@co0ontty/wand 4.100.0 → 4.101.0
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/dist/ai-team-runner.d.ts +1 -1
- package/dist/ai-team-runner.js +3 -3
- package/dist/build-info.json +3 -3
- package/dist/conversation-service.d.ts +11 -1
- package/dist/conversation-service.js +56 -9
- package/dist/conversation-sync-contract.d.ts +27 -0
- package/dist/conversation-sync-contract.js +23 -0
- package/dist/conversation-sync.d.ts +11 -0
- package/dist/conversation-sync.js +85 -0
- package/dist/conversation-types.d.ts +1 -0
- package/dist/server-conversation-routes.js +17 -0
- package/dist/server-session-context.js +1 -1
- package/dist/server-session-list-routes.js +2 -2
- package/dist/server.js +4 -1
- package/dist/session-registry.d.ts +6 -1
- package/dist/session-registry.js +29 -0
- package/dist/web-ui/content/ai-teams.js +11 -11
- package/dist/web-ui/content/module-manifest.json +1 -1
- package/dist/web-ui/content/modules/{5d4915f6e1661d23 → 08c7b047195f138d}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{621b2383696b9d7d → 09ef1bb1d195d727}/host.js +1 -1
- package/dist/web-ui/content/modules/{d1185edafb2a3fc6 → 119874145414688d}/shell-file-panel-drawer.js +1 -1
- package/dist/web-ui/content/modules/{e2263673e53a298c → 15bcc550ef9fd5b7}/host.js +1 -1
- package/dist/web-ui/content/modules/{b9b78d6b75945e66 → 1a7303b87763fd43}/employee-profile.js +1 -1
- package/dist/web-ui/content/modules/{bbe7c6f6eda87002 → 1d35739f634745f6}/task-board-host.js +1 -1
- package/dist/web-ui/content/modules/2099d37d57856cbd/brand-identity.js +1 -0
- package/dist/web-ui/content/modules/{bc56ae7841b21ca6 → 222f48948517167e}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{51fc769946593cfa → 2981483671797b92}/chunk.js +1 -1
- package/dist/web-ui/content/modules/2d6339b2f6c2e2d0/host.js +1 -0
- package/dist/web-ui/content/modules/{a04036215e751a32 → 2edc19639ac1bd4b}/chunk.js +1 -1
- package/dist/web-ui/content/modules/2f88fc37c6105f7e/sidebar-peek.js +1 -0
- package/dist/web-ui/content/modules/31124fb7ee6939df/host.js +1 -0
- package/dist/web-ui/content/modules/31b28c5d0019c363/host-bridge.js +1 -0
- package/dist/web-ui/content/modules/{784eef1d52221e7d → 321bd9c755bc30fc}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{e7780cd2afeb29d9 → 32c461164a1b364c}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3b975071451386a4 → 35a8fd2cfd31d7a0}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{ca37cc312813dd4f → 3601736ae2d678ef}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{dfb9876d670c5365 → 36bd608366c56b72}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a919e64032fe3acc → 36ce8123a2079807}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{371e120f3773f783 → 36e5c3a6d6705358}/employee-card.js +1 -1
- package/dist/web-ui/content/modules/3700d99c54d3c400/host.js +1 -0
- package/dist/web-ui/content/modules/{3d0ec18974ad2b11 → 38917c19e2cf1702}/chunk.js +1 -1
- package/dist/web-ui/content/modules/3ae29086b227f9d9/markdown.js +1 -0
- package/dist/web-ui/content/modules/{07b7b195f2e59a16 → 42c439d3acfe22bd}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{258f0487e8621dcc → 42db858e4417c702}/chunk.js +1 -1
- package/dist/web-ui/content/modules/443dc81eac29f233/host.js +1 -0
- package/dist/web-ui/content/modules/{48b00eccb3067884 → 456634525d44777d}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{96f4a041d5cf046b → 47419445e0aaa3cc}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{2409b362681d91d6 → 476ff7911bce1a38}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{950a2f28bc128f94 → 4a9a3e1f87b2c32b}/dialog-modal.js +1 -1
- package/dist/web-ui/content/modules/{405a98ab11edb2c1 → 4af10e1f8a789204}/runtime.js +54 -54
- package/dist/web-ui/content/modules/{0cb64ca968a6d25d → 4b9deeeb77570db3}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{280457daf6b6fe61 → 4d4870f20eb1c52d}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3d050c621f552e20 → 4f30a913cc5b3f89}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a1e9344b3fbd11ae → 5395fa57a47e9b96}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{0a04baa27e4fc9e3 → 544dc812abdfbbb8}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{9638c7ba97db8755 → 5513bcbacdf44588}/notice-view.js +1 -1
- package/dist/web-ui/content/modules/{b3c8d461cf58ea32 → 55b75ebcf6924001}/host.js +1 -1
- package/dist/web-ui/content/modules/{9a12d5f9e5fef729 → 58836e616e6d12ff}/workspaces-panel.js +1 -1
- package/dist/web-ui/content/modules/{f555ceb3720822c5 → 5c94fb2b7abcd1a5}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a763fe780816708f → 5df1b522f5d3c99d}/host.js +1 -1
- package/dist/web-ui/content/modules/{73a96d56bc1484de → 622a8d12c4c622bf}/host.js +1 -1
- package/dist/web-ui/content/modules/626c7ce0aa1714b0/host.js +1 -0
- package/dist/web-ui/content/modules/{b0b078bcfc9085a6 → 665e81fe210f1b7a}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{26b6ff004618750f → 6f341fe3e8aee844}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3d1f076ddfc09771 → 72b13a7486b6d437}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a9114b269e25b3f5 → 7375574a2ea42740}/chunk.js +1 -1
- package/dist/web-ui/content/modules/76adde4019731df1/chunk.js +1 -0
- package/dist/web-ui/content/modules/{8676143ae232d8b6 → 78a46adbf9807f89}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{0bd3cebfdbc60d19 → 7925b65867b7aa4a}/queue-view-adapter.js +1 -1
- package/dist/web-ui/content/modules/{2837772e09c2b62d → 8198bfd269c0caca}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{ea7cd328cb5cf7e0 → 82e40fdf0abfb8cd}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{5e50a3c3c546d824 → 84b79a33c64e146c}/chunk.js +1 -1
- package/dist/web-ui/content/modules/8a4f0ef2c0812af6/chunk.js +4 -0
- package/dist/web-ui/content/modules/{8c4258e7c35e9eca → 8a6844a4251a1271}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{da8314e267c164ed → 8bd214570df4a7a0}/host.js +1 -1
- package/dist/web-ui/content/modules/{29c912ef59696172 → 8bff85e108320aab}/panel.js +1 -1
- package/dist/web-ui/content/modules/{5444c4f9260fcb2f → 8ce71665ae55ccf1}/toast-region.js +1 -1
- package/dist/web-ui/content/modules/{ad896e0a52316ead → 8e29056fb56439f7}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{d0a0f9214f3bbf71 → 905f8bc3f8a3efb8}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{f248ee3b31df4034 → 96dd661559b67ebf}/chunk.js +1 -1
- package/dist/web-ui/content/modules/988e01b67e6f1883/composer-surface-adapter.js +1 -0
- package/dist/web-ui/content/modules/{c4705a6af423d824 → 98c14fc0474455a5}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a2263c03ce67440a → 9d48d1ea3c9228bd}/library-bridge.js +1 -1
- package/dist/web-ui/content/modules/{23eea6861975478b → 9e754b01fa4207fb}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{ddcaaa62f1b7f049 → 9f33acc1c4284e03}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{b9445d806edca559 → a098c7b1aa4e2f6b}/sha256.js +1 -1
- package/dist/web-ui/content/modules/{abe3642ec4dba601 → a4af270960a39ea6}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{91f4ec7a3631129c → a4dca2ffaf656d3c}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{97faa837aeaaff64 → a975ff38c3d43ba8}/workspace-window.js +1 -1
- package/dist/web-ui/content/modules/{2575e08b75b1a192 → aab92f2990a7185f}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{e8f9f6d46ef4bb53 → acb21c7e7fd6cb67}/page.js +1 -1
- package/dist/web-ui/content/modules/{23178d02e631d065 → ad1136919a65fc6e}/host.js +1 -1
- package/dist/web-ui/content/modules/{007197d061c2a565 → b0254a2d3652a925}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{4ca8f7b400b83127 → b0c4eed46c1b6ad4}/chat-render.js +1 -1
- package/dist/web-ui/content/modules/{7aab1455fc7348e1 → b1d43ed06a5d1a57}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{4718bec8ce29956e → b38924f45bfa71d6}/chunk.js +1 -1
- package/dist/web-ui/content/modules/b550260fc9c5363a/dropdown-surface.js +1 -0
- package/dist/web-ui/content/modules/{c2e0b78e4a6b1a18 → b62294e53dcb3147}/host.js +1 -1
- package/dist/web-ui/content/modules/{9a4f713719354002 → b937f1a939618be9}/host.js +1 -1
- package/dist/web-ui/content/modules/{65e98a2bcd16cd79 → bce467c603299460}/chunk.js +1 -1
- package/dist/web-ui/content/modules/c138b442c1682189/panel-host.js +1 -0
- package/dist/web-ui/content/modules/{93b428761a02ca66 → c152782274c04fad}/chunk.js +1 -1
- package/dist/web-ui/content/modules/c32d14632487364f/group-editor.js +1 -0
- package/dist/web-ui/content/modules/{0b00a661913662d4 → c422f47fd13dc4bc}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{0500b57b86317246 → c6d0a1b2753a4883}/host.js +1 -1
- package/dist/web-ui/content/modules/{28795c8bb7f4e2e8 → c72c4f1d47c3726d}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{2aa0bc0eba53a5c9 → c81a3d95b14cdcd4}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{0128a9a2c361da59 → cd22aa55f6cc5276}/chunk.js +1 -1
- package/dist/web-ui/content/modules/cdff6e7f72879c88/progress.js +1 -0
- package/dist/web-ui/content/modules/{0206d2425a3eb375 → cf715621edb1d12e}/chunk.js +1 -1
- package/dist/web-ui/content/modules/cfee7b0d79587d59/home.js +6 -0
- package/dist/web-ui/content/modules/{82f9fed7fd7ffd9f → e33f6d66a02ec26c}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{fd2a62ffb5f81f09 → e5e93fe5304838a1}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{cdb1909af2179a41 → e61136c22675ec7d}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{f41d42a01dc09373 → e95b60ab18a79499}/login-visual.js +1 -1
- package/dist/web-ui/content/modules/{a120182be2ef9632 → eecaebc5482ee203}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{b0d4d1f8ff0fae38 → eece3c2d2374e8f7}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{4dd52ad71d002eab → ef7f76b551fdc619}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{45e8d613816cdec5 → f55031a02775c89e}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{9a0704236531e38e → f6f86d43c12b0864}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{37767c3c41b8d8a8 → f90f80d7207dff1f}/host.js +1 -1
- package/dist/web-ui/content/modules/fbe35e7ddd7384fa/host.js +1 -0
- package/dist/web-ui/embedded-assets.d.ts +407 -407
- package/dist/web-ui/embedded-assets.js +4 -4
- package/dist/ws-broadcast.d.ts +2 -1
- package/dist/ws-broadcast.js +1 -1
- package/package.json +1 -1
- package/dist/web-ui/content/modules/0261c50fee52b437/host.js +0 -1
- package/dist/web-ui/content/modules/05889845b99c95dd/host.js +0 -1
- package/dist/web-ui/content/modules/19a7b932484a64ca/host-bridge.js +0 -1
- package/dist/web-ui/content/modules/1f88294162059296/home.js +0 -6
- package/dist/web-ui/content/modules/2be38bfbed614f65/host.js +0 -1
- package/dist/web-ui/content/modules/360db1263b60f857/composer-surface-adapter.js +0 -1
- package/dist/web-ui/content/modules/364b10aceecf7ab9/panel-host.js +0 -1
- package/dist/web-ui/content/modules/5f4ea7ad706b19f7/progress.js +0 -1
- package/dist/web-ui/content/modules/71205ec0b1cf554d/host.js +0 -1
- package/dist/web-ui/content/modules/76b953fe1f34c421/dropdown-surface.js +0 -1
- package/dist/web-ui/content/modules/8492b5592532e563/chunk.js +0 -1
- package/dist/web-ui/content/modules/890cdc256b49e26c/host.js +0 -1
- package/dist/web-ui/content/modules/9d7b92a76b2d54ab/sidebar-peek.js +0 -1
- package/dist/web-ui/content/modules/a48f540d6a228012/chunk.js +0 -4
- package/dist/web-ui/content/modules/c8ee697d1dd6e302/group-editor.js +0 -1
- package/dist/web-ui/content/modules/d948ac122dc34acc/markdown.js +0 -1
- package/dist/web-ui/content/modules/edb31a89f667eddf/brand-identity.js +0 -1
- package/dist/web-ui/content/modules/f9111c80a2c26147/host.js +0 -1
package/dist/web-ui/content/modules/{9a12d5f9e5fef729 → 58836e616e6d12ff}/workspaces-panel.js
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Vt}from"/assets/modules/5cd5d3d65d966c5f/chunk.js";import{a as zt,b as Ft}from"/assets/modules/19d3bc36fa1e9160/chunk.js";import{a as Ma,b as kt,c as gt,d as ta,e as za,f as Rt,g as Tt,h as It,i as Nt,j as Wt,k as Ct,l as Fa,m as xt,n as $t,o as ka,p as Et,q as Dt}from"/assets/modules/fd2a62ffb5f81f09/chunk.js";import"/assets/modules/28795c8bb7f4e2e8/chunk.js";import{shared97_A as Ut,shared97_B as Qt,shared97_C as Yt,shared97_D as Jt,shared97_E as Ka,shared97_F as Va,shared97_a as na,shared97_b as Ha,shared97_c as ja,shared97_d as ya,shared97_e as Bt,shared97_f as ha,shared97_h as Xe,shared97_i as Fe,shared97_j as Ue,shared97_k as Qe,shared97_l as Ye,shared97_m as Ot,shared97_n as ba,shared97_o as wa,shared97_p as Ze,shared97_q as Gt,shared97_r as Ht,shared97_s as jt,shared97_u as Sa,shared97_v as qt,shared97_w as va,shared97_x as Kt,shared97_z as _t}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared105_b as Lt}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared98_p as qa,shared98_q as Mt,shared98_v as _e,shared98_x as sa,shared98_y as ra}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared81_a as Ga}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared100_a as St,shared100_b as Oa,shared100_c as fa,shared100_d as vt}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared101_e as bt,shared101_f as ua,shared101_h as wt}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared103_a as $e}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared91_b as yt,shared91_d as ht}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared84_a as Pt}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared112_a as Xt,shared112_c as Zt}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared113_a as Ea}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared104_a as Be,shared104_e as aa}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared65_a as ue}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared114_b as La}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared93_a as At}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared50_k as pt,shared50_r as ut}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared86_a as be}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{a as ft}from"/assets/modules/c4705a6af423d824/chunk.js";import{a as Pa}from"/assets/modules/258f0487e8621dcc/chunk.js";import"/assets/modules/2aa0bc0eba53a5c9/chunk.js";import"/assets/modules/3d050c621f552e20/chunk.js";import{a as Aa}from"/assets/modules/cdb1909af2179a41/chunk.js";import{d as pa}from"/assets/modules/4718bec8ce29956e/chunk.js";import{shared118_a as ga}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared46_a as Ba}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared95_a as nt}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared23_b as ct,shared23_d as dt}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared88_a as lt}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared24_a as da}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared54_a as _,shared54_b as he}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared41_c as b}from"/assets/modules/405a98ab11edb2c1/runtime.js";import"/assets/modules/ad896e0a52316ead/chunk.js";import{b as it}from"/assets/modules/91f4ec7a3631129c/chunk.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared26_b as tt}from"/assets/modules/405a98ab11edb2c1/runtime.js";import"/assets/modules/9a0704236531e38e/chunk.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared55_a as Da}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared12_a as te}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared60_a as X}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import"/assets/modules/0b00a661913662d4/chunk.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{a as ma}from"/assets/modules/bc56ae7841b21ca6/chunk.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared42_B as Ve,shared42_i as st,shared42_j as rt,shared42_m as ot}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared47_a as mt}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared61_a as D}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared13_zb as ze}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared11_a as ca}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared5_c as ve}from"/assets/modules/405a98ab11edb2c1/runtime.js";async function Ra({title:e,description:s,action:i,danger:f=!0,trigger:c}){(c?.querySelector(".workspace-task-main,.workspace-row-main")??c?.querySelector("button,a[href]"))?.focus({preventScroll:!0});let g=await Pt.dialog({title:e,description:s,actions:[{label:"\u53D6\u6D88",value:!1,autoFocus:!0},{label:i,value:!0,kind:f?"danger":"secondary"}]});return g.dismissed!==!0&&!!g.action}function _a(e,s,i,f){return e===0?Promise.resolve(!1):Ra({title:`\u6E05\u7A7A${s}\u7684\u4F1A\u8BDD\uFF1F`,trigger:i,description:f??`\u5C06\u5220\u9664\u5F53\u524D\u5217\u51FA\u7684\u5168\u90E8 ${e} \u4E2A\u4F1A\u8BDD\uFF0C\u5305\u62EC\u6B63\u5728\u8FD0\u884C\u7684\u4F1A\u8BDD\uFF0C\u65E0\u6CD5\u64A4\u9500\u3002\u4EFB\u52A1\u548C\u5DE5\u4F5C\u533A\u4F1A\u4FDD\u7559\u3002`,action:"\u786E\u8BA4\u6E05\u7A7A"})}var o=ve(ca(),1);var Ge=ve(ca(),1);function en(e){let s=e.commits[0]?.subject.trim();return s&&s!==e.taskName.trim()?`${e.taskName} \xB7 ${s}`:e.taskName||s||e.branch}function an(e,s,i){let f=new Set(i),c=s.worktrees.filter(m=>f.has(m.taskId)&&m.actionable);if(!s.targetBranch)throw new Error("\u65E0\u6CD5\u8BC6\u522B\u9879\u76EE\u9ED8\u8BA4\u5206\u652F\u3002");if(c.length===0)throw new Error("\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6709\u5F85\u5408\u5E76\u6539\u52A8\u7684 Worktree\u3002");let g=c.map((m,A)=>({order:A+1,task:m.taskName,branch:m.branch,worktreePath:m.path,baseRef:m.baseRef||null,uncommittedChanges:m.hasUncommittedChanges,potentialConflict:m.hasConflicts,commitsAhead:m.aheadCount,commitSubjects:m.commits.map(W=>W.subject).filter(Boolean)}));return{system:[`\u4F60\u662F Wand \u4E3A\u9879\u76EE\u300C${e.name}\u300D\u542F\u52A8\u7684 Worktree \u5408\u5E76 Agent\u3002`,`\u9879\u76EE\u4E3B\u5DE5\u4F5C\u533A\uFF1A${s.repoRoot||e.cwd}`,`\u552F\u4E00\u76EE\u6807\u5206\u652F\uFF1A${s.targetBranch}`,"","## \u6267\u884C\u8981\u6C42","1. \u5148\u8BFB\u53D6\u9879\u76EE\u5185\u9002\u7528\u7684 AGENTS.md/agent.md \u4E0E\u4ED3\u5E93\u7EA6\u5B9A\uFF0C\u518D\u68C0\u67E5\u4E3B\u5DE5\u4F5C\u533A\u548C\u6BCF\u4E2A Worktree \u7684\u771F\u5B9E Git \u72B6\u6001\u3002","2. \u5BF9\u6709\u672A\u63D0\u4EA4\u6539\u52A8\u7684 Worktree\uFF0C\u5148\u7406\u89E3\u6539\u52A8\u3001\u5B8C\u6210\u5FC5\u8981\u9A8C\u8BC1\uFF0C\u5E76\u521B\u5EFA\u6E05\u6670\u7684\u63D0\u4EA4\uFF1B\u4E0D\u5F97\u4E22\u5F03\u6216\u8986\u76D6\u73B0\u6709\u7528\u6237\u6539\u52A8\u3002",`3. \u53EA\u628A\u6E05\u5355\u4E2D\u7684\u5206\u652F\u5408\u5E76\u5230 ${s.targetBranch}\uFF0C\u6309\u6E05\u5355\u987A\u5E8F\u9010\u4E2A\u5904\u7406\uFF1B\u4E0D\u8981\u6539\u4E3A\u5176\u4ED6\u76EE\u6807\u5206\u652F\u3002`,"4. \u9047\u5230\u51B2\u7A81\u65F6\u7406\u89E3\u53CC\u65B9\u610F\u56FE\u540E\u89E3\u51B3\u5E76\u9A8C\u8BC1\uFF1B\u82E5\u65E0\u6CD5\u5B89\u5168\u5224\u65AD\uFF0C\u505C\u6B62\u5728\u53EF\u6062\u590D\u72B6\u6001\u5E76\u6E05\u695A\u62A5\u544A\uFF0C\u4E0D\u8981\u5F3A\u884C\u8986\u76D6\u3002","5. \u5408\u5E76\u5B8C\u6210\u540E\u8FD0\u884C\u4E0E\u6539\u52A8\u76F8\u79F0\u7684\u6D4B\u8BD5\u3002\u4E0D\u8981 push\uFF0C\u4E5F\u4E0D\u8981\u5220\u9664 Worktree\u3001\u4EFB\u52A1\u5206\u652F\u6216 Wand \u7684\u9879\u76EE\u4EFB\u52A1\u8BB0\u5F55\u3002","6. \u6700\u540E\u6C47\u62A5\u6BCF\u4E2A Worktree \u7684\u63D0\u4EA4/\u5408\u5E76\u7ED3\u679C\u3001\u6D4B\u8BD5\u7ED3\u679C\uFF0C\u4EE5\u53CA\u4EFB\u4F55\u4ECD\u9700\u4EBA\u5DE5\u5904\u7406\u7684\u95EE\u9898\u3002"].join(`
|
|
1
|
+
import{a as Vt}from"/assets/modules/5cd5d3d65d966c5f/chunk.js";import{a as zt,b as Ft}from"/assets/modules/19d3bc36fa1e9160/chunk.js";import{a as Ma,b as kt,c as gt,d as ta,e as za,f as Rt,g as Tt,h as It,i as Nt,j as Wt,k as Ct,l as Fa,m as xt,n as $t,o as ka,p as Et,q as Dt}from"/assets/modules/e5e93fe5304838a1/chunk.js";import"/assets/modules/c72c4f1d47c3726d/chunk.js";import{shared97_A as Ut,shared97_B as Qt,shared97_C as Yt,shared97_D as Jt,shared97_E as Ka,shared97_F as Va,shared97_a as na,shared97_b as Ha,shared97_c as ja,shared97_d as ya,shared97_e as Bt,shared97_f as ha,shared97_h as Xe,shared97_i as Fe,shared97_j as Ue,shared97_k as Qe,shared97_l as Ye,shared97_m as Ot,shared97_n as ba,shared97_o as wa,shared97_p as Ze,shared97_q as Gt,shared97_r as Ht,shared97_s as jt,shared97_u as Sa,shared97_v as qt,shared97_w as va,shared97_x as Kt,shared97_z as _t}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared105_b as Lt}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared98_p as qa,shared98_q as Mt,shared98_v as _e,shared98_x as sa,shared98_y as ra}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared81_a as Ga}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared100_a as St,shared100_b as Oa,shared100_c as fa,shared100_d as vt}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared101_e as bt,shared101_f as ua,shared101_h as wt}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared103_a as $e}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared91_b as yt,shared91_d as ht}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared84_a as Pt}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared112_a as Xt,shared112_c as Zt}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared113_a as Ea}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared104_a as Be,shared104_e as aa}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared65_a as ue}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared114_b as La}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared93_a as At}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared50_k as pt,shared50_r as ut}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared86_a as be}from"/assets/modules/4af10e1f8a789204/runtime.js";import{a as ft}from"/assets/modules/98c14fc0474455a5/chunk.js";import{a as Pa}from"/assets/modules/42db858e4417c702/chunk.js";import"/assets/modules/c81a3d95b14cdcd4/chunk.js";import"/assets/modules/4f30a913cc5b3f89/chunk.js";import{a as Aa}from"/assets/modules/e61136c22675ec7d/chunk.js";import{d as pa}from"/assets/modules/b38924f45bfa71d6/chunk.js";import{shared118_a as ga}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared46_a as Ba}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared95_a as nt}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared23_b as ct,shared23_d as dt}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared88_a as lt}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared24_a as da}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared54_a as _,shared54_b as he}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared41_c as b}from"/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/8e29056fb56439f7/chunk.js";import{b as it}from"/assets/modules/a4dca2ffaf656d3c/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared26_b as tt}from"/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/f6f86d43c12b0864/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared55_a as Da}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared12_a as te}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared60_a as X}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/c422f47fd13dc4bc/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{a as ma}from"/assets/modules/222f48948517167e/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared42_B as Ve,shared42_i as st,shared42_j as rt,shared42_m as ot}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared47_a as mt}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared61_a as D}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared13_zb as ze}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared11_a as ca}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared5_c as ve}from"/assets/modules/4af10e1f8a789204/runtime.js";async function Ra({title:e,description:s,action:i,danger:f=!0,trigger:c}){(c?.querySelector(".workspace-task-main,.workspace-row-main")??c?.querySelector("button,a[href]"))?.focus({preventScroll:!0});let g=await Pt.dialog({title:e,description:s,actions:[{label:"\u53D6\u6D88",value:!1,autoFocus:!0},{label:i,value:!0,kind:f?"danger":"secondary"}]});return g.dismissed!==!0&&!!g.action}function _a(e,s,i,f){return e===0?Promise.resolve(!1):Ra({title:`\u6E05\u7A7A${s}\u7684\u4F1A\u8BDD\uFF1F`,trigger:i,description:f??`\u5C06\u5220\u9664\u5F53\u524D\u5217\u51FA\u7684\u5168\u90E8 ${e} \u4E2A\u4F1A\u8BDD\uFF0C\u5305\u62EC\u6B63\u5728\u8FD0\u884C\u7684\u4F1A\u8BDD\uFF0C\u65E0\u6CD5\u64A4\u9500\u3002\u4EFB\u52A1\u548C\u5DE5\u4F5C\u533A\u4F1A\u4FDD\u7559\u3002`,action:"\u786E\u8BA4\u6E05\u7A7A"})}var o=ve(ca(),1);var Ge=ve(ca(),1);function en(e){let s=e.commits[0]?.subject.trim();return s&&s!==e.taskName.trim()?`${e.taskName} \xB7 ${s}`:e.taskName||s||e.branch}function an(e,s,i){let f=new Set(i),c=s.worktrees.filter(m=>f.has(m.taskId)&&m.actionable);if(!s.targetBranch)throw new Error("\u65E0\u6CD5\u8BC6\u522B\u9879\u76EE\u9ED8\u8BA4\u5206\u652F\u3002");if(c.length===0)throw new Error("\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6709\u5F85\u5408\u5E76\u6539\u52A8\u7684 Worktree\u3002");let g=c.map((m,A)=>({order:A+1,task:m.taskName,branch:m.branch,worktreePath:m.path,baseRef:m.baseRef||null,uncommittedChanges:m.hasUncommittedChanges,potentialConflict:m.hasConflicts,commitsAhead:m.aheadCount,commitSubjects:m.commits.map(W=>W.subject).filter(Boolean)}));return{system:[`\u4F60\u662F Wand \u4E3A\u9879\u76EE\u300C${e.name}\u300D\u542F\u52A8\u7684 Worktree \u5408\u5E76 Agent\u3002`,`\u9879\u76EE\u4E3B\u5DE5\u4F5C\u533A\uFF1A${s.repoRoot||e.cwd}`,`\u552F\u4E00\u76EE\u6807\u5206\u652F\uFF1A${s.targetBranch}`,"","## \u6267\u884C\u8981\u6C42","1. \u5148\u8BFB\u53D6\u9879\u76EE\u5185\u9002\u7528\u7684 AGENTS.md/agent.md \u4E0E\u4ED3\u5E93\u7EA6\u5B9A\uFF0C\u518D\u68C0\u67E5\u4E3B\u5DE5\u4F5C\u533A\u548C\u6BCF\u4E2A Worktree \u7684\u771F\u5B9E Git \u72B6\u6001\u3002","2. \u5BF9\u6709\u672A\u63D0\u4EA4\u6539\u52A8\u7684 Worktree\uFF0C\u5148\u7406\u89E3\u6539\u52A8\u3001\u5B8C\u6210\u5FC5\u8981\u9A8C\u8BC1\uFF0C\u5E76\u521B\u5EFA\u6E05\u6670\u7684\u63D0\u4EA4\uFF1B\u4E0D\u5F97\u4E22\u5F03\u6216\u8986\u76D6\u73B0\u6709\u7528\u6237\u6539\u52A8\u3002",`3. \u53EA\u628A\u6E05\u5355\u4E2D\u7684\u5206\u652F\u5408\u5E76\u5230 ${s.targetBranch}\uFF0C\u6309\u6E05\u5355\u987A\u5E8F\u9010\u4E2A\u5904\u7406\uFF1B\u4E0D\u8981\u6539\u4E3A\u5176\u4ED6\u76EE\u6807\u5206\u652F\u3002`,"4. \u9047\u5230\u51B2\u7A81\u65F6\u7406\u89E3\u53CC\u65B9\u610F\u56FE\u540E\u89E3\u51B3\u5E76\u9A8C\u8BC1\uFF1B\u82E5\u65E0\u6CD5\u5B89\u5168\u5224\u65AD\uFF0C\u505C\u6B62\u5728\u53EF\u6062\u590D\u72B6\u6001\u5E76\u6E05\u695A\u62A5\u544A\uFF0C\u4E0D\u8981\u5F3A\u884C\u8986\u76D6\u3002","5. \u5408\u5E76\u5B8C\u6210\u540E\u8FD0\u884C\u4E0E\u6539\u52A8\u76F8\u79F0\u7684\u6D4B\u8BD5\u3002\u4E0D\u8981 push\uFF0C\u4E5F\u4E0D\u8981\u5220\u9664 Worktree\u3001\u4EFB\u52A1\u5206\u652F\u6216 Wand \u7684\u9879\u76EE\u4EFB\u52A1\u8BB0\u5F55\u3002","6. \u6700\u540E\u6C47\u62A5\u6BCF\u4E2A Worktree \u7684\u63D0\u4EA4/\u5408\u5E76\u7ED3\u679C\u3001\u6D4B\u8BD5\u7ED3\u679C\uFF0C\u4EE5\u53CA\u4EFB\u4F55\u4ECD\u9700\u4EBA\u5DE5\u5904\u7406\u7684\u95EE\u9898\u3002"].join(`
|
|
2
2
|
`),message:["## \u672C\u6B21\u8981\u5408\u5E76\u7684 Worktree\uFF08\u6309\u6B64\u987A\u5E8F\u5904\u7406\uFF09",JSON.stringify(g,null,2)].join(`
|
|
3
3
|
`)}}var C=ve(ze(),1),fn={ready:{label:"\u5F85\u5408\u5E76"},dirty:{label:"\u6709\u672A\u63D0\u4EA4\u6539\u52A8"},conflict:{label:"\u53EF\u80FD\u51B2\u7A81"},empty:{label:"\u5DF2\u540C\u6B65"},unavailable:{label:"\u4E0D\u53EF\u7528"}};function kn({worktree:e,selected:s,first:i,onToggle:f}){let c=fn[e.state],g=!e.actionable,m=[e.aheadCount>0?`${e.aheadCount} commits`:"",e.hasUncommittedChanges?"\u5DE5\u4F5C\u533A\u6709\u6539\u52A8":"",e.hasConflicts?"\u9700\u5904\u7406\u51B2\u7A81":""].filter(Boolean).join(" \xB7 ")||e.reason||"\u6CA1\u6709\u65B0\u7684\u5F85\u5408\u5E76\u6539\u52A8";return(0,C.jsx)(Ve,{children:(0,C.jsx)(ga,{checked:s,disabled:g,"data-wand-autofocus":i?"":void 0,onChange:f,children:(0,C.jsxs)(D,{vertical:!0,gap:4,children:[(0,C.jsx)(X.Text,{strong:!0,children:en(e)}),(0,C.jsx)(X.Text,{code:!0,title:e.path,children:e.branch}),(0,C.jsx)(X.Text,{type:"secondary",children:m}),(0,C.jsx)(nt,{color:e.state==="ready"?"success":e.state==="dirty"||e.state==="conflict"?"warning":void 0,children:c.label})]})})})}function tn({open:e,workspace:s,repository:i=ue,onStartAgent:f,onDismiss:c}){let[g,m]=Ge.useState(null),[A,W]=Ge.useState(new Set),[I,u]=Ge.useState(!1),[v,w]=Ge.useState(!1),[q,U]=Ge.useState("");Ge.useEffect(()=>{if(!e)return;let k=new AbortController;return m(null),W(new Set),u(!0),w(!1),U(""),i.listWorktrees(s.id,{signal:k.signal}).then(G=>{k.signal.aborted||m(G)}).catch(G=>{k.signal.aborted||U(be(G,"\u65E0\u6CD5\u8BFB\u53D6\u9879\u76EE Worktree\u3002"))}).finally(()=>{k.signal.aborted||u(!1)}),()=>k.abort()},[e,i,s.id]);let x=g?.worktrees.filter(k=>k.actionable)??[],N=x.filter(k=>A.has(k.taskId)).length;function M(k){W(G=>{let $=new Set(G);return $.has(k)?$.delete(k):$.add(k),$})}function J(){if(N===x.length){W(new Set);return}W(new Set(x.map(k=>k.taskId)))}async function K(){if(!(!g||N===0||v)){w(!0),U("");try{let k=an(s,g,[...A]);await f(k),c()}catch(k){U(be(k,"\u65E0\u6CD5\u542F\u52A8 Worktree \u5408\u5E76 Agent\u3002"))}finally{w(!1)}}}let O=g?.targetBranch||"\u9879\u76EE\u9ED8\u8BA4\u5206\u652F",L=g?.worktrees.length??s.worktreeCount??0;return(0,C.jsx)(lt,{open:e,onOpenChange:k=>{k||c()},title:"\u9879\u76EE Worktrees",description:`${s.name} \xB7 ${L} \u4E2A Worktree \xB7 \u9ED8\u8BA4\u5408\u5E76\u5230 ${O}`,className:"wand-task-library-dialog wand-worktree-modal",closeLabel:"\u5173\u95ED\u9879\u76EE Worktree",testId:"workspace-worktree-dialog",dismissable:!v,children:(0,C.jsxs)(D,{vertical:!0,gap:16,"aria-busy":I||v,children:[(0,C.jsx)(Da,{type:"info",showIcon:!0,icon:(0,C.jsx)(b,{name:"branch",size:18,strokeWidth:1.8}),title:`\u5408\u5E76\u76EE\u6807\uFF1A${O}`,description:(0,C.jsx)(X.Text,{code:!0,style:{overflowWrap:"anywhere"},children:g?.repoRoot||s.cwd})}),I?(0,C.jsx)(mt,{tip:"\u6B63\u5728\u68C0\u67E5\u6240\u6709 Worktree\u2026",children:(0,C.jsx)("div",{style:{minHeight:100},role:"status",children:"\u6B63\u5728\u68C0\u67E5\u6240\u6709 Worktree\u2026"})}):g&&g.worktrees.length>0?(0,C.jsx)(ft,{size:"small",title:"\u9009\u62E9\u8981\u4EA4\u7ED9 Agent \u5408\u5E76\u7684 Worktree",extra:x.length>1?(0,C.jsx)(_,{kind:"ghost",type:"button",disabled:v,onClick:J,children:N===x.length?"\u53D6\u6D88\u5168\u9009":"\u5168\u9009\u53EF\u5408\u5E76\u9879"}):null,children:(0,C.jsx)(Pa,{size:"small",dataSource:[...g.worktrees],renderItem:(k,G)=>(0,C.jsx)(Pa.Item,{children:(0,C.jsx)(kn,{worktree:k,selected:A.has(k.taskId),first:G===0,onToggle:()=>M(k.taskId)})},k.taskId)})}):g?(0,C.jsx)(Aa,{image:Aa.PRESENTED_IMAGE_SIMPLE,description:"\u8FD9\u4E2A\u9879\u76EE\u8FD8\u6CA1\u6709\u72EC\u7ACB Worktree\u3002\u8BF7\u5148\u65B0\u5EFA\u4EFB\u52A1\u3002"}):null,q?(0,C.jsx)(Da,{type:"error",showIcon:!0,role:"alert",title:q}):null,(0,C.jsxs)(D,{component:"footer","data-slot":"worktree-footer",justify:"space-between",align:"center",gap:12,wrap:!0,children:[(0,C.jsx)(X.Text,{type:"secondary",children:N>0?`\u5DF2\u9009\u62E9 ${N} \u4E2A`:"\u9009\u62E9\u540E\u4F1A\u542F\u52A8\u4E00\u4E2A\u6258\u7BA1 Agent"}),(0,C.jsxs)(tt,{children:[(0,C.jsx)(_,{kind:"ghost",disabled:v,onClick:c,children:"\u53D6\u6D88"}),(0,C.jsx)(_,{kind:"primary",disabled:I||v||N===0,onClick:()=>{K()},children:v?"\u6B63\u5728\u542F\u52A8 Agent\u2026":`\u542F\u52A8 Agent \u5408\u5E76${N?` ${N} \u4E2A`:""}`})]})]})]})})}var He=ve(ca(),1);var nn=ve(ca(),1);var Ua=ve(ze(),1);function sn({employee:e}){let[s,i]=nn.useState(null),f=e.avatar===s?"":e.avatar;return(0,Ua.jsx)("span",{className:"sidebar-employee-avatar",onErrorCapture:c=>{c.target instanceof HTMLImageElement&&i(e.avatar??"")},children:(0,Ua.jsx)(pt,{employee:{...e,avatar:f},provider:"",size:"sm"})})}var R=ve(ze(),1);function rn({entries:e,employees:s,displayMode:i,query:f="",disabled:c=!1,listLoading:g=!1,listError:m=!1,liveTitles:A,selectedSessionId:W,now:I,onOpen:u,onStartConversation:v,onArchiveSession:w,onDeleteSession:q,onOpenConversation:U}){let x=He.useMemo(()=>Ut(e,{employees:s,activeOnly:i==="active",selectedSessionId:W,limit:Number.POSITIVE_INFINITY}),[e,s,i,W]),N=He.useCallback(M=>{v?.(),Be.open(M?{initialEmployeeId:M}:{})},[v]);return(0,R.jsxs)("section",{className:"sidebar-recent","aria-label":"\u6700\u8FD1\u4F1A\u8BDD",children:[(0,R.jsxs)(D,{align:"center",justify:"space-between",gap:"small",className:"sidebar-section-head",style:{paddingBlock:8},children:[(0,R.jsx)(X.Text,{strong:!0,className:"sidebar-section-title",children:"\u6700\u8FD1\u4F1A\u8BDD"}),(0,R.jsx)(he,{className:"sidebar-section-add",title:"\u65B0\u5EFA\u5DE5\u4F5C","aria-label":"\u65B0\u5EFA\u5DE5\u4F5C",disabled:c,onClick:()=>N(),children:(0,R.jsx)(b,{name:"plus",size:16})})]}),g&&x.length===0?(0,R.jsx)("div",{role:"status","aria-label":"\u6B63\u5728\u52A0\u8F7D\u6700\u8FD1\u5BF9\u8BDD","aria-busy":"true",children:(0,R.jsx)(Ve,{children:(0,R.jsx)(ma,{active:!0,title:!1,paragraph:{rows:2}})})}):x.length===0&&(m||f.trim())?null:x.length===0?(0,R.jsx)("p",{className:"sidebar-section-empty",children:i==="active"?"\u73B0\u5728\u6CA1\u6709\u6D3B\u52A8\u4F1A\u8BDD\u3002":"\u8FD8\u6CA1\u6709\u5BF9\u8BDD\uFF0C\u70B9\uFF0B\u5F00\u59CB\u65B0\u7684\u5DE5\u4F5C\u3002"}):(0,R.jsxs)(D,{vertical:!0,gap:4,className:"sidebar-recent-groups",children:[i==="active"&&x.every(M=>M.entries.length===0)?(0,R.jsx)(X.Paragraph,{type:"secondary",className:"sidebar-filter-empty",role:"status",children:f.trim()?"\u6CA1\u6709\u5339\u914D\u7684\u6D3B\u52A8\u4F1A\u8BDD\u3002":"\u73B0\u5728\u6CA1\u6709\u6D3B\u52A8\u4F1A\u8BDD\u3002"}):null,x.map(M=>(0,R.jsx)(gn,{group:M,employees:s,displayMode:i,liveTitles:A,selectedSessionId:W,now:I,onOpen:u,onStartConversation:N,onOpenConversation:U,onArchiveSession:w,onDeleteSession:q,disabled:c},M.key))]})]})}function gn({group:e,employees:s,displayMode:i,liveTitles:f,selectedSessionId:c,now:g,onOpen:m,onStartConversation:A,onArchiveSession:W,onDeleteSession:I,onOpenConversation:u,disabled:v=!1}){let[w,q]=Fe(`recent.${e.key}`,!1,!1,void 0,e.entries.length>0),U=He.useRef(null),x=e.entries.map(K=>K.session),N=Ze(x),M=!!(W||I),J=e.entries.map((K,O)=>{let L=K.session,k=_e(L,O,f?.[L.id]),G=(0,R.jsx)(Jt,{id:L.id,title:k,titleGenerating:L.titleGenerating,avatarNode:(0,R.jsx)(wn,{entry:K,group:e}),state:wa(L),glow:ba(L),summary:hn(K,e,g),active:c===L.id,onClick:()=>m(K)});return M?(0,R.jsx)(ya,{row:(0,R.jsx)("div",{className:"sidebar-recent-row",children:G}),session:L,label:k,disabled:v,intoNewTask:L.workspaceTaskId?void 0:K.group,onOpen:()=>m(K),onArchive:W?$=>W(L.id,$):void 0,onDelete:I?()=>I(L,k):void 0},L.id):(0,R.jsx)(He.Fragment,{children:G},L.id)});return(0,R.jsx)(Yt,{label:e.title,count:e.entries.length,totalCount:e.totalCount,description:`${N.description}\uFF0C\u5171 ${e.totalCount} \u4E2A\u4F1A\u8BDD`,activity:N,containsCurrent:e.entries.some(K=>K.session.id===c),avatarNode:(0,R.jsx)(bn,{group:e,employees:s}),action:(0,R.jsx)(yn,{group:e,onStartConversation:A}),expanded:w,onToggle:()=>q(!w),onSetOpen:q,onActivate:e.employeeId&&u?()=>u(e.employeeId):void 0,toggleRef:U,collapsedPreview:(0,R.jsx)(va,{sessions:x,expanded:w,label:`${e.title}\u7684\u4F1A\u8BDD\u9884\u89C8`,className:"sidebar-session-preview-person",liveTitles:f,selectedSessionId:c,disabled:v,expansionRef:U,onExpand:()=>q(!0),onActivate:K=>{let O=e.entries.find(L=>L.session.id===K.id);O&&(q(!1),m(O))}}),children:J.length?J:(0,R.jsx)(X.Paragraph,{type:"secondary",className:"sidebar-group-empty",children:"\u6682\u65E0\u6D3B\u52A8\u4F1A\u8BDD"})})}function yn({group:e,onStartConversation:s}){if(e.kind==="employee")return(0,R.jsx)(he,{className:"sidebar-recent-add",title:`\u4E0E${e.title}\u65B0\u5EFA\u5BF9\u8BDD`,"aria-label":`\u4E0E${e.title}\u65B0\u5EFA\u5BF9\u8BDD`,onClick:()=>s(e.employeeId??void 0),children:(0,R.jsx)(b,{name:"plus",size:14})});if(e.kind==="blank-terminal"||e.kind==="terminal"){let i=e.kind==="blank-terminal";return(0,R.jsx)(he,{className:"sidebar-recent-add",title:i?"\u65B0\u5EFA\u7A7A\u767D\u7EC8\u7AEF":"\u65B0\u5EFA\u7EC8\u7AEF","aria-label":i?"\u65B0\u5EFA\u7A7A\u767D\u7EC8\u7AEF":"\u65B0\u5EFA\u7EC8\u7AEF",onClick:()=>{i?Be.open({initialKind:"shell"}):Be.open({initialKind:"pty"})},children:(0,R.jsx)(b,{name:"plus",size:14})})}return null}function hn(e,s,i){let f=Ft(e.session.startedAt??"",i);return[e.taskName||e.group.workspaceName,f].filter(Boolean).join(" \xB7 ")}function bn({group:e,employees:s}){let i=e.latestSession;if(e.kind==="employee"){let f=s.find(c=>c.id===e.employeeId)??Sn(i,e.title);return(0,R.jsx)(sn,{employee:f})}return i?.teamChat?(0,R.jsx)(ra,{teamChat:i.teamChat}):e.kind==="team"?(0,R.jsx)(b,{name:"users",size:18}):i?(0,R.jsx)(sa,{session:i,size:18,className:"sidebar-recent-provider"}):(0,R.jsx)(b,{name:"terminal",size:18,className:"sidebar-recent-provider"})}function wn({entry:e,group:s}){let i=e.session;return i.teamChat?(0,R.jsx)(ra,{teamChat:i.teamChat}):s.kind==="team"?(0,R.jsx)(b,{name:"users",size:14,className:"sidebar-recent-provider"}):(0,R.jsx)(sa,{session:i,size:14,className:"sidebar-recent-provider"})}function Sn(e,s){return{id:e?.employeeId??"employee",name:s||e?.employeeName||"\u5458\u5DE5",avatar:e?.employeeAvatar??""}}var a=ve(ze(),1),oa=80;function vn(e){for(let s of e){let i=s.codePointAt(0);if(i!==void 0&&(i<32||i===127||i>=128&&i<=159||i===8232||i===8233))return!0}return!1}function Rn(e){let s=e.trim();return!s||Array.from(s).length>oa?!1:!vn(s)}function ne(){return aa.getRuntime()}function we(e,s){ne()?.toast(e,s)}function on(e){let s=e.replace(/\\/g,"/").replace(/\/+$/,"");if(!s)return e;let i=s.startsWith("/"),f=s.split("/").filter(Boolean);return f.length<=2?i?`/${f.join("/")}`:f.join("/")||s:`\u2026/${f.slice(-2).join("/")}`}function Qa({checked:e,label:s}){return(0,a.jsx)("span",{className:"wand-workspace-manage-check","aria-hidden":"true",children:(0,a.jsx)(Ve,{children:(0,a.jsx)(ga,{tabIndex:-1,checked:e,"aria-label":s})})})}function Ta({session:e,index:s,liveTitle:i,active:f,manageMode:c=!1,selected:g=!1,onToggleSelect:m,onOpen:A,onDelete:W,onArchive:I,intoNewTask:u}){let v=e.archived===!0,w=_e(e,s,i),q=e.teamStep?`${e.teamStep.teamName} \xB7 ${e.teamStep.memberName} \xB7 ${e.teamStep.title}`:e.cwd||e.title||e.id,U=wa(e),x=ba(e),N=c?m??A:A,M=(0,a.jsx)(D,{align:"center",gap:4,style:{minWidth:0,width:"100%"},className:te("workspace-session",f&&"active",v&&"archived",c&&"managing",c&&g&&"selected"),"data-session-id":e.id,draggable:!c&&!v,onDragStart:J=>{J.stopPropagation(),kt(J.dataTransfer,e.id)},children:(0,a.jsx)(ja,{title:`${w} \xB7 ${U.label} \xB7 ${q}`,selector:".workspace-session-name",children:(0,a.jsxs)(pa,{style:{flex:1,minWidth:0,width:"100%",height:"auto",whiteSpace:"normal",justifyContent:"flex-start",textAlign:"start",padding:6},className:"workspace-session-main",orientation:"vertical",size:"sm",active:f,"aria-pressed":c?g:void 0,title:`${w} \xB7 ${U.label} \xB7 ${q}`,render:(0,a.jsx)("button",{type:"button",onClick:N}),children:[c&&(0,a.jsx)(Qa,{checked:g,label:`\u9009\u62E9\u7EC8\u7AEF ${w}`}),(0,a.jsx)("span",{style:{display:"inline-flex",width:20,height:20,flexShrink:0},className:te("workspace-session-mark",x!=="none"&&`wand-logo-glow glow-${x}`),"data-glow":x,"aria-hidden":"true",children:(0,a.jsx)(Ba,{dot:x!=="none",color:Ot(x),children:e.teamChat?(0,a.jsx)(ra,{teamChat:e.teamChat}):(0,a.jsx)(sa,{session:e,size:14})})}),(0,a.jsx)("span",{style:{minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:te("workspace-session-name",e.titleGenerating&&"title-generating"),"aria-busy":e.titleGenerating||void 0,"aria-label":e.titleGenerating?`${w}\uFF0CAI \u6B63\u5728\u751F\u6210\u6807\u9898`:void 0,title:e.titleGenerating?"AI \u6B63\u5728\u751F\u6210\u6807\u9898":void 0,children:w}),e.teamStep?(0,a.jsx)("span",{className:"workspace-session-kind workspace-session-kind-team",title:`${e.teamStep.teamName} \xB7 ${e.teamStep.stepStatus}`,children:e.teamStep.memberName||"\u56E2\u961F"}):e.teamChat?(0,a.jsx)("span",{className:"workspace-session-kind workspace-session-kind-team",title:`${e.teamChat.teamName} \xB7 ${e.teamChat.memberCount} \u4EBA`,children:"\u7FA4\u804A"}):e.sessionKind==="pty"&&(0,a.jsx)("span",{className:"workspace-session-kind",children:"\u7EC8\u7AEF"})]})})});return(0,a.jsx)(ya,{row:M,session:e,label:w,disabled:c,intoNewTask:e.workspaceTaskId?void 0:u,onOpen:A,onArchive:I,onDelete:W})}function Tn({id:e,storageKey:s,sessions:i,label:f,activeSessionId:c,liveTitles:g,onOpen:m,onDelete:A,onArchive:W}){let[I,u]=Fe(s,!0);return i.length===0?null:(0,a.jsxs)("div",{className:"workspace-archive-fold",children:[(0,a.jsxs)(_,{style:{width:"100%",justifyContent:"flex-start",height:"auto"},kind:"ghost",type:"button",className:"workspace-archive-fold-head","aria-expanded":I,"aria-controls":e,title:I?`\u6536\u8D77${f}`:`\u5C55\u5F00 ${i.length} \u4E2A${f}`,onClick:v=>Ue(v.currentTarget,()=>u(!I)),onKeyDown:v=>Qe(v,I,u),children:[(0,a.jsx)(Xe,{open:I,size:10,className:te("workspace-task-chevron",I&&"open")}),(0,a.jsx)(b,{name:"archive",size:11}),(0,a.jsx)("span",{className:"workspace-archive-fold-label",children:f}),(0,a.jsx)("span",{className:"workspace-archive-fold-count",children:i.length})]}),(0,a.jsx)(Ye,{id:e,open:I,children:(0,a.jsx)(D,{vertical:!0,gap:4,style:{paddingInlineStart:6},className:"workspace-archive-fold-list",children:i.map((v,w)=>(0,a.jsx)(Ta,{session:v,index:w,liveTitle:g?.[v.id],active:c===v.id,onOpen:()=>m(v),onDelete:()=>A(v,w),onArchive:q=>W(v.id,q)},v.id))})})]})}function ln({task:e,visibleSessions:s=e.sessions,hasChildExecution:i=!1,childTaskCount:f=0,children:c,descendantSessionCount:g=0,now:m,liveTitles:A,activeTaskId:W,activeSessionId:I,manageMode:u=!1,displayMode:v="full",selected:w=!1,selectedSessionIds:q,onToggleSelect:U,onToggleSession:x,onOpen:N,onOpenSession:M,onRequestNewSession:J,isOnlyTask:K=!1,onClearSessions:O,onClearTeamHistory:L,onDeleteSession:k,onArchiveSession:G,onRename:$,onArchive:Z,onDelete:se,onMoveSession:Q,defaultGroup:S}){let[re,Ee]=Fe(`team.${e.id}`,!0),[z,De]=Fe(`teamhistory.${e.id}`,!0),[P,ee]=o.useState(!1),[Re,B]=fa(),Ne=o.useRef(null),[Je,We]=o.useState(""),Ce=o.useRef(!1),[ce,de]=o.useState(!1),[ae,je]=o.useState(e.name);o.useLayoutEffect(()=>{Ce.current&&!ce&&document.activeElement===document.body&&Ne.current?.querySelector(".workspace-task-main")?.focus({preventScroll:!0}),Ce.current=ce},[ce]);let[fe,Y]=o.useState(""),[h,ke]=o.useState(!1),Se=!!e.worktree,me=S?e.sessions.some(t=>t.id===I):W===e.id,Me=o.useId(),xe=o.useId(),qe=o.useId(),Oe=o.useId(),Te=o.useId(),oe=qa(e.sessions),ie=qa(s),Ke=Mt(s),Ae=ie.live.length+ie.history.length,pe=e.archivedSessions??[],le=e.sessions.length,n=o.useRef(null),[y,F]=Fe(`task.${e.id}`,!0,!1,!!S||me||K||i),d=()=>F(!y),H=Ze(ie.live),p=Ze(s,e),V=e.canArchive!==!1&&!e.sessions.some(na),Ie=o.useId(),E=s.length>0||i||pe.length>0,Pe=f>0?`${f} \u9879`:le>0?s.length===le?String(le):`${s.length}/${le}`:"",Ia=async()=>{if(h||!$)return;let t=ae.trim();if(!Rn(t)){Y(t?"\u4EFB\u52A1\u540D\u79F0\u65E0\u6548\u6216\u8FC7\u957F\uFF08\u6700\u591A 80 \u5B57\u7B26\uFF09\u3002":"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0\u3002");return}if(t===e.name){de(!1);return}ke(!0),Y("");try{await $(t),de(!1)}catch(j){Y(be(j,"\u91CD\u547D\u540D\u4EFB\u52A1\u5931\u8D25\u3002"))}finally{ke(!1)}},Na=async t=>{if(!(t==="archive"&&(!V||!Z))&&!(t==="delete"&&!se)&&!h){ke(!0),We(""),B(!1);try{if(!(t==="archive"?!0:t==="clear"||t==="clear-history"?await _a(t==="clear"?le:oe.history.length,`\u4EFB\u52A1\u300C${e.name}\u300D${t==="clear-history"?"\u5DF2\u7ED3\u675F\u7684\u56E2\u961F\u4F1A\u8BDD":""}`,Ne.current,t==="clear-history"?`\u5C06\u5220\u9664\u8FD9\u4E00\u8F6E\u534F\u4F5C\u7559\u4E0B\u7684 ${oe.history.length} \u4E2A\u6210\u5458\u4F1A\u8BDD\uFF0C\u65E0\u6CD5\u64A4\u9500\u3002\u4F60\u81EA\u5DF1\u7684\u4F1A\u8BDD\u548C\u4EFB\u52A1\u90FD\u4F1A\u4FDD\u7559\u3002`:void 0):await Ra({title:`\u5220\u9664\u300C${e.name}\u300D\uFF1F`,description:"\u5C06\u5220\u9664\u4EFB\u52A1\u3001\u6240\u5C5E\u4F1A\u8BDD\u5E76\u6E05\u7406 Worktree\uFF0C\u65E0\u6CD5\u64A4\u9500\u3002",action:"\u786E\u8BA4\u5220\u9664\u4EFB\u52A1",danger:!0,trigger:Ne.current})))return;t==="archive"?await Z?.():t==="delete"?await se?.():t==="clear"?await O():await L(oe.history.map(ge=>ge.id))}catch(j){We(be(j,"\u65E0\u6CD5\u5904\u7406\u4EFB\u52A1\uFF0C\u8BF7\u91CD\u8BD5\u3002")),Ne.current?.contains(document.activeElement)&&B(!0)}finally{ke(!1)}}};return ce?(0,a.jsxs)("form",{style:{display:"flex",alignItems:"center",gap:4},noValidate:!0,className:"workspace-task workspace-task-rename","aria-busy":h,onSubmit:t=>{t.preventDefault(),Ia()},children:[(0,a.jsxs)("span",{style:{minWidth:0,flex:1},className:"workspace-task-rename-field",children:[(0,a.jsx)(da,{className:"workspace-task-rename-input",value:ae,disabled:h,maxLength:oa,autoFocus:!0,"aria-label":`\u91CD\u547D\u540D\u4EFB\u52A1 ${e.name}`,"aria-invalid":!!fe||void 0,onChange:t=>{je(t.currentTarget.value),Y("")},onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),h||de(!1))}}),fe&&(0,a.jsx)("span",{className:"workspace-task-rename-error",role:"alert",children:fe})]}),(0,a.jsx)(he,{type:"submit",className:"workspace-task-action confirm",disabled:h,title:"\u4FDD\u5B58\u4EFB\u52A1\u540D\u79F0","aria-label":"\u4FDD\u5B58\u4EFB\u52A1\u540D\u79F0",children:(0,a.jsx)(b,{name:"check",size:13})}),(0,a.jsx)(he,{className:"workspace-task-action cancel",disabled:h,title:"\u53D6\u6D88\u91CD\u547D\u540D","aria-label":"\u53D6\u6D88\u91CD\u547D\u540D",onClick:()=>de(!1),children:(0,a.jsx)(b,{name:"close",size:13})})]}):(0,a.jsxs)("div",{className:te("workspace-task-group",P&&"is-session-drop-target",me&&"active",y&&"is-open",u&&"managing",u&&w&&"selected"),"data-workspace-task-id":S?void 0:e.id,"data-sidebar-default-task-id":S?.workspaceId,"aria-busy":h||void 0,onKeyDown:t=>{t.key!=="Escape"||t.defaultPrevented||!y||!E||Re||!t.currentTarget.contains(t.target)||(t.preventDefault(),t.stopPropagation(),n.current?.focus({preventScroll:!0}),F(!1))},onDragOver:t=>{!Q||u||h||!Ma(t.dataTransfer)||(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect="move",ee(!0))},onDragLeave:t=>{t.currentTarget.contains(t.relatedTarget)||ee(!1)},onDrop:t=>{if(!Ma(t.dataTransfer))return;t.preventDefault(),t.stopPropagation(),ee(!1);let j=gt(t.dataTransfer);!Q||!j||h||u||e.sessions.some(ge=>ge.id===j)||(ke(!0),Q(j).then(()=>F(!0)).catch(ge=>we(be(ge,"\u65E0\u6CD5\u79FB\u52A8\u4F1A\u8BDD\u3002"),"danger")).finally(()=>ke(!1)))},children:[P&&(0,a.jsx)("span",{className:"workspace-task-drop-hint",children:"\u79FB\u5165\u6B64\u4EFB\u52A1 \xB7 \u8FD0\u884C\u76EE\u5F55\u4E0D\u53D8"}),(0,a.jsx)(Ha,{open:Re,disabled:u,rowRef:Ne,onOpenChange:t=>{(!t||!h)&&B(t)},label:`\u4EFB\u52A1 ${e.name} \u7684\u66F4\u591A\u64CD\u4F5C`,title:e.name,description:Se?"\u9694\u79BB\u4EFB\u52A1 \xB7 \u4FDD\u7559 Worktree \u7684\u5F52\u6863":void 0,error:Je,className:"workspace-task-menu",row:(0,a.jsxs)(D,{align:"center",gap:4,style:{minWidth:0},className:te("workspace-task",me&&"active",!Se&&"not-isolated",u&&"managing",u&&w&&"selected"),children:[(0,a.jsx)("span",{className:"workspace-task-disclosure-slot",children:E&&!u?(0,a.jsx)(he,{ref:n,className:"workspace-task-disclosure",disabled:h,"aria-label":`${y?"\u6536\u8D77":"\u5C55\u5F00"}\u4EFB\u52A1 ${e.name}`,"aria-expanded":y,"aria-controls":i?xe:Me,onClick:t=>{t.stopPropagation(),Ue(t.currentTarget,d)},onKeyDown:t=>Qe(t,y,F),children:(0,a.jsx)(Xe,{open:y,size:12})}):null}),(0,a.jsxs)(pa,{style:{flex:1,minWidth:0,height:"auto",whiteSpace:"nowrap",justifyContent:"flex-start",textAlign:"start"},className:"workspace-task-main",orientation:"vertical",size:"sm",active:me,"aria-pressed":u?w:void 0,"aria-expanded":u||N?void 0:y,"aria-controls":N?void 0:Me,title:`${e.name}
|
|
4
4
|
${e.worktree?.path??e.cwd}`,render:(0,a.jsx)("button",{type:"button",onClick:t=>{if(u){(U??N)?.();return}if(N){N();return}E&&Ue(t.currentTarget,d)},onKeyDown:u?void 0:t=>Qe(t,y,F)}),children:[u&&(0,a.jsx)(Qa,{checked:w,label:`\u9009\u62E9\u4EFB\u52A1 ${e.name}`}),(0,a.jsx)("span",{style:{minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:"workspace-task-name",children:e.name})]}),Pe?(0,a.jsx)("span",{id:Ie,className:"workspace-task-count",title:`${f?`${f} \u4E2A\u76F4\u63A5\u5B50\u4EFB\u52A1\uFF0C`:""}${p.description}\uFF0C\u81EA\u8EAB ${le} \u4E2A\u4F1A\u8BDD${g?`\uFF0C\u540E\u4EE3 ${g} \u4E2A\u4F1A\u8BDD\uFF08\u53BB\u91CD\uFF09`:""}`,children:Pe}):null,p.label?(0,a.jsxs)("span",{className:`sidebar-task-status tone-${p.tone}`,title:p.description,"aria-label":p.label,children:[(0,a.jsx)(b,{name:p.label==="\u6392\u961F\u4E2D"?"history":p.label==="\u5F85\u5904\u7406"?"warning":p.label==="\u521A\u5B8C\u6210"?"check":"circle",size:11}),(0,a.jsx)("span",{children:p.label})]}):null]}),menu:{items:[...N?[{key:"open",disabled:h,icon:(0,a.jsx)(b,{name:"task"}),label:"\u6253\u5F00\u4EFB\u52A1"}]:[],{key:"new",disabled:h,icon:(0,a.jsx)(b,{name:"plus"}),label:"\u65B0\u5EFA\u4F1A\u8BDD"},...(e.worktree?.path||e.cwd)?.trim()?[{key:"copy-cwd",disabled:h,icon:(0,a.jsx)(b,{name:"copy"}),label:"\u590D\u5236\u5DE5\u4F5C\u76EE\u5F55"}]:[],...$?[{key:"rename",disabled:h,icon:(0,a.jsx)(b,{name:"edit"}),label:"\u91CD\u547D\u540D\u4EFB\u52A1"}]:[],...Z?[{key:"archive",disabled:h||!V,icon:(0,a.jsx)(b,{name:"archive"}),label:V?Se?"\u5F52\u6863\u4EFB\u52A1\uFF08\u4FDD\u7559 Worktree\uFF09":"\u5F52\u6863\u4EFB\u52A1":"\u5F52\u6863\u4EFB\u52A1\uFF08\u6267\u884C\u7ED3\u675F\u540E\u53EF\u7528\uFF09"}]:[],...le||Se?[{key:"danger-divider",type:"divider"}]:[],...le?[{key:"clear",disabled:h,danger:!0,icon:(0,a.jsx)(b,{name:"terminal"}),label:`\u6E05\u7A7A\u6240\u5217\u4F1A\u8BDD\uFF08${le}\uFF09`}]:[],...oe.history.length?[{key:"clear-history",disabled:h,danger:!0,icon:(0,a.jsx)(b,{name:"archive"}),label:`\u6E05\u7406\u56E2\u961F\u5386\u53F2\uFF08${oe.history.length}\uFF09`}]:[],...Se?[{key:"delete",disabled:h,danger:!0,icon:(0,a.jsx)(b,{name:"trash"}),label:"\u5220\u9664\u4EFB\u52A1\u5E76\u6E05\u7406 Worktree\u2026"}]:[]],onClick:({key:t})=>{h||(t==="open"?(B(!1),N?.()):t==="new"?(B(!1),J()):t==="copy-cwd"?(We(""),Ga(e.worktree?.path||e.cwd).then(()=>B(!1)).catch(j=>We(be(j,"\u65E0\u6CD5\u590D\u5236\u5DE5\u4F5C\u76EE\u5F55\u3002")))):t==="rename"?(B(!1),je(e.name),Y(""),de(!0)):(t==="archive"||t==="delete"||t==="clear"||t==="clear-history")&&Na(t))}}}),(0,a.jsxs)(Kt,{id:Me,open:y,label:`\u4EFB\u52A1 ${e.name}`,toggleRef:n,toggleClassName:"workspace-task-chevron-btn",inlineToggle:!0,disabled:h,hasSessions:s.length>0||pe.length>0,onOpenChange:F,children:[(0,a.jsx)(va,{sessions:s,expanded:y||u,label:`\u4EFB\u52A1 ${e.name} \u7684\u4F1A\u8BDD\u9884\u89C8`,className:"sidebar-session-preview-task",selectedSessionId:I,liveTitles:A,disabled:u||h,expansionRef:n,onExpand:()=>{F(!0),s.some(t=>t.teamStep)&&Ee(!0),s.some(t=>t.teamStep?.runFinished)&&De(!0)},onActivate:t=>{F(!1),M(t)}}),(0,a.jsxs)(Ye,{id:Me,open:y,children:[le===0&&!i&&e.executionStatus!=="queued"&&!u&&(0,a.jsxs)(_,{kind:"ghost",type:"button",className:"workspace-task-empty",onClick:J,children:[(0,a.jsx)(b,{name:"plus",size:12}),S?"\u6DFB\u52A0\u4F1A\u8BDD":"\u6DFB\u52A0\u4F1A\u8BDD\uFF0C\u6216\u62D6\u5165\u5DF2\u6709\u4F1A\u8BDD"]}),(0,a.jsxs)(D,{vertical:!0,gap:4,style:{paddingInlineStart:6},className:"workspace-task-sessions",children:[(u?e.sessions:Ke).map((t,j)=>(0,a.jsx)(Ta,{session:t,index:j,liveTitle:A?.[t.id],active:I===t.id,manageMode:u,selected:q?.has(t.id)??!1,onToggleSelect:()=>x?.(t.id),onOpen:()=>M(t),onDelete:()=>k(t),onArchive:u?void 0:ge=>G([t.id],ge),intoNewTask:S},t.id)),!u&&Ae>0&&(0,a.jsxs)("div",{className:"workspace-team-fold",children:[(0,a.jsxs)(_,{style:{width:"100%",justifyContent:"flex-start",height:"auto"},kind:"ghost",type:"button",className:"workspace-team-fold-head","aria-expanded":re,"aria-controls":qe,title:re?"\u6536\u8D77\u56E2\u961F\u4F1A\u8BDD":`\u5C55\u5F00\u4EFB\u52A1\u300C${e.name}\u300D\u7684 ${Ae} \u4E2A\u56E2\u961F\u4F1A\u8BDD`,onClick:t=>Ue(t.currentTarget,()=>Ee(!re)),onKeyDown:t=>Qe(t,re,Ee),children:[(0,a.jsx)(Xe,{open:re,size:10,className:te("workspace-task-chevron",re&&"open")}),(0,a.jsx)("span",{className:"workspace-team-fold-label",children:"\u56E2\u961F\u4F1A\u8BDD"}),H.label?(0,a.jsx)("span",{className:`workspace-task-activity ${H.tone}`,title:H.description,children:H.label}):null,(0,a.jsx)("span",{className:"workspace-team-fold-count",children:Ae})]}),(0,a.jsx)(Ye,{id:qe,open:re,children:(0,a.jsxs)(D,{vertical:!0,gap:4,style:{paddingInlineStart:6},className:"workspace-team-fold-list",children:[ie.live.map((t,j)=>(0,a.jsx)(Ta,{session:t,index:j,liveTitle:A?.[t.id],active:I===t.id,onOpen:()=>M(t),onDelete:()=>k(t),onArchive:ge=>G([t.id],ge),intoNewTask:S},t.id)),ie.history.length>0&&(0,a.jsxs)("div",{className:"workspace-team-history",children:[(0,a.jsx)(D,{align:"center",gap:4,className:"workspace-team-history-head",children:(0,a.jsxs)(_,{style:{width:"100%",justifyContent:"flex-start",height:"auto"},kind:"ghost",type:"button",className:"workspace-team-fold-head is-nested","aria-expanded":z,"aria-controls":Oe,title:z?"\u6536\u8D77\u5DF2\u7ED3\u675F\u7684\u56E2\u961F\u4F1A\u8BDD":`\u5C55\u5F00 ${ie.history.length} \u4E2A\u5DF2\u7ED3\u675F\u7684\u56E2\u961F\u4F1A\u8BDD`,onClick:t=>Ue(t.currentTarget,()=>De(!z)),onKeyDown:t=>Qe(t,z,De),children:[(0,a.jsx)(Xe,{open:z,size:10,className:te("workspace-task-chevron",z&&"open")}),(0,a.jsx)("span",{className:"workspace-team-fold-label",children:"\u5DF2\u7ED3\u675F"}),(0,a.jsx)("span",{className:"workspace-team-fold-count",children:ie.history.length})]})}),(0,a.jsx)(Ye,{id:Oe,open:z,children:(0,a.jsx)(D,{vertical:!0,gap:4,className:"workspace-team-fold-list",children:ie.history.map((t,j)=>(0,a.jsx)(Ta,{session:t,index:j,liveTitle:A?.[t.id],active:I===t.id,onOpen:()=>M(t),onDelete:()=>k(t),onArchive:ge=>G([t.id],ge),intoNewTask:S},t.id))})})]})]})})]})]}),v!=="active"&&pe.length>0&&(0,a.jsx)(Tn,{id:Te,storageKey:`archived.task.${e.id}`,sessions:pe,label:"\u5DF2\u5F52\u6863\u4F1A\u8BDD",activeSessionId:I,liveTitles:A,onOpen:t=>M(t),onDelete:(t,j)=>k(t,j),onArchive:(t,j)=>G([t],j)})]})]}),i&&c?(0,a.jsx)(Ye,{id:xe,open:y||u,children:(0,a.jsx)("div",{className:"workspace-task-children",children:c})}):null]})}function In({group:e,searchQuery:s="",totalSessionCount:i,now:f,preview:c=!1,directoryCount:g,liveTitles:m,activeWorkspaceId:A,activeTaskId:W,activeSessionId:I,manageMode:u=!1,displayMode:v="full",selection:w,onToggleTask:q,onToggleGroup:U,onToggleDefaultTask:x,onToggleSession:N,onActiveTaskOpen:M,onOpenSession:J,onRequestNewSessionInTask:K,onTasksChanged:O,onOpenDialog:L}){let k=new Set([...e.standaloneSessions,...e.tasks.flatMap(n=>Sa(e,n,s,m))].map(n=>n.id)).size,G=e.tasks.some(n=>n.executionStatus==="queued"),[$,Z]=Fe(`project.${e.workspaceId}`,!1,!0,void 0,k>0||G),[se,Q]=o.useState(!1),[S,re]=o.useState(!1),[Ee,z]=o.useState(""),[De,P]=fa(),[ee,Re]=o.useState(!1),B=o.useRef(null),Ne=o.useRef(!1);o.useLayoutEffect(()=>{Ne.current&&!ee&&document.activeElement===document.body&&B.current?.querySelector(".workspace-row-main")?.focus({preventScroll:!0}),Ne.current=ee},[ee]);let[Je,We]=o.useState(e.workspaceName),[Ce,ce]=o.useState(""),[de,ae]=o.useState(!1),je=o.useId(),fe=jt(e),Y=c||$,h=Ze([...e.tasks.flatMap(n=>n.sessions),...e.standaloneSessions],{executionStatus:e.tasks.some(n=>n.executionStatus==="running")?"running":G?"queued":null,queuedExecutionCount:e.tasks.reduce((n,y)=>n+(y.queuedExecutionCount??0),0)}),ke=!e.synthetic&&!e.global,Se=!e.global,me=Et(e.synthetic||e.global?{kind:"directory",cwd:e.workspaceCwd}:{kind:"workspace",workspaceId:e.workspaceId},O),Me=async()=>{if(de)return;let n=Je.trim();if(!n){ce("\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u540D\u79F0\u3002");return}if(n.length>oa){ce(`\u5DE5\u4F5C\u533A\u540D\u79F0\u6700\u591A ${oa} \u4E2A\u5B57\u7B26\u3002`);return}if(n===e.workspaceName){Re(!1);return}ae(!0),ce("");try{await ue.renameDirectory(e.workspaceCwd,n),we(`\u5DF2\u5C06\u76EE\u5F55\u300C${e.workspaceName}\u300D\u91CD\u547D\u540D\u4E3A\u300C${n}\u300D`,"success"),Re(!1),await O()}catch(y){ce(be(y,"\u91CD\u547D\u540D\u76EE\u5F55\u5931\u8D25\u3002"))}finally{ae(!1)}},xe=async n=>{await ue.archiveTask(n.id),$e.getSnapshot().taskId===n.id&&ne()?.closeWorkspace(),we(`\u5DF2\u5F52\u6863\u4EFB\u52A1\u300C${n.name}\u300D\uFF0C\u53EF\u5728\u4EFB\u52A1\u770B\u677F\u7684\u5F52\u6863\u4EFB\u52A1\u4E2D\u6062\u590D\u3002`,"info"),await O()},qe=async n=>{await ue.deleteTask(n.id,!0),await ne()?.refreshSessions(),$e.getSnapshot().taskId===n.id&&ne()?.closeWorkspace(),we(`\u5DF2\u5220\u9664\u4EFB\u52A1\u300C${n.name}\u300D`,"info"),await O()},Oe=async()=>{if(!(!ke||S)){re(!0),P(!1),z("");try{if(!await Ra({title:`\u5220\u9664\u76EE\u5F55\u300C${e.workspaceName}\u300D\uFF1F`,description:"\u5C06\u5220\u9664\u6B64\u76EE\u5F55\u53CA\u5176\u5168\u90E8\u4EFB\u52A1\u3001\u7EC8\u7AEF\u548C\u4EFB\u52A1 Worktree\uFF0C\u65E0\u6CD5\u64A4\u9500\u3002",action:"\u786E\u8BA4\u5220\u9664\u76EE\u5F55",trigger:B.current}))return;await ue.remove(e.workspaceId,!0),await ne()?.refreshSessions(),$e.getSnapshot().workspaceId===e.workspaceId&&ne()?.closeWorkspace(),we(`\u5DF2\u5220\u9664\u76EE\u5F55\u300C${e.workspaceName}\u300D`,"info"),await O()}catch(n){z(be(n,"\u65E0\u6CD5\u5220\u9664\u76EE\u5F55\u3002")),B.current?.contains(document.activeElement)&&P(!0)}finally{re(!1)}}},Te=async n=>{let y=ne();if(!y)throw new Error("\u5DE5\u4F5C\u7A7A\u95F4\u8FD0\u884C\u73AF\u5883\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5\u3002");await y.startWorktreeMergeAgent({workspaceId:e.workspaceId,cwd:e.workspaceCwd,systemPrompt:n.system,prompt:n.message}),y.toast("\u5DF2\u542F\u52A8 Agent\uFF0C\u51C6\u5907\u5408\u5E76\u6240\u9009 Worktree \u5230\u9879\u76EE\u9ED8\u8BA4\u5206\u652F\u3002","success")},oe=async(n,y,F)=>{await ha(n,y),we(F,"info"),await O()},ie=async(n,y)=>{let F=[...new Set(n)].filter(d=>d.trim().length>0);F.length!==0&&(await ue.batchArchiveSessions(F,y),we(y?`\u5DF2\u5F52\u6863 ${F.length} \u4E2A\u4F1A\u8BDD\uFF0C\u53EF\u5728\u300C\u5DF2\u5F52\u6863\u4F1A\u8BDD\u300D\u4E2D\u6062\u590D`:`\u5DF2\u6062\u590D ${F.length} \u4E2A\u4F1A\u8BDD`,"info"),await O())},Ke=e.tasks.length,Ae=u&&w?Nt(w,e):!1,pe=[...new Set([...e.tasks.flatMap(n=>n.sessions.map(y=>y.id)),...e.standaloneSessions.map(n=>n.id)])],le=async()=>{if(!S){re(!0),P(!1),z("");try{if(!await _a(pe.length,`\u76EE\u5F55\u300C${e.workspaceName}\u300D`,B.current))return;let n=$e.getSnapshot(),y=e.tasks.find(F=>F.id===n.taskId)??null;await oe(pe,y,`\u5DF2\u6E05\u7A7A\u76EE\u5F55\u300C${e.workspaceName}\u300D\u7684\u7EC8\u7AEF`)}catch(n){z(be(n,"\u65E0\u6CD5\u6E05\u7A7A\u7EC8\u7AEF\u3002")),B.current?.contains(document.activeElement)&&P(!0)}finally{re(!1)}}};return(0,a.jsxs)("section",{"data-sidebar-tree-directory-id":e.workspaceId,className:te("workspace-item",e.global&&"workspace-global-tasks",Y&&"is-open",e.synthetic&&"is-synthetic",A===e.workspaceId&&"active-workspace"),children:[ee?(0,a.jsxs)("form",{style:{display:"flex",alignItems:"center",gap:4},noValidate:!0,className:"workspace-row-rename","aria-busy":de,onSubmit:n=>{n.preventDefault(),Me()},children:[(0,a.jsxs)("span",{style:{minWidth:0,flex:1},className:"workspace-task-rename-field",children:[(0,a.jsx)(da,{className:"workspace-task-rename-input",value:Je,disabled:de,maxLength:oa,autoFocus:!0,"aria-label":`\u91CD\u547D\u540D\u76EE\u5F55 ${e.workspaceName}`,"aria-invalid":!!Ce||void 0,onChange:n=>{We(n.currentTarget.value),ce("")},onKeyDown:n=>{n.key==="Escape"&&(n.preventDefault(),de||Re(!1))}}),Ce&&(0,a.jsx)("span",{className:"workspace-task-rename-error",role:"alert",children:Ce})]}),(0,a.jsx)(he,{type:"submit",className:"workspace-task-action confirm",disabled:de,title:"\u4FDD\u5B58\u5DE5\u4F5C\u533A\u540D\u79F0","aria-label":"\u4FDD\u5B58\u5DE5\u4F5C\u533A\u540D\u79F0",children:(0,a.jsx)(b,{name:"check",size:13})}),(0,a.jsx)(he,{className:"workspace-task-action cancel",disabled:de,title:"\u53D6\u6D88\u91CD\u547D\u540D","aria-label":"\u53D6\u6D88\u91CD\u547D\u540D",onClick:()=>Re(!1),children:(0,a.jsx)(b,{name:"close",size:13})})]}):null,!c&&(0,a.jsx)(Ha,{open:De,disabled:u||ee,rowRef:B,onOpenChange:n=>{(!n||!S)&&P(n)},label:`\u76EE\u5F55 ${e.workspaceName} \u7684\u66F4\u591A\u64CD\u4F5C`,title:e.workspaceName,description:on(e.workspaceCwd),error:Ee,className:"workspace-directory-menu",row:(0,a.jsx)(D,{align:"center",gap:4,style:{minWidth:0},className:te("workspace-row",ee&&"is-renaming"),hidden:ee,children:(0,a.jsx)(ja,{title:`${e.workspaceName} \xB7 ${e.workspaceCwd}`,selector:".workspace-row-title",children:(0,a.jsxs)(pa,{style:{flex:1,minWidth:0,height:"auto",whiteSpace:"normal",justifyContent:"flex-start",textAlign:"start",padding:6},className:"workspace-row-main",orientation:"vertical",size:"md","aria-expanded":u?void 0:Y,"aria-pressed":u?Ae:void 0,"aria-controls":je,title:e.global?"\u8FD9\u4E9B\u5386\u53F2\u4EFB\u52A1\u5C1A\u672A\u6307\u5B9A\u5DE5\u4F5C\u533A\uFF0C\u53EF\u5728\u4EFB\u52A1\u770B\u677F\u4E2D\u9009\u62E9\u5DE5\u4F5C\u533A\u3002":e.workspaceCwd,render:(0,a.jsx)("button",{type:"button",onClick:u?()=>U?.(e):n=>Ue(n.currentTarget,()=>Z(!Y)),onKeyDown:u?void 0:n=>Qe(n,Y,Z)}),children:[u&&(0,a.jsx)(Qa,{checked:Ae,label:`\u9009\u62E9\u76EE\u5F55 ${e.workspaceName}`}),(0,a.jsx)("span",{className:"workspace-directory-chevron-wrap",onClick:u?n=>{n.stopPropagation(),Z(!Y)}:void 0,children:(0,a.jsx)(Xe,{open:Y,size:16,className:te("workspace-row-chevron",Y&&"open")})}),(0,a.jsxs)(D,{vertical:!0,style:{minWidth:0,flex:1},className:"workspace-row-label",children:[(0,a.jsx)(D,{align:"center",gap:4,style:{minWidth:0},className:"workspace-row-name",children:(0,a.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},className:"workspace-row-title",children:e.workspaceName})}),!e.global&&(0,a.jsx)(X.Text,{type:"secondary",ellipsis:!0,className:"workspace-row-path",title:e.workspaceCwd,style:{fontSize:12},children:on(e.workspaceCwd)})]}),(0,a.jsx)(X.Text,{type:"secondary",className:"workspace-row-count",title:`\u5F53\u524D\u663E\u793A ${k} / \u5171 ${i} \u4E2A\u4F1A\u8BDD\uFF1B${e.tasks.filter(n=>!n.parentWorkspaceTaskId).length} \u4E2A\u4E3B\u76EE\u6807\u3001${e.tasks.filter(n=>n.parentWorkspaceTaskId).length} \u4E2A\u5B50\u4EFB\u52A1\uFF0C${e.standaloneSessions.length} \u4E2A\u672A\u5206\u7EC4\u4F1A\u8BDD\uFF1B\u4E0D\u542B\u5F52\u6863`,"aria-label":`\u5F53\u524D\u663E\u793A ${k} \u4E2A\u4F1A\u8BDD\uFF0C\u5171 ${i} \u4E2A\u4F1A\u8BDD`,children:k===i?k:`${k}/${i}`}),(0,a.jsx)("span",{className:`sidebar-head-activity tone-${h.tone}`,title:h.description,"aria-label":h.description,children:h.label?(0,a.jsx)(Ba,{status:h.tone==="warning"?"warning":h.tone==="success"?"success":"processing"}):null})]})})}),menu:{multiple:!0,items:[{key:"new",disabled:S||e.global,icon:(0,a.jsx)(b,{name:"plus"}),label:"\u5728\u6B64\u65B0\u5EFA\u4F1A\u8BDD"},...!e.global&&e.workspaceCwd.trim()?[{key:"copy-cwd",disabled:S,icon:(0,a.jsx)(b,{name:"copy"}),label:"\u590D\u5236\u5DE5\u4F5C\u76EE\u5F55"}]:[],{key:"organize",disabled:S,icon:(0,a.jsx)(b,{name:"folder"}),label:me.label,children:me.items},...Se?[{key:"rename",disabled:S,icon:(0,a.jsx)(b,{name:"edit"}),label:"\u91CD\u547D\u540D\u76EE\u5F55"}]:[],...e.tasks.some(n=>n.worktree)?[{key:"merge",disabled:S,icon:(0,a.jsx)(b,{name:"merge"}),label:"\u67E5\u770B\u5E76\u5408\u5E76 Worktree"}]:[],...pe.length||ke?[{key:"danger-divider",type:"divider"}]:[],...pe.length?[{key:"clear",disabled:S,danger:!0,icon:(0,a.jsx)(b,{name:"terminal"}),label:`\u6E05\u7A7A\u6240\u5217\u4F1A\u8BDD\uFF08${pe.length}\uFF09`}]:[],...ke?[{key:"delete",disabled:S,danger:!0,icon:(0,a.jsx)(b,{name:"trash"}),label:"\u5220\u9664\u76EE\u5F55\u2026"}]:[]],onClick:({key:n,domEvent:y})=>{y.stopPropagation(),!S&&(me.handleMenuKey(n)||(n==="new"?(P(!1),L?.(),Be.open({initialCwd:e.workspaceCwd,...e.synthetic||e.global?{}:{workspaceId:e.workspaceId}})):n==="copy-cwd"?(z(""),Ga(e.workspaceCwd).then(()=>P(!1)).catch(F=>z(be(F,"\u65E0\u6CD5\u590D\u5236\u5DE5\u4F5C\u76EE\u5F55\u3002")))):n==="rename"?(P(!1),We(e.workspaceName),ce(""),Re(!0)):n==="merge"?(P(!1),Q(!0)):n==="delete"?Oe():n==="clear"&&le()))}}}),(0,a.jsx)(Ye,{id:je,open:Y,children:(0,a.jsxs)(D,{vertical:!0,gap:4,style:{paddingInlineStart:4},className:"workspace-tasks",children:[v==="active"&&k===0&&!G?(0,a.jsx)(X.Paragraph,{type:"secondary",className:"sidebar-group-empty",children:"\u6682\u65E0\u6D3B\u52A8\u4F1A\u8BDD"}):null,(fe.sessions.length>0||!!(s.trim()&&fe.archivedSessions?.length))&&(0,a.jsx)(ln,{task:fe,defaultGroup:e,now:f,liveTitles:m,activeTaskId:null,activeSessionId:I,manageMode:u,displayMode:v,selected:w?Gt(w,e):!1,selectedSessionIds:w?new Set(w.sessionIds):void 0,onToggleSelect:()=>x?.(e),onToggleSession:N,onOpenSession:n=>J(e,n),onRequestNewSession:()=>{L?.(),Be.open({initialCwd:e.global?void 0:e.workspaceCwd,...e.global||e.synthetic?{}:{workspaceId:e.workspaceId}})},onClearSessions:()=>oe(fe.sessions.map(n=>n.id),null,`\u5DF2\u6E05\u7A7A\u300C${fe.name}\u300D\u7684\u4F1A\u8BDD`),onClearTeamHistory:n=>oe(n,null,`\u5DF2\u6E05\u7A7A\u300C${fe.name}\u300D\u7684\u56E2\u961F\u5386\u53F2`),onDeleteSession:(n,y)=>oe([n.id],null,`\u5DF2\u5220\u9664\u7EC8\u7AEF\u300C${_e(n,y??fe.sessions.indexOf(n),m?.[n.id])}\u300D`),onArchiveSession:ie}),(()=>{let n=new Map;for(let d of e.tasks)if(d.parentWorkspaceTaskId){let H=n.get(d.parentWorkspaceTaskId)??[];H.push(d),n.set(d.parentWorkspaceTaskId,H)}let y=d=>{let H=[...n.get(d)??[]],p=new Set([d]),V=new Set;for(;H.length;){let Ie=H.pop();if(!p.has(Ie.id)){p.add(Ie.id);for(let E of Sa(e,Ie,s,m))V.add(E.id);H.push(...n.get(Ie.id)??[])}}return V.size},F=(d,H=[])=>(0,a.jsx)("div",{children:(0,a.jsx)(ln,{task:d,descendantSessionCount:y(d.id),hasChildExecution:e.tasks.some(p=>p.parentWorkspaceTaskId===d.id),childTaskCount:e.tasks.filter(p=>p.parentWorkspaceTaskId===d.id).length,visibleSessions:Sa(e,d,s,m),now:f,liveTitles:m,activeTaskId:W,activeSessionId:I,manageMode:u,displayMode:v,selected:w?.taskIds.includes(d.id)??!1,selectedSessionIds:w?new Set(w.sessionIds):void 0,onToggleSelect:()=>q?.(d.id),onToggleSession:N,onOpen:()=>M(e,d),onOpenSession:p=>J(e,p),onRequestNewSession:()=>K(d),isOnlyTask:Ke===1,onClearSessions:async()=>{let p=d.sessions.map(V=>V.id);await oe(p,d,`\u5DF2\u6E05\u7A7A\u4EFB\u52A1\u300C${d.name}\u300D\u7684 ${p.length} \u4E2A\u7EC8\u7AEF`)},onClearTeamHistory:async p=>{await oe(p,d,`\u5DF2\u6E05\u7A7A\u4EFB\u52A1\u300C${d.name}\u300D\u7684 ${p.length} \u4E2A\u5DF2\u7ED3\u675F\u56E2\u961F\u4F1A\u8BDD`)},onDeleteSession:async(p,V)=>{let Ie=_e(p,V??d.sessions.indexOf(p),m?.[p.id]);await oe([p.id],d,`\u5DF2\u5220\u9664\u7EC8\u7AEF\u300C${Ie}\u300D`)},onArchiveSession:ie,onRename:async p=>{let V=await ue.updateTask(d.id,{name:p});we(`\u5DF2\u5C06\u4EFB\u52A1\u300C${d.name}\u300D\u91CD\u547D\u540D\u4E3A\u300C${V.name}\u300D`,"success"),await O()},onMoveSession:async p=>{await ue.moveSession(d.id,p),we(`\u5DF2\u79FB\u5165\u300C${d.name}\u300D\uFF0C\u8FD0\u884C\u76EE\u5F55\u4E0D\u53D8`,"success"),await ne()?.refreshSessions(),await O()},onDelete:()=>qe(d),onArchive:()=>xe(d),children:e.tasks.filter(p=>p.parentWorkspaceTaskId===d.id&&![...H,d.id].includes(p.id)).map(p=>F(p,[...H,d.id]))},d.id)},d.id);return e.tasks.filter(d=>!d.parentWorkspaceTaskId||!e.tasks.some(H=>H.id===d.parentWorkspaceTaskId)).map(d=>F(d))})()]})}),(0,a.jsx)(tn,{open:se,workspace:{id:e.workspaceId,name:e.workspaceName,cwd:e.workspaceCwd,layout:null,createdAt:"",lastOpenedAt:null},onStartAgent:Te,onDismiss:()=>Q(!1)})]})}function Nn({groups:e,loading:s,error:i,activeWorkspaceId:f,peekDirectoryId:c,onExpand:g}){return s&&e.length===0?(0,a.jsx)("div",{className:"sidebar-collapsed-tree-state","aria-label":"\u6B63\u5728\u52A0\u8F7D\u9879\u76EE",children:"\u2026"}):i&&e.length===0?(0,a.jsx)("div",{className:"sidebar-collapsed-tree-state error",title:i,"aria-label":i,children:"!"}):(0,a.jsx)(D,{vertical:!0,align:"center",gap:"small",className:"sidebar-collapsed-rail","aria-label":"\u9879\u76EE\u76EE\u5F55",children:e.map(m=>(0,a.jsx)(he,{className:te("sidebar-collapsed-rail-task",f===m.workspaceId&&"active"),title:m.workspaceName,"aria-label":`\u67E5\u770B\u76EE\u5F55 ${m.workspaceName}`,"aria-expanded":c===m.workspaceId,"aria-controls":c===m.workspaceId?"sidebar-peek":void 0,"data-sidebar-directory-id":m.workspaceId,"data-sidebar-directory-name":m.workspaceName,"data-pressed":f===m.workspaceId||void 0,onClick:()=>g(m.workspaceId),children:(0,a.jsx)(b,{name:"folder",size:18})},m.workspaceId))})}function cn({selectedSessionId:e=null,sessionTitles:s=null,sessionTitleGenerating:i=null,extraGroups:f=null,compact:c=!1,directoryId:g,peekDirectoryId:m,onExpand:A,onNavigate:W,onOpenDialog:I,searchQuery:u,onSearchChange:v,surfacesEnabled:w=!0}={}){let q=vt(),U=o.useRef(null),x=ot(),[N,M]=o.useState(c);o.useLayoutEffect(()=>{(!c||x)&&M(c)},[c,x]);let[J,K]=o.useState(null);o.useLayoutEffect(()=>{if(c||N||!J)return;let r=U.current?.querySelector(`[data-sidebar-tree-directory-id="${CSS.escape(J)}"] .workspace-row-main`);r?.scrollIntoView({block:"nearest",behavior:"instant"}),r?.focus({preventScroll:!0}),K(null)},[c,N,J]);let O=o.useSyncExternalStore(aa.subscribe,aa.getSnapshot,aa.getSnapshot),[L,k]=o.useState(0),G=o.useRef(O.open);o.useEffect(()=>{G.current&&!O.open&&k(r=>r+1),G.current=O.open},[O.open]);let{groups:$,loading:Z,error:se,reload:Q}=Zt(L),S=o.useMemo(()=>{if(!i)return $;let r=l=>l.id in i?{...l,titleGenerating:i[l.id]}:l;return $.map(l=>({...l,standaloneSessions:l.standaloneSessions.map(r),archivedSessions:l.archivedSessions?.map(r),tasks:l.tasks.map(T=>({...T,sessions:T.sessions.map(r),archivedSessions:T.archivedSessions?.map(r)}))}))},[$,i]),re=!c&&g===void 0;o.useEffect(()=>{if(re){if(!se){Va(null);return}Va({kind:S.length===0?"load":"sync",message:se,retry:()=>Q()})}},[re,se,S.length,Q]);let Ee=o.useContext(ua),{mode:z,setMode:De}=Ee,P=u??Ee.query,ee=v??Ee.setQuery,Re=qt(g===void 0?S:S.filter(r=>r.workspaceId===g),P,s??{}),B=z==="active"?bt(Re,e):Re,Ne=o.useMemo(()=>new Map(S.map(r=>[r.workspaceId,r.tasks.reduce((l,T)=>l+T.sessions.length,r.standaloneSessions.length)])),[S]),Je=o.useSyncExternalStore($e.subscribe,$e.getSnapshot,$e.getServerSnapshot),{workspaceId:We,taskId:Ce}=zt(S,Je,e),[ce,de]=o.useState(Date.now);o.useEffect(()=>{let r=window.setInterval(()=>de(Date.now()),6e4);return()=>window.clearInterval(r)},[]);let[ae,je]=yt("workspaceView","directory",ht(["directory","recent"],"directory"),String,"push"),[fe,Y]=fa(),[h,ke]=o.useState(!1),[Se,me]=o.useState("idle"),[Me,xe]=o.useState(""),[qe,Oe]=o.useState(""),Te=o.useRef(null),[oe,ie]=o.useState(!1),Ke=o.useRef(null),Ae=o.useRef(null),pe=o.useRef(!1),le=o.useId(),n=w&&!c&&(oe||!!P);o.useEffect(()=>{w||ie(!1)},[w]);let y=o.useCallback(()=>{Te.current!==null&&(window.clearTimeout(Te.current),Te.current=null)},[]);o.useEffect(()=>y,[y]),o.useEffect(()=>{if(n){pe.current=!0;let r=requestAnimationFrame(()=>Ke.current?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(r)}pe.current&&(pe.current=!1,Ae.current?.focus({preventScroll:!0}))},[n]);let[F,d]=o.useState(ta),[H,p]=o.useState(!1),[V,Ie]=o.useState(!1),E=Ct(F,B),Pe=za(E),Ia=(E.directoryIds?.length??0)>0,Na=E.sessionIds.length>0,t=Ia||Na,j=E.taskIds.length>0||E.sessionIds.length>0,ge=E.taskIds.length>0||E.sessionIds.length>0,Wa=$.some(r=>r.tasks.some(l=>E.taskIds.includes(l.id)&&(l.canArchive===!1||l.sessions.some(na))||l.sessions.some(T=>E.sessionIds.includes(T.id)&&(T.canArchive===!1||na(T))))||r.standaloneSessions.some(l=>E.sessionIds.includes(l.id)&&(l.canArchive===!1||na(l)))),ia=It(B),Ya=Pe>0&&(E.directoryIds?.length??0)===(ia.directoryIds?.length??0)&&E.taskIds.length===ia.taskIds.length&&E.sessionIds.length===ia.sessionIds.length,Ja=o.useCallback(()=>{y(),ke(!1),d(ta),p(!1),me("idle"),xe(""),Oe("")},[y]),Ca=o.useCallback((r,l,T)=>{W?.();let ye=ne();if(!ye){we("\u5DE5\u4F5C\u7A7A\u95F4\u8FD0\u884C\u73AF\u5883\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5\u3002","warning");return}let Le={workspaceId:l.workspaceId,workspaceName:r.global?"":r.workspaceName,taskId:l.id,taskName:l.name,cwd:l.cwd};return T&&(Le.preferredSessionId=T),ye.openTask(Le)},[W]),Xa=o.useCallback((r,l)=>{if(W?.(),l.teamChat){La.open("","","teamchat",l.teamChat.runId);return}let T=ne();if(!T){we("\u5DE5\u4F5C\u7A7A\u95F4\u8FD0\u884C\u73AF\u5883\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5\u3002","warning");return}let ye=Ka(r,l,$);if(ye){if($e.getSnapshot().taskId===ye.id){T.selectSession(l.id);return}Promise.resolve(Ca(r,ye,l.id)).then(()=>T.selectSession(l.id));return}!r.synthetic&&!r.global?T.openWorkspace({id:r.workspaceId,name:r.workspaceName,cwd:r.workspaceCwd,layout:null,createdAt:"",lastOpenedAt:null}):T.closeWorkspace(),T.selectSession(l.id)},[W,Ca,$]),dn=o.useCallback(async(r,l)=>{await ue.batchArchiveSessions([r],l),we(l?"\u5DF2\u5F52\u6863\u4F1A\u8BDD\uFF0C\u53EF\u5728\u6240\u5C5E\u4EFB\u52A1\u7684\u300C\u5DF2\u5F52\u6863\u4F1A\u8BDD\u300D\u4E2D\u6062\u590D":"\u5DF2\u6062\u590D\u4F1A\u8BDD","info"),await Q()},[Q]),mn=o.useCallback(async r=>{let l=$.map(T=>Ka(T,r,$)).find(Boolean)??null;await ha([r.id],l),we(`\u5DF2\u5220\u9664\u4F1A\u8BDD\u300C${_e(r,0,s?.[r.id])}\u300D`,"info"),await Q()},[Q,s,$]),Za=o.useRef(!0),ea=ut(),{employees:xa}=ea,et=o.useMemo(()=>_t(S),[S]),at=o.useMemo(()=>Qt(et,{query:P,employees:xa}),[et,P,xa]);o.useEffect(()=>{if(Za.current){Za.current=!1;return}k(r=>r+1)},[e,Ce]);let pn=async r=>{if(V||r==="archive"&&Wa)return;let l=E;if(za(l)!==0&&!(r==="delete"&&(l.directoryIds?.length??0)===0&&l.sessionIds.length===0)){Ie(!0),me("pending"),xe(""),Oe("");try{if(r==="delete"){let ye=l.directoryIds??[];for(let la of ye)await ue.remove(la,!0),$e.getSnapshot().workspaceId===la&&ne()?.closeWorkspace();let Le=$t(l,$);if(Le.length>0){let la=$.flatMap($a=>$a.tasks).find($a=>$a.sessions.some(un=>Le.includes(un.id)))??null;await ha(Le,la)}await ne()?.refreshSessions()}else{for(let ye of l.taskIds)await ue.archiveTask(ye),Ce===ye&&ne()?.closeWorkspace();l.sessionIds.length>0?(await ue.batchArchiveSessions(l.sessionIds,!0),await ne()?.refreshSessions()):await ne()?.refreshSessions()}let T=r==="delete"?`\u5DF2${ka(l,$)}`:`\u5DF2${xt(l)}`;me("done"),xe(T),await Q(),y(),Te.current=window.setTimeout(()=>{Te.current=null,Ja()},rt)}catch(T){me("error"),xe("\u5904\u7406\u5931\u8D25"),Oe(be(T,"\u65E0\u6CD5\u5904\u7406\u6240\u9009\u4EFB\u52A1\u3002")),y(),Te.current=window.setTimeout(()=>{Te.current=null,p(!1),me("idle"),xe("")},st)}finally{Ie(!1)}}};return(0,a.jsxs)("section",{ref:U,"data-sidebar-popup-owner":q,className:te("workspaces-panel",c&&"workspaces-panel-compact"),"aria-label":"\u5DE5\u4F5C\u533A\u6267\u884C\u4F1A\u8BDD",children:[(0,a.jsxs)("div",{className:"sidebar-full-list",hidden:N,inert:c,"aria-hidden":c||void 0,onTransitionEnd:r=>{r.target===r.currentTarget&&r.propertyName==="opacity"&&M(c)},children:[(0,a.jsxs)(a.Fragment,{children:[h?(0,a.jsxs)(D,{align:"center",wrap:!0,gap:"small",className:"sidebar-manage-bar",role:"toolbar","aria-label":"\u6279\u91CF\u64CD\u4F5C",children:[(0,a.jsx)("span",{className:"sidebar-manage-count",role:qe?"alert":void 0,children:qe||(Pe>0?`\u5DF2\u9009\u62E9 ${Pe} \u9879`:"\u70B9\u9009\u4EFB\u52A1\u6216\u7EC8\u7AEF")}),(0,a.jsx)(_,{className:"sidebar-manage-action",kind:"ghost",size:"small",disabled:V,onClick:()=>{d(Ya?ta:ia),p(!1)},children:Ya?"\u53D6\u6D88\u5168\u9009":"\u5168\u9009"}),H?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(_,{className:"sidebar-manage-action",kind:"ghost",size:"small",disabled:V,onClick:()=>p(!1),children:"\u8FD4\u56DE"}),(0,a.jsx)(_,{className:te("sidebar-manage-action",H==="delete"&&"danger"),kind:H==="delete"?"danger":"secondary",size:"small","aria-live":"polite",disabled:(V||Pe===0)&&Se!=="done",onClick:()=>{pn(H)},children:Se==="pending"?"\u6B63\u5728\u5904\u7406\u2026":Se==="done"||Se==="error"?Me:H==="delete"?`\u786E\u8BA4${ka(E,$)}`:`\u786E\u8BA4${Fa(E)}`})]}):(0,a.jsxs)(a.Fragment,{children:[ge&&!V&&(0,a.jsx)(Dt,{target:{kind:"selection",taskIds:E.taskIds,sessionIds:E.sessionIds},onChanged:async()=>{await ne()?.refreshSessions(),await Q()}}),j&&(0,a.jsx)(_,{className:"sidebar-manage-action",kind:"secondary",size:"small",disabled:V||Pe===0||Wa,title:Wa?"\u6240\u9009\u4EFB\u52A1\u4ECD\u5728\u6267\u884C\uFF0C\u5B8C\u6210\u540E\u624D\u80FD\u5F52\u6863":void 0,onClick:()=>p("archive"),children:Fa(E)}),t&&(0,a.jsx)(_,{className:"sidebar-manage-action danger",kind:"danger",size:"small",disabled:V||Pe===0,onClick:()=>p("delete"),children:ka(E,$)})]}),(0,a.jsx)(_,{className:"sidebar-manage-action",kind:"ghost",size:"small",disabled:V,onClick:Ja,children:"\u5B8C\u6210"})]}):g===void 0?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(D,{vertical:!0,gap:"small",style:{paddingTop:4,paddingBottom:8},className:"sidebar-presentation-tools",children:[(0,a.jsxs)(D,{align:"center",gap:4,style:{minWidth:0},className:te("sidebar-list-heading",n&&"is-searching"),children:[(0,a.jsxs)("div",{className:"sidebar-search-slot",children:[(0,a.jsx)(X.Text,{strong:!0,className:"sidebar-list-title","aria-hidden":n||void 0,children:"\u6267\u884C\u4F1A\u8BDD"}),(0,a.jsx)("div",{className:"sidebar-search-expand",id:le,"aria-hidden":!n,inert:!n||void 0,children:(0,a.jsx)(da,{ref:Ke,className:"sidebar-search-input",type:"search",value:P,clearable:!!P,clearLabel:"\u6E05\u7A7A\u5DE5\u4F5C\u533A\u641C\u7D22",onClear:()=>{ee?.(""),Ke.current?.focus({preventScroll:!0})},placeholder:ae==="recent"?"\u641C\u7D22\u6700\u8FD1\u4F1A\u8BDD":"\u641C\u7D22\u5DE5\u4F5C\u533A\u3001\u4EFB\u52A1\u6216\u4F1A\u8BDD","aria-label":"\u641C\u7D22\u5DE5\u4F5C\u533A\u3001\u4EFB\u52A1\u6216\u4F1A\u8BDD",tabIndex:n?0:-1,startSlot:(0,a.jsx)(b,{name:"search",size:14}),onChange:r=>ee?.(r.currentTarget.value),onKeyDown:r=>{r.key!=="Escape"||r.nativeEvent.isComposing||(r.preventDefault(),r.stopPropagation(),ee?.(""),ie(!1))}})})]}),(0,a.jsxs)(D,{align:"center",gap:4,style:{flexShrink:0},className:"sidebar-list-actions",children:[(0,a.jsx)(he,{ref:Ae,title:n?"\u6536\u8D77\u641C\u7D22":"\u641C\u7D22\u4EFB\u52A1\u6216\u4F1A\u8BDD","aria-label":n?"\u6536\u8D77\u641C\u7D22":"\u641C\u7D22\u4EFB\u52A1\u6216\u4F1A\u8BDD","aria-expanded":n,"aria-controls":le,onClick:()=>{n&&ee?.(""),ie(!n)},children:(0,a.jsx)(At,{active:n,from:"search",to:"back",size:16})}),(0,a.jsx)(ct,{popupOwner:q,open:fe,onOpenChange:Y,align:"end",ariaLabel:"\u4F1A\u8BDD\u5217\u8868\u9009\u9879",contentRole:"menu",trigger:(0,a.jsx)(he,{title:"\u5217\u8868\u9009\u9879","aria-label":"\u4F1A\u8BDD\u5217\u8868\u9009\u9879",children:(0,a.jsx)(b,{name:"more",size:16})}),children:(0,a.jsx)(it,{selectable:!1,items:[{key:"fold",icon:(0,a.jsx)(b,{name:"folder"}),label:z==="folded"?"\u5C55\u5F00\u4EFB\u52A1\u4F1A\u8BDD":"\u6536\u8D77\u4EFB\u52A1\u4F1A\u8BDD"},{key:"manage",icon:(0,a.jsx)(b,{name:"check"}),label:"\u6279\u91CF\u7BA1\u7406",disabled:Z&&S.length===0},{key:"refresh",icon:(0,a.jsx)(b,{name:"refresh"}),label:"\u5237\u65B0\u5217\u8868",disabled:Z}],onClick:({key:r})=>{Y(!1),r==="fold"?De(z==="folded"?"full":"folded"):r==="refresh"?Q():(ke(!0),d(ta),p(!1))}})})]})]}),(0,a.jsxs)(D,{align:"center",justify:"space-between",gap:4,className:"sidebar-display-row",children:[(0,a.jsx)(dt,{className:"sidebar-view-switch",ariaLabel:"\u4F1A\u8BDD\u7EC4\u7EC7\u65B9\u5F0F",tabs:[{value:"directory",label:"\u6309\u5DE5\u4F5C\u533A"},{value:"recent",label:"\u6700\u8FD1\u4F1A\u8BDD"}],value:ae,onValueChange:r=>{je(r),Y(!1);try{localStorage.setItem("wand.sidebar.workspaceView",r)}catch{}}}),(0,a.jsx)(Bt,{active:z==="active",onChange:r=>{Y(!1),De(r?"active":"full")}}),Z&&S.length>0?(0,a.jsx)("span",{className:"sidebar-refresh-state",role:"status",title:"\u6B63\u5728\u540C\u6B65",children:(0,a.jsx)(b,{name:"refresh",size:14})}):null]})]})}):null,(0,a.jsxs)(Lt,{value:`${ae}:${z}:${h}`,children:[g===void 0?(0,a.jsxs)("div",{hidden:h||ae!=="recent",inert:h||ae!=="recent",children:[(0,a.jsx)(rn,{entries:at,employees:xa,displayMode:z,query:P,disabled:ae!=="recent"||h||!w||c,contactsLoading:ea.loading,contactsError:ea.error?Xt(ea.error):null,onReloadContacts:ea.reload,listLoading:Z&&S.length===0,listError:!!(se&&S.length===0),liveTitles:s??{},selectedSessionId:e,now:ce,onOpen:r=>Xa(r.group,r.session),onStartConversation:()=>I?.(),onOpenConversation:r=>{W?.(),Ea.mode("chats"),Ea.select(Vt(r))},onArchiveSession:(r,l)=>dn(r,l),onDeleteSession:r=>mn(r)}),!Z&&!se&&at.length===0&&P?(0,a.jsx)(X.Paragraph,{type:"secondary",className:"sidebar-filter-empty",children:"\u6CA1\u6709\u5339\u914D\u7684\u4F1A\u8BDD\u3002"}):null,se&&S.length===0?(0,a.jsx)(_,{kind:"ghost",onClick:()=>{Q()},children:"\u91CD\u65B0\u52A0\u8F7D\u4F1A\u8BDD"}):null]}):null,(0,a.jsx)(Oa.Provider,{value:w&&!c&&!h&&(g!==void 0||ae==="directory"),children:(0,a.jsxs)("div",{hidden:g===void 0&&!h&&ae!=="directory",inert:g===void 0&&!h&&ae!=="directory",children:[!Z&&!se&&P&&B.length===0?(0,a.jsx)("div",{className:"sidebar-search-empty",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5DE5\u4F5C\u533A\u3001\u4EFB\u52A1\u6216\u4F1A\u8BDD\u3002"}):null,Z&&S.length===0?(0,a.jsx)("div",{"aria-busy":"true",role:"status","aria-label":"\u6B63\u5728\u52A0\u8F7D\u4EFB\u52A1\u5217\u8868",children:(0,a.jsx)(Ve,{children:(0,a.jsx)(ma,{active:!0,title:!1,paragraph:{rows:2}})})}):se&&S.length===0?(0,a.jsxs)("div",{className:"sidebar-load-error",role:"alert",children:[(0,a.jsx)("span",{children:"\u4EFB\u52A1\u5217\u8868\u52A0\u8F7D\u5931\u8D25"}),(0,a.jsx)("p",{children:se}),(0,a.jsx)(_,{kind:"ghost",type:"button",onClick:()=>{Q()},children:"\u91CD\u8BD5"})]}):!P||B.length>0?(0,a.jsxs)("div",{className:"sidebar-results","aria-label":"\u76EE\u5F55",children:[z==="active"&&B.length>0&&B.every(r=>r.tasks.length===0&&r.standaloneSessions.length===0)?(0,a.jsx)(X.Paragraph,{type:"secondary",className:"sidebar-filter-empty",role:"status",children:P?"\u6CA1\u6709\u5339\u914D\u7684\u6D3B\u52A8\u4F1A\u8BDD\u3002":"\u73B0\u5728\u6CA1\u6709\u6D3B\u52A8\u4F1A\u8BDD\u3002"}):null,B.length>0?(0,a.jsx)(D,{vertical:!0,gap:8,className:"workspaces-list","aria-label":"\u76EE\u5F55",children:B.map(r=>(0,a.jsx)(In,{group:r,searchQuery:P,totalSessionCount:Ne.get(r.workspaceId)??0,preview:g!==void 0,now:ce,directoryCount:B.length,liveTitles:s??void 0,displayMode:z,activeWorkspaceId:We,activeTaskId:Ce,activeSessionId:e,manageMode:h,selection:E,onToggleTask:l=>d(T=>Rt(T,l)),onToggleGroup:l=>{d(T=>Wt(T,l)),p(!1)},onToggleDefaultTask:l=>{d(T=>Ht(T,l)),p(!1)},onToggleSession:l=>d(T=>Tt(T,l)),onActiveTaskOpen:Ca,onOpenSession:Xa,onRequestNewSessionInTask:l=>{I?.();let T=S.find(ye=>ye.tasks.some(Le=>Le.id===l.id));Be.open({initialCwd:l.cwd||T?.workspaceCwd,workspaceId:l.workspaceId,workspaceTaskId:l.id,taskName:l.name})},onTasksChanged:Q,onOpenDialog:I},r.workspaceId))}):(0,a.jsx)(D,{vertical:!0,gap:"small",style:{padding:8},className:"workspaces-section-empty",children:z==="active"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:"\u73B0\u5728\u6CA1\u6709\u5728\u8DD1\u3001\u5F85\u5904\u7406\u6216\u521A\u5B8C\u6210\u7684\u4F1A\u8BDD\u3002"}),(0,a.jsxs)(_,{kind:"ghost",size:"small",className:"workspaces-empty-action",onClick:()=>De("full"),children:[(0,a.jsx)(b,{name:"eye",slot:"start",size:13}),(0,a.jsx)("span",{children:"\u663E\u793A\u5168\u90E8\u4EFB\u52A1"})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:"\u5F53\u524D\u6CA1\u6709\u5339\u914D\u7684\u6267\u884C\u4F1A\u8BDD\u3002\u672A\u6D3E\u53D1\u4EFB\u52A1\u4ECD\u5728\u4EFB\u52A1\u9762\u677F\uFF0C\u5F52\u6863\u8BB0\u5F55\u53EF\u901A\u8FC7\u641C\u7D22\u67E5\u770B\u3002"}),(0,a.jsx)(_,{kind:"ghost",size:"small",onClick:()=>{W?.(),La.open()},children:"\u67E5\u770B\u4EFB\u52A1\u8BA1\u5212"}),(0,a.jsxs)(_,{kind:"ghost",size:"small",className:"workspaces-empty-action","aria-label":"\u65B0\u5EFA\u4F1A\u8BDD",onClick:()=>{I?.(),Be.open()},children:[(0,a.jsx)(b,{name:"plus",slot:"start",size:13}),(0,a.jsx)("span",{children:"\u5F00\u59CB\u4E00\u4E2A\u4F1A\u8BDD"})]})]})})]}):null]})})]})]}),h||g!==void 0||ae!=="directory"?null:f]}),c?(0,a.jsx)(Nn,{groups:B,loading:Z,error:se,activeWorkspaceId:We,peekDirectoryId:m,onExpand:r=>{K(r??null),A?.()}}):null]})}function Wn(e){let s=wt();return(0,a.jsx)(ua.Provider,{value:s,children:(0,a.jsx)(cn,{...e})})}function Sr(e={}){let s=o.useContext(ua),i=`sidebar-${o.useId()}`;return(0,a.jsx)(St.Provider,{value:i,children:(0,a.jsx)(Oa.Provider,{value:e.surfacesEnabled!==!1&&!e.compact,children:s?(0,a.jsx)(cn,{...e}):(0,a.jsx)(Wn,{...e})})})}export{Nn as CompactDirectoryRail,Sr as WorkspacesPanel,on as shortenWorkspacePath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{shared22_d as W,shared22_e as ie}from"/assets/modules/
|
|
1
|
+
import{shared22_d as W,shared22_e as ie}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared31_a as ae}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared13_I as w,shared13_Ia as le,shared13_N as ee,shared13_Z as _,shared13_a as y,shared13_ab as re,shared13_ea as X,shared13_ga as G,shared13_ma as te,shared13_pa as p,shared13_ta as ne,shared13_ua as oe}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared11_a as T}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared5_c as L}from"/assets/modules/4af10e1f8a789204/runtime.js";var i=L(T());var Ne={xxxl:4,xxl:3,xl:3,lg:3,md:3,sm:2,xs:1},se=Ne;var ce=L(T()),Ee=ce.default.createContext(null),P=Ee;var F=L(T());var we=e=>ee(e).map(t=>({...t?.props,key:t.key}));function K(e,t,l){let o=F.useMemo(()=>t||we(l),[t,l]);return F.useMemo(()=>o.map(({span:n,...r})=>n==="filled"?{...r,filled:!0}:{...r,span:_(n)?n:W(e,n)}),[o,e])}var me=L(T());function ve(e,t){let l=[],o=[],a=!1,n=0;return e.filter(r=>r).forEach(r=>{let{filled:c,...s}=r;if(c){o.push(s),l.push(o),o=[],n=0;return}let m=t-n;n+=r.span||1,n>=t?(n>t?(a=!0,o.push({...s,span:m})):o.push(s),l.push(o),o=[],n=0):o.push(s)}),o.length>0&&l.push(o),l=l.map(r=>{let c=r.reduce((s,m)=>s+(m.span||1),0);if(c<t){let s=r[r.length-1];return s.span=t-(c-(s.span||1)),r}return r}),[l,a]}var ze=(e,t)=>{let[l,o]=(0,me.useMemo)(()=>ve(t,e),[t,e]);return l},de=ze;var Me=e=>e.children,pe=Me;var f=L(T());var h=L(T());var De=e=>{let{itemPrefixCls:t,component:l,span:o,className:a,style:n,labelStyle:r,contentStyle:c,bordered:s,label:m,content:u,colon:M,type:d,styles:v,classNames:S}=e,x=l,{classNames:D,styles:I}=h.default.useContext(P),[g,B]=G([D,S],[I,v],{props:e}),$={...r,...B.label},R={...c,...B.content};if(s){let C;d==="label"&&(C=$),d==="content"&&(C=R);let z=C?{...n,...C}:n;return h.default.createElement(x,{colSpan:o,style:z,className:y(a,{[`${t}-item-${d}`]:d==="label"||d==="content",[g.label]:g.label&&d==="label",[g.content]:g.content&&d==="content"})},w(m)&&h.default.createElement("span",null,m),w(u)&&h.default.createElement("span",null,u))}return h.default.createElement(x,{className:y(`${t}-item`,a),style:n,colSpan:o},h.default.createElement("div",{className:`${t}-item-container`},w(m)&&h.default.createElement("span",{style:$,className:y(`${t}-item-label`,g.label,{[`${t}-item-no-colon`]:!M})},m),w(u)&&h.default.createElement("span",{style:R,className:y(`${t}-item-content`,g.content)},u)))},O=De;function j(e,{colon:t,prefixCls:l,bordered:o},{component:a,type:n,showLabel:r,showContent:c,labelStyle:s,contentStyle:m,styles:u}){return e.map(({label:M,children:d,prefixCls:v=l,className:S,style:x,labelStyle:D,contentStyle:I,span:g=1,key:B,styles:$,classNames:R},C)=>{let z=B??C;if(typeof a=="string")return f.createElement(O,{key:`${n}-${z}`,className:S,style:x,classNames:R,styles:{label:{...s,...u?.label,...D,...$?.label},content:{...m,...u?.content,...I,...$?.content}},span:g,colon:t,component:a,itemPrefixCls:v,bordered:o,label:r?M:null,content:c?d:null,type:n});let H={label:{...s,...u?.label,...D,...$?.label},content:{...m,...u?.content,...I,...$?.content}};return[f.createElement(O,{key:`label-${z}`,className:S,style:x,classNames:R,styles:H,span:1,colon:t,component:a[0],itemPrefixCls:v,bordered:o,label:M,type:"label"}),f.createElement(O,{key:`content-${z}`,className:S,style:x,classNames:R,styles:H,span:g*2-1,component:a[1],itemPrefixCls:v,bordered:o,content:d,type:"content"})]})}var Ie=e=>{let t=f.useContext(P),{prefixCls:l,vertical:o,row:a,index:n,bordered:r}=e;return o?f.createElement(f.Fragment,null,f.createElement("tr",{key:`label-${n}`,className:`${l}-row`},j(a,e,{component:"th",type:"label",showLabel:!0,...t})),f.createElement("tr",{key:`content-${n}`,className:`${l}-row`},j(a,e,{component:"td",type:"content",showContent:!0,...t}))):f.createElement("tr",{key:n,className:`${l}-row`},j(a,e,{component:r?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0,...t}))},fe=Ie;var Be=e=>{let{componentCls:t,labelBg:l}=e;return{[`&${t}-bordered`]:{[`> ${t}-view`]:{border:`${p(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"> table":{tableLayout:"auto"},[`${t}-row`]:{borderBottom:`${p(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:first-child":{"> th:first-child, > td:first-child":{borderStartStartRadius:e.borderRadiusLG}},"&:last-child":{borderBottom:"none","> th:first-child, > td:first-child":{borderEndStartRadius:e.borderRadiusLG}},[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${p(e.padding)} ${p(e.paddingLG)}`,borderInlineEnd:`${p(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderInlineEnd:"none"}},[`> ${t}-item-label`]:{color:e.colorTextSecondary,backgroundColor:l,"&::after":{display:"none"}}}},[`&${t}-medium`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${p(e.paddingSM)} ${p(e.paddingLG)}`}}},[`&${t}-small`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${p(e.paddingXS)} ${p(e.padding)}`}}}}}},Le=e=>{let{componentCls:t,extraColor:l,itemPaddingBottom:o,itemPaddingEnd:a,colonMarginRight:n,colonMarginLeft:r,titleMarginBottom:c}=e;return{[t]:{...oe(e),...Be(e),"&-rtl":{direction:"rtl"},[`${t}-header`]:{display:"flex",alignItems:"center",marginBottom:c},[`${t}-title`]:{...ne,flex:"auto",color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG},[`${t}-extra`]:{marginInlineStart:"auto",color:l,fontSize:e.fontSize},[`${t}-view`]:{width:"100%",borderRadius:e.borderRadiusLG,table:{minWidth:"100%",tableLayout:"fixed",borderCollapse:"collapse"}},[`${t}-row`]:{"> th, > td":{paddingBottom:o,paddingInlineEnd:a},"> th:last-child, > td:last-child":{paddingInlineEnd:0},"&:last-child":{borderBottom:"none","> th, > td":{paddingBottom:0}}},[`${t}-item-label`]:{color:e.labelColor,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start","&::after":{content:'":"',position:"relative",top:-.5,marginInline:`${p(r)} ${p(n)}`},[`&${t}-item-no-colon::after`]:{content:'""'}},[`${t}-item-no-label`]:{"&::after":{margin:0,content:'""'}},[`${t}-item-content`]:{display:"table-cell",flex:1,color:e.contentColor,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word",overflowWrap:"break-word"},[`${t}-item`]:{paddingBottom:0,verticalAlign:"top","&-container":{display:"flex",[`${t}-item-label`]:{display:"inline-flex",alignItems:"baseline"},[`${t}-item-content`]:{display:"inline-flex",alignItems:"baseline",minWidth:"1em"}}},"&-medium":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingXS}}}}}},Te=e=>({labelBg:e.colorFillAlter,labelColor:e.colorTextTertiary,titleColor:e.colorText,titleMarginBottom:e.fontSizeSM*e.lineHeightSM,itemPaddingBottom:e.padding,itemPaddingEnd:e.padding,colonMarginRight:e.marginXS,colonMarginLeft:e.marginXXS/2,contentColor:e.colorText,extraColor:e.colorText}),ue=re("Descriptions",e=>{let t=le(e,{});return Le(t)},Te);var ge=i.forwardRef((e,t)=>{let{prefixCls:l,title:o,extra:a,column:n,colon:r=!0,bordered:c,layout:s,children:m,className:u,rootClassName:M,style:d,size:v,labelStyle:S,contentStyle:x,styles:D,items:I,classNames:g,...B}=e,{getPrefixCls:$,direction:R,className:C,style:z,classNames:H,styles:be}=te("descriptions"),b=$("descriptions",l),A=ie(),q=i.useMemo(()=>_(n)?n:W(A,n)??W(A,se)??3,[A,n]),J=K(A,I,m),U=ae(v),ye=de(q,J),[xe,$e]=ue(b),he={...e,column:q,items:J,size:U},Se=X(z),Re=X(d),[N,E]=G([H,g],[be,Se,D,Re],{props:he}),Ce=i.useMemo(()=>({labelStyle:S,contentStyle:x,styles:{label:E.label,content:E.content},classNames:{label:N.label,content:N.content}}),[S,x,E.label,E.content,N.label,N.content]),Q=i.useRef(null);i.useImperativeHandle(t,()=>({nativeElement:Q.current}));let Y=w(o),Z=w(a);return i.createElement(P.Provider,{value:Ce},i.createElement("div",{ref:Q,className:y(b,C,N.root,{[`${b}-medium`]:U==="medium"||U==="middle",[`${b}-small`]:U==="small",[`${b}-bordered`]:!!c,[`${b}-rtl`]:R==="rtl"},u,M,xe,$e),style:E.root,...B},(Y||Z)&&i.createElement("div",{className:y(`${b}-header`,N.header),style:E.header},Y&&i.createElement("div",{className:y(`${b}-title`,N.title),style:E.title},o),Z&&i.createElement("div",{className:y(`${b}-extra`,N.extra),style:E.extra},a)),i.createElement("div",{className:`${b}-view`},i.createElement("table",null,i.createElement("tbody",null,ye.map((k,V)=>i.createElement(fe,{key:V,index:V,colon:r,prefixCls:b,vertical:s==="vertical",bordered:c,row:k})))))))});ge.Item=pe;var yt=ge;export{yt as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
2
|
const __wandCssTextPool = Object.freeze([".wand-file-explorer-btn,.file-side-panel-header-actions .ant-btn,.file-explorer-up{width:32px;height:32px;flex-shrink:0}.wand-explorer-search-scope{justify-content:space-between;gap:8px;padding:0 0 8px}.wand-explorer-search-scope .ant-checkbox-wrapper{font-size:12px}.wand-explorer-search-scope>.ant-typography{font-size:11px;flex-shrink:0}.wand-explorer-search-count,.wand-explorer-search-duration{font-size:12px}.wand-explorer-search-limit{font-size:12px;line-height:1.5;padding-bottom:8px}.wand-explorer-results{overflow-x:hidden}@media(pointer:coarse){.wand-file-explorer-btn,.file-side-panel-header-actions .ant-btn,.file-explorer-up{width:44px;height:44px}.wand-file-explorer :is([role=treeitem],[role=option]){min-height:44px}}@media(hover:none),(pointer:coarse){.wand-explorer-keyhints{display:none}}\n"]);
|
|
3
|
-
import{a as Me,b as ee,c as Ce}from"/assets/modules/a1e9344b3fbd11ae/chunk.js";import{b as ye}from"/assets/modules/8492b5592532e563/chunk.js";import"/assets/modules/28795c8bb7f4e2e8/chunk.js";import{shared132_a as te,shared132_b as O,shared132_c as Y,shared132_d as de,shared132_e as Q,shared132_f as U}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared81_a as Ne}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared110_c as pe,shared110_d as q}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared84_a as Te}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared86_b as ce}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{a as Se}from"/assets/modules/2837772e09c2b62d/chunk.js";import{a as se}from"/assets/modules/c4705a6af423d824/chunk.js";import"/assets/modules/258f0487e8621dcc/chunk.js";import"/assets/modules/2aa0bc0eba53a5c9/chunk.js";import{a as ge}from"/assets/modules/0cb64ca968a6d25d/chunk.js";import"/assets/modules/4dd52ad71d002eab/chunk.js";import"/assets/modules/3d050c621f552e20/chunk.js";import{a as j}from"/assets/modules/cdb1909af2179a41/chunk.js";import{d as Ee,e as ie}from"/assets/modules/a919e64032fe3acc/chunk.js";import"/assets/modules/4718bec8ce29956e/chunk.js";import{shared118_a as ke}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared120_a as be}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared95_a as ne}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared23_c as Fe}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared88_a as we}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared24_a as _}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared54_a as H,shared54_b as oe}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import"/assets/modules/ad896e0a52316ead/chunk.js";import"/assets/modules/5d4915f6e1661d23/chunk.js";import"/assets/modules/91f4ec7a3631129c/chunk.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared26_b as xe}from"/assets/modules/405a98ab11edb2c1/runtime.js";import"/assets/modules/9a0704236531e38e/chunk.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared83_g as Re}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared55_a as X}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared60_a as M}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import"/assets/modules/0b00a661913662d4/chunk.js";import"/assets/modules/e7780cd2afeb29d9/chunk.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import"/assets/modules/bc56ae7841b21ca6/chunk.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared42_t as ve}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared47_a as le}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared61_a as k}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared28_c as ae}from"/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import "/assets/modules/405a98ab11edb2c1/runtime.js";import{shared13_S as Ye,shared13_zb as Z}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared11_a as re}from"/assets/modules/405a98ab11edb2c1/runtime.js";import{shared5_c as W}from"/assets/modules/405a98ab11edb2c1/runtime.js";var p=W(re(),1),me=W(re(),1),$e=W(Ye(),1);function Qe(t){return t.trim()}function Ue(t,n){let i=Qe(n);if(!i)return[];let l=t.toLowerCase(),c=l.length===t.length?l:t,a=l.length===t.length?i.toLowerCase():i,d=[],y=c.indexOf(a);for(;y!==-1;)d.push({start:y,end:y+a.length}),y=c.indexOf(a,y+a.length);return d}function De(t,n){let i=Ue(t,n);if(i.length===0)return[{value:t,match:!1}];let l=[],c=0;for(let a of i)a.start>c&&l.push({value:t.slice(c,a.start),match:!1}),l.push({value:t.slice(a.start,a.end),match:!0}),c=a.end;return c<t.length&&l.push({value:t.slice(c),match:!1}),l}function Je(t,n){let i=n.replace(/\\/g,"/").replace(/\/+$/,""),l=t.replace(/\\/g,"/").replace(/\/+$/,"");return i?l===i?"":l.startsWith(`${i}/`)?l.slice(i.length+1):l:l}function Ze(t,n){let i=Je(t,n);return i||Y(n)||"/"}function Ie(t,n){let i=[],l=new Map;for(let c of t){let a=O(c.path),d=l.get(a);d||(d={key:a,label:Ze(a,n),entries:[]},l.set(a,d),i.push(d)),d.entries.push(c)}return i}function Pe(t,n){if(n==="all")return[...t];let i=n==="dir"?"dir":"file";return t.filter(l=>l.type===i)}function ue(t){return t.type!=="file"||typeof t.size!="number"?"":Re(t.size)}function ze(t){let n=new Date(t);if(Number.isNaN(n.getTime()))return"";let i=l=>String(l).padStart(2,"0");return`${n.getFullYear()}-${i(n.getMonth()+1)}-${i(n.getDate())} ${i(n.getHours())}:${i(n.getMinutes())}`}function Ae(t){let n=0,i=0;for(let l of t)l.type==="dir"?i+=1:n+=1;return{all:t.length,file:n,dir:i}}var A=W(re(),1);var I=W(Z(),1),et=new Set(["ArrowDown","ArrowUp","Home","End"]);function Le({request:t,onSubmit:n,onDismiss:i,repository:l=Ce}){let c=t!==null,[a,d]=(0,A.useState)(""),[y,f]=(0,A.useState)(null),[T,C]=(0,A.useState)(!1),[R,E]=(0,A.useState)(!1),[v,s]=(0,A.useState)(""),[h,g]=(0,A.useState)(-1),b=(0,A.useRef)([]);if((0,A.useEffect)(()=>{t&&(d(t.initialDir),f(null),C(!1),E(!1),s(""),g(-1))},[t]),(0,A.useEffect)(()=>{if(!c)return;let r=a.trim();if(!r){f(null),C(!1),s("\u8BF7\u8F93\u5165\u76EE\u6807\u76EE\u5F55\u3002"),g(-1);return}let u=new AbortController;C(!0),s(""),g(-1);let B=window.setTimeout(()=>{l.list(r,{signal:u.signal}).then(P=>{u.signal.aborted||(f(P),s(""))}).catch(P=>{u.signal.aborted||(f(null),s(ce(P,"\u65E0\u6CD5\u8BFB\u53D6\u8BE5\u76EE\u5F55\u3002")))}).finally(()=>{u.signal.aborted||C(!1)})},140);return()=>{window.clearTimeout(B),u.abort()}},[c,a,l]),(0,A.useEffect)(()=>{h<0||b.current[h]?.scrollIntoView({block:"nearest"})},[h]),!t)return null;let S=y?.currentPath??a.trim();function z(r){d(r),f(null),s(""),g(-1)}async function w(r){if(!t||R)return;let u=te(r,Y(t.from));if(u===t.from){s("\u76EE\u6807\u4F4D\u7F6E\u4E0E\u5F53\u524D\u4F4D\u7F6E\u76F8\u540C\u3002");return}E(!0),s("");try{await n(t.from,u)||s("\u79FB\u52A8\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u76EE\u6807\u76EE\u5F55\u540E\u91CD\u8BD5\u3002")}catch(B){s(ce(B,"\u79FB\u52A8\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u76EE\u6807\u76EE\u5F55\u6216\u6743\u9650\u540E\u91CD\u8BD5\u3002"))}finally{E(!1)}}function F(r){z(r.path)}function L(r){if(!r.nativeEvent.isComposing){if(et.has(r.key)){r.preventDefault(),g(u=>ee(u,y?.items.length??0,r.key));return}if(r.key==="Enter"){if(r.preventDefault(),h>=0){let u=y?.items[h];u&&F(u);return}w(S)}}}let D=y?.items.find(r=>r.type==="parent")??null,N=Y(t.from);return(0,I.jsx)(we,{open:c,onOpenChange:r=>{r||i()},title:`\u79FB\u52A8${t.isDir?"\u6587\u4EF6\u5939":"\u6587\u4EF6"}`,description:`\u4E3A\u300C${N}\u300D\u9009\u62E9\u76EE\u6807\u76EE\u5F55\uFF0C\u786E\u8BA4\u540E\u7ACB\u5373\u79FB\u52A8\u3002`,className:"wand-task-library-dialog wand-folder-picker-library-dialog wand-move-dialog",closeLabel:"\u5173\u95ED\u79FB\u52A8\u5BF9\u8BDD\u6846",testId:"move-entry-dialog",dismissable:!R,children:(0,I.jsx)(ye,{noValidate:!0,"aria-busy":T||R,onSubmit:r=>{r.preventDefault(),w(S)},children:(0,I.jsxs)(k,{vertical:!0,gap:16,children:[(0,I.jsxs)(xe,{wrap:!0,"aria-label":"\u5FEB\u6377\u76EE\u5F55",children:[(0,I.jsx)(H,{size:"small",onClick:()=>z("/tmp"),children:"\u4E34\u65F6\u76EE\u5F55 /tmp"}),(0,I.jsx)(H,{size:"small",onClick:()=>z("/"),children:"\u6839\u76EE\u5F55 /"}),(0,I.jsx)(H,{size:"small",disabled:!D||T,onClick:()=>{D&&z(D.path)},children:"\u8FD4\u56DE\u4E0A\u7EA7"})]}),(0,I.jsx)(ge.Item,{label:"\u76EE\u6807\u76EE\u5F55",htmlFor:"wand-move-input",children:(0,I.jsx)(_,{id:"wand-move-input","data-wand-autofocus":!0,autoFocus:!0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-invalid":v?"true":"false","aria-controls":"wand-move-options","aria-activedescendant":h>=0?`wand-move-option-${h}`:void 0,value:a,onChange:r=>d(r.currentTarget.value),onKeyDown:L})}),(0,I.jsx)(Me,{id:"wand-move-options",optionPrefix:"wand-move-option",items:y?.items,loading:T,error:v,activeIndex:h,itemRefs:b,onActivate:F,onActiveIndex:g}),v?(0,I.jsx)(X,{type:"error",showIcon:!0,role:"alert",title:v}):null,(0,I.jsxs)(k,{justify:"space-between",align:"center",gap:12,wrap:!0,children:[(0,I.jsx)(M.Text,{type:"secondary",ellipsis:!0,style:{minWidth:0,flex:1},title:S,children:S||"\u8BF7\u8F93\u5165\u76EE\u6807\u76EE\u5F55"}),(0,I.jsx)(H,{kind:"primary",type:"submit",disabled:T||R||!S,children:R?"\u6B63\u5728\u79FB\u52A8\u2026":"\u79FB\u52A8\u5230\u6B64\u5904"})]})]})})})}var He=__wandCssTextPool[0];var e=W(Z(),1),tt=new Set(["png","jpg","jpeg","gif","webp","svg","avif","bmp","ico","heic","heif"]),rt=new Set(["mp4","webm","mov","mkv","m4v","ogv","mp3","wav","ogg","m4a","flac","aac","opus"]),nt=new Set(["zip","tar","gz","tgz","bz2","7z","rar","xz"]),at=new Set(["md","markdown","mdx"]),ot=new Set(["txt","log"]),it=new Set(["pdf"]),lt=new Set(["ts","tsx","js","jsx","mjs","cjs","json","jsonc","yaml","yml","toml","ini","cfg","conf","env","py","rb","go","rs","java","c","cpp","h","hpp","cs","swift","kt","scala","php","sh","bash","zsh","fish","lua","sql","graphql","proto","vue","svelte","html","htm","xml","css","scss","less","diff","patch"]),Be=[{value:"all",label:"\u5168\u90E8"},{value:"file",label:"\u6587\u4EF6"},{value:"dir",label:"\u6587\u4EF6\u5939"}];function We(t){let n=document.createElement("a");n.href=`/api/file-raw?download=1&path=${encodeURIComponent(t)}`,n.rel="noopener",document.body.appendChild(n),n.click(),n.remove()}function fe(t,n){if(t.type==="dir")return n?"folderOpen":"folder";let i=t.name.toLowerCase(),l=i.lastIndexOf("."),c=l>=0&&l<i.length-1?i.slice(l+1):"";return tt.has(c)?"image":rt.has(c)?"media":nt.has(c)?"archive":it.has(c)?"pdf":at.has(c)?"markdown":ot.has(c)?"file":lt.has(c)?"code":"file"}function V({name:t,size:n=16}){let i={className:"wand-fe-icon",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};switch(t){case"folder":return(0,e.jsx)("svg",{...i,children:(0,e.jsx)("path",{d:"M4 20a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2z"})});case"folderOpen":return(0,e.jsx)("svg",{...i,children:(0,e.jsx)("path",{d:"M6 14l1.5-3A2 2 0 0 1 9.2 10H20a2 2 0 0 1 1.9 2.5l-1.5 6A2 2 0 0 1 18.4 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"})});case"file":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("path",{d:"M14 3v5h5"})]});case"image":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,e.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,e.jsx)("path",{d:"m21 15-4.5-4.5L5 21"})]});case"code":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"m16 18 6-6-6-6"}),(0,e.jsx)("path",{d:"m8 6-6 6 6 6"})]});case"media":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,e.jsx)("path",{d:"m10 9 5 3-5 3z"})]});case"archive":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M4 4h16v4H4z"}),(0,e.jsx)("path",{d:"M5 8v12h14V8"}),(0,e.jsx)("path",{d:"M12 12v4"})]});case"pdf":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("path",{d:"M14 3v5h5M8 13h5M8 17h8"})]});case"markdown":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,e.jsx)("path",{d:"M7 15V9l3 4 3-4v6"})]});case"newFile":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("path",{d:"M14 3v5h5"}),(0,e.jsx)("path",{d:"M12 12v6M9 15h6"})]});case"newFolder":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M4 20a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2z"}),(0,e.jsx)("path",{d:"M12 11v6M9 14h6"})]});case"refresh":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M21 12a9 9 0 1 1-3-6.7"}),(0,e.jsx)("path",{d:"M21 3v6h-6"})]})}}function Ke(t){let n=t.gitStatus;return n?n.staged==="added"?{text:"A",className:"git-added",label:"\u5DF2\u6682\u5B58\u65B0\u589E"}:n.staged==="modified"?{text:"M",className:"git-modified",label:"\u5DF2\u6682\u5B58\u4FEE\u6539"}:n.staged==="deleted"?{text:"D",className:"git-deleted",label:"\u5DF2\u6682\u5B58\u5220\u9664"}:n.staged==="renamed"?{text:"R",className:"git-renamed",label:"\u5DF2\u6682\u5B58\u91CD\u547D\u540D"}:n.unstaged==="modified"?{text:"M",className:"git-modified",label:"\u672A\u6682\u5B58\u4FEE\u6539"}:n.unstaged==="deleted"?{text:"D",className:"git-deleted",label:"\u672A\u6682\u5B58\u5220\u9664"}:n.untracked?{text:"?",className:"git-untracked",label:"\u672A\u8DDF\u8E2A"}:null:null}function je(t){return{"git-added":"success","git-modified":"warning","git-deleted":"error","git-renamed":"purple"}[t.className]}function st(t){let n=[],i=ue(t);i&&n.push(i);let l=t.mtime?ze(t.mtime):"";return l&&n.push(l),t.type==="dir"&&n.push("\u6587\u4EF6\u5939"),n.length>0?`${t.path}
|
|
3
|
+
import{a as Me,b as ee,c as Ce}from"/assets/modules/5395fa57a47e9b96/chunk.js";import{b as ye}from"/assets/modules/76adde4019731df1/chunk.js";import"/assets/modules/c72c4f1d47c3726d/chunk.js";import{shared132_a as te,shared132_b as O,shared132_c as Y,shared132_d as de,shared132_e as Q,shared132_f as U}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared81_a as Ne}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared110_c as pe,shared110_d as q}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared84_a as Te}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared86_b as ce}from"/assets/modules/4af10e1f8a789204/runtime.js";import{a as Se}from"/assets/modules/8198bfd269c0caca/chunk.js";import{a as se}from"/assets/modules/98c14fc0474455a5/chunk.js";import"/assets/modules/42db858e4417c702/chunk.js";import"/assets/modules/c81a3d95b14cdcd4/chunk.js";import{a as ge}from"/assets/modules/4b9deeeb77570db3/chunk.js";import"/assets/modules/ef7f76b551fdc619/chunk.js";import"/assets/modules/4f30a913cc5b3f89/chunk.js";import{a as j}from"/assets/modules/e61136c22675ec7d/chunk.js";import{d as Ee,e as ie}from"/assets/modules/36ce8123a2079807/chunk.js";import"/assets/modules/b38924f45bfa71d6/chunk.js";import{shared118_a as ke}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared120_a as be}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared95_a as ne}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared23_c as Fe}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared88_a as we}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared24_a as _}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared54_a as H,shared54_b as oe}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/8e29056fb56439f7/chunk.js";import"/assets/modules/08c7b047195f138d/chunk.js";import"/assets/modules/a4dca2ffaf656d3c/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared26_b as xe}from"/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/f6f86d43c12b0864/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared83_g as Re}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared55_a as X}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared60_a as M}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/c422f47fd13dc4bc/chunk.js";import"/assets/modules/32c461164a1b364c/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/222f48948517167e/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared42_t as ve}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared47_a as le}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared61_a as k}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared28_c as ae}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared13_S as Ye,shared13_zb as Z}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared11_a as re}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared5_c as W}from"/assets/modules/4af10e1f8a789204/runtime.js";var p=W(re(),1),me=W(re(),1),$e=W(Ye(),1);function Qe(t){return t.trim()}function Ue(t,n){let i=Qe(n);if(!i)return[];let l=t.toLowerCase(),c=l.length===t.length?l:t,a=l.length===t.length?i.toLowerCase():i,d=[],y=c.indexOf(a);for(;y!==-1;)d.push({start:y,end:y+a.length}),y=c.indexOf(a,y+a.length);return d}function De(t,n){let i=Ue(t,n);if(i.length===0)return[{value:t,match:!1}];let l=[],c=0;for(let a of i)a.start>c&&l.push({value:t.slice(c,a.start),match:!1}),l.push({value:t.slice(a.start,a.end),match:!0}),c=a.end;return c<t.length&&l.push({value:t.slice(c),match:!1}),l}function Je(t,n){let i=n.replace(/\\/g,"/").replace(/\/+$/,""),l=t.replace(/\\/g,"/").replace(/\/+$/,"");return i?l===i?"":l.startsWith(`${i}/`)?l.slice(i.length+1):l:l}function Ze(t,n){let i=Je(t,n);return i||Y(n)||"/"}function Ie(t,n){let i=[],l=new Map;for(let c of t){let a=O(c.path),d=l.get(a);d||(d={key:a,label:Ze(a,n),entries:[]},l.set(a,d),i.push(d)),d.entries.push(c)}return i}function Pe(t,n){if(n==="all")return[...t];let i=n==="dir"?"dir":"file";return t.filter(l=>l.type===i)}function ue(t){return t.type!=="file"||typeof t.size!="number"?"":Re(t.size)}function ze(t){let n=new Date(t);if(Number.isNaN(n.getTime()))return"";let i=l=>String(l).padStart(2,"0");return`${n.getFullYear()}-${i(n.getMonth()+1)}-${i(n.getDate())} ${i(n.getHours())}:${i(n.getMinutes())}`}function Ae(t){let n=0,i=0;for(let l of t)l.type==="dir"?i+=1:n+=1;return{all:t.length,file:n,dir:i}}var A=W(re(),1);var I=W(Z(),1),et=new Set(["ArrowDown","ArrowUp","Home","End"]);function Le({request:t,onSubmit:n,onDismiss:i,repository:l=Ce}){let c=t!==null,[a,d]=(0,A.useState)(""),[y,f]=(0,A.useState)(null),[T,C]=(0,A.useState)(!1),[R,E]=(0,A.useState)(!1),[v,s]=(0,A.useState)(""),[h,g]=(0,A.useState)(-1),b=(0,A.useRef)([]);if((0,A.useEffect)(()=>{t&&(d(t.initialDir),f(null),C(!1),E(!1),s(""),g(-1))},[t]),(0,A.useEffect)(()=>{if(!c)return;let r=a.trim();if(!r){f(null),C(!1),s("\u8BF7\u8F93\u5165\u76EE\u6807\u76EE\u5F55\u3002"),g(-1);return}let u=new AbortController;C(!0),s(""),g(-1);let B=window.setTimeout(()=>{l.list(r,{signal:u.signal}).then(P=>{u.signal.aborted||(f(P),s(""))}).catch(P=>{u.signal.aborted||(f(null),s(ce(P,"\u65E0\u6CD5\u8BFB\u53D6\u8BE5\u76EE\u5F55\u3002")))}).finally(()=>{u.signal.aborted||C(!1)})},140);return()=>{window.clearTimeout(B),u.abort()}},[c,a,l]),(0,A.useEffect)(()=>{h<0||b.current[h]?.scrollIntoView({block:"nearest"})},[h]),!t)return null;let S=y?.currentPath??a.trim();function z(r){d(r),f(null),s(""),g(-1)}async function w(r){if(!t||R)return;let u=te(r,Y(t.from));if(u===t.from){s("\u76EE\u6807\u4F4D\u7F6E\u4E0E\u5F53\u524D\u4F4D\u7F6E\u76F8\u540C\u3002");return}E(!0),s("");try{await n(t.from,u)||s("\u79FB\u52A8\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u76EE\u6807\u76EE\u5F55\u540E\u91CD\u8BD5\u3002")}catch(B){s(ce(B,"\u79FB\u52A8\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u76EE\u6807\u76EE\u5F55\u6216\u6743\u9650\u540E\u91CD\u8BD5\u3002"))}finally{E(!1)}}function F(r){z(r.path)}function L(r){if(!r.nativeEvent.isComposing){if(et.has(r.key)){r.preventDefault(),g(u=>ee(u,y?.items.length??0,r.key));return}if(r.key==="Enter"){if(r.preventDefault(),h>=0){let u=y?.items[h];u&&F(u);return}w(S)}}}let D=y?.items.find(r=>r.type==="parent")??null,N=Y(t.from);return(0,I.jsx)(we,{open:c,onOpenChange:r=>{r||i()},title:`\u79FB\u52A8${t.isDir?"\u6587\u4EF6\u5939":"\u6587\u4EF6"}`,description:`\u4E3A\u300C${N}\u300D\u9009\u62E9\u76EE\u6807\u76EE\u5F55\uFF0C\u786E\u8BA4\u540E\u7ACB\u5373\u79FB\u52A8\u3002`,className:"wand-task-library-dialog wand-folder-picker-library-dialog wand-move-dialog",closeLabel:"\u5173\u95ED\u79FB\u52A8\u5BF9\u8BDD\u6846",testId:"move-entry-dialog",dismissable:!R,children:(0,I.jsx)(ye,{noValidate:!0,"aria-busy":T||R,onSubmit:r=>{r.preventDefault(),w(S)},children:(0,I.jsxs)(k,{vertical:!0,gap:16,children:[(0,I.jsxs)(xe,{wrap:!0,"aria-label":"\u5FEB\u6377\u76EE\u5F55",children:[(0,I.jsx)(H,{size:"small",onClick:()=>z("/tmp"),children:"\u4E34\u65F6\u76EE\u5F55 /tmp"}),(0,I.jsx)(H,{size:"small",onClick:()=>z("/"),children:"\u6839\u76EE\u5F55 /"}),(0,I.jsx)(H,{size:"small",disabled:!D||T,onClick:()=>{D&&z(D.path)},children:"\u8FD4\u56DE\u4E0A\u7EA7"})]}),(0,I.jsx)(ge.Item,{label:"\u76EE\u6807\u76EE\u5F55",htmlFor:"wand-move-input",children:(0,I.jsx)(_,{id:"wand-move-input","data-wand-autofocus":!0,autoFocus:!0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-invalid":v?"true":"false","aria-controls":"wand-move-options","aria-activedescendant":h>=0?`wand-move-option-${h}`:void 0,value:a,onChange:r=>d(r.currentTarget.value),onKeyDown:L})}),(0,I.jsx)(Me,{id:"wand-move-options",optionPrefix:"wand-move-option",items:y?.items,loading:T,error:v,activeIndex:h,itemRefs:b,onActivate:F,onActiveIndex:g}),v?(0,I.jsx)(X,{type:"error",showIcon:!0,role:"alert",title:v}):null,(0,I.jsxs)(k,{justify:"space-between",align:"center",gap:12,wrap:!0,children:[(0,I.jsx)(M.Text,{type:"secondary",ellipsis:!0,style:{minWidth:0,flex:1},title:S,children:S||"\u8BF7\u8F93\u5165\u76EE\u6807\u76EE\u5F55"}),(0,I.jsx)(H,{kind:"primary",type:"submit",disabled:T||R||!S,children:R?"\u6B63\u5728\u79FB\u52A8\u2026":"\u79FB\u52A8\u5230\u6B64\u5904"})]})]})})})}var He=__wandCssTextPool[0];var e=W(Z(),1),tt=new Set(["png","jpg","jpeg","gif","webp","svg","avif","bmp","ico","heic","heif"]),rt=new Set(["mp4","webm","mov","mkv","m4v","ogv","mp3","wav","ogg","m4a","flac","aac","opus"]),nt=new Set(["zip","tar","gz","tgz","bz2","7z","rar","xz"]),at=new Set(["md","markdown","mdx"]),ot=new Set(["txt","log"]),it=new Set(["pdf"]),lt=new Set(["ts","tsx","js","jsx","mjs","cjs","json","jsonc","yaml","yml","toml","ini","cfg","conf","env","py","rb","go","rs","java","c","cpp","h","hpp","cs","swift","kt","scala","php","sh","bash","zsh","fish","lua","sql","graphql","proto","vue","svelte","html","htm","xml","css","scss","less","diff","patch"]),Be=[{value:"all",label:"\u5168\u90E8"},{value:"file",label:"\u6587\u4EF6"},{value:"dir",label:"\u6587\u4EF6\u5939"}];function We(t){let n=document.createElement("a");n.href=`/api/file-raw?download=1&path=${encodeURIComponent(t)}`,n.rel="noopener",document.body.appendChild(n),n.click(),n.remove()}function fe(t,n){if(t.type==="dir")return n?"folderOpen":"folder";let i=t.name.toLowerCase(),l=i.lastIndexOf("."),c=l>=0&&l<i.length-1?i.slice(l+1):"";return tt.has(c)?"image":rt.has(c)?"media":nt.has(c)?"archive":it.has(c)?"pdf":at.has(c)?"markdown":ot.has(c)?"file":lt.has(c)?"code":"file"}function V({name:t,size:n=16}){let i={className:"wand-fe-icon",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};switch(t){case"folder":return(0,e.jsx)("svg",{...i,children:(0,e.jsx)("path",{d:"M4 20a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2z"})});case"folderOpen":return(0,e.jsx)("svg",{...i,children:(0,e.jsx)("path",{d:"M6 14l1.5-3A2 2 0 0 1 9.2 10H20a2 2 0 0 1 1.9 2.5l-1.5 6A2 2 0 0 1 18.4 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"})});case"file":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("path",{d:"M14 3v5h5"})]});case"image":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,e.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,e.jsx)("path",{d:"m21 15-4.5-4.5L5 21"})]});case"code":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"m16 18 6-6-6-6"}),(0,e.jsx)("path",{d:"m8 6-6 6 6 6"})]});case"media":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,e.jsx)("path",{d:"m10 9 5 3-5 3z"})]});case"archive":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M4 4h16v4H4z"}),(0,e.jsx)("path",{d:"M5 8v12h14V8"}),(0,e.jsx)("path",{d:"M12 12v4"})]});case"pdf":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("path",{d:"M14 3v5h5M8 13h5M8 17h8"})]});case"markdown":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,e.jsx)("path",{d:"M7 15V9l3 4 3-4v6"})]});case"newFile":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("path",{d:"M14 3v5h5"}),(0,e.jsx)("path",{d:"M12 12v6M9 15h6"})]});case"newFolder":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M4 20a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2z"}),(0,e.jsx)("path",{d:"M12 11v6M9 14h6"})]});case"refresh":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M21 12a9 9 0 1 1-3-6.7"}),(0,e.jsx)("path",{d:"M21 3v6h-6"})]})}}function Ke(t){let n=t.gitStatus;return n?n.staged==="added"?{text:"A",className:"git-added",label:"\u5DF2\u6682\u5B58\u65B0\u589E"}:n.staged==="modified"?{text:"M",className:"git-modified",label:"\u5DF2\u6682\u5B58\u4FEE\u6539"}:n.staged==="deleted"?{text:"D",className:"git-deleted",label:"\u5DF2\u6682\u5B58\u5220\u9664"}:n.staged==="renamed"?{text:"R",className:"git-renamed",label:"\u5DF2\u6682\u5B58\u91CD\u547D\u540D"}:n.unstaged==="modified"?{text:"M",className:"git-modified",label:"\u672A\u6682\u5B58\u4FEE\u6539"}:n.unstaged==="deleted"?{text:"D",className:"git-deleted",label:"\u672A\u6682\u5B58\u5220\u9664"}:n.untracked?{text:"?",className:"git-untracked",label:"\u672A\u8DDF\u8E2A"}:null:null}function je(t){return{"git-added":"success","git-modified":"warning","git-deleted":"error","git-renamed":"purple"}[t.className]}function st(t){let n=[],i=ue(t);i&&n.push(i);let l=t.mtime?ze(t.mtime):"";return l&&n.push(l),t.type==="dir"&&n.push("\u6587\u4EF6\u5939"),n.length>0?`${t.path}
|
|
4
4
|
${n.join(" \xB7 ")}`:t.path}var Ve=p.createContext(null);function Ge({entry:t,depth:n,snapshot:i,activePath:l,onToggle:c,onFileActivate:a,onContextMenu:d,renameState:y,setRenameState:f,pendingCreate:T,setPendingCreate:C}){let R=p.useContext(Ve),E=t.type==="dir",v=E?i.expanded.get(t.path):void 0,s=!!v,h=!!(E&&s&&v?.status==="loaded"&&v.entries.length===0),g=E&&!h,b=!E&&l===t.path,S=Ke(t),z=ue(t),[w,F]=p.useState(t.name);p.useEffect(()=>{y?.path===t.path&&F(t.name)},[y?.path,t.name]);let L=async()=>{let r=w.trim();if(f(null),!r||r===t.name)return;let u=te(O(t.path),r);u!==t.path&&await Q.execute({type:"rename",from:t.path,to:u})},D=T?.dir===t.path;return y?.path===t.path?(0,e.jsx)(k,{align:"center",gap:"small",className:"wand-explorer-row editing",style:{padding:"4px 8px",paddingLeft:8+n*12},children:(0,e.jsxs)(k,{align:"center",gap:"small",className:"wand-explorer-rename",style:{flex:1,minWidth:0},children:[(0,e.jsx)("span",{className:"wand-explorer-icon",children:(0,e.jsx)(V,{name:fe(t,!1)})}),(0,e.jsx)(_,{value:w,autoFocus:!0,spellCheck:!1,"aria-label":`\u91CD\u547D\u540D ${t.name}`,onChange:r=>F(r.currentTarget.value),onClick:r=>r.stopPropagation(),onBlur:()=>{L()},onKeyDown:r=>{r.nativeEvent.isComposing||(r.key==="Enter"?(r.preventDefault(),r.currentTarget.blur()):r.key==="Escape"&&(r.preventDefault(),f(null)))}})]})}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(ae,{className:`wand-explorer-row${b?" active":""}`,ref:r=>{r?R?.set(t.path,r):R?.delete(t.path)},block:!0,size:"small",type:b?"primary":"text",style:{paddingLeft:8+n*12,justifyContent:"flex-start",gap:4},role:"treeitem",tabIndex:0,"aria-label":t.name,"aria-level":n+1,"aria-expanded":E?s:void 0,"aria-selected":b,onKeyDown:r=>{if(r.target===r.currentTarget)if(r.key==="ContextMenu"||r.shiftKey&&r.key==="F10"){r.preventDefault();let u=r.currentTarget.getBoundingClientRect();d({x:u.left+12,y:u.bottom,entry:t,dir:O(t.path)})}else if(["ArrowDown","ArrowUp","Home","End"].includes(r.key)&&R){r.preventDefault();let u=[...R.values()].filter(K=>K.isConnected);u.sort((K,G)=>K===G?0:K.compareDocumentPosition(G)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);let P=u.indexOf(r.currentTarget)+(r.key==="ArrowDown"?1:-1);r.key==="Home"&&(P=0),r.key==="End"&&(P=u.length-1),u[Math.max(0,Math.min(u.length-1,P))]?.focus()}else r.key==="Enter"||r.key===" "?(r.preventDefault(),E?c(t.path):a(t.path)):E&&(r.key==="ArrowRight"&&!s||r.key==="ArrowLeft"&&s)&&(r.preventDefault(),c(t.path))},title:st(t),onClick:()=>{E?c(t.path):a(t.path)},onDoubleClick:()=>{E&&Q.execute({type:"navigate",dir:t.path})},onContextMenu:r=>{r.preventDefault(),d({x:r.clientX,y:r.clientY,entry:t,dir:O(t.path)})},children:[(0,e.jsx)("span",{className:`wand-explorer-chevron${s?" open":""}${g?"":" empty"}`,style:{width:12,flexShrink:0,transform:s?"rotate(90deg)":void 0},"aria-hidden":"true",children:g?"\u25B8":""}),(0,e.jsx)("span",{className:"wand-explorer-icon","aria-hidden":"true",children:(0,e.jsx)(V,{name:fe(t,s&&E)})}),(0,e.jsx)(M.Text,{ellipsis:!0,className:"wand-explorer-name",style:{flex:1,minWidth:0,textAlign:"left",color:"inherit"},children:t.name}),z?(0,e.jsx)(M.Text,{type:b?void 0:"secondary",className:"wand-explorer-size",style:{color:b?"inherit":void 0},children:z}):null,S&&(0,e.jsx)(ne,{className:`wand-explorer-git ${S.className}`,color:je(S),role:"img",title:S.label,"aria-label":S.label,children:S.text})]}),E&&s&&(0,e.jsxs)("div",{className:"wand-explorer-children",children:[v?.status==="loading"&&(0,e.jsxs)(k,{align:"center",gap:"small",className:"wand-explorer-row pending",style:{padding:"4px 8px",paddingLeft:8+(n+1)*12},role:"status",children:[(0,e.jsx)("span",{className:"wand-explorer-chevron empty"}),(0,e.jsx)("span",{className:"wand-explorer-name",children:"\u52A0\u8F7D\u4E2D"}),(0,e.jsx)(le,{className:"wand-explorer-dots",size:"small","aria-hidden":"true"})]}),v?.status==="error"&&(0,e.jsxs)(k,{align:"center",gap:"small",className:"wand-explorer-row error",style:{padding:"4px 8px",paddingLeft:8+(n+1)*12},role:"alert",children:[(0,e.jsx)("span",{className:"wand-explorer-chevron empty"}),(0,e.jsx)("span",{className:"wand-explorer-name",children:v.error||"\u8BFB\u53D6\u5931\u8D25"})]}),v?.status==="loaded"&&v.entries.length===0&&(0,e.jsxs)(k,{align:"center",gap:"small",className:"wand-explorer-row pending",style:{padding:"4px 8px",paddingLeft:8+(n+1)*12},children:[(0,e.jsx)("span",{className:"wand-explorer-chevron empty"}),(0,e.jsx)("span",{className:"wand-explorer-name",children:"\u7A7A\u6587\u4EF6\u5939"})]}),D&&T&&(0,e.jsx)(Xe,{depth:n+1,kind:T.kind,onCancel:()=>C(null),onSubmit:async r=>{let u=T.dir;C(null),r&&await Q.execute({type:T.kind==="file"?"create.file":"create.dir",dir:u,name:r})}}),v?.status==="loaded"&&v.entries.map(r=>(0,e.jsx)(Ge,{entry:r,depth:n+1,snapshot:i,activePath:l,onToggle:c,onFileActivate:a,onContextMenu:d,renameState:y,setRenameState:f,pendingCreate:T,setPendingCreate:C},r.path))]})]})}function Xe({depth:t,kind:n,onCancel:i,onSubmit:l}){let[c,a]=p.useState("");return(0,e.jsx)(k,{align:"center",gap:"small",className:"wand-explorer-row editing",style:{padding:"4px 8px",paddingLeft:8+t*12},children:(0,e.jsxs)(k,{align:"center",gap:"small",className:"wand-explorer-rename",style:{flex:1,minWidth:0},children:[(0,e.jsx)("span",{className:"wand-explorer-icon",children:(0,e.jsx)(V,{name:n==="file"?"file":"folder"})}),(0,e.jsx)(_,{value:c,autoFocus:!0,"aria-label":n==="file"?"\u65B0\u6587\u4EF6\u540D":"\u65B0\u6587\u4EF6\u5939\u540D",placeholder:n==="file"?"\u6587\u4EF6\u540D\uFF08\u56DE\u8F66\u521B\u5EFA\uFF0CEsc \u53D6\u6D88\uFF09":"\u6587\u4EF6\u5939\u540D\uFF08\u56DE\u8F66\u521B\u5EFA\uFF0CEsc \u53D6\u6D88\uFF09",spellCheck:!1,onChange:d=>a(d.currentTarget.value),onClick:d=>d.stopPropagation(),onBlur:()=>c.trim()?l(c):i(),onKeyDown:d=>{d.nativeEvent.isComposing||(d.key==="Enter"?(d.preventDefault(),l(c)):d.key==="Escape"&&(d.preventDefault(),i()))}})]})})}function ct({state:t,onClose:n,onAction:i}){let l=p.useRef(null),c=ve(),a=p.useRef(new Map),d=p.useRef(document.activeElement);p.useLayoutEffect(()=>{[...a.current.values()].find(h=>!h.disabled)?.focus({preventScroll:!0})},[]),p.useEffect(()=>{let h=b=>{l.current&&!l.current.contains(b.target)&&n()},g=b=>{b.target instanceof Node&&l.current?.contains(b.target)||n()};return window.addEventListener("mousedown",h,!0),window.addEventListener("scroll",g,!0),()=>{window.removeEventListener("mousedown",h,!0),window.removeEventListener("scroll",g,!0)}},[n]);let y=typeof window<"u"?window.innerWidth:1024,f=typeof window<"u"?window.innerHeight:768,T=Math.min(t.x,y-184),C=Math.min(t.y,f-400),R=t.entry,E=R?.type==="dir",v=E&&R?R.path:t.dir,s=(h,g,b={})=>(0,e.jsx)(Ee,{label:h,tone:b.danger?"danger":"default",ref:S=>{S?a.current.set(g,S):a.current.delete(g)},disabled:b.disabled,onClick:()=>{d.current instanceof HTMLElement&&d.current.isConnected&&d.current.focus({preventScroll:!0}),i(g)}});return(0,$e.createPortal)((0,e.jsxs)(se,{ref:l,size:"small",styles:{body:{padding:4}},className:"wand-explorer-context-menu",style:{position:"fixed",zIndex:1100,pointerEvents:"auto",width:180,maxHeight:"calc(100dvh - 16px)",overflowY:"auto",overscrollBehavior:"contain",left:Math.max(8,T),top:Math.max(8,C)},role:"menu","aria-label":"\u6587\u4EF6\u64CD\u4F5C",onKeyDown:h=>{if(h.key==="Escape")h.preventDefault(),h.stopPropagation(),n(),d.current instanceof HTMLElement&&d.current.focus();else if(["ArrowDown","ArrowUp","Home","End"].includes(h.key)){h.preventDefault();let g=[...a.current.values()].filter(z=>!z.disabled),b=g.indexOf(document.activeElement),S=h.key==="Home"?0:h.key==="End"?g.length-1:b+(h.key==="ArrowDown"?1:-1);g[(S+g.length)%g.length]?.focus()}},children:[s("\u65B0\u5EFA\u6587\u4EF6","newFile",{disabled:!v}),s("\u65B0\u5EFA\u6587\u4EF6\u5939","newDir",{disabled:!v}),(0,e.jsx)(ie,{}),R?(0,e.jsxs)(e.Fragment,{children:[E?s("\u8FDB\u5165\u6B64\u76EE\u5F55","navigate"):s("\u6253\u5F00","open"),s("\u5728\u6587\u4EF6\u6811\u4E2D\u663E\u793A","reveal"),s("\u590D\u5236\u5B8C\u6574\u8DEF\u5F84","copyPath"),s("\u590D\u5236\u76F8\u5BF9\u8DEF\u5F84","copyRelative"),!E&&s("\u4E0B\u8F7D\u6587\u4EF6","download"),(0,e.jsx)(ie,{}),s("\u91CD\u547D\u540D","rename"),s("\u79FB\u52A8\u5230\u2026","move"),s("\u5220\u9664","delete",{danger:!0})]}):(0,e.jsxs)(e.Fragment,{children:[s("\u5237\u65B0","refresh"),s("\u590D\u5236\u76EE\u5F55\u8DEF\u5F84","copyPath")]})]}),c??document.body)}function pt({snapshot:t,query:n,rows:i,activeIndex:l,listId:c,rowRefs:a,searchInputRef:d,onActiveIndex:y,onOpen:f,onReveal:T,onContextMenu:C,onFilter:R,onClear:E,onRetry:v}){let s=Ae(t.searchResults??[]),h=Ie(i,t.root),g=p.useRef(!1),b=new Map;i.forEach((w,F)=>b.set(w.path,F));let S=Be.find(w=>w.value===t.searchFilter),z=!t.searchError;return(0,e.jsxs)(k,{vertical:!0,className:"wand-explorer-search-panel",style:{flex:1,minHeight:0},children:[z&&(0,e.jsxs)(k,{wrap:!0,align:"center",gap:6,className:"wand-explorer-search-summary",style:{padding:"8px 0"},children:[(0,e.jsx)(M.Text,{className:"wand-explorer-search-count",children:t.searching?"\u641C\u7D22\u4E2D":`${s.all} \u9879\u7ED3\u679C${t.searchTruncated?" \xB7 \u5DF2\u622A\u65AD":""}`}),!t.searching&&t.searchDurationMs!==null&&s.all>0&&(0,e.jsxs)(M.Text,{type:"secondary",className:"wand-explorer-search-duration",children:[t.searchDurationMs," ms"]}),(0,e.jsx)(Fe,{className:"wand-explorer-search-filters",size:"small","aria-label":"\u6309\u7C7B\u578B\u7B5B\u9009\u7ED3\u679C",value:t.searchFilter,onMouseDown:()=>{g.current=!0},options:Be.map(w=>({value:w.value,disabled:s.all===0,label:(0,e.jsxs)(k,{align:"center",gap:4,className:"wand-explorer-filter-option",children:[w.label,(0,e.jsx)(M.Text,{type:"secondary",className:"wand-explorer-filter-count",children:s[w.value]})]})})),onChange:w=>{R(w),g.current&&d.current?.focus(),g.current=!1}})]}),!t.searching&&t.searchTruncated&&(0,e.jsx)(M.Text,{type:"secondary",className:"wand-explorer-search-limit",role:"status",children:"\u7ED3\u679C\u5DF2\u622A\u65AD\u3002\u8F93\u5165\u66F4\u5B8C\u6574\u540D\u79F0\uFF0C\u6216\u8FDB\u5165\u5B50\u76EE\u5F55\u7EE7\u7EED\u67E5\u627E\u3002"}),t.searching&&(0,e.jsx)(Se,{className:"wand-explorer-search-progress",percent:100,showInfo:!1,size:"small",status:"active","aria-label":"\u6B63\u5728\u641C\u7D22\u6587\u4EF6"}),t.searchError?(0,e.jsx)(X,{className:"wand-file-explorer-empty",type:"error",showIcon:!0,title:"\u641C\u7D22\u5931\u8D25",description:(0,e.jsxs)(k,{vertical:!0,gap:"small",children:[(0,e.jsx)("p",{className:"wand-file-explorer-empty-hint",children:t.searchError}),(0,e.jsx)(H,{kind:"ghost",size:"small",onClick:v,children:"\u91CD\u8BD5\u641C\u7D22"})]})}):i.length>0?(0,e.jsx)(k,{vertical:!0,id:c,className:"wand-explorer-results",role:"listbox","aria-label":"\u641C\u7D22\u7ED3\u679C",style:{flex:1,minHeight:0,overflowY:"auto"},children:h.map(w=>(0,e.jsxs)("div",{className:"wand-explorer-search-group",role:"group","aria-label":w.label,children:[(0,e.jsx)(se,{size:"small",variant:"borderless",className:"wand-explorer-search-group-label",title:(0,e.jsx)(M.Text,{ellipsis:!0,className:"wand-explorer-search-group-path",children:w.label}),extra:(0,e.jsx)(M.Text,{type:"secondary",className:"wand-explorer-search-group-count",children:w.entries.length}),styles:{body:{display:"none"},header:{minHeight:28,padding:"0 8px",fontSize:12}},style:{position:"sticky",top:0,zIndex:1,borderRadius:0,background:"var(--bg-secondary)"},children:(0,e.jsx)("span",{})}),w.entries.map(F=>{let L=b.get(F.path)??-1,D=L===l,N=Ke(F);return(0,e.jsxs)(ae,{block:!0,type:D?"primary":"text",size:"small",style:{justifyContent:"flex-start",gap:6,fontSize:13},id:`${c}-option-${L}`,ref:r=>{r?a.current?.set(F.path,r):a.current?.delete(F.path)},className:`wand-explorer-result${D?" active":""}`,role:"option","aria-selected":D,title:F.path,onMouseEnter:()=>y(L),onClick:()=>f(F),onDoubleClick:()=>T(F),onContextMenu:r=>{r.preventDefault(),C({x:r.clientX,y:r.clientY,entry:F,dir:O(F.path)})},children:[(0,e.jsx)("span",{className:"wand-explorer-result-icon","aria-hidden":"true",children:(0,e.jsx)(V,{name:fe(F,!1)})}),(0,e.jsx)(M.Text,{ellipsis:!0,className:"wand-explorer-result-name",style:{flex:1,minWidth:0,textAlign:"left",color:"inherit"},children:De(F.name,n).map((r,u)=>r.match?(0,e.jsx)(M.Text,{mark:!0,className:"wand-explorer-hit",children:r.value},u):(0,e.jsx)(p.Fragment,{children:r.value},u))}),N&&(0,e.jsx)(ne,{className:`wand-explorer-git ${N.className}`,color:je(N),role:"img",title:N.label,"aria-label":N.label,children:N.text})]},F.path)})]},w.key))}):t.searching?null:s.all>0?(0,e.jsxs)(j,{className:"wand-file-explorer-empty",description:null,children:[(0,e.jsxs)("p",{className:"wand-file-explorer-empty-title",children:["\u300C",S?.label??"\u5F53\u524D","\u300D\u7B5B\u9009\u4E0B\u6CA1\u6709\u7ED3\u679C"]}),(0,e.jsxs)(H,{kind:"ghost",size:"small",onClick:()=>R("all"),children:["\u663E\u793A\u5168\u90E8 ",s.all," \u9879"]})]}):(0,e.jsxs)(j,{className:"wand-file-explorer-empty",description:null,children:[(0,e.jsxs)("p",{className:"wand-file-explorer-empty-title",children:["\u6CA1\u6709\u5339\u914D\u300C",n,"\u300D\u7684\u6587\u4EF6"]}),(0,e.jsx)("p",{className:"wand-file-explorer-empty-hint",children:t.includeGenerated?"\u6309\u540D\u79F0\u641C\u7D22\uFF0C\u5305\u542B\u4F9D\u8D56\u4E0E\u751F\u6210\u76EE\u5F55\uFF1B\u6700\u591A\u5411\u4E0B 5 \u5C42\u3002":"\u6309\u540D\u79F0\u641C\u7D22\u9879\u76EE\u6587\u4EF6\uFF1B\u53EF\u52FE\u9009\u4E0A\u65B9\u9009\u9879\u5305\u542B\u4F9D\u8D56\u4E0E\u751F\u6210\u76EE\u5F55\u3002"}),(0,e.jsx)(H,{kind:"ghost",size:"small",onClick:E,children:"\u6E05\u9664\u641C\u7D22"})]}),i.length>0&&(0,e.jsxs)(k,{wrap:!0,gap:"small",className:"wand-explorer-keyhints","aria-hidden":"true",style:{padding:8},children:[(0,e.jsxs)("span",{children:[(0,e.jsx)(M.Text,{keyboard:!0,children:"\u2191"}),(0,e.jsx)(M.Text,{keyboard:!0,children:"\u2193"}),"\u9009\u62E9"]}),(0,e.jsxs)("span",{children:[(0,e.jsx)(M.Text,{keyboard:!0,children:"\u21B5"}),"\u6253\u5F00"]}),(0,e.jsxs)("span",{children:[(0,e.jsx)(M.Text,{keyboard:!0,children:"\u21E7\u21B5"}),"\u5728\u6811\u4E2D\u5B9A\u4F4D"]}),(0,e.jsxs)("span",{children:[(0,e.jsx)(M.Text,{keyboard:!0,children:"Esc"}),"\u6E05\u7A7A"]})]})]})}function Jt({root:t}){let n=p.useRef(new Map),i=p.useRef(new Map),l=p.useRef(null),c=p.useRef(null),a=dt(),d=(0,me.useSyncExternalStore)(q.subscribe,q.getSnapshot,q.getSnapshot),y=d.open?d.activePath:null,f=Q,[T,C]=p.useState(null),[R,E]=p.useState(null),[v,s]=p.useState(null),[h,g]=p.useState(null),[b,S]=p.useState(a.searchQuery),[z,w]=p.useState(0),F=a.searchQuery.trim(),L=F.length>0,D=p.useMemo(()=>Pe(a.searchResults??[],a.searchFilter),[a.searchResults,a.searchFilter]),N=D.length>0?Math.min(z,D.length-1):-1,r=p.useId();p.useEffect(()=>{t&&f.setRoot(t)},[t,f]),p.useEffect(()=>{S(a.searchQuery)},[a.searchQuery]),p.useEffect(()=>{w(0)},[F,a.searchFilter,a.searchResults]),p.useEffect(()=>{if(N<0)return;let o=D[N];o&&i.current.get(o.path)?.scrollIntoView({block:"nearest"})},[N,D]),p.useEffect(()=>{let o=a.revealPath;if(!o)return;let m=n.current.get(o),x=c.current;c.current=null,f.execute({type:"reveal.done"}),m&&(m.scrollIntoView({block:"center"}),(!x||x.path!==o||x.focus)&&m.focus({preventScroll:!0}))},[a.revealPath,f]),p.useEffect(()=>{if(!y)return;let o=U.getSnapshot();if(!o.root||!de(y,o.root)||o.searchQuery.trim())return;let m=n.current.get(y);if(m){m.scrollIntoView({block:"nearest"});return}c.current={path:y,focus:!1},f.execute({type:"reveal",path:y})},[y,f]);let u=o=>{c.current={path:o,focus:!0},f.execute({type:"reveal",path:o})},B=o=>{pe.open(o).then(m=>{if(m)return;let x=q.getSnapshot();x.activePath!==o||x.failure?.status!==415||(pe.execute({type:"close"}),We(o),J("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4EE5\u6587\u672C\u6253\u5F00\uFF0C\u5DF2\u5F00\u59CB\u4E0B\u8F7D","info"))})},P=a.root?a.expanded.get(a.root):void 0,K=async o=>{let m=T;if(C(null),!m)return;let x=m.entry;if(o==="newFile"){s({dir:m.entry?.type==="dir"?m.entry.path:m.dir,kind:"file"});return}if(o==="newDir"){s({dir:m.entry?.type==="dir"?m.entry.path:m.dir,kind:"dir"});return}if(o==="navigate"&&x){f.execute({type:"navigate",dir:x.path});return}if(o==="open"&&x){B(x.path);return}if(o==="reveal"&&x){u(x.path);return}if(o==="rename"&&x){E({path:x.path});return}if(o==="move"&&x){g({from:x.path,initialDir:O(x.path),isDir:x.type==="dir"});return}if(o==="delete"&&x){f.execute({type:"delete",path:x.path});return}if(o==="refresh"){f.execute({type:"refresh",dir:m.dir});return}if(o==="copyPath"){let $=await Oe(x?.path??m.dir);J($?"\u5DF2\u590D\u5236\u8DEF\u5F84":"\u590D\u5236\u5931\u8D25",$?"success":"error");return}if(o==="copyRelative"&&x&&a.root){let $=ut(x.path,a.root),he=await Oe($);J(he?"\u5DF2\u590D\u5236\u76F8\u5BF9\u8DEF\u5F84":"\u590D\u5236\u5931\u8D25",he?"success":"error");return}if(o==="download"&&x){We(x.path);return}},G=o=>{o.type==="dir"?u(o.path):B(o.path)},_e=o=>{if(o.nativeEvent.isComposing)return;if((o.key==="ArrowDown"||o.key==="ArrowUp")&&D.length>0){o.preventDefault(),w(ee(N,D.length,o.key));return}if(o.key!=="Enter")return;let m=N>=0?D[N]:void 0;m&&(o.preventDefault(),o.shiftKey?u(m.path):G(m))},qe=v&&a.root&&v.dir===a.root?(0,e.jsx)(Xe,{depth:0,kind:v.kind,onCancel:()=>s(null),onSubmit:async o=>{let m=v.dir;s(null),o&&await f.execute({type:v.kind==="file"?"create.file":"create.dir",dir:m,name:o})}}):null;return(0,e.jsxs)(Ve.Provider,{value:n.current,children:[(0,e.jsx)("style",{id:"wand-file-explorer-styles",children:He}),(0,e.jsxs)(k,{vertical:!0,className:"wand-file-explorer",style:{flex:1,minHeight:0},onContextMenu:o=>{o.target===o.currentTarget&&(o.preventDefault(),C({x:o.clientX,y:o.clientY,entry:null,dir:a.activeDir||a.root}))},children:[(0,e.jsxs)(k,{align:"center",gap:4,className:"wand-file-explorer-toolbar",style:{padding:"4px 0 8px",flexShrink:0},children:[(0,e.jsx)(k,{className:"wand-file-explorer-search",style:{flex:1,minWidth:0},onKeyDown:_e,children:(0,e.jsx)(be,{value:b,label:"\u641C\u7D22\u6587\u4EF6",placeholder:"\u641C\u7D22\u6587\u4EF6\u2026",disabled:!a.root,inputRef:l,listId:L?r:void 0,activeOptionId:N>=0?`${r}-option-${N}`:void 0,onValueChange:S,onSearch:o=>{f.execute({type:"search.start",query:o})}})}),(0,e.jsx)(oe,{className:"wand-file-explorer-btn",title:"\u65B0\u5EFA\u6587\u4EF6","aria-label":"\u65B0\u5EFA\u6587\u4EF6",disabled:!a.root||a.busy,onClick:()=>s({dir:a.activeDir||a.root,kind:"file"}),children:(0,e.jsx)(V,{name:"newFile",size:15})}),(0,e.jsx)(oe,{className:"wand-file-explorer-btn",title:"\u65B0\u5EFA\u6587\u4EF6\u5939","aria-label":"\u65B0\u5EFA\u6587\u4EF6\u5939",disabled:!a.root||a.busy,onClick:()=>s({dir:a.activeDir||a.root,kind:"dir"}),children:(0,e.jsx)(V,{name:"newFolder",size:15})})]}),(0,e.jsxs)(k,{align:"center",className:"wand-explorer-search-scope",children:[(0,e.jsx)(ke,{disabled:!a.root,checked:a.includeGenerated,onChange:o=>{f.execute({type:"search.scope",includeGenerated:o.target.checked})},children:"\u5305\u542B\u4F9D\u8D56\u4E0E\u751F\u6210\u76EE\u5F55"}),(0,e.jsx)(M.Text,{type:"secondary",title:"\u6309\u540D\u79F0\u5339\u914D\u5F53\u524D\u76EE\u5F55\u53CA\u5411\u4E0B 5 \u5C42\uFF0C\u6700\u591A\u8FD4\u56DE 80 \u9879\uFF1B\u9879\u76EE\u6587\u4EF6\u4F18\u5148\u3002",children:"\u540D\u79F0 \xB7 5 \u5C42"})]}),L?(0,e.jsx)(pt,{snapshot:a,query:F,rows:D,activeIndex:N,listId:r,rowRefs:i,searchInputRef:l,onActiveIndex:w,onOpen:G,onReveal:o=>u(o.path),onContextMenu:C,onFilter:o=>{f.execute({type:"search.filter",filter:o})},onClear:()=>{f.execute({type:"search.clear"}),l.current?.focus()},onRetry:()=>{f.execute({type:"search.start",query:b})}}):(0,e.jsxs)(k,{vertical:!0,className:"wand-file-explorer-tree",style:{flex:1,minHeight:0,overflowY:"auto",overflowX:"hidden"},role:"tree","aria-label":"\u6587\u4EF6\u6811",children:[!a.root&&(0,e.jsx)(j,{className:"wand-file-explorer-empty",description:null,children:"\u5C1A\u672A\u9009\u62E9\u5DE5\u4F5C\u76EE\u5F55\u3002"}),a.root&&P?.status==="loading"&&!P.entries.length&&(0,e.jsxs)(j,{className:"wand-file-explorer-empty",description:null,children:[(0,e.jsx)(le,{size:"small"}),"\u52A0\u8F7D\u4E2D\u2026"]}),a.root&&P?.status==="error"&&(0,e.jsx)(X,{className:"wand-file-explorer-empty",type:"error",showIcon:!0,title:"\u8BFB\u53D6\u5931\u8D25",description:(0,e.jsxs)(k,{vertical:!0,gap:"small",children:[(0,e.jsx)("p",{className:"wand-file-explorer-empty-title",children:P.error||"\u8BFB\u53D6\u76EE\u5F55\u5931\u8D25"}),(0,e.jsx)(H,{kind:"ghost",size:"small",onClick:()=>{f.execute({type:"refresh",dir:a.root})},children:"\u91CD\u65B0\u52A0\u8F7D"})]})}),P?.status==="loaded"&&(0,e.jsxs)(e.Fragment,{children:[qe,P.entries.length>0?P.entries.map(o=>(0,e.jsx)(Ge,{entry:o,depth:0,snapshot:a,activePath:y,onToggle:m=>{f.execute({type:"toggle",dir:m})},onFileActivate:B,onContextMenu:m=>C(m),renameState:R,setRenameState:E,pendingCreate:v,setPendingCreate:s},o.path)):(0,e.jsx)(j,{className:"wand-file-explorer-empty",description:null,children:"\u8FD9\u4E2A\u76EE\u5F55\u662F\u7A7A\u7684\u3002"})]})]})]}),T&&(0,e.jsx)(ct,{state:T,onClose:()=>C(null),onAction:o=>{K(o)}}),(0,e.jsx)(Le,{request:h,onDismiss:()=>g(null),onSubmit:async(o,m)=>{let x=h;if(!x)return!1;if(m===o)return J("\u76EE\u6807\u4F4D\u7F6E\u4E0E\u5F53\u524D\u4F4D\u7F6E\u76F8\u540C\u3002","warning"),!1;if(x.isDir&&de(m,o))return J("\u4E0D\u80FD\u628A\u6587\u4EF6\u5939\u79FB\u52A8\u5230\u5B83\u81EA\u5DF1\u6216\u5B83\u7684\u5B50\u76EE\u5F55\u4E2D\u3002","warning"),!1;let $=await f.execute({type:"move",from:o,to:m});return $&&g(null),$}})]})}function dt(){return(0,me.useSyncExternalStore)(U.subscribe,U.getSnapshot,U.getSnapshot)}async function Oe(t){try{return await Ne(t),!0}catch{return!1}}function J(t,n){Te.toast(t,{tone:n})}function ut(t,n){return t.startsWith(n)?t.slice(n.length).replace(/^\/+/,"")||".":t}export{Jt as FileExplorerHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{shared6_a as y}from"/assets/modules/
|
|
1
|
+
import{shared6_a as y}from"/assets/modules/4af10e1f8a789204/runtime.js";import{a as d}from"/assets/modules/4b9deeeb77570db3/chunk.js";import"/assets/modules/ef7f76b551fdc619/chunk.js";import"/assets/modules/4f30a913cc5b3f89/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared53_a as c}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared25_a as m}from"/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/8e29056fb56439f7/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared55_a as s}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared60_a as a}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/32c461164a1b364c/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared47_a as h}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared61_a as p}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared28_c as t}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared13_zb as g}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared11_a as N}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared5_c as l}from"/assets/modules/4af10e1f8a789204/runtime.js";var n=l(N(),1);var e=l(g(),1);function S({checking:i,switchServer:b,visual:f,httpHref:u="/"}){let[o,v]=n.useState(!1),[T,w]=n.useState(!1);return(0,e.jsx)("main",{className:"login-page",children:(0,e.jsxs)("div",{className:"login-layout",children:[(0,e.jsxs)("header",{className:"login-brand",children:[(0,e.jsx)(c,{style:{width:36,height:36}}),(0,e.jsx)("span",{children:"Wand"})]}),(0,e.jsxs)("section",{className:"login-left","aria-labelledby":"login-title",children:[(0,e.jsxs)(a.Title,{id:"login-title",level:1,className:"login-title",children:["\u4F60\u7684 AI \u5DE5\u4F5C\u53F0\u3002",(0,e.jsx)("br",{}),(0,e.jsx)("span",{children:"\u968F\u65F6\u63A5\u7EED\u3002"})]}),(0,e.jsxs)(a.Paragraph,{className:"login-intro",children:["\u8FDE\u63A5\u672C\u673A\u7684\u7EC8\u7AEF\u3001AI \u4F1A\u8BDD\u4E0E\u5DE5\u4F5C\u533A\uFF0C",(0,e.jsx)("br",{className:"login-desktop-break"}),"\u5728\u4F60\u9700\u8981\u7684\u5730\u65B9\u7EE7\u7EED\u5DE5\u4F5C\u3002"]}),(0,e.jsx)("div",{className:"left-spacer",children:f})]}),(0,e.jsxs)("section",{className:"login-right","aria-labelledby":"login-form-title","aria-busy":i,children:[(0,e.jsxs)("div",{className:"login-form-heading",children:[(0,e.jsx)(a.Title,{id:"login-form-title",level:2,children:i?"\u6B63\u5728\u6062\u590D\u4F1A\u8BDD":"\u6B22\u8FCE\u56DE\u6765"}),(0,e.jsx)(a.Paragraph,{type:"secondary",children:i?"\u6B63\u5728\u68C0\u67E5\u672C\u5730\u767B\u5F55\u4F1A\u8BDD\uFF0C\u8BF7\u7A0D\u5019\u3002":"\u7EE7\u7EED\u4F60\u7684\u5DE5\u4F5C\u3002"})]}),i?(0,e.jsx)("div",{className:"login-checking",children:(0,e.jsx)(h,{"aria-label":"\u6B63\u5728\u6062\u590D\u4F1A\u8BDD"})}):(0,e.jsx)("form",{id:"login-form",autoComplete:"on",noValidate:!0,children:(0,e.jsxs)(p,{vertical:!0,gap:20,children:[(0,e.jsx)("input",{name:"username",autoComplete:"username",value:"wand",readOnly:!0,tabIndex:-1,"aria-hidden":"true",style:{position:"absolute",width:1,height:1,opacity:0,pointerEvents:"none"}}),(0,e.jsxs)("div",{children:[(0,e.jsx)(d.Item,{label:"\u8BBF\u95EE\u5BC6\u7801",layout:"vertical",htmlFor:"password",style:{margin:0},children:(0,e.jsx)(m.Password,{id:"password",size:"large",placeholder:"\u8F93\u5165\u8BBF\u95EE\u5BC6\u7801",autoFocus:!0,autoComplete:o?"off":"current-password",visibilityToggle:{visible:!o&&T,onVisibleChange:r=>w(!o&&r)},onChange:r=>v(y(r.target.value)),"aria-describedby":"password-hint login-error","aria-invalid":"false"})}),(0,e.jsx)(a.Paragraph,{id:"password-hint",type:"secondary",className:"login-password-hint",children:"\u51ED\u636E\u53EA\u53D1\u9001\u5230\u672C\u673A Wand \u670D\u52A1\uFF0C\u4E0D\u4F1A\u4FDD\u5B58\u5728\u6B64\u9875\u9762\u3002"}),(0,e.jsx)("div",{className:"login-feedback","aria-live":"polite",children:(0,e.jsx)(a.Paragraph,{id:"login-error",type:"danger",className:"hidden",role:"alert"})})]}),(0,e.jsx)(t,{id:"login-button",type:"primary",size:"large",htmlType:"button",block:!0,children:"\u8FDB\u5165\u63A7\u5236\u53F0"}),b&&(0,e.jsx)(t,{id:"login-switch-server-button",type:"text",size:"large",block:!0,children:"\u5207\u6362\u670D\u52A1\u5668"}),(0,e.jsx)(s,{id:"login-cert-hint",className:"hidden",type:"warning",showIcon:!0,title:"\u8BC1\u4E66\u4E0D\u53D7\u4FE1\u4EFB\uFF0C\u767B\u5F55\u6001\u65E0\u6CD5\u4FDD\u5B58",description:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("p",{children:"\u6D4F\u89C8\u5668\u62D2\u7EDD\u4FDD\u5B58\u767B\u5F55 Cookie\u3002\u8BF7\u6539\u7528 HTTP\uFF0C\u6216\u5C06\u672C\u670D\u52A1\u8BC1\u4E66\u8BBE\u4E3A\u53D7\u4FE1\u4EFB\u540E\u91CD\u8BD5\u3002"}),(0,e.jsx)(t,{id:"login-cert-http-link",href:u,rel:"noopener",children:"\u6539\u7528 HTTP \u8BBF\u95EE"})]})})]})})]})]})})}export{S as LoginForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as R,b as z,c as M}from"/assets/modules/5395fa57a47e9b96/chunk.js";import{b as H}from"/assets/modules/76adde4019731df1/chunk.js";import"/assets/modules/c72c4f1d47c3726d/chunk.js";import{shared117_a as l,shared117_b as w}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared86_b as b}from"/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/42db858e4417c702/chunk.js";import"/assets/modules/c81a3d95b14cdcd4/chunk.js";import{a as K}from"/assets/modules/4b9deeeb77570db3/chunk.js";import"/assets/modules/ef7f76b551fdc619/chunk.js";import"/assets/modules/4f30a913cc5b3f89/chunk.js";import"/assets/modules/e61136c22675ec7d/chunk.js";import"/assets/modules/36ce8123a2079807/chunk.js";import"/assets/modules/b38924f45bfa71d6/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared88_a as B}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared24_a as N}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared54_a as y}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/8e29056fb56439f7/chunk.js";import"/assets/modules/08c7b047195f138d/chunk.js";import"/assets/modules/a4dca2ffaf656d3c/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared26_b as W}from"/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/f6f86d43c12b0864/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared55_a as D}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared60_a as A}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/c422f47fd13dc4bc/chunk.js";import"/assets/modules/32c461164a1b364c/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/222f48948517167e/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared61_a as C}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared13_zb as L}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared11_a as G}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared5_c as x}from"/assets/modules/4af10e1f8a789204/runtime.js";var o=x(G(),1);var t=x(L(),1),U=new Set(["ArrowDown","ArrowUp","Home","End"]);function ae({repository:F=M}){let n=(0,o.useSyncExternalStore)(w.subscribe,w.getSnapshot,w.getSnapshot),[s,I]=(0,o.useState)(""),[p,u]=(0,o.useState)(null),[g,k]=(0,o.useState)(!1),[d,m]=(0,o.useState)(!1),[h,i]=(0,o.useState)(""),[a,f]=(0,o.useState)(-1),S=(0,o.useRef)([]);(0,o.useEffect)(()=>{n.open&&(I(n.initialPath),u(null),k(!1),m(!1),i(""),f(-1))},[n.open,n.revision,n.initialPath]),(0,o.useEffect)(()=>{if(!n.open)return;let e=s.trim();if(!e){u(null),k(!1),i("\u8BF7\u8F93\u5165\u5DE5\u4F5C\u76EE\u5F55\u3002"),f(-1);return}let r=new AbortController;k(!0),i(""),f(-1);let c=window.setTimeout(()=>{F.list(e,{signal:r.signal}).then(P=>{r.signal.aborted||(u(P),i(""))}).catch(P=>{r.signal.aborted||(u(null),i(b(P,"\u65E0\u6CD5\u8BFB\u53D6\u8BE5\u76EE\u5F55\u3002")))}).finally(()=>{r.signal.aborted||k(!1)})},120);return()=>{window.clearTimeout(c),r.abort()}},[n.open,s,F]),(0,o.useEffect)(()=>{a<0||S.current[a]?.scrollIntoView({block:"nearest"})},[a]);function v(e){I(e),u(null),i(""),f(-1)}async function O(e){if(!d){l.setDismissable(!1),m(!0),i("");try{await l.choose(e)||i("\u65E0\u6CD5\u5E94\u7528\u5DE5\u4F5C\u76EE\u5F55\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5\u3002")}catch(r){i(b(r,"\u65E0\u6CD5\u8BFB\u53D6\u8BE5\u76EE\u5F55\u3002"))}finally{l.setDismissable(!0),m(!1)}}}function T(e){if(e.type==="parent"){v(e.path);return}O(e.path)}async function V(e){e.preventDefault();let r=s.trim();if(!r||d){r||i("\u8BF7\u8F93\u5165\u5DE5\u4F5C\u76EE\u5F55\u3002");return}l.setDismissable(!1),m(!0),i("");try{let c=await F.list(r);await l.choose(c.currentPath)||i("\u65E0\u6CD5\u5E94\u7528\u5DE5\u4F5C\u76EE\u5F55\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\u540E\u91CD\u8BD5\u3002")}catch(c){i(b(c,"\u65E0\u6CD5\u8BFB\u53D6\u8BE5\u76EE\u5F55\u3002"))}finally{l.setDismissable(!0),m(!1)}}function q(e){if(e.nativeEvent.isComposing)return;if(U.has(e.key)){e.preventDefault(),f(c=>z(c,p?.items.length??0,e.key));return}if(e.key!=="Enter"||a<0)return;let r=p?.items[a];r&&(e.preventDefault(),T(r))}let E=p?.items.find(e=>e.type==="parent")??null;return(0,t.jsx)(B,{open:n.open,onOpenChange:e=>{e||l.close()},title:"\u9009\u62E9\u5DE5\u4F5C\u76EE\u5F55",description:"\u8F93\u5165\u8DEF\u5F84\u6216\u4ECE\u76EE\u5F55\u5EFA\u8BAE\u4E2D\u9009\u62E9\uFF0C\u540E\u7EED\u65B0\u4F1A\u8BDD\u4F1A\u4ECE\u8BE5\u76EE\u5F55\u542F\u52A8\u3002",className:"wand-task-library-dialog wand-folder-picker-library-dialog",closeLabel:"\u5173\u95ED\u5DE5\u4F5C\u76EE\u5F55\u9009\u62E9\u5668",testId:"folder-picker-dialog",dismissable:!d,children:(0,t.jsx)(H,{noValidate:!0,"aria-busy":g||d,onSubmit:e=>{V(e)},children:(0,t.jsxs)(C,{vertical:!0,gap:16,children:[(0,t.jsxs)(W,{wrap:!0,"aria-label":"\u5FEB\u6377\u76EE\u5F55",children:[(0,t.jsx)(y,{size:"small",onClick:()=>v("/tmp"),children:"\u4E34\u65F6\u76EE\u5F55 /tmp"}),(0,t.jsx)(y,{size:"small",onClick:()=>v("/"),children:"\u6839\u76EE\u5F55 /"}),(0,t.jsx)(y,{size:"small",disabled:!E||g,onClick:()=>{E&&v(E.path)},children:"\u8FD4\u56DE\u4E0A\u7EA7"})]}),(0,t.jsx)(K.Item,{label:"\u5DE5\u4F5C\u76EE\u5F55",htmlFor:"wand-folder-picker-input",children:(0,t.jsx)(N,{id:"wand-folder-picker-input","data-wand-autofocus":!0,autoFocus:!0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-invalid":h?"true":"false","aria-controls":"wand-folder-picker-options","aria-activedescendant":a>=0?`wand-folder-picker-option-${a}`:void 0,value:s,onChange:e=>I(e.currentTarget.value),onKeyDown:q})}),(0,t.jsx)(R,{id:"wand-folder-picker-options",optionPrefix:"wand-folder-picker-option",items:p?.items,loading:g,error:h,activeIndex:a,itemRefs:S,onActivate:T,onActiveIndex:f}),h?(0,t.jsx)(D,{type:"error",showIcon:!0,role:"alert",title:h}):null,(0,t.jsxs)(C,{justify:"space-between",align:"center",gap:12,wrap:!0,children:[(0,t.jsx)(A.Text,{type:"secondary",ellipsis:!0,style:{minWidth:0,flex:1},title:p?.currentPath??s,children:p?.currentPath??s}),(0,t.jsx)(y,{kind:"primary",type:"submit",disabled:g||d||!s.trim(),children:d?"\u6B63\u5728\u5E94\u7528\u2026":"\u4F7F\u7528\u6B64\u76EE\u5F55"})]})]})})})}export{ae as FolderPickerHost};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
2
|
const __wandCssTextPool = Object.freeze([".wand-settings-library-grid,.wand-settings-library-default-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));gap:16px}.wand-settings-library-field{margin-bottom:0;min-width:0}.wand-settings-library-number,.wand-settings-library-select,.wand-settings-library-select>button{width:100%}.wand-settings-library-save-bar{display:flex;flex-direction:column;align-items:flex-start;gap:12px}.wand-settings-library-action-label{display:grid}.wand-settings-library-action-label>span{grid-area:1/1}.wand-settings-library-action-measure{visibility:hidden}\n"]);
|
|
3
|
-
import{a as A}from"/assets/modules/
|
|
3
|
+
import{a as A}from"/assets/modules/84b79a33c64e146c/chunk.js";import{a as y}from"/assets/modules/4b9deeeb77570db3/chunk.js";import{h as F}from"/assets/modules/36ce8123a2079807/chunk.js";import{shared135_a as T}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared25_a as k}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared54_a as N}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared55_a as C}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared42_h as v,shared42_i as S}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared48_b as L}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared13_zb as R}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared11_a as B}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared5_c as h}from"/assets/modules/4af10e1f8a789204/runtime.js";var l=h(B(),1);var e=h(R(),1);typeof document<"u"&&L("wand-settings-field-styles",__wandCssTextPool[0]);function q({title:t,description:n,action:i,children:a}){return(0,e.jsxs)("section",{className:"wand-settings-library-section","aria-label":t,children:[(0,e.jsxs)("div",{className:"wand-settings-library-section-heading",children:[(0,e.jsx)("h3",{children:t}),i]}),n?(0,e.jsx)("p",{children:n}):null,(0,e.jsx)(y,{component:!1,layout:"vertical",children:(0,e.jsx)("div",{className:"wand-settings-library-section-body",children:a})})]})}function z({children:t}){return(0,e.jsx)("div",{className:"wand-settings-library-grid",children:t})}function J({label:t,hint:n,error:i,htmlFor:a,children:s}){return(0,e.jsx)(y.Item,{label:t,htmlFor:a,layout:"vertical",validateStatus:i?"error":void 0,help:i||n,className:"wand-settings-library-field",children:s})}function K({id:t,value:n,onChange:i,type:a="text",placeholder:s,disabled:r,invalid:o,autoComplete:g,min:m,max:b,list:p}){let[c,u]=(0,l.useState)(!1);return a==="number"?(0,e.jsx)(A,{id:t,value:n===""?null:String(n),stringMode:!0,className:"wand-settings-library-number",min:m===void 0?void 0:String(m),max:b===void 0?void 0:String(b),disabled:r,placeholder:s,status:o?"error":void 0,"aria-invalid":o||void 0,autoComplete:g,onChange:d=>i(d===null?"":String(d))}):(0,e.jsx)(k,{id:t,type:a==="password"&&c?"text":a,value:n,placeholder:s,disabled:r,status:o?"error":void 0,"aria-invalid":o||void 0,autoComplete:g,list:p,spellCheck:!1,suffix:a==="password"?(0,e.jsx)(N,{type:"button",kind:"ghost",className:"wand-settings-library-secret-toggle",disabled:r,"aria-controls":t,"aria-pressed":c,"aria-label":c?"\u9690\u85CF\u654F\u611F\u5185\u5BB9":"\u663E\u793A\u654F\u611F\u5185\u5BB9",onClick:()=>u(d=>!d),children:c?"\u9690\u85CF":"\u663E\u793A"}):void 0,onChange:d=>i(d.currentTarget.value)})}function Q({id:t,ariaLabel:n,value:i,options:a,onChange:s,disabled:r,searchable:o,searchPlaceholder:g}){return(0,e.jsx)("div",{id:t,className:"wand-settings-library-select",children:(0,e.jsx)(T,{ariaLabel:n,value:i,options:a,disabled:r,searchable:o,searchPlaceholder:g,onValueChange:s})})}function U({label:t,description:n,checked:i,onCheckedChange:a,disabled:s}){return(0,e.jsxs)("div",{className:"wand-settings-library-toggle-row",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("strong",{children:t}),n?(0,e.jsx)("span",{children:n}):null]}),(0,e.jsx)(F,{ariaLabel:t,checked:i,disabled:s,onCheckedChange:a})]})}function I({children:t,tone:n="info"}){return t?(0,e.jsx)(C,{type:n,title:t,role:"status","aria-live":"polite",showIcon:!0}):null}function E(t,n){let[i,a]=(0,l.useState)(null),s=(0,l.useRef)(!1),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>()=>{r.current!==null&&window.clearTimeout(r.current)},[]),(0,l.useEffect)(()=>{if(t){s.current=!0,a(null),r.current!==null&&(window.clearTimeout(r.current),r.current=null);return}!s.current||n!=="success"&&n!=="error"||(s.current=!1,a(n),r.current!==null&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>{r.current=null,a(null)},n==="error"?S:v))},[t,n]),i}function X({label:t,pending:n=!1,disabled:i,onSave:a,status:s,tone:r}){return(0,e.jsxs)("div",{className:"wand-settings-library-save-bar",children:[(0,e.jsx)(M,{kind:"primary",pending:n,settled:r==="error"?"error":r==="success"||r==="warning"?"success":null,disabled:i,pendingLabel:"\u4FDD\u5B58\u4E2D\u2026",successLabel:"\u5DF2\u4FDD\u5B58",errorLabel:"\u4FDD\u5B58\u5931\u8D25",onClick:a,children:t}),(0,e.jsx)(I,{tone:r,children:s})]})}function M({children:t,pending:n=!1,settled:i=null,pendingLabel:a="\u5904\u7406\u4E2D\u2026",successLabel:s="\u5DF2\u5B8C\u6210",errorLabel:r="\u5931\u8D25",onClick:o,disabled:g,...m}){let b=E(n,i),[p,c]=(0,l.useState)(null),u=(0,l.useRef)(null);(0,l.useEffect)(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]);let d=p??b,w=f=>{u.current!==null&&window.clearTimeout(u.current),c(f),u.current=window.setTimeout(()=>{u.current=null,c(null)},f==="error"?S:v)};return(0,e.jsx)(N,{...m,className:["wand-settings-library-action",m.className].filter(Boolean).join(" "),"aria-busy":n||void 0,"aria-live":"polite",disabled:g||n||d==="success",onClick:o?async f=>{try{let x=await o(f);x===!1?w("error"):x===!0&&w("success")}catch{w("error")}}:void 0,children:(0,e.jsxs)("span",{className:"wand-settings-library-action-label",children:[(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:t}),(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:a}),(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:s}),(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:r}),(0,e.jsx)("span",{children:n?a:d==="success"?s:d==="error"?r:t})]})})}export{q as a,z as b,J as c,K as d,Q as e,U as f,I as g,X as h,M as i};
|