agentworkshop 0.7.5 → 0.7.7
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/.AgentWorkShop/prompts/host-tools.json +1 -1
- package/.output/.AgentWorkShop/prompts/host-tools.json +1 -1
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{rzGB_ojX.js → 3612gD2V.js} +2 -2
- package/.output/public/_nuxt/8eIQAVlb.js +1 -0
- package/.output/public/_nuxt/Ah9qOv1m.js +1 -0
- package/.output/public/_nuxt/{DdPeifHR.js → B4Fia4FB.js} +1 -1
- package/.output/public/_nuxt/B7aqqzkY.js +1 -0
- package/.output/public/_nuxt/BJ-fxrSw.js +1 -0
- package/.output/public/_nuxt/{DPDqAD1e.js → BSXx2vqR.js} +1 -1
- package/.output/public/_nuxt/{CdSgfcYR.js → BVZjSVs2.js} +1 -1
- package/.output/public/_nuxt/{DP6bdyIp.js → BVzDoF8t.js} +1 -1
- package/.output/public/_nuxt/BYL0Rjqj.js +7 -0
- package/.output/public/_nuxt/{CXmkVXS5.js → BjVLsC3M.js} +1 -1
- package/.output/public/_nuxt/{7ZABjMRh2.js → BkfchkK62.js} +1 -1
- package/.output/public/_nuxt/BnVoQ74r.js +1 -0
- package/.output/public/_nuxt/Bnp4vIAf.js +1 -0
- package/.output/public/_nuxt/BsMpJf7S.js +70 -0
- package/.output/public/_nuxt/{Z8k0uMSI.js → Bt_HDizI.js} +1 -1
- package/.output/public/_nuxt/Bu-P92Pe.js +18 -0
- package/.output/public/_nuxt/ButLXkjo.js +2 -0
- package/.output/public/_nuxt/C-GarxYC.js +1 -0
- package/.output/public/_nuxt/{D8DDDzV62.js → C2iWjzEC2.js} +1 -1
- package/.output/public/_nuxt/{HWXLx5Hz.js → C8dxXc6K.js} +5 -5
- package/.output/public/_nuxt/CGdPdJPP.js +1 -0
- package/.output/public/_nuxt/{CyygA0q4.js → CQiKcuoG.js} +4 -4
- package/.output/public/_nuxt/{CN7Zh8GQ.js → CRGlf1Gb.js} +1 -1
- package/.output/public/_nuxt/{DSBfvCi5.js → CblLEiCZ.js} +7 -7
- package/.output/public/_nuxt/Cd15nPnG2.js +1 -0
- package/.output/public/_nuxt/{OwJ1LJkF.js → CsCpu2Zh.js} +1 -1
- package/.output/public/_nuxt/CvbHIGQY2.js +1 -0
- package/.output/public/_nuxt/Cyk3du4K2.js +1 -0
- package/.output/public/_nuxt/{DVQAz9WI.js → D4qXvjuV.js} +2 -2
- package/.output/public/_nuxt/{CfIXY-ET.js → DCEyMaN-.js} +1 -1
- package/.output/public/_nuxt/{BFYNhG9S.js → DCXIGxzT.js} +1 -1
- package/.output/public/_nuxt/{B9aPoQvt.js → DM8DS9MA.js} +1 -1
- package/.output/public/_nuxt/{ChnfyQHz.js → DNzaswei.js} +1 -1
- package/.output/public/_nuxt/{CrFGZYVB2.js → DYZBdSSg2.js} +1 -1
- package/.output/public/_nuxt/{dObsRdSQ.js → DZk24ego.js} +1 -1
- package/.output/public/_nuxt/DeYsUzhr.js +1 -0
- package/.output/public/_nuxt/Dk6pq9JB2.js +1 -0
- package/.output/public/_nuxt/{ByGNWgAr.js → Do88WZG2.js} +3 -3
- package/.output/public/_nuxt/{R_WxTozV2.js → Du-eSpo2.js} +1 -1
- package/.output/public/_nuxt/OmpTerminalPanel.B_Pl5Ynm.css +1 -0
- package/.output/public/_nuxt/{Bsc69G4x.js → VnIWJ0ts.js} +3 -3
- package/.output/public/_nuxt/_id_.BzKMZnLe.css +1 -0
- package/.output/public/_nuxt/_id_.CbpDAWRh.css +1 -0
- package/.output/public/_nuxt/{_wsId_.DET_GinP.css → _wsId_.COUzMXpP.css} +1 -1
- package/.output/public/_nuxt/agents.BlejnOOC.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/14df171d-89cb-43ec-ad6f-9df72d6da7f5.json +1 -0
- package/.output/public/_nuxt/daq.zZ8GR433.css +1 -0
- package/.output/public/_nuxt/{default.D17kXlD6.css → default.V3_hUJq1.css} +1 -1
- package/.output/public/_nuxt/{B4GHHF6d2.js → fQUs58kX2.js} +1 -1
- package/.output/public/_nuxt/p7wSGMtc.js +1 -0
- package/.output/public/_nuxt/tRBT-plo.js +1 -0
- package/.output/server/chunks/_/SearchOutlined.mjs +4 -4
- package/.output/server/chunks/_/SearchOutlined.mjs.map +1 -1
- package/.output/server/chunks/_/character-asset.repo.mjs +3 -6
- package/.output/server/chunks/_/character-asset.repo.mjs.map +1 -1
- package/.output/server/chunks/_/host-bindings.mjs +1 -1
- package/.output/server/chunks/_/nitro.mjs +4967 -2035
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/_/scene-layout.repo.mjs +4 -10
- package/.output/server/chunks/_/scene-layout.repo.mjs.map +1 -1
- package/.output/server/chunks/build/{Col-D7fjGDF6.mjs → Col-biaNnEPf.mjs} +2 -2
- package/.output/server/chunks/build/{Col-D7fjGDF6.mjs.map → Col-biaNnEPf.mjs.map} +1 -1
- package/.output/server/chunks/build/{OmpTerminalPanel-B_SYhmgb.mjs → OmpTerminalPanel-COphA1br.mjs} +20 -19
- package/.output/server/chunks/build/OmpTerminalPanel-COphA1br.mjs.map +1 -0
- package/.output/server/chunks/build/{TownView-Bl8Gkcxi.mjs → TownView-B5KifIaT.mjs} +4 -4
- package/.output/server/chunks/build/{TownView-Bl8Gkcxi.mjs.map → TownView-B5KifIaT.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-GnRJPykX.mjs → _id_-C-ewLgfl.mjs} +119 -119
- package/.output/server/chunks/build/{_id_-GnRJPykX.mjs.map → _id_-C-ewLgfl.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-CWLFGZjV.mjs → _id_-Ct4Jhvl1.mjs} +42 -38
- package/.output/server/chunks/build/_id_-Ct4Jhvl1.mjs.map +1 -0
- package/.output/server/chunks/build/{_wsId_-BhQMjyHG.mjs → _wsId_-CanI_6Su.mjs} +591 -53
- package/.output/server/chunks/build/{_wsId_-BhQMjyHG.mjs.map → _wsId_-CanI_6Su.mjs.map} +1 -1
- package/.output/server/chunks/build/{agents-D4l1icvn.mjs → agents-DSOptxXA.mjs} +146 -91
- package/.output/server/chunks/build/agents-DSOptxXA.mjs.map +1 -0
- package/.output/server/chunks/build/{alert-gH-s7yIh.mjs → alert-qJnjyRcP.mjs} +3 -3
- package/.output/server/chunks/build/{alert-gH-s7yIh.mjs.map → alert-qJnjyRcP.mjs.map} +1 -1
- package/.output/server/chunks/build/{button-BhbX5ACI.mjs → button-DEcZFcqN.mjs} +3 -3
- package/.output/server/chunks/build/{button-BhbX5ACI.mjs.map → button-DEcZFcqN.mjs.map} +1 -1
- package/.output/server/chunks/build/{card-l4BbX67w.mjs → card-Dipvaykh.mjs} +5 -5
- package/.output/server/chunks/build/{card-l4BbX67w.mjs.map → card-Dipvaykh.mjs.map} +1 -1
- package/.output/server/chunks/build/{channel-templates-DqjtC-R0.mjs → channel-templates-BK0KuPOd.mjs} +13 -12
- package/.output/server/chunks/build/channel-templates-BK0KuPOd.mjs.map +1 -0
- package/.output/server/chunks/build/{checkbox-BF11p3dH.mjs → checkbox-dzcpU_Cd.mjs} +4 -4
- package/.output/server/chunks/build/{checkbox-BF11p3dH.mjs.map → checkbox-dzcpU_Cd.mjs.map} +1 -1
- package/.output/server/chunks/build/{daq-BOgpn9sl.mjs → daq-D9RA_uze.mjs} +102 -102
- package/.output/server/chunks/build/{daq-BOgpn9sl.mjs.map → daq-D9RA_uze.mjs.map} +1 -1
- package/.output/server/chunks/build/dcw-BTM5YU-B.mjs +1 -1
- package/.output/server/chunks/build/{default-CKJWhkot.mjs → default-BfWGTlbj.mjs} +81 -23
- package/.output/server/chunks/build/{default-CKJWhkot.mjs.map → default-BfWGTlbj.mjs.map} +1 -1
- package/.output/server/chunks/build/{drawer-CVValqoh.mjs → drawer-Cmh90erI.mjs} +3 -3
- package/.output/server/chunks/build/{drawer-CVValqoh.mjs.map → drawer-Cmh90erI.mjs.map} +1 -1
- package/.output/server/chunks/build/{dropdown-ByCsEWlQ.mjs → dropdown-CGQ0KAzA.mjs} +2 -2
- package/.output/server/chunks/build/{dropdown-ByCsEWlQ.mjs.map → dropdown-CGQ0KAzA.mjs.map} +1 -1
- package/.output/server/chunks/build/{dropdown-Dex8PXu6.mjs → dropdown-vhn1NPFs.mjs} +4 -4
- package/.output/server/chunks/build/{dropdown-Dex8PXu6.mjs.map → dropdown-vhn1NPFs.mjs.map} +1 -1
- package/.output/server/chunks/build/{input-number-BBlRoAJ7.mjs → input-number-Bd55elNN.mjs} +5 -5
- package/.output/server/chunks/build/{input-number-BBlRoAJ7.mjs.map → input-number-Bd55elNN.mjs.map} +1 -1
- package/.output/server/chunks/build/{input--KMeLYqZ.mjs → input-sf_BT6o6.mjs} +3 -3
- package/.output/server/chunks/build/{input--KMeLYqZ.mjs.map → input-sf_BT6o6.mjs.map} +1 -1
- package/.output/server/chunks/build/logs-Dyk0I2I9.mjs +1 -1
- package/.output/server/chunks/build/{menu-xN-SXb9Q.mjs → menu-WCrlpYVh.mjs} +3 -3
- package/.output/server/chunks/build/{menu-xN-SXb9Q.mjs.map → menu-WCrlpYVh.mjs.map} +1 -1
- package/.output/server/chunks/build/{modal-DrCOcjrl.mjs → modal-yvUquPj5.mjs} +4 -4
- package/.output/server/chunks/build/{modal-DrCOcjrl.mjs.map → modal-yvUquPj5.mjs.map} +1 -1
- package/.output/server/chunks/build/{monitor-KW8WLOJd.mjs → monitor-MIOvsyLa.mjs} +21 -21
- package/.output/server/chunks/build/{monitor-KW8WLOJd.mjs.map → monitor-MIOvsyLa.mjs.map} +1 -1
- package/.output/server/chunks/build/pages-DR2bzczM.mjs +1 -1
- package/.output/server/chunks/build/{plugins-B-ZNey0Z.mjs → plugins-DnOBIWGg.mjs} +7 -7
- package/.output/server/chunks/build/{plugins-B-ZNey0Z.mjs.map → plugins-DnOBIWGg.mjs.map} +1 -1
- package/.output/server/chunks/build/{popconfirm-C5H1Qoh3.mjs → popconfirm-CRaHcz5O.mjs} +4 -4
- package/.output/server/chunks/build/{popconfirm-C5H1Qoh3.mjs.map → popconfirm-CRaHcz5O.mjs.map} +1 -1
- package/.output/server/chunks/build/{useWorkshopApi-Bh5VUHWu.mjs → segmented-DPe9ZzLO.mjs} +7 -78
- package/.output/server/chunks/build/segmented-DPe9ZzLO.mjs.map +1 -0
- package/.output/server/chunks/build/{select-D7H2ysgT.mjs → select-D-CeE5vY.mjs} +3 -3
- package/.output/server/chunks/build/{select-D7H2ysgT.mjs.map → select-D-CeE5vY.mjs.map} +1 -1
- package/.output/server/chunks/build/{settings-Cr06lbRy.mjs → settings-DA8IkGLo.mjs} +11 -11
- package/.output/server/chunks/build/{settings-Cr06lbRy.mjs.map → settings-DA8IkGLo.mjs.map} +1 -1
- package/.output/server/chunks/build/{space-DCwIlnkI.mjs → space-CCBYAkXt.mjs} +2 -2
- package/.output/server/chunks/build/{space-DCwIlnkI.mjs.map → space-CCBYAkXt.mjs.map} +1 -1
- package/.output/server/chunks/build/{switch-VC0m9ede.mjs → switch-CelRXpcy.mjs} +3 -3
- package/.output/server/chunks/build/{switch-VC0m9ede.mjs.map → switch-CelRXpcy.mjs.map} +1 -1
- package/.output/server/chunks/build/{table-BksLg3Q_.mjs → table-Cswq-l2r.mjs} +10 -10
- package/.output/server/chunks/build/{table-BksLg3Q_.mjs.map → table-Cswq-l2r.mjs.map} +1 -1
- package/.output/server/chunks/build/{tabs-CzUfD3iX.mjs → tabs-BM3tAh_J.mjs} +5 -5
- package/.output/server/chunks/build/{tabs-CzUfD3iX.mjs.map → tabs-BM3tAh_J.mjs.map} +1 -1
- package/.output/server/chunks/build/{tag-oQI3VtqM.mjs → tag-NO9jEqKy.mjs} +4 -4
- package/.output/server/chunks/build/{tag-oQI3VtqM.mjs.map → tag-NO9jEqKy.mjs.map} +1 -1
- package/.output/server/chunks/build/{teams-QR3BBF7A.mjs → teams-BhSKBBBM.mjs} +15 -14
- package/.output/server/chunks/build/teams-BhSKBBBM.mjs.map +1 -0
- package/.output/server/chunks/build/{tokens-DFvr_TLj.mjs → tokens-D_eyxmcv.mjs} +16 -16
- package/.output/server/chunks/build/{tokens-DFvr_TLj.mjs.map → tokens-D_eyxmcv.mjs.map} +1 -1
- package/.output/server/chunks/build/town-BUqRobze.mjs +1 -1
- package/.output/server/chunks/build/{town-_4tEEEVW.mjs → town-DPtOPRRO.mjs} +4 -4
- package/.output/server/chunks/build/{town-_4tEEEVW.mjs.map → town-DPtOPRRO.mjs.map} +1 -1
- package/.output/server/chunks/build/useLocalTime-9a4B-aHv.mjs +42 -0
- package/.output/server/chunks/build/useLocalTime-9a4B-aHv.mjs.map +1 -0
- package/.output/server/chunks/build/useWorkshopApi-D2gq06N2.mjs +81 -0
- package/.output/server/chunks/build/useWorkshopApi-D2gq06N2.mjs.map +1 -0
- package/.output/server/chunks/build/useWorkshopWs-B3j5wIAK.mjs +1 -1
- package/.output/server/chunks/build/user-Dk-ytEUV.mjs +1 -1
- package/.output/server/chunks/build/{users-4FZ0yFUO.mjs → users-CmVvb1oq.mjs} +16 -16
- package/.output/server/chunks/build/{users-4FZ0yFUO.mjs.map → users-CmVvb1oq.mjs.map} +1 -1
- package/.output/server/chunks/build/{workshop-k0XZTFKg.mjs → workshop-iCzNRifn.mjs} +9 -9
- package/.output/server/chunks/build/{workshop-k0XZTFKg.mjs.map → workshop-iCzNRifn.mjs.map} +1 -1
- package/.output/server/chunks/build/workspaces-IfORCDJE.mjs +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/mcp/workshop.mjs +1 -1
- package/.output/server/chunks/routes/api/metrics.mjs +1 -1
- package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs +1 -1
- package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/plugins/manifest.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/config.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/index.get.mjs +3 -3
- package/.output/server/chunks/routes/api/system/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/system/index.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs +1 -1
- package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs +1 -1
- package/.output/server/chunks/routes/api/system/monitor.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/settings/events.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/settings/reset.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/users/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/login.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/logout.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/me.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/register.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/_...path_.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/send.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs +6 -14
- package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs +39 -0
- package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/audit.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/caller.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/from-channel.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs +9 -2
- package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/channels.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +6 -4
- package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +247 -0
- package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs +27 -0
- package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +19 -7
- package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index10.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index4.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index4.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index5.get.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index5.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index6.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index6.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/index7.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index7.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index9.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/runtime.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/dispatch.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/users/me.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/users/register.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/chunks/virtual/entry.mjs +123 -113
- package/.output/server/chunks/virtual/entry.mjs.map +1 -1
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/index.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/app/components/AppHeader.vue +56 -2
- package/app/components/workshop/ChannelSessionList.vue +703 -593
- package/app/components/workshop/terminal/OmpTerminalPanel.vue +2 -1
- package/app/composables/workshop/useLocalTime.ts +16 -0
- package/app/composables/workshop/useSceneLayouts.ts +2 -1
- package/app/composables/workshop/useWorkshopApi.ts +249 -224
- package/app/pages/daq/[id].vue +7 -6
- package/app/pages/daq/index.vue +2 -2
- package/app/pages/dcw/[id].vue +3 -3
- package/app/pages/workshop/agents.vue +432 -382
- package/bin/aw.mjs +0 -0
- package/cli/aw.mjs +8 -1
- package/cli/commands/stop.mjs +111 -108
- package/cli/commands/tui.mjs +10 -1
- package/cli/core/registry.mjs +5 -3
- package/cli/infra.mjs +108 -109
- package/config.yml +134 -134
- package/docs/tui.md +1 -1
- package/i18n/locales/en.ts +5 -0
- package/i18n/locales/zh-CN.ts +5 -0
- package/package.json +148 -140
- package/scripts/_dbg-catalog-smoke.ts +20 -0
- package/scripts/_dbg-codex-probe.mjs +58 -0
- package/scripts/_dbg-dsh-probe.mjs +31 -0
- package/scripts/_dbg-interval-scenario.mjs +126 -0
- package/scripts/_dbg-line-spawn.ts +31 -0
- package/scripts/_dbg-live-engine-probe.mjs +80 -0
- package/scripts/_dbg-mcp-bridge-probe.mjs +147 -0
- package/scripts/_dbg-opencode-sse.mjs +101 -0
- package/scripts/_dbg-opencode-start.ts +57 -0
- package/scripts/_dbg-plugin-matrix.mjs +212 -0
- package/scripts/_dbg-protocol-matrix.mjs +425 -0
- package/scripts/_dbg-real-scenario-timeline.log +123 -0
- package/scripts/_dbg-registry-smoke.ts +14 -0
- package/scripts/_dbg-sim-keeper.mjs +100 -0
- package/scripts/_dbg-team-drill.mjs +173 -0
- package/scripts/dev-guard.mjs +11 -3
- package/scripts/dev-protocol-simulators.mjs +28 -1
- package/scripts/e2e-multi-harness.ts +374 -0
- package/scripts/e2e-multiharness-team.mjs +319 -0
- package/scripts/e2e-plc-scenario.mjs +292 -0
- package/scripts/e2e-real-scenario.mjs +452 -0
- package/scripts/migrate-local-time.mjs +123 -0
- package/scripts/start.mjs +60 -9
- package/server/api/system/settings/index.get.ts +3 -3
- package/server/api/workshop/agent-tools/invoke.post.ts +27 -41
- package/server/api/workshop/agent-tools/list.get.ts +25 -0
- package/server/api/workshop/channels/[id]/index.patch.ts +38 -30
- package/server/api/workshop/daq/[id]/samples.get.ts +6 -3
- package/server/api/workshop/harnesses/[id]/providers.get.ts +16 -0
- package/server/api/workshop/harnesses.get.ts +12 -0
- package/server/api/workshop/hitl/respond.post.ts +87 -67
- package/server/api/workshop/ws.ts +13 -0
- package/server/data/daqs.json +1366 -16
- package/server/data/dcw-lines.json +266 -0
- package/server/data/dcw-products.json +203 -0
- package/server/data/dcw-recipes.json +784 -0
- package/server/data/dcw-rollback.json +1144 -1
- package/server/data/dcw-runs.json +983 -791
- package/server/data/dcw-writes.json +1080 -0
- package/server/data/dcws.json +3278 -203
- package/server/data/line-runs.json +52 -2
- package/server/harness/aw-mcp-bridge.mjs +153 -0
- package/server/plugins/00-local-time.ts +10 -0
- package/server/plugins/aw-plugins.ts +3 -0
- package/server/plugins/backup.ts +116 -97
- package/server/plugins/dev-stability-guard.ts +24 -15
- package/server/plugins/retention.ts +1 -0
- package/server/plugins/security.ts +24 -3
- package/server/plugins/workshop.ts +156 -153
- package/server/repositories/user.repository.ts +414 -391
- package/server/services/system-config.ts +30 -6
- package/server/services/workshop/.mimosa/hook-state/sess_fed429fb-c8b7-4a50-bbd6-45afc580893f.json +1 -0
- package/server/services/workshop/.mimosa/hook-status/sess_fed429fb-c8b7-4a50-bbd6-45afc580893f-e6b75bbfe6.json +14 -0
- package/server/services/workshop/agents/adapters/line-spawn.ts +108 -0
- package/server/services/workshop/agents/adapters/stdio-jsonrpc.ts +316 -0
- package/server/services/workshop/agents/agent-interface.ts +17 -0
- package/server/services/workshop/agents/codex-agent.ts +822 -0
- package/server/services/workshop/agents/dsh-agent.ts +670 -0
- package/server/services/workshop/agents/factory.ts +4 -16
- package/server/services/workshop/agents/harness-env.ts +54 -0
- package/server/services/workshop/agents/harness-models.ts +270 -0
- package/server/services/workshop/agents/host-tool-bridge.ts +592 -0
- package/server/services/workshop/agents/industrial-tools.ts +5 -1
- package/server/services/workshop/agents/node-bindings.repo.ts +4 -5
- package/server/services/workshop/agents/omp-agent.ts +1178 -1957
- package/server/services/workshop/agents/opencode-agent.ts +987 -0
- package/server/services/workshop/agents/prompt-builder.ts +393 -0
- package/server/services/workshop/agents/registry.ts +125 -0
- package/server/services/workshop/assets/character-asset.repo.ts +3 -5
- package/server/services/workshop/assets/device-twin.repo.ts +3 -5
- package/server/services/workshop/daq/daq-controller.ts +8 -4
- package/server/services/workshop/daq/daq-node.repo.ts +3 -5
- package/server/services/workshop/daq/daq-node.ts +2 -2
- package/server/services/workshop/daq/daq-templates.ts +3 -5
- package/server/services/workshop/daq/drivers.ts +41 -12
- package/server/services/workshop/daq/storage/sqlite.adapter.ts +313 -309
- package/server/services/workshop/db/backup-registry.ts +33 -0
- package/server/services/workshop/db/channel.repo.ts +104 -101
- package/server/services/workshop/db/database.ts +956 -949
- package/server/services/workshop/dcw/dcw-controller.ts +3 -1
- package/server/services/workshop/dcw/dcw-line.repo.ts +4 -11
- package/server/services/workshop/dcw/dcw-node.repo.ts +3 -5
- package/server/services/workshop/dcw/dcw-node.ts +13 -1
- package/server/services/workshop/dcw/dcw-product.repo.ts +3 -4
- package/server/services/workshop/dcw/dcw-recipe.repo.ts +3 -19
- package/server/services/workshop/dcw/dcw-templates.ts +3 -5
- package/server/services/workshop/dcw/drivers.ts +37 -13
- package/server/services/workshop/dcw/line-run.ts +3 -5
- package/server/services/workshop/dcw/recipe-rollback.repo.ts +4 -10
- package/server/services/workshop/json-store.mjs +72 -0
- package/server/services/workshop/plugins/host.mjs +2 -1
- package/server/services/workshop/runtime/agent-runtime.ts +44 -0
- package/server/services/workshop/runtime/manager.ts +2953 -2868
- package/server/services/workshop/scene/scene-layout.repo.ts +4 -11
- package/server/services/workshop/settings.ts +7 -0
- package/shared/config/schema.json +5 -0
- package/shared/config/single-instance.mjs +133 -86
- package/shared/local-time.mjs +36 -0
- package/shared/workshop-protocol.ts +11 -5
- package/tui/aw-tui.mjs +28 -10
- package/tui/components/hitl-card.mjs +47 -36
- package/tui/lib/config.mjs +62 -58
- package/tui/lib/ws.mjs +2 -1
- package/.output/public/_nuxt/9X0fVBD7.js +0 -57
- package/.output/public/_nuxt/B6M2WJWm2.js +0 -1
- package/.output/public/_nuxt/B9Yie5HN.js +0 -2
- package/.output/public/_nuxt/BF9XPEuw.js +0 -1
- package/.output/public/_nuxt/BbQornXa.js +0 -1
- package/.output/public/_nuxt/Bxgaym6j.js +0 -1
- package/.output/public/_nuxt/Bxh5nf8j.js +0 -1
- package/.output/public/_nuxt/CXLI50Sq.js +0 -1
- package/.output/public/_nuxt/CdfAP_IH2.js +0 -1
- package/.output/public/_nuxt/Ce1zyNYu.js +0 -1
- package/.output/public/_nuxt/D-Ne4C9a.js +0 -1
- package/.output/public/_nuxt/DEHNjlTq2.js +0 -1
- package/.output/public/_nuxt/DFnGFEav.js +0 -18
- package/.output/public/_nuxt/DYWgGHNo.js +0 -7
- package/.output/public/_nuxt/OmpTerminalPanel.Bc9GjNU5.css +0 -1
- package/.output/public/_nuxt/W1E3-5ML.js +0 -14
- package/.output/public/_nuxt/XVB9_zwP.js +0 -1
- package/.output/public/_nuxt/Xaf_HIR3.js +0 -1
- package/.output/public/_nuxt/_id_.BeqSLvl_.css +0 -1
- package/.output/public/_nuxt/_id_.DN3U6EF9.css +0 -1
- package/.output/public/_nuxt/agents.BJwgTLFZ.css +0 -1
- package/.output/public/_nuxt/builds/meta/55c10854-ee0e-4be4-924b-a1b0e100fe11.json +0 -1
- package/.output/public/_nuxt/daq.BXsnevQv.css +0 -1
- package/.output/public/_nuxt/yIKY_V1P.js +0 -1
- package/.output/server/chunks/build/OmpTerminalPanel-B_SYhmgb.mjs.map +0 -1
- package/.output/server/chunks/build/_id_-CWLFGZjV.mjs.map +0 -1
- package/.output/server/chunks/build/agents-D4l1icvn.mjs.map +0 -1
- package/.output/server/chunks/build/channel-templates-DqjtC-R0.mjs.map +0 -1
- package/.output/server/chunks/build/interval-WlxgjTzO.mjs +0 -9
- package/.output/server/chunks/build/interval-WlxgjTzO.mjs.map +0 -1
- package/.output/server/chunks/build/teams-QR3BBF7A.mjs.map +0 -1
- package/.output/server/chunks/build/useWorkshopApi-Bh5VUHWu.mjs.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BUcmySDa2.js","./BBrRELH32.js","./CWKEp1wx2.js","./BFjGV-RV2.js","./RYFtK4qZ2.js","./BGkumHZ32.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{C as e,F as t,G as n,H as r,Ht as i,M as a,St as o,Ut as s,Wt as c,a as l,b as u,bt as d,dt as f,et as p,f as m,ft as h,g,gt as _,h as v,it as y,lt as b,m as x,mt as S,nt as ee,ot as C,p as w,pt as te,rt as T,t as E,vt as D,w as O,x as k,y as A,z as ne}from"./BSCpFtzG.js";import{B as j,I as M,L as N,R as re,k as ie,z as ae}from"./2LwEn9gX.js";import{t as oe}from"./HclGiUj8.js";import{n as se}from"./BeIfu4N3.js";import{t as P}from"./BJvGPTpC.js";import{t as ce}from"./eHGLpQSg2.js";import{t as le}from"./NIM0Wglj2.js";import{t as ue}from"./BBrRELH32.js";import{C as de,L as fe,N as F,O as pe,St as I,_ as me,b as he,c as ge,dt as _e,et as ve,v as ye,y as be,z as L}from"./BFjGV-RV2.js";import{t as xe}from"./C_gFA2H_2.js";import{n as Se,t as Ce}from"./ZugRk0CM2.js";import{t as we}from"./36oeS8_R2.js";import{t as Te}from"./GP2wXyuY.js";import{r as Ee,t as De}from"./CS8R0_J3.js";import{t as Oe}from"./CUxV8Bw_.js";import{n as R}from"./DeYsUzhr.js";var ke=`__characterAssets`;function Ae(e){return{id:e.id,name:e.name,file:e.file,frames:e.sheet?.frames??4,frameWidth:e.sheet?.frameWidth??48,frameHeight:e.sheet?.frameHeight??88,kind:e.kind===`glb`?`glb`:e.kind===`dev`?`dev`:`sheet`,builtin:e.author===`system`,applied:(e.appliedTo?.length??0)>0}}function z(){let e=[],t=[{id:`knight`,name:`灰羽骑士`,file:`/assets/game/character/knight.png`,frames:4,frameWidth:48,frameHeight:88,kind:`sheet`,builtin:!0,applied:!1},{id:`mage`,name:`紫晶法师`,file:`/assets/game/character/mage.png`,frames:4,frameWidth:48,frameHeight:88,kind:`sheet`,builtin:!0,applied:!1},{id:`bot`,name:`青枢机械`,file:`/assets/game/character/bot.png`,frames:4,frameWidth:48,frameHeight:88,kind:`sheet`,builtin:!0,applied:!1},{id:`hero-3d`,name:`标准员工模型`,file:`/assets/game/character/hero-3d.glb`,frames:1,frameWidth:0,frameHeight:0,kind:`glb`,builtin:!0,applied:!1,hint:`默认员工 3D 模型`},{id:`device-3d`,name:`工业泵设备`,file:`/assets/game/character/device-3d.glb`,frames:1,frameWidth:0,frameHeight:0,kind:`dev`,builtin:!0,applied:!1,hint:`数字孪生实体模型(拖入场景生成设备)`}],n=[];try{let e=Object.assign({});for(let[t,r]of Object.entries(e)){let e=t.split(`/`).pop()??``,i=`dev-folder-`+e.replace(/\.glb$/i,``),a=r.replace(/^\/public\//,`/`);n.push({id:i,name:e.replace(/\.glb$/i,``).replace(/[-_]/g,` `),file:a,frames:1,frameWidth:0,frameHeight:0,kind:`dev`,builtin:!0,applied:!1,hint:`设备实体(拖入场景生成数字孪生)`})}}catch{}let r=(e=!0)=>{let t=typeof document<`u`?document.cookie.match(/(?:^|;\s*)token=([^;]+)/)?.[1]??``:``,n={},r=t||``;return r&&(n.authorization=`Bearer ${decodeURIComponent(r)}`),e&&(n[`content-type`]=`application/json`),n},i=h({models:e,loaded:!1,loading:!1,error:``,async load(){if(!(i.loading||i.loaded)){i.loading=!0;try{let[e,a]=await Promise.allSettled([fetch(`/api/workshop/assets/character`,{headers:r()}),fetch(`/api/workshop/assets/devices`,{headers:r()})]),o=e.status===`fulfilled`?await e.value.json().catch(()=>({})):{},s=a.status===`fulfilled`?await a.value.json().catch(()=>({})):{},c=o?.data?.assets??[],l=(s?.data?.devices??[]).map(e=>({id:e.id,name:e.name,file:e.file,frames:1,frameWidth:0,frameHeight:0,kind:`dev`,builtin:!0,applied:!1,hint:`设备实体(拖入场景生成数字孪生)`,hFactor:typeof e.defaultScale==`number`&&e.defaultScale>0?e.defaultScale:1})),u=new Set(t.map(e=>e.file)),d=(s?.data?.characters??[]).filter(e=>!u.has(e.file)).map(e=>({id:e.id,name:e.name,file:e.file,frames:1,frameWidth:0,frameHeight:0,kind:`glb`,builtin:!0,applied:!1,hint:`角色 3D 模型(在频道成员管理中设置)`})),f=[],p=new Set;for(let e of c)f.push(Ae(e)),p.add(e.id);for(let e of l)p.has(e.id)||(f.push(e),p.add(e.id));for(let e of d)p.has(e.id)||(f.push(e),p.add(e.id));for(let e of t)p.has(e.id)||f.push(e);for(let e of n)p.has(e.id)||f.push(e);i.models.splice(0,i.models.length,...f),i.loaded=!0,i.error=``}catch(e){i.loaded=!1,i.error=e instanceof Error?e.message:String(e)}finally{i.loading=!1}}},byId(t){return e.find(e=>e.id===t)},async upload(e,t){let n=new FormData;n.append(`file`,e),n.append(`name`,t.name??e.name.replace(/\.[^.]+$/,``)),n.append(`workspaceId`,t.workspaceId??``),n.append(`kind`,t.kind??`sheet`),n.append(`frameWidth`,String(t.frameWidth??48)),n.append(`frameHeight`,String(t.frameHeight??88)),n.append(`frames`,String(t.frames??4));let a=await fetch(`/api/workshop/assets/character`,{method:`POST`,headers:r(!1),body:n}),o=await a.json().catch(()=>({}));if(!a.ok||!o?.data?.asset)throw Error(o?.message??`上传失败`);return i.loaded=!1,await i.load(),Ae(o.data.asset)},async remove(e){let t=await fetch(`/api/workshop/assets/character/${e}`,{method:`DELETE`,headers:r()}),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n?.message??`删除失败`);return i.loaded=!1,await i.load(),{used:n?.data?.used??0}},async uploadDevice(e,t){let n=new FormData;n.append(`file`,e),t&&n.append(`name`,t);let a=await fetch(`/api/workshop/assets/devices`,{method:`POST`,headers:r(!1),body:n}),o=await a.json().catch(()=>({}));if(!a.ok||!o?.data?.asset)throw Error(o?.message??`设备模型上传失败`);i.loaded=!1,await i.load();let s=o.data.asset;return{id:s.id,name:s.name,file:s.file,frames:1,frameWidth:0,frameHeight:0,kind:`dev`,builtin:!1,applied:!1,hint:`设备实体(拖入场景生成数字孪生)`}},async removeDevice(e){let t=e.replace(/^dev-folder-/,``),n=await fetch(`/api/workshop/assets/devices/${encodeURIComponent(t)}`,{method:`DELETE`,headers:r()}),a=await n.json().catch(()=>({}));if(!n.ok)throw Error(a?.message??`设备模型删除失败`);i.loaded=!1,await i.load()},async bind(e,t,n){let i=await fetch(`/api/workshop/channels/${e}/agents/${t}/model`,{method:`PATCH`,headers:r(),body:JSON.stringify({modelRef:n})}),a=await i.json().catch(()=>({}));if(!i.ok)throw Error(a?.message??`绑定失败`)}});return i}function je(){let e=globalThis;e[ke]||(e[ke]=z());let t=e[ke];return t.load(),t}var Me={key:0,class:`mp-loading`},B={key:1,class:`mp-failed`},Ne=Object.assign(E(e({__name:`ModelPreview3D`,props:{file:{default:``},localFile:{default:null},height:{default:64}},setup(e){let n=e,i=S(null),c=S(!1),l=S(!1),u=globalThis,d=``;function f(){if(u.__modelPreviewRig)return u.__modelPreviewRig;let e=new he({alpha:!0,antialias:!1,powerPreference:`low-power`});e.setPixelRatio(Math.min(window.devicePixelRatio,1.5)),e.toneMapping=4,e.toneMappingExposure=1.15;let t={renderer:e,slots:new Set,raf:0,clock:new pe},n=()=>{t.raf=requestAnimationFrame(n);let e=t.clock.getDelta();for(let n of t.slots)!n.canvas.isConnected&&n.canvas.width===0||(n.group&&(n.group.rotation.y+=e*n.speed),t.renderer.setSize(n.w,n.h,!1),t.renderer.render(n.scene,n.camera),n.ctx.clearRect(0,0,n.w,n.h),n.ctx.drawImage(t.renderer.domElement,0,0,n.w,n.h))};return n(),u.__modelPreviewRig=t,t}function m(){let e=u.__modelPreviewRig;!e||e.slots.size>0||(cancelAnimationFrame(e.raf),e.renderer.dispose(),e.renderer.domElement.remove(),delete u.__modelPreviewRig)}function h(e){try{let t=new be(u.__modelPreviewRig.renderer);e.environment=t.fromScene(new me,.04).texture,e.environmentIntensity=.55,t.dispose()}catch{}e.add(new L(14674431,3813157,1.3));let t=new F(16773855,2.2);t.position.set(3,4,2),e.add(t);let n=new F(4311284,1);n.position.set(-3,1,-2.5),e.add(n)}function _(e){let t=new de().setFromObject(e),n=new I;t.getSize(n);let r=t.getCenter(new I),i=2/(Math.max(n.x,Math.max(n.y,n.z))||1);e.scale.setScalar(i),e.position.set(-r.x*i,-r.y*i,-r.z*i)}let y=null;function b(e){if(!i.value||c.value)return;let t=i.value,r=t.clientWidth||120,a=n.height||64,o=f(),s=document.createElement(`canvas`);s.style.width=`100%`,s.style.height=`${a}px`,s.width=Math.max(2,Math.round(r*Math.min(window.devicePixelRatio,1.5))),s.height=Math.max(2,Math.round(a*Math.min(window.devicePixelRatio,1.5)));let u=s.getContext(`2d`);if(!u){c.value=!0;return}t.appendChild(s);let d=new _e;h(d);let p=new ve(38,r/a,.1,100);p.position.set(2.4,1.8,3.1),p.lookAt(0,0,0);let m=new fe;d.add(m),y={canvas:s,ctx:u,scene:d,camera:p,group:m,w:s.width,h:s.height,speed:.6},o.slots.add(y),l.value=!0,new ye().load(e,e=>{let t=e.scene;y&&(t.traverse(e=>{let t=e;t.isMesh&&(t.castShadow=!1,t.receiveShadow=!1)}),_(t),y.group.add(t),l.value=!1)},void 0,()=>{l.value=!1,c.value=!0})}function x(){d&&URL.revokeObjectURL(d),d=``,y&&(u.__modelPreviewRig?.slots.delete(y),y.scene.traverse(e=>{let t=e;if(t.isMesh){t.geometry?.dispose();let e=Array.isArray(t.material)?t.material:[t.material];for(let t of e){for(let e of Object.keys(t)){let n=t[e];n&&n.isTexture&&n.dispose()}t?.dispose()}}}),y.canvas.remove(),y=null,m())}function ee(){if(c.value=!1,n.localFile){d=URL.createObjectURL(n.localFile),b(d);return}n.file&&b(n.file)}return ne(ee),p(()=>[n.file,n.localFile],()=>{x(),(n.localFile??(n.file?n.file:null))&&a(()=>ee())}),t(x),(t,n)=>(r(),g(`div`,{ref_key:`hostRef`,ref:i,class:`model-preview-3d`,style:s({height:`${e.height}px`})},[o(l)?(r(),g(`div`,Me,[...n[0]||=[w(`span`,{class:`mp-spin`},null,-1)]])):o(c)?(r(),g(`div`,B,` PREVIEW NA `)):v(``,!0)],4))}}),[[`__scopeId`,`data-v-b29ffdbe`]]),{__name:`WorkshopTownModelPreview3D`}),Pe={class:`asset-lib`},Fe={class:`lib-head`},Ie={class:`head-title`},Le={class:`head-hint`},Re={class:`upload-row`},ze={class:`upload-name`},Be={key:0,class:`drop-hint`},Ve={key:1,class:`upload-file-tag`},He={class:`upload-actions`},Ue=[`disabled`],We=[`disabled`],V={key:2,class:`mini-err`},H={key:3,class:`mini-err`},Ge={class:`lib-grid`},Ke=[`data-model-id`,`title`,`onDragstart`],qe={key:1,class:`model-img glb dev`},Je={class:`model-name`},Ye={class:`model-badge`},Xe={class:`card-actions`},Ze=[`disabled`,`onClick`],Qe={key:0,class:`lib-note`},$e={key:1,class:`lib-note`},et={key:0,class:`mini-msg`},tt=Object.assign(E(e({__name:`AssetLibrary`,setup(e){let{t}=se(),a=je(),s=m(()=>a.models.filter(e=>e.kind===`dev`)),d=e=>/\.(glb|gltf)$/i.test(e);function f(e,t){e.dataTransfer&&(e.dataTransfer.setData(`application/x-aw-model`,t),e.dataTransfer.setData(`text/plain`,t),e.dataTransfer.effectAllowed=`copy`)}let p=S(!1),h=S(``),_=S(null),y=S(!1),b=e=>{let t=e.target;C(t.files?.[0]??null)},ee=e=>{y.value=!1,C(e.dataTransfer?.files?.[0]??null)},C=e=>{if(e&&!/\.(glb|gltf|obj|fbx)$/i.test(e.name)){h.value=`仅支持 .glb/.gltf/.obj/.fbx 模型文件`;return}_.value=e,h.value=``},te=()=>{_.value=null};async function T(){let e=_.value;if(!e){h.value=t(`assetLibrary.kcjqcaw012`);return}p.value=!0,h.value=``;try{let n=await a.uploadDevice(e);_.value=null,h.value=t(`assetLibrary.k8nv3or016`,{p0:n.name})}catch(e){h.value=e instanceof Error?e.message:String(e)}finally{p.value=!1}}let E=S(``),D=S(``);async function O(e){E.value=e,D.value=``;try{await a.removeDevice(e),D.value=t(`assetLibrary.k8n918k013`)}catch(e){D.value=e instanceof Error?e.message:String(e)}finally{E.value=``}}return(e,t)=>(r(),g(`aside`,Pe,[w(`div`,Fe,[w(`span`,Ie,c(e.$t(`assetLibrary.k7la4x5001`)),1),w(`span`,Le,c(e.$t(`assetLibrary.kulif5b002`)),1)]),w(`div`,{class:i([`upload-box`,{drop:o(y)}]),onDragover:t[0]||=j(e=>y.value=!0,[`prevent`]),onDragleave:t[1]||=e=>y.value=!1,onDrop:j(ee,[`prevent`])},[w(`label`,Re,[w(`input`,{type:`file`,accept:`.glb,.gltf,.obj,.fbx`,class:`file-input`,onChange:b},null,32),w(`span`,ze,[t[2]||=w(`span`,{class:`i-tabler-plus upload-ico`},null,-1),u(` `+c(o(_)?.name||e.$t(`assetLibrary.k1iiort6010`)),1)])]),o(y)?(r(),g(`span`,Be,[t[3]||=w(`span`,{class:`i-tabler-download`},null,-1),u(` `+c(e.$t(`assetLibrary.k5hg6jq003`)),1)])):v(``,!0),o(_)?(r(),g(l,{key:1},[d(o(_).name)?(r(),x(Ne,{key:0,"local-file":o(_),height:92},null,8,[`local-file`])):(r(),g(`span`,Ve,c(o(_).name)+` (`+c(e.$t(`assetLibrary.k1xz5wvk009`)),1)),w(`div`,He,[w(`button`,{class:`upload-btn go`,disabled:o(p),onClick:T},c(o(p)?e.$t(`assetLibrary.k1ar7n8i005`):e.$t(`assetLibrary.k1hhga4h014`)),9,Ue),w(`button`,{class:`upload-btn`,disabled:o(p),onClick:te},c(e.$t(`assetLibrary.k3xdnn004`)),9,We)])],64)):o(p)?(r(),g(`span`,V,c(e.$t(`assetLibrary.k1ar7n8i005`)),1)):v(``,!0),o(h)&&!o(_)?(r(),g(`span`,H,c(o(h)),1)):v(``,!0)],34),w(`div`,Ge,[(r(!0),g(l,null,n(o(s),n=>(r(),g(`div`,{key:n.id,class:`model-card`,"data-model-id":n.id,draggable:`true`,title:n.hint||e.$t(`assetLibrary.katn7lo015`,{p0:n.name}),onDragstart:e=>f(e,n.id)},[d(n.file)?(r(),x(Ne,{key:0,file:n.file,height:76},null,8,[`file`])):(r(),g(`span`,qe,[...t[4]||=[w(`span`,{class:`i-tabler-cpu glb-cube`,"aria-hidden":`true`},null,-1)]])),w(`span`,Je,c(n.name),1),w(`span`,Ye,c(e.$t(`assetLibrary.k1n32zs0006`)),1),w(`div`,Xe,[n.file.includes(`/assets/game/devices/`)?(r(),g(`button`,{key:0,class:`card-btn danger`,disabled:o(E)===n.id,onClick:e=>O(n.id)},c(o(E)===n.id?`…`:e.$t(`assetLibrary.k498l011`)),9,Ze)):v(``,!0)])],40,Ke))),128)),o(a).loaded?o(s).length===0?(r(),g(`div`,$e,c(e.$t(`assetLibrary.k15527e1008`)),1)):v(``,!0):(r(),g(`div`,Qe,[t[5]||=w(`span`,{class:`loading-dot`},null,-1),u(` `+c(e.$t(`assetLibrary.k1kq2tmi007`)),1)]))]),o(D)?(r(),g(`span`,et,c(o(D)),1)):v(``,!0)]))}}),[[`__scopeId`,`data-v-c83e9503`]]),{__name:`WorkshopAssetLibrary`}),U={class:`twin-panel`},W={class:`twin-head`},nt={class:`twin-kicker`},rt={class:`twin-count`},it={key:0,class:`twin-error`},at={key:1,class:`twin-empty`},ot={key:2,class:`twin-empty`},st={class:`twin-empty-frame`},ct={class:`twin-empty-title`},lt={class:`twin-empty-sub`},ut={key:3,class:`twin-list`},dt=[`onClick`],ft={class:`twin-row`},pt={class:`twin-model-tag`},mt={class:`twin-idbar`},ht={class:`twin-name`},gt={class:`twin-code`},_t=[`disabled`,`title`,`onClick`],vt={key:0,class:`twin-tele`},yt={key:1,class:`twin-daq`},bt={key:2,class:`twin-dcw`},xt={class:`dcw-head`},G={key:0,class:`dcw-src`},St={class:`dcw-set`},Ct=[`title`],wt={key:0,class:`dcw-act-at`},Tt={class:`dcw-win`},Et=[`title`],Dt={class:`dcw-ctrl`},Ot=[`onUpdate:modelValue`,`step`,`min`,`max`,`placeholder`,`onKeydown`],kt=[`disabled`,`title`,`onClick`],At={key:1,class:`dcw-err`},jt={key:4,class:`twin-err`},Mt=Object.assign(E(e({__name:`DeviceTwinPanel`,props:{daqLive:{},dcwLive:{}},emits:[`focus-device`],setup(e){let{t:a}=se(),d=Oe(),f=Te(),p=e=>e.kind===`daq`||(e.modelRef??``).startsWith(`daq-`),m=null;ne(()=>{d.load(),m=P(()=>void d.load(),2e3)}),t(()=>{m&&clearInterval(m)});let _=S(``),y=S(``),b=S(``),x=null;async function ee(e){if(b.value!==e.id){b.value=e.id,x&&clearTimeout(x),x=setTimeout(()=>{b.value=``},3e3);return}x&&clearTimeout(x),b.value=``,_.value=e.id,y.value=``;try{await d.remove(e.id)}catch(e){y.value=e instanceof Error?e.message:String(e)}finally{_.value=``}}let C={idle:`var(--hud-amber)`,running:`var(--hud-ok)`,alarm:`var(--hud-danger)`,offline:`var(--hud-dim)`},te={idle:`STANDBY`,running:`RUNNING`,alarm:`ALARM`,offline:`OFFLINE`},E=e=>e.replace(/[^A-Za-z0-9]/g,``).slice(0,4).toUpperCase()||`DEV`,D=e=>e.replace(/^dev-/,``).replace(/[^a-z0-9]/gi,``).slice(-6).toUpperCase(),O=e=>typeof e==`number`?(Math.round(e*100)/100).toString():String(e),k=e=>`${Number.isFinite(e.lo)?e.lo:`-∞`} ~ ${Number.isFinite(e.hi)?e.hi:`+∞`} ${e.unit}`,A=h({}),M=h({}),re=S(``);function ie(e){let t=A[e.id];if(t==null||t===``)return;let n=Number(t);if(n<e.lo||n>e.hi){M[e.id]=a(`deviceTwinPanel.kxddket010`,{p0:e.src===`recipe`?a(`deviceTwinPanel.kq2jssk008`):a(`deviceTwinPanel.k1iwj796009`),p1:k(e)});return}M[e.id]=``,re.value=e.id,f.write(e.id,n).then(t=>{t.ok||(M[e.id]=t.message)}).catch(t=>{M[e.id]=t instanceof Error?t.message:String(t)}).finally(()=>{re.value=``})}return(t,a)=>(r(),g(`aside`,U,[w(`div`,W,[w(`span`,nt,c(t.$t(`deviceTwinPanel.k7k6evr002`)),1),w(`span`,rt,c(o(d).twins.length),1)]),o(d).error?(r(),g(`div`,it,c(o(d).error),1)):v(``,!0),o(d).loaded?o(d).twins.length===0?(r(),g(`div`,ot,[w(`div`,st,[w(`div`,ct,c(t.$t(`deviceTwinPanel.k13y2qmg004`)),1),w(`div`,lt,c(t.$t(`deviceTwinPanel.kotf23l005`)),1)])])):(r(),g(`div`,ut,[(r(!0),g(l,null,n(o(d).twins,d=>(r(),g(`button`,{key:d.id,class:i([`twin-card`,{daq:p(d)}]),type:`button`,onClick:e=>t.$emit(`focus-device`,d)},[w(`div`,ft,[w(`span`,pt,c(E(d.modelRef||d.name)),1),w(`div`,mt,[w(`span`,ht,c(d.name),1),w(`span`,gt,c(p(d)?`DAQ`:D(d.id)),1)]),w(`button`,{class:i([`twin-del`,{armed:o(b)===d.id}]),disabled:o(_)===d.id,title:o(b)===d.id?`再次点击确认删除该设备实例`:`删除该设备实例`,onClick:j(e=>ee(d),[`stop`])},c(o(b)===d.id?t.$t(`deviceTwinPanel.k44653007`):`✕`),11,_t),w(`span`,{class:i([`twin-state`,`s-${d.state}`])},[w(`i`,{class:`twin-state-dot`,style:s({background:C[d.state]||`var(--hud-dim)`})},null,4),u(` `+c(te[d.state]||d.state),1)],2)]),Object.keys(d.telemetry).length?(r(),g(`div`,vt,[(r(!0),g(l,null,n(d.telemetry,(e,t)=>(r(),g(`span`,{key:t,class:`tele-item`},[w(`em`,null,c(t),1),w(`b`,null,c(O(e)),1)]))),128))])):v(``,!0),e.daqLive?.[d.id]?.length?(r(),g(`div`,yt,[(r(!0),g(l,null,n(e.daqLive[d.id],(e,t)=>(r(),g(`span`,{key:`${e.ch}-${t}`,class:i([`daq-item`,{alarm:e.alarm}])},[w(`em`,null,c(e.ch),1),w(`b`,null,[u(c(e.value),1),w(`i`,null,c(e.unit),1)])],2))),128))])):v(``,!0),e.dcwLive?.[d.id]?.length?(r(),g(`div`,bt,[(r(!0),g(l,null,n(e.dcwLive[d.id],e=>(r(),g(`div`,{key:e.id,class:`dcw-item`},[w(`div`,xt,[w(`em`,null,[u(c(e.ch),1),e.src===`recipe`?(r(),g(`i`,G,c(t.$t(`deviceTwinPanel.k48grv006`)),1)):v(``,!0)]),w(`b`,St,[u(c(e.value==null?`--`:e.value.toFixed(e.decimals)),1),w(`i`,null,c(e.unit),1)])]),e.readValue!=null||e.lastReadAt?(r(),g(`div`,{key:0,class:`dcw-act`,title:t.$t(`deviceTwinPanel.k9r7d4e030`)},[a[0]||=w(`em`,null,`ACT`,-1),w(`b`,null,[u(c(e.readValue==null?`--`:e.readValue.toFixed(e.decimals)),1),w(`i`,null,c(e.unit),1)]),e.lastReadAt?(r(),g(`i`,wt,c(e.lastReadAt.slice(11,19)),1)):v(``,!0)],8,Ct)):v(``,!0),w(`div`,Tt,[w(`span`,{title:e.src===`recipe`?`当前运行配方工艺窗口`:`节点全局量程`},c(k(e)),9,Et)]),w(`div`,Dt,[T(w(`input`,{"onUpdate:modelValue":t=>o(A)[e.id]=t,type:`number`,class:`ctrl-input`,step:10**-e.decimals,min:Number.isFinite(e.lo)?e.lo:void 0,max:Number.isFinite(e.hi)?e.hi:void 0,placeholder:`${Number.isFinite(e.lo)?e.lo:``} ~ ${Number.isFinite(e.hi)?e.hi:``}`,onKeydown:ae(t=>ie(e),[`enter`])},null,40,Ot),[[N,o(A)[e.id],void 0,{number:!0}]]),w(`button`,{class:`ctrl-btn dcw-send`,disabled:o(A)[e.id]==null||o(A)[e.id]===``||o(re)===e.id,title:t.$t(`deviceTwinPanel.k1j04u8001`),onClick:j(t=>ie(e),[`stop`])},c(o(re)===e.id?`···`:`SET`),9,kt)]),o(M)[e.id]?(r(),g(`small`,At,c(o(M)[e.id]),1)):v(``,!0)]))),128))])):v(``,!0)],10,dt))),128))])):(r(),g(`div`,at,c(t.$t(`deviceTwinPanel.kkw7sn5003`)),1)),o(y)?(r(),g(`span`,jt,c(o(y)),1)):v(``,!0)]))}}),[[`__scopeId`,`data-v-15ec18ea`]]),{__name:`WorkshopDeviceTwinPanel`}),Nt=`__sceneLayouts`;function K(e=!0){let t=typeof document<`u`?document.cookie.match(/(?:^|;\s*)token=([^;]+)/)?.[1]??``:``,n={};return t&&(n.authorization=`Bearer ${decodeURIComponent(t)}`),e&&(n[`content-type`]=`application/json`),n}function Pt(){let e=null,t=e=>new Promise(t=>setTimeout(t,e)),n=h({layouts:{},loaded:!1,loading:!1,error:``,rev:0,async load(){return e||=r().finally(()=>{e=null}),e},byChannel(e){return n.layouts[e]},async save(e,r){n.layouts[e]={channelId:e,x:r.x,z:r.z,radiusX:r.radiusX,radiusZ:r.radiusZ,shape:r.shape??`ellipse`,rotationY:r.rotationY??0,updatedAt:R()},n.rev++;let i=null;for(let a=0;a<3;a++)try{let t=await fetch(`/api/workshop/scene/layouts/${e}`,{method:`PUT`,headers:K(),body:JSON.stringify(r)}),i=await t.json().catch(()=>({}));if(!t.ok||!i?.data?.layout)throw Error(i?.message??`保存频道布局失败`);return n.layouts[e]=i.data.layout,i.data.layout}catch(e){i=e instanceof Error?e:Error(String(e)),a<2&&await t(500*(a+1))}throw i??Error(`保存频道布局失败`)},async remove(e){let t=await fetch(`/api/workshop/scene/layouts/${e}`,{method:`DELETE`,headers:K()}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r?.message??`移除频道放置失败`);let i=Object.fromEntries(Object.entries(n.layouts).filter(([t])=>t!==e));n.layouts=i,n.rev++}});async function r(){n.loading=!0;let e=``;try{for(let r=0;r<3;r++)try{let e=await fetch(`/api/workshop/scene/layouts`,{headers:K()});if(!e.ok)throw Error(`HTTP ${e.status}`);let t=(await e.json().catch(()=>({})))?.data?.layouts??[],r={};for(let e of t)r[e.channelId]=e;n.layouts=r,n.loaded=!0,n.error=``,n.rev++;return}catch(n){e=n instanceof Error?n.message:String(n),r<2&&await t(400*(r+1))}n.loaded=!1,n.error=e}finally{n.loading=!1}}return n}function Ft(){let e=globalThis;e[Nt]||(e[Nt]=Pt());let t=e[Nt];return t.load(),t}function It(e){return C()?(f(e),!0):!1}var Lt=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var Rt=Object.prototype.toString,zt=e=>Rt.call(e)===`[object Object]`,Bt=()=>{};function Vt(...e){if(e.length!==1)return D(...e);let t=e[0];return typeof t==`function`?te(y(()=>({get:t,set:Bt}))):S(t)}function Ht(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}var Ut=e=>e();function Wt(e=Ut,t={}){let{initialState:n=`active`}=t,r=Vt(n===`active`);function i(){r.value=!1}function a(){r.value=!0}return{isActive:te(r),pause:i,resume:a,eventFilter:(...t)=>{r.value&&e(...t)}}}function Gt(e){return Array.isArray(e)?e:[e]}function Kt(e){return e||O()}function qt(e,t,n={}){let{eventFilter:r=Ut,...i}=n;return p(e,Ht(r,t),i)}function Jt(e,t,n={}){let{eventFilter:r,initialState:i=`active`,...a}=n,{eventFilter:o,pause:s,resume:c,isActive:l}=Wt(r,{initialState:i});return{stop:qt(e,t,{...a,eventFilter:o}),pause:s,resume:c,isActive:l}}function Yt(e,t=!0,n){Kt(n)?ne(e,n):t?e():a(e)}function Xt(e,t,n){return p(e,t,{...n,immediate:!0})}var Zt=Lt?window:void 0;Lt&&window.document,Lt&&window.navigator,Lt&&window.location;function Qt(e){let t=d(e);return t?.$el??t}function q(...e){let t=[],n=()=>{t.forEach(e=>e()),t.length=0},r=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),i=m(()=>{let t=Gt(d(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0}),a=Xt(()=>[i.value?.map(e=>Qt(e))??[Zt].filter(e=>e!=null),Gt(d(i.value?e[1]:e[0])),Gt(o(i.value?e[2]:e[1])),d(i.value?e[3]:e[2])],([e,i,a,o])=>{if(n(),!e?.length||!i?.length||!a?.length)return;let s=zt(o)?{...o}:o;t.push(...e.flatMap(e=>i.flatMap(t=>a.map(n=>r(e,t,n,s)))))},{flush:`post`});return It(n),()=>{a(),n()}}var $t=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},en=`__vueuse_ssr_handlers__`,tn=nn();function nn(){return en in $t||($t[en]=$t[en]||{}),$t[en]}function rn(e,t){return tn[e]||t}function an(e){return e==null?`any`:e instanceof Set?`set`:e instanceof Map?`map`:e instanceof Date?`date`:typeof e==`boolean`?`boolean`:typeof e==`string`?`string`:typeof e==`object`?`object`:Number.isNaN(e)?`any`:`number`}var on={boolean:{read:e=>e===`true`,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},sn=`vueuse-storage`;function cn(e,t,n,r={}){let{flush:i=`pre`,deep:o=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,mergeDefaults:l=!1,shallow:u,window:f=Zt,eventFilter:h,onError:g=e=>{console.error(e)},initOnMounted:v}=r,y=(u?_:S)(typeof t==`function`?t():t),b=m(()=>d(e));if(!n)try{n=rn(`getDefaultStorage`,()=>Zt?.localStorage)()}catch(e){g(e)}if(!n)return y;let x=d(t),ee=an(x),C=r.serializer??on[ee],{pause:w,resume:te}=Jt(y,e=>D(e),{flush:i,deep:o,eventFilter:h});p(b,()=>k(),{flush:i});let T=!1;f&&s&&(n instanceof Storage?q(f,`storage`,e=>{v&&!T||k(e)},{passive:!0}):q(f,sn,e=>{v&&!T||A(e)})),v?Yt(()=>{T=!0,k()}):k();function E(e,t){if(f){let r={key:b.value,oldValue:e,newValue:t,storageArea:n};f.dispatchEvent(n instanceof Storage?new StorageEvent(`storage`,r):new CustomEvent(sn,{detail:r}))}}function D(e){try{let t=n.getItem(b.value);if(e==null)E(t,null),n.removeItem(b.value);else{let r=C.write(e);t!==r&&(n.setItem(b.value,r),E(t,r))}}catch(e){g(e)}}function O(e){let t=e?e.newValue:n.getItem(b.value);if(t==null)return c&&x!=null&&n.setItem(b.value,C.write(x)),x;if(!e&&l){let e=C.read(t);return typeof l==`function`?l(e,x):ee===`object`&&!Array.isArray(e)?{...x,...e}:e}return typeof t==`string`?C.read(t):t}function k(e){if(!(e&&e.storageArea!==n)){if(e&&e.key==null){y.value=x;return}if(!(e&&e.key!==b.value)){w();try{let t=C.write(y.value);(e===void 0||e?.newValue!==t)&&(y.value=O(e))}catch(e){g(e)}finally{e?a(te):te()}}}}function A(e){k(e.detail)}return y}var ln={class:`town-view`},un={class:`topnav`},dn={class:`brand`},fn={class:`brand-sub`},pn=[`aria-label`],mn={class:`seg`},hn=[`disabled`,`title`],gn={class:`nav-right`},_n=[`title`],vn={class:`nav-chip mono`},yn=[`title`],bn={class:`avatar-fallback`},xn={class:`app`},Sn={class:`rail rail-left`},Cn={class:`panel`},wn={class:`panel-hd`},Tn={class:`panel-tag`},En={class:`panel`},Dn={class:`panel-hd`},On={class:`panel-tag`},kn={class:`daq-ctrl`},An=[`title`],jn=[`title`],Mn=[`value`],Nn={class:`daq-list`},Pn=[`title`,`onClick`,`onKeydown`],Fn={class:`daq-ico`},In=[`innerHTML`],Ln={class:`daq-meta`},Rn={class:`daq-name`},zn={class:`daq-code`},Bn=[`title`,`onClick`],Vn={class:`daq-count`},Hn={key:0,class:`daq-children`},Un=[`draggable`,`title`,`onDragstart`,`onClick`],Wn={class:`daq-meta`},Gn={class:`daq-name`},Kn={class:`daq-node-sub`},qn={class:`node-val mono`},Jn={class:`node-dev`},Yn={key:0,class:`scene-cur`},Xn={key:0,class:`daq-empty-hint`},Zn={class:`panel`},Qn={class:`panel-hd`},$n={class:`panel-tag`},er={class:`daq-list`},tr=[`title`,`onClick`,`onKeydown`],nr={class:`daq-ico`},rr=[`innerHTML`],ir={class:`daq-meta`},ar={class:`daq-name`},or={class:`daq-code`},sr=[`title`,`onClick`],cr={class:`daq-count`},lr={key:0,class:`daq-children`},ur=[`draggable`,`title`,`onDragstart`,`onClick`],dr={class:`daq-meta`},fr={class:`daq-name`},pr={class:`daq-node-sub`},mr={class:`node-val mono`},hr={class:`node-dev`},gr={key:0,class:`scene-cur`},_r={key:0,class:`daq-empty-hint`},vr={class:`panel`},yr={class:`panel-hd`},br={class:`panel-tag`},xr={class:`scene-list`},Sr=[`draggable`,`data-channel-id`,`title`,`onDragstart`,`onClick`],Cr={class:`scene-meta-wrap`},wr={class:`scene-name`},Tr={class:`scene-meta`},Er={key:0,class:`scene-cur`},Dr={key:1,class:`scene-add`},Or={key:0,class:`scene-hint`},kr={class:`stage-col`},Ar={class:`stage-top`},jr={class:`vp-title`},Mr={class:`vp-id`},Nr={class:`vp-tools`},Pr=[`title`],Fr=[`title`],Ir=[`title`],Lr=[`title`],Rr={class:`angle-chip`},zr=[`value`,`aria-label`],Br={value:`std`},Vr={class:`leaders`},Hr=[`d`,`stroke`],Ur=[`cx`,`cy`,`fill`],Wr={class:`callout-layer`},Gr=[`title`,`onClick`],Kr={class:`co-label`},qr={class:`co-val`},Jr={class:`co-range`},Yr={class:`kpi-strip`},Xr={class:`kpi`},Zr={class:`kpi-meta`},Qr={class:`kpi-label`},$r={class:`kpi-val`},ei={class:`kpi`},ti={class:`kpi-meta`},ni={class:`kpi-label`},ri={class:`kpi-val`},ii={class:`kpi`},ai={class:`kpi-meta`},oi={class:`kpi-label`},si={class:`kpi-val`},ci={class:`kpi`},li={class:`kpi-meta`},ui={class:`kpi-label`},di={class:`kpi-val`},fi={class:`kpi`},pi={class:`kpi-meta`},mi={class:`kpi-label`},hi={class:`kpi-val`},gi={key:1,class:`empty-hint`},_i=[`title`],vi={class:`bp-name`},yi={class:`bp-sub`},bi={class:`bp-tabs`},xi={class:`bp-row`},Si={class:`bp-label`},Ci={class:`bp-seg`},wi={class:`bp-row`},Ti={class:`bp-label`},Ei={class:`bp-val`},Di={class:`bp-row`},Oi={class:`bp-label`},ki={class:`bp-val`},Ai={class:`bp-row`},ji={class:`bp-label`},Mi={class:`bp-val`},Ni={class:`bp-hint`},Pi={class:`member-list`},Fi={class:`member-info`},Ii={class:`member-name`},Li=[`value`,`onChange`],Ri=[`value`],zi={key:0,class:`bp-hint`},Bi={class:`bp-actions`},Vi={key:3,class:`drop-chip`},Hi={key:4,class:`error-chip`},Ui={key:5,"data-hud":`town-loading`,class:`loading-mask`},Wi={class:`loading-text`},Gi={class:`dock`},Ki={class:`dock-card`},qi={class:`dock-hd`},Ji={class:`dock-mode`},Yi={class:`ctl-sec`},Xi={class:`ctl-row`},Zi=[`title`],Qi={class:`fps-seg`},$i=[`onClick`],ea={class:`ctl-row`},ta=[`title`],na={class:`fps-seg`},ra=[`onClick`],ia={class:`ctl-sec`},aa={class:`ctl-row`},oa={class:`ctl-name`},sa=[`value`],ca={class:`ctl-val`},la={class:`ctl-row`},ua={class:`ctl-name`},da=[`value`],fa={class:`ctl-val`},pa={class:`ctl-row`},ma={class:`ctl-name`},ha=[`value`],ga={class:`ctl-val`},_a={class:`ctl-row`},va=[`title`],ya=[`value`],ba={class:`ctl-val`},xa={class:`ctl-sec`},Sa={class:`ctl-row`},Ca={class:`ctl-name`},wa={class:`ctl-btns`},Ta=[`disabled`,`title`],Ea={class:`dock-card`},Da={class:`dock-hd`},Oa={class:`dock-count mono`},ka=[`onClick`],Aa=[`title`],ja={class:`trend-wrap`},Ma={key:0,class:`trend-empty`},Na={class:`rail rail-right`},Pa={key:0,class:`panel inspector`},Fa={class:`panel-hd`},Ia=[`title`],La={class:`ins-chip-row`},Ra={class:`ins-chip mono`},za={key:0,class:`ins-chip accent`},Ba={key:1,class:`ins-chip accent`},Va={key:0,class:`daq-info`},Ha={class:`daq-info-row`},Ua={class:`cy`},Wa={class:`daq-info-row`},Ga={class:`daq-info-row`},Ka={class:`daq-bind-bar`},qa=[`step`,`placeholder`],Ja=[`disabled`],Ya={key:0,class:`dcw-err`},Xa={key:1,class:`daq-bind-bar`},Za={value:``},Qa=[`value`],$a=[`disabled`],eo={key:1,class:`daq-info`},to={class:`daq-info-row`},no={class:`cy`},ro={class:`daq-info-row`},io={class:`daq-info-row`},ao={key:0,class:`daq-bind-bar`},oo={value:``},so=[`value`],co=[`disabled`],lo={key:1,class:`daq-node-ctl`},uo={class:`daq-info-row`},fo={class:`daq-th-inputs`},po={class:`daq-info-row`},mo={class:`daq-th-inputs`},ho=[`value`],go=[`value`],_o={class:`daq-info-row`},vo={class:`daq-th-inputs`},yo=[`value`],bo=[`value`],xo={class:`daq-info-row`},So={class:`daq-info-row`},Co=[`title`],wo={key:2,class:`ins-empty`},To={class:`obj-row`},Eo={class:`obj-label`},Do=[`placeholder`,`disabled`,`title`],Oo={class:`obj-row`},ko={class:`obj-label`},Ao=[`value`,`disabled`],jo=[`value`],Mo={class:`sect-hd`},No={class:`bind-ico`},Po=[`innerHTML`],Fo={class:`bind-meta`},Io={class:`bind-label`},Lo={class:`bind-val`},Ro=[`title`,`onClick`],zo={key:0,class:`ins-empty`},Bo={key:1,class:`bind-add-wrap`},Vo={key:0,class:`bp-group`},Ho={class:`bp-tpl`},Uo=[`data-node-id`,`title`,`onClick`],Wo=[`innerHTML`],Go={key:0,class:`bp-cur`},Ko={key:1,class:`bp-cur`},qo={key:0,class:`bp-empty`},Jo={class:`sect-hd`},Yo={class:`dcw-top`},Xo={class:`bind-ico`},Zo=[`innerHTML`],Qo={class:`dcw-id`},$o={class:`bind-label`},es={key:0,class:`dcw-tag`},ts={class:`dcw-name`},ns={class:`dcw-cur`},rs=[`title`,`onClick`],is={class:`dcw-win-num`},as={class:`dcw-win-track`},os={class:`dcw-win-num`},ss={class:`dcw-write`},cs=[`onUpdate:modelValue`,`step`,`placeholder`,`onKeydown`],ls=[`disabled`,`title`,`onClick`],us={key:0,class:`dcw-err`},ds={key:2,class:`ins-empty`},fs={key:3,class:`bind-add-wrap`},ps={key:0,class:`bp-group`},ms={class:`bp-tpl`},hs=[`data-node-id`,`title`,`onClick`],gs=[`innerHTML`],_s={key:0,class:`bp-cur`},vs={key:1,class:`bp-cur`},ys={key:0,class:`bp-empty`},bs={class:`xz-seg`},xs={class:`scale-row`},Ss=[`value`],Cs={class:`scale-val`},ws={class:`ins-foot`},Ts={key:5,class:`ins-empty`},Es={class:`chat-id-row`},Ds={class:`chat-nameplate`},Os={class:`chat-name`},ks={class:`chat-meta`},As={key:0,class:`chat-harness`},js={class:`chat-count`},Ms={class:`obj-row`},Ns={class:`obj-label`},Ps=[`value`,`disabled`],Fs=[`value`],Is={class:`obj-row`},Ls={class:`obj-label`},Rs={class:`range-status`},zs=[`title`],Bs={class:`sect-hd`},Vs={class:`bind-meta`},Hs={class:`bind-label`},Us=[`value`,`title`,`onChange`],Ws={value:`auto`},Gs={value:`manual`},Ks=[`title`,`onClick`],qs={key:0,class:`ins-empty`},Js={key:1,class:`daq-bind-bar`,style:{"margin-bottom":`8px`}},Ys={value:`dcw`},Xs={value:`daq`},Zs={value:``},Qs=[`value`],$s=[`value`],ec={value:`auto`},tc={value:`manual`},nc=[`disabled`],rc={class:`sect-hd`,style:{color:`var(--hud-amber)`}},ic={class:`approval-detail`},ac=[`onUpdate:modelValue`,`placeholder`],oc={class:`daq-bind-bar`,style:{"margin-top":`5px`}},sc=[`onClick`],cc=[`onClick`],lc={class:`obj-row`},uc={class:`obj-label`},dc={class:`bp-seg`},fc={class:`obj-row`},pc={class:`obj-label`},mc={class:`bp-val`},hc={class:`obj-row`},gc={class:`obj-label`},_c={class:`bp-val`},vc={key:4,class:`ins-empty`},yc={class:`sect-hd chat-sect`},bc=[`title`],xc={key:0,class:`rpg-note`},Sc={class:`rpg-divider`},Cc={class:`rpg-time`},wc={class:`rpg-bubble`},Tc={class:`rpg-text`},Ec={key:2,class:`rpg-divider live`},Dc={class:`rpg-time`},Oc={class:`rpg-bubble`},kc={class:`rpg-text`},Ac={key:3,class:`rpg-typing`},jc={class:`ty-label`},Mc={key:4,class:`rpg-note`},Nc={class:`panel`},Pc={class:`panel-hd`},Fc={class:`health-body`},Ic={class:`donut-wrap`},Lc={class:`donut-center`},Rc={class:`health-legend`},zc={class:`hl-row`},Bc={class:`n`},Vc={class:`hl-row`},Hc={class:`n`},Uc={class:`hl-row`},Wc={class:`n`},Gc={class:`hl-row`},Kc={class:`n`},qc={class:`panel`},Jc={class:`panel-hd`},Yc={class:`panel-tag`},Xc={class:`panel`},Zc={class:`panel-hd`},Qc={class:`panel-tag`},$c=[`title`],el={class:`alarm-list`},tl={class:`al-body`},nl={class:`al-txt`},rl={class:`al-src`},il=[`onClick`],al={key:0,class:`rail-empty`},ol={class:`panel`},sl={class:`panel-hd`},cl={class:`panel-tag`},ll={class:`event-list`},ul={class:`ev-time`},dl=[`title`],fl=[`title`],pl={key:0,class:`rail-empty`},ml={class:`panel`},hl={class:`panel-hd`},gl={class:`mm-body`},_l=[`title`],vl={class:`mm-col`},yl=[`title`],bl=[`title`],xl=[`title`],Sl={class:`mm-meta mono`},Cl={class:`statusbar`},wl={class:`sb-stats`},Tl={class:`sb-lat mono`},El={class:`copy`},Dl={key:0,"data-hud":`town-loading`,class:`loading-mask`},Ol={class:`loading-text`},kl=`aw-town-panel-pos`,Al=3200,jl=2400,Ml=3e4,Nl=80,Pl=120,Fl=104,Il=8,Ll=1600,Rl=Object.assign(E(e({__name:`TownView`,props:{channelId:{},allChannels:{type:Boolean}},setup(e){let{t:d}=se(),f=e,y=Se(),x=xe(),{conn:C}=Ce(),te=we(),E=je(),D=Oe(),O=Ft(),de=ce(),fe=S(null),F=_(null),pe=_(null),I=_(null),me=typeof window<`u`?new URLSearchParams(location.search).get(`render`)!==`2d`:!0,he=S(!1),_e=S(0),ve=S(0),ye=S(0),be=S(null),L=S(null),R=S(``),ke=m(()=>C.state===`connecting`),Ae=m(()=>y.channels[f.channelId]?.name??``),z=S(`browse`),Me=S(!0),B=S(null),Ne=m(()=>{switch(B.value?.state){case`dirty`:return d(`townView.k3oo50k155`);case`saving`:return d(`townView.k1b38d59156`);case`saved`:return d(`townView.k3n51yk157`);case`error`:return d(`townView.k1b3ayhc158`);default:return``}});function Pe(){z.value=z.value===`browse`?`edit`:`browse`,I.value?.setMode(z.value),z.value===`browse`&&(We(),Ge(null)),W.value=!1}let Fe=S(`translate`);function Ie(e){Fe.value=e,I.value?.setTransformMode(e)}p(()=>[L.value,z.value],([e,t])=>{t===`edit`&&e?.kind===`device`&&I.value?.setTransformMode(Fe.value)});function Le(e){let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`SELECT`||t.tagName===`TEXTAREA`||t.isContentEditable))return;let n=e.key.toLowerCase();if(e.key===`Escape`){We();return}z.value===`edit`&&L.value?.kind===`device`&&(n===`g`?Ie(`translate`):n===`r`?Ie(`rotate`):n===`s`?Ie(`scale`):(e.key===`Delete`||e.key===`Backspace`)&&dt())}function Re(){Me.value=!Me.value,I.value?.setSnap(Me.value)}function ze(e,t,n,r){let i=t||f.channelId;return i?de.request({method:`PATCH`,url:`/workshop/channels/${i}/agents/${e}/position`,data:{x:n,z:r}}).catch(()=>null):Promise.resolve()}function Be(e,t,n){let r=t||f.channelId;return r?de.request({method:`PATCH`,url:`/workshop/channels/${r}/agents/${e}/range`,data:{range:n}}).catch(()=>null):Promise.resolve()}function Ve(){if(z.value!==`edit`){jt();return}I.value?.persistAllDevices()}function He(e){L.value&&I.value?.setModelScale(L.value.id,e,L.value.kind)}function Ue(e){L.value&&I.value?.persistScale(L.value.kind,L.value.id)}function We(){L.value=null}let V=S(null),H=S(null);function Ge(e){V.value=e,H.value=e?I.value?.getChannelLayout(e)??null:null}async function Ke(){if(!V.value||!H.value)return;let e=H.value,t={x:e.x,z:e.z,radiusX:e.radiusX,radiusZ:e.radiusZ,shape:e.shape??`ellipse`,rotationY:e.rotationY??0};try{await O.save(V.value,t),B.value={state:`saved`,at:Date.now()}}catch(e){B.value={state:`error`,at:Date.now()},R.value=e instanceof Error?e.message:String(e)}}async function qe(){if(V.value)try{await O.remove(V.value),I.value?.removeChannel(V.value),Ge(null)}catch(e){R.value=e instanceof Error?e.message:String(e)}}function Je(){!V.value||!H.value||(I.value?.updateChannelLayout(V.value,H.value),B.value={state:`dirty`,at:Date.now()})}let Ye=S(``);function Xe(e){let t=I.value;if(t){if(e.placed){t.focusChannel(e.channelId),Ge(e.channelId);return}Ye.value=d(`townView.k7rvbts159`),window.setTimeout(()=>{Ye.value=``},2600)}}function Ze(e,t,n){let r=I.value;if(!r)return!1;let i=G().find(t=>t.channelId===e),a=i?.channelName??y.channels[e]?.name??e.slice(0,8),o=i?.agents.length??y.agents[e]?.length??0;return r.getChannelLayout(e)?(Ye.value=d(`townView.kcyn0191`,{p0:a}),window.setTimeout(()=>{Ye.value=``},2600),r.focusChannel(e),Ge(e),!1):(r.dropChannelOnWorld(t,n,e,a,o),O.save(e,{x:t,z:n,radiusX:Math.max(120,110+o*18),radiusZ:Math.max(80,70+o*14),shape:`ellipse`,rotationY:0}).then(()=>{B.value={state:`saved`,at:Date.now()}}).catch(()=>{B.value={state:`error`,at:Date.now()}}),r.focusChannel(e),!0)}let Qe=m(()=>E.models.filter(e=>e.kind===`glb`)),$e=m(()=>E.models.filter(e=>e.kind===`dev`)),et=S(``),U=S(null),W=S(!1);p(()=>L.value,e=>{if(et.value=e?.kind===`device`?I.value?.getDeviceName?.(e.id)??``:``,U.value=null,e?.kind===`agent`){let t=I.value?.getAgentRange?.(e.id);U.value=t?{radiusX:t.radiusX,radiusZ:t.radiusZ,shape:t.shape}:null,W.value=I.value?.isRangeDrawing(e.id)??!1}else W.value=!1});let nt=m(()=>{let e=L.value;if(!e||e.kind!==`agent`)return``;let t=I.value?.getAgentRange?.(e.id);return t?`${t.shape===`rect`?d(`townView.k43u0g050`):d(`townView.k414bc049`)} ${Math.round(t.radiusX)} × ${Math.round(t.radiusZ)}`:d(`townView.k1v1icf6160`)});function rt(){let e=L.value;if(!(!e||e.kind!==`agent`)){if(W.value){I.value?.cancelRangeDraw(),W.value=!1;return}I.value?.startRangeDraw(e.id),W.value=!0}}function it(){!L.value||L.value.kind!==`agent`||!U.value||(I.value?.setAgentRangeScene(L.value.id,U.value),B.value={state:`dirty`,at:Date.now()})}function at(){!L.value||L.value.kind!==`agent`||I.value?.commitAgentRange(L.value.id)}function ot(){let e=L.value;!e||e.kind!==`agent`||(I.value?.clearAgentRange(e.id),U.value=null,W.value=!1)}function st(){if(!L.value||L.value.kind!==`device`)return;let e=L.value.id,t=et.value.trim();t&&(I.value?.renameDevice(e,t),D.update(e,{name:t}).catch(e=>{R.value=e instanceof Error?e.message:String(e)}))}async function ct(e){let t=L.value;if(!t||t.kind!==`agent`)return;let n=t.id,r=y.agents?Object.keys(y.agents).find(e=>(y.agents[e]??[]).some(e=>e.agentId===n)):void 0;if(!r){R.value=d(`townView.kpplr16161`);return}try{await E.bind(r,n,e),I.value?.swapAgentModel(n,e)}catch(e){R.value=e instanceof Error?e.message:String(e)}}async function lt(e){let t=L.value;if(!(!t||t.kind!==`device`)){I.value?.swapDeviceModel(t.id,e);try{await D.update(t.id,{modelRef:e})}catch(e){R.value=e instanceof Error?e.message:String(e)}}}let ut=S(``);function dt(){let e=L.value;if(!(!e||e.kind!==`device`)){if(ut.value!==e.id){ut.value=e.id,window.setTimeout(()=>{ut.value===e.id&&(ut.value=``)},3e3);return}ut.value=``,I.value?.removeDevice(e.id).then(()=>We()).catch(e=>{R.value=e instanceof Error?e.message:String(e)})}}let ft=S(`boundary`),pt=m(()=>V.value?G().find(e=>e.channelId===V.value)?.agents??[]:[]);async function mt(e,t){if(V.value)try{await E.bind(V.value,e,t),I.value?.swapAgentModel(e,t)}catch(e){R.value=e instanceof Error?e.message:String(e)}}function ht(e){ft.value=e}let gt=S(0),_t=m(()=>(gt.value,vt().map(e=>({channelId:e,name:y.channels[e]?.name??e.slice(0,8),agentCount:(y.agents[e]??[]).length,placed:I.value?.hasChannel(e)??!1,color:bt(e)}))));function vt(){let e=[];for(let t of yt()??[])for(let n of t.channelIds??[])e.includes(n)||e.push(n);return e.includes(f.channelId)||e.push(f.channelId),e}function yt(){return x.workspaces}function bt(e){return ge(e)}function xt(e,t){e.dataTransfer&&(e.dataTransfer.setData(`application/x-aw-channel`,t),e.dataTransfer.setData(`text/plain`,t),e.dataTransfer.effectAllowed=`copy`)}function G(){let e=[];for(let[t,n]of Object.entries(y.channels)){let r=(y.agents[t]??[]).map(e=>{let n=e.currentTaskId?(y.tasks[t]??[]).find(t=>t.id===e.currentTaskId):void 0;return{agentId:e.agentId,name:e.name,role:e.role,harness:e.harness,state:e.state,currentTaskId:e.currentTaskId??null,currentTaskTitle:n?.title??null,currentTaskProgress:e.currentTaskProgress??n?.progress??null,modelRef:e.modelRef??null,homeX:e.config?.homeX??null,homeZ:e.config?.homeZ??null,range:e.config?.range??null}});e.push({channelId:t,channelName:n.name,agents:r})}return e}function St(e){!e||!(`registerModelsFromList`in e)||(`screenToWorld`in e?e.registerModelsFromList(E.models.map(e=>({id:e.id,file:e.file,name:e.name,kind:e.kind,hFactor:e.hFactor??1}))):e.registerModelsFromList(E.models.map(e=>({id:e.id,file:e.file,name:e.name}))))}p(()=>E.models.map(e=>`${e.id}:${e.file}`).join(`|`),()=>St(F.value));async function Ct(){F.value||!fe.value||(me?await wt():await Tt())}async function wt(){let e=fe.value;if(!e)return;let[{TownScene3D:t}]=await Promise.all([oe(()=>import(`./BUcmySDa2.js`),__vite__mapDeps([0,1,2,3]),import.meta.url)]),n=new t(G(),e);n.resolveTaskAssignee=e=>y.tasks[f.channelId]?.find(t=>t.id===e)?.assigneeId??null,n.devices={async create(e){return{id:(await D.create({name:e.name,modelRef:e.modelRef,kind:e.kind,controls:e.controls,posX:e.posX,posZ:e.posZ,scale:e.scale})).id}},async update(e,t){if(J.nodeById(e)){await J.saveTransform(e,t.posX,t.posZ);return}await D.update(e,t)},async remove(e){if(J.nodeById(e)){await J.removeNode(e);return}await D.remove(e)},async control(e,t,n){return D.control(e,t,n)}},n.agentApi={async updateHome(e,t,n,r){return ze(e,t,n,r)},async updateRange(e,t,n){return Be(e,t,n)}},n.channelApi={async save(e,t){return O.save(e,t)}},F.value=n,St(n),I.value=n,n.setFpsCap(Number(pf.value)),n.setQualityMode(gf.value),Et(n),n.on(`select`,e=>{L.value=e}),n.on(`saveState`,e=>{B.value=e}),n.on(`selectChannel`,e=>{Ge(e)}),n.on(`channelResized`,e=>{e&&V.value===e.channelId&&(H.value=e.layout)}),n.on(`agentRangeChanged`,e=>{if(e&&L.value?.kind===`agent`&&L.value.id===e.agentId){let t=I.value?.getAgentRange?.(e.agentId);U.value=t?{radiusX:t.radiusX,radiusZ:t.radiusZ,shape:t.shape}:null}}),he.value=!0,Dt(n),Bf=ql(n),O.load().then(()=>{n.hydrate(G(),Object.values(O.layouts),Wl.value),It()}).catch(e=>{R.value=d(`townView.k1hmf2ut192`,{p0:e instanceof Error?e.message:String(e)}),window.setTimeout(()=>{O.load()},2500)})}async function Tt(){let e=fe.value;if(!e)return;let[t,{TownScene:n}]=await Promise.all([oe(()=>import(`./BGkumHZ32.js`),[],import.meta.url),oe(()=>import(`./RYFtK4qZ2.js`),__vite__mapDeps([4,5,1,2]),import.meta.url)]),r=new n(G());F.value=r,St(r),r.resolveTaskAssignee=e=>y.tasks[f.channelId]?.find(t=>t.id===e)?.assigneeId??null;let i=new t.Game({type:t.AUTO,parent:e.id||`town-host`,width:1100,height:700,backgroundColor:`#eceae4`,pixelArt:!0,antialias:!1,roundPixels:!0,powerPreference:`high-performance`,physics:{default:`arcade`,arcade:{gravity:{x:0,y:0},debug:!1}},scale:{mode:t.Scale.FIT,autoCenter:t.Scale.CENTER_BOTH},scene:r});pe.value=i,Et(r),r.on(`ready`,()=>{he.value=!0,Dt(r)})}function Et(e){let t=e;t.on(`fps`,e=>{_e.value=e}),t.on(`agentCount`,e=>{ve.value=e}),t.on(`blockCount`,e=>{ye.value=e,gt.value++}),t.on(`lastActivity`,e=>{be.value=e});let n=te.subscribe(t=>{try{if(t.type===`channel.snapshot`){e.rebuild(G()),F.value&&K(F.value),f.channelId&&e.focusChannel(f.channelId);return}if(t.type===`device.updated`){D.applyRemote(t.payload),F.value&&K(F.value);return}if(t.type===`device.created`){D.load().then(()=>{F.value&&K(F.value)});return}if(t.type===`device.deleted`){D.removeRemote(t.payload.id),F.value&&K(F.value);return}if(t.type===`scene.layout.saved`||t.type===`scene.layout.removed`){O.load().then(()=>{Pt(F.value),It()});return}let n=ue(t)?.bubble;n?.agentId&&rn(n.agentId,n.kind,n.text,t.at,t.seq),e.handleTownEvent(t)}catch(e){R.value=e instanceof Error?e.message:String(e)}});F._off=n,window.__town={get scene(){return F.value},get game(){return pe.value},buildInput:G,get characterAssets(){return E}}}function Dt(e){if(`screenToWorld`in e){Nt(e);return}kt(e)}let Ot=[];function kt(e){let t=e.game.canvas;if(!t)return;let n=(n,r)=>{let i=e.cameras.main,a=t.getBoundingClientRect(),o=(n-a.left)/a.width,s=(r-a.top)/a.height;return{x:i.worldView.x+o*i.worldView.width,y:i.worldView.y+s*i.worldView.height}},r=!1,i=0,a=0;t.addEventListener(`pointerdown`,e=>{e.button===0&&(r=!0,i=e.clientX,a=e.clientY)});let o=n=>{if(!r)return;let o=e.cameras.main,s=t.getBoundingClientRect(),c=e.game.scale.width/s.width,l=(n.clientX-i)*c/o.zoom,u=(n.clientY-a)*c/o.zoom;o.scrollX-=l,o.scrollY-=u,i=n.clientX,a=n.clientY},s=()=>{r=!1};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s),Ot.push(()=>window.removeEventListener(`pointermove`,o)),Ot.push(()=>window.removeEventListener(`pointerup`,s)),t.addEventListener(`wheel`,t=>{t.preventDefault();let n=e.cameras.main,r=n.zoom+(t.deltaY<0?.08:-.08);n.setZoom(Math.min(2.4,Math.max(.6,r)))},{passive:!1}),t.addEventListener(`dragover`,e=>{e.preventDefault(),e.dataTransfer.dropEffect=`copy`}),t.addEventListener(`drop`,t=>{t.preventDefault();let r=t.dataTransfer?.getData(`application/x-aw-model`)||t.dataTransfer?.getData(`text/plain`);if(!r)return;let i=n(t.clientX,t.clientY),a=e.dropModelOnWorld(i.x,i.y,r);Gt.value=a})}let At=null;function jt(){R.value=d(`townView.kt6xb5p162`),At&&clearTimeout(At),At=setTimeout(()=>{R.value=``},2600)}function Nt(e){let t=e.canvas;if(!t)return;let n=0,r=0,i=0;t.addEventListener(`contextmenu`,e=>e.preventDefault()),t.addEventListener(`mousedown`,e=>{e.button===1&&e.preventDefault()}),t.addEventListener(`pointerdown`,t=>{if(!e.isGizmoBusy?.()){if(t.button===1||t.button===2||t.shiftKey){t.preventDefault(),n=2,r=t.clientX,i=t.clientY;return}t.button===0&&(e.tryStartPointerDrag(t.clientX,t.clientY)||(n=1,r=t.clientX,i=t.clientY))}});let a=t=>{if(e.isGizmoBusy?.())return;if(e.isPointerDragging()){e.movePointerDrag(t.clientX,t.clientY);return}if(!n)return;let a=t.clientX-r,o=t.clientY-i;r=t.clientX,i=t.clientY,n===1?e.orbitBy(a,o):e.panByScreen(a,o)},o=()=>{if(e.isPointerDragging()){e.endPointerDrag();return}n=0};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o),Ot.push(()=>window.removeEventListener(`pointermove`,a)),Ot.push(()=>window.removeEventListener(`pointerup`,o)),t.addEventListener(`wheel`,t=>{t.preventDefault(),e.zoomBy(t.deltaY>0?.12:-.11)},{passive:!1}),t.addEventListener(`dragover`,e=>{e.preventDefault(),e.dataTransfer.dropEffect=`copy`}),t.addEventListener(`drop`,t=>{t.preventDefault();let n=t.dataTransfer;if(!n)return;if(z.value!==`edit`){jt();return}let r=n.getData(`application/x-aw-channel`)||n.getData(`text/plain`);if(r&&_t.value.some(e=>e.channelId===r)){let n=e.screenToWorld(t.clientX,t.clientY);Ze(r,n.x,n.z);return}let i=n.getData(`application/x-aw-daq-node`);if(i){let n=J.nodeById(i);if(n){let r=e.screenToWorld(t.clientX,t.clientY);J.patchNode(i,{posX:Math.round(r.x),posZ:Math.round(r.z)}).then(()=>{if(!n.deviceBindingId){let e=Wu(r.x,r.z,95);e&&Bu(i,e.id)}}).catch(e=>{R.value=e instanceof Error?e.message:String(e)})}return}let a=n.getData(`application/x-aw-dcw-node`);if(a){let n=Y.nodes.find(e=>e.id===a);if(n){let r=e.screenToWorld(t.clientX,t.clientY);Y.patchNode(a,{posX:Math.round(r.x),posZ:Math.round(r.z)}).then(()=>{if(!n.deviceBindingId){let e=Wu(r.x,r.z,95);e&&Y.bindNode(a,e.id).catch(e=>{R.value=e instanceof Error?e.message:String(e)})}F.value&&K(F.value)}).catch(e=>{R.value=e instanceof Error?e.message:String(e)})}return}let o=n.getData(`application/x-aw-model`)||n.getData(`text/plain`);if(o){let n=e.screenToWorld(t.clientX,t.clientY),r=e.dropModelOnWorld(n.x,n.z,o);Gt.value=r}})}function K(e){`syncDevices`in e&&e.syncDevices(Wl.value)}p(()=>O.rev,e=>{let t=I.value;!t||!O.loaded||e===0||(t.hydrate(G(),Object.values(O.layouts),Wl.value),It())});function Pt(e){if(!e||!(`applySceneLayouts`in e))return;let t=e;t.applySceneLayouts(Object.values(O.layouts)),t.rebuild(G())}function It(){O.load().finally(()=>{})}function Lt(e){let t=I.value;t&&(typeof e.posX==`number`&&typeof e.posZ==`number`&&t.focusTo(e.posX,e.posZ),t.setSelected?.({kind:`device`,id:e.id}))}let Rt=h({});function zt(){if(!(typeof localStorage>`u`))try{let e=JSON.parse(localStorage.getItem(kl)||`{}`);for(let t of Object.keys(e))e[t]&&Number.isFinite(e[t].x)&&(Rt[t]=e[t])}catch{}}function Bt(){try{localStorage.setItem(kl,JSON.stringify(Rt))}catch{}}let Vt=null;function Ht(e,t){let n=e.currentTarget,r=n.closest(`.drag-panel`),i=n.closest(`.town-frame`);if(!r||!i)return;e.preventDefault();let a=r.getBoundingClientRect(),o=i.getBoundingClientRect();r.style.left=`${a.left-o.left}px`,r.style.top=`${a.top-o.top}px`,r.style.bottom=`auto`,r.style.transform=`none`,Rt[t]={x:a.left-o.left,y:a.top-o.top},Vt={frame:i,panel:r,offX:e.clientX-a.left,offY:e.clientY-a.top},document.body.style.userSelect=`none`,document.body.style.cursor=`grabbing`;let s=e=>{let n=Vt;if(!n)return;let r=n.frame.getBoundingClientRect(),i=e.clientX-n.offX-r.left,a=e.clientY-n.offY-r.top,o=n.panel.offsetWidth,s=Math.max(-o+90,Math.min(i,r.width-30)),c=Math.max(4,Math.min(a,r.height-34));n.panel.style.left=`${s}px`,n.panel.style.top=`${c}px`,Rt[t]={x:s,y:c}},c=()=>{Vt=null,document.body.style.userSelect=``,document.body.style.cursor=``,window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),Bt()};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c)}zt();let Ut=_(null),Wt=e=>`#${e.toString(16).padStart(6,`0`)}`,Gt=_(null),Kt=m(()=>{let e=Gt.value;return e?e.mode===`rebind`?d(`townView.kgz2nej193`,{p0:e.agentId?.slice(0,8)??d(`townView.k479op189`),p1:e.textureKey}):d(`townView.k5e2460194`,{p0:e.textureKey}):``}),qt=m(()=>{let e=L.value;if(!e||e.kind!==`agent`)return[];let t=nn.get(e.id);if(!t||t.length===0)return[];let n=q.value.length?q.value[q.value.length-1]?.at??0:0;return t.filter(e=>e.at>n)}),Jt=m(()=>!L.value||L.value.kind!==`agent`?``:I.value?.getAgentName?.(L.value.id)??d(`townView.k3xdvm125`)),Yt=m(()=>{let e=L.value;if(!e||e.kind!==`agent`)return null;for(let t of Object.values(y.agents)){let n=(t??[]).find(t=>t.agentId===e.id);if(n)return n}return null}),Xt=m(()=>Yt.value?.role===`lead`?`Leader`:`Worker`),Zt=m(()=>Yt.value?.role===`lead`?`LEADER`:`WORKER`),Qt=m(()=>{let e=Yt.value?.state;return d(e===`busy`?`townView.k3n4l5f163`:e===`stopped`?`townView.k3n58d1164`:`townView.k3zcvb115`)}),q=S([]),$t=S(!1),en=new Map,tn=S(null),nn=h(new Map);function rn(e,t,n,r,i){let a=typeof r==`number`?r:r?Date.parse(String(r)):Date.now();if(!Number.isFinite(a)||a<=0)return;let o=nn.get(e);o||(o=[],nn.set(e,o));let s=o[o.length-1];s&&s.text===n&&Math.abs(a-s.at)<1500||(o.push({id:`live-${i??a}-${o.length}`,agentId:e,text:n,kind:t,at:a,live:!0}),o.length>Nl&&o.splice(0,o.length-Nl))}function an(){return typeof document>`u`?``:document.cookie.match(/(?:^|;\s*)token=([^;]+)/)?.[1]??``}function on(e){for(let t of Object.keys(y.agents))if((y.agents[t]??[]).some(t=>t.agentId===e))return t}async function sn(e,t,n=!1){let r=en.get(e);if(!n&&r&&Date.now()-r.at<Ml){q.value=r.rows;return}$t.value=!0;try{let n=an(),r=`/api/workshop/channels/${t}/events?limit=500&excludeTypes=agent.delta`,i=await(await fetch(r,{headers:n?{authorization:`Bearer ${decodeURIComponent(n)}`}:{}})).json().catch(()=>null),a=i?.data?.items??(Array.isArray(i?.data)?i.data:[]),o=[];for(let t of a){let n=ue(t)?.bubble;if(!n||n.agentId!==e)continue;let r=t.at,i=typeof r==`number`?r:r?Date.parse(String(r)):0;o.push({id:`${String(t.seq??o.length)}-${o.length}`,agentId:n.agentId,text:n.text,kind:n.kind,at:i,live:!1})}o.sort((e,t)=>e.at-t.at),en.set(e,{rows:o,at:Date.now()}),q.value=o}catch{q.value=[]}finally{$t.value=!1}}function Rl(){let e=L.value;if(!e||e.kind!==`agent`)return;let t=on(e.id);t&&sn(e.id,t,!0)}p(()=>L.value,e=>{if(!e||e.kind!==`agent`){q.value=[];return}let t=on(e.id);t?sn(e.id,t):q.value=[]},{immediate:!0});let zl=m(()=>{let e=L.value;if(!e||e.kind!==`agent`)return`#35e0a0`;let t=on(e.id);return t?ge(t)??`#35e0a0`:`#35e0a0`});function Bl(e){switch(e){case`artifact`:return d(`townView.k3w9q9165`);case`delta`:return`……`;case`info`:return d(`townView.k44xa7166`);case`error`:return d(`townView.k3zbgf167`);default:return``}}function Vl(e){if(!e||!Number.isFinite(e)||e<=0)return`--:--:--`;let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}p(()=>q.value.length+qt.value.length,async()=>{await a();let e=tn.value;e&&(e.scrollTop=e.scrollHeight)});let Hl=e=>Y.lines.find(t=>t.id===e)?.color,Ul=m(()=>Y.nodes.map(e=>({id:e.id,workspaceId:``,name:e.name,modelRef:`dcw-${e.templateRef.startsWith(`dcw-`)?e.templateRef.slice(4):e.templateRef}`,boundAgentId:null,kind:`daq`,telemetry:{value:e.value??0},desired:{},controls:[],state:e.enabled?e.state===`error`?`alarm`:`running`:`offline`,posX:e.posX,posZ:e.posZ,lineId:e.lineId||void 0,lineColor:e.lineId?Hl(e.lineId):void 0,updatedAt:e.lastWriteAt??e.createdAt}))),Wl=m(()=>[...D.twins.filter(e=>!uu(e)),...X.value,...Ul.value]),Gl=e=>Wl.value.find(t=>t.id===e),Kl=m(()=>he.value&&ye.value===0&&!Wl.value.some(e=>typeof e.posX==`number`&&typeof e.posZ==`number`));function ql(e){return P(()=>{D.load().then(()=>{if(F.value===e){e.syncDevices(Wl.value);for(let t of e.getDeviceNodes()){let n=Gl(t.twinId);n&&e.updateDeviceNode(t.twinId,n.state,n.telemetry)}}})},5e3)}let Jl=_([]),J=De(),Y=Te(),Yl=h(Y.templates.map(e=>({id:e.key,name:e.name,code:e.code,ch:e.ch,unit:e.unit,min:e.min,max:e.max,decimals:e.decimals,icon:e.icon})));p(()=>Y.templates,e=>{e?.length&&Yl.splice(0,Yl.length,...e.map(e=>({id:e.key,name:e.name,code:e.code,ch:e.ch,unit:e.unit,min:e.min,max:e.max,decimals:e.decimals,icon:e.icon})))},{immediate:!0,deep:!0});let Xl=cn(`aw.twin.treeOpen`,{});function Zl(e){Xl.value[e]=!Xl.value[e]}let Ql=m(()=>{let e=new Map;for(let t of J.nodes){let n=t.templateRef.startsWith(`daq-`)?t.templateRef.slice(4):t.templateRef,r=e.get(n)??[];r.push(t),e.set(n,r)}for(let t of e.values())t.sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0}));return e}),$l=m(()=>{let e=new Map;for(let t of Y.nodes){let n=t.templateRef.startsWith(`dcw-`)?t.templateRef.slice(4):t.templateRef,r=e.get(n)??[];r.push(t),e.set(n,r)}for(let t of e.values())t.sort((e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0}));return e});async function eu(e){try{let t=(Ql.value.get(e.id)?.length??0)+1;await J.createFromTemplate(`daq-${e.id}`,{name:`${e.name} ${String(t).padStart(2,`0`)}`}),Xl.value[`daq:${e.id}`]=!0}catch(e){R.value=e instanceof Error?e.message:String(e)}}async function tu(e){try{await Y.createFromTemplate(`dcw-${e.id}`,{}),Xl.value[`dcw:${e.id}`]=!0}catch(e){R.value=e instanceof Error?e.message:String(e)}}function nu(e,t){e.dataTransfer&&(e.dataTransfer.setData(`application/x-aw-daq-node`,t.id),e.dataTransfer.setData(`text/plain`,t.id),e.dataTransfer.effectAllowed=`copy`)}function ru(e,t){e.dataTransfer&&(e.dataTransfer.setData(`application/x-aw-dcw-node`,t.id),e.dataTransfer.setData(`text/plain`,t.id),e.dataTransfer.effectAllowed=`copy`)}function iu(e){return!J.controller.running||!e.enabled||e.state===`offline`?`offline`:e.state===`alarm`?`alarm`:e.state===`warn`?`warn`:`running`}function au(e){return!e.enabled||e.state===`error`?`offline`:`running`}let ou=h(Ee.map(e=>({id:e.key,name:e.name,code:e.code,ch:e.ch,unit:e.unit,base:e.base,amp:e.amp,min:e.min,max:e.max,decimals:e.decimals,icon:e.icon})));p(()=>J.templates,e=>{e?.length&&ou.splice(0,ou.length,...e.map(e=>({id:e.key,name:e.name,code:e.code,ch:e.ch,unit:e.unit,base:e.base,amp:e.amp,min:e.min,max:e.max,decimals:e.decimals,icon:e.icon})))},{immediate:!0,deep:!0});let su=e=>{let t=e.startsWith(`daq-`)?e.slice(4):e;return ou.find(e=>e.id===t)},cu=e=>su(e.templateRef);function lu(e){return!J.controller.running||!e.enabled?`offline`:e.state===`alarm`?`alarm`:`running`}let uu=e=>e.kind===`daq`||(e.modelRef??``).startsWith(`daq-`),X=m(()=>J.nodes.map(e=>({id:e.id,workspaceId:``,name:e.name,modelRef:`daq-${cu(e)?.id??`unknown`}`,boundAgentId:null,kind:`daq`,telemetry:{value:e.value??0},desired:{},controls:[],state:lu(e),posX:e.posX,posZ:e.posZ,lineId:e.lineId||void 0,lineColor:e.lineId?Hl(e.lineId):void 0,updatedAt:e.lastAt??e.createdAt}))),du=S(0),fu=new Map,pu=new Map,mu=null,hu=!1;function gu(){hu||(hu=!0,requestAnimationFrame(()=>{hu=!1,du.value++}))}function _u(e){if(!e.nodeId||typeof e.value!=`number`||!Number.isFinite(e.value))return;let t=e.state??`ok`;fu.set(e.nodeId,{value:e.value,state:t,atMs:Date.parse(e.at??``)||Date.now()});let n=pu.get(e.nodeId);n||(n=[],pu.set(e.nodeId,n)),n.push(e.value),n.length>Pl&&n.shift();let r=bu.get(e.nodeId);r&&r!==t&&xu(e.nodeId,r,t,e.value),r!==t&&bu.set(e.nodeId,t),gu()}let vu=m(()=>{du.value;let e=new Map;for(let t of J.nodes){let n=cu(t);if(!n)continue;let r=fu.get(t.id),i=r&&(!t.lastAt||r.atMs>=Date.parse(t.lastAt)),a=i?r.value:t.value;if(a==null)continue;let o=i?r.state:t.state;e.set(t.id,{value:a,hist:pu.get(t.id)??t.hist,phase:0,tpl:n,alarm:o===`alarm`})}return e}),yu=e=>e.value.toFixed(e.tpl.decimals),bu=new Map;function xu(e,t,n,r){let i=J.nodeById(e),a=i?cu(i):null,o=(i?.deviceBindingId?D.byId(i.deviceBindingId)?.name:null)??i?.name??e.slice(0,8),s=`${r?.toFixed(a?.decimals??2)??`--`} ${a?.unit??``}`;n===`alarm`?cf(d(`townView.k113fir9195`,{p0:o,p1:a?.ch??``,p2:s}),`crit`,o):n===`warn`?cf(d(`townView.k1knv89d196`,{p0:o,p1:a?.ch??``,p2:s}),`warn`,o):t!==`ok`&&n===`ok`&&cf(d(`townView.ksjancw197`,{p0:o,p1:a?.ch??``}),`info`,o)}p(()=>J.nodes.map(e=>`${e.id}:${e.state}`).join(`|`),()=>{for(let e of J.nodes){let t=bu.get(e.id);bu.set(e.id,e.state),!(!t||t===e.state)&&xu(e.id,t,e.state,e.value)}});function Su(e){return Math.max(0,Math.ceil((Date.parse(e.expiresAt)-Date.now())/1e3))}let Cu=()=>{let e=document.cookie.match(/(?:^|;\s*)token=([^;]+)/)?.[1]??``;return{"content-type":`application/json`,authorization:`Bearer ${decodeURIComponent(e)}`}},wu=S([]),Tu=S(`dcw`),Eu=S(``),Du=S(`auto`),Ou=S([]),ku=h({}),Au=null;async function ju(){let e=L.value?.id;if(!(L.value?.kind!==`agent`||!e))try{let t=await fetch(`/api/workshop/agent-tools/bindings?agentId=${encodeURIComponent(e)}`,{headers:Cu()}).then(e=>e.json());wu.value=t.data?.bindings??[]}catch{}}async function Mu(){let e=L.value?.id;if(!(L.value?.kind!==`agent`||!e))try{let t=await fetch(`/api/workshop/agent-tools/approvals?agentId=${encodeURIComponent(e)}`,{headers:Cu()}).then(e=>e.json());Ou.value=t.data?.approvals??[]}catch{}}async function Nu(){!L.value?.id||!Eu.value||(await fetch(`/api/workshop/agent-tools/bindings`,{method:`POST`,headers:Cu(),body:JSON.stringify({agentId:L.value.id,nodeId:Eu.value,kind:Tu.value,mode:Du.value})}),Eu.value=``,await ju())}async function Pu(e){await fetch(`/api/workshop/agent-tools/bindings/${e}`,{method:`DELETE`,headers:Cu()}),await ju()}async function Fu(e,t){await fetch(`/api/workshop/agent-tools/bindings/${e}`,{method:`PATCH`,headers:Cu(),body:JSON.stringify({mode:t})}),await ju()}async function Iu(e,t){await fetch(`/api/workshop/agent-tools/approvals/${e}/decide`,{method:`POST`,headers:Cu(),body:JSON.stringify({approved:t,comment:ku[e]??``})}),Reflect.deleteProperty(ku,e),await Mu()}p(()=>L.value?.id,e=>{Au&&=(clearInterval(Au),null),L.value?.kind===`agent`&&e&&(ju(),Mu(),Au=P(()=>{Mu()},1e3))},{immediate:!0}),t(()=>{Au&&clearInterval(Au)});function Lu(e){return e.kind===`dcw`?Y.nodeById(e.nodeId)?.name??e.nodeId:J.nodeById(e.nodeId)?.name??e.nodeId}let Ru=e=>J.nodeById(e)?.deviceBindingId??null,zu=e=>e?J.nodes.filter(t=>t.deviceBindingId===e).map(e=>e.id):[];function Bu(e,t){J.bindNode(e,t).catch(e=>{R.value=e instanceof Error?e.message:String(e)})}function Vu(e){J.bindNode(e,null).catch(e=>{R.value=e instanceof Error?e.message:String(e)})}let Hu={thermo:`<path d="M10 4a2 2 0 0 1 4 0v9a4 4 0 1 1-4 0V4Z"/><circle cx="12" cy="16.5" r="1.6"/>`,pressure:`<circle cx="12" cy="12" r="8"/><path d="m12 12 3.5-3.5"/><circle cx="12" cy="12" r="1.2"/>`,tension:`<circle cx="12" cy="10" r="4"/><path d="M4 18.5h16M8 18.5V14M16 18.5V14"/><path d="M2.5 10H8M16 10h5.5"/>`,encoder:`<circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="2"/><path d="M12 4v3M12 17v3M4 12h3M17 12h3"/>`,camera:`<rect x="3" y="7" width="13" height="10" rx="2"/><path d="m16 11 5-3v8l-5-3"/><circle cx="8" cy="12" r="2.5"/>`,gateway:`<rect x="8" y="11" width="8" height="10" rx="1.5"/><circle cx="12" cy="5.5" r="1.5"/><path d="M12 10V7M8.5 8.5a5 5 0 0 1 7 0M6 6a8.5 8.5 0 0 1 12 0"/>`},Uu=e=>Hu[e]??Hu.gateway;function Wu(e,t,n){let r=null,i=n;for(let n of D.twins){if(uu(n)||typeof n.posX!=`number`||typeof n.posZ!=`number`)continue;let a=Math.hypot(n.posX-e,n.posZ-t);a<i&&(i=a,r=n)}return r}let Gu=S(!1),Ku=S(!1),qu=S(420);function Ju(e,t){let n=t.currentTarget,r=n?.closest(`.panel`);if(n&&r){let e=n.getBoundingClientRect().top-r.getBoundingClientRect().top-12;qu.value=Math.max(160,Math.round(e))}e===`daq`?Gu.value=!Gu.value:Ku.value=!Ku.value}let Yu=m(()=>{let e=L.value?.kind===`device`?L.value.id:``,t={};if(!e)return t;for(let n of J.nodes){if(n.deviceBindingId===e)continue;let r=cu(n);r&&(t[r.id]??=[]).push({id:n.id,name:n.name,tpl:r,devName:n.deviceBindingId?D.byId(n.deviceBindingId)?.name??null:null,placed:typeof n.posX==`number`})}return t}),Xu=m(()=>Object.values(Yu.value).reduce((e,t)=>e+t.length,0));function Zu(e){let t=L.value?.kind===`device`?L.value.id:``;t&&(Bu(e,t),Gu.value=!1)}let Qu=new Map;function $u(e,t){let n=t;n?Qu.set(e,n):Qu.delete(e)}function ed(){for(let[e,t]of Qu){let n=vu.value.get(e),r=t.getContext(`2d`);if(!n||!r)continue;let i=t.width,a=t.height;r.clearRect(0,0,i,a);let o=n.hist;if(o.length<2)continue;let s=o[0],c=o[0];for(let e of o)e<s&&(s=e),e>c&&(c=e);let l=Math.max(1e-6,c-s);r.strokeStyle=Mf(e),r.lineWidth=1.4,r.beginPath(),o.forEach((e,t)=>{let n=t/(o.length-1)*(i-2)+1,c=a-2-(e-s)/l*(a-4);t?r.lineTo(n,c):r.moveTo(n,c)}),r.stroke()}}p(()=>J.nodes.map(e=>`${e.id}:${e.posX??``}:${e.posZ??``}:${e.enabled}:${e.state}:${e.deviceBindingId??``}`).join(`|`),()=>{F.value&&K(F.value)}),p(()=>Y.nodes.map(e=>`${e.id}:${e.posX??``}:${e.posZ??``}:${e.enabled}:${e.deviceBindingId??``}:${e.value??``}`).join(`|`),()=>{F.value&&K(F.value)}),p(()=>J.nodes.map(e=>`${e.id}:${e.deviceBindingId??``}`).join(`|`),()=>{let e=I.value;!e||!(`syncDaqLinks`in e)||e.syncDaqLinks(J.nodes.filter(e=>e.deviceBindingId).map(e=>({daqId:e.id,deviceId:e.deviceBindingId})))});let td=m(()=>L.value?.kind===`device`&&(nd.value?.modelRef||``).startsWith(`daq-`)),nd=m(()=>L.value?.kind===`device`?Gl(L.value?.id)??null:null),rd=m(()=>{let e=L.value?.id;return e?vu.value.get(e)??null:null}),id=S(``),ad=m(()=>{let e=L.value?.id;return e?zu(e).map(e=>{let t=Gl(e),n=vu.value.get(e),r=n?.tpl??su(t?.modelRef??``);return{daqId:e,name:t?.name??e,ch:r?.ch??t(`townView.k1ef3cls168`),icon:r?.icon??`gateway`,value:n?yu(n):`--`,unit:n?.tpl.unit??r?.unit??``,color:Mf(e)}}):[]}),od=m(()=>{let e=L.value?.id;if(!e)return``;let t=Ru(e);return t?D.twins.find(e=>e.id===t)?.name??t.slice(0,8):``}),sd=e=>e?Y.nodes.filter(t=>t.deviceBindingId===e):[];function cd(e){let t=Y.nodeById(e);if(!t||!t.lineId)return null;let n=Y.lineStateOf(t.lineId);if(!n.active||!n.recipeId)return null;let r=Y.recipes.find(e=>e.id===n.recipeId);return r?r.params.find(t=>t.nodeId===e)??null:null}let ld=m(()=>{let e=L.value?.id;return e?sd(e).map(e=>{let t=e.templateRef.startsWith(`dcw-`)?e.templateRef.slice(4):e.templateRef,n=Y.templates.find(e=>e.key===t),r=cd(e.id);return{dcwId:e.id,name:e.name,ch:n?.ch??t,unit:e.unit,icon:n?.icon??`gateway`,value:e.value,state:e.state,decimals:e.decimals,gMin:e.min,gMax:e.max,rMin:r?.min??null,rMax:r?.max??null}}):[]});function ud(e){let t=cd(e.id);return t&&(t.min!=null||t.max!=null)?{lo:t.min??-1/0,hi:t.max??1/0,src:`recipe`}:{lo:e.min,hi:e.max,src:`global`}}function dd(e){let t=e.rMin??e.gMin,n=e.rMax??e.gMax;return!Number.isFinite(t)||!Number.isFinite(n)||n<=t||e.value==null?50:Math.min(100,Math.max(0,(e.value-t)/(n-t)*100))}let fd=h({}),pd=h({});function md(e){let t=fd[e.id];if(t==null||t===``)return;let n=ud(e);if(Number(t)<n.lo||Number(t)>n.hi){pd[e.id]=d(`townView.kbuyve5198`,{p0:n.src===`recipe`?d(`townView.kb251ac190`):d(`townView.k1iwj796179`),p1:Number.isFinite(n.lo)?n.lo:`-∞`,p2:Number.isFinite(n.hi)?n.hi:`+∞`});return}pd[e.id]=``,Y.write(e.id,Number(t)).then(t=>{t.ok||(pd[e.id]=t.message)}).catch(t=>{pd[e.id]=t instanceof Error?t.message:String(t)})}let hd=e=>{let t=e.startsWith(`dcw-`)?e.slice(4):e;return Yl.find(e=>e.id===t)},gd=m(()=>{let e=L.value?.kind===`device`?L.value.id:``,t={};if(!e)return t;for(let n of Y.nodes){if(n.deviceBindingId===e)continue;let r=hd(n.templateRef);r&&(t[r.id]??=[]).push({id:n.id,name:n.name,tpl:r,devName:n.deviceBindingId?D.byId(n.deviceBindingId)?.name??null:null,placed:typeof n.posX==`number`})}return t}),_d=m(()=>Object.values(gd.value).reduce((e,t)=>e+t.length,0));function vd(e){let t=L.value?.kind===`device`?L.value.id:``;t&&(Y.bindNode(e,t).catch(e=>{R.value=e instanceof Error?e.message:String(e)}),Ku.value=!1)}function yd(e){Y.bindNode(e,null).catch(e=>{R.value=e instanceof Error?e.message:String(e)})}let bd=m(()=>L.value?.kind===`device`&&(Gl(L.value?.id)?.modelRef??``).startsWith(`dcw-`)),Z=m(()=>{let e=L.value?.id;return e?Y.nodeById(e)??null:null}),xd=m(()=>{let e=Z.value;return e?ud(e):null}),Sd=m(()=>{let e=Z.value;return e?.deviceBindingId?D.twins.find(t=>t.id===e.deviceBindingId)?.name??e.deviceBindingId.slice(0,8):``}),Cd=S(``);function wd(){let e=Z.value;!e||!Cd.value||(Y.bindNode(e.id,Cd.value).catch(e=>{R.value=e instanceof Error?e.message:String(e)}),Cd.value=``)}function Td(){let e=Z.value;e&&Y.bindNode(e.id,null).catch(e=>{R.value=e instanceof Error?e.message:String(e)})}function Ed(){let e=Z.value;e&&md(e)}function Dd(e){if(!e)return`--`;let t=ud(e);return`${Number.isFinite(t.lo)?t.lo:`-∞`} ~ ${Number.isFinite(t.hi)?t.hi:`+∞`} ${e.unit}`}function Od(e){if(!e)return``;let t=ud(e);return`${Number.isFinite(t.lo)?t.lo:``} ~ ${Number.isFinite(t.hi)?t.hi:``}`}let Q=m(()=>{let e=L.value?.id;return e?J.nodeById(e)??null:null}),kd=S(null);p(Q,e=>{kd.value=e?e.intervalMs??J.controller.defaultIntervalMs:null},{immediate:!0});function Ad(){let e=Q.value;!e||kd.value==null||J.patchNode(e.id,{intervalMs:Math.max(120,Math.min(6e4,Math.round(kd.value)))}).catch(e=>{R.value=e instanceof Error?e.message:String(e)})}function jd(e,t){let n=Number(t);Number.isFinite(n)&&J.patchNode(Q.value.id,{[e]:(e.startsWith(`warn`),n)}).catch(e=>{R.value=e instanceof Error?e.message:String(e)})}let Md=S(!0);function Nd(e){let t=Ru(e)??e,n=Gl(t);n&&(L.value={kind:`device`,id:t,scale:L.value?.scale??1,rotation:L.value?.rotation??0},et.value=n.name)}let Pd=S(!1);function Fd(){Pd.value=!Pd.value,I.value?.setAutoOrbit(Pd.value)}function Id(){let e=I.value,t=L.value;if(e){if(!t){R.value=d(`townView.k15tn2fh169`);return}if(t.kind===`device`){let n=e.getDeviceNodes().find(e=>e.twinId===t.id);n&&e.focusTo(n.x,n.z)}else{let n=e.getAgent(t.id);n&&e.focusTo(n.root.position.x,n.root.position.z)}}}let Ld=S({}),Rd=cn(`aw.twin.calloutNear`,1150),zd=m(()=>{let e={};for(let t of X.value){let n=vu.value.get(t.id);if(!n)continue;let r={ch:n.tpl.ch,value:yu(n),unit:n.tpl.unit,alarm:n.alarm??!1};(e[t.id]??=[]).push(r);let i=Ru(t.id);i&&(e[i]??=[]).push(r)}return e}),Bd=m(()=>{let e={};for(let t of Y.nodes){if(!t.deviceBindingId)continue;let n=t.templateRef.startsWith(`dcw-`)?t.templateRef.slice(4):t.templateRef,r=Y.templates.find(e=>e.key===n),i=ud(t);(e[t.deviceBindingId]??=[]).push({id:t.id,ch:r?.ch??n,name:t.name,unit:t.unit,value:t.value,readValue:t.readValue,lastReadAt:t.lastReadAt,decimals:t.decimals,lo:i.lo,hi:i.hi,src:i.src})}return e}),Vd=S({pos:{x:0,y:0,z:0},target:{x:0,z:0},yaw:0,dolly:1}),Hd=m(()=>{if(!Md.value)return[];let e=I.value;if(!e)return[];let t=e.getDeviceNodes(),n=qd.value?.clientWidth??1600,r=[];for(let e of X.value){let n=vu.value.get(e.id);if(!n)continue;let i=Ru(e.id),a=i?t.find(e=>e.twinId===i):t.find(t=>t.twinId===e.id);if(!a)continue;let o=Ld.value[e.id];o&&r.push({t:e,st:n,anchor:a,pos:o})}let i=new Map(r.map(e=>[e.anchor.twinId,e.anchor.topY])),a=new Map;for(let e of r){let t=a.get(e.anchor.twinId)??[];t.push(e),a.set(e.anchor.twinId,t)}let o=[];for(let e of a.values()){e.sort((e,t)=>e.t.id<t.t.id?-1:1);let t=e[0],r=Math.hypot(Vd.value.pos.x-t.anchor.x,Vd.value.pos.y-(i.get(t.anchor.twinId)??60),Vd.value.pos.z-t.anchor.z)<Rd.value,a=Math.min(n-96,Math.max(96,t.pos.x));e.forEach((e,n)=>{let{lo:i,hi:s}=yf(e.st.tpl.min,e.st.tpl.max);o.push({id:e.t.id,x:a,y:t.pos.y-n*Fl,label:`${e.st.tpl.ch} · ${e.anchor.name||e.t.name}`,value:yu(e.st),unit:e.st.tpl.unit,lo:i,hi:s,warn:e.st.alarm??!1,near:r,leader:n===0})})}return o}),Ud=null,Wd=m(()=>D.twins.length),Gd=m(()=>D.twins.filter(e=>e.state===`running`).length),Kd=le(),qd=S(null),Jd=S(`std`);function Yd(e){Jd.value=e.target.value,I.value?.setViewPreset(Jd.value)}function Xd(){document.fullscreenElement?document.exitFullscreen():qd.value?.requestFullscreen?.()}let Zd=m(()=>D.twins.filter(e=>e.state===`idle`).length),Qd=m(()=>D.twins.filter(e=>e.state===`alarm`).length),$d=m(()=>D.twins.filter(e=>e.state===`offline`).length),ef=m(()=>{let e=D.twins.length;if(!e)return 100;let t=Gd.value+Zd.value;return Math.round(t/e*100)}),tf=m(()=>ef.value>=90?`#35e0a0`:ef.value>=60?`#f6c453`:`#ff6b6b`),nf=S(null);function rf(){let e=nf.value;if(!e)return;let t=e.getContext(`2d`);if(!t)return;let n=D.twins.length||1,r=[{n:Gd.value,color:`#35e0a0`},{n:Zd.value,color:`#f6c453`},{n:Qd.value,color:`#ff6b6b`},{n:$d.value,color:`#3a4a63`}];t.clearRect(0,0,118,118),t.lineWidth=12;let i=-Math.PI/2;for(let e of r){if(!e.n)continue;let r=e.n/n*Math.PI*2;t.beginPath(),t.strokeStyle=e.color,t.arc(59,59,48,i,i+r),t.stroke(),i+=r}}p(ef,()=>rf()),p(()=>D.twins.length,()=>rf()),ne(()=>rf());let af=S([]),of=0,sf=[d(`townView.k3ng94k170`),d(`townView.k3mi2n0171`),d(`townView.k3ncnxl172`)];function cf(e,t=`warn`,n=`SYSTEM`){let r=new Date,i=[r.getHours(),r.getMinutes(),r.getSeconds()].map(e=>String(e).padStart(2,`0`)).join(`:`);af.value.unshift({id:++of,txt:e,src:n,time:i,state:0,level:t}),af.value.length>30&&af.value.pop()}let lf=m(()=>af.value.filter(e=>e.state<2).length);function uf(e){let t=af.value.find(t=>t.id===e);t&&(t.state=Math.min(2,t.state+1))}function df(){af.value=af.value.map(e=>({...e,state:2}))}let ff=S(100),pf=cn(`aw.twin.fpsCap`,`60`),mf=[{v:`60`,label:`60`},{v:`120`,label:`120`},{v:`0`,label:`∞`}];function hf(e){pf.value=e,I.value?.setFpsCap(Number(e))}let gf=cn(`aw.twin.quality`,`auto`),_f=[{v:`auto`,label:`townView.qualityAuto`},{v:`normal`,label:`townView.qualityNormal`},{v:`hd`,label:`townView.qualityHD`},{v:`ultra`,label:`townView.qualityUltra`}];function vf(e){gf.value=e,I.value?.setQualityMode(e)}function yf(e,t){let n=ff.value/100,r=(e+t)/2;return{lo:r-(r-e)*n,hi:r+(t-r)*n}}let bf=S(!1);function xf(){bf.value=!bf.value,cf(bf.value?d(`townView.kb157zk173`):d(`townView.k1s9qzr9174`),bf.value?`crit`:`info`,`SYSTEM`)}let Sf=S(1.12),Cf=S(1);function wf(e,t,n){return`${Math.min(100,Math.max(0,(e-t)/(n-t)*100)).toFixed(1)}%`}function Tf(e){Sf.value=Number(e.target.value)/100,I.value?.setExposure(Sf.value)}function Ef(e){Cf.value=Number(e.target.value)/100,I.value?.setTerritoryOpacity(Cf.value)}function Df(){I.value?.resetView(),Sf.value=1.12,Cf.value=1,I.value?.setExposure(1.12),I.value?.setTerritoryOpacity(1)}function Of(e){Af.value={...Af.value,[e]:!Af.value[e]}}let kf=S(null),Af=S({}),jf=[`#35e0a0`,`#41c8f4`,`#f6c453`,`#a78bfa`,`#ff6b6b`,`#4dd0e1`],Mf=e=>jf[Math.abs(e.split(``).reduce((e,t)=>e*31+t.charCodeAt(0),7))%jf.length]??`#35e0a0`;function Nf(e,t){let n=Af.value[e];return n==null?(t??X.value.findIndex(t=>t.id===e))<Il:!n}let Pf=S(!1),Ff=m(()=>Math.max(X.value.length-Il,0)),If=m(()=>Pf.value?X.value:X.value.slice(0,Il));function Lf(){let e=kf.value;if(!e)return;let t=Math.min(window.devicePixelRatio,2),n=e.clientWidth,r=e.clientHeight;(e.width!==n*t||e.height!==r*t)&&(e.width=n*t,e.height=r*t);let i=e.getContext(`2d`);if(i){i.setTransform(t,0,0,t,0,0),i.clearRect(0,0,n,r),i.strokeStyle=`rgba(29, 42, 66, 0.6)`,i.lineWidth=1;for(let e=1;e<4;e++){let t=r/4*e;i.beginPath(),i.moveTo(0,t),i.lineTo(n,t),i.stroke()}X.value.forEach((e,t)=>{if(!Nf(e.id,t))return;let a=vu.value.get(e.id);if(!a)return;let o=pu.get(e.id)??a.hist;if(o.length<2)return;let s=a.tpl.min,c=a.tpl.max;i.strokeStyle=Mf(e.id),i.lineWidth=1.6,i.beginPath(),o.forEach((e,t)=>{let a=t/119*n,o=r-(e-s)/(c-s)*(r-8)-4;t===0?i.moveTo(a,o):i.lineTo(a,o)}),i.stroke()})}}let Rf=null,zf=null,Bf=null,Vf=null,Hf=S(null),Uf=m(()=>Math.min(5,Math.max(.4,Vd.value.dolly))),$=null;function Wf(e){let t=e.clientWidth||220,n=e.clientHeight||148;return{s:t/(Ll*Uf.value),w:t,h:n}}function Gf(){let e=Hf.value,t=Ut.value,n=I.value;if(!e)return;let r=Math.min(window.devicePixelRatio||1,2),i=Wf(e);(e.width!==Math.round(i.w*r)||e.height!==Math.round(i.h*r))&&(e.width=Math.round(i.w*r),e.height=Math.round(i.h*r));let a=e.getContext(`2d`);if(!a)return;a.setTransform(r,0,0,r,0,0),a.fillStyle=`#060b13`,a.fillRect(0,0,i.w,i.h);let o=n?.getCameraPose(),s=o?o.target.x:Al/2,c=o?o.target.z:jl/2,l=i.w/2/i.s,u=i.h/2/i.s,d=(e,t)=>({x:i.w/2+(e-s)*i.s,y:i.h/2+(t-c)*i.s}),f=(e,t,n=60)=>e>s-l-n&&e<s+l+n&&t>c-u-n&&t<c+u+n;a.fillStyle=`rgba(65,200,244,.10)`;for(let e=Math.floor((s-l)/250)*250;e<=s+l;e+=250)for(let t=Math.floor((c-u)/250)*250;t<=c+u;t+=250){let n=d(e,t);a.fillRect(n.x-1,n.y-1,1.6,1.6)}let p=d(0,0),m=d(Al,jl);a.strokeStyle=`rgba(53,224,160,.35)`,a.lineWidth=1,a.strokeRect(p.x,p.y,m.x-p.x,m.y-p.y);for(let e of t?.blocks??[]){let t=e.x*Al,n=e.y*jl;if(!f(t,n,400))continue;let r=d(t,n),o=Math.max(4,(e.rx??.03)*Al*i.s),s=Math.max(3,(e.rz??.03)*jl*i.s);a.strokeStyle=Wt(e.color),a.globalAlpha=.6,a.lineWidth=1,a.beginPath(),a.ellipse(r.x,r.y,o,s,0,0,Math.PI*2),a.stroke(),a.globalAlpha=.08,a.fillStyle=Wt(e.color),a.fill(),a.globalAlpha=1}a.strokeStyle=`rgba(65,200,244,.28)`;let h=new Set(J.nodes.filter(e=>e.deviceBindingId).map(e=>e.id));for(let[e,n]of J.nodes.filter(e=>e.deviceBindingId).map(e=>[e.id,e.deviceBindingId])){let r=(t?.devices??[]).find(t=>t.twinId===e),i=(t?.devices??[]).find(e=>e.twinId===n);if(!r||!i)continue;let o=d(r.x*Al,r.y*jl),s=d(i.x*Al,i.y*jl);a.beginPath(),a.moveTo(o.x,o.y),a.lineTo(s.x,s.y),a.stroke()}let g=e=>e.x>=7&&e.x<=i.w-7&&e.y>=7&&e.y<=i.h-7?{...e,edge:!1}:{x:Math.min(i.w-7,Math.max(7,e.x)),y:Math.min(i.h-7,Math.max(7,e.y)),edge:!0};for(let e of t?.devices??[]){let t=g(d(e.x*Al,e.y*jl));if(e.daq)a.globalAlpha=t.edge?.4:1,a.fillStyle=`#35e0a0`,a.beginPath(),a.arc(t.x,t.y,t.edge?1.8:2.4,0,7),a.fill(),!t.edge&&e.twinId&&h.has(e.twinId)&&(a.strokeStyle=`rgba(53,224,160,.5)`,a.beginPath(),a.arc(t.x,t.y,4.4,0,7),a.stroke());else{a.globalAlpha=t.edge?.4:1,a.fillStyle=Wt(e.color);let n=t.edge?3.6:5.2;a.fillRect(t.x-n/2,t.y-n/2,n,n)}a.globalAlpha=1}for(let e of t?.agents??[]){let t=g(d(e.x*Al,e.y*jl));a.globalAlpha=t.edge?.35:1,a.fillStyle=Wt(e.color),a.beginPath(),a.arc(t.x,t.y,t.edge?1.6:2.2,0,7),a.fill(),a.globalAlpha=1}if(o){let e=Math.atan2(-Math.cos(o.yaw),-Math.sin(o.yaw)),t=Math.min(i.w,i.h)*.36;a.fillStyle=`rgba(65,200,244,.14)`,a.strokeStyle=`rgba(65,200,244,.5)`,a.lineWidth=1,a.beginPath(),a.moveTo(i.w/2,i.h/2),a.arc(i.w/2,i.h/2,t,e-.4,e+.4),a.closePath(),a.fill(),a.stroke();let n=d(o.pos.x,o.pos.z);n.x>4&&n.x<i.w-4&&n.y>4&&n.y<i.h-4&&(a.fillStyle=`rgba(255,255,255,.85)`,a.beginPath(),a.arc(n.x,n.y,2.4,0,7),a.fill())}a.fillStyle=`#fff`,a.beginPath(),a.arc(i.w/2,i.h/2,3,0,7),a.fill(),a.strokeStyle=`rgba(255,255,255,.4)`,a.beginPath(),a.arc(i.w/2,i.h/2,5.5,0,7),a.stroke()}function Kf(e){I.value?.zoomBy(e.deltaY>0?.14:-.12)}function qf(e){$={lx:e.clientX,ly:e.clientY,moved:!1};try{e.target.setPointerCapture?.(e.pointerId)}catch{}}function Jf(e){let t=Hf.value,n=I.value;if(!$||!t||!n)return;let r=Wf(t),i=e.clientX-$.lx,a=e.clientY-$.ly;Math.abs(i)+Math.abs(a)>3&&($.moved=!0);let o=i/r.s,s=a/r.s;$.lx=e.clientX,$.ly=e.clientY,n.panWorldBy(o,s)}function Yf(e){let t=Hf.value,n=I.value;if($&&!$.moved&&t&&n){let r=t.getBoundingClientRect(),i=Wf(t),a=n.getCameraPose(),o=a.target.x+(e.clientX-r.left-r.width/2)/i.s,s=a.target.z+(e.clientY-r.top-r.height/2)/i.s;n.focusTo(o,s)}$=null}function Xf(){let e=F.value;e?.getMinimapState&&(Ut.value=e.getMinimapState()),Gf();let t=I.value;if(t&&(Vd.value=t.getCameraPose(),Md.value)){let e=t.getDeviceNodes(),n=qd.value?.getBoundingClientRect(),r={};for(let i of X.value){let a=Ru(i.id),o=a?e.find(e=>e.twinId===a):e.find(e=>e.twinId===i.id);if(!o)continue;let s=t.worldToScreen(o.x,(o.topY??92)+26,o.z);s&&n&&(r[i.id]={x:s.x-n.left,y:s.y-n.top})}Ld.value=r}}function Zf(){if(document.hidden){Rf&&=(clearInterval(Rf),null),Vf&&=(clearInterval(Vf),null),zf&&=(clearInterval(zf),null);return}Rf||=P(Xf,150),Vf||=P(()=>{J.nodes.length&&(Lf(),ed())},200),zf||=P(()=>{let e=F.value;e?.getRecentActivity&&(Jl.value=e.getRecentActivity())},400)}return ne(()=>{window.addEventListener(`keydown`,Le),document.addEventListener(`visibilitychange`,Zf),J.ensureWsFeed(),J.load(),mu=we().subscribe(e=>{e.type===`daq.reading`&&_u(e.payload)}),Y.ensureWsFeed(),Y.load(),Rf=P(Xf,150),Vf=P(()=>{J.nodes.length&&(Lf(),ed())},200),zf=P(()=>{let e=F.value;e?.getRecentActivity&&(Jl.value=e.getRecentActivity())},400)}),t(()=>{window.removeEventListener(`keydown`,Le);for(let e of Ot)try{e()}catch{}Ot.length=0,document.removeEventListener(`visibilitychange`,Zf),Rf&&clearInterval(Rf),Vf&&clearInterval(Vf),zf&&clearInterval(zf),Bf&&clearInterval(Bf),Ud&&clearInterval(Ud),Rf=null,Vf=null,zf=null,Bf=null,Ud=null}),ne(()=>{Ct();let e=G();e.length>0&&F.value&&F.value.rebuild(e)}),t(()=>{mu?.();let e=F._off;e?.(),I.value?.dispose(),I.value=null,pe.value?.destroy(!0),pe.value=null,F.value=null}),(e,t)=>{let a=tt,d=Mt;return r(),g(`div`,ln,[w(`header`,un,[w(`div`,dn,[t[52]||=A(`<svg class="brand-glyph" viewBox="0 0 32 32" fill="none" aria-hidden="true" data-v-ee250387><path d="M16 2.5 27.5 9v14L16 29.5 4.5 23V9L16 2.5Z" stroke="#35e0a0" stroke-width="1.6" data-v-ee250387></path><path d="M16 8.2 22.5 12v8L16 23.8 9.5 20v-8L16 8.2Z" stroke="#41c8f4" stroke-width="1.3" opacity=".85" data-v-ee250387></path><circle cx="16" cy="16" r="2.4" fill="#35e0a0" data-v-ee250387></circle><circle cx="25.5" cy="7.5" r="1.6" fill="#41c8f4" data-v-ee250387></circle></svg>`,1),w(`div`,null,[t[51]||=w(`div`,{class:`brand-name`},[u(` DIGITAL `),w(`em`,null,`TWIN`)],-1),w(`div`,fn,` AGENTWORKSHOP · `+c(e.$t(`townView.klyi8yg127`)),1)])]),w(`nav`,{class:`nav-tabs`,"aria-label":e.$t(`townView.k1c9jyta001`)},[w(`div`,mn,[w(`button`,{class:i({on:o(z)===`browse`}),onClick:t[0]||=e=>o(z)===`edit`&&Pe()},c(e.$t(`townView.k48dwh027`)),3),w(`button`,{class:i({on:o(z)===`edit`}),onClick:t[1]||=e=>o(z)===`browse`&&Pe()},c(e.$t(`townView.k45eb0028`)),3)]),w(`button`,{class:`nav-action`,disabled:o(z)!==`edit`,title:o(z)===`edit`?`把全部设备的位置/朝向/缩放写入数据库`:`运行模式只读`,onClick:Ve},c(e.$t(`townView.k1b3bk8t029`)),9,hn),o(B)&&o(B).state!==`idle`?(r(),g(`span`,{key:0,class:i([`save-chip`,`s-${o(B).state}`])},c(o(Ne)),3)):v(``,!0)],8,pn),w(`div`,gn,[w(`span`,{class:i([`nav-chip mono`,{"nav-bell-warn":o(lf)>0}]),title:e.$t(`townView.k1fsi3ir002`)},`◉ `+c(o(lf)),11,_n),w(`span`,vn,c(o(_e))+` FPS`,1),w(`div`,{class:`avatar-chip`,title:e.$t(`townView.k1demf38003`)},[w(`div`,bn,c((o(Kd).user?.name??`OP`).slice(0,2).toUpperCase()),1),w(`span`,null,c(o(Kd).user?.name||e.$t(`townView.k1pub99m139`)),1)],8,yn)])]),w(`div`,xn,[w(`aside`,Sn,[w(`section`,Cn,[w(`div`,wn,[w(`h3`,null,c(e.$t(`townView.k1k75lzy030`)),1),w(`span`,Tn,c(o($e).length),1)]),k(a,{class:`lib-embed`})]),w(`section`,En,[w(`div`,Dn,[w(`h3`,null,c(e.$t(`townView.k2gwyas031`)),1),w(`span`,On,c(o(X).length),1)]),w(`div`,kn,[w(`button`,{class:i([`daq-ctl-btn`,{on:o(J).controller.running}]),title:o(J).controller.running?`暂停全部采集:停止所有启用节点的采样(节点级启停独立)`:`恢复全部采集:仅启用节点恢复采集(手动停用的保持停用)`,onClick:t[2]||=e=>o(J).controllerAction(o(J).controller.running?`pause`:`resume`)},c(o(J).controller.running?e.$t(`townView.k3w3j8f140`):e.$t(`townView.k3n93ed175`)),11,An),w(`label`,{class:`daq-ctl-cycle mono`,title:e.$t(`townView.khzlyf5004`)},[u(c(e.$t(`townView.k3xg3w032`))+` `,1),w(`input`,{type:`number`,min:`200`,max:`60000`,step:`100`,value:o(J).controller.defaultIntervalMs,onChange:t[3]||=e=>o(J).controllerAction(`config`,Number(e.target.value))},null,40,Mn),t[53]||=u(`ms `,-1)],8,jn)]),w(`div`,Nn,[(r(!0),g(l,null,n(o(ou),a=>(r(),g(`div`,{key:a.id,class:`daq-group`},[w(`div`,{class:i([`daq-card tpl`,{open:!!o(Xl)[`daq:${a.id}`]}]),role:`button`,tabindex:`0`,title:e.$t(`townView.k2tplxp0001`,{p0:a.name,p1:a.ch,p2:a.min,p3:a.max,p4:a.unit}),onClick:e=>Zl(`daq:${a.id}`),onKeydown:ae(j(e=>Zl(`daq:${a.id}`),[`prevent`]),[`enter`])},[t[54]||=w(`span`,{class:`daq-caret`},`▶`,-1),w(`span`,Fn,[(r(),g(`svg`,{class:`daq-svg`,viewBox:`0 0 24 24`,innerHTML:Uu(a.icon)},null,8,In))]),w(`div`,Ln,[w(`span`,Rn,c(a.name),1),w(`span`,zn,c(a.code),1)]),o(z)===`edit`?(r(),g(`button`,{key:0,class:`daq-add`,title:e.$t(`townView.k2tplxp0002`,{p0:a.name}),onClick:j(e=>eu(a),[`stop`])},` + `,8,Bn)):v(``,!0),w(`span`,Vn,`×`+c(o(Ql).get(a.id)?.length??0),1)],42,Pn),o(Xl)[`daq:${a.id}`]?(r(),g(`div`,Hn,[(r(!0),g(l,null,n(o(Ql).get(a.id)??[],t=>(r(),g(`div`,{key:t.id,class:i([`daq-node`,{placed:typeof t.posX==`number`}]),draggable:o(z)===`edit`,title:typeof t.posX==`number`?e.$t(`townView.k2tplxp0005`):e.$t(`townView.k2tplxp0006`),onDragstart:e=>nu(e,t),onClick:e=>typeof t.posX==`number`&&Lt({id:t.id,posX:t.posX,posZ:t.posZ})},[w(`span`,{class:i([`node-dot`,iu(t)])},null,2),w(`div`,Wn,[w(`span`,Gn,c(t.name),1),w(`span`,Kn,[w(`span`,qn,c(t.value==null?`--`:`${t.value.toFixed(a.decimals)} ${a.unit}`),1),w(`span`,Jn,c(t.deviceBindingId?o(D).byId(t.deviceBindingId)?.name??e.$t(`townView.k3own4q148`):e.$t(`townView.k3own4q148`)),1)])]),typeof t.posX==`number`?(r(),g(`span`,Yn,`✓`)):v(``,!0)],42,Un))),128)),o(Ql).get(a.id)?.length?v(``,!0):(r(),g(`div`,Xn,c(e.$t(`townView.k2tplxp0003`)),1))])):v(``,!0)]))),128))])]),w(`section`,Zn,[w(`div`,Qn,[w(`h3`,null,c(e.$t(`townView.km7ayhi033`)),1),w(`span`,$n,c(o(Y).nodes.length),1)]),w(`div`,er,[(r(!0),g(l,null,n(o(Yl),a=>(r(),g(`div`,{key:a.id,class:`daq-group`},[w(`div`,{class:i([`daq-card tpl`,{open:!!o(Xl)[`dcw:${a.id}`]}]),role:`button`,tabindex:`0`,title:e.$t(`townView.k2tplxp0001`,{p0:a.name,p1:a.ch,p2:a.min,p3:a.max,p4:a.unit}),onClick:e=>Zl(`dcw:${a.id}`),onKeydown:ae(j(e=>Zl(`dcw:${a.id}`),[`prevent`]),[`enter`])},[t[55]||=w(`span`,{class:`daq-caret`},`▶`,-1),w(`span`,nr,[(r(),g(`svg`,{class:`daq-svg`,viewBox:`0 0 24 24`,innerHTML:Uu(a.icon)},null,8,rr))]),w(`div`,ir,[w(`span`,ar,c(a.name),1),w(`span`,or,c(a.code),1)]),o(z)===`edit`?(r(),g(`button`,{key:0,class:`daq-add`,title:e.$t(`townView.k2tplxp0002`,{p0:a.name}),onClick:j(e=>tu(a),[`stop`])},` + `,8,sr)):v(``,!0),w(`span`,cr,`×`+c(o($l).get(a.id)?.length??0),1)],42,tr),o(Xl)[`dcw:${a.id}`]?(r(),g(`div`,lr,[(r(!0),g(l,null,n(o($l).get(a.id)??[],t=>(r(),g(`div`,{key:t.id,class:i([`daq-node`,{placed:typeof t.posX==`number`}]),draggable:o(z)===`edit`,title:typeof t.posX==`number`?e.$t(`townView.k2tplxp0005`):e.$t(`townView.k2tplxp0006`),onDragstart:e=>ru(e,t),onClick:e=>typeof t.posX==`number`&&Lt({id:t.id,posX:t.posX,posZ:t.posZ})},[w(`span`,{class:i([`node-dot`,au(t)])},null,2),w(`div`,dr,[w(`span`,fr,c(t.name),1),w(`span`,pr,[w(`span`,mr,c(t.value==null?`--`:`${t.value.toFixed(a.decimals)} ${a.unit}`),1),w(`span`,hr,c(t.deviceBindingId?o(D).byId(t.deviceBindingId)?.name??e.$t(`townView.k3own4q148`):e.$t(`townView.k3own4q148`)),1)])]),typeof t.posX==`number`?(r(),g(`span`,gr,`✓`)):v(``,!0)],42,ur))),128)),o($l).get(a.id)?.length?v(``,!0):(r(),g(`div`,_r,c(e.$t(`townView.k2tplxp0003`)),1))])):v(``,!0)]))),128))])]),w(`section`,vr,[w(`div`,yr,[w(`h3`,null,c(e.$t(`townView.k1c9n911034`)),1),w(`span`,br,c(o(_t).length),1)]),w(`div`,xr,[(r(!0),g(l,null,n(o(_t),t=>(r(),g(`div`,{key:t.channelId,class:i([`scene-row`,{active:t.placed}]),draggable:!t.placed&&o(z)===`edit`,"data-channel-id":t.channelId,title:t.placed?`已在场景中,点击定位`:`拖拽到场景放置`,onDragstart:e=>t.placed?void 0:xt(e,t.channelId),onClick:e=>Xe(t)},[w(`span`,{class:`scene-ico`,style:s({"--ch":t.color})},null,4),w(`div`,Cr,[w(`span`,wr,c(t.name),1),w(`span`,Tr,c(t.agentCount)+` `+c(e.$t(`townView.k1brss7t128`))+` `+c(t.placed?e.$t(`townView.k3n94g3141`):e.$t(`townView.k3os7i3176`)),1)]),t.placed?(r(),g(`span`,Er,`✓`)):(r(),g(`span`,Dr,`+`))],42,Sr))),128)),o(Ye)?(r(),g(`div`,Or,c(o(Ye)),1)):v(``,!0)])])]),w(`main`,kr,[w(`div`,{ref_key:`stageRef`,ref:qd,class:`stage`},[w(`div`,{id:`town-host`,ref_key:`hostRef`,ref:fe,class:`town-host`},null,512),t[71]||=w(`div`,{class:`stage-vignette`},null,-1),w(`div`,Ar,[w(`div`,jr,[w(`h2`,null,c(e.$t(`townView.k1b0z4vr035`)),1),w(`span`,Mr,`CH · `+c(o(Ae)||e.$t(`townView.k3lkuz3142`)),1)]),w(`div`,Nr,[w(`button`,{class:`vp-tool`,title:e.$t(`townView.k18d6wnb005`),onClick:Id},[...t[56]||=[w(`svg`,{class:`vp-svg`,viewBox:`0 0 24 24`},[w(`circle`,{cx:`12`,cy:`12`,r:`7`}),w(`path`,{d:`M12 2v4M12 18v4M2 12h4M18 12h4`})],-1)]],8,Pr),w(`button`,{class:i([`vp-tool`,{on:o(Pd)}]),title:e.$t(`townView.k1io51dn006`),onClick:Fd},[...t[57]||=[w(`svg`,{class:`vp-svg`,viewBox:`0 0 24 24`},[w(`circle`,{cx:`12`,cy:`12`,r:`3.2`}),w(`path`,{d:`M20.5 9a10 10 0 0 1 .3 4.5M3.5 15a10 10 0 0 1-.3-4.5`})],-1)]],10,Fr),w(`button`,{class:i([`vp-tool`,{on:o(Md)}]),title:e.$t(`townView.k1sgjlq8007`),onClick:t[4]||=e=>Md.value=!o(Md)},[...t[58]||=[w(`svg`,{class:`vp-svg`,viewBox:`0 0 24 24`},[w(`path`,{d:`M4 8h12l4 4-4 4H4z`}),w(`circle`,{cx:`8.5`,cy:`12`,r:`1.4`})],-1)]],10,Ir),w(`button`,{class:`vp-tool`,title:e.$t(`townView.k3wuf0008`),onClick:Xd},[...t[59]||=[w(`svg`,{class:`vp-svg`,viewBox:`0 0 24 24`},[w(`path`,{d:`M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5`})],-1)]],8,Lr)])]),w(`div`,Rr,[w(`select`,{value:o(Jd),"aria-label":e.$t(`townView.k1k4j5i7009`),onChange:t[5]||=e=>Yd(e)},[w(`option`,Br,c(e.$t(`townView.kv72860036`)),1),t[60]||=w(`option`,{value:`top`},` 俯视 · TOP `,-1),t[61]||=w(`option`,{value:`front`},` 前视 · FRONT `,-1),t[62]||=w(`option`,{value:`side`},` 侧视 · SIDE `,-1)],40,zr)]),o(Md)?(r(),g(l,{key:0},[(r(),g(`svg`,Vr,[(r(!0),g(l,null,n(o(Hd),e=>T((r(),g(`g`,{key:`ld-${e.id}`,class:i({near:e.near})},[w(`path`,{d:`M ${e.x} ${e.y-8} L ${e.x} ${e.y-2}`,stroke:e.warn?`rgba(246,196,83,.8)`:`rgba(65,200,244,.55)`,"stroke-width":`1.3`,fill:`none`},null,8,Hr),w(`circle`,{cx:e.x,cy:e.y,r:`2.6`,fill:e.warn?`#f6c453`:`#41c8f4`},null,8,Ur)],2)),[[re,e.leader]])),128))])),w(`div`,Wr,[(r(!0),g(l,null,n(o(Hd),n=>(r(),g(`div`,{key:n.id,class:i([`callout`,{warn:n.warn,near:n.near}]),style:s({left:n.x+`px`,top:n.y+`px`}),title:e.$t(`townView.k1ejxiwp010`),onClick:e=>Nd(n.id)},[w(`div`,Kr,[t[63]||=w(`span`,{class:`co-dot`},null,-1),u(c(n.label),1)]),w(`div`,qr,[u(c(n.value),1),w(`small`,null,c(n.unit),1)]),w(`div`,Jr,c(e.$t(`townView.k1faqmjb073`))+` `+c(n.lo.toFixed(Math.min(2,(String(n.lo).split(`.`)[1]??``).length+1)))+` – `+c(n.hi.toFixed(Math.min(2,(String(n.hi).split(`.`)[1]??``).length+1))),1)],14,Gr))),128))])],64)):v(``,!0),w(`div`,Yr,[w(`div`,Xr,[t[64]||=w(`span`,{class:`kpi-ico c1`},[w(`svg`,{class:`kpi-svg`,viewBox:`0 0 24 24`},[w(`path`,{d:`M4 8.5 12 4l8 4.5v7L12 20l-8-4.5v-7Z`}),w(`path`,{d:`M4 8.5l8 4.5 8-4.5M12 13v7`})])],-1),w(`div`,Zr,[w(`div`,Qr,c(e.$t(`townView.k1k6xemt037`)),1),w(`div`,$r,[u(c(o(Wd)),1),w(`small`,null,c(e.$t(`townView.k49lh038`)),1)])])]),w(`div`,ei,[t[65]||=w(`span`,{class:`kpi-ico c2`},[w(`svg`,{class:`kpi-svg`,viewBox:`0 0 24 24`},[w(`path`,{d:`m5 12.5 4.5 4.5L19 7.5`})])],-1),w(`div`,ti,[w(`div`,ni,c(e.$t(`townView.k1l1a9t2039`)),1),w(`div`,ri,[u(c(o(Gd)),1),w(`small`,null,c(e.$t(`townView.k49lh038`)),1)])])]),w(`div`,ii,[t[66]||=w(`span`,{class:`kpi-ico c3`},[w(`svg`,{class:`kpi-svg`,viewBox:`0 0 24 24`},[w(`path`,{d:`M12 3 22 20H2L12 3Z`}),w(`path`,{d:`M12 10v4M12 17v.2`})])],-1),w(`div`,ai,[w(`div`,oi,c(e.$t(`townView.k1fsi3ir002`)),1),w(`div`,si,[u(c(o(lf)),1),w(`small`,null,c(e.$t(`townView.k4dfq040`)),1)])])]),w(`div`,ci,[t[67]||=A(`<span class="kpi-ico c4" data-v-ee250387><svg class="kpi-svg" viewBox="0 0 24 24" data-v-ee250387><path d="M9.5 14.5 14.5 9.5" data-v-ee250387></path><path d="M11 6.5 12.8 4.7a4 4 0 0 1 5.6 5.6L16.5 12" data-v-ee250387></path><path d="m13 17.5-1.8 1.8a4 4 0 0 1-5.6-5.6L7.5 12" data-v-ee250387></path></svg></span>`,1),w(`div`,li,[w(`div`,ui,c(e.$t(`townView.k1emsai1041`)),1),w(`div`,di,[u(c(o(X).length),1),w(`small`,null,c(e.$t(`townView.k4l1w042`)),1)])])]),w(`div`,fi,[t[69]||=A(`<span class="kpi-ico c5" data-v-ee250387><svg class="kpi-svg" viewBox="0 0 24 24" data-v-ee250387><path d="M5 19a9 9 0 1 1 14 0" data-v-ee250387></path><path d="M12 13l3.5-3.5" data-v-ee250387></path><circle cx="12" cy="13" r="1.4" data-v-ee250387></circle></svg></span>`,1),w(`div`,pi,[w(`div`,mi,c(e.$t(`townView.kbrxdq1043`)),1),w(`div`,hi,[u(c(o(ef)),1),t[68]||=w(`small`,null,`%`,-1)])])])]),o(Kl)?(r(),g(`div`,gi,[w(`b`,null,c(e.$t(`townView.k3rwxjc044`)),1),w(`span`,null,c(e.$t(`townView.k1sa1eaj045`)),1)])):v(``,!0),o(V)&&o(H)?(r(),g(`div`,{key:2,class:`boundary-panel drag-panel`,style:s(o(Rt).boundary?{left:o(Rt).boundary.x+`px`,top:o(Rt).boundary.y+`px`,bottom:`auto`,transform:`none`}:void 0)},[w(`div`,{class:`bp-title drag-grip`,title:e.$t(`townView.k1d0rl5z011`),onPointerdown:t[8]||=e=>Ht(e,`boundary`)},[w(`span`,vi,c(o(y).channels[o(V)]?.name??o(V).slice(0,8)),1),w(`span`,yi,c(e.$t(`townView.k1mehlxs046`)),1),w(`div`,bi,[w(`button`,{class:i([`bp-tab`,{on:o(ft)===`boundary`}]),onClick:t[6]||=e=>ht(`boundary`)},c(e.$t(`townView.k489ka047`)),3),w(`button`,{class:i([`bp-tab`,{on:o(ft)===`members`}]),onClick:t[7]||=e=>ht(`members`)},c(e.$t(`townView.k3ztf1129`))+` `+c(o(pt).length),3)])],40,_i),o(ft)===`boundary`?(r(),g(l,{key:0},[w(`div`,xi,[w(`span`,Si,c(e.$t(`townView.k3zhy5048`)),1),w(`div`,Ci,[w(`button`,{class:i([`seg-btn`,{on:o(H).shape===`ellipse`}]),onClick:t[9]||=e=>{o(H).shape=`ellipse`,Je()}},c(e.$t(`townView.k414bc049`)),3),w(`button`,{class:i([`seg-btn`,{on:o(H).shape===`rect`}]),onClick:t[10]||=e=>{o(H).shape=`rect`,Je()}},c(e.$t(`townView.k43u0g050`)),3)])]),w(`div`,wi,[w(`span`,Ti,c(e.$t(`townView.k1fbz4s1051`)),1),T(w(`input`,{"onUpdate:modelValue":t[11]||=e=>o(H).radiusX=e,class:`bp-range`,type:`range`,min:`80`,max:`4000`,step:`8`,style:s({"--fill":wf(o(H).radiusX,80,4e3)}),onChange:Je},null,36),[[N,o(H).radiusX,void 0,{number:!0}]]),w(`span`,Ei,c(Math.round(o(H).radiusX)),1)]),w(`div`,Di,[w(`span`,Oi,c(e.$t(`townView.k1ighwgs052`)),1),T(w(`input`,{"onUpdate:modelValue":t[12]||=e=>o(H).radiusZ=e,class:`bp-range`,type:`range`,min:`60`,max:`4000`,step:`8`,style:s({"--fill":wf(o(H).radiusZ,60,4e3)}),onChange:Je},null,36),[[N,o(H).radiusZ,void 0,{number:!0}]]),w(`span`,ki,c(Math.round(o(H).radiusZ)),1)]),w(`div`,Ai,[w(`span`,ji,c(e.$t(`townView.k40qab053`)),1),T(w(`input`,{"onUpdate:modelValue":t[13]||=e=>o(H).rotationY=e,class:`bp-range`,type:`range`,min:`0`,max:`360`,step:`5`,style:s({"--fill":wf(o(H).rotationY??0,0,360)}),onChange:Je},null,36),[[N,o(H).rotationY,void 0,{number:!0}]]),w(`span`,Mi,c(Math.round(o(H).rotationY??0))+`°`,1)])],64)):(r(),g(l,{key:1},[w(`div`,Ni,c(e.$t(`townView.kimxls2054`)),1),w(`div`,Pi,[(r(!0),g(l,null,n(o(pt),e=>(r(),g(`div`,{key:e.agentId,class:`member-row`},[w(`span`,{class:`member-ava`,style:s({color:bt(o(V))})},c(e.name.charAt(0).toUpperCase()),5),w(`div`,Fi,[w(`span`,Ii,c(e.name),1),w(`span`,{class:i([`member-role`,e.role===`lead`?`r-lead`:`r-worker`])},c(e.role===`lead`?`Leader`:`Worker`),3)]),w(`select`,{class:`member-select`,value:(e.modelRef??``)||`hero-3d`,onChange:t=>mt(e.agentId,t.target.value)},[(r(!0),g(l,null,n(o(Qe),e=>(r(),g(`option`,{key:e.id,value:e.id},c(e.name),9,Ri))),128))],40,Li)]))),128)),o(pt).length===0?(r(),g(`div`,zi,c(e.$t(`townView.k419rbs055`)),1)):v(``,!0)])],64)),w(`div`,Bi,[o(ft)===`boundary`?(r(),g(`button`,{key:0,class:`bp-btn save`,onClick:Ke},c(e.$t(`townView.k1b3kp8f056`)),1)):v(``,!0),w(`button`,{class:`bp-btn danger`,onClick:qe},c(e.$t(`townView.k1hs45qg057`)),1),w(`button`,{class:`bp-btn`,onClick:t[14]||=e=>Ge(null)},c(e.$t(`townView.k3x62t058`)),1)])],4)):v(``,!0),o(Kt)?(r(),g(`div`,Vi,c(o(Kt)),1)):v(``,!0),o(R)?(r(),g(`div`,Hi,c(o(R)),1)):v(``,!0),o(he)?v(``,!0):(r(),g(`div`,Ui,[t[70]||=w(`div`,{class:`loading-spinner`},null,-1),w(`span`,Wi,c(e.$t(`townView.kvjdqfg059`)),1)]))],512),w(`div`,Gi,[w(`section`,Ki,[w(`div`,qi,[w(`h3`,null,c(e.$t(`townView.k1c9iq23060`)),1),w(`span`,Ji,c(o(z)===`edit`?e.$t(`townView.k1iipfcs143`):e.$t(`townView.k1l147w1177`)),1)]),w(`p`,Yi,c(e.$t(`townView.secRender`)),1),w(`div`,Xi,[w(`span`,{class:`ctl-name`,title:e.$t(`townView.qualityTip`)},c(e.$t(`townView.qualityLabel`)),9,Zi),w(`div`,Qi,[(r(),g(l,null,n(_f,t=>w(`button`,{key:t.v,class:i({on:o(gf)===t.v}),onClick:e=>vf(t.v)},c(e.$t(t.label)),11,$i)),64))]),t[72]||=w(`span`,{class:`ctl-val`},null,-1)]),w(`div`,ea,[w(`span`,{class:`ctl-name`,title:e.$t(`townView.fpsCapTip`)},c(e.$t(`townView.fpsCapLabel`)),9,ta),w(`div`,na,[(r(),g(l,null,n(mf,e=>w(`button`,{key:e.v,class:i({on:o(pf)===e.v}),onClick:t=>hf(e.v)},c(e.label),11,ra)),64))]),t[73]||=w(`span`,{class:`ctl-val`},null,-1)]),w(`p`,ia,c(e.$t(`townView.secEnv`)),1),w(`div`,aa,[w(`span`,oa,c(e.$t(`townView.k1gizopz061`)),1),w(`input`,{class:`ctl-range`,type:`range`,min:`30`,max:`220`,value:Math.round(o(Sf)*100),style:s({"--fill":wf(Math.round(o(Sf)*100),30,220)}),onInput:t[15]||=e=>Tf(e)},null,44,sa),w(`span`,ca,c(Math.round(o(Sf)*100))+`%`,1)]),w(`div`,la,[w(`span`,ua,c(e.$t(`townView.k1bcpqto062`)),1),w(`input`,{class:`ctl-range`,type:`range`,min:`10`,max:`100`,value:Math.round(o(Cf)*100),style:s({"--fill":wf(Math.round(o(Cf)*100),10,100)}),onInput:t[16]||=e=>Ef(e)},null,44,da),w(`span`,fa,c(Math.round(o(Cf)*100))+`%`,1)]),w(`div`,pa,[w(`span`,ma,c(e.$t(`townView.k1bztha1063`)),1),w(`input`,{class:`ctl-range`,type:`range`,min:`60`,max:`120`,value:o(ff),style:s({"--fill":wf(o(ff),60,120)}),onInput:t[17]||=e=>ff.value=Number(e.target.value)},null,44,ha),w(`span`,ga,c(o(ff))+`%`,1)]),w(`div`,_a,[w(`span`,{class:`ctl-name`,title:e.$t(`townView.kz71l1f012`)},c(e.$t(`townView.ka4i1s9064`)),9,va),w(`input`,{class:`ctl-range`,type:`range`,min:`0`,max:`3000`,step:`50`,value:o(Rd),style:s({"--fill":wf(o(Rd),0,3e3)}),onInput:t[18]||=e=>Rd.value=Number(e.target.value)},null,44,ya),w(`span`,ba,c(o(Rd)===0?e.$t(`townView.k493s144`):`${o(Rd)}`),1)]),w(`p`,xa,c(e.$t(`townView.secOps`)),1),w(`div`,Sa,[w(`span`,Ca,c(e.$t(`townView.k1idc6pa065`)),1),w(`button`,{class:i([`snap-toggle`,{on:o(Me)}]),onClick:Re},c(o(Me)?e.$t(`townView.k4bs5145`):e.$t(`townView.k493s144`)),3),t[74]||=w(`span`,{class:`ctl-val`},null,-1)]),w(`div`,wa,[w(`button`,{class:`btn btn-primary`,onClick:Df},c(e.$t(`townView.k1lap9bs024`)),1),w(`button`,{class:`btn btn-ghost`,disabled:o(z)!==`edit`,title:o(z)===`edit`?e.$t(`townView.ksavetip181`):e.$t(`townView.krotip182`),onClick:Ve},c(e.$t(`townView.k1b3bk8t029`)),9,Ta),w(`button`,{class:i([`btn btn-danger`,{armed:o(bf)}]),onClick:xf},c(e.$t(`townView.k1i046wf066`)),3)])]),w(`section`,Ea,[w(`div`,Da,[w(`h3`,null,c(e.$t(`townView.k1kfoef9067`)),1),w(`span`,Oa,c(o(X).length),1),w(`div`,{class:i([`trend-legend`,{expanded:o(Pf)}])},[(r(!0),g(l,null,n(o(If),e=>(r(),g(`button`,{key:e.id,class:i([`lg-chip`,{off:!Nf(e.id)}]),onClick:t=>Of(e.id)},[w(`span`,{class:`lg-dot`,style:s({background:Mf(e.id)})},null,4),u(c(e.name),1)],10,ka))),128)),o(Ff)>0?(r(),g(`button`,{key:0,class:`lg-chip lg-more mono`,title:o(Pf)?e.$t(`townView.trendCollapse`):e.$t(`townView.trendExpandAll`,{p0:o(X).length}),onClick:t[19]||=e=>Pf.value=!o(Pf)},c(o(Pf)?e.$t(`townView.trendCollapse`):`+${o(Ff)}`),9,Aa)):v(``,!0)],2)]),w(`div`,ja,[w(`canvas`,{ref_key:`trendCanvas`,ref:kf,class:`trend-cv`},null,512),o(X).length?v(``,!0):(r(),g(`span`,Ma,c(e.$t(`townView.k1uht2uv068`)),1))])])])]),w(`aside`,Na,[k(ie,{name:`ins`},{default:ee(()=>[o(L)?(r(),g(`section`,Pa,[w(`div`,Fa,[w(`h3`,null,c(o(L).kind===`device`?o(bd)?e.$t(`townView.k1ekqxlt146`):o(td)?e.$t(`townView.k1empnnb178`):e.$t(`townView.k1k6wg8j185`):o(Xt)),1),w(`button`,{class:`mini-btn`,title:e.$t(`townView.k1bsckft013`),onClick:We},` ✕ `,8,Ia)]),w(`div`,La,[w(`span`,Ra,c(o(L).id.slice(0,8)),1),o(L).kind===`device`&&o(td)?(r(),g(`span`,za,`DAQ`)):o(L).kind===`device`&&o(bd)?(r(),g(`span`,Ba,`DCW`)):v(``,!0)]),o(L).kind===`device`?(r(),g(l,{key:0},[o(bd)?(r(),g(`div`,Va,[w(`div`,Ha,[w(`span`,null,c(e.$t(`townView.k1deqh0d069`)),1),w(`b`,Ua,c(o(Z)?.value==null?`--`:o(Z).value.toFixed(o(Z).decimals))+` `+c(o(Z)?.unit),1)]),w(`div`,Wa,[w(`span`,null,c(o(xd)?.src===`recipe`?e.$t(`townView.kq2jssk147`):e.$t(`townView.k1iwj796179`)),1),w(`b`,{class:i({amber:o(xd)?.src===`recipe`})},c(Dd(o(Z))),3)]),w(`div`,Ga,[w(`span`,null,c(e.$t(`townView.k1i8rtqt070`)),1),w(`b`,null,c(o(Sd)||e.$t(`townView.k3own4q148`)),1)]),w(`div`,Ka,[T(w(`input`,{"onUpdate:modelValue":t[20]||=e=>o(fd)[o(L).id]=e,type:`number`,class:`bind-select`,step:10**-(o(Z)?.decimals??2),placeholder:Od(o(Z)),onKeydown:ae(Ed,[`enter`])},null,40,qa),[[N,o(fd)[o(L).id],void 0,{number:!0}]]),w(`button`,{class:`bind-add-btn`,disabled:o(fd)[o(L).id]==null||o(fd)[o(L).id]===``,onClick:Ed},c(e.$t(`townView.kwrbtn180`)),9,Ja)]),o(pd)[o(L).id]?(r(),g(`p`,Ya,c(o(pd)[o(L).id]),1)):v(``,!0),o(z)===`edit`?(r(),g(`div`,Xa,[T(w(`select`,{"onUpdate:modelValue":t[21]||=e=>b(Cd)?Cd.value=e:null,class:`bind-select`},[w(`option`,Za,c(e.$t(`townView.kjo6ekr071`)),1),(r(!0),g(l,null,n(o(D).twins.filter(e=>!uu(e)&&e.id!==(o(L)?.id??``)),e=>(r(),g(`option`,{key:e.id,value:e.id},c(e.name),9,Qa))),128))],512),[[M,o(Cd)]]),w(`button`,{class:`bind-add-btn`,disabled:!o(Sd)&&!o(Cd),onClick:t[22]||=e=>o(Sd)?Td():wd()},c(o(Sd)?e.$t(`townView.k479eh149`):e.$t(`townView.k452a8102`)),9,$a)])):v(``,!0)])):o(td)?(r(),g(`div`,eo,[w(`div`,to,[w(`span`,null,c(e.$t(`townView.k3mv305072`)),1),w(`b`,no,c(o(rd)?yu(o(rd)):`--`)+` `+c(o(rd)?.tpl.unit),1)]),w(`div`,ro,[w(`span`,null,c(e.$t(`townView.k1faqmjb073`)),1),w(`b`,null,c(o(rd)?.tpl.min)+` ~ `+c(o(rd)?.tpl.max),1)]),w(`div`,io,[w(`span`,null,c(e.$t(`townView.k1i8rtqt070`)),1),w(`b`,null,c(o(od)||e.$t(`townView.k3own4q148`)),1)]),o(z)===`edit`?(r(),g(`div`,ao,[T(w(`select`,{"onUpdate:modelValue":t[23]||=e=>b(id)?id.value=e:null,class:`bind-select`},[w(`option`,oo,c(e.$t(`townView.kjo6ekr071`)),1),(r(!0),g(l,null,n(o(D).twins.filter(e=>!uu(e)&&e.id!==(o(L)?.id??``)),e=>(r(),g(`option`,{key:e.id,value:e.id},c(e.name),9,so))),128))],512),[[M,o(id)]]),w(`button`,{class:`bind-add-btn`,disabled:!o(od)&&!o(id),onClick:t[24]||=e=>{o(od)?Vu(o(L).id):Bu(o(L).id,o(id)),id.value=``}},c(o(od)?e.$t(`townView.k479eh149`):e.$t(`townView.k452a8102`)),9,co)])):v(``,!0),o(z)===`edit`&&o(Q)?(r(),g(`div`,lo,[w(`div`,uo,[w(`span`,null,c(e.$t(`townView.k1l6g2ga074`)),1),w(`span`,fo,[T(w(`input`,{"onUpdate:modelValue":t[25]||=e=>b(kd)?kd.value=e:null,type:`number`,min:`200`,max:`60000`,step:`100`,class:`daq-num`,onChange:Ad},null,544),[[N,o(kd),void 0,{number:!0}]]),w(`small`,null,c(e.$t(`townView.k1or92b075`)),1)])]),w(`div`,po,[w(`span`,null,c(e.$t(`townView.k3x5tpx076`)),1),w(`span`,mo,[w(`input`,{value:o(Q).warnLow,type:`number`,step:`any`,class:`daq-num`,onChange:t[26]||=e=>jd(`warnLow`,e.target.value)},null,40,ho),t[75]||=u(` ~ `,-1),w(`input`,{value:o(Q).warnHigh,type:`number`,step:`any`,class:`daq-num`,onChange:t[27]||=e=>jd(`warnHigh`,e.target.value)},null,40,go)])]),w(`div`,_o,[w(`span`,null,c(e.$t(`townView.k1hjj0jf077`)),1),w(`span`,vo,[w(`input`,{value:o(Q).min,type:`number`,step:`any`,class:`daq-num`,onChange:t[28]||=e=>jd(`min`,e.target.value)},null,40,yo),t[76]||=u(` ~ `,-1),w(`input`,{value:o(Q).max,type:`number`,step:`any`,class:`daq-num`,onChange:t[29]||=e=>jd(`max`,e.target.value)},null,40,bo)])]),w(`div`,xo,[w(`span`,null,c(e.$t(`townView.k48tki078`)),1),w(`button`,{class:i([`bind-add-btn`,{warn:o(Q).enabled}]),onClick:t[30]||=e=>o(J).patchNode(o(L).id,{enabled:!o(Q).enabled})},c(o(Q).enabled?e.$t(`townView.k1wv0nyo150`):e.$t(`townView.kh1586b180`)),3)]),w(`div`,So,[w(`span`,null,c(e.$t(`townView.k3xakp079`)),1),w(`button`,{class:`bind-add-btn danger`,title:e.$t(`townView.kpwutri014`),onClick:t[31]||=e=>dt()},c(e.$t(`townView.k1bpp30k080`)),9,Co)])])):(r(),g(`div`,wo,c(e.$t(`townView.kzk5dfx081`)),1))])):(r(),g(l,{key:2},[w(`div`,To,[w(`span`,Eo,c(e.$t(`townView.k3xhia082`)),1),T(w(`input`,{"onUpdate:modelValue":t[32]||=e=>b(et)?et.value=e:null,class:`obj-input`,placeholder:e.$t(`townView.k1k6vbaf015`),disabled:o(z)!==`edit`,title:o(z)===`edit`?`设备名称`:`运行模式只读`,onChange:st,onKeydown:ae(st,[`enter`])},null,40,Do),[[N,o(et)]])]),w(`div`,Oo,[w(`span`,ko,c(e.$t(`townView.k41amp083`)),1),w(`select`,{class:`obj-select`,value:o(I)?.getDeviceModelRef?.(o(L).id)??``,disabled:o(z)!==`edit`,onChange:t[33]||=e=>lt(e.target.value)},[(r(!0),g(l,null,n(o($e),e=>(r(),g(`option`,{key:e.id,value:e.id},c(e.name),9,jo))),128))],40,Ao)]),w(`div`,Mo,c(e.$t(`townView.k1vtyk05130`))+` `+c(o(ad).length)+` `+c(e.$t(`townView.k3vfpz5138`)),1),(r(!0),g(l,null,n(o(ad),t=>(r(),g(`div`,{key:t.daqId,class:`bind-row`},[w(`span`,No,[(r(),g(`svg`,{class:`bind-svg`,viewBox:`0 0 24 24`,innerHTML:Uu(t.icon)},null,8,Po))]),w(`span`,Fo,[w(`span`,Io,c(t.ch),1),w(`span`,Lo,[w(`b`,null,c(t.value),1),u(` `+c(t.unit)+` · `+c(t.name),1)])]),w(`canvas`,{ref_for:!0,ref:e=>$u(t.daqId,e),class:`bind-spark`,width:`56`,height:`20`},null,512),o(z)===`edit`?(r(),g(`button`,{key:0,class:`bind-x`,title:e.$t(`townView.k1k73omv016`),onClick:e=>Vu(t.daqId)},` ✕ `,8,Ro)):v(``,!0)]))),128)),o(ad).length?v(``,!0):(r(),g(`div`,zo,c(e.$t(`townView.kgpuqhb084`)),1)),o(z)===`edit`?(r(),g(`div`,Bo,[w(`button`,{class:`bind-add`,onClick:t[34]||=e=>Ju(`daq`,e)},c(e.$t(`townView.kvm0lin085`)),1),o(Gu)?(r(),g(`div`,{key:0,class:`bind-pop`,style:s({maxHeight:`${o(qu)}px`})},[(r(!0),g(l,null,n(o(ou),t=>(r(),g(l,{key:t.id},[o(Yu)[t.id]?.length?(r(),g(`div`,Vo,[w(`span`,Ho,c(t.name)+` · `+c(t.ch),1),(r(!0),g(l,null,n(o(Yu)[t.id],t=>(r(),g(`button`,{key:t.id,"data-node-id":t.id,title:t.devName?e.$t(`townView.k2bindr0007`,{p0:t.devName}):e.$t(`townView.k2bindr0008`),onClick:e=>Zu(t.id)},[(r(),g(`svg`,{class:`bind-svg`,viewBox:`0 0 24 24`,innerHTML:Uu(t.tpl.icon)},null,8,Wo)),w(`span`,null,[u(c(t.name),1),t.devName?(r(),g(`i`,Go,`→ `+c(t.devName),1)):t.placed?v(``,!0):(r(),g(`i`,Ko,c(e.$t(`townView.k2bindr0009`)),1))])],8,Uo))),128))])):v(``,!0)],64))),128)),o(Xu)?v(``,!0):(r(),g(`div`,qo,c(e.$t(`townView.k2bindr0010`)),1))],4)):v(``,!0)])):v(``,!0),w(`div`,Jo,c(e.$t(`townView.ktzir2t131`))+` `+c(o(ld).length)+` `+c(e.$t(`townView.k4l1w042`)),1),(r(!0),g(l,null,n(o(ld),t=>(r(),g(`div`,{key:t.dcwId,class:`dcw-row`},[w(`div`,Yo,[w(`span`,Xo,[(r(),g(`svg`,{class:`bind-svg`,viewBox:`0 0 24 24`,innerHTML:Uu(t.icon)},null,8,Zo))]),w(`span`,Qo,[w(`span`,$o,[u(c(t.ch),1),t.rMin!=null||t.rMax!=null?(r(),g(`i`,es,c(e.$t(`townView.k48grv086`)),1)):v(``,!0)]),w(`span`,ts,c(t.name),1)]),w(`span`,ns,[w(`b`,null,c(t.value==null?`--`:t.value.toFixed(t.decimals)),1),w(`i`,null,c(t.unit),1)]),o(z)===`edit`?(r(),g(`button`,{key:0,class:`bind-x`,title:e.$t(`townView.k1k73omv016`),onClick:e=>yd(t.dcwId)},` ✕ `,8,rs)):v(``,!0)]),w(`div`,{class:i([`dcw-win`,{recipe:t.rMin!=null||t.rMax!=null}])},[w(`em`,null,c(t.rMin!=null||t.rMax!=null?e.$t(`townView.k1l3m0hx151`):e.$t(`townView.k1bc6rqf181`)),1),w(`span`,is,c(t.rMin??`-∞`),1),w(`span`,as,[w(`i`,{style:s({left:`${dd(t)}%`})},null,4)]),w(`span`,os,c(t.rMax??`+∞`),1)],2),w(`div`,ss,[T(w(`input`,{"onUpdate:modelValue":e=>o(fd)[t.dcwId]=e,type:`number`,step:10**-t.decimals,placeholder:`${t.rMin??t.gMin} ~ ${t.rMax??t.gMax}`,onKeydown:ae(e=>md(o(Y).nodeById(t.dcwId)),[`enter`])},null,40,cs),[[N,o(fd)[t.dcwId],void 0,{number:!0}]]),w(`button`,{class:`dcw-send`,disabled:o(fd)[t.dcwId]==null||o(fd)[t.dcwId]===``,title:e.$t(`townView.k15t7izc017`),onClick:e=>md(o(Y).nodeById(t.dcwId))},` write `,8,ls)]),o(pd)[t.dcwId]?(r(),g(`small`,us,c(o(pd)[t.dcwId]),1)):v(``,!0)]))),128)),o(ld).length?v(``,!0):(r(),g(`div`,ds,c(e.$t(`townView.k10smf24087`)),1)),o(z)===`edit`?(r(),g(`div`,fs,[w(`button`,{class:`bind-add`,onClick:t[35]||=e=>Ju(`dcw`,e)},c(e.$t(`townView.kvk1vh5088`)),1),o(Ku)?(r(),g(`div`,{key:0,class:`bind-pop`,style:s({maxHeight:`${o(qu)}px`})},[(r(!0),g(l,null,n(o(Yl),t=>(r(),g(l,{key:t.id},[o(gd)[t.id]?.length?(r(),g(`div`,ps,[w(`span`,ms,c(t.name)+` · `+c(t.ch),1),(r(!0),g(l,null,n(o(gd)[t.id],t=>(r(),g(`button`,{key:t.id,"data-node-id":t.id,title:t.devName?e.$t(`townView.k2bindr0007`,{p0:t.devName}):e.$t(`townView.k2bindr0008`),onClick:e=>vd(t.id)},[(r(),g(`svg`,{class:`bind-svg`,viewBox:`0 0 24 24`,innerHTML:Uu(t.tpl.icon)},null,8,gs)),w(`span`,null,[u(c(t.name),1),t.devName?(r(),g(`i`,_s,`→ `+c(t.devName),1)):t.placed?v(``,!0):(r(),g(`i`,vs,c(e.$t(`townView.k2bindr0009`)),1))])],8,hs))),128))])):v(``,!0)],64))),128)),o(_d)?v(``,!0):(r(),g(`div`,ys,c(e.$t(`townView.k2bindr0010`)),1))],4)):v(``,!0)])):v(``,!0),o(z)===`edit`?(r(),g(l,{key:4},[t[79]||=w(`div`,{class:`sect-hd`},` 变换 · BLENDER `,-1),w(`div`,bs,[w(`button`,{class:i([`seg-btn`,{on:o(Fe)===`translate`}]),onClick:t[36]||=e=>Ie(`translate`)},c(e.$t(`townView.k1hg3167089`)),3),w(`button`,{class:i([`seg-btn`,{on:o(Fe)===`rotate`}]),onClick:t[37]||=e=>Ie(`rotate`)},c(e.$t(`townView.k1enlg7i090`)),3),w(`button`,{class:i([`seg-btn`,{on:o(Fe)===`scale`}]),onClick:t[38]||=e=>Ie(`scale`)},c(e.$t(`townView.k1ibjg3j091`)),3)]),w(`div`,xs,[t[77]||=w(`span`,{class:`scale-min`},`0.2×`,-1),w(`input`,{class:`scale-range`,type:`range`,min:`0.2`,max:`5`,step:`0.05`,value:o(L).scale,onInput:t[39]||=e=>He(Number(e.target.value)),onChange:t[40]||=e=>Ue(Number(e.target.value))},null,40,Ss),t[78]||=w(`span`,{class:`scale-max`},`5×`,-1)]),w(`div`,Cs,c(Math.round(o(L).scale*100))+`% `,1),w(`div`,ws,[w(`button`,{class:i([`btn btn-danger ins-del`,{armed:o(ut)===o(L).id}]),onClick:dt},c(o(ut)===o(L).id?e.$t(`townView.k1w10xa5152`):e.$t(`townView.k121kfef182`)),3)])],64)):(r(),g(`div`,Ts,c(e.$t(`townView.kt0i3y2092`)),1))],64))],64)):o(L).kind===`agent`?(r(),g(l,{key:1},[w(`div`,Es,[w(`span`,{class:`chat-badge`,style:s({"--p-acc":o(zl)})},c(o(Jt).slice(0,1).toUpperCase()),5),w(`div`,Ds,[w(`span`,Os,c(o(Jt)),1),w(`span`,ks,[w(`span`,{class:i([`chat-role`,o(Yt)?.role===`lead`?`r-lead`:`r-worker`])},c(o(Zt)),3),w(`span`,{class:i([`chat-state`,`s-${o(Yt)?.state??`idle`}`])},c(o(Qt)),3),o(Yt)?.harness?(r(),g(`span`,As,c(o(Yt).harness.toUpperCase()),1)):v(``,!0),w(`span`,js,c(o(q).length+o(qt).length)+` `+c(e.$t(`townView.k4dfq040`)),1)])])]),w(`div`,Ms,[w(`span`,Ns,c(e.$t(`townView.k41amp083`)),1),w(`select`,{class:`obj-select`,value:(o(I)?.getAgentModel?.(o(L).id)??``)||`hero-3d`,disabled:o(z)!==`edit`,onChange:t[41]||=e=>ct(e.target.value)},[(r(!0),g(l,null,n(o(Qe),e=>(r(),g(`option`,{key:e.id,value:e.id},c(e.name),9,Fs))),128))],40,Ps)]),t[83]||=w(`div`,{class:`obj-sep`},null,-1),w(`div`,Is,[w(`span`,Ls,c(e.$t(`townView.k1fix3hb093`)),1),w(`span`,Rs,c(o(nt)),1),o(z)===`edit`?(r(),g(`button`,{key:0,class:i([`obj-mini`,{on:o(W)}]),title:e.$t(`townView.k13enoy3018`),onClick:rt},c(o(W)?e.$t(`townView.k3slzhc153`):e.$t(`townView.k1f1xmci183`)),11,zs)):v(``,!0)]),t[84]||=w(`div`,{class:`obj-sep`},null,-1),w(`div`,Bs,c(e.$t(`townView.k1p7nru2094`)),1),(r(!0),g(l,null,n(o(wu),t=>(r(),g(`div`,{key:t.id,class:`bind-row`},[w(`span`,{class:i([`ins-chip`,t.kind===`dcw`?`accent`:``]),style:{flex:`none`}},c(t.kind===`dcw`?e.$t(`townView.k40ifw097`):e.$t(`townView.k40rjw098`)),3),w(`span`,Vs,[w(`span`,Hs,c(Lu(t)),1),w(`select`,{class:`bind-select`,style:{"margin-top":`3px`},value:t.mode,title:e.$t(`townView.khqvwix019`),onChange:e=>Fu(t.id,e.target.value)},[w(`option`,Ws,c(e.$t(`townView.k1io1ylm095`)),1),w(`option`,Gs,c(e.$t(`townView.k1duyr8q096`)),1)],40,Us)]),w(`button`,{class:`bind-x`,title:e.$t(`townView.k1k73omv016`),onClick:e=>Pu(t.id)},` ✕ `,8,Ks)]))),128)),o(wu).length?v(``,!0):(r(),g(`div`,qs,` 未绑定工业节点 —— 绑定后 Agent 可用 dcw_control / daq_query 工具 `)),o(z)===`edit`?(r(),g(`div`,Js,[T(w(`select`,{"onUpdate:modelValue":t[42]||=e=>b(Tu)?Tu.value=e:null,class:`bind-select`,style:{flex:`none`,width:`62px`}},[w(`option`,Ys,c(e.$t(`townView.k40ifw097`)),1),w(`option`,Xs,c(e.$t(`townView.k40rjw098`)),1)],512),[[M,o(Tu)]]),T(w(`select`,{"onUpdate:modelValue":t[43]||=e=>b(Eu)?Eu.value=e:null,class:`bind-select`},[w(`option`,Zs,c(e.$t(`townView.kurjldk099`)),1),o(Tu)===`dcw`?(r(!0),g(l,{key:0},n(o(Y).nodes,e=>(r(),g(`option`,{key:e.id,value:e.id},c(e.name),9,Qs))),128)):(r(!0),g(l,{key:1},n(o(J).nodes,e=>(r(),g(`option`,{key:e.id,value:e.id},c(e.name),9,$s))),128))],512),[[M,o(Eu)]]),T(w(`select`,{"onUpdate:modelValue":t[44]||=e=>b(Du)?Du.value=e:null,class:`bind-select`,style:{flex:`none`,width:`76px`}},[w(`option`,ec,c(e.$t(`townView.k45kpj100`)),1),w(`option`,tc,c(e.$t(`townView.k3zul4101`)),1)],512),[[M,o(Du)]]),w(`button`,{class:`bind-add-btn`,disabled:!o(Eu),onClick:Nu},c(e.$t(`townView.k452a8102`)),9,nc)])):v(``,!0),o(Ou).length?(r(),g(l,{key:2},[w(`div`,rc,c(e.$t(`townView.k1gk2jg7132`))+` `+c(o(Ou).length),1),(r(!0),g(l,null,n(o(Ou),t=>(r(),g(`div`,{key:t.id,class:`approval-card`},[w(`div`,ic,c(t.detail),1),w(`div`,{class:i([`approval-ttl`,{urgent:Su(t)<=30}])},` ⏱ `+c(Su(t))+`s `+c(e.$t(`townView.hitlAutoReject`)),3),T(w(`input`,{"onUpdate:modelValue":e=>o(ku)[t.id]=e,class:`dcw-write input-inline`,style:{width:`100%`,"margin-top":`5px`},placeholder:e.$t(`townView.keztqrn020`)},null,8,ac),[[N,o(ku)[t.id]]]),w(`div`,oc,[w(`button`,{class:`bind-add-btn`,onClick:e=>Iu(t.id,!0)},c(e.$t(`townView.kslcozu103`)),9,sc),w(`button`,{class:`bind-add-btn danger`,onClick:e=>Iu(t.id,!1)},c(e.$t(`townView.k14gu3rd104`)),9,cc)])]))),128))],64)):v(``,!0),o(U)&&o(z)===`edit`?(r(),g(l,{key:3},[w(`div`,lc,[w(`span`,uc,c(e.$t(`townView.k3zhy5048`)),1),w(`div`,dc,[w(`button`,{class:i([`seg-btn`,{on:o(U).shape===`ellipse`}]),onClick:t[45]||=e=>{o(U).shape=`ellipse`,it()}},c(e.$t(`townView.k414bc049`)),3),w(`button`,{class:i([`seg-btn`,{on:o(U).shape===`rect`}]),onClick:t[46]||=e=>{o(U).shape=`rect`,it()}},c(e.$t(`townView.k43u0g050`)),3)])]),w(`div`,fc,[w(`span`,pc,c(e.$t(`townView.k41lwj105`)),1),T(w(`input`,{"onUpdate:modelValue":t[47]||=e=>o(U).radiusX=e,class:`obj-range`,type:`range`,min:`40`,max:`4000`,step:`8`,onInput:it,onChange:at},null,544),[[N,o(U).radiusX,void 0,{number:!0}]]),w(`span`,mc,c(Math.round(o(U).radiusX)),1)]),w(`div`,hc,[w(`span`,gc,c(e.$t(`townView.k45bta106`)),1),T(w(`input`,{"onUpdate:modelValue":t[48]||=e=>o(U).radiusZ=e,class:`obj-range`,type:`range`,min:`40`,max:`4000`,step:`8`,onInput:it,onChange:at},null,544),[[N,o(U).radiusZ,void 0,{number:!0}]]),w(`span`,_c,c(Math.round(o(U).radiusZ)),1)]),w(`button`,{class:`obj-mini danger`,onClick:ot},c(e.$t(`townView.k1w45mzc107`)),1)],64)):(r(),g(`div`,vc,c(e.$t(`townView.k14s8urm108`)),1)),t[85]||=w(`div`,{class:`obj-sep`},null,-1),w(`div`,yc,[u(c(e.$t(`townView.k1ghjbfc133`))+` `+c(o(Jt))+` `,1),w(`button`,{class:`mini-btn chat-refresh`,title:e.$t(`townView.k15avt7g021`),onClick:Rl},c(o($t)?`…`:`↻`),9,bc)]),w(`div`,{ref_key:`chatScroll`,ref:tn,class:`rpg-lines chat-embed`},[o($t)?(r(),g(`div`,xc,c(e.$t(`townView.kkhlx5h109`)),1)):v(``,!0),o(q).length?(r(),g(l,{key:1},[w(`div`,Sc,c(e.$t(`townView.k768cnt134`))+` `+c(o(q).length),1),(r(!0),g(l,null,n(o(q),e=>(r(),g(`div`,{key:e.id,class:`rpg-line hist`},[w(`span`,Cc,c(Vl(e.at)),1),w(`div`,wc,[Bl(e.kind)?(r(),g(`span`,{key:0,class:i([`rpg-kind`,`k-${e.kind}`])},c(Bl(e.kind)),3)):v(``,!0),w(`span`,Tc,c(e.text),1)])]))),128))],64)):v(``,!0),o(qt).length?(r(),g(`div`,Ec,c(e.$t(`townView.k1cwz73k135`))+` `+c(o(qt).length),1)):v(``,!0),(r(!0),g(l,null,n(o(qt),e=>(r(),g(`div`,{key:e.id,class:`rpg-line live`},[w(`span`,Dc,c(Vl(e.at)),1),w(`div`,Oc,[w(`span`,kc,c(e.text),1)])]))),128)),o(Yt)?.state===`busy`?(r(),g(`div`,Ac,[t[80]||=w(`span`,{class:`ty-dot`},null,-1),t[81]||=w(`span`,{class:`ty-dot`},null,-1),t[82]||=w(`span`,{class:`ty-dot`},null,-1),w(`span`,jc,c(e.$t(`townView.k3o5tz9110`)),1)])):v(``,!0),!o($t)&&!o(q).length&&!o(qt).length?(r(),g(`div`,Mc,c(e.$t(`townView.k1qkqld7111`)),1)):v(``,!0)],512)],64)):v(``,!0)])):v(``,!0)]),_:1}),w(`section`,Nc,[w(`div`,Pc,[w(`h3`,null,c(e.$t(`townView.k17dkhgd112`)),1)]),w(`div`,Fc,[w(`div`,Ic,[w(`canvas`,{ref_key:`donutCanvas`,ref:nf,width:`118`,height:`118`},null,512),w(`div`,Lc,[w(`b`,{style:s({color:o(tf)})},c(o(ef))+`%`,5),w(`span`,null,c(e.$t(`townView.k7h1nxo113`)),1)])]),w(`div`,Rc,[w(`div`,zc,[t[86]||=w(`span`,{class:`hl-dot`,style:{background:`var(--hud-accent)`}},null,-1),u(` `+c(e.$t(`townView.k3vp67i114`))+` `,1),w(`span`,Bc,c(o(Gd)),1)]),w(`div`,Vc,[t[87]||=w(`span`,{class:`hl-dot`,style:{background:`var(--hud-amber)`}},null,-1),u(` `+c(e.$t(`townView.k3zcvb115`))+` `,1),w(`span`,Hc,c(o(Zd)),1)]),w(`div`,Uc,[t[88]||=w(`span`,{class:`hl-dot`,style:{background:`var(--hud-danger)`}},null,-1),u(` `+c(e.$t(`townView.k3xmid116`))+` `,1),w(`span`,Wc,c(o(Qd)),1)]),w(`div`,Gc,[t[89]||=w(`span`,{class:`hl-dot`,style:{background:`#3a4a63`}},null,-1),u(` `+c(e.$t(`townView.statesOffline`))+` `,1),w(`span`,Kc,c(o($d)),1)])])])]),w(`section`,qc,[w(`div`,Jc,[w(`h3`,null,c(e.$t(`townView.k1q247fn117`)),1),w(`span`,Yc,c(o(D).twins.length),1)]),k(d,{class:`kd-embed`,"daq-live":o(zd),"dcw-live":o(Bd),onFocusDevice:Lt},null,8,[`daq-live`,`dcw-live`])]),w(`section`,Xc,[w(`div`,Zc,[w(`h3`,null,c(e.$t(`townView.k1cxf749118`)),1),w(`span`,Qc,c(o(lf))+` `+c(e.$t(`townView.k4dfq040`)),1),w(`button`,{class:`mini-btn`,title:e.$t(`townView.k1bkswpz022`),onClick:df},` ✓ `,8,$c)]),w(`div`,el,[(r(!0),g(l,null,n(o(af).slice(0,8),e=>(r(),g(`div`,{key:e.id,class:`al-row`},[w(`span`,{class:i([`al-ico`,e.state===2?`info`:e.state===1?`warn`:`crit`])},[...t[90]||=[w(`svg`,{class:`al-svg`,viewBox:`0 0 24 24`},[w(`path`,{d:`M12 3 22 20H2L12 3Z`}),w(`path`,{d:`M12 10v4M12 17v.2`})],-1)]],2),w(`div`,tl,[w(`div`,nl,c(e.txt),1),w(`div`,rl,c(e.src)+` · `+c(e.time),1)]),w(`button`,{class:i([`al-state`,`s${e.state}`]),onClick:t=>uf(e.id)},c(sf[e.state]),11,il)]))),128)),o(af).length?v(``,!0):(r(),g(`div`,al,[t[91]||=w(`svg`,{class:`re-ico`,viewBox:`0 0 24 24`},[w(`path`,{d:`M12 3l7 3v5c0 4.6-3 8.2-7 10-4-1.8-7-5.4-7-10V6l7-3Z`}),w(`path`,{d:`m9.2 12.2 2 2 3.6-4`})],-1),w(`span`,null,c(e.$t(`townView.kjz544r119`)),1)]))])]),w(`section`,ol,[w(`div`,sl,[w(`h3`,null,c(e.$t(`townView.k1cxdtq2120`)),1),w(`span`,cl,c(o(Jl).length),1)]),w(`div`,ll,[(r(!0),g(l,null,n([...o(Jl)].reverse(),(e,t)=>(r(),g(`div`,{key:`${e.at}-${t}`,class:`event-row`},[w(`span`,ul,c(Vl(e.at)),1),w(`span`,{class:`ev-name`,title:e.agentName},c(e.agentName),9,dl),w(`span`,{class:`ev-text`,title:e.text},c(e.text),9,fl)]))),128)),o(Jl).length?v(``,!0):(r(),g(`div`,pl,[t[92]||=w(`svg`,{class:`re-ico`,viewBox:`0 0 24 24`},[w(`path`,{d:`M3 12h3l2.5-6 4 12L15 12h6`})],-1),w(`span`,null,c(e.$t(`townView.k2uk6ua121`)),1)]))])]),w(`section`,ml,[w(`div`,hl,[w(`h3`,null,c(e.$t(`townView.kjug2jq122`)),1)]),w(`div`,gl,[w(`div`,{class:`mm-wrap`,title:e.$t(`townView.klfwiqg023`)},[w(`canvas`,{ref_key:`navCanvas`,ref:Hf,class:`nav-cv`,onPointerdown:qf,onPointermove:Jf,onPointerup:Yf,onPointercancel:Yf,onWheel:j(Kf,[`prevent`])},null,544)],8,_l),w(`div`,vl,[w(`button`,{class:`vp-tool`,title:e.$t(`townView.k1lap9bs024`),onClick:Df},[...t[93]||=[w(`svg`,{class:`vp-svg`,viewBox:`0 0 24 24`},[w(`path`,{d:`M3 12a9 9 0 1 0 3-6.7M3 4v5h5`})],-1)]],8,yl),w(`button`,{class:`vp-tool`,title:e.$t(`townView.kav8a8k025`),onClick:t[49]||=e=>o(I)?.zoomBy(.22)},[...t[94]||=[w(`svg`,{class:`vp-svg`,viewBox:`0 0 24 24`},[w(`circle`,{cx:`11`,cy:`11`,r:`6.5`}),w(`path`,{d:`m16 16 4.5 4.5M8.5 11h5`})],-1)]],8,bl),w(`button`,{class:`vp-tool`,title:e.$t(`townView.k1u7uce9026`),onClick:t[50]||=e=>o(I)?.zoomBy(-.18)},[...t[95]||=[w(`svg`,{class:`vp-svg`,viewBox:`0 0 24 24`},[w(`circle`,{cx:`11`,cy:`11`,r:`6.5`}),w(`path`,{d:`m16 16 4.5 4.5M8.5 11h5M11 8.5v5`})],-1)]],8,xl)])]),w(`div`,Sl,c(e.$t(`townView.k1gaaodq136`))+c(o(Uf).toFixed(1))+` · `+c(o(Ut)?.devices?.length??0)+` `+c(e.$t(`townView.k47e16126`)),1)])])]),w(`footer`,Cl,[w(`span`,null,[w(`span`,{class:i([`sb-dot`,{red:o(C).state!==`open`}])},null,2),u(c(e.$t(`townView.k1i4g246123`))+` `,1),w(`b`,null,c(o(C).state===`open`?e.$t(`townView.k41k5c154`):o(ke)?e.$t(`townView.k3lmtk3184`):e.$t(`townView.k44c2n186`)),1)]),w(`span`,wl,[u(c(e.$t(`townView.k4a0jt124`))+` `,1),w(`b`,null,c(o(ye)),1),t[96]||=w(`i`,null,`·`,-1),u(c(e.$t(`townView.k3xdvm125`))+` `,1),w(`b`,null,c(o(ve)),1),t[97]||=w(`i`,null,`·`,-1),u(c(e.$t(`townView.k47e16126`))+` `,1),w(`b`,null,c(o(Wd)),1)]),w(`span`,Tl,c(o(_e))+` FPS `,1),w(`span`,El,` © 2026 ABO · DIGITAL TWIN · `+c(e.$t(`townView.k1h5gxpf137`)),1)]),o(he)?v(``,!0):(r(),g(`div`,Dl,[t[98]||=w(`div`,{class:`loading-spinner`},null,-1),w(`span`,Ol,c(e.$t(`townView.kvjdqfg059`)),1)]))])}}}),[[`__scopeId`,`data-v-ee250387`]]),{__name:`WorkshopTownView`});export{cn as n,Rl as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,G as t,H as n,Ht as ee,St as r,Wt as i,a,b as o,et as s,g as c,h as l,lt as u,mt as d,nt as f,p,t as m,x as h}from"./BSCpFtzG.js";import{B as te,z as g}from"./2LwEn9gX.js";import{d as _}from"./PQLnLxYe.js";import{n as v}from"./uBbDCfTz.js";import{n as y}from"./BeIfu4N3.js";import{t as b}from"./Bt_HDizI.js";import{r as x}from"./BsMpJf7S.js";import{n as ne,t as re}from"./Do88WZG2.js";import{n as ie,t as ae}from"./B4Fia4FB.js";import{t as oe}from"./BYL0Rjqj.js";import{t as se}from"./DM8DS9MA.js";import{t as ce}from"./Du-eSpo2.js";import{t as le}from"./C9f8QMp12.js";import{t as S}from"./NIM0Wglj2.js";import{t as C}from"./C_gFA2H_2.js";import{n as w,t as T}from"./ZugRk0CM2.js";import{t as ue}from"./CNs_Ozdc2.js";var de={class:`page`},fe={key:0,class:`auth-gate aw-orbs`},pe={class:`hint`},me={class:`hint`},he={class:`aw-page-head`},ge={class:`sub`},_e={class:`head-acts`},E={class:`lib-links`},D={class:`grid`},O={class:`card-head`},k={class:`name`},A={class:`card-body`},j=[`onClick`],M={class:`ch-name`},N={class:`ch-meta`},P={key:0,class:`empty`},F={class:`card-foot`},I=[`onClick`],ve=[`onClick`],L=m(e({__name:`index`,setup(e){let{t:m}=y();ue({layout:`default`});let L=S(),R=C(),z=w(),{subscribe:ye}=T(),B=d(`login`),V=d(``),H=d(``),U=d(``),W=d(``),G=d(!1),K=async()=>{if(!V.value.trim()){x.warning(m(`wsHome.k1vnhyks019`));return}if(!H.value.trim()){x.warning(m(`wsHome.k8ieqzj020`));return}if(U.value.length<6){x.warning(m(`wsHome.ksx73ra021`));return}G.value=!0;try{let e=await L.register(V.value,H.value,U.value);x.success(m(`wsHome.k1mbatbh030`,{p0:e.name})),V.value=``,H.value=``,U.value=``}catch(e){x.error(e instanceof Error?e.message:String(e))}finally{G.value=!1}},q=async()=>{if(!H.value.trim()){x.warning(m(`wsHome.k8ieqzj020`));return}G.value=!0;try{let e=await L.login(H.value,U.value);x.success(m(`wsHome.kwixbdl031`,{p0:e.name})),U.value=``}catch(e){x.error(e instanceof Error?e.message:String(e))}finally{G.value=!1}},J=async()=>{G.value=!0;try{let e=await L.loginWithToken(W.value);x.success(m(`wsHome.kwixbdl031`,{p0:e.name})),W.value=``}catch(e){x.error(e instanceof Error?e.message:String(e))}finally{G.value=!1}},be=()=>{L.logout(),x.success(m(`wsHome.k3ngm6p022`))},Y=d(!1);s(()=>L.isLoggedIn,async e=>{if(!e){Y.value=!1;return}if(await L.refresh(),L.isLoggedIn)try{await R.load(),Y.value=!0}catch(e){x.error(e instanceof Error?e.message:m(`wsHome.k1br33vc023`))}},{immediate:!0}),s(()=>Y.value&&R.workspaces.map(e=>e.channelIds.join(`,`)).join(`|`),()=>{if(Y.value)for(let e of R.workspaces)for(let t of e.channelIds)ye(t)},{immediate:!0});let X=d(!1),Z=d(``),Q=d(!1),$=async()=>{let e=Z.value.trim();if(!e){x.warning(`Workspace 名称必填`);return}Q.value=!0;try{let t=await R.create(e);X.value=!1,Z.value=``,R.setActiveWorkspaceId(t.id),_(`/workshop/w/${t.id}`)}catch(e){x.error(e instanceof Error?e.message:String(e))}finally{Q.value=!1}},xe=async e=>{await R.remove(e),x.success(m(`wsHome.k3n5sd7024`))},Se=e=>e.map(e=>{let t=z.channels[e],n=z.agents[e]??[];return{id:e,name:t?.name??e.slice(0,8),synced:t!==void 0,agents:n.length,busy:n.filter(e=>e.state===`busy`).length,activeTasks:(z.tasks[e]??[]).filter(e=>![`COMPLETED`,`CANCELED`,`FAILED`].includes(e.state)).length}});return v({title:()=>m(`titles.workshop`)}),(e,s)=>{let d=re,m=ne,v=b,y=ce,x=ie,S=ae,C=se,w=le,T=oe;return n(),c(`div`,de,[r(L).isLoggedIn?(n(),c(a,{key:1},[p(`div`,he,[p(`div`,null,[s[17]||=p(`p`,{class:`aw-kicker`},` workshop / overview `,-1),p(`h1`,null,`Workshop `+i(e.$t(`wsHome.k3n4m5c025`)),1),p(`p`,ge,i(r(L).user?.name)+` `+i(e.$t(`wsHome.ke16e53026`)),1)]),p(`div`,_e,[p(`div`,E,[p(`button`,{type:`button`,class:`lib-link`,onClick:s[7]||=t=>(`navigateTo`in e?e.navigateTo:r(_))(`/workshop/agents`)},i(e.$t(`wsHome.k3pa5h4013`)),1),p(`button`,{type:`button`,class:`lib-link`,onClick:s[8]||=t=>(`navigateTo`in e?e.navigateTo:r(_))(`/workshop/teams`)},i(e.$t(`wsHome.k3svl8y014`)),1),p(`button`,{type:`button`,class:`lib-link`,onClick:s[9]||=t=>(`navigateTo`in e?e.navigateTo:r(_))(`/workshop/channel-templates`)},` Channel `+i(e.$t(`wsHome.k41ds5027`)),1),p(`button`,{type:`button`,class:`lib-link`,onClick:s[10]||=t=>(`navigateTo`in e?e.navigateTo:r(_))(`/tokens`)},` API Token `),p(`button`,{type:`button`,class:`lib-link`,onClick:be},i(e.$t(`wsHome.k484e7015`)),1)]),p(`button`,{class:`aw-pill im`,onClick:s[11]||=e=>X.value=!0},[s[18]||=p(`span`,{class:`i-tabler-plus im-pop`},null,-1),o(` `+i(e.$t(`wsHome.newWs`)),1)])])]),h(w,{spinning:!r(Y)},{default:f(()=>[p(`div`,D,[(n(!0),c(a,null,t(r(R).workspaces,u=>(n(),c(`div`,{key:u.id,class:`card`},[p(`div`,O,[s[19]||=p(`span`,{class:`card-mark`},[p(`span`,{class:`i-tabler-box`})],-1),p(`span`,k,i(u.name),1)]),p(`div`,A,[(n(!0),c(a,null,t(Se(u.channelIds),t=>(n(),c(`div`,{key:t.id,class:`ch-row`,onClick:t=>(`navigateTo`in e?e.navigateTo:r(_))(`/workshop/w/${u.id}`)},[p(`span`,{class:ee([`dot`,{live:t.activeTasks>0}])},null,2),p(`span`,M,i(t.name),1),p(`span`,N,[t.synced?(n(),c(a,{key:0},[o(i(t.agents)+` `+i(e.$t(`wsHome.k1ggoa45028`))+` `+i(t.busy)+` / `+i(e.$t(`wsHome.k3wcox029`))+` `+i(t.activeTasks),1)],64)):(n(),c(a,{key:1},[o(i(e.$t(`wsHome.k1bst7s9016`)),1)],64))])],8,j))),128)),u.channelIds.length===0?(n(),c(`div`,P,i(e.$t(`wsHome.k1ylgrbc017`)),1)):l(``,!0)]),p(`div`,F,[p(`button`,{class:`aw-pill outline im`,onClick:t=>(`navigateTo`in e?e.navigateTo:r(_))(`/workshop/w/${u.id}`)},[s[20]||=p(`span`,{class:`i-tabler-arrow-right im-pop`},null,-1),o(` `+i(e.$t(`wsHome.kr1uwwi018`)),1)],8,I),p(`button`,{class:`aw-ghost im`,title:`删除 Workspace`,onClick:te(e=>xe(u.id),[`stop`])},[...s[21]||=[p(`span`,{class:`i-tabler-trash im-shake`},null,-1)]],8,ve)])]))),128)),r(R).workspaces.length===0&&r(Y)?(n(),c(`div`,{key:0,class:`card placeholder`,onClick:s[12]||=e=>X.value=!0},[...s[22]||=[p(`span`,{class:`i-tabler-plus big`},null,-1),p(`span`,null,`新建第一个 Workspace`,-1)]])):l(``,!0)])]),_:1},8,[`spinning`]),h(T,{open:r(X),"onUpdate:open":s[14]||=e=>u(X)?X.value=e:null,title:e.$t(`wsHome.newWs`),"confirm-loading":r(Q),"ok-text":`创建并进入`,"cancel-text":`取消`,onOk:$},{default:f(()=>[h(d,{value:r(Z),"onUpdate:value":s[13]||=e=>u(Z)?Z.value=e:null,placeholder:e.$t(`wsHome.ksmpk8l007`),onKeydown:g($,[`enter`])},null,8,[`value`,`placeholder`])]),_:1},8,[`open`,`title`,`confirm-loading`])],64)):(n(),c(`div`,fe,[h(C,{class:`auth-card`},{default:f(()=>[s[15]||=p(`p`,{class:`aw-kicker`},` agentworkshop / sign in `,-1),p(`h2`,null,i(e.$t(`wsHome.kr0vzqu008`)),1),s[16]||=p(`p`,{class:`sub`},` 全局用户系统统管身份;每个用户可管理多个 API Token, 管理 API 需用户 token(Authorization: Bearer)。 `,-1),h(S,{"active-key":r(B),"onUpdate:activeKey":s[6]||=e=>u(B)?B.value=e:null},{default:f(()=>[h(x,{key:`login`,tab:`账号登录`},{default:f(()=>[h(y,{direction:`vertical`,style:{width:`100%`}},{default:f(()=>[h(d,{value:r(H),"onUpdate:value":s[0]||=e=>u(H)?H.value=e:null,type:`email`,placeholder:e.$t(`wsHome.k48h2c001`),onKeydown:g(q,[`enter`])},null,8,[`value`,`placeholder`]),h(m,{value:r(U),"onUpdate:value":s[1]||=e=>u(U)?U.value=e:null,placeholder:e.$t(`wsHome.k3yvgs002`),onKeydown:g(q,[`enter`])},null,8,[`value`,`placeholder`]),h(v,{type:`primary`,block:``,loading:r(G),onClick:q},{default:f(()=>[o(i(e.$t(`wsHome.k43kol009`)),1)]),_:1},8,[`loading`]),p(`p`,pe,i(e.$t(`wsHome.k17x74cj010`)),1)]),_:1})]),_:1}),h(x,{key:`register`,tab:`注册新用户`},{default:f(()=>[h(y,{direction:`vertical`,style:{width:`100%`}},{default:f(()=>[h(d,{value:r(V),"onUpdate:value":s[2]||=e=>u(V)?V.value=e:null,placeholder:e.$t(`wsHome.kwgbai9003`)},null,8,[`value`,`placeholder`]),h(d,{value:r(H),"onUpdate:value":s[3]||=e=>u(H)?H.value=e:null,type:`email`,placeholder:e.$t(`wsHome.kizjkbo004`)},null,8,[`value`,`placeholder`]),h(m,{value:r(U),"onUpdate:value":s[4]||=e=>u(U)?U.value=e:null,placeholder:e.$t(`wsHome.kh3cqfn005`),onKeydown:g(K,[`enter`])},null,8,[`value`,`placeholder`]),h(v,{type:`primary`,block:``,loading:r(G),onClick:K},{default:f(()=>[o(i(e.$t(`wsHome.k1so6a0v011`)),1)]),_:1},8,[`loading`]),p(`p`,me,i(e.$t(`wsHome.k1r0a4u3012`)),1)]),_:1})]),_:1}),h(x,{key:`token`,tab:`Token 登录`},{default:f(()=>[h(y,{direction:`vertical`,style:{width:`100%`}},{default:f(()=>[h(m,{value:r(W),"onUpdate:value":s[5]||=e=>u(W)?W.value=e:null,placeholder:e.$t(`wsHome.k15qunld006`),onKeydown:g(J,[`enter`])},null,8,[`value`,`placeholder`]),h(v,{type:`primary`,block:``,loading:r(G),onClick:J},{default:f(()=>[o(i(e.$t(`wsHome.k43kol009`)),1)]),_:1},8,[`loading`])]),_:1})]),_:1})]),_:1},8,[`active-key`])]),_:1})]))])}}}),[[`__scopeId`,`data-v-dfba3160`]]);export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,M as t,P as n,et as r,f as i,mt as a,x as o,z as s}from"./BSCpFtzG.js";import{At as c,B as l,D as u,d,h as f,it as p,j as m,kt as h,m as g,n as _,nt as v,pt as y,t as b,u as x}from"./BDUjyaF4.js";import{K as S,g as C,i as w,p as T}from"./
|
|
1
|
+
import{C as e,M as t,P as n,et as r,f as i,mt as a,x as o,z as s}from"./BSCpFtzG.js";import{At as c,B as l,D as u,d,h as f,it as p,j as m,kt as h,m as g,n as _,nt as v,pt as y,t as b,u as x}from"./BDUjyaF4.js";import{K as S,g as C,i as w,p as T}from"./Bt_HDizI.js";import{m as E}from"./BsMpJf7S.js";var D=e=>{let{componentCls:t}=e,n=`${t}-inner`;return{[t]:{[`&${t}-small`]:{minWidth:e.switchMinWidthSM,height:e.switchHeightSM,lineHeight:`${e.switchHeightSM}px`,[`${t}-inner`]:{paddingInlineStart:e.switchInnerMarginMaxSM,paddingInlineEnd:e.switchInnerMarginMinSM,[`${n}-checked`]:{marginInlineStart:`calc(-100% + ${e.switchPinSizeSM+e.switchPadding*2}px - ${e.switchInnerMarginMaxSM*2}px)`,marginInlineEnd:`calc(100% - ${e.switchPinSizeSM+e.switchPadding*2}px + ${e.switchInnerMarginMaxSM*2}px)`},[`${n}-unchecked`]:{marginTop:-e.switchHeightSM,marginInlineStart:0,marginInlineEnd:0}},[`${t}-handle`]:{width:e.switchPinSizeSM,height:e.switchPinSizeSM},[`${t}-loading-icon`]:{top:(e.switchPinSizeSM-e.switchLoadingIconSize)/2,fontSize:e.switchLoadingIconSize},[`&${t}-checked`]:{[`${t}-inner`]:{paddingInlineStart:e.switchInnerMarginMinSM,paddingInlineEnd:e.switchInnerMarginMaxSM,[`${n}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${n}-unchecked`]:{marginInlineStart:`calc(100% - ${e.switchPinSizeSM+e.switchPadding*2}px + ${e.switchInnerMarginMaxSM*2}px)`,marginInlineEnd:`calc(-100% + ${e.switchPinSizeSM+e.switchPadding*2}px - ${e.switchInnerMarginMaxSM*2}px)`}},[`${t}-handle`]:{insetInlineStart:`calc(100% - ${e.switchPinSizeSM+e.switchPadding}px)`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${n}`]:{[`${n}-unchecked`]:{marginInlineStart:e.marginXXS/2,marginInlineEnd:-e.marginXXS/2}},[`&${t}-checked ${n}`]:{[`${n}-checked`]:{marginInlineStart:-e.marginXXS/2,marginInlineEnd:e.marginXXS/2}}}}}}},O=e=>{let{componentCls:t}=e;return{[t]:{[`${t}-loading-icon${e.iconCls}`]:{position:`relative`,top:(e.switchPinSize-e.fontSize)/2,color:e.switchLoadingIconColor,verticalAlign:`top`},[`&${t}-checked ${t}-loading-icon`]:{color:e.switchColor}}}},k=e=>{let{componentCls:t}=e,n=`${t}-handle`;return{[t]:{[n]:{position:`absolute`,top:e.switchPadding,insetInlineStart:e.switchPadding,width:e.switchPinSize,height:e.switchPinSize,transition:`all ${e.switchDuration} ease-in-out`,"&::before":{position:`absolute`,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:e.colorWhite,borderRadius:e.switchPinSize/2,boxShadow:e.switchHandleShadow,transition:`all ${e.switchDuration} ease-in-out`,content:`""`}},[`&${t}-checked ${n}`]:{insetInlineStart:`calc(100% - ${e.switchPinSize+e.switchPadding}px)`},[`&:not(${t}-disabled):active`]:{[`${n}::before`]:{insetInlineEnd:e.switchHandleActiveInset,insetInlineStart:0},[`&${t}-checked ${n}::before`]:{insetInlineEnd:0,insetInlineStart:e.switchHandleActiveInset}}}}},A=e=>{let{componentCls:t}=e,n=`${t}-inner`;return{[t]:{[n]:{display:`block`,overflow:`hidden`,borderRadius:100,height:`100%`,paddingInlineStart:e.switchInnerMarginMax,paddingInlineEnd:e.switchInnerMarginMin,transition:`padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,[`${n}-checked, ${n}-unchecked`]:{display:`block`,color:e.colorTextLightSolid,fontSize:e.fontSizeSM,transition:`margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,pointerEvents:`none`},[`${n}-checked`]:{marginInlineStart:`calc(-100% + ${e.switchPinSize+e.switchPadding*2}px - ${e.switchInnerMarginMax*2}px)`,marginInlineEnd:`calc(100% - ${e.switchPinSize+e.switchPadding*2}px + ${e.switchInnerMarginMax*2}px)`},[`${n}-unchecked`]:{marginTop:-e.switchHeight,marginInlineStart:0,marginInlineEnd:0}},[`&${t}-checked ${n}`]:{paddingInlineStart:e.switchInnerMarginMin,paddingInlineEnd:e.switchInnerMarginMax,[`${n}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${n}-unchecked`]:{marginInlineStart:`calc(100% - ${e.switchPinSize+e.switchPadding*2}px + ${e.switchInnerMarginMax*2}px)`,marginInlineEnd:`calc(-100% + ${e.switchPinSize+e.switchPadding*2}px - ${e.switchInnerMarginMax*2}px)`}},[`&:not(${t}-disabled):active`]:{[`&:not(${t}-checked) ${n}`]:{[`${n}-unchecked`]:{marginInlineStart:e.switchPadding*2,marginInlineEnd:-e.switchPadding*2}},[`&${t}-checked ${n}`]:{[`${n}-checked`]:{marginInlineStart:-e.switchPadding*2,marginInlineEnd:e.switchPadding*2}}}}}},j=e=>{let{componentCls:t}=e;return{[t]:h(h(h(h({},f(e)),{position:`relative`,display:`inline-block`,boxSizing:`border-box`,minWidth:e.switchMinWidth,height:e.switchHeight,lineHeight:`${e.switchHeight}px`,verticalAlign:`middle`,background:e.colorTextQuaternary,border:`0`,borderRadius:100,cursor:`pointer`,transition:`all ${e.motionDurationMid}`,userSelect:`none`,[`&:hover:not(${t}-disabled)`]:{background:e.colorTextTertiary}}),g(e)),{[`&${t}-checked`]:{background:e.switchColor,[`&:hover:not(${t}-disabled)`]:{background:e.colorPrimaryHover}},[`&${t}-loading, &${t}-disabled`]:{cursor:`not-allowed`,opacity:e.switchDisabledOpacity,"*":{boxShadow:`none`,cursor:`not-allowed`}},[`&${t}-rtl`]:{direction:`rtl`}})}},M=d(`Switch`,e=>{let t=e.fontSize*e.lineHeight,n=e.controlHeight/2,r=t-4,i=n-4,a=x(e,{switchMinWidth:r*2+8,switchHeight:t,switchDuration:e.motionDurationMid,switchColor:e.colorPrimary,switchDisabledOpacity:e.opacityLoading,switchInnerMarginMin:r/2,switchInnerMarginMax:r+2+4,switchPadding:2,switchPinSize:r,switchBg:e.colorBgContainer,switchMinWidthSM:i*2+4,switchHeightSM:n,switchInnerMarginMinSM:i/2,switchInnerMarginMaxSM:i+2+4,switchPinSizeSM:i,switchHandleShadow:`0 2px 4px 0 ${new u(`#00230b`).setAlpha(.2).toRgbString()}`,switchLoadingIconSize:e.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${e.opacityLoading})`,switchHandleActiveInset:`-30%`});return[j(a),A(a),k(a),O(a),D(a)]}),N=v(`small`,`default`),P=e({compatConfig:{MODE:3},name:`ASwitch`,__ANT_SWITCH:!0,inheritAttrs:!1,props:{id:String,prefixCls:String,size:b.oneOf(N),disabled:{type:Boolean,default:void 0},checkedChildren:b.any,unCheckedChildren:b.any,tabindex:b.oneOfType([b.string,b.number]),autofocus:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},checked:b.oneOfType([b.string,b.number,b.looseBool]),checkedValue:b.oneOfType([b.string,b.number,b.looseBool]).def(!0),unCheckedValue:b.oneOfType([b.string,b.number,b.looseBool]).def(!1),onChange:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onMouseup:{type:Function},"onUpdate:checked":{type:Function},onBlur:Function,onFocus:Function},slots:Object,setup(e,u){let{attrs:d,slots:f,expose:p,emit:h}=u,g=T(),v=l(),b=i(()=>e.disabled??v.value);n(()=>{m(!(`defaultChecked`in d),`Switch`,`'defaultChecked' is deprecated, please use 'v-model:checked'`),m(!(`value`in d),`Switch`,"`value` is not validate prop, do you mean `checked`?")});let x=a(e.checked===void 0?d.defaultChecked:e.checked),D=i(()=>x.value===e.checkedValue);r(()=>e.checked,()=>{x.value=e.checked});let{prefixCls:O,direction:k,size:A}=_(`switch`,e),[j,N]=M(O),P=a(),F=()=>{var e;(e=P.value)==null||e.focus()};p({focus:F,blur:()=>{var e;(e=P.value)==null||e.blur()}}),s(()=>{t(()=>{e.autofocus&&!b.value&&P.value.focus()})});let I=(e,t)=>{b.value||(h(`update:checked`,e),h(`change`,e,t),g.onFieldChange())},L=e=>{h(`blur`,e)},R=t=>{F();let n=D.value?e.unCheckedValue:e.checkedValue;I(n,t),h(`click`,n,t)},z=t=>{t.keyCode===C.LEFT?I(e.unCheckedValue,t):t.keyCode===C.RIGHT&&I(e.checkedValue,t),h(`keydown`,t)},B=e=>{var t;(t=P.value)==null||t.blur(),h(`mouseup`,e)},V=i(()=>({[`${O.value}-small`]:A.value===`small`,[`${O.value}-loading`]:e.loading,[`${O.value}-checked`]:D.value,[`${O.value}-disabled`]:b.value,[O.value]:!0,[`${O.value}-rtl`]:k.value===`rtl`,[N.value]:!0}));return()=>j(o(w,null,{default:()=>[o(`button`,c(c(c({},S(e,[`prefixCls`,`checkedChildren`,`unCheckedChildren`,`checked`,`autofocus`,`checkedValue`,`unCheckedValue`,`id`,`onChange`,`onUpdate:checked`])),d),{},{id:e.id??g.id.value,onKeydown:z,onClick:R,onBlur:L,onMouseup:B,type:`button`,role:`switch`,"aria-checked":x.value,disabled:b.value||e.loading,class:[d.class,V.value],ref:P}),[o(`div`,{class:`${O.value}-handle`},[e.loading?o(E,{class:`${O.value}-loading-icon`},null):null]),o(`span`,{class:`${O.value}-inner`},[o(`span`,{class:`${O.value}-inner-checked`},[y(f,e,`checkedChildren`)]),o(`span`,{class:`${O.value}-inner-unchecked`},[y(f,e,`unCheckedChildren`)])])])]}))}}),F=p(P);export{F as t};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{A as e,C as t,F as n,G as r,H as i,M as a,Q as ee,St as o,Wt as s,a as c,b as l,et as u,f as d,g as f,h as te,lt as ne,m as re,mt as p,nt as m,p as h,t as g,x as _}from"./BSCpFtzG.js";import{t as ie}from"./HclGiUj8.js";import{n as ae}from"./BeIfu4N3.js";import{t as oe}from"./
|
|
2
|
-
`))}function z(e){b&&(R(),
|
|
1
|
+
import{A as e,C as t,F as n,G as r,H as i,M as a,Q as ee,St as o,Wt as s,a as c,b as l,et as u,f as d,g as f,h as te,lt as ne,m as re,mt as p,nt as m,p as h,t as g,x as _}from"./BSCpFtzG.js";import{t as ie}from"./HclGiUj8.js";import{n as ae}from"./BeIfu4N3.js";import{t as oe}from"./Bt_HDizI.js";import{r as se}from"./BsMpJf7S.js";import{r as ce}from"./Do88WZG2.js";import{t as le}from"./BSXx2vqR.js";import{t as ue}from"./BkfchkK62.js";import{t as de}from"./NIM0Wglj2.js";import{n as fe}from"./DeYsUzhr.js";var pe={class:`term-title`},me={class:`term-name`},he={class:`ts-chip aw-mono ts-pid`},ge={key:0,class:`ts-chip ts-sub`},_e={class:`term-toolbar`},ve=[`data-state`],ye=[`data-live`],be={class:`term-body`},xe={key:0,class:`hitl-card`},Se={class:`hitl-head`},Ce={class:`hitl-question`},we={key:0,class:`hitl-options`},Te={class:`hitl-message`},Ee={class:`hitl-row`},De={class:`hitl-row`},Oe={class:`term-hint aw-kicker`},v=Object.assign(g(t({__name:`OmpTerminalPanel`,props:e({pid:{},agentId:{},channelId:{},subtitle:{}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:[`update:open`],setup(e){let t=e,g=ee(e,`open`),{t:v}=ae(),ke=de(),y=p(null),b=null,x=null,S=null,C=p(`idle`),w=p(!0),T=p(!1),E=p(!1),D=p(null),O=null,k=null,A=0,j=!1,M=0,N=``,P=[],F=-1,I={reset:`\x1B[0m`,dim:`\x1B[2m`,bold:`\x1B[1m`,red:`\x1B[31m`,green:`\x1B[32m`,yellow:`\x1B[33m`,blue:`\x1B[34m`,magenta:`\x1B[35m`,cyan:`\x1B[36m`,dimItalicMagenta:`\x1B[2;3;35m`},L=!1;function R(){if(W.length===0)return;let e=W.join(``);W.length=0,b?.write(e),/\r?\n$/.test(e)||(L=!0)}function Ae(){L&&(L=!1,b?.write(`\r
|
|
2
|
+
`))}function z(e){b&&(R(),Ae(),b.write(`\r\x1B[K`),b.write(e.endsWith(`\r
|
|
3
3
|
`)||e.endsWith(`
|
|
4
|
-
`)?e:`${e}\r\n`),B())}function B(){b&&(L||W.length>0||b.write(`\r\x1b[K${I.dim}❯${I.reset} ${I.cyan}${N}${I.reset}`))}function
|
|
4
|
+
`)?e:`${e}\r\n`),B())}function B(){b&&(L||W.length>0||b.write(`\r\x1b[K${I.dim}❯${I.reset} ${I.cyan}${N}${I.reset}`))}function je(){W.length=0,L=!1,U=!1,G.clear(),H=``,N=``,P=[],F=-1,b?.reset(),B()}let Me=()=>{let e=new Date;return`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}:${String(e.getSeconds()).padStart(2,`0`)}`};function V(e,t=160){let n=e.replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t)}…`:n}let H=``,U=!1,W=[],G=new Map;function Ne(e){if(e.seq<=M)return;M=e.seq;let t=e.frame;switch(t.type){case`__terminal_notice`:{let e=String(t.level??`info`),n=e===`error`?I.red:e===`warning`?I.yellow:I.dim;z(`${I.dim}[${Me()}]${I.reset} ${n}⚡ ${String(t.message??``)}${I.reset}`);return}case`__human_input`:H=String(t.text??``),z(`${I.bold}${I.cyan}❯ ${H}${I.reset}`);return;case`ready`:z(`${I.green}● omp ready${I.reset} ${I.dim}protocol v${String(t.protocolVersion??`?`)} · mode rpc-ui${I.reset}`);return;case`agent_start`:U=!1,G.clear(),z(`${I.dim}── agent turn started ──${I.reset}`);return;case`agent_end`:z(`${I.dim}── agent turn ended(${String(t.messageCount??`?`)} messages)──${I.reset}`);return;case`message_start`:if(String(t.role??``)===`user`){let e=String(t.text??``);if(e===H)return;z(`${I.bold}${I.cyan}❯ ${e.replace(/\n/g,`\r
|
|
5
5
|
`)}${I.reset}`)}return;case`message_update`:{let e=t.assistantMessageEvent;if(!e)return;if(e.type===`text_delta`&&e.delta){U=!0;let t=typeof e.contentIndex==`number`?e.contentIndex:0;G.set(t,(G.get(t)??0)+e.delta.length),W.push(e.delta.replace(/\n/g,`\r
|
|
6
6
|
`))}else if(e.type===`text_end`&&typeof e.content==`string`&&e.content.length>0){let t=typeof e.contentIndex==`number`?e.contentIndex:0,n=G.get(t)??0;e.content.length>n&&(U=!0,G.set(t,e.content.length),W.push(e.content.slice(n).replace(/\n/g,`\r
|
|
7
7
|
`)))}else e.type===`thinking_delta`&&e.delta&&(U=!0,W.push(`${I.dimItalicMagenta}${e.delta.replace(/\n/g,`\r
|
|
8
|
-
`)}${I.reset}`));return}case`message_end`:String(t.role??``)===`assistant`&&U&&(U=!1,R(),
|
|
9
|
-
`)}${I.reset}`);return;case`response`:{let e=String(t.command??``);if(e===`steer`||e===`follow_up`||e===`abort`||e===`prompt`){let n=t.success!==!1;z(` ${I.dim}· ${e} ${n?`accepted`:`failed: ${String(t.error??``)}`}${I.reset}`)}return}default:return}}let K=d(()=>t.pid!=null&&t.pid>0||!!t.agentId),q=p(null);function
|
|
8
|
+
`)}${I.reset}`));return}case`message_end`:String(t.role??``)===`assistant`&&U&&(U=!1,R(),Ae(),B());return;case`tool_execution_start`:z(` ${I.yellow}⚙ ${String(t.toolName??`tool`)}${I.reset}${I.dim}(${V(String(t.args??``),120)})${I.reset}`);return;case`tool_execution_update`:z(` ${I.dim}↳ … ${V(String(t.update??``),100)}${I.reset}`);return;case`tool_execution_end`:{let e=t.isError===!0?`${I.red}✗${I.reset}`:`${I.green}✓${I.reset}`,n=V(String(t.result??``),180);z(` ${e} ${I.dim}${n}${I.reset}`);return}case`host_tool_call`:z(` ${I.magenta}⇄ host:${String(t.toolName??`?`)}${I.reset}${I.dim}(${V(String(t.args??``),100)})${I.reset}`);return;case`extension_ui_request`:{let e=String(t.method??``);if(e===`cancel`){z(v(`ompTerminalPanel.k14jk3nu001`,{p0:I.dim,p1:String(t.targetId??``),p2:I.reset})),D.value&&D.value.id===String(t.targetId??``)&&(D.value=null);return}if(e===`notify`){z(` ${I.blue}ℹ ${String(t.message??``)}${I.reset}`);return}if(e===`select`||e===`confirm`||e===`input`||e===`editor`){let n=String(t.title??``);if(z(`${I.bold}${I.magenta}⚠ HITL · ${e}: ${n}${I.reset}`),Array.isArray(t.options))for(let e of t.options)z(` ${I.magenta}○${I.reset} ${String(e)}`);D.value={id:String(t.id??``),method:e,title:n,options:Array.isArray(t.options)?t.options.map(String):void 0,message:typeof t.message==`string`?t.message:void 0,placeholder:typeof t.placeholder==`string`?t.placeholder:void 0,prefill:typeof t.prefill==`string`?t.prefill:void 0,at:fe()}}return}case`command_output`:z(`${I.dim}${String(t.text??``).replace(/\n/g,`\r
|
|
9
|
+
`)}${I.reset}`);return;case`response`:{let e=String(t.command??``);if(e===`steer`||e===`follow_up`||e===`abort`||e===`prompt`){let n=t.success!==!1;z(` ${I.dim}· ${e} ${n?`accepted`:`failed: ${String(t.error??``)}`}${I.reset}`)}return}default:return}}let K=d(()=>t.pid!=null&&t.pid>0||!!t.agentId),q=p(null);function Pe(){let e=window.location.protocol===`https:`?`wss`:`ws`,n=encodeURIComponent(ke.token??``),r=t.pid!=null&&t.pid>0?`pid=${t.pid}`:`agentId=${encodeURIComponent(t.agentId??``)}${t.channelId?`&channelId=${encodeURIComponent(t.channelId)}`:``}`;return`${e}://${window.location.host}/api/system/monitor/terminal/ws?${r}&token=${n}`}let J=``;function Fe(e){switch(e.type){case`term.init`:q.value!==e.meta.pid&&(q.value=e.meta.pid,M=0,J=``,z(v(`ompTerminalPanel.k68kkpc002`,{p0:I.dim,p1:e.meta.pid,p2:e.lastSeq,p3:I.reset}))),w.value=e.alive,T.value=e.running,E.value=e.streaming,D.value=e.hitl;return;case`term.frames`:for(let t of e.frames)Ne(t);R();return;case`term.state`:w.value=e.alive,T.value=e.running,E.value=e.streaming;return;case`term.notice`:se.info(e.message);return;case`term.error`:{let t=`[${e.code}] ${e.message}`;if(t===J)return;J=t,z(`${I.red}✗ ${t}${I.reset}`);return}case`pong`:return}}function Y(){if(!K.value||!ke.token||O&&(O.readyState===WebSocket.OPEN||O.readyState===WebSocket.CONNECTING))return;j=!1,C.value=A===0?`connecting`:`retrying`;let e=new WebSocket(Pe());O=e,e.onopen=()=>{O===e&&(A=0,C.value=`open`)},e.onmessage=t=>{if(O===e)try{Fe(JSON.parse(t.data))}catch{}},e.onclose=()=>{if(O!==e)return;if(O=null,D.value=null,j||!K.value){C.value=`dead`;return}A+=1;let t=Math.min(1e3*2**Math.min(A-1,4),1e4);C.value=`retrying`,k=setTimeout(()=>{k=null,!j&&K.value&&Y()},t)},e.onerror=()=>{}}function X(){j=!0,k&&=(clearTimeout(k),null),O?.close(),O=null}function Ie(e){if(O?.readyState===WebSocket.OPEN){O.send(JSON.stringify(e));return}z(v(`ompTerminalPanel.k59zj91003`,{p0:I.red,p1:I.reset}))}function Le(e){let t=e.trim();t&&(P.push(t),P=P.slice(-50),F=-1,Ie({type:`input`,text:t}))}function Re(){Ie({type:`abort`}),z(`${I.yellow}^C${I.reset}`)}function Z(e){Ie({type:`ui_response`,...e});let t=e.cancelled?`cancelled`:e.confirmed===void 0?`"${V(e.value??``,80)}"`:String(e.confirmed);z(v(`ompTerminalPanel.kvzhi95004`,{p0:I.green,p1:t,p2:I.reset})),D.value=null}let Q=p(``);u(D,e=>{Q.value=e?.prefill??e?.placeholder??``});let $=null;async function ze(){if(b||!y.value)return;let e=y.value,[{Terminal:t},{FitAddon:n}]=await Promise.all([ie(()=>import(`./BrIJiJSN.js`),[],import.meta.url),ie(()=>import(`./DIOBYJe3.js`),[],import.meta.url)]);b=new t({convertEol:!1,cursorBlink:!0,cursorStyle:`bar`,fontFamily:`"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`,fontSize:12.5,lineHeight:1.25,scrollback:8e3,theme:{background:`#10151c`,foreground:`#d6dee8`,cursor:`#7aa2f7`,selectionBackground:`#33467c`,black:`#10151c`,red:`#f7768e`,green:`#9ece6a`,yellow:`#e0af68`,blue:`#7aa2f7`,magenta:`#bb9af7`,cyan:`#7dcfff`,white:`#d6dee8`}}),x=new n,b.loadAddon(x),b.open(e),B();let r=e=>{if(e.ctrlKey||e.metaKey||e.altKey){(e.key===`c`||e.key===`C`)&&(e.preventDefault(),e.stopPropagation(),Re());return}if(e.key===`Enter`){e.preventDefault(),e.stopPropagation(),b?.write(`\r\x1B[K`);let t=N;N=``,Le(t),B();return}if(e.key===`Backspace`){e.preventDefault(),e.stopPropagation(),N=N.slice(0,-1),B();return}if(e.key===`ArrowUp`||e.key===`ArrowDown`){if(P.length===0)return;e.preventDefault(),e.stopPropagation(),e.key===`ArrowUp`?F=F<0?P.length-1:Math.max(0,F-1):(F=F<0?-1:Math.min(P.length-1,F+1),F===P.length-1&&(F=-1)),N=F<0?``:P[F]??``,B();return}e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.preventDefault(),e.stopPropagation(),N+=e.key,B())};e.addEventListener(`keydown`,r,!0),$=r,b.onData(e=>{e.length<=1||(N+=e.replace(/[\r\n]+$/,``),B())}),S=new ResizeObserver(()=>{try{x?.fit()}catch{}}),S.observe(e)}function Be(){$&&y.value&&(y.value.removeEventListener(`keydown`,$,!0),$=null),S?.disconnect(),S=null,b?.dispose(),b=null,x=null}u(g,e=>{e?a(async()=>{await ze(),je(),M=0,A=0,J=``,z(`${I.dim}── AgentWorkShop harness terminal · ${t.pid?`PID ${t.pid}`:`agent ${t.agentId?.slice(0,8)}…`} ──${I.reset}`),Y(),a(()=>{try{x?.fit()}catch{}})}):(X(),D.value=null)}),u(()=>[t.pid,t.agentId],()=>{g.value&&(X(),a(()=>{je(),M=0,A=0,J=``,q.value=null,z(`${I.dim}── 切换目标 · ${t.pid?`PID ${t.pid}`:`agent ${t.agentId?.slice(0,8)}…`} ──${I.reset}`),Y()}))}),n(()=>{X(),Be()});let Ve=()=>{W.length=0,L=!1,b?.clear(),B()},He=d(()=>w.value?E.value?{text:v(`terminal.stateStreaming`),color:`processing`}:T.value?{text:v(`terminal.stateRunning`),color:`warning`}:{text:v(`terminal.stateIdle`),color:`success`}:{text:v(`terminal.stateExited`),color:`error`}),Ue=d(()=>{switch(C.value){case`open`:return{text:v(`terminal.connOpen`),color:`success`};case`connecting`:return{text:v(`terminal.connConnecting`),color:`default`};case`retrying`:return{text:`${v(`terminal.connRetrying`)}(${A})`,color:`warning`};default:return{text:v(`terminal.connClosed`),color:`default`}}});return(t,n)=>{let a=oe,ee=le,u=ce,d=ue;return i(),re(d,{open:g.value,"onUpdate:open":n[7]||=e=>g.value=e,placement:`right`,width:860,"body-style":{padding:`0`,display:`flex`,flexDirection:`column`,background:`#10151c`},"header-style":{background:`#10151c`,borderBottom:`1px solid #1d2733`},class:`omp-terminal-drawer`},{title:m(()=>[h(`div`,pe,[n[8]||=h(`span`,{class:`term-brand`},[h(`span`,{class:`i-tabler-terminal-2`})],-1),h(`span`,me,s(o(v)(`terminal.title`)),1),h(`span`,he,`PID `+s(o(q)??e.pid??`–`),1),e.subtitle?(i(),f(`span`,ge,s(e.subtitle),1)):te(``,!0)])]),extra:m(()=>[h(`div`,_e,[h(`span`,{class:`ts-chip aw-mono`,"data-state":o(C)},[n[9]||=h(`span`,{class:`ts-dot`},null,-1),l(s(o(Ue).text),1)],8,ve),h(`span`,{class:`ts-chip aw-mono`,"data-live":o(T)?o(E)?`streaming`:`running`:`idle`},s(o(He).text),9,ye),_(a,{size:`small`,danger:``,class:`ts-btn`,disabled:!o(T)&&!o(E),onClick:Re},{icon:m(()=>[...n[10]||=[h(`span`,{class:`i-tabler-player-stop`},null,-1)]]),default:m(()=>[l(` `+s(o(v)(`terminal.abort`)),1)]),_:1},8,[`disabled`]),_(a,{size:`small`,class:`ts-btn`,onClick:Ve},{icon:m(()=>[...n[11]||=[h(`span`,{class:`i-tabler-eraser`},null,-1)]]),default:m(()=>[l(` `+s(o(v)(`terminal.clear`)),1)]),_:1})])]),default:m(()=>[h(`div`,be,[o(D)?(i(),f(`div`,xe,[h(`div`,Se,[n[12]||=h(`span`,{class:`i-tabler-user-question`},null,-1),h(`b`,null,s(o(v)(`terminal.hitlTitle`)),1),_(ee,{color:`magenta`},{default:m(()=>[l(s(o(D).method),1)]),_:1}),_(a,{size:`small`,type:`text`,danger:``,onClick:n[0]||=e=>Z({id:o(D).id,cancelled:!0})},{default:m(()=>[l(s(o(v)(`terminal.hitlCancel`)),1)]),_:1})]),h(`p`,Ce,s(o(D).title),1),o(D).method===`select`?(i(),f(`div`,we,[(i(!0),f(c,null,r(o(D).options??[],e=>(i(),re(a,{key:e,block:``,onClick:t=>Z({id:o(D).id,value:e})},{default:m(()=>[l(s(e),1)]),_:2},1032,[`onClick`]))),128))])):o(D).method===`confirm`?(i(),f(c,{key:1},[h(`p`,Te,s(o(D).message),1),h(`div`,Ee,[_(a,{type:`primary`,onClick:n[1]||=e=>Z({id:o(D).id,confirmed:!0})},{default:m(()=>[l(s(o(v)(`terminal.hitlConfirm`)),1)]),_:1}),_(a,{onClick:n[2]||=e=>Z({id:o(D).id,confirmed:!1})},{default:m(()=>[l(s(o(v)(`terminal.hitlDeny`)),1)]),_:1})])],64)):(i(),f(c,{key:2},[_(u,{value:o(Q),"onUpdate:value":n[3]||=e=>ne(Q)?Q.value=e:null,rows:3,placeholder:o(D).placeholder,class:`hitl-textarea`,onPressEnter:n[4]||=e=>Z({id:o(D).id,value:o(Q)})},null,8,[`value`,`placeholder`]),h(`div`,De,[_(a,{type:`primary`,onClick:n[5]||=e=>Z({id:o(D).id,value:o(Q)})},{default:m(()=>[l(s(o(v)(`terminal.hitlSubmit`)),1)]),_:1}),_(a,{onClick:n[6]||=e=>Z({id:o(D).id,cancelled:!0})},{default:m(()=>[l(s(o(v)(`terminal.hitlCancel`)),1)]),_:1})])],64))])):te(``,!0),h(`div`,{ref_key:`hostEl`,ref:y,class:`term-host`},null,512),h(`div`,Oe,s(o(v)(`terminal.hint`)),1)])]),_:1},8,[`open`])}}}),[[`__scopeId`,`data-v-01e245c4`]]),{__name:`WorkshopTerminalOmpTerminalPanel`});export{v as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,F as t,G as n,H as r,Ht as i,St as a,Wt as o,a as s,b as c,et as l,f as u,ft as ee,g as d,h as f,mt as p,nt as m,p as h,rt as g,t as _,x as v,z as y}from"./BSCpFtzG.js";import{B as te,F as ne,I as b,L as x}from"./2LwEn9gX.js";import{a as re}from"./Bi6AiCuP.js";import{t as ie}from"./ubPfs9mQ.js";import{n as ae}from"./BeIfu4N3.js";import{t as oe}from"./BJvGPTpC.js";import{t as se}from"./CNs_Ozdc2.js";import{t as ce}from"./GP2wXyuY.js";import{a as le,n as S,t as ue}from"./CS8R0_J3.js";import{t as de}from"./CUxV8Bw_.js";var fe={class:`page`},pe={class:`aw-kicker`},me={class:`aw-page-head`},he={key:0,class:`err`},ge={key:1,class:`grid`},_e={class:`col-live`},ve={class:`aw-tile value-card`},ye={class:`aw-kicker`},be={class:`big-val mono`},xe={class:`facts mono`},Se={class:`col-form aw-tile pad`},Ce={class:`sec`},we={class:`field`},Te={class:`field`},Ee={value:``},De=[`value`],Oe={class:`field`},ke=[`value`,`disabled`],Ae={class:`field row`},je=[`disabled`],Me={class:`field row`},Ne=[`disabled`],Pe=[`disabled`],Fe={class:`field row`},Ie=[`disabled`],Le={class:`field`},Re={class:`field`},ze={class:`field-row`},Be={class:`field`},Ve={class:`field`},He={class:`field`},Ue={class:`field`},We=[`disabled`],Ge={class:`sec mt`},Ke={class:`driver-grid`},qe={key:0},Je=[`onUpdate:modelValue`],Ye=[`value`],Xe=[`onUpdate:modelValue`,`type`,`placeholder`],Ze={class:`test-row`},Qe=[`disabled`],$e={class:`sec mt`},et={class:`bind-row`},tt={value:``},nt=[`value`],rt={class:`col-hist aw-tile pad`},it={class:`hist-hd`},at={class:`sec`},ot={class:`hist-ctl mono`},st=[`value`],ct={class:`raw-table mono`},lt={key:2,class:`aw-tile pad frames-tile`},ut={class:`hist-hd`},dt={class:`sec`},ft={class:`mono frames-n`},pt=[`viewBox`],mt=[`points`],ht={class:`raw-table mono`},gt={key:0,class:`gal`},_t=[`title`,`onClick`],vt=[`src`],yt={class:`mono`},bt={key:1,class:`frames-empty`},xt=[`src`],C=320,St=84,Ct=`#35e0a0`,wt=`rgba(120,135,160,0.18)`,w=`rgba(140,155,175,0.8)`,T=_(e({__name:`[id]`,setup(e){let{t:_}=ae();se({layout:`default`});let T=re(),E=u(()=>String(T.params.id??``)),D=ue(),O=ce();O.load();let k=de(),A=u(()=>D.nodeById(E.value)??null),j=u(()=>{let e=A.value?le(A.value.templateRef):``;return D.templates.find(t=>t.key===e)??null}),Tt={ok:_(`daqDetail.k41k5c026`),warn:_(`daqDetail.k49z8v027`),alarm:_(`daqDetail.k3xmid028`),offline:_(`daqDetail.k44c2n029`)},M=()=>{let e=A.value;return!e||!D.controller.running||!e.enabled?`offline`:e.state},N=null;y(()=>{N=D.ensureWsFeed(),D.load(),k.load(),F.value&&L()}),t(()=>N?.());let P=u(()=>j.value?.signalKind??`scalar`),F=u(()=>P.value!==`scalar`),I=u(()=>D.framesOf(E.value));async function L(){E.value&&await D.fetchFrames(E.value,{limit:24}).catch(()=>{})}l(E,()=>{F.value&&L()});let R=e=>new Date(e).toLocaleTimeString(`zh-CN`,{hour12:!1}),z=e=>Object.entries(e.metrics??{}).slice(0,3).map(([e,t])=>`${e}=${t}`).join(` `),Et=u(()=>I.value.find(e=>e.kind===`vector`&&e.points?.length)),Dt=u(()=>{let e=Et.value?.points??[];if(e.length<2)return``;let t=Math.min(...e),n=Math.max(...e)-t||1;return e.map((r,i)=>`${(i/(e.length-1)*C).toFixed(1)},${(78-(r-t)/n*72).toFixed(1)}`).join(` `)}),B=p(null);function Ot(e){return e==null?_(`daqDetail.k9vnp9h053`,{p0:D.controller.defaultPublishIntervalMs}):e===0?_(`daqDetail.k1m1zwux030`):`${e}ms`}let V=ee({enabled:!0,driver:`mock`,lineId:``,followGlobal:!0,intervalMs:5e3,calKind:`none`,calScale:1,calOffset:0,publishFollow:!0,publishEveryFrame:!1,publishMs:1e3,unit:``,decimals:1,min:0,max:100,warnLow:null,warnHigh:null});l(A,e=>{e&&(V.enabled=e.enabled,V.lineId=e.lineId??``,V.driver=e.driver,V.followGlobal=e.intervalMs==null,V.intervalMs=e.intervalMs??D.controller.defaultIntervalMs,V.publishFollow=e.publishIntervalMs==null,V.publishEveryFrame=e.publishIntervalMs===0,V.publishMs=e.publishIntervalMs==null?D.controller.defaultPublishIntervalMs:e.publishIntervalMs,V.unit=e.unit,V.decimals=e.decimals,V.min=e.min,V.max=e.max,V.warnLow=e.warnLow,V.warnHigh=e.warnHigh)},{immediate:!0});let H=p({}),U=u(()=>S.find(e=>e.kind===V.driver)?.configFields??[]);l(A,e=>{e&&(H.value={...e.driverConfig})},{immediate:!0}),l(()=>V.driver,()=>{if(U.value.length&&Object.keys(H.value).length===0){let e={};for(let t of U.value)t.default!==void 0&&(e[t.key]=t.default);H.value=e}},{immediate:!0});let W=p(!1),G=p(null);async function kt(){W.value=!0,G.value=null;try{await D.patchNode(E.value,{driver:V.driver,driverConfig:{...H.value}}),G.value=await D.testNode(E.value)}catch(e){G.value={ok:!1,message:e instanceof Error?e.message:String(e)}}finally{W.value=!1}}let K=p(!1);async function At(){let e=A.value;if(!(!e||K.value)){K.value=!0;try{await D.patchNode(e.id,{enabled:V.enabled,driver:V.driver,lineId:V.lineId,driverConfig:{...H.value},intervalMs:V.followGlobal?null:Math.max(1e3,Math.min(6e4,Math.round(V.intervalMs))),publishIntervalMs:V.publishFollow?null:V.publishEveryFrame?0:Math.max(0,Math.min(6e4,Math.round(V.publishMs))),unit:V.unit,decimals:Math.max(0,Math.min(6,Math.round(V.decimals))),min:V.min,max:V.max,warnLow:V.warnLow,warnHigh:V.warnHigh})}finally{K.value=!1}}}function jt(e){return D.meta.drivers.find(t=>t.kind===e)?.status===`planned`}let q=p(``),J=u(()=>{let e=A.value?.deviceBindingId;return e?k.twins.find(t=>t.id===e)?.name??`${e.slice(0,8)}…`:``});function Mt(){D.bindNode(E.value,A.value?.deviceBindingId?null:q.value||null)}let Nt=u(()=>k.twins.filter(e=>e.kind!==`daq`&&e.id!==A.value?.id)),Y=p([]),X=p(15e3),Pt=p(!1),Ft=[{label:`1s 桶`,ms:1e3},{label:`5s 桶`,ms:5e3},{label:`15s 桶(默认)`,ms:15e3},{label:`30s 桶`,ms:3e4},{label:`1min 桶`,ms:6e4}];async function Z(){if(E.value){Pt.value=!0;try{let e=await D.samplesOf(E.value,{toMs:Date.now(),bucketMs:X.value||void 0,limit:400});Y.value=[...e].reverse()}finally{Pt.value=!1,Lt()}}}let It=p(null);function Lt(){let e=It.value;if(!e)return;let t=Math.min(window.devicePixelRatio||1,2),n=e.clientWidth,r=e.clientHeight;(e.width!==n*t||e.height!==r*t)&&(e.width=n*t,e.height=r*t);let i=e.getContext(`2d`);if(!i)return;i.setTransform(t,0,0,t,0,0),i.clearRect(0,0,n,r);for(let e=1;e<4;e++)i.strokeStyle=wt,i.beginPath(),i.moveTo(0,r/4*e),i.lineTo(n,r/4*e),i.stroke();let a=Y.value;if(a.length<2)return;let o=1/0,s=-1/0;for(let e of a){let t=e.value??e.avg??e.min??0;o=Math.min(o,t),s=Math.max(s,t)}let c=Math.max(s-o,1e-9);i.strokeStyle=w,i.font=`10px monospace`,i.fillStyle=w,i.fillText(s.toFixed(2),4,11),i.fillText(o.toFixed(2),4,r-4),i.strokeStyle=Ct,i.lineWidth=1.6,i.beginPath(),a.forEach((e,t)=>{let s=t/(a.length-1)*n,l=r-((e.value??e.avg??0)-o)/c*(r-16)-8;t===0?i.moveTo(s,l):i.lineTo(s,l)}),i.stroke()}let Q=p(null),$=null;function Rt(){let e=Q.value,t=A.value;if(!e||!t||t.hist.length<2)return;let n=Math.min(window.devicePixelRatio||1,2),r=e.clientWidth,i=e.clientHeight;(e.width!==r*n||e.height!==i*n)&&(e.width=r*n,e.height=i*n);let a=e.getContext(`2d`);if(!a)return;a.setTransform(n,0,0,n,0,0),a.clearRect(0,0,r,i);let o=Math.max(...t.hist),s=Math.min(...t.hist),c=Math.max(o-s,1e-9);a.strokeStyle=`rgba(65,200,244,0.9)`,a.lineWidth=1.5,a.beginPath(),t.hist.forEach((e,n)=>{let o=n/(t.hist.length-1)*r,l=i-(e-s)/c*(i-6)-3;n===0?a.moveTo(o,l):a.lineTo(o,l)}),a.stroke()}return y(()=>{Z(),$=oe(()=>{Rt()},800)}),t(()=>{$&&clearInterval($)}),l(X,()=>void Z()),(e,t)=>{let l=ie;return r(),d(`div`,fe,[h(`p`,pe,[v(l,{to:`/daq`,class:`back`},{default:m(()=>[c(o(e.$t(`daqDetail.k1emg364001`)),1)]),_:1}),c(` / NODE `+o(E.value.slice(0,8).toUpperCase()),1)]),h(`div`,me,[h(`h1`,null,o(A.value?.name??E.value),1),h(`span`,{class:i([`st-pill`,[M()]])},o(Tt[M()]),3)]),!A.value&&a(D).error?(r(),d(`p`,he,[c(o(a(D).error)+`(`,1),v(l,{to:`/workshop`},{default:m(()=>[c(o(e.$t(`daqDetail.k1bhhheq002`)),1)]),_:1}),t[20]||=c(`) `,-1)])):f(``,!0),A.value?(r(),d(`div`,ge,[h(`section`,_e,[h(`div`,ve,[h(`p`,ye,o(e.$t(`daqDetail.k1fx2vik032`))+` `+o(j.value?.ch??`-`),1),h(`div`,be,[c(o(A.value.value==null?`--`:A.value.value.toFixed(A.value.decimals)),1),h(`small`,null,o(A.value.unit),1)]),h(`canvas`,{ref_key:`liveCanvas`,ref:Q,class:`live-canvas`},null,512),h(`dl`,xe,[h(`div`,null,[h(`dt`,null,o(e.$t(`daqDetail.k4a0la003`)),1),h(`dd`,null,o(A.value.driver)+o(jt(A.value.driver)?e.$t(`daqDetail.kz8zr9v035`):``),1)]),h(`div`,null,[h(`dt`,null,o(e.$t(`daqDetail.k3xg3w004`)),1),h(`dd`,null,o(A.value.intervalMs??e.$t(`daqDetail.k9vnp9h053`,{p0:a(D).controller.defaultIntervalMs})),1)]),h(`div`,null,[h(`dt`,null,o(e.$t(`daqDetail.k3w6td005`)),1),h(`dd`,null,o(Ot(A.value.publishIntervalMs)),1)]),h(`div`,null,[h(`dt`,null,o(e.$t(`daqDetail.k3x5tpx006`)),1),h(`dd`,null,o(A.value.warnLow??`-∞`)+` ~ `+o(A.value.warnHigh??`+∞`),1)]),h(`div`,null,[h(`dt`,null,o(e.$t(`daqDetail.k1hjj0jf007`)),1),h(`dd`,null,o(A.value.min)+` ~ `+o(A.value.max),1)]),h(`div`,null,[h(`dt`,null,o(e.$t(`daqDetail.k1i8rtqt008`)),1),h(`dd`,null,o(J.value||e.$t(`daqDetail.k3own4q036`)),1)])])])]),h(`section`,Se,[h(`h3`,Ce,o(e.$t(`daqDetail.kd9d69j009`)),1),h(`form`,{class:`form-grid`,onSubmit:te(At,[`prevent`])},[h(`label`,we,[h(`span`,null,o(e.$t(`daqDetail.k1iw7tbf010`)),1),h(`button`,{type:`button`,class:i([`toggle`,{on:V.enabled}]),onClick:t[0]||=e=>V.enabled=!V.enabled},o(V.enabled?e.$t(`daqDetail.k3w3j8f037`):e.$t(`daqDetail.k3n5aaj045`)),3)]),h(`label`,Te,[h(`span`,null,o(e.$t(`daqDetail.k12k23od011`)),1),g(h(`select`,{"onUpdate:modelValue":t[1]||=e=>V.lineId=e,class:`input`},[h(`option`,Ee,o(e.$t(`daqDetail.k3ootr6012`)),1),(r(!0),d(s,null,n(a(O).lines,e=>(r(),d(`option`,{key:e.id,value:e.id},o(e.name),9,De))),128))],512),[[b,V.lineId]])]),h(`label`,Oe,[h(`span`,null,o(e.$t(`daqDetail.k1l6smxo013`)),1),g(h(`select`,{"onUpdate:modelValue":t[2]||=e=>V.driver=e,class:`input`},[(r(!0),d(s,null,n(a(S),t=>(r(),d(`option`,{key:t.kind,value:t.kind,disabled:t.status===`planned`},o(t.label)+o(t.status===`planned`?e.$t(`daqDetail.kz8zr9v035`):``),9,ke))),128))],512),[[b,V.driver]])]),h(`label`,Ae,[h(`button`,{type:`button`,class:i([`toggle slim`,{on:V.followGlobal}]),onClick:t[3]||=e=>V.followGlobal=!V.followGlobal},o(V.followGlobal?e.$t(`daqDetail.k1k2ueyq038`):e.$t(`daqDetail.k1cgi8fy046`)),3),g(h(`input`,{"onUpdate:modelValue":t[4]||=e=>V.intervalMs=e,type:`number`,min:`1000`,max:`60000`,step:`500`,class:`input`,disabled:V.followGlobal},null,8,je),[[x,V.intervalMs,void 0,{number:!0}]]),t[21]||=h(`small`,null,`ms`,-1)]),h(`label`,Me,[h(`button`,{type:`button`,class:i([`toggle slim`,{on:V.calKind===`linear`}]),title:`采集标定 decoder:物理值 = scale × PLC采集值 + offset`,onClick:t[5]||=e=>V.calKind=V.calKind===`linear`?`none`:`linear`},o(V.calKind===`linear`?e.$t(`daqDetail.k1eru4r1039`):e.$t(`daqDetail.k3oktae047`)),3),g(h(`input`,{"onUpdate:modelValue":t[6]||=e=>V.calScale=e,type:`number`,step:`0.1`,class:`input`,disabled:V.calKind!==`linear`,title:`decode 斜率(≠0)`},null,8,Ne),[[x,V.calScale,void 0,{number:!0}]]),g(h(`input`,{"onUpdate:modelValue":t[7]||=e=>V.calOffset=e,type:`number`,step:`0.1`,class:`input`,disabled:V.calKind!==`linear`,title:`decode 截距`},null,8,Pe),[[x,V.calOffset,void 0,{number:!0}]]),t[22]||=h(`small`,null,`decoder`,-1)]),h(`label`,Fe,[h(`button`,{type:`button`,class:i([`toggle slim`,{on:V.publishFollow}]),onClick:t[8]||=e=>V.publishFollow=!V.publishFollow},o(V.publishFollow?e.$t(`daqDetail.k1k2t5o7040`):e.$t(`daqDetail.k1cggz5f048`)),3),h(`span`,{class:i([`toggle slim`,{on:V.publishEveryFrame}]),style:{cursor:`pointer`},onClick:t[9]||=e=>V.publishEveryFrame=!V.publishEveryFrame},o(V.publishEveryFrame?e.$t(`daqDetail.k41mvv041`):e.$t(`daqDetail.k3n42dj049`)),3),g(h(`input`,{"onUpdate:modelValue":t[10]||=e=>V.publishMs=e,type:`number`,min:`0`,max:`60000`,step:`100`,class:`input`,disabled:V.publishFollow||V.publishEveryFrame},null,8,Ie),[[x,V.publishMs,void 0,{number:!0}]]),t[23]||=h(`small`,null,`ms`,-1)]),h(`label`,Le,[h(`span`,null,o(e.$t(`daqDetail.k3x4ef014`)),1),g(h(`input`,{"onUpdate:modelValue":t[11]||=e=>V.unit=e,class:`input`},null,512),[[x,V.unit]])]),h(`label`,Re,[h(`span`,null,o(e.$t(`daqDetail.k3mxmcx015`)),1),g(h(`input`,{"onUpdate:modelValue":t[12]||=e=>V.decimals=e,type:`number`,min:`0`,max:`6`,class:`input`},null,512),[[x,V.decimals,void 0,{number:!0}]])]),h(`div`,ze,[h(`label`,Be,[h(`span`,null,o(e.$t(`daqDetail.k1l9jv5m016`)),1),g(h(`input`,{"onUpdate:modelValue":t[13]||=e=>V.min=e,type:`number`,step:`any`,class:`input`},null,512),[[x,V.min,void 0,{number:!0}]])]),h(`label`,Ve,[h(`span`,null,o(e.$t(`daqDetail.k1md63hm017`)),1),g(h(`input`,{"onUpdate:modelValue":t[14]||=e=>V.warnLow=e,type:`number`,step:`any`,class:`input`},null,512),[[x,V.warnLow,void 0,{number:!0}]])]),h(`label`,He,[h(`span`,null,o(e.$t(`daqDetail.k1md63gp018`)),1),g(h(`input`,{"onUpdate:modelValue":t[15]||=e=>V.warnHigh=e,type:`number`,step:`any`,class:`input`},null,512),[[x,V.warnHigh,void 0,{number:!0}]])]),h(`label`,Ue,[h(`span`,null,o(e.$t(`daqDetail.k1l9jv4p019`)),1),g(h(`input`,{"onUpdate:modelValue":t[16]||=e=>V.max=e,type:`number`,step:`any`,class:`input`},null,512),[[x,V.max,void 0,{number:!0}]])])]),h(`button`,{class:`aw-pill`,type:`submit`,disabled:K.value},o(K.value?e.$t(`daqDetail.k1as0g50042`):e.$t(`daqDetail.ksn9cgo050`)),9,We)],32),U.value.length?(r(),d(s,{key:0},[h(`h3`,Ge,o(e.$t(`daqDetail.k1p9gioa033`))+` `+o(a(S).find(e=>e.kind===V.driver)?.label),1),h(`div`,Ke,[(r(!0),d(s,null,n(U.value,e=>(r(),d(`label`,{key:e.key,class:`field`},[h(`span`,null,[c(o(e.label),1),e.required?(r(),d(`em`,qe,`*`)):f(``,!0)]),e.type===`select`?g((r(),d(`select`,{key:0,"onUpdate:modelValue":t=>H.value[e.key]=t,class:`input`},[(r(!0),d(s,null,n(e.options,e=>(r(),d(`option`,{key:e.value,value:e.value},o(e.label),9,Ye))),128))],8,Je)),[[b,H.value[e.key]]]):g((r(),d(`input`,{key:1,"onUpdate:modelValue":t=>H.value[e.key]=t,type:e.type===`number`?`number`:`text`,placeholder:e.placeholder,class:`input`},null,8,Xe)),[[ne,H.value[e.key]]])]))),128))]),h(`div`,Ze,[h(`button`,{class:`pill-btn`,disabled:W.value,onClick:kt},o(W.value?e.$t(`daqDetail.k1fsh720043`):e.$t(`daqDetail.k1fstglk051`)),9,Qe),G.value?(r(),d(`span`,{key:0,class:i([`test-out mono`,G.value.ok?`ok`:`bad`])},o(G.value.ok?`✓`:`✗`)+` `+o(G.value.message),3)):f(``,!0)])],64)):f(``,!0),h(`h3`,$e,o(e.$t(`daqDetail.k1ie6qju020`)),1),h(`div`,et,[g(h(`select`,{"onUpdate:modelValue":t[17]||=e=>q.value=e,class:`input grow`},[h(`option`,tt,o(e.$t(`daqDetail.kjobzu3021`)),1),(r(!0),d(s,null,n(Nt.value,e=>(r(),d(`option`,{key:e.id,value:e.id},o(e.name),9,nt))),128))],512),[[b,q.value]]),h(`button`,{class:`pill-btn`,onClick:Mt},o(J.value?e.$t(`daqDetail.k479eh044`):e.$t(`daqDetail.k452a8052`)),1)])]),h(`section`,rt,[h(`div`,it,[h(`h3`,at,o(e.$t(`daqDetail.k1i535i5034`))+o(a(D).meta.tsdb)+`) `,1),h(`div`,ot,[g(h(`select`,{"onUpdate:modelValue":t[18]||=e=>X.value=e,class:`input`},[(r(),d(s,null,n(Ft,e=>h(`option`,{key:e.ms,value:e.ms},o(e.label),9,st)),64))],512),[[b,X.value,void 0,{number:!0}]]),h(`button`,{class:`pill-btn`,onClick:Z},o(e.$t(`daqDetail.k3x1jg022`)),1)])]),h(`canvas`,{ref_key:`chartCanvas`,ref:It,class:`hist-canvas`},null,512),h(`table`,ct,[h(`thead`,null,[h(`tr`,null,[h(`th`,null,o(e.$t(`daqDetail.k40vsf023`)),1),h(`th`,null,o(e.$t(`daqDetail.k48v5024`)),1),h(`th`,null,o(e.$t(`daqDetail.k4bza025`)),1)])]),h(`tbody`,null,[(r(!0),d(s,null,n(Y.value.filter(e=>e.value!=null).slice(-12).reverse(),(e,t)=>(r(),d(`tr`,{key:t},[h(`td`,null,o(new Date(e.at).toLocaleTimeString(`zh-CN`,{hour12:!1})),1),h(`td`,null,o(e.value.toFixed(A.value?.decimals??2)),1),h(`td`,null,o(e.state),1)]))),128))])])])])):f(``,!0),F.value?(r(),d(`section`,lt,[h(`div`,ut,[h(`h3`,dt,[c(o(P.value===`image`?e.$t(`daqDetail.kfrm0001`):e.$t(`daqDetail.kfrm0002`))+` `,1),h(`span`,ft,o(I.value.length),1)]),h(`button`,{class:`pill-btn`,onClick:L},o(e.$t(`daqDetail.k3x1jg022`)),1)]),P.value===`vector`?(r(),d(s,{key:0},[(r(),d(`svg`,{class:`vec-svg`,viewBox:`0 0 ${C} ${St}`,preserveAspectRatio:`none`},[h(`polyline`,{points:Dt.value,fill:`none`,stroke:`var(--accent)`,"stroke-width":`1.5`},null,8,mt)],8,pt)),h(`table`,ht,[h(`thead`,null,[h(`tr`,null,[h(`th`,null,o(e.$t(`daqDetail.k40vsf023`)),1),h(`th`,null,o(e.$t(`daqDetail.kfrm0004`)),1),h(`th`,null,o(e.$t(`daqDetail.kfrm0005`)),1)])]),h(`tbody`,null,[(r(!0),d(s,null,n(I.value.filter(e=>e.kind===`vector`).slice(0,12),e=>(r(),d(`tr`,{key:e.at},[h(`td`,null,o(R(e.at)),1),h(`td`,null,o(e.points?.length??0),1),h(`td`,null,o(z(e)),1)]))),128))])])],64)):(r(),d(s,{key:1},[I.value.length?(r(),d(`div`,gt,[(r(!0),d(s,null,n(I.value,t=>(r(),d(`figure`,{key:t.at,class:`gal-item`,title:e.$t(`daqDetail.kfrm0006`),onClick:e=>B.value=t},[h(`img`,{src:t.thumbUrl,loading:`lazy`,alt:`daq frame`},null,8,vt),h(`figcaption`,yt,o(R(t.at))+` · `+o(z(t)),1)],8,_t))),128))])):(r(),d(`p`,bt,o(e.$t(`daqDetail.kfrm0003`)),1)),B.value?(r(),d(`div`,{key:2,class:`gal-full`,onClick:t[19]||=e=>B.value=null},[h(`img`,{src:B.value.contentUrl??B.value.thumbUrl,alt:`daq frame full`},null,8,xt)])):f(``,!0)],64))])):f(``,!0)])}}}),[[`__scopeId`,`data-v-c3ee3a1c`]]);export{T as default};
|