tide-commander 1.210.0 → 1.211.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/assets/{AudioPlayer-CElliTTR.js → AudioPlayer-BkW6rbHa.js} +1 -1
- package/dist/assets/{BossLogsModal-DO0Vs1lM.js → BossLogsModal-CWJfLRLA.js} +1 -1
- package/dist/assets/{BossSpawnModal-BuDifEmB.js → BossSpawnModal-DMxCXROC.js} +1 -1
- package/dist/assets/{ControlsModal-DPcrW0oK.js → ControlsModal-BaSSGPXP.js} +1 -1
- package/dist/assets/{DockerLogsModal-DaGU7BRb.js → DockerLogsModal-C_Nb5L_a.js} +1 -1
- package/dist/assets/{EmbeddedEditor-BFwoN_46.js → EmbeddedEditor-CG0ULJUZ.js} +1 -1
- package/dist/assets/{FcStdViewer-D0qXXGZb.js → FcStdViewer-BgEgrxaw.js} +1 -1
- package/dist/assets/{GcodeViewer-DqMtMidS.js → GcodeViewer-CTlX7eA7.js} +1 -1
- package/dist/assets/{GlbViewer-B3jqR181.js → GlbViewer-CKaX8cFI.js} +1 -1
- package/dist/assets/{GmailOAuthSetup-G3QuK-qX.js → GmailOAuthSetup-1AhXjBRc.js} +1 -1
- package/dist/assets/{GoogleOAuthSetup-dCjYnCta.js → GoogleOAuthSetup-DqPgZjOY.js} +1 -1
- package/dist/assets/{IframeModal-DYJCvfYE.js → IframeModal-ClN_kGcP.js} +1 -1
- package/dist/assets/{IntegrationsPanel-M73zpDQj.js → IntegrationsPanel-ckrmRwYi.js} +2 -2
- package/dist/assets/{LogViewerModal-IwhEcaYj.js → LogViewerModal-D_eGItAQ.js} +1 -1
- package/dist/assets/{MonitoringModal-k5DVlUx4.js → MonitoringModal-BrsQN8tD.js} +1 -1
- package/dist/assets/{PM2LogsModal-CK08IAnZ.js → PM2LogsModal-CKfdmFqw.js} +1 -1
- package/dist/assets/{PluginsPanel-DAmAgJvL.js → PluginsPanel-Bfqcnrsb.js} +1 -1
- package/dist/assets/{RestoreArchivedAreaModal-BCn-HylF.js → RestoreArchivedAreaModal-oZSTlXhf.js} +1 -1
- package/dist/assets/{Scene2DCanvas-DZ3LFW07.js → Scene2DCanvas-B2oTAqlK.js} +1 -1
- package/dist/assets/{SceneManager-aCcayL_T.js → SceneManager-pnDsJdS-.js} +1 -1
- package/dist/assets/{SkillsPanel-mr09RF0o.js → SkillsPanel-AQimvs-1.js} +1 -1
- package/dist/assets/{SlackMultiInstanceSetup-JSGJZGh6.js → SlackMultiInstanceSetup-U4d0XsWJ.js} +1 -1
- package/dist/assets/SpawnModal-DgKO0K6L.js +1 -0
- package/dist/assets/{StatisticsModal-DyUUvnxL.js → StatisticsModal-DDC8OYen.js} +1 -1
- package/dist/assets/{StlViewer-B0mqqtbi.js → StlViewer-DJZ7Qgp0.js} +1 -1
- package/dist/assets/{SubordinateAssignmentModal-C7XdTSBc.js → SubordinateAssignmentModal-DCM6PpB_.js} +1 -1
- package/dist/assets/{ThreeAreaSelector-Cxtggsnt.js → ThreeAreaSelector-CjEcL3Kh.js} +1 -1
- package/dist/assets/{ThreeViewShortcuts-BqvxjuDQ.js → ThreeViewShortcuts-UakjRD8w.js} +1 -1
- package/dist/assets/{TriggerManagerPanel-BnTWDT1K.js → TriggerManagerPanel-C42VLQu6.js} +1 -1
- package/dist/assets/{VideoPlayer-jknjvQg9.js → VideoPlayer-UW43AiLH.js} +1 -1
- package/dist/assets/{WorkflowEditorPanel-CvWwQ2Rk.js → WorkflowEditorPanel-DUvf5X0c.js} +1 -1
- package/dist/assets/{abnfDiagram-VRR7QNED-CUyx8tcg.js → abnfDiagram-VRR7QNED-KDmvD_Gi.js} +1 -1
- package/dist/assets/{arc-x9pqF0PL.js → arc-D8Dnwz7O.js} +1 -1
- package/dist/assets/{architectureDiagram-ZJ3FMSHR-BL9aDWOo.js → architectureDiagram-ZJ3FMSHR-DzHUfCXK.js} +1 -1
- package/dist/assets/{area-logos-Dr_ZUFxK.js → area-logos-JqUib9Ux.js} +1 -1
- package/dist/assets/{blockDiagram-677ZJIJ3-CaM55zZQ.js → blockDiagram-677ZJIJ3-CwOc3I3e.js} +1 -1
- package/dist/assets/{c4Diagram-LMCZKHZV-CCXnyLaP.js → c4Diagram-LMCZKHZV-ByDTz6Pi.js} +1 -1
- package/dist/assets/channel-C9DXs2xS.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-CUBfQrLS.js → chunk-2Q5K7J3B-CJ-5lUjr.js} +1 -1
- package/dist/assets/{chunk-32BRIVSS-CBsYvxtB.js → chunk-32BRIVSS-ClxbX6JR.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-D9K_iBqe.js → chunk-5VM5RSS4-D-B4g6BP.js} +1 -1
- package/dist/assets/{chunk-EX3LRPZG-BArv7wZg.js → chunk-EX3LRPZG-DE_ym6tm.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-nqIaplf_.js → chunk-JWPE2WC7-DbFNU_Ef.js} +1 -1
- package/dist/assets/{chunk-MOJQB5TN-D9-EvsXA.js → chunk-MOJQB5TN-BonkkykU.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-DhEtjvXf.js → chunk-RYQCIY6F-CqaRznBG.js} +1 -1
- package/dist/assets/{chunk-V7JOEXUC-CloPxFmQ.js → chunk-V7JOEXUC-DI5OpSJo.js} +1 -1
- package/dist/assets/{chunk-VR4S4FIN-B_gj6T5J.js → chunk-VR4S4FIN-DzHJs5bu.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-CYQuP2YZ.js → chunk-XXDRQBXY-x9Zsg6mD.js} +1 -1
- package/dist/assets/classDiagram-OUVF2IWQ-apBPMHmB.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-apBPMHmB.js +1 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-CnNLLImF.js → cose-bilkent-JH36ORCC-B4Gh0RgK.js} +1 -1
- package/dist/assets/{cynefin-VYW2F7L2-CIlHlZVD.js → cynefin-VYW2F7L2-1rocbocI.js} +1 -1
- package/dist/assets/{cynefinDiagram-TSTJHNR4-DhQrqCi2.js → cynefinDiagram-TSTJHNR4-BCbOrdTH.js} +1 -1
- package/dist/assets/{dagre-VKFMJZFB-XKh2Tzhw.js → dagre-VKFMJZFB-CquTDGCQ.js} +1 -1
- package/dist/assets/{diagram-FQU43EPY-C7LI8otY.js → diagram-FQU43EPY-CtRps2DK.js} +1 -1
- package/dist/assets/{diagram-G47NLZAW-BMBTikTC.js → diagram-G47NLZAW-C8uHzoun.js} +1 -1
- package/dist/assets/{diagram-NH7WQ7WH-BW_TXoVZ.js → diagram-NH7WQ7WH-BzGxTXmO.js} +1 -1
- package/dist/assets/{diagram-OA4YK3LP-PDlY_6C8.js → diagram-OA4YK3LP-BoUlY6He.js} +1 -1
- package/dist/assets/{diagram-WEI45ONY-svn0tX11.js → diagram-WEI45ONY-EewNkn4I.js} +1 -1
- package/dist/assets/{ebnfDiagram-CCIWWBDH-BUIULs-0.js → ebnfDiagram-CCIWWBDH-DAp0_rYI.js} +1 -1
- package/dist/assets/{erDiagram-Q63AITRT-BiLmEbtK.js → erDiagram-Q63AITRT-CIDiaIv_.js} +1 -1
- package/dist/assets/{flowDiagram-23GEKE2U-Mc6PRVJ8.js → flowDiagram-23GEKE2U-ZQudeco2.js} +1 -1
- package/dist/assets/{ganttDiagram-NO4QXBWP-BRUNbUed.js → ganttDiagram-NO4QXBWP-DDa9u7Kj.js} +1 -1
- package/dist/assets/{gitGraphDiagram-IHSO6WYX-ezzuOWgX.js → gitGraphDiagram-IHSO6WYX-D0LPqp_M.js} +1 -1
- package/dist/assets/{index-D_NWG6YH.js → index-BMILmzZt.js} +3 -3
- package/dist/assets/{index-CdgtzuJp.js → index-BuW-OFAQ.js} +1 -1
- package/dist/assets/{index-BfLoArjP.js → index-CM0wRsAP.js} +1 -1
- package/dist/assets/{index-DfYkUGiD.js → index-CbjaD3wY.js} +2 -2
- package/dist/assets/{index-D8VUtdAF.js → index-CgtrBMsu.js} +1 -1
- package/dist/assets/index-CmZ79Am7.js +2 -0
- package/dist/assets/{index-BhcdiVTj.js → index-D0O_xUmt.js} +1 -1
- package/dist/assets/{index-Y6_p8QBS.js → index-DjZWtEFJ.js} +1 -1
- package/dist/assets/{index-SspfO_Hv.js → index-tU947Zt1.js} +1 -1
- package/dist/assets/{infoDiagram-FWYZ7A6U-BlWhqgLQ.js → infoDiagram-FWYZ7A6U-CD4Ws76i.js} +1 -1
- package/dist/assets/{ishikawaDiagram-FXEZZL3T-C52xQkXn.js → ishikawaDiagram-FXEZZL3T-DSEmTd2f.js} +1 -1
- package/dist/assets/{journeyDiagram-5HDEW3XC-DyobJuKu.js → journeyDiagram-5HDEW3XC-3_c5LjHs.js} +1 -1
- package/dist/assets/{kanban-definition-HUTT4EX6-D3TWdW5B.js → kanban-definition-HUTT4EX6-24lijuGn.js} +1 -1
- package/dist/assets/{linear-kXdtPjWH.js → linear-B_K6Qcv3.js} +1 -1
- package/dist/assets/{main-BmGgLw1j.css → main-6EJsyrfW.css} +1 -1
- package/dist/assets/main-D0r07JA_.js +344 -0
- package/dist/assets/{mermaid.core-jkxx9VU-.js → mermaid.core-B6sgvfs-.js} +4 -4
- package/dist/assets/{mindmap-definition-LN4V7U3C-CbFsW2ye.js → mindmap-definition-LN4V7U3C-BsAOrAHj.js} +1 -1
- package/dist/assets/{pegDiagram-2B236MQR-D2nH_y6d.js → pegDiagram-2B236MQR-DdfupKz5.js} +1 -1
- package/dist/assets/{pieDiagram-ENE6RG2P-CaK3PEMJ.js → pieDiagram-ENE6RG2P-D1YBZYdK.js} +1 -1
- package/dist/assets/{quadrantDiagram-ABIIQ3AL-UgYM7N6C.js → quadrantDiagram-ABIIQ3AL-Bw-hoDGQ.js} +1 -1
- package/dist/assets/{railroadDiagram-RFXS5EU6-CC2ZEDL4.js → railroadDiagram-RFXS5EU6-CkmO-Wgv.js} +1 -1
- package/dist/assets/{requirementDiagram-TGXJPOKE-nlqWI7vA.js → requirementDiagram-TGXJPOKE-CSI19yqY.js} +1 -1
- package/dist/assets/{sankeyDiagram-HTMAVEWB-9uWggzcO.js → sankeyDiagram-HTMAVEWB-BvLYUk8J.js} +1 -1
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-0p9VY0Wu.js → sequenceDiagram-DBY2YBRQ-DSQLX4Eb.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-B2sHn0MG.js → sizeCapture-X5ZJPWSS-DfyzoJ-u.js} +1 -1
- package/dist/assets/{stateDiagram-2N3HPSRC-DpATBmQQ.js → stateDiagram-2N3HPSRC-G3bxzIPH.js} +1 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-DCUADcVF.js +1 -0
- package/dist/assets/{swimlanes-5IMT3BWC-BPpym6MS.js → swimlanes-5IMT3BWC-CDZGonhF.js} +2 -2
- package/dist/assets/swimlanesDiagram-G3AALYLV-Ddwy1JnL.js +8 -0
- package/dist/assets/{timeline-definition-FHXFAJF6-SrMCxAjV.js → timeline-definition-FHXFAJF6-C5QDZq49.js} +1 -1
- package/dist/assets/{vennDiagram-L72KCM5P-_9HfkXQN.js → vennDiagram-L72KCM5P-0a1v0gi5.js} +1 -1
- package/dist/assets/{wardleyDiagram-EHGQE667-EnATDQOK.js → wardleyDiagram-EHGQE667-DArhtjvR.js} +1 -1
- package/dist/assets/{web-BkIE9AAN.js → web-BU7b4YVF.js} +1 -1
- package/dist/assets/{web-CB0hTO4y.js → web-BgCc_AGi.js} +1 -1
- package/dist/assets/{web-6vks_1wd.js → web-BiQ9JdSl.js} +1 -1
- package/dist/assets/{xychartDiagram-FW5EYKEG-DlMpFz7X.js → xychartDiagram-FW5EYKEG-BIZcXzGL.js} +1 -1
- package/dist/build-info.json +1 -1
- package/dist/index.html +2 -2
- package/dist/src/packages/server/data/builtin-skills/conversation-history.js +3 -2
- package/dist/src/packages/server/data/event-queries.js +16 -6
- package/dist/src/packages/server/data/migrations/009_whatsapp_participant_jid.sql +9 -0
- package/dist/src/packages/server/data/migrations/010_whatsapp_participant_alt_jid.sql +9 -0
- package/dist/src/packages/server/integrations/whatsapp/whatsapp-client.js +6 -2
- package/dist/src/packages/server/integrations/whatsapp/whatsapp-routes.js +103 -2
- package/dist/src/packages/server/integrations/whatsapp/whatsapp-skill.js +11 -0
- package/dist/src/packages/server/integrations/whatsapp/whatsapp-trigger-handler.js +48 -5
- package/dist/src/packages/server/routes/event-routes.js +2 -0
- package/dist/src/packages/server/routes/files.js +169 -0
- package/package.json +1 -1
- package/dist/assets/SpawnModal-Rduhhunw.js +0 -1
- package/dist/assets/channel-W4AeOLhF.js +0 -1
- package/dist/assets/classDiagram-OUVF2IWQ-39XSHTF2.js +0 -1
- package/dist/assets/classDiagram-v2-EOCWNBFH-39XSHTF2.js +0 -1
- package/dist/assets/index-C9Axek5A.js +0 -2
- package/dist/assets/main-Bt4E0_YW.js +0 -344
- package/dist/assets/stateDiagram-v2-6OUMAXLB-CQH1oSae.js +0 -1
- package/dist/assets/swimlanesDiagram-G3AALYLV-BhNebkPx.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c0 as ra,u as A,j as e,H as j,c1 as Us,c2 as qs,F as X,s as D,c3 as Vs,r as d,bU as Q,I as M,ap as Js,c4 as Ye,f as ca,c5 as ma,e as da,c6 as ua,m as pa,S as ha,g as xa,bf as Gs,c7 as Ge}from"./main-
|
|
1
|
+
import{c0 as ra,u as A,j as e,H as j,c1 as Us,c2 as qs,F as X,s as D,c3 as Vs,r as d,bU as Q,I as M,ap as Js,c4 as Ye,f as ca,c5 as ma,e as da,c6 as ua,m as pa,S as ha,g as xa,bf as Gs,c7 as Ge}from"./main-D0r07JA_.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-DYBBrXTx.js";const ba=[{value:"",labelKey:"terminal:building.colorDefault"},{value:"#2a2a3a",labelKey:"terminal:building.colorDarkGray"},{value:"#3a2a2a",labelKey:"terminal:building.colorDarkRed"},{value:"#2a3a2a",labelKey:"terminal:building.colorDarkGreen"},{value:"#2a2a4a",labelKey:"terminal:building.colorDarkBlue"},{value:"#3a3a2a",labelKey:"terminal:building.colorDarkYellow"},{value:"#3a2a3a",labelKey:"terminal:building.colorDarkPurple"},{value:"#2a3a3a",labelKey:"terminal:building.colorDarkCyan"},{value:"#4a3a3a",labelKey:"terminal:building.colorWarmBrown"},{value:"#3a4a4a",labelKey:"terminal:building.colorCoolSteel"}];function ja(r){return ra.t(r)}function Je(r){if(r===0)return"0 B";const p=1024,u=["B","KB","MB","GB"],x=Math.floor(Math.log(r)/Math.log(p));return parseFloat((r/Math.pow(p,x)).toFixed(1))+" "+u[x]}function ga(r){const u=Date.now()-r,x=Math.floor(u/(1e3*60*60)),n=Math.floor(u%(1e3*60*60)/(1e3*60));return x>0?`${x}h ${n}m`:`${n}m`}const Ys={30:"#1a1a1a",31:"#e74c3c",32:"#2ecc71",33:"#f39c12",34:"#3498db",35:"#9b59b6",36:"#00bcd4",37:"#ecf0f1",90:"#7f8c8d",91:"#ff6b6b",92:"#4ade80",93:"#fbbf24",94:"#60a5fa",95:"#c084fc",96:"#22d3ee",97:"#ffffff"};function Ws(r){const p=[],u=/\x1B\[([0-9;]*)m/g;let x=0,n=null,y;for(;(y=u.exec(r))!==null;){if(y.index>x){const g=r.slice(x,y.index);n?p.push(e.jsx("span",{style:{color:n},children:g},p.length)):p.push(g)}const C=y[1].split(";").map(Number);for(const g of C)g===0||g===39?n=null:Ys[g]&&(n=Ys[g]);x=u.lastIndex}if(x<r.length){const C=r.slice(x);n?p.push(e.jsx("span",{style:{color:n},children:C},p.length)):p.push(C)}return p.length>0?p:[r]}function va({buildingName:r,onClose:p,onConfirm:u}){const{t:x}=A(["terminal","common"]);return e.jsx("div",{className:"modal-overlay visible",onClick:p,children:e.jsxs("div",{className:"modal confirm-modal",onClick:n=>n.stopPropagation(),children:[e.jsx("div",{className:"modal-header",children:x("terminal:building.deleteBuilding")}),e.jsxs("div",{className:"modal-body confirm-modal-body",children:[e.jsx("p",{children:x("terminal:building.deleteConfirm",{name:r})}),e.jsx("p",{className:"confirm-modal-note",children:x("terminal:building.deleteNote")})]}),e.jsxs("div",{className:"modal-footer",children:[e.jsx("button",{className:"btn btn-secondary",onClick:p,children:x("common:buttons.cancel")}),e.jsx("button",{className:"btn btn-danger",onClick:u,autoFocus:!0,children:x("common:buttons.delete")})]})]})})}function fa({usePM2:r,setUsePM2:p}){const{t:u}=A(["terminal"]);return e.jsxs("div",{className:"form-section pm2-toggle-section",children:[e.jsxs("label",{className:"toggle-switch",children:[e.jsx("input",{type:"checkbox",className:"toggle-input",checked:r,onChange:x=>p(x.target.checked)}),e.jsx("span",{className:"toggle-track",children:e.jsx("span",{className:"toggle-thumb"})}),e.jsxs("span",{className:"toggle-label",children:[e.jsx("span",{className:"pm2-badge",children:"PM2"}),u("terminal:building.usePM2")]})]}),e.jsx("div",{className:"form-hint",children:u("terminal:building.pm2Hint")})]})}function Na({usePM2:r,pm2Script:p,setPm2Script:u,pm2Args:x,setPm2Args:n,pm2Interpreter:y,setPm2Interpreter:C,pm2InterpreterArgs:g,setPm2InterpreterArgs:v,pm2Env:s,setPm2Env:h,isEditMode:a,building:t,handleCommand:c}){var f;const{t:l}=A(["terminal","common"]);return r?e.jsxs("div",{className:"form-section pm2-config-section",children:[e.jsx("label",{className:"form-label",children:l("terminal:building.pm2Configuration")}),e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:[l("terminal:building.pm2Script"),e.jsx(j,{text:l("terminal:building.helpPm2Script"),title:l("terminal:building.pm2Script"),position:"top",size:"sm"})]}),e.jsx("input",{type:"text",className:"form-input",value:p,onChange:b=>u(b.target.value),placeholder:"npm, java, python, ./app.js",required:r})]}),e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:[l("terminal:building.pm2Arguments"),e.jsx(j,{text:l("terminal:building.helpPm2Arguments"),title:l("terminal:building.pm2Arguments"),position:"top",size:"sm"})]}),e.jsx("input",{type:"text",className:"form-input",value:x,onChange:b=>n(b.target.value),placeholder:"run dev, -jar app.jar, app.py"})]}),e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:[l("terminal:building.pm2Interpreter"),e.jsx(j,{text:l("terminal:building.helpPm2Interpreter"),title:l("terminal:building.pm2Interpreter"),position:"top",size:"sm"})]}),e.jsx("select",{className:"form-input form-select",value:y,onChange:b=>C(b.target.value),children:Object.keys(Us).map(b=>e.jsx("option",{value:b,children:Us[b].label},b))})]}),e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:[l("terminal:building.pm2InterpArgs"),e.jsx(j,{text:l("terminal:building.helpPm2InterpArgs"),title:l("terminal:building.pm2InterpArgs"),position:"top",size:"sm"})]}),e.jsx("input",{type:"text",className:"form-input",value:g,onChange:b=>v(b.target.value),placeholder:"-jar (for Java)"})]}),e.jsxs("div",{className:"command-row env-row",children:[e.jsxs("span",{className:"command-label",children:[l("terminal:building.pm2Environment"),e.jsx(j,{text:l("terminal:building.helpPm2Environment"),title:l("terminal:building.pm2Environment"),position:"top",size:"sm"})]}),e.jsx("textarea",{className:"form-input form-textarea",value:s,onChange:b=>h(b.target.value),placeholder:`KEY=value
|
|
2
2
|
SERVER_PORT=7201
|
|
3
3
|
NODE_ENV=production`,rows:3})]}),e.jsx("div",{className:"pm2-examples",children:e.jsxs("details",{children:[e.jsx("summary",{children:l("terminal:building.pm2Examples")}),e.jsxs("div",{className:"pm2-examples-content",children:[e.jsxs("div",{className:"pm2-example",children:[e.jsx("strong",{children:"Node.js:"})," Script: ",e.jsx("code",{children:"npm"}),", Args: ",e.jsx("code",{children:"run dev"})]}),e.jsxs("div",{className:"pm2-example",children:[e.jsx("strong",{children:"Symfony:"})," Script: ",e.jsx("code",{children:"symfony"}),", Args: ",e.jsx("code",{children:"serve --no-daemon"}),", Interpreter: ",e.jsx("code",{children:"None"})]}),e.jsxs("div",{className:"pm2-example",children:[e.jsx("strong",{children:"Java JAR:"})," Script: ",e.jsx("code",{children:"app.jar"}),", Interpreter: ",e.jsx("code",{children:"Java"}),", Interp. Args: ",e.jsx("code",{children:"-jar"})]}),e.jsxs("div",{className:"pm2-example",children:[e.jsx("strong",{children:"Python:"})," Script: ",e.jsx("code",{children:"app.py"}),", Interpreter: ",e.jsx("code",{children:"Python 3"})]})]})]})}),a&&(t==null?void 0:t.pm2Status)&&e.jsx("div",{className:"pm2-status-display",children:e.jsxs("div",{className:"pm2-status-row",children:[e.jsxs("span",{className:"pm2-metric",children:[e.jsx("span",{className:"pm2-metric-label",children:"PID"}),e.jsx("span",{className:"pm2-metric-value",children:t.pm2Status.pid||"-"})]}),e.jsxs("span",{className:"pm2-metric",children:[e.jsx("span",{className:"pm2-metric-label",children:"CPU"}),e.jsxs("span",{className:"pm2-metric-value",children:[((f=t.pm2Status.cpu)==null?void 0:f.toFixed(1))||"0","%"]})]}),e.jsxs("span",{className:"pm2-metric",children:[e.jsx("span",{className:"pm2-metric-label",children:"MEM"}),e.jsx("span",{className:"pm2-metric-value",children:Je(t.pm2Status.memory||0)})]}),e.jsxs("span",{className:"pm2-metric",children:[e.jsx("span",{className:"pm2-metric-label",children:"Restarts"}),e.jsx("span",{className:"pm2-metric-value",children:t.pm2Status.restarts||0})]}),t.pm2Status.uptime&&e.jsxs("span",{className:"pm2-metric",children:[e.jsx("span",{className:"pm2-metric-label",children:"Uptime"}),e.jsx("span",{className:"pm2-metric-value",children:ga(t.pm2Status.uptime)})]})]})}),a&&e.jsxs("div",{className:"pm2-actions",children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-success",onClick:()=>c("start"),children:l("common:buttons.start")}),e.jsx("button",{type:"button",className:"btn btn-sm btn-danger",onClick:()=>c("stop"),children:l("common:buttons.stop")}),e.jsx("button",{type:"button",className:"btn btn-sm btn-warning",onClick:()=>c("restart"),children:l("terminal:buildingAction.restart")}),e.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>c("logs"),children:l("terminal:logs.title")})]})]}):null}function ka({dockerMode:r,setDockerMode:p,dockerImage:u,setDockerImage:x,dockerContainerName:n,setDockerContainerName:y,dockerCommand:C,setDockerCommand:g,dockerPorts:v,setDockerPorts:s,dockerVolumes:h,setDockerVolumes:a,dockerNetwork:t,setDockerNetwork:c,dockerRestart:l,setDockerRestart:f,dockerPull:b,setDockerPull:z,dockerEnv:T,setDockerEnv:B,dockerComposePath:$,setDockerComposePath:I,dockerComposeProject:K,setDockerComposeProject:R,dockerComposeServices:H,setDockerComposeServices:O,selectedExistingContainer:m,setSelectedExistingContainer:L,dockerContainersList:q,isEditMode:V,building:k,handleCommand:_}){const{t:F}=A(["config","common"]);return e.jsxs("div",{className:"form-section docker-config-section",children:[e.jsx("label",{className:"form-label",children:F("config:buildings.dockerConfig")}),e.jsxs("div",{className:"docker-mode-selector",children:[e.jsxs("label",{className:`docker-mode-option ${r==="container"?"active":""}`,children:[e.jsx("input",{type:"radio",name:"dockerMode",value:"container",checked:r==="container",onChange:()=>p("container")}),e.jsx("span",{className:"docker-mode-icon",children:"📦"}),e.jsx("span",{className:"docker-mode-label",children:"Container"}),e.jsx("span",{className:"docker-mode-desc",children:"Create a new container"})]}),e.jsxs("label",{className:`docker-mode-option ${r==="compose"?"active":""}`,children:[e.jsx("input",{type:"radio",name:"dockerMode",value:"compose",checked:r==="compose",onChange:()=>p("compose")}),e.jsx("span",{className:"docker-mode-icon",children:"🛠"}),e.jsx("span",{className:"docker-mode-label",children:"Compose"}),e.jsx("span",{className:"docker-mode-desc",children:"Manage multiple services"})]}),e.jsxs("label",{className:`docker-mode-option ${r==="existing"?"active":""}`,children:[e.jsx("input",{type:"radio",name:"dockerMode",value:"existing",checked:r==="existing",onChange:()=>p("existing")}),e.jsx("span",{className:"docker-mode-icon",children:"🔎"}),e.jsx("span",{className:"docker-mode-label",children:"Existing"}),e.jsx("span",{className:"docker-mode-desc",children:"Adopt existing container"})]})]}),r==="container"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:["Image:",e.jsx(j,{text:"Docker image to run, e.g., nginx:latest, redis:alpine, my-app:v1",title:"Image",position:"top",size:"sm"})]}),e.jsx("input",{type:"text",className:"form-input",value:u,onChange:o=>x(o.target.value),placeholder:"nginx:latest",required:!0})]}),e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:["Container Name:",e.jsx(j,{text:"Custom name for the container. If empty, auto-generated based on building name.",title:"Container Name",position:"top",size:"sm"})]}),e.jsx("input",{type:"text",className:"form-input",value:n,onChange:o=>y(o.target.value),placeholder:"Auto-generated (tc-{name}-{id})"})]}),e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:["Command:",e.jsx(j,{text:"Override the default container command. Leave empty to use image's CMD.",title:"Command Override",position:"top",size:"sm"})]}),e.jsx("input",{type:"text",className:"form-input",value:C,onChange:o=>g(o.target.value),placeholder:"Optional command override"})]}),e.jsxs("div",{className:"form-section docker-ports-section",children:[e.jsxs("label",{className:"form-label",children:["Port Mappings",e.jsx("button",{type:"button",className:"btn btn-sm btn-add",onClick:()=>s([...v,""]),children:"+ Add"})]}),v.map((o,S)=>e.jsxs("div",{className:"docker-mapping-row",children:[e.jsx("input",{type:"text",className:"form-input",value:o,onChange:U=>{const E=[...v];E[S]=U.target.value,s(E)},placeholder:"8080:80 or 3000"}),e.jsx("button",{type:"button",className:"btn btn-sm btn-danger",onClick:()=>s(v.filter((U,E)=>E!==S)),children:"x"})]},S)),v.length===0&&e.jsx("div",{className:"form-hint",children:"Format: host:container (e.g., 8080:80) or same port (e.g., 3000)"})]}),e.jsxs("div",{className:"form-section docker-volumes-section",children:[e.jsxs("label",{className:"form-label",children:["Volume Mounts",e.jsx("button",{type:"button",className:"btn btn-sm btn-add",onClick:()=>a([...h,""]),children:"+ Add"})]}),h.map((o,S)=>e.jsxs("div",{className:"docker-mapping-row",children:[e.jsx("input",{type:"text",className:"form-input",value:o,onChange:U=>{const E=[...h];E[S]=U.target.value,a(E)},placeholder:"./data:/app/data or /host/path:/container/path"}),e.jsx("button",{type:"button",className:"btn btn-sm btn-danger",onClick:()=>a(h.filter((U,E)=>E!==S)),children:"x"})]},S)),h.length===0&&e.jsx("div",{className:"form-hint",children:"Format: host_path:container_path (relative paths resolved from working directory)"})]}),e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:["Network:",e.jsx(j,{text:"Docker network to connect to. Leave empty for default bridge network.",title:"Network",position:"top",size:"sm"})]}),e.jsx("input",{type:"text",className:"form-input",value:t,onChange:o=>c(o.target.value),placeholder:"bridge (default)"})]}),e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:["Restart Policy:",e.jsx(j,{text:"When should Docker restart the container automatically?",title:"Restart Policy",position:"top",size:"sm"})]}),e.jsx("select",{className:"form-input form-select",value:l,onChange:o=>f(o.target.value),children:Object.keys(qs).map(o=>e.jsx("option",{value:o,children:qs[o].label},o))})]})]}),r==="compose"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:["Compose File:",e.jsx(j,{text:"Path to docker-compose.yml file, relative to working directory.",title:"Compose File",position:"top",size:"sm"})]}),e.jsx(X,{value:$,onChange:I,placeholder:"docker-compose.yml",className:"form-input",directoriesOnly:!1})]}),e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:["Project Name:",e.jsx(j,{text:"Override the compose project name. Leave empty for auto-generated name.",title:"Project Name",position:"top",size:"sm"})]}),e.jsx("input",{type:"text",className:"form-input",value:K,onChange:o=>R(o.target.value),placeholder:"Auto-generated"})]}),e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:["Services:",e.jsx(j,{text:"Specific services to manage (comma-separated). Leave empty for all services.",title:"Services",position:"top",size:"sm"})]}),e.jsx("input",{type:"text",className:"form-input",value:H,onChange:o=>O(o.target.value),placeholder:"All services (or: api, db, redis)"})]})]}),r==="existing"&&e.jsxs("div",{className:"docker-existing-section",children:[e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:["Select Container:",e.jsx(j,{text:"Choose an existing Docker container to monitor and control. The container will not be deleted when removing the building.",title:"Existing Container",position:"top",size:"sm"})]}),e.jsxs("div",{className:"docker-existing-select-wrapper",children:[e.jsxs("select",{className:"form-input form-select",value:m,onChange:o=>L(o.target.value),required:r==="existing",children:[e.jsx("option",{value:"",children:"Select a container..."}),q.map(o=>e.jsxs("option",{value:o.name,children:[o.name," (",o.image,") - ",o.state]},o.id))]}),e.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>D.requestDockerContainersList(),title:"Refresh container list",children:"↻"})]})]}),q.length===0&&e.jsx("div",{className:"form-hint docker-existing-hint",children:"No containers found. Make sure Docker is running and you have containers available."}),m&&e.jsx("div",{className:"docker-existing-info",children:(()=>{const o=q.find(S=>S.name===m);return o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"docker-existing-info-row",children:[e.jsx("span",{className:"docker-existing-info-label",children:"Image:"}),e.jsx("span",{className:"docker-existing-info-value",children:o.image})]}),e.jsxs("div",{className:"docker-existing-info-row",children:[e.jsx("span",{className:"docker-existing-info-label",children:"Status:"}),e.jsx("span",{className:`docker-existing-info-value docker-status-${o.status}`,children:o.state})]}),e.jsxs("div",{className:"docker-existing-info-row",children:[e.jsx("span",{className:"docker-existing-info-label",children:"ID:"}),e.jsx("span",{className:"docker-existing-info-value",children:o.id.slice(0,12)})]}),o.ports.length>0&&e.jsxs("div",{className:"docker-existing-info-row",children:[e.jsx("span",{className:"docker-existing-info-label",children:"Ports:"}),e.jsx("span",{className:"docker-existing-info-value",children:o.ports.map(S=>`${S.host}:${S.container}/${S.protocol}`).join(", ")})]})]}):null})()}),e.jsx("div",{className:"form-hint",children:"Note: Existing containers will not be deleted when you remove this building."})]}),r!=="existing"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"command-row",children:[e.jsxs("span",{className:"command-label",children:["Pull Policy:",e.jsx(j,{text:"When to pull images: always, only if missing, or never.",title:"Pull Policy",position:"top",size:"sm"})]}),e.jsx("select",{className:"form-input form-select",value:b,onChange:o=>z(o.target.value),children:Object.keys(Vs).map(o=>e.jsx("option",{value:o,children:Vs[o].label},o))})]}),e.jsxs("div",{className:"command-row env-row",children:[e.jsxs("span",{className:"command-label",children:["Environment:",e.jsx(j,{text:"Environment variables in KEY=value format, one per line.",title:"Environment Variables",position:"top",size:"sm"})]}),e.jsx("textarea",{className:"form-input form-textarea",value:T,onChange:o=>B(o.target.value),placeholder:`KEY=value
|
|
4
4
|
DATABASE_URL=postgres://...
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as dt,d as ft,E as us,a1 as hs,f as ds,bm as fs,c8 as ms,ah as gs,r as l,z as ps,S as Fe,c9 as it,ca as ys,cb as As,cc as xs,az as Es,cd as we,s as X,ce as Ms,j as c,I as O,W as Rt,cf as Lt,t as Dt,cg as Cs,ch as kt,ci as at,V as ct,m as Ss,ay as Wt,u as st,cj as Ft,aJ as _s,ck as $t,cl as Is,cm as vs,cn as Ns,co as bs,cp as js,cq as ws,cr as Ts}from"./main-Bt4E0_YW.js";import{cs as er,ct as tr,cu as sr,cv as nr,cw as rr}from"./main-Bt4E0_YW.js";import{s as Rs,S as Ls}from"./settingsSearch-DYr4vFyy.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-DYBBrXTx.js";function fe(t){return Array.isArray?Array.isArray(t):Vt(t)==="[object Array]"}function Ds(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ks(t){return t==null?"":Ds(t)}function ue(t){return typeof t=="string"}function Yt(t){return typeof t=="number"}function Fs(t){return t===!0||t===!1||$s(t)&&Vt(t)=="[object Boolean]"}function qt(t){return typeof t=="object"}function $s(t){return qt(t)&&t!==null}function ne(t){return t!=null}function lt(t){return!t.trim().length}function Vt(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Bs="Incorrect 'index' type",Ps=t=>`Invalid value for key ${t}`,Qs=t=>`Pattern length exceeds max of ${t}.`,zs=t=>`Missing ${t} property in key`,Ks=t=>`Property 'weight' in key '${t}' must be a positive integer`,Bt=Object.prototype.hasOwnProperty;class Os{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{let o=Xt(r);this._keys.push(o),this._keyMap[o.id]=o,n+=o.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Xt(t){let e=null,n=null,r=null,o=1,a=null;if(ue(t)||fe(t))r=t,e=Pt(t),n=mt(t);else{if(!Bt.call(t,"name"))throw new Error(zs("name"));const u=t.name;if(r=u,Bt.call(t,"weight")&&(o=t.weight,o<=0))throw new Error(Ks(u));e=Pt(u),n=mt(u),a=t.getFn}return{path:e,id:n,weight:o,src:r,getFn:a}}function Pt(t){return fe(t)?t:t.split(".")}function mt(t){return fe(t)?t.join("."):t}function Gs(t,e){let n=[],r=!1;const o=(a,u,d)=>{if(ne(a))if(!u[d])n.push(a);else{let h=u[d];const f=a[h];if(!ne(f))return;if(d===u.length-1&&(ue(f)||Yt(f)||Fs(f)))n.push(ks(f));else if(fe(f)){r=!0;for(let m=0,x=f.length;m<x;m+=1)o(f[m],u,d+1)}else u.length&&o(f,u,d+1)}};return o(t,ue(e)?e.split("."):e,0),r?n:n[0]}const Us={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Hs={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},Ws={location:0,threshold:.6,distance:100},Ys={useExtendedSearch:!1,getFn:Gs,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var C={...Hs,...Us,...Ws,...Ys};const qs=/[^ ]+/g;function Vs(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(o){const a=o.match(qs).length;if(n.has(a))return n.get(a);const u=1/Math.pow(a,.5*t),d=parseFloat(Math.round(u*r)/r);return n.set(a,d),d},clear(){n.clear()}}}class Et{constructor({getFn:e=C.getFn,fieldNormWeight:n=C.fieldNormWeight}={}){this.norm=Vs(n,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ue(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();ue(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!ne(e)||lt(e))return;let r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){let r={i:n,$:{}};this.keys.forEach((o,a)=>{let u=o.getFn?o.getFn(e):this.getFn(e,o.path);if(ne(u)){if(fe(u)){let d=[];const h=[{nestedArrIndex:-1,value:u}];for(;h.length;){const{nestedArrIndex:f,value:m}=h.pop();if(ne(m))if(ue(m)&&!lt(m)){let x={v:m,i:f,n:this.norm.get(m)};d.push(x)}else fe(m)&&m.forEach((x,y)=>{h.push({nestedArrIndex:y,value:x})})}r.$[a]=d}else if(ue(u)&&!lt(u)){let d={v:u,n:this.norm.get(u)};r.$[a]=d}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function Jt(t,e,{getFn:n=C.getFn,fieldNormWeight:r=C.fieldNormWeight}={}){const o=new Et({getFn:n,fieldNormWeight:r});return o.setKeys(t.map(Xt)),o.setSources(e),o.create(),o}function Xs(t,{getFn:e=C.getFn,fieldNormWeight:n=C.fieldNormWeight}={}){const{keys:r,records:o}=t,a=new Et({getFn:e,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(o),a}function Je(t,{errors:e=0,currentLocation:n=0,expectedLocation:r=0,distance:o=C.distance,ignoreLocation:a=C.ignoreLocation}={}){const u=e/t.length;if(a)return u;const d=Math.abs(r-n);return o?u+d/o:d?1:u}function Js(t=[],e=C.minMatchCharLength){let n=[],r=-1,o=-1,a=0;for(let u=t.length;a<u;a+=1){let d=t[a];d&&r===-1?r=a:!d&&r!==-1&&(o=a-1,o-r+1>=e&&n.push([r,o]),r=-1)}return t[a-1]&&a-r>=e&&n.push([r,a-1]),n}const _e=32;function Zs(t,e,n,{location:r=C.location,distance:o=C.distance,threshold:a=C.threshold,findAllMatches:u=C.findAllMatches,minMatchCharLength:d=C.minMatchCharLength,includeMatches:h=C.includeMatches,ignoreLocation:f=C.ignoreLocation}={}){if(e.length>_e)throw new Error(Qs(_e));const m=e.length,x=t.length,y=Math.max(0,Math.min(r,x));let E=a,A=y;const M=d>1||h,N=M?Array(x):[];let D;for(;(D=t.indexOf(e,A))>-1;){let U=Je(e,{currentLocation:D,expectedLocation:y,distance:o,ignoreLocation:f});if(E=Math.min(U,E),A=D+m,M){let Y=0;for(;Y<m;)N[D+Y]=1,Y+=1}}A=-1;let b=[],L=1,G=m+x;const ce=1<<m-1;for(let U=0;U<m;U+=1){let Y=0,J=G;for(;Y<J;)Je(e,{errors:U,currentLocation:y+J,expectedLocation:y,distance:o,ignoreLocation:f})<=E?Y=J:G=J,J=Math.floor((G-Y)/2+Y);G=J;let oe=Math.max(1,y-J+1),le=u?x:Math.min(y+J,x)+m,Q=Array(le+2);Q[le+1]=(1<<U)-1;for(let q=le;q>=oe;q-=1){let V=q-1,ee=n[t.charAt(V)];if(M&&(N[V]=+!!ee),Q[q]=(Q[q+1]<<1|1)&ee,U&&(Q[q]|=(b[q+1]|b[q])<<1|1|b[q+1]),Q[q]&ce&&(L=Je(e,{errors:U,currentLocation:V,expectedLocation:y,distance:o,ignoreLocation:f}),L<=E)){if(E=L,A=V,A<=y)break;oe=Math.max(1,2*y-A)}}if(Je(e,{errors:U+1,currentLocation:y,expectedLocation:y,distance:o,ignoreLocation:f})>E)break;b=Q}const me={isMatch:A>=0,score:Math.max(.001,L)};if(M){const U=Js(N,d);U.length?h&&(me.indices=U):me.isMatch=!1}return me}function en(t){let e={};for(let n=0,r=t.length;n<r;n+=1){const o=t.charAt(n);e[o]=(e[o]||0)|1<<r-n-1}return e}const et=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t);class Zt{constructor(e,{location:n=C.location,threshold:r=C.threshold,distance:o=C.distance,includeMatches:a=C.includeMatches,findAllMatches:u=C.findAllMatches,minMatchCharLength:d=C.minMatchCharLength,isCaseSensitive:h=C.isCaseSensitive,ignoreDiacritics:f=C.ignoreDiacritics,ignoreLocation:m=C.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:o,includeMatches:a,findAllMatches:u,minMatchCharLength:d,isCaseSensitive:h,ignoreDiacritics:f,ignoreLocation:m},e=h?e:e.toLowerCase(),e=f?et(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const x=(E,A)=>{this.chunks.push({pattern:E,alphabet:en(E),startIndex:A})},y=this.pattern.length;if(y>_e){let E=0;const A=y%_e,M=y-A;for(;E<M;)x(this.pattern.substr(E,_e),E),E+=_e;if(A){const N=y-_e;x(this.pattern.substr(N),N)}}else x(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:o}=this.options;if(e=n?e:e.toLowerCase(),e=r?et(e):e,this.pattern===e){let M={isMatch:!0,score:0};return o&&(M.indices=[[0,e.length-1]]),M}const{location:a,distance:u,threshold:d,findAllMatches:h,minMatchCharLength:f,ignoreLocation:m}=this.options;let x=[],y=0,E=!1;this.chunks.forEach(({pattern:M,alphabet:N,startIndex:D})=>{const{isMatch:b,score:L,indices:G}=Zs(e,M,N,{location:a+D,distance:u,threshold:d,findAllMatches:h,minMatchCharLength:f,includeMatches:o,ignoreLocation:m});b&&(E=!0),y+=L,b&&G&&(x=[...x,...G])});let A={isMatch:E,score:E?y/this.chunks.length:1};return E&&o&&(A.indices=x),A}}class Ae{constructor(e){this.pattern=e}static isMultiMatch(e){return Qt(e,this.multiRegex)}static isSingleMatch(e){return Qt(e,this.singleRegex)}search(){}}function Qt(t,e){const n=t.match(e);return n?n[1]:null}class tn extends Ae{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class sn extends Ae{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class nn extends Ae{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class rn extends Ae{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class on extends Ae{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class an extends Ae{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class es extends Ae{constructor(e,{location:n=C.location,threshold:r=C.threshold,distance:o=C.distance,includeMatches:a=C.includeMatches,findAllMatches:u=C.findAllMatches,minMatchCharLength:d=C.minMatchCharLength,isCaseSensitive:h=C.isCaseSensitive,ignoreDiacritics:f=C.ignoreDiacritics,ignoreLocation:m=C.ignoreLocation}={}){super(e),this._bitapSearch=new Zt(e,{location:n,threshold:r,distance:o,includeMatches:a,findAllMatches:u,minMatchCharLength:d,isCaseSensitive:h,ignoreDiacritics:f,ignoreLocation:m})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class ts extends Ae{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const o=[],a=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+a,o.push([r,n-1]);const u=!!o.length;return{isMatch:u,score:u?0:1,indices:o}}}const gt=[tn,ts,nn,rn,an,on,sn,es],zt=gt.length,cn=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,ln="|";function un(t,e={}){return t.split(ln).map(n=>{let r=n.trim().split(cn).filter(a=>a&&!!a.trim()),o=[];for(let a=0,u=r.length;a<u;a+=1){const d=r[a];let h=!1,f=-1;for(;!h&&++f<zt;){const m=gt[f];let x=m.isMultiMatch(d);x&&(o.push(new m(x,e)),h=!0)}if(!h)for(f=-1;++f<zt;){const m=gt[f];let x=m.isSingleMatch(d);if(x){o.push(new m(x,e));break}}}return o})}const hn=new Set([es.type,ts.type]);class dn{constructor(e,{isCaseSensitive:n=C.isCaseSensitive,ignoreDiacritics:r=C.ignoreDiacritics,includeMatches:o=C.includeMatches,minMatchCharLength:a=C.minMatchCharLength,ignoreLocation:u=C.ignoreLocation,findAllMatches:d=C.findAllMatches,location:h=C.location,threshold:f=C.threshold,distance:m=C.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:o,minMatchCharLength:a,findAllMatches:d,ignoreLocation:u,location:h,threshold:f,distance:m},e=n?e:e.toLowerCase(),e=r?et(e):e,this.pattern=e,this.query=un(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:o,ignoreDiacritics:a}=this.options;e=o?e:e.toLowerCase(),e=a?et(e):e;let u=0,d=[],h=0;for(let f=0,m=n.length;f<m;f+=1){const x=n[f];d.length=0,u=0;for(let y=0,E=x.length;y<E;y+=1){const A=x[y],{isMatch:M,indices:N,score:D}=A.search(e);if(M){if(u+=1,h+=D,r){const b=A.constructor.type;hn.has(b)?d=[...d,...N]:d.push(N)}}else{h=0,u=0,d.length=0;break}}if(u){let y={isMatch:!0,score:h/u};return r&&(y.indices=d),y}}return{isMatch:!1,score:1}}}const pt=[];function fn(...t){pt.push(...t)}function yt(t,e){for(let n=0,r=pt.length;n<r;n+=1){let o=pt[n];if(o.condition(t,e))return new o(t,e)}return new Zt(t,e)}const tt={AND:"$and",OR:"$or"},At={PATH:"$path",PATTERN:"$val"},xt=t=>!!(t[tt.AND]||t[tt.OR]),mn=t=>!!t[At.PATH],gn=t=>!fe(t)&&qt(t)&&!xt(t),Kt=t=>({[tt.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function ss(t,e,{auto:n=!0}={}){const r=o=>{let a=Object.keys(o);const u=mn(o);if(!u&&a.length>1&&!xt(o))return r(Kt(o));if(gn(o)){const h=u?o[At.PATH]:a[0],f=u?o[At.PATTERN]:o[h];if(!ue(f))throw new Error(Ps(h));const m={keyId:mt(h),pattern:f};return n&&(m.searcher=yt(f,e)),m}let d={children:[],operator:a[0]};return a.forEach(h=>{const f=o[h];fe(f)&&f.forEach(m=>{d.children.push(r(m))})}),d};return xt(t)||(t=Kt(t)),r(t)}function pn(t,{ignoreFieldNorm:e=C.ignoreFieldNorm}){t.forEach(n=>{let r=1;n.matches.forEach(({key:o,norm:a,score:u})=>{const d=o?o.weight:null;r*=Math.pow(u===0&&d?Number.EPSILON:u,(d||1)*(e?1:a))}),n.score=r})}function yn(t,e){const n=t.matches;e.matches=[],ne(n)&&n.forEach(r=>{if(!ne(r.indices)||!r.indices.length)return;const{indices:o,value:a}=r;let u={indices:o,value:a};r.key&&(u.key=r.key.src),r.idx>-1&&(u.refIndex=r.idx),e.matches.push(u)})}function An(t,e){e.score=t.score}function xn(t,e,{includeMatches:n=C.includeMatches,includeScore:r=C.includeScore}={}){const o=[];return n&&o.push(yn),r&&o.push(An),t.map(a=>{const{idx:u}=a,d={item:e[u],refIndex:u};return o.length&&o.forEach(h=>{h(a,d)}),d})}class de{constructor(e,n={},r){this.options={...C,...n},this.options.useExtendedSearch,this._keyStore=new Os(this.options.keys),this.setCollection(e,r)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Et))throw new Error(Bs);this._myIndex=n||Jt(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){ne(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let r=0,o=this._docs.length;r<o;r+=1){const a=this._docs[r];e(a,r)&&(this.removeAt(r),r-=1,o-=1,n.push(a))}return n}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:n=-1}={}){const{includeMatches:r,includeScore:o,shouldSort:a,sortFn:u,ignoreFieldNorm:d}=this.options;let h=ue(e)?ue(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return pn(h,{ignoreFieldNorm:d}),a&&h.sort(u),Yt(n)&&n>-1&&(h=h.slice(0,n)),xn(h,this._docs,{includeMatches:r,includeScore:o})}_searchStringList(e){const n=yt(e,this.options),{records:r}=this._myIndex,o=[];return r.forEach(({v:a,i:u,n:d})=>{if(!ne(a))return;const{isMatch:h,score:f,indices:m}=n.searchIn(a);h&&o.push({item:a,idx:u,matches:[{score:f,value:a,norm:d,indices:m}]})}),o}_searchLogical(e){const n=ss(e,this.options),r=(d,h,f)=>{if(!d.children){const{keyId:x,searcher:y}=d,E=this._findMatches({key:this._keyStore.get(x),value:this._myIndex.getValueForItemAtKeyId(h,x),searcher:y});return E&&E.length?[{idx:f,item:h,matches:E}]:[]}const m=[];for(let x=0,y=d.children.length;x<y;x+=1){const E=d.children[x],A=r(E,h,f);if(A.length)m.push(...A);else if(d.operator===tt.AND)return[]}return m},o=this._myIndex.records,a={},u=[];return o.forEach(({$:d,i:h})=>{if(ne(d)){let f=r(n,d,h);f.length&&(a[h]||(a[h]={idx:h,item:d,matches:[]},u.push(a[h])),f.forEach(({matches:m})=>{a[h].matches.push(...m)}))}}),u}_searchObjectList(e){const n=yt(e,this.options),{keys:r,records:o}=this._myIndex,a=[];return o.forEach(({$:u,i:d})=>{if(!ne(u))return;let h=[];r.forEach((f,m)=>{h.push(...this._findMatches({key:f,value:u[m],searcher:n}))}),h.length&&a.push({idx:d,item:u,matches:h})}),a}_findMatches({key:e,value:n,searcher:r}){if(!ne(n))return[];let o=[];if(fe(n))n.forEach(({v:a,i:u,n:d})=>{if(!ne(a))return;const{isMatch:h,score:f,indices:m}=r.searchIn(a);h&&o.push({score:f,key:e,value:a,idx:u,norm:d,indices:m})});else{const{v:a,n:u}=n,{isMatch:d,score:h,indices:f}=r.searchIn(a);d&&o.push({score:h,key:e,value:a,norm:u,indices:f})}return o}}de.version="7.1.0";de.createIndex=Jt;de.parseIndex=Xs;de.config=C;de.parseQuery=ss;fn(dn);function ke(t){return t.trim().toLowerCase().split(/\s+/).filter(Boolean)}function En(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ze(t,e){const n=e.trim(),r=ke(n);if(r.length<=1)return t.search(n);const[o,...a]=r.map(h=>t.search(h)),u=a.map(h=>{const f=new Map;for(const m of h)f.set(m.refIndex,m.score??1);return f}),d=[];for(const h of o){let f=h.score??1,m=!0;for(const x of u){const y=x.get(h.refIndex);if(y===void 0){m=!1;break}f+=y}m&&d.push({item:h.item,score:f/r.length})}return d.sort((h,f)=>(h.score??1)-(f.score??1)),d}function Ot(t,e,n){return e===t?6:e.startsWith(t)?5:e.split(/[^a-z0-9]+/i).includes(t)?4:e.includes(t)?3:n.includes(t)?2:1}function Mn(t,e,n){const r=ke(t);if(r.length===0)return 1;const o=e.toLowerCase(),a=n.toLowerCase(),u=Ot(r.join(" "),o,a);if(r.length===1)return u;let d=6;for(const h of r)d=Math.min(d,Ot(h,o,a));return Math.max(u,d)}const Cn=4;function Gt(t){return t.replace(/…|\.\.\./g," ").replace(/\s+/g," ").trim().toLowerCase()}const Sn=24;function _n(t,e){const n=Gt(t),r=Gt(e);return n===r?!0:Math.min(n.length,r.length)<Sn?!1:n.includes(r)||r.includes(n)}function In(t,e){const n=[],r=o=>{!o||!o.text.trim()||n.length>=Cn||n.some(a=>_n(a.text,o.text))||n.push(o)};t&&r({text:t,kind:"user"});for(const o of e??[])r(o);return n.length>0?n:void 0}async function vn(t){const e=new URLSearchParams({q:t}),n=await dt(ft(`/api/folders/search?${e.toString()}`));if(!n.ok){const o=await n.json().catch(()=>({}));throw new Error(o.error||`Failed to search folders: ${n.statusText}`)}const r=await n.json();return Array.isArray(r.folders)?r.folders:[]}const Ut=["agent","session","building","setting","file","file-content","folder","area"],Nn=2,bn=2,jn=50,wn=10,Tn=3,Rn=30,Ln=8,Dn=8,kn=3,Fn=15,ut=5,ht=5;function $n(){const t=Wt(Fe.SPOTLIGHT_TAB,"all");return we.includes(t)?t:"all"}function Ht(){return Ss(Fe.SPOTLIGHT_QUERY,"")}function Bn(){const t=Wt(Fe.AOP_CONFIG,{});return t.sortMode==="name"||t.sortMode==="status"||t.sortMode==="recent"?t.sortMode:"recent"}function Pn({isOpen:t,onClose:e,onOpenSpawnModal:n,onOpenCommanderView:r,onOpenToolbox:o,onOpenFileExplorer:a,onOpenPM2LogsModal:u,onOpenBossLogsModal:d,onOpenDatabasePanel:h,onOpenMonitoringModal:f,onOpenSessionFinder:m,onOpenFileDetail:x}){const y=us(),E=hs(),A=ds(),M=fs(),N=ms(),D=gs(),b=l.useRef(e);b.current=e;const L=l.useRef(n);L.current=n;const G=l.useRef(r);G.current=r;const ce=l.useRef(o);ce.current=o;const me=l.useRef(a);me.current=a;const U=l.useRef(u);U.current=u;const Y=l.useRef(d);Y.current=d;const J=l.useRef(h);J.current=h;const oe=l.useRef(f);oe.current=f;const le=l.useRef(m);le.current=m;const Q=l.useRef(x);Q.current=x;const[R,q]=l.useState(Ht),[V,ee]=l.useState(0),[ie,$e]=l.useState($n),[Be,ge]=l.useState([]),[Pe,pe]=l.useState([]),[Qe,te]=l.useState([]),[se,ye]=l.useState(!1),[Ie,xe]=l.useState(!1),[ze,ve]=l.useState(!1),[Ke,v]=l.useState(!1),[S,k]=l.useState({query:"",rows:[]}),[Ne,Te]=l.useState(!1),[Ee,Mt]=l.useState(!1);l.useEffect(()=>{Te(!1),Mt(!1)},[R,t]);const ns=l.useCallback(s=>{q(s),ps(Fe.SPOTLIGHT_QUERY,s)},[]);l.useEffect(()=>{t&&(q(Ht()),ee(0))},[t]),l.useEffect(()=>{if(!t){ge([]),ye(!1);return}const s=R.trim();if(s.length<Nn){ge([]),ye(!1);return}ge([]),ye(!0);let i=!1;const g=setTimeout(()=>{vn(s).then(I=>{i||ge(I)}).catch(()=>{i||ge([])}).finally(()=>{i||ye(!1)})},250);return()=>{i=!0,clearTimeout(g)}},[t,R]);const Ct=(M.fileSearchExcludeDirs??it).join(",");l.useEffect(()=>{if(!t){pe([]),xe(!1);return}const s=R.trim();if(s.length<bn){pe([]),xe(!1);return}pe([]),xe(!0);let i=!1;const g=setTimeout(()=>{ys(s,{exclude:M.fileSearchExcludeDirs??[...it],limit:jn}).then(I=>{i||pe(I)}).catch(()=>{i||pe([])}).finally(()=>{i||xe(!1)})},250);return()=>{i=!0,clearTimeout(g)}},[t,R,Ct,M.fileSearchExcludeDirs]),l.useEffect(()=>{if(!t){te([]),ve(!1);return}const s=R.trim();if(s.length<Tn){te([]),ve(!1);return}te([]),ve(!0);const i=new AbortController,g=setTimeout(()=>{As(s,{exclude:M.fileSearchExcludeDirs??[...it],limit:Rn,signal:i.signal}).then(I=>{i.signal.aborted||te(I)}).catch(()=>{i.signal.aborted||te([])}).finally(()=>{i.signal.aborted||ve(!1)})},300);return()=>{clearTimeout(g),i.abort()}},[t,R,Ct,M.fileSearchExcludeDirs]),l.useEffect(()=>{if(!t){k({query:"",rows:[]}),v(!1);return}const s=R.trim();if(s.length<kn){k({query:"",rows:[]}),v(!1);return}k({query:"",rows:[]}),v(!0);let i=!1;const g=setTimeout(()=>{xs(s,{limit:Fn}).then(I=>{i||k({query:s,rows:I})}).catch(()=>{i||k({query:"",rows:[]})}).finally(()=>{i||v(!1)})},250);return()=>{i=!0,clearTimeout(g)}},[t,R]);const nt=l.useCallback(s=>{$e(s),Es(Fe.SPOTLIGHT_TAB,s)},[]),St=l.useRef(ie);St.current=ie;const rs=l.useCallback(s=>{const i=we.indexOf(St.current),g=we[(i+s+we.length)%we.length];nt(g)},[nt]);l.useEffect(()=>{ee(0)},[ie]);const rt=X.getShortcuts(),Oe=l.useMemo(()=>t?Ms():{},[t]),Ge=l.useMemo(()=>{if(!t)return[];const s=window.matchMedia("(pointer: coarse)").matches,i=rt.find(I=>I.id==="spawn-agent"),g=rt.find(I=>I.id==="toggle-commander");return[{id:"cmd-spawn",type:"command",title:"Spawn New Agent",subtitle:s?"":i?Rt(i):"Alt+N",icon:c.jsx(O,{name:"plus",size:16}),action:()=>{b.current(),L.current()}},{id:"cmd-commander",type:"command",title:"Commander View",subtitle:s?"":g!=null&&g.key?Rt(g):"Tab",icon:c.jsx(O,{name:"dashboard",size:16}),action:()=>{b.current(),G.current()}},{id:"cmd-settings",type:"command",title:"Settings & Tools",subtitle:"Configure Tide Commander",icon:c.jsx(O,{name:"gear",size:16}),action:()=>{b.current(),ce.current()}},{id:"cmd-monitoring",type:"command",title:"Monitoring & Logs",subtitle:"Triggers, workflows, events",icon:c.jsx(O,{name:"chart-line",size:16}),action:()=>{var I;b.current(),(I=oe.current)==null||I.call(oe)}}]},[t,rt]),Ue=l.useMemo(()=>{if(!t)return[];const s=R.trim();return(s?Rs(s):Ls).map(g=>({id:`setting-${g.id}`,type:"setting",title:g.title,subtitle:s?`Settings section • ${s}`:"Settings section",icon:c.jsx(O,{name:"gear",size:16}),_searchText:`${g.title} ${g.keywords.join(" ")}`,action:()=>{b.current(),ce.current(s||g.title)}}))},[t,R]),He=l.useMemo(()=>{const s=new Map;if(!t)return s;const i=Array.from(E.values());for(const g of y.values())for(const I of i)if(X.isPositionInArea({x:g.position.x,z:g.position.z},I)){s.set(g.id,I);break}return s},[t,y,E]),be=l.useMemo(()=>t?Array.from(y.values()).map(s=>{const i=[];s.lastAssignedTask&&i.push(s.lastAssignedTask);const g=`${s.class} • ${s.cwd}`,I=He.get(s.id),B=(I==null?void 0:I.name)||"";let T=`${s.name} ${s.class} ${s.status} ${s.cwd}`;s.taskLabel&&(T+=` ${s.taskLabel}`),B&&(T+=` ${B}`),i.length>0&&(T+=` ${i.join(" ")}`);const K=Date.now()-s.lastActivity;let $;return s.lastAssignedTask&&(s.lastAssignedTask.length>150?$=s.lastAssignedTask.slice(0,150)+"...":$=s.lastAssignedTask),{id:`agent-${s.id}`,type:"agent",title:s.name,subtitle:g,lastUserInput:$,timeAway:K,icon:c.jsx(Dt,{agent:s,size:20}),_searchText:T,_userQueries:i,_agentId:s.id,_lastActivity:s.lastActivity,_taskLabel:s.taskLabel,_status:s.status,_provider:s.provider??"claude",_piModel:s.piModel,_piModelProvider:s.piModelProvider,_areaName:B||void 0,_areaColor:I==null?void 0:I.color,action:()=>{b.current(),Lt(s.id),X.selectAgent(s.id),X.getState().viewMode!=="flat"&&X.requestTerminalExpand()}}}):[],[t,y,He]),We=l.useMemo(()=>t?Array.from(E.values()).map(s=>{var i;return{id:`area-${s.id}`,type:"area",title:s.name,subtitle:`${s.assignedAgentIds.length} agents • ${((i=s.directories)==null?void 0:i.length)||0} folders`,icon:c.jsx(O,{name:"map",size:16}),action:()=>{b.current(),X.selectArea(s.id)}}}):[],[t,E]),Ye=l.useMemo(()=>{const s=new Map;for(const i of be)i._agentId&&s.set(i._agentId,i);return s},[be]),_t=l.useMemo(()=>{const s=new Map;if(!t)return s;for(const i of y.values()){const g=He.get(i.id);if(!g||g.archived)continue;const I=s.get(g.id);I?I.push(i):s.set(g.id,[i])}return s},[t,y,He]),It=l.useMemo(()=>{const s=new Map;for(const i of N)s.has(i.agentId)||s.set(i.agentId,i.timestamp);return s},[N]),ot=l.useMemo(()=>{if(!t)return[];const s=R.trim().toLowerCase(),i=ke(s),g=Cs({sortMode:Bn(),agentsWithUnseenOutput:D,getLatestToolTimestamp:T=>It.get(T)}),I=Array.from(E.values()).filter(T=>!T.archived).filter(T=>{if(i.length===0)return!0;const K=T.name.toLowerCase();return i.some($=>K.includes($))}).sort((T,K)=>T.name.localeCompare(K.name,void 0,{sensitivity:"base"})),B=[];for(const T of I){const K=T.name.toLowerCase(),$=i.filter(W=>!K.includes(W));let H=(_t.get(T.id)||[]).slice().sort(g).map(W=>Ye.get(W.id)).filter(W=>!!W);$.length>0&&(H=H.filter(W=>{const z=`${W.title} ${W.subtitle||""} ${W._searchText||""}`.toLowerCase();return $.every(F=>z.includes(F))}),H.length===0)||!s&&H.length===0||B.push({areaId:T.id,areaName:T.name,areaColor:T.color,agents:H})}return B},[t,R,E,_t,Ye,D,It]),qe=l.useMemo(()=>t?Array.from(A.values()).filter(s=>s.type==="server"||s.type==="boss"||s.type==="database"||s.type==="tests").map(s=>{var $,re,H,W,z;const i=s.status==="running"?"#4ade80":s.status==="stopped"?"#f87171":"#facc15",g=s.type==="boss"?"crown":s.type==="database"?"database":s.type==="tests"?"flask":"desktop",I=s.type==="boss"?"Boss":s.type==="database"?"Database":s.type==="tests"?"Tests":"Server";let B=`${I} • ${s.status}`;if(s.type==="database"&&((re=($=s.database)==null?void 0:$.connections)!=null&&re.length)){const F=s.database.connections[0];B+=` • ${F.engine} @ ${F.host}`}else s.type==="tests"&&s.folderPath?B=`${I} • ${s.folderPath}`:s.cwd&&(B+=` • ${s.cwd}`);const T=((H=s.pm2Status)==null?void 0:H.ports)||[];let K=`${s.name} ${s.type} ${s.status} ${s.cwd||""} ${((W=s.pm2)==null?void 0:W.name)||""}`;if(s.type==="tests"&&(K+=` ${s.folderPath||""} tests junit maven`),T.length>0&&(K+=` ${T.join(" ")}`),s.type==="database"&&((z=s.database)!=null&&z.connections))for(const F of s.database.connections)K+=` ${F.name} ${F.engine} ${F.host} ${F.database||""} mysql postgresql sql`;return{id:`building-${s.id}`,type:"building",title:s.name,subtitle:B,_ports:T,icon:c.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[c.jsx(O,{name:"status-pending",size:10,weight:"fill",color:i}),c.jsx(O,{name:g,size:16})]}),_searchText:K,action:()=>{var F;b.current(),s.type==="boss"?Y.current(s.id):s.type==="database"?J.current(s.id):s.type==="tests"?X.openTestsBuilding(s.id):s.type==="http"?X.openHttpBuilding(s.id):(F=s.pm2)!=null&&F.enabled&&U.current(s.id)}}}):[],[t,A]),vt=l.useMemo(()=>t?Be.map(s=>{const i=s.isGitRepo&&s.gitBranch?`${s.path} • ${s.gitBranch}`:s.path;return{id:`folder-${s.path}`,type:"folder",title:s.name,subtitle:i,matchedText:s.path,icon:c.jsx(O,{name:s.isGitRepo?"git-branch":"folder",size:16}),_searchText:`${s.name} ${s.path}`,_isGitRepo:s.isGitRepo,_gitBranch:s.gitBranch,action:()=>{b.current(),X.openFileExplorer(s.path)}}}):[],[t,Be]),Ve=l.useMemo(()=>t?Pe.map(s=>{const i=s.areaName&&s.areaName!==s.projectName?`${s.projectName} · ${s.areaName}`:s.projectName;return{id:`file-${s.path}`,type:"file",title:s.name,subtitle:s.relativePath,matchedText:`${s.path} ${i}`,icon:kt(s.path),_searchText:`${s.name} ${s.relativePath} ${s.path} ${s.projectName} ${s.areaName}`,_projectName:s.projectName,_areaName:s.areaName,action:()=>{b.current(),Q.current({filePath:s.path,projectRoot:s.projectRoot,searchQuery:R.trim()})}}}):[],[t,Pe,R]),Xe=l.useMemo(()=>t?Qe.map(s=>{const i=s.matches[0],g=s.areaName&&s.areaName!==s.projectName?`${s.projectName} · ${s.areaName}`:s.projectName;return{id:`file-content-${s.path}`,type:"file-content",title:s.name,subtitle:`${s.relativePath}${i!=null&&i.line?`:${i.line}`:""}`,matchedQuery:i==null?void 0:i.content,matchedText:`${s.path} ${g}`,icon:kt(s.path),_projectName:s.projectName,_areaName:s.areaName,_lineNumber:i==null?void 0:i.line,action:()=>{b.current(),Q.current({filePath:s.path,projectRoot:s.projectRoot,targetLine:i==null?void 0:i.line,searchQuery:R.trim()})}}}):[],[t,Qe,R]),Me=l.useMemo(()=>{if(!t)return[];const s=i=>{const g=Date.now()-new Date(i).getTime();return!Number.isFinite(g)||g<0?"":g<36e5?`${Math.max(1,Math.floor(g/6e4))}m`:g<864e5?`${Math.floor(g/36e5)}h`:`${Math.floor(g/864e5)}d`};return S.rows.map(i=>{var W;const g=Array.from(y.values()).find(z=>z.sessionId===i.sessionId),I=g??(i.agentId?y.get(i.agentId):void 0),B=(i.firstPrompt||i.snippet||i.sessionId).slice(0,90),T=[i.projectPath||i.projectDir];I&&T.push(`→ ${I.name}${g?"":" (past session)"}`);const K=(W=i.extracts)==null?void 0:W.map(z=>z.timestamp?Date.parse(z.timestamp):Number.NaN).find(Number.isFinite),$=Date.parse(i.lastModified),re=K??(Number.isFinite($)?$:void 0),H=re===void 0?"":s(re);return H&&T.push(H),T.push(`${i.totalMatches}×`),{id:`session-${i.sessionId}`,type:"session",title:B,subtitle:T.join(" • "),matchedQuery:i.snippet||void 0,matchedExtracts:i.extracts&&i.extracts.length>0?i.extracts:void 0,_agentId:I==null?void 0:I.id,_sessionMatches:i.totalMatches,_sessionNearbyMatches:i.nearbyMatches,_matchedMessageAt:re,_provider:i.provider||"claude",icon:I?c.jsx(Dt,{agent:I,size:20}):c.jsx(O,{name:"history",size:16}),action:()=>{var F;b.current();const z=Array.from(X.getState().agents.values()).find(je=>je.sessionId===i.sessionId);z?(Lt(z.id),X.selectAgent(z.id),X.getState().viewMode!=="flat"&&X.requestTerminalExpand(),X.requestTerminalSearch(z.id,S.query)):(F=le.current)==null||F.call(le,{initialQuery:S.query,initialSessionKey:`${i.projectPath}::${i.sessionId}`})}}})},[t,S,y]),Nt=l.useMemo(()=>new de(be,{keys:["title","subtitle","_searchText","lastUserInput"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[be]),bt=l.useMemo(()=>new de(Ge,{keys:["title","subtitle"],threshold:.4,includeScore:!0,includeMatches:!0}),[Ge]),jt=l.useMemo(()=>new de(We,{keys:["title","subtitle"],threshold:.4,includeScore:!0,includeMatches:!0}),[We]),wt=l.useMemo(()=>new de(qe,{keys:["title","subtitle","_searchText"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[qe]),Re=l.useMemo(()=>{if(!R.trim()){const p=[];p.push(...qe);const _=[...be].sort((w,P)=>{const Z=at(w._agentId,w._lastActivity,Oe);return at(P._agentId,P._lastActivity,Oe)-Z});p.push(..._),p.push(...We.slice(0,2));const j={};return Ut.forEach((w,P)=>{j[w]=P}),p.sort((w,P)=>(j[w.type]??999)-(j[P.type]??999)),p}const s=R.trim().toLowerCase(),i=ke(s),g=Ze(Nt,R).slice(0,30),I=Ze(jt,R).slice(0,2),B=vt.slice(0,8),T=Ve.slice(0,wn),K=Ue.slice(0,Dn),$=Ze(wt,R).filter(p=>{const _=p.score??1,j=`${p.item.title} ${p.item.subtitle||""} ${p.item._searchText||""}`.toLowerCase();return i.every(w=>j.includes(w))||_<=.2}).slice(0,4),re={agent:6,building:5,folder:4,file:4,"file-content":4,setting:4,command:3,area:2,"modified-file":1,session:0},H=p=>Mn(s,p.title,`${p.subtitle||""} ${p._searchText||""} ${p.matchedText||""}`),W=(p,_)=>{const j=(1-Math.min(1,_??1))*4;return H(p)*100+(re[p.type]??0)*5+j},z=new Map,F=(p,_)=>{const j=z.get(p.type),w={item:p,score:W(p,_)};j?j.push(w):z.set(p.type,[w])},je=new Map;for(const p of Me)p._agentId&&!je.has(p._agentId)&&je.set(p._agentId,p);for(const p of g){const _={...p.item};if(_._userQueries&&_._userQueries.length>0){const w=_._userQueries.find(P=>i.some(Z=>P.toLowerCase().includes(Z)));if(w){const P=w.toLowerCase(),Z=P.includes(s)?s:i.find(he=>P.includes(he))??s;if(w.length>200){const he=P.indexOf(Z),Le=Math.max(0,he-60),De=Math.min(w.length,he+Z.length+100);_.matchedQuery=(Le>0?"...":"")+w.slice(Le,De)+(De<w.length?"...":"")}else _.matchedQuery=w}}const j=_._agentId?je.get(_._agentId):void 0;if(j){_.matchedQuery||(_.matchedQuery=j.matchedQuery);const w=_.matchedQuery,P=(w==null?void 0:w.toLowerCase())??"";_.matchedExtracts=In(w&&i.every(Z=>P.includes(Z))?w:void 0,j.matchedExtracts),_.action=j.action,_._sessionMatches=j._sessionMatches,_._sessionNearbyMatches=j._sessionNearbyMatches,_._matchedMessageAt=j._matchedMessageAt,_._searchText=`${_._searchText||""} ${j.matchedQuery||""} ${s}`}F(_,p.score)}for(const[p,_]of je){if(g.some(w=>w.item._agentId===p))continue;const j=Ye.get(p);j&&F({...j,matchedQuery:_.matchedQuery,matchedExtracts:_.matchedExtracts,action:_.action,_sessionMatches:_._sessionMatches,_sessionNearbyMatches:_._sessionNearbyMatches,_matchedMessageAt:_._matchedMessageAt,_searchText:`${j._searchText||""} ${_.matchedQuery||""} ${s}`},void 0)}for(const p of $)F(p.item,p.score);for(const p of I)F(p.item,p.score);for(const p of K)F(p,void 0);for(const p of B)F(p,void 0);for(const p of T)F(p,void 0);for(const p of Xe.slice(0,Ln))F(p,void 0);const cs=24*36e5,ls=Date.now(),Tt=p=>{const _=at(p.item._agentId,p.item._lastActivity,Oe),j=Math.exp(-Math.LN2*Math.max(0,ls-_)/cs),w=p.item._sessionMatches??0,P=Math.log2(1+w),Z=p.item._sessionNearbyMatches;return(Z===void 0?P:Z>0?8+Math.log2(1+Z)+P*.1:P*.2)+(p.item._matchedMessageAt===void 0?2*j:0)};for(const[p,_]of z)p==="agent"?_.sort((j,w)=>{const P=H(j.item),Z=H(w.item);if(Z!==P)return Z-P;const Se=j.item._matchedMessageAt,he=w.item._matchedMessageAt;if(Se!==void 0||he!==void 0){if(Se===void 0)return 1;if(he===void 0)return-1;if(he!==Se)return he-Se}const Le=Tt(j),De=Tt(w);return De!==Le?De-Le:w.score-j.score}):_.sort((j,w)=>w.score-j.score);const Ce=[];for(const p of Ut){if(p==="session"){!Ee&&Me.length>ut?(Ce.push(...Me.slice(0,ut)),Ce.push({id:"session-show-all",type:"session",title:`Show all conversations (${Me.length})`,subtitle:`${Me.length-ut} more matches`,icon:c.jsx(O,{name:"arrow-down",size:16}),action:()=>Mt(!0)})):Ce.push(...Me);continue}const _=z.get(p);if(_){if(p==="agent"&&!Ne&&_.length>ht){for(const j of _.slice(0,ht))Ce.push(j.item);Ce.push({id:"agent-show-all",type:"agent",title:`Show all agents (${_.length})`,subtitle:`${_.length-ht} more matches`,icon:c.jsx(O,{name:"arrow-down",size:16}),action:()=>Te(!0)});continue}for(const j of _)Ce.push(j.item)}}return Ce},[R,Nt,jt,wt,be,Ye,We,qe,Ue,vt,Ve,Xe,Me,Oe,Ne,Ee]),ae=l.useMemo(()=>{switch(ie){case"agents":return Re.filter(s=>s.type==="agent");case"buildings":return Re.filter(s=>s.type==="building");case"commands":return R.trim()?Ze(bt,R).slice(0,3).map(s=>s.item):Ge;case"folders":return Re.filter(s=>s.type==="folder");case"files":return Ve;case"contents":return Xe;case"settings":return Ue;case"areas":return ot.flatMap(s=>s.agents);case"all":default:return Re}},[ie,Re,ot,Ve,Xe,Ue,R,bt,Ge]),os=l.useMemo(()=>{const s=[];if(Ke&&s.push("session"),Ie&&s.push("file"),ze&&s.push("file-content"),se&&s.push("folder"),ie==="all")return s;const g={buildings:"building",folders:"folder",files:"file",contents:"file-content",agents:"agent",settings:"setting",commands:"command"}[ie];return g&&s.includes(g)?[g]:[]},[ie,Ke,Ie,ze,se]);l.useEffect(()=>{V>=ae.length&&ee(Math.max(0,ae.length-1))},[ae.length,V]);const is=l.useCallback(s=>{if(s.altKey&&!s.ctrlKey&&!s.metaKey&&(s.key==="p"||s.key==="n"||s.key==="P"||s.key==="N")){s.preventDefault(),s.stopPropagation(),s.nativeEvent.stopImmediatePropagation();const i=s.key.toLowerCase();ee(i==="p"?g=>g>0?g-1:ae.length-1:g=>g<ae.length-1?g+1:0);return}switch(s.key){case"Escape":s.preventDefault(),b.current();break;case"ArrowUp":s.preventDefault(),ee(i=>i>0?i-1:ae.length-1);break;case"ArrowDown":s.preventDefault(),ee(i=>i<ae.length-1?i+1:0);break;case"Enter":s.preventDefault(),ae[V]&&ae[V].action();break}},[ae,V]),as=l.useCallback((s,i)=>{if(!i||!s)return s;const g=ke(i);if(g.length===0)return s;const I=new RegExp(g.map(En).sort((re,H)=>H.length-re.length).join("|"),"gi"),B=[];let T=0,K=0,$;for(;($=I.exec(s))!==null;)$.index>T&&B.push(s.slice(T,$.index)),B.push(ct.createElement("mark",{key:K++,className:"spotlight-highlight"},$[0])),T=$.index+$[0].length;return T<s.length&&B.push(s.slice(T)),B.length>0?ct.createElement(ct.Fragment,null,...B):s},[]);return{query:R,setQuery:ns,selectedIndex:V,setSelectedIndex:ee,results:ae,loadingTypes:os,activeTab:ie,setActiveTab:nt,cycleTab:rs,areaSections:ot,handleKeyDown:is,highlightMatch:as}}const Qn=l.forwardRef(function({query:e,onQueryChange:n,onKeyDown:r,onResetSelection:o,commandMode:a=!1,executingCommand:u=!1},d){const{t:h}=st(["common"]);return c.jsxs("div",{className:`spotlight-input-wrapper${a?" is-command-mode":""}`,children:[c.jsx("span",{className:"spotlight-search-icon",children:a?"›_":"⌘"}),c.jsx("input",{ref:d,type:"text",className:"spotlight-input",placeholder:h("common:search.spotlightPlaceholder"),value:e,onChange:f=>{n(f.target.value),o()},onKeyDown:r,autoFocus:!0,spellCheck:!1,disabled:u,"aria-label":a?"Plugin command":void 0}),c.jsxs("div",{className:"spotlight-input-hints",children:[c.jsx("span",{className:"spotlight-shortcut-hint",children:"↑↓"}),c.jsx("span",{className:"spotlight-shortcut-hint",children:"Enter"}),c.jsx("span",{className:"spotlight-shortcut-hint",children:"Esc"})]})]})}),zn=l.memo(function({activeTab:e,onSelect:n}){const{t:r}=st(["terminal"]);return c.jsxs("div",{className:"spotlight-tabs",role:"tablist","aria-label":r("terminal:spotlight.tabsLabel"),children:[we.map(o=>c.jsx("button",{type:"button",role:"tab","aria-selected":o===e,tabIndex:-1,className:`spotlight-tab${o===e?" active":""}`,onClick:()=>n(o),children:r(`terminal:spotlight.tabs.${o}`)},o)),c.jsx("span",{className:"spotlight-tabs-hint",children:c.jsx("kbd",{children:"Tab"})})]})}),Kn=l.forwardRef(function({results:e,loadingTypes:n,selectedIndex:r,query:o,activeTab:a,areaSections:u,highlightMatch:d,onSelectIndex:h},f){const{t:m}=st(["terminal"]),x=l.useRef(!1);l.useEffect(()=>{x.current=!1},[e]),l.useEffect(()=>{const A=typeof f=="function"?null:f==null?void 0:f.current;if(!A)return;const M=()=>{x.current=!0};return A.addEventListener("mousemove",M),()=>{A.removeEventListener("mousemove",M)}},[f,e]);const y={command:m("terminal:spotlight.categories.commands"),agent:m("terminal:spotlight.categories.agents"),building:m("terminal:spotlight.categories.infrastructure"),setting:m("terminal:spotlight.categories.settings"),area:m("terminal:spotlight.categories.areas"),folder:m("terminal:spotlight.categories.folders"),file:m("terminal:spotlight.categories.files"),"file-content":m("terminal:spotlight.categories.fileContents"),"modified-file":m("terminal:spotlight.categories.modifiedFiles"),session:m("terminal:spotlight.categories.sessions")},E=l.useMemo(()=>{const A=[];let M=null,N=[];e.forEach((b,L)=>{b.type!==M&&(M!==null&&N.length>0&&A.push([M,N]),M=b.type,N=[]),N.push({result:b,index:L})}),M!==null&&N.length>0&&A.push([M,N]);for(const b of n)A.some(([L])=>L===b)||A.push([b,[]]);const D=["agent","session","building","setting","file","file-content","folder","area","command"];return A.sort(([b],[L])=>D.indexOf(b)-D.indexOf(L)),A},[e,n]);if(l.useEffect(()=>{if(!f||typeof f=="function")return;const A=f.current;if(!A)return;const M=A.querySelector(".spotlight-item.selected");M&&M.scrollIntoView({block:"nearest",behavior:"smooth"})},[r,f]),a==="areas"){if(u.length===0)return c.jsx("div",{className:"spotlight-results",ref:f,children:c.jsx("div",{className:"spotlight-empty",children:m("terminal:spotlight.noResults")})});let A=0;return c.jsx("div",{className:"spotlight-results",ref:f,children:u.map(M=>c.jsxs("div",{children:[c.jsxs("div",{className:"spotlight-category-header spotlight-area-section-header",children:[c.jsx("span",{className:"spotlight-area-dot",style:{background:M.areaColor},"aria-hidden":"true"}),c.jsx("span",{className:"spotlight-area-name",children:M.areaName}),c.jsx("span",{className:"spotlight-area-count",children:M.agents.length})]}),M.agents.length===0?c.jsx("div",{className:"spotlight-area-empty",children:m("terminal:spotlight.noAgentsInArea")}):M.agents.map(N=>{const D=A++;return c.jsx(Ft,{result:N,isSelected:D===r,query:o,highlightMatch:d,onClick:()=>N.action(),onMouseEnter:()=>{x.current&&h(D)}},N.id)})]},M.areaId))})}return e.length===0&&n.length===0?c.jsx("div",{className:"spotlight-results",ref:f,children:c.jsx("div",{className:"spotlight-empty",children:m("terminal:spotlight.noResults")})}):c.jsx("div",{className:"spotlight-results",ref:f,children:E.map(([A,M])=>c.jsxs("div",{children:[(a==="all"||E.length>1)&&c.jsx("div",{className:"spotlight-category-header",children:y[A]||A}),n.includes(A)&&c.jsxs("div",{className:"spotlight-block-loading",role:"status",children:[c.jsx("span",{className:"spotlight-loading-spinner","aria-hidden":"true"}),m("terminal:spotlight.searching")]}),M.map(({result:N,index:D})=>c.jsx(Ft,{result:N,isSelected:D===r,query:o,highlightMatch:d,onClick:()=>N.action(),onMouseEnter:()=>{x.current&&h(D)}},N.id))]},A))})}),On=l.memo(function({commandMode:e=!1}){const{t:n}=st(["terminal"]);return c.jsxs("div",{className:"spotlight-footer",children:[c.jsxs("div",{className:"spotlight-footer-left",children:[c.jsxs("span",{className:"spotlight-footer-hint",children:[c.jsx("kbd",{children:"↑"}),c.jsx("kbd",{children:"↓"})," ",c.jsx("kbd",{children:"Alt+N"}),c.jsx("kbd",{children:"Alt+P"})," ",n("terminal:spotlight.navigate")]}),c.jsxs("span",{className:"spotlight-footer-hint",children:[c.jsx("kbd",{children:"Enter"})," ",e?"run command":n("terminal:spotlight.select")]}),c.jsxs("span",{className:"spotlight-footer-hint",children:[c.jsx("kbd",{children:"Tab"})," ",e?"complete command":n("terminal:spotlight.switchTabs")]})]}),c.jsx("div",{className:"spotlight-footer-right",children:c.jsxs("span",{className:"spotlight-footer-hint",children:[c.jsx("kbd",{children:"Esc"})," ",n("common:buttons.close")]})})]})});function Gn({detail:t,onClose:e}){const[n,r]=l.useState(null),[o,a]=l.useState(!0),[u,d]=l.useState(null);_s("spotlight-file-detail",!0,e),l.useEffect(()=>{const E=new AbortController;return a(!0),d(null),r(null),(async()=>{try{const M=await dt(ft(`/api/files/read?path=${encodeURIComponent(t.filePath)}`),{signal:E.signal}),N=await M.json();if(!M.ok)throw new Error(N.error||"Unable to read file");let D=null;if(!N.binary)try{const b=await dt(ft(`/api/files/git-original?path=${encodeURIComponent(t.filePath)}`),{signal:E.signal}),L=await b.json();b.ok&&!L.binary&&typeof L.content=="string"&&(D=L.content)}catch{}E.signal.aborted||r({filename:N.filename||t.filePath.split("/").pop()||t.filePath,content:typeof N.content=="string"?N.content:"",originalContent:D,binary:N.binary===!0})}catch(M){E.signal.aborted||d(M instanceof Error?M.message:"Unable to load file")}finally{E.signal.aborted||a(!1)}})(),()=>E.abort()},[t.filePath]),l.useEffect(()=>{const E=A=>{A.key==="Escape"&&(A.preventDefault(),A.stopImmediatePropagation(),e())};return document.addEventListener("keydown",E,!0),()=>document.removeEventListener("keydown",E,!0)},[e]);const h=()=>{X.revealFileInExplorer(t.filePath,t.projectRoot,t.targetLine),e()},f=(n==null?void 0:n.filename)||t.filePath,m=f.lastIndexOf(".")>=0?f.slice(f.lastIndexOf(".")):"",x=Is(m),y=(n==null?void 0:n.originalContent)!=null&&n.originalContent!==n.content;return c.jsx("div",{className:"guake-git-diff-modal-overlay",onClick:e,children:c.jsxs("div",{className:"guake-git-diff-modal",onClick:E=>E.stopPropagation(),children:[c.jsxs("div",{className:"guake-git-diff-modal-header",children:[c.jsxs("div",{className:"guake-git-diff-path spotlight-file-detail-path",title:t.filePath,children:[t.filePath,t.targetLine?c.jsxs("span",{className:"spotlight-file-detail-line",children:[":",t.targetLine]}):null]}),c.jsxs("button",{type:"button",className:"spotlight-file-detail-explorer",onClick:h,title:"Open in File Explorer",children:[c.jsx(O,{name:"folder-open",size:14}),"Open in File Explorer"]}),c.jsx("button",{className:"guake-git-close",onClick:e,title:"Close (Esc)",children:c.jsx(O,{name:"close",size:14})})]}),c.jsxs("div",{className:"guake-git-diff-content",children:[o&&c.jsx("div",{className:"guake-git-diff-loading-overlay",children:c.jsx("div",{className:"diff-image-spinner"})}),u&&c.jsx("div",{className:"spotlight-file-detail-message",children:u}),(n==null?void 0:n.binary)&&c.jsx("div",{className:"spotlight-file-detail-message",children:"Binary preview is available in the File Explorer."}),n&&!n.binary&&(y?c.jsx($t,{originalContent:n.originalContent||"",modifiedContent:n.content,filename:n.filename,filePath:t.filePath,language:x,searchQuery:t.searchQuery,targetLine:t.targetLine}):c.jsx($t,{originalContent:"",modifiedContent:n.content,filename:n.filename,filePath:t.filePath,language:x,initialModifiedOnly:!0,searchQuery:t.searchQuery,targetLine:t.targetLine,readOnly:!0}))]})]})})}const Un=l.forwardRef(function({commands:e,selectedIndex:n,executing:r,error:o,onSelectIndex:a,onExecute:u},d){return l.useEffect(()=>{var h,f;!d||typeof d=="function"||(f=(h=d.current)==null?void 0:h.querySelector(".spotlight-command-item.selected"))==null||f.scrollIntoView({block:"nearest"})},[d,n]),c.jsxs("div",{className:"spotlight-results spotlight-command-results",ref:d,children:[c.jsxs("div",{className:"spotlight-command-mode-banner",children:[c.jsx("span",{className:"spotlight-command-mode-icon",children:c.jsx(O,{name:"terminal",size:13})}),c.jsxs("div",{children:[c.jsx("strong",{children:"Plugin command mode"}),c.jsx("span",{children:"Runs locally without sending a prompt to an AI agent"})]})]}),o&&c.jsxs("div",{className:"spotlight-command-error",role:"alert",children:[c.jsx(O,{name:"warn",size:13}),c.jsx("span",{children:o})]}),e.length===0?c.jsxs("div",{className:"spotlight-empty spotlight-command-empty",children:[c.jsx(O,{name:"search",size:18}),c.jsx("strong",{children:"No matching plugin command"}),c.jsxs("span",{children:["Type ",c.jsx("code",{children:"/"})," to see enabled plugin commands."]})]}):e.map((h,f)=>c.jsxs("button",{type:"button",className:`spotlight-item spotlight-command-item${f===n?" selected":""}`,disabled:r,onMouseEnter:()=>a(f),onClick:()=>u(h),children:[c.jsx("span",{className:"spotlight-item-icon spotlight-command-item-icon",children:c.jsx(O,{name:"plug",size:16})}),c.jsxs("span",{className:"spotlight-item-content",children:[c.jsxs("span",{className:"spotlight-item-header",children:[c.jsx("code",{className:"spotlight-command-name",children:h.name}),h.name!==h.canonicalName&&c.jsxs("span",{className:"spotlight-command-alias",children:["alias of ",h.canonicalName]})]}),c.jsx("span",{className:"spotlight-item-subtitle",children:h.summary})]}),c.jsx("span",{className:"spotlight-command-plugin-badge",children:h.pluginName}),r&&f===n?c.jsx("span",{className:"spotlight-loading-spinner","aria-label":"Running command"}):c.jsx("span",{className:"spotlight-command-enter",children:"↵"})]},`${h.pluginId}:${h.name}`))]})}),Hn=768;function Xn({isOpen:t,onClose:e,onOpenSpawnModal:n,onOpenCommanderView:r,onOpenToolbox:o,onOpenFileExplorer:a,onOpenPM2LogsModal:u,onOpenBossLogsModal:d,onOpenDatabasePanel:h,onOpenMonitoringModal:f,onOpenSessionFinder:m}){const x=l.useRef(null),y=l.useRef(null),E=l.useRef(null),A=l.useRef(0),M=l.useRef(!1),N=l.useRef(()=>{}),[D,b]=l.useState(null),[L,G]=l.useState(0),[ce,me]=l.useState(!1),[U,Y]=l.useState(null),[J,oe]=l.useState(null),le=vs(),{query:Q,setQuery:R,selectedIndex:q,setSelectedIndex:V,results:ee,loadingTypes:ie,activeTab:$e,setActiveTab:Be,cycleTab:ge,areaSections:Pe,handleKeyDown:pe,highlightMatch:Qe}=Pn({isOpen:t,onClose:e,onOpenSpawnModal:n,onOpenCommanderView:r,onOpenToolbox:o,onOpenFileExplorer:a,onOpenPM2LogsModal:u,onOpenBossLogsModal:d,onOpenDatabasePanel:h,onOpenMonitoringModal:f,onOpenSessionFinder:m,onOpenFileDetail:b}),te=Q.startsWith("/"),se=l.useMemo(()=>Ns(Q,bs()),[Q,le]),ye=l.useCallback(()=>{const v=se[L];if(!v)return;const S=Q.trim().replace(/^\S+/,"");R(`${v.name}${S}`),G(0)},[se,L,Q,R]),Ie=l.useCallback(async v=>{me(!0),Y(null);try{const S=v.pluginId===js||v.requiresAgent?X.getState().selectedAgentIds.values().next().value:void 0,k=await ws(v,Q,{agentId:S});k.kind==="output"&&oe(k),e()}catch(S){Y(S instanceof Error?S.message:String(S))}finally{me(!1)}},[e,Q]);A.current=te?se.length:ee.length,M.current=te,N.current=ye;const xe=l.useRef(ge);xe.current=ge,l.useEffect(()=>{t&&(oe(null),Y(null),setTimeout(()=>{var v,S;(v=x.current)==null||v.focus(),(S=x.current)==null||S.select()},50))},[t]),l.useEffect(()=>{if(!t)return;const v=window.visualViewport;if(!v||window.innerWidth>Hn)return;const S=()=>{const k=y.current;k&&(k.style.height=`${v.height}px`,k.style.top=`${v.offsetTop}px`)};return S(),v.addEventListener("resize",S),v.addEventListener("scroll",S),()=>{v.removeEventListener("resize",S),v.removeEventListener("scroll",S);const k=y.current;k&&(k.style.height="",k.style.top="")}},[t]),l.useEffect(()=>{if(!t)return;const v=S=>{if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation(),e();return}if(S.key==="Tab"){S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation(),M.current?N.current():xe.current(S.shiftKey?-1:1);return}if(S.altKey&&!S.ctrlKey&&!S.metaKey&&(S.key==="n"||S.key==="p"||S.key==="N"||S.key==="P")){S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation();const k=S.key.toLowerCase(),Ne=A.current;if(Ne===0)return;const Te=Ee=>k==="p"?Ee>0?Ee-1:Ne-1:Ee<Ne-1?Ee+1:0;M.current?G(Te):V(Te);return}};return window.addEventListener("keydown",v,{capture:!0}),()=>{window.removeEventListener("keydown",v,{capture:!0})}},[t,e]);const ze=l.useCallback(v=>{v.target===v.currentTarget&&e()},[e]),ve=l.useCallback(()=>{V(0),G(0),Y(null)},[V]);l.useEffect(()=>{L>=se.length&&G(Math.max(0,se.length-1))},[se.length,L]);const Ke=l.useCallback(v=>{if(!te){pe(v);return}const S=se.length;if(v.key==="ArrowUp"||v.key==="ArrowDown"){if(v.preventDefault(),S===0)return;G(k=>v.key==="ArrowUp"?k>0?k-1:S-1:k<S-1?k+1:0);return}if(v.key==="Tab"){v.preventDefault(),ye();return}if(v.key==="Enter"){v.preventDefault();const k=se[L];k&&!ce&&Ie(k)}},[se,te,L,ye,Ie,ce,pe]);return t?c.jsx("div",{ref:y,className:"spotlight-overlay",onClick:ze,children:c.jsxs("div",{className:"spotlight-modal",children:[c.jsx(Qn,{ref:x,query:Q,onQueryChange:R,onKeyDown:Ke,onResetSelection:ve,commandMode:te,executingCommand:ce}),!te&&c.jsx(zn,{activeTab:$e,onSelect:Be}),te?c.jsx(Un,{ref:E,commands:se,selectedIndex:L,executing:ce,error:U,onSelectIndex:G,onExecute:v=>void Ie(v)}):c.jsx(Kn,{ref:E,results:ee,loadingTypes:ie,selectedIndex:q,query:Q,activeTab:$e,areaSections:Pe,highlightMatch:Qe,onSelectIndex:V}),c.jsx(On,{commandMode:te})]})}):J?c.jsx(Ts,{command:J.command,output:J.output,onClose:()=>oe(null)}):D?c.jsx(Gn,{detail:D,onClose:()=>b(null)}):null}export{er as FILE_ICON_NAMES,Xn as Spotlight,On as SpotlightFooter,Qn as SpotlightInput,Ft as SpotlightItem,Kn as SpotlightResults,tr as formatDuration,sr as formatRelativeTime,nr as getAgentIcon,kt as getFileIconFromPath,rr as getTypeLabel,Pn as useSpotlightSearch};
|
|
1
|
+
import{c as dt,d as ft,E as us,a1 as hs,f as ds,bm as fs,c8 as ms,ah as gs,r as l,z as ps,S as Fe,c9 as it,ca as ys,cb as As,cc as xs,az as Es,cd as we,s as X,ce as Ms,j as c,I as O,W as Rt,cf as Lt,t as Dt,cg as Cs,ch as kt,ci as at,V as ct,m as Ss,ay as Wt,u as st,cj as Ft,aJ as _s,ck as $t,cl as Is,cm as vs,cn as Ns,co as bs,cp as js,cq as ws,cr as Ts}from"./main-D0r07JA_.js";import{cs as er,ct as tr,cu as sr,cv as nr,cw as rr}from"./main-D0r07JA_.js";import{s as Rs,S as Ls}from"./settingsSearch-DYr4vFyy.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-DYBBrXTx.js";function fe(t){return Array.isArray?Array.isArray(t):Vt(t)==="[object Array]"}function Ds(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ks(t){return t==null?"":Ds(t)}function ue(t){return typeof t=="string"}function Yt(t){return typeof t=="number"}function Fs(t){return t===!0||t===!1||$s(t)&&Vt(t)=="[object Boolean]"}function qt(t){return typeof t=="object"}function $s(t){return qt(t)&&t!==null}function ne(t){return t!=null}function lt(t){return!t.trim().length}function Vt(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Bs="Incorrect 'index' type",Ps=t=>`Invalid value for key ${t}`,Qs=t=>`Pattern length exceeds max of ${t}.`,zs=t=>`Missing ${t} property in key`,Ks=t=>`Property 'weight' in key '${t}' must be a positive integer`,Bt=Object.prototype.hasOwnProperty;class Os{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{let o=Xt(r);this._keys.push(o),this._keyMap[o.id]=o,n+=o.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Xt(t){let e=null,n=null,r=null,o=1,a=null;if(ue(t)||fe(t))r=t,e=Pt(t),n=mt(t);else{if(!Bt.call(t,"name"))throw new Error(zs("name"));const u=t.name;if(r=u,Bt.call(t,"weight")&&(o=t.weight,o<=0))throw new Error(Ks(u));e=Pt(u),n=mt(u),a=t.getFn}return{path:e,id:n,weight:o,src:r,getFn:a}}function Pt(t){return fe(t)?t:t.split(".")}function mt(t){return fe(t)?t.join("."):t}function Gs(t,e){let n=[],r=!1;const o=(a,u,d)=>{if(ne(a))if(!u[d])n.push(a);else{let h=u[d];const f=a[h];if(!ne(f))return;if(d===u.length-1&&(ue(f)||Yt(f)||Fs(f)))n.push(ks(f));else if(fe(f)){r=!0;for(let m=0,x=f.length;m<x;m+=1)o(f[m],u,d+1)}else u.length&&o(f,u,d+1)}};return o(t,ue(e)?e.split("."):e,0),r?n:n[0]}const Us={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Hs={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},Ws={location:0,threshold:.6,distance:100},Ys={useExtendedSearch:!1,getFn:Gs,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var C={...Hs,...Us,...Ws,...Ys};const qs=/[^ ]+/g;function Vs(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(o){const a=o.match(qs).length;if(n.has(a))return n.get(a);const u=1/Math.pow(a,.5*t),d=parseFloat(Math.round(u*r)/r);return n.set(a,d),d},clear(){n.clear()}}}class Et{constructor({getFn:e=C.getFn,fieldNormWeight:n=C.fieldNormWeight}={}){this.norm=Vs(n,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ue(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();ue(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!ne(e)||lt(e))return;let r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){let r={i:n,$:{}};this.keys.forEach((o,a)=>{let u=o.getFn?o.getFn(e):this.getFn(e,o.path);if(ne(u)){if(fe(u)){let d=[];const h=[{nestedArrIndex:-1,value:u}];for(;h.length;){const{nestedArrIndex:f,value:m}=h.pop();if(ne(m))if(ue(m)&&!lt(m)){let x={v:m,i:f,n:this.norm.get(m)};d.push(x)}else fe(m)&&m.forEach((x,y)=>{h.push({nestedArrIndex:y,value:x})})}r.$[a]=d}else if(ue(u)&&!lt(u)){let d={v:u,n:this.norm.get(u)};r.$[a]=d}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function Jt(t,e,{getFn:n=C.getFn,fieldNormWeight:r=C.fieldNormWeight}={}){const o=new Et({getFn:n,fieldNormWeight:r});return o.setKeys(t.map(Xt)),o.setSources(e),o.create(),o}function Xs(t,{getFn:e=C.getFn,fieldNormWeight:n=C.fieldNormWeight}={}){const{keys:r,records:o}=t,a=new Et({getFn:e,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(o),a}function Je(t,{errors:e=0,currentLocation:n=0,expectedLocation:r=0,distance:o=C.distance,ignoreLocation:a=C.ignoreLocation}={}){const u=e/t.length;if(a)return u;const d=Math.abs(r-n);return o?u+d/o:d?1:u}function Js(t=[],e=C.minMatchCharLength){let n=[],r=-1,o=-1,a=0;for(let u=t.length;a<u;a+=1){let d=t[a];d&&r===-1?r=a:!d&&r!==-1&&(o=a-1,o-r+1>=e&&n.push([r,o]),r=-1)}return t[a-1]&&a-r>=e&&n.push([r,a-1]),n}const _e=32;function Zs(t,e,n,{location:r=C.location,distance:o=C.distance,threshold:a=C.threshold,findAllMatches:u=C.findAllMatches,minMatchCharLength:d=C.minMatchCharLength,includeMatches:h=C.includeMatches,ignoreLocation:f=C.ignoreLocation}={}){if(e.length>_e)throw new Error(Qs(_e));const m=e.length,x=t.length,y=Math.max(0,Math.min(r,x));let E=a,A=y;const M=d>1||h,N=M?Array(x):[];let D;for(;(D=t.indexOf(e,A))>-1;){let U=Je(e,{currentLocation:D,expectedLocation:y,distance:o,ignoreLocation:f});if(E=Math.min(U,E),A=D+m,M){let Y=0;for(;Y<m;)N[D+Y]=1,Y+=1}}A=-1;let b=[],L=1,G=m+x;const ce=1<<m-1;for(let U=0;U<m;U+=1){let Y=0,J=G;for(;Y<J;)Je(e,{errors:U,currentLocation:y+J,expectedLocation:y,distance:o,ignoreLocation:f})<=E?Y=J:G=J,J=Math.floor((G-Y)/2+Y);G=J;let oe=Math.max(1,y-J+1),le=u?x:Math.min(y+J,x)+m,Q=Array(le+2);Q[le+1]=(1<<U)-1;for(let q=le;q>=oe;q-=1){let V=q-1,ee=n[t.charAt(V)];if(M&&(N[V]=+!!ee),Q[q]=(Q[q+1]<<1|1)&ee,U&&(Q[q]|=(b[q+1]|b[q])<<1|1|b[q+1]),Q[q]&ce&&(L=Je(e,{errors:U,currentLocation:V,expectedLocation:y,distance:o,ignoreLocation:f}),L<=E)){if(E=L,A=V,A<=y)break;oe=Math.max(1,2*y-A)}}if(Je(e,{errors:U+1,currentLocation:y,expectedLocation:y,distance:o,ignoreLocation:f})>E)break;b=Q}const me={isMatch:A>=0,score:Math.max(.001,L)};if(M){const U=Js(N,d);U.length?h&&(me.indices=U):me.isMatch=!1}return me}function en(t){let e={};for(let n=0,r=t.length;n<r;n+=1){const o=t.charAt(n);e[o]=(e[o]||0)|1<<r-n-1}return e}const et=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t);class Zt{constructor(e,{location:n=C.location,threshold:r=C.threshold,distance:o=C.distance,includeMatches:a=C.includeMatches,findAllMatches:u=C.findAllMatches,minMatchCharLength:d=C.minMatchCharLength,isCaseSensitive:h=C.isCaseSensitive,ignoreDiacritics:f=C.ignoreDiacritics,ignoreLocation:m=C.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:o,includeMatches:a,findAllMatches:u,minMatchCharLength:d,isCaseSensitive:h,ignoreDiacritics:f,ignoreLocation:m},e=h?e:e.toLowerCase(),e=f?et(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const x=(E,A)=>{this.chunks.push({pattern:E,alphabet:en(E),startIndex:A})},y=this.pattern.length;if(y>_e){let E=0;const A=y%_e,M=y-A;for(;E<M;)x(this.pattern.substr(E,_e),E),E+=_e;if(A){const N=y-_e;x(this.pattern.substr(N),N)}}else x(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:o}=this.options;if(e=n?e:e.toLowerCase(),e=r?et(e):e,this.pattern===e){let M={isMatch:!0,score:0};return o&&(M.indices=[[0,e.length-1]]),M}const{location:a,distance:u,threshold:d,findAllMatches:h,minMatchCharLength:f,ignoreLocation:m}=this.options;let x=[],y=0,E=!1;this.chunks.forEach(({pattern:M,alphabet:N,startIndex:D})=>{const{isMatch:b,score:L,indices:G}=Zs(e,M,N,{location:a+D,distance:u,threshold:d,findAllMatches:h,minMatchCharLength:f,includeMatches:o,ignoreLocation:m});b&&(E=!0),y+=L,b&&G&&(x=[...x,...G])});let A={isMatch:E,score:E?y/this.chunks.length:1};return E&&o&&(A.indices=x),A}}class Ae{constructor(e){this.pattern=e}static isMultiMatch(e){return Qt(e,this.multiRegex)}static isSingleMatch(e){return Qt(e,this.singleRegex)}search(){}}function Qt(t,e){const n=t.match(e);return n?n[1]:null}class tn extends Ae{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class sn extends Ae{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class nn extends Ae{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class rn extends Ae{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class on extends Ae{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class an extends Ae{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class es extends Ae{constructor(e,{location:n=C.location,threshold:r=C.threshold,distance:o=C.distance,includeMatches:a=C.includeMatches,findAllMatches:u=C.findAllMatches,minMatchCharLength:d=C.minMatchCharLength,isCaseSensitive:h=C.isCaseSensitive,ignoreDiacritics:f=C.ignoreDiacritics,ignoreLocation:m=C.ignoreLocation}={}){super(e),this._bitapSearch=new Zt(e,{location:n,threshold:r,distance:o,includeMatches:a,findAllMatches:u,minMatchCharLength:d,isCaseSensitive:h,ignoreDiacritics:f,ignoreLocation:m})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class ts extends Ae{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const o=[],a=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+a,o.push([r,n-1]);const u=!!o.length;return{isMatch:u,score:u?0:1,indices:o}}}const gt=[tn,ts,nn,rn,an,on,sn,es],zt=gt.length,cn=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,ln="|";function un(t,e={}){return t.split(ln).map(n=>{let r=n.trim().split(cn).filter(a=>a&&!!a.trim()),o=[];for(let a=0,u=r.length;a<u;a+=1){const d=r[a];let h=!1,f=-1;for(;!h&&++f<zt;){const m=gt[f];let x=m.isMultiMatch(d);x&&(o.push(new m(x,e)),h=!0)}if(!h)for(f=-1;++f<zt;){const m=gt[f];let x=m.isSingleMatch(d);if(x){o.push(new m(x,e));break}}}return o})}const hn=new Set([es.type,ts.type]);class dn{constructor(e,{isCaseSensitive:n=C.isCaseSensitive,ignoreDiacritics:r=C.ignoreDiacritics,includeMatches:o=C.includeMatches,minMatchCharLength:a=C.minMatchCharLength,ignoreLocation:u=C.ignoreLocation,findAllMatches:d=C.findAllMatches,location:h=C.location,threshold:f=C.threshold,distance:m=C.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:o,minMatchCharLength:a,findAllMatches:d,ignoreLocation:u,location:h,threshold:f,distance:m},e=n?e:e.toLowerCase(),e=r?et(e):e,this.pattern=e,this.query=un(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:o,ignoreDiacritics:a}=this.options;e=o?e:e.toLowerCase(),e=a?et(e):e;let u=0,d=[],h=0;for(let f=0,m=n.length;f<m;f+=1){const x=n[f];d.length=0,u=0;for(let y=0,E=x.length;y<E;y+=1){const A=x[y],{isMatch:M,indices:N,score:D}=A.search(e);if(M){if(u+=1,h+=D,r){const b=A.constructor.type;hn.has(b)?d=[...d,...N]:d.push(N)}}else{h=0,u=0,d.length=0;break}}if(u){let y={isMatch:!0,score:h/u};return r&&(y.indices=d),y}}return{isMatch:!1,score:1}}}const pt=[];function fn(...t){pt.push(...t)}function yt(t,e){for(let n=0,r=pt.length;n<r;n+=1){let o=pt[n];if(o.condition(t,e))return new o(t,e)}return new Zt(t,e)}const tt={AND:"$and",OR:"$or"},At={PATH:"$path",PATTERN:"$val"},xt=t=>!!(t[tt.AND]||t[tt.OR]),mn=t=>!!t[At.PATH],gn=t=>!fe(t)&&qt(t)&&!xt(t),Kt=t=>({[tt.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function ss(t,e,{auto:n=!0}={}){const r=o=>{let a=Object.keys(o);const u=mn(o);if(!u&&a.length>1&&!xt(o))return r(Kt(o));if(gn(o)){const h=u?o[At.PATH]:a[0],f=u?o[At.PATTERN]:o[h];if(!ue(f))throw new Error(Ps(h));const m={keyId:mt(h),pattern:f};return n&&(m.searcher=yt(f,e)),m}let d={children:[],operator:a[0]};return a.forEach(h=>{const f=o[h];fe(f)&&f.forEach(m=>{d.children.push(r(m))})}),d};return xt(t)||(t=Kt(t)),r(t)}function pn(t,{ignoreFieldNorm:e=C.ignoreFieldNorm}){t.forEach(n=>{let r=1;n.matches.forEach(({key:o,norm:a,score:u})=>{const d=o?o.weight:null;r*=Math.pow(u===0&&d?Number.EPSILON:u,(d||1)*(e?1:a))}),n.score=r})}function yn(t,e){const n=t.matches;e.matches=[],ne(n)&&n.forEach(r=>{if(!ne(r.indices)||!r.indices.length)return;const{indices:o,value:a}=r;let u={indices:o,value:a};r.key&&(u.key=r.key.src),r.idx>-1&&(u.refIndex=r.idx),e.matches.push(u)})}function An(t,e){e.score=t.score}function xn(t,e,{includeMatches:n=C.includeMatches,includeScore:r=C.includeScore}={}){const o=[];return n&&o.push(yn),r&&o.push(An),t.map(a=>{const{idx:u}=a,d={item:e[u],refIndex:u};return o.length&&o.forEach(h=>{h(a,d)}),d})}class de{constructor(e,n={},r){this.options={...C,...n},this.options.useExtendedSearch,this._keyStore=new Os(this.options.keys),this.setCollection(e,r)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Et))throw new Error(Bs);this._myIndex=n||Jt(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){ne(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let r=0,o=this._docs.length;r<o;r+=1){const a=this._docs[r];e(a,r)&&(this.removeAt(r),r-=1,o-=1,n.push(a))}return n}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:n=-1}={}){const{includeMatches:r,includeScore:o,shouldSort:a,sortFn:u,ignoreFieldNorm:d}=this.options;let h=ue(e)?ue(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return pn(h,{ignoreFieldNorm:d}),a&&h.sort(u),Yt(n)&&n>-1&&(h=h.slice(0,n)),xn(h,this._docs,{includeMatches:r,includeScore:o})}_searchStringList(e){const n=yt(e,this.options),{records:r}=this._myIndex,o=[];return r.forEach(({v:a,i:u,n:d})=>{if(!ne(a))return;const{isMatch:h,score:f,indices:m}=n.searchIn(a);h&&o.push({item:a,idx:u,matches:[{score:f,value:a,norm:d,indices:m}]})}),o}_searchLogical(e){const n=ss(e,this.options),r=(d,h,f)=>{if(!d.children){const{keyId:x,searcher:y}=d,E=this._findMatches({key:this._keyStore.get(x),value:this._myIndex.getValueForItemAtKeyId(h,x),searcher:y});return E&&E.length?[{idx:f,item:h,matches:E}]:[]}const m=[];for(let x=0,y=d.children.length;x<y;x+=1){const E=d.children[x],A=r(E,h,f);if(A.length)m.push(...A);else if(d.operator===tt.AND)return[]}return m},o=this._myIndex.records,a={},u=[];return o.forEach(({$:d,i:h})=>{if(ne(d)){let f=r(n,d,h);f.length&&(a[h]||(a[h]={idx:h,item:d,matches:[]},u.push(a[h])),f.forEach(({matches:m})=>{a[h].matches.push(...m)}))}}),u}_searchObjectList(e){const n=yt(e,this.options),{keys:r,records:o}=this._myIndex,a=[];return o.forEach(({$:u,i:d})=>{if(!ne(u))return;let h=[];r.forEach((f,m)=>{h.push(...this._findMatches({key:f,value:u[m],searcher:n}))}),h.length&&a.push({idx:d,item:u,matches:h})}),a}_findMatches({key:e,value:n,searcher:r}){if(!ne(n))return[];let o=[];if(fe(n))n.forEach(({v:a,i:u,n:d})=>{if(!ne(a))return;const{isMatch:h,score:f,indices:m}=r.searchIn(a);h&&o.push({score:f,key:e,value:a,idx:u,norm:d,indices:m})});else{const{v:a,n:u}=n,{isMatch:d,score:h,indices:f}=r.searchIn(a);d&&o.push({score:h,key:e,value:a,norm:u,indices:f})}return o}}de.version="7.1.0";de.createIndex=Jt;de.parseIndex=Xs;de.config=C;de.parseQuery=ss;fn(dn);function ke(t){return t.trim().toLowerCase().split(/\s+/).filter(Boolean)}function En(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ze(t,e){const n=e.trim(),r=ke(n);if(r.length<=1)return t.search(n);const[o,...a]=r.map(h=>t.search(h)),u=a.map(h=>{const f=new Map;for(const m of h)f.set(m.refIndex,m.score??1);return f}),d=[];for(const h of o){let f=h.score??1,m=!0;for(const x of u){const y=x.get(h.refIndex);if(y===void 0){m=!1;break}f+=y}m&&d.push({item:h.item,score:f/r.length})}return d.sort((h,f)=>(h.score??1)-(f.score??1)),d}function Ot(t,e,n){return e===t?6:e.startsWith(t)?5:e.split(/[^a-z0-9]+/i).includes(t)?4:e.includes(t)?3:n.includes(t)?2:1}function Mn(t,e,n){const r=ke(t);if(r.length===0)return 1;const o=e.toLowerCase(),a=n.toLowerCase(),u=Ot(r.join(" "),o,a);if(r.length===1)return u;let d=6;for(const h of r)d=Math.min(d,Ot(h,o,a));return Math.max(u,d)}const Cn=4;function Gt(t){return t.replace(/…|\.\.\./g," ").replace(/\s+/g," ").trim().toLowerCase()}const Sn=24;function _n(t,e){const n=Gt(t),r=Gt(e);return n===r?!0:Math.min(n.length,r.length)<Sn?!1:n.includes(r)||r.includes(n)}function In(t,e){const n=[],r=o=>{!o||!o.text.trim()||n.length>=Cn||n.some(a=>_n(a.text,o.text))||n.push(o)};t&&r({text:t,kind:"user"});for(const o of e??[])r(o);return n.length>0?n:void 0}async function vn(t){const e=new URLSearchParams({q:t}),n=await dt(ft(`/api/folders/search?${e.toString()}`));if(!n.ok){const o=await n.json().catch(()=>({}));throw new Error(o.error||`Failed to search folders: ${n.statusText}`)}const r=await n.json();return Array.isArray(r.folders)?r.folders:[]}const Ut=["agent","session","building","setting","file","file-content","folder","area"],Nn=2,bn=2,jn=50,wn=10,Tn=3,Rn=30,Ln=8,Dn=8,kn=3,Fn=15,ut=5,ht=5;function $n(){const t=Wt(Fe.SPOTLIGHT_TAB,"all");return we.includes(t)?t:"all"}function Ht(){return Ss(Fe.SPOTLIGHT_QUERY,"")}function Bn(){const t=Wt(Fe.AOP_CONFIG,{});return t.sortMode==="name"||t.sortMode==="status"||t.sortMode==="recent"?t.sortMode:"recent"}function Pn({isOpen:t,onClose:e,onOpenSpawnModal:n,onOpenCommanderView:r,onOpenToolbox:o,onOpenFileExplorer:a,onOpenPM2LogsModal:u,onOpenBossLogsModal:d,onOpenDatabasePanel:h,onOpenMonitoringModal:f,onOpenSessionFinder:m,onOpenFileDetail:x}){const y=us(),E=hs(),A=ds(),M=fs(),N=ms(),D=gs(),b=l.useRef(e);b.current=e;const L=l.useRef(n);L.current=n;const G=l.useRef(r);G.current=r;const ce=l.useRef(o);ce.current=o;const me=l.useRef(a);me.current=a;const U=l.useRef(u);U.current=u;const Y=l.useRef(d);Y.current=d;const J=l.useRef(h);J.current=h;const oe=l.useRef(f);oe.current=f;const le=l.useRef(m);le.current=m;const Q=l.useRef(x);Q.current=x;const[R,q]=l.useState(Ht),[V,ee]=l.useState(0),[ie,$e]=l.useState($n),[Be,ge]=l.useState([]),[Pe,pe]=l.useState([]),[Qe,te]=l.useState([]),[se,ye]=l.useState(!1),[Ie,xe]=l.useState(!1),[ze,ve]=l.useState(!1),[Ke,v]=l.useState(!1),[S,k]=l.useState({query:"",rows:[]}),[Ne,Te]=l.useState(!1),[Ee,Mt]=l.useState(!1);l.useEffect(()=>{Te(!1),Mt(!1)},[R,t]);const ns=l.useCallback(s=>{q(s),ps(Fe.SPOTLIGHT_QUERY,s)},[]);l.useEffect(()=>{t&&(q(Ht()),ee(0))},[t]),l.useEffect(()=>{if(!t){ge([]),ye(!1);return}const s=R.trim();if(s.length<Nn){ge([]),ye(!1);return}ge([]),ye(!0);let i=!1;const g=setTimeout(()=>{vn(s).then(I=>{i||ge(I)}).catch(()=>{i||ge([])}).finally(()=>{i||ye(!1)})},250);return()=>{i=!0,clearTimeout(g)}},[t,R]);const Ct=(M.fileSearchExcludeDirs??it).join(",");l.useEffect(()=>{if(!t){pe([]),xe(!1);return}const s=R.trim();if(s.length<bn){pe([]),xe(!1);return}pe([]),xe(!0);let i=!1;const g=setTimeout(()=>{ys(s,{exclude:M.fileSearchExcludeDirs??[...it],limit:jn}).then(I=>{i||pe(I)}).catch(()=>{i||pe([])}).finally(()=>{i||xe(!1)})},250);return()=>{i=!0,clearTimeout(g)}},[t,R,Ct,M.fileSearchExcludeDirs]),l.useEffect(()=>{if(!t){te([]),ve(!1);return}const s=R.trim();if(s.length<Tn){te([]),ve(!1);return}te([]),ve(!0);const i=new AbortController,g=setTimeout(()=>{As(s,{exclude:M.fileSearchExcludeDirs??[...it],limit:Rn,signal:i.signal}).then(I=>{i.signal.aborted||te(I)}).catch(()=>{i.signal.aborted||te([])}).finally(()=>{i.signal.aborted||ve(!1)})},300);return()=>{clearTimeout(g),i.abort()}},[t,R,Ct,M.fileSearchExcludeDirs]),l.useEffect(()=>{if(!t){k({query:"",rows:[]}),v(!1);return}const s=R.trim();if(s.length<kn){k({query:"",rows:[]}),v(!1);return}k({query:"",rows:[]}),v(!0);let i=!1;const g=setTimeout(()=>{xs(s,{limit:Fn}).then(I=>{i||k({query:s,rows:I})}).catch(()=>{i||k({query:"",rows:[]})}).finally(()=>{i||v(!1)})},250);return()=>{i=!0,clearTimeout(g)}},[t,R]);const nt=l.useCallback(s=>{$e(s),Es(Fe.SPOTLIGHT_TAB,s)},[]),St=l.useRef(ie);St.current=ie;const rs=l.useCallback(s=>{const i=we.indexOf(St.current),g=we[(i+s+we.length)%we.length];nt(g)},[nt]);l.useEffect(()=>{ee(0)},[ie]);const rt=X.getShortcuts(),Oe=l.useMemo(()=>t?Ms():{},[t]),Ge=l.useMemo(()=>{if(!t)return[];const s=window.matchMedia("(pointer: coarse)").matches,i=rt.find(I=>I.id==="spawn-agent"),g=rt.find(I=>I.id==="toggle-commander");return[{id:"cmd-spawn",type:"command",title:"Spawn New Agent",subtitle:s?"":i?Rt(i):"Alt+N",icon:c.jsx(O,{name:"plus",size:16}),action:()=>{b.current(),L.current()}},{id:"cmd-commander",type:"command",title:"Commander View",subtitle:s?"":g!=null&&g.key?Rt(g):"Tab",icon:c.jsx(O,{name:"dashboard",size:16}),action:()=>{b.current(),G.current()}},{id:"cmd-settings",type:"command",title:"Settings & Tools",subtitle:"Configure Tide Commander",icon:c.jsx(O,{name:"gear",size:16}),action:()=>{b.current(),ce.current()}},{id:"cmd-monitoring",type:"command",title:"Monitoring & Logs",subtitle:"Triggers, workflows, events",icon:c.jsx(O,{name:"chart-line",size:16}),action:()=>{var I;b.current(),(I=oe.current)==null||I.call(oe)}}]},[t,rt]),Ue=l.useMemo(()=>{if(!t)return[];const s=R.trim();return(s?Rs(s):Ls).map(g=>({id:`setting-${g.id}`,type:"setting",title:g.title,subtitle:s?`Settings section • ${s}`:"Settings section",icon:c.jsx(O,{name:"gear",size:16}),_searchText:`${g.title} ${g.keywords.join(" ")}`,action:()=>{b.current(),ce.current(s||g.title)}}))},[t,R]),He=l.useMemo(()=>{const s=new Map;if(!t)return s;const i=Array.from(E.values());for(const g of y.values())for(const I of i)if(X.isPositionInArea({x:g.position.x,z:g.position.z},I)){s.set(g.id,I);break}return s},[t,y,E]),be=l.useMemo(()=>t?Array.from(y.values()).map(s=>{const i=[];s.lastAssignedTask&&i.push(s.lastAssignedTask);const g=`${s.class} • ${s.cwd}`,I=He.get(s.id),B=(I==null?void 0:I.name)||"";let T=`${s.name} ${s.class} ${s.status} ${s.cwd}`;s.taskLabel&&(T+=` ${s.taskLabel}`),B&&(T+=` ${B}`),i.length>0&&(T+=` ${i.join(" ")}`);const K=Date.now()-s.lastActivity;let $;return s.lastAssignedTask&&(s.lastAssignedTask.length>150?$=s.lastAssignedTask.slice(0,150)+"...":$=s.lastAssignedTask),{id:`agent-${s.id}`,type:"agent",title:s.name,subtitle:g,lastUserInput:$,timeAway:K,icon:c.jsx(Dt,{agent:s,size:20}),_searchText:T,_userQueries:i,_agentId:s.id,_lastActivity:s.lastActivity,_taskLabel:s.taskLabel,_status:s.status,_provider:s.provider??"claude",_piModel:s.piModel,_piModelProvider:s.piModelProvider,_areaName:B||void 0,_areaColor:I==null?void 0:I.color,action:()=>{b.current(),Lt(s.id),X.selectAgent(s.id),X.getState().viewMode!=="flat"&&X.requestTerminalExpand()}}}):[],[t,y,He]),We=l.useMemo(()=>t?Array.from(E.values()).map(s=>{var i;return{id:`area-${s.id}`,type:"area",title:s.name,subtitle:`${s.assignedAgentIds.length} agents • ${((i=s.directories)==null?void 0:i.length)||0} folders`,icon:c.jsx(O,{name:"map",size:16}),action:()=>{b.current(),X.selectArea(s.id)}}}):[],[t,E]),Ye=l.useMemo(()=>{const s=new Map;for(const i of be)i._agentId&&s.set(i._agentId,i);return s},[be]),_t=l.useMemo(()=>{const s=new Map;if(!t)return s;for(const i of y.values()){const g=He.get(i.id);if(!g||g.archived)continue;const I=s.get(g.id);I?I.push(i):s.set(g.id,[i])}return s},[t,y,He]),It=l.useMemo(()=>{const s=new Map;for(const i of N)s.has(i.agentId)||s.set(i.agentId,i.timestamp);return s},[N]),ot=l.useMemo(()=>{if(!t)return[];const s=R.trim().toLowerCase(),i=ke(s),g=Cs({sortMode:Bn(),agentsWithUnseenOutput:D,getLatestToolTimestamp:T=>It.get(T)}),I=Array.from(E.values()).filter(T=>!T.archived).filter(T=>{if(i.length===0)return!0;const K=T.name.toLowerCase();return i.some($=>K.includes($))}).sort((T,K)=>T.name.localeCompare(K.name,void 0,{sensitivity:"base"})),B=[];for(const T of I){const K=T.name.toLowerCase(),$=i.filter(W=>!K.includes(W));let H=(_t.get(T.id)||[]).slice().sort(g).map(W=>Ye.get(W.id)).filter(W=>!!W);$.length>0&&(H=H.filter(W=>{const z=`${W.title} ${W.subtitle||""} ${W._searchText||""}`.toLowerCase();return $.every(F=>z.includes(F))}),H.length===0)||!s&&H.length===0||B.push({areaId:T.id,areaName:T.name,areaColor:T.color,agents:H})}return B},[t,R,E,_t,Ye,D,It]),qe=l.useMemo(()=>t?Array.from(A.values()).filter(s=>s.type==="server"||s.type==="boss"||s.type==="database"||s.type==="tests").map(s=>{var $,re,H,W,z;const i=s.status==="running"?"#4ade80":s.status==="stopped"?"#f87171":"#facc15",g=s.type==="boss"?"crown":s.type==="database"?"database":s.type==="tests"?"flask":"desktop",I=s.type==="boss"?"Boss":s.type==="database"?"Database":s.type==="tests"?"Tests":"Server";let B=`${I} • ${s.status}`;if(s.type==="database"&&((re=($=s.database)==null?void 0:$.connections)!=null&&re.length)){const F=s.database.connections[0];B+=` • ${F.engine} @ ${F.host}`}else s.type==="tests"&&s.folderPath?B=`${I} • ${s.folderPath}`:s.cwd&&(B+=` • ${s.cwd}`);const T=((H=s.pm2Status)==null?void 0:H.ports)||[];let K=`${s.name} ${s.type} ${s.status} ${s.cwd||""} ${((W=s.pm2)==null?void 0:W.name)||""}`;if(s.type==="tests"&&(K+=` ${s.folderPath||""} tests junit maven`),T.length>0&&(K+=` ${T.join(" ")}`),s.type==="database"&&((z=s.database)!=null&&z.connections))for(const F of s.database.connections)K+=` ${F.name} ${F.engine} ${F.host} ${F.database||""} mysql postgresql sql`;return{id:`building-${s.id}`,type:"building",title:s.name,subtitle:B,_ports:T,icon:c.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[c.jsx(O,{name:"status-pending",size:10,weight:"fill",color:i}),c.jsx(O,{name:g,size:16})]}),_searchText:K,action:()=>{var F;b.current(),s.type==="boss"?Y.current(s.id):s.type==="database"?J.current(s.id):s.type==="tests"?X.openTestsBuilding(s.id):s.type==="http"?X.openHttpBuilding(s.id):(F=s.pm2)!=null&&F.enabled&&U.current(s.id)}}}):[],[t,A]),vt=l.useMemo(()=>t?Be.map(s=>{const i=s.isGitRepo&&s.gitBranch?`${s.path} • ${s.gitBranch}`:s.path;return{id:`folder-${s.path}`,type:"folder",title:s.name,subtitle:i,matchedText:s.path,icon:c.jsx(O,{name:s.isGitRepo?"git-branch":"folder",size:16}),_searchText:`${s.name} ${s.path}`,_isGitRepo:s.isGitRepo,_gitBranch:s.gitBranch,action:()=>{b.current(),X.openFileExplorer(s.path)}}}):[],[t,Be]),Ve=l.useMemo(()=>t?Pe.map(s=>{const i=s.areaName&&s.areaName!==s.projectName?`${s.projectName} · ${s.areaName}`:s.projectName;return{id:`file-${s.path}`,type:"file",title:s.name,subtitle:s.relativePath,matchedText:`${s.path} ${i}`,icon:kt(s.path),_searchText:`${s.name} ${s.relativePath} ${s.path} ${s.projectName} ${s.areaName}`,_projectName:s.projectName,_areaName:s.areaName,action:()=>{b.current(),Q.current({filePath:s.path,projectRoot:s.projectRoot,searchQuery:R.trim()})}}}):[],[t,Pe,R]),Xe=l.useMemo(()=>t?Qe.map(s=>{const i=s.matches[0],g=s.areaName&&s.areaName!==s.projectName?`${s.projectName} · ${s.areaName}`:s.projectName;return{id:`file-content-${s.path}`,type:"file-content",title:s.name,subtitle:`${s.relativePath}${i!=null&&i.line?`:${i.line}`:""}`,matchedQuery:i==null?void 0:i.content,matchedText:`${s.path} ${g}`,icon:kt(s.path),_projectName:s.projectName,_areaName:s.areaName,_lineNumber:i==null?void 0:i.line,action:()=>{b.current(),Q.current({filePath:s.path,projectRoot:s.projectRoot,targetLine:i==null?void 0:i.line,searchQuery:R.trim()})}}}):[],[t,Qe,R]),Me=l.useMemo(()=>{if(!t)return[];const s=i=>{const g=Date.now()-new Date(i).getTime();return!Number.isFinite(g)||g<0?"":g<36e5?`${Math.max(1,Math.floor(g/6e4))}m`:g<864e5?`${Math.floor(g/36e5)}h`:`${Math.floor(g/864e5)}d`};return S.rows.map(i=>{var W;const g=Array.from(y.values()).find(z=>z.sessionId===i.sessionId),I=g??(i.agentId?y.get(i.agentId):void 0),B=(i.firstPrompt||i.snippet||i.sessionId).slice(0,90),T=[i.projectPath||i.projectDir];I&&T.push(`→ ${I.name}${g?"":" (past session)"}`);const K=(W=i.extracts)==null?void 0:W.map(z=>z.timestamp?Date.parse(z.timestamp):Number.NaN).find(Number.isFinite),$=Date.parse(i.lastModified),re=K??(Number.isFinite($)?$:void 0),H=re===void 0?"":s(re);return H&&T.push(H),T.push(`${i.totalMatches}×`),{id:`session-${i.sessionId}`,type:"session",title:B,subtitle:T.join(" • "),matchedQuery:i.snippet||void 0,matchedExtracts:i.extracts&&i.extracts.length>0?i.extracts:void 0,_agentId:I==null?void 0:I.id,_sessionMatches:i.totalMatches,_sessionNearbyMatches:i.nearbyMatches,_matchedMessageAt:re,_provider:i.provider||"claude",icon:I?c.jsx(Dt,{agent:I,size:20}):c.jsx(O,{name:"history",size:16}),action:()=>{var F;b.current();const z=Array.from(X.getState().agents.values()).find(je=>je.sessionId===i.sessionId);z?(Lt(z.id),X.selectAgent(z.id),X.getState().viewMode!=="flat"&&X.requestTerminalExpand(),X.requestTerminalSearch(z.id,S.query)):(F=le.current)==null||F.call(le,{initialQuery:S.query,initialSessionKey:`${i.projectPath}::${i.sessionId}`})}}})},[t,S,y]),Nt=l.useMemo(()=>new de(be,{keys:["title","subtitle","_searchText","lastUserInput"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[be]),bt=l.useMemo(()=>new de(Ge,{keys:["title","subtitle"],threshold:.4,includeScore:!0,includeMatches:!0}),[Ge]),jt=l.useMemo(()=>new de(We,{keys:["title","subtitle"],threshold:.4,includeScore:!0,includeMatches:!0}),[We]),wt=l.useMemo(()=>new de(qe,{keys:["title","subtitle","_searchText"],threshold:.4,ignoreLocation:!0,includeScore:!0,includeMatches:!0}),[qe]),Re=l.useMemo(()=>{if(!R.trim()){const p=[];p.push(...qe);const _=[...be].sort((w,P)=>{const Z=at(w._agentId,w._lastActivity,Oe);return at(P._agentId,P._lastActivity,Oe)-Z});p.push(..._),p.push(...We.slice(0,2));const j={};return Ut.forEach((w,P)=>{j[w]=P}),p.sort((w,P)=>(j[w.type]??999)-(j[P.type]??999)),p}const s=R.trim().toLowerCase(),i=ke(s),g=Ze(Nt,R).slice(0,30),I=Ze(jt,R).slice(0,2),B=vt.slice(0,8),T=Ve.slice(0,wn),K=Ue.slice(0,Dn),$=Ze(wt,R).filter(p=>{const _=p.score??1,j=`${p.item.title} ${p.item.subtitle||""} ${p.item._searchText||""}`.toLowerCase();return i.every(w=>j.includes(w))||_<=.2}).slice(0,4),re={agent:6,building:5,folder:4,file:4,"file-content":4,setting:4,command:3,area:2,"modified-file":1,session:0},H=p=>Mn(s,p.title,`${p.subtitle||""} ${p._searchText||""} ${p.matchedText||""}`),W=(p,_)=>{const j=(1-Math.min(1,_??1))*4;return H(p)*100+(re[p.type]??0)*5+j},z=new Map,F=(p,_)=>{const j=z.get(p.type),w={item:p,score:W(p,_)};j?j.push(w):z.set(p.type,[w])},je=new Map;for(const p of Me)p._agentId&&!je.has(p._agentId)&&je.set(p._agentId,p);for(const p of g){const _={...p.item};if(_._userQueries&&_._userQueries.length>0){const w=_._userQueries.find(P=>i.some(Z=>P.toLowerCase().includes(Z)));if(w){const P=w.toLowerCase(),Z=P.includes(s)?s:i.find(he=>P.includes(he))??s;if(w.length>200){const he=P.indexOf(Z),Le=Math.max(0,he-60),De=Math.min(w.length,he+Z.length+100);_.matchedQuery=(Le>0?"...":"")+w.slice(Le,De)+(De<w.length?"...":"")}else _.matchedQuery=w}}const j=_._agentId?je.get(_._agentId):void 0;if(j){_.matchedQuery||(_.matchedQuery=j.matchedQuery);const w=_.matchedQuery,P=(w==null?void 0:w.toLowerCase())??"";_.matchedExtracts=In(w&&i.every(Z=>P.includes(Z))?w:void 0,j.matchedExtracts),_.action=j.action,_._sessionMatches=j._sessionMatches,_._sessionNearbyMatches=j._sessionNearbyMatches,_._matchedMessageAt=j._matchedMessageAt,_._searchText=`${_._searchText||""} ${j.matchedQuery||""} ${s}`}F(_,p.score)}for(const[p,_]of je){if(g.some(w=>w.item._agentId===p))continue;const j=Ye.get(p);j&&F({...j,matchedQuery:_.matchedQuery,matchedExtracts:_.matchedExtracts,action:_.action,_sessionMatches:_._sessionMatches,_sessionNearbyMatches:_._sessionNearbyMatches,_matchedMessageAt:_._matchedMessageAt,_searchText:`${j._searchText||""} ${_.matchedQuery||""} ${s}`},void 0)}for(const p of $)F(p.item,p.score);for(const p of I)F(p.item,p.score);for(const p of K)F(p,void 0);for(const p of B)F(p,void 0);for(const p of T)F(p,void 0);for(const p of Xe.slice(0,Ln))F(p,void 0);const cs=24*36e5,ls=Date.now(),Tt=p=>{const _=at(p.item._agentId,p.item._lastActivity,Oe),j=Math.exp(-Math.LN2*Math.max(0,ls-_)/cs),w=p.item._sessionMatches??0,P=Math.log2(1+w),Z=p.item._sessionNearbyMatches;return(Z===void 0?P:Z>0?8+Math.log2(1+Z)+P*.1:P*.2)+(p.item._matchedMessageAt===void 0?2*j:0)};for(const[p,_]of z)p==="agent"?_.sort((j,w)=>{const P=H(j.item),Z=H(w.item);if(Z!==P)return Z-P;const Se=j.item._matchedMessageAt,he=w.item._matchedMessageAt;if(Se!==void 0||he!==void 0){if(Se===void 0)return 1;if(he===void 0)return-1;if(he!==Se)return he-Se}const Le=Tt(j),De=Tt(w);return De!==Le?De-Le:w.score-j.score}):_.sort((j,w)=>w.score-j.score);const Ce=[];for(const p of Ut){if(p==="session"){!Ee&&Me.length>ut?(Ce.push(...Me.slice(0,ut)),Ce.push({id:"session-show-all",type:"session",title:`Show all conversations (${Me.length})`,subtitle:`${Me.length-ut} more matches`,icon:c.jsx(O,{name:"arrow-down",size:16}),action:()=>Mt(!0)})):Ce.push(...Me);continue}const _=z.get(p);if(_){if(p==="agent"&&!Ne&&_.length>ht){for(const j of _.slice(0,ht))Ce.push(j.item);Ce.push({id:"agent-show-all",type:"agent",title:`Show all agents (${_.length})`,subtitle:`${_.length-ht} more matches`,icon:c.jsx(O,{name:"arrow-down",size:16}),action:()=>Te(!0)});continue}for(const j of _)Ce.push(j.item)}}return Ce},[R,Nt,jt,wt,be,Ye,We,qe,Ue,vt,Ve,Xe,Me,Oe,Ne,Ee]),ae=l.useMemo(()=>{switch(ie){case"agents":return Re.filter(s=>s.type==="agent");case"buildings":return Re.filter(s=>s.type==="building");case"commands":return R.trim()?Ze(bt,R).slice(0,3).map(s=>s.item):Ge;case"folders":return Re.filter(s=>s.type==="folder");case"files":return Ve;case"contents":return Xe;case"settings":return Ue;case"areas":return ot.flatMap(s=>s.agents);case"all":default:return Re}},[ie,Re,ot,Ve,Xe,Ue,R,bt,Ge]),os=l.useMemo(()=>{const s=[];if(Ke&&s.push("session"),Ie&&s.push("file"),ze&&s.push("file-content"),se&&s.push("folder"),ie==="all")return s;const g={buildings:"building",folders:"folder",files:"file",contents:"file-content",agents:"agent",settings:"setting",commands:"command"}[ie];return g&&s.includes(g)?[g]:[]},[ie,Ke,Ie,ze,se]);l.useEffect(()=>{V>=ae.length&&ee(Math.max(0,ae.length-1))},[ae.length,V]);const is=l.useCallback(s=>{if(s.altKey&&!s.ctrlKey&&!s.metaKey&&(s.key==="p"||s.key==="n"||s.key==="P"||s.key==="N")){s.preventDefault(),s.stopPropagation(),s.nativeEvent.stopImmediatePropagation();const i=s.key.toLowerCase();ee(i==="p"?g=>g>0?g-1:ae.length-1:g=>g<ae.length-1?g+1:0);return}switch(s.key){case"Escape":s.preventDefault(),b.current();break;case"ArrowUp":s.preventDefault(),ee(i=>i>0?i-1:ae.length-1);break;case"ArrowDown":s.preventDefault(),ee(i=>i<ae.length-1?i+1:0);break;case"Enter":s.preventDefault(),ae[V]&&ae[V].action();break}},[ae,V]),as=l.useCallback((s,i)=>{if(!i||!s)return s;const g=ke(i);if(g.length===0)return s;const I=new RegExp(g.map(En).sort((re,H)=>H.length-re.length).join("|"),"gi"),B=[];let T=0,K=0,$;for(;($=I.exec(s))!==null;)$.index>T&&B.push(s.slice(T,$.index)),B.push(ct.createElement("mark",{key:K++,className:"spotlight-highlight"},$[0])),T=$.index+$[0].length;return T<s.length&&B.push(s.slice(T)),B.length>0?ct.createElement(ct.Fragment,null,...B):s},[]);return{query:R,setQuery:ns,selectedIndex:V,setSelectedIndex:ee,results:ae,loadingTypes:os,activeTab:ie,setActiveTab:nt,cycleTab:rs,areaSections:ot,handleKeyDown:is,highlightMatch:as}}const Qn=l.forwardRef(function({query:e,onQueryChange:n,onKeyDown:r,onResetSelection:o,commandMode:a=!1,executingCommand:u=!1},d){const{t:h}=st(["common"]);return c.jsxs("div",{className:`spotlight-input-wrapper${a?" is-command-mode":""}`,children:[c.jsx("span",{className:"spotlight-search-icon",children:a?"›_":"⌘"}),c.jsx("input",{ref:d,type:"text",className:"spotlight-input",placeholder:h("common:search.spotlightPlaceholder"),value:e,onChange:f=>{n(f.target.value),o()},onKeyDown:r,autoFocus:!0,spellCheck:!1,disabled:u,"aria-label":a?"Plugin command":void 0}),c.jsxs("div",{className:"spotlight-input-hints",children:[c.jsx("span",{className:"spotlight-shortcut-hint",children:"↑↓"}),c.jsx("span",{className:"spotlight-shortcut-hint",children:"Enter"}),c.jsx("span",{className:"spotlight-shortcut-hint",children:"Esc"})]})]})}),zn=l.memo(function({activeTab:e,onSelect:n}){const{t:r}=st(["terminal"]);return c.jsxs("div",{className:"spotlight-tabs",role:"tablist","aria-label":r("terminal:spotlight.tabsLabel"),children:[we.map(o=>c.jsx("button",{type:"button",role:"tab","aria-selected":o===e,tabIndex:-1,className:`spotlight-tab${o===e?" active":""}`,onClick:()=>n(o),children:r(`terminal:spotlight.tabs.${o}`)},o)),c.jsx("span",{className:"spotlight-tabs-hint",children:c.jsx("kbd",{children:"Tab"})})]})}),Kn=l.forwardRef(function({results:e,loadingTypes:n,selectedIndex:r,query:o,activeTab:a,areaSections:u,highlightMatch:d,onSelectIndex:h},f){const{t:m}=st(["terminal"]),x=l.useRef(!1);l.useEffect(()=>{x.current=!1},[e]),l.useEffect(()=>{const A=typeof f=="function"?null:f==null?void 0:f.current;if(!A)return;const M=()=>{x.current=!0};return A.addEventListener("mousemove",M),()=>{A.removeEventListener("mousemove",M)}},[f,e]);const y={command:m("terminal:spotlight.categories.commands"),agent:m("terminal:spotlight.categories.agents"),building:m("terminal:spotlight.categories.infrastructure"),setting:m("terminal:spotlight.categories.settings"),area:m("terminal:spotlight.categories.areas"),folder:m("terminal:spotlight.categories.folders"),file:m("terminal:spotlight.categories.files"),"file-content":m("terminal:spotlight.categories.fileContents"),"modified-file":m("terminal:spotlight.categories.modifiedFiles"),session:m("terminal:spotlight.categories.sessions")},E=l.useMemo(()=>{const A=[];let M=null,N=[];e.forEach((b,L)=>{b.type!==M&&(M!==null&&N.length>0&&A.push([M,N]),M=b.type,N=[]),N.push({result:b,index:L})}),M!==null&&N.length>0&&A.push([M,N]);for(const b of n)A.some(([L])=>L===b)||A.push([b,[]]);const D=["agent","session","building","setting","file","file-content","folder","area","command"];return A.sort(([b],[L])=>D.indexOf(b)-D.indexOf(L)),A},[e,n]);if(l.useEffect(()=>{if(!f||typeof f=="function")return;const A=f.current;if(!A)return;const M=A.querySelector(".spotlight-item.selected");M&&M.scrollIntoView({block:"nearest",behavior:"smooth"})},[r,f]),a==="areas"){if(u.length===0)return c.jsx("div",{className:"spotlight-results",ref:f,children:c.jsx("div",{className:"spotlight-empty",children:m("terminal:spotlight.noResults")})});let A=0;return c.jsx("div",{className:"spotlight-results",ref:f,children:u.map(M=>c.jsxs("div",{children:[c.jsxs("div",{className:"spotlight-category-header spotlight-area-section-header",children:[c.jsx("span",{className:"spotlight-area-dot",style:{background:M.areaColor},"aria-hidden":"true"}),c.jsx("span",{className:"spotlight-area-name",children:M.areaName}),c.jsx("span",{className:"spotlight-area-count",children:M.agents.length})]}),M.agents.length===0?c.jsx("div",{className:"spotlight-area-empty",children:m("terminal:spotlight.noAgentsInArea")}):M.agents.map(N=>{const D=A++;return c.jsx(Ft,{result:N,isSelected:D===r,query:o,highlightMatch:d,onClick:()=>N.action(),onMouseEnter:()=>{x.current&&h(D)}},N.id)})]},M.areaId))})}return e.length===0&&n.length===0?c.jsx("div",{className:"spotlight-results",ref:f,children:c.jsx("div",{className:"spotlight-empty",children:m("terminal:spotlight.noResults")})}):c.jsx("div",{className:"spotlight-results",ref:f,children:E.map(([A,M])=>c.jsxs("div",{children:[(a==="all"||E.length>1)&&c.jsx("div",{className:"spotlight-category-header",children:y[A]||A}),n.includes(A)&&c.jsxs("div",{className:"spotlight-block-loading",role:"status",children:[c.jsx("span",{className:"spotlight-loading-spinner","aria-hidden":"true"}),m("terminal:spotlight.searching")]}),M.map(({result:N,index:D})=>c.jsx(Ft,{result:N,isSelected:D===r,query:o,highlightMatch:d,onClick:()=>N.action(),onMouseEnter:()=>{x.current&&h(D)}},N.id))]},A))})}),On=l.memo(function({commandMode:e=!1}){const{t:n}=st(["terminal"]);return c.jsxs("div",{className:"spotlight-footer",children:[c.jsxs("div",{className:"spotlight-footer-left",children:[c.jsxs("span",{className:"spotlight-footer-hint",children:[c.jsx("kbd",{children:"↑"}),c.jsx("kbd",{children:"↓"})," ",c.jsx("kbd",{children:"Alt+N"}),c.jsx("kbd",{children:"Alt+P"})," ",n("terminal:spotlight.navigate")]}),c.jsxs("span",{className:"spotlight-footer-hint",children:[c.jsx("kbd",{children:"Enter"})," ",e?"run command":n("terminal:spotlight.select")]}),c.jsxs("span",{className:"spotlight-footer-hint",children:[c.jsx("kbd",{children:"Tab"})," ",e?"complete command":n("terminal:spotlight.switchTabs")]})]}),c.jsx("div",{className:"spotlight-footer-right",children:c.jsxs("span",{className:"spotlight-footer-hint",children:[c.jsx("kbd",{children:"Esc"})," ",n("common:buttons.close")]})})]})});function Gn({detail:t,onClose:e}){const[n,r]=l.useState(null),[o,a]=l.useState(!0),[u,d]=l.useState(null);_s("spotlight-file-detail",!0,e),l.useEffect(()=>{const E=new AbortController;return a(!0),d(null),r(null),(async()=>{try{const M=await dt(ft(`/api/files/read?path=${encodeURIComponent(t.filePath)}`),{signal:E.signal}),N=await M.json();if(!M.ok)throw new Error(N.error||"Unable to read file");let D=null;if(!N.binary)try{const b=await dt(ft(`/api/files/git-original?path=${encodeURIComponent(t.filePath)}`),{signal:E.signal}),L=await b.json();b.ok&&!L.binary&&typeof L.content=="string"&&(D=L.content)}catch{}E.signal.aborted||r({filename:N.filename||t.filePath.split("/").pop()||t.filePath,content:typeof N.content=="string"?N.content:"",originalContent:D,binary:N.binary===!0})}catch(M){E.signal.aborted||d(M instanceof Error?M.message:"Unable to load file")}finally{E.signal.aborted||a(!1)}})(),()=>E.abort()},[t.filePath]),l.useEffect(()=>{const E=A=>{A.key==="Escape"&&(A.preventDefault(),A.stopImmediatePropagation(),e())};return document.addEventListener("keydown",E,!0),()=>document.removeEventListener("keydown",E,!0)},[e]);const h=()=>{X.revealFileInExplorer(t.filePath,t.projectRoot,t.targetLine),e()},f=(n==null?void 0:n.filename)||t.filePath,m=f.lastIndexOf(".")>=0?f.slice(f.lastIndexOf(".")):"",x=Is(m),y=(n==null?void 0:n.originalContent)!=null&&n.originalContent!==n.content;return c.jsx("div",{className:"guake-git-diff-modal-overlay",onClick:e,children:c.jsxs("div",{className:"guake-git-diff-modal",onClick:E=>E.stopPropagation(),children:[c.jsxs("div",{className:"guake-git-diff-modal-header",children:[c.jsxs("div",{className:"guake-git-diff-path spotlight-file-detail-path",title:t.filePath,children:[t.filePath,t.targetLine?c.jsxs("span",{className:"spotlight-file-detail-line",children:[":",t.targetLine]}):null]}),c.jsxs("button",{type:"button",className:"spotlight-file-detail-explorer",onClick:h,title:"Open in File Explorer",children:[c.jsx(O,{name:"folder-open",size:14}),"Open in File Explorer"]}),c.jsx("button",{className:"guake-git-close",onClick:e,title:"Close (Esc)",children:c.jsx(O,{name:"close",size:14})})]}),c.jsxs("div",{className:"guake-git-diff-content",children:[o&&c.jsx("div",{className:"guake-git-diff-loading-overlay",children:c.jsx("div",{className:"diff-image-spinner"})}),u&&c.jsx("div",{className:"spotlight-file-detail-message",children:u}),(n==null?void 0:n.binary)&&c.jsx("div",{className:"spotlight-file-detail-message",children:"Binary preview is available in the File Explorer."}),n&&!n.binary&&(y?c.jsx($t,{originalContent:n.originalContent||"",modifiedContent:n.content,filename:n.filename,filePath:t.filePath,language:x,searchQuery:t.searchQuery,targetLine:t.targetLine}):c.jsx($t,{originalContent:"",modifiedContent:n.content,filename:n.filename,filePath:t.filePath,language:x,initialModifiedOnly:!0,searchQuery:t.searchQuery,targetLine:t.targetLine,readOnly:!0}))]})]})})}const Un=l.forwardRef(function({commands:e,selectedIndex:n,executing:r,error:o,onSelectIndex:a,onExecute:u},d){return l.useEffect(()=>{var h,f;!d||typeof d=="function"||(f=(h=d.current)==null?void 0:h.querySelector(".spotlight-command-item.selected"))==null||f.scrollIntoView({block:"nearest"})},[d,n]),c.jsxs("div",{className:"spotlight-results spotlight-command-results",ref:d,children:[c.jsxs("div",{className:"spotlight-command-mode-banner",children:[c.jsx("span",{className:"spotlight-command-mode-icon",children:c.jsx(O,{name:"terminal",size:13})}),c.jsxs("div",{children:[c.jsx("strong",{children:"Plugin command mode"}),c.jsx("span",{children:"Runs locally without sending a prompt to an AI agent"})]})]}),o&&c.jsxs("div",{className:"spotlight-command-error",role:"alert",children:[c.jsx(O,{name:"warn",size:13}),c.jsx("span",{children:o})]}),e.length===0?c.jsxs("div",{className:"spotlight-empty spotlight-command-empty",children:[c.jsx(O,{name:"search",size:18}),c.jsx("strong",{children:"No matching plugin command"}),c.jsxs("span",{children:["Type ",c.jsx("code",{children:"/"})," to see enabled plugin commands."]})]}):e.map((h,f)=>c.jsxs("button",{type:"button",className:`spotlight-item spotlight-command-item${f===n?" selected":""}`,disabled:r,onMouseEnter:()=>a(f),onClick:()=>u(h),children:[c.jsx("span",{className:"spotlight-item-icon spotlight-command-item-icon",children:c.jsx(O,{name:"plug",size:16})}),c.jsxs("span",{className:"spotlight-item-content",children:[c.jsxs("span",{className:"spotlight-item-header",children:[c.jsx("code",{className:"spotlight-command-name",children:h.name}),h.name!==h.canonicalName&&c.jsxs("span",{className:"spotlight-command-alias",children:["alias of ",h.canonicalName]})]}),c.jsx("span",{className:"spotlight-item-subtitle",children:h.summary})]}),c.jsx("span",{className:"spotlight-command-plugin-badge",children:h.pluginName}),r&&f===n?c.jsx("span",{className:"spotlight-loading-spinner","aria-label":"Running command"}):c.jsx("span",{className:"spotlight-command-enter",children:"↵"})]},`${h.pluginId}:${h.name}`))]})}),Hn=768;function Xn({isOpen:t,onClose:e,onOpenSpawnModal:n,onOpenCommanderView:r,onOpenToolbox:o,onOpenFileExplorer:a,onOpenPM2LogsModal:u,onOpenBossLogsModal:d,onOpenDatabasePanel:h,onOpenMonitoringModal:f,onOpenSessionFinder:m}){const x=l.useRef(null),y=l.useRef(null),E=l.useRef(null),A=l.useRef(0),M=l.useRef(!1),N=l.useRef(()=>{}),[D,b]=l.useState(null),[L,G]=l.useState(0),[ce,me]=l.useState(!1),[U,Y]=l.useState(null),[J,oe]=l.useState(null),le=vs(),{query:Q,setQuery:R,selectedIndex:q,setSelectedIndex:V,results:ee,loadingTypes:ie,activeTab:$e,setActiveTab:Be,cycleTab:ge,areaSections:Pe,handleKeyDown:pe,highlightMatch:Qe}=Pn({isOpen:t,onClose:e,onOpenSpawnModal:n,onOpenCommanderView:r,onOpenToolbox:o,onOpenFileExplorer:a,onOpenPM2LogsModal:u,onOpenBossLogsModal:d,onOpenDatabasePanel:h,onOpenMonitoringModal:f,onOpenSessionFinder:m,onOpenFileDetail:b}),te=Q.startsWith("/"),se=l.useMemo(()=>Ns(Q,bs()),[Q,le]),ye=l.useCallback(()=>{const v=se[L];if(!v)return;const S=Q.trim().replace(/^\S+/,"");R(`${v.name}${S}`),G(0)},[se,L,Q,R]),Ie=l.useCallback(async v=>{me(!0),Y(null);try{const S=v.pluginId===js||v.requiresAgent?X.getState().selectedAgentIds.values().next().value:void 0,k=await ws(v,Q,{agentId:S});k.kind==="output"&&oe(k),e()}catch(S){Y(S instanceof Error?S.message:String(S))}finally{me(!1)}},[e,Q]);A.current=te?se.length:ee.length,M.current=te,N.current=ye;const xe=l.useRef(ge);xe.current=ge,l.useEffect(()=>{t&&(oe(null),Y(null),setTimeout(()=>{var v,S;(v=x.current)==null||v.focus(),(S=x.current)==null||S.select()},50))},[t]),l.useEffect(()=>{if(!t)return;const v=window.visualViewport;if(!v||window.innerWidth>Hn)return;const S=()=>{const k=y.current;k&&(k.style.height=`${v.height}px`,k.style.top=`${v.offsetTop}px`)};return S(),v.addEventListener("resize",S),v.addEventListener("scroll",S),()=>{v.removeEventListener("resize",S),v.removeEventListener("scroll",S);const k=y.current;k&&(k.style.height="",k.style.top="")}},[t]),l.useEffect(()=>{if(!t)return;const v=S=>{if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation(),e();return}if(S.key==="Tab"){S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation(),M.current?N.current():xe.current(S.shiftKey?-1:1);return}if(S.altKey&&!S.ctrlKey&&!S.metaKey&&(S.key==="n"||S.key==="p"||S.key==="N"||S.key==="P")){S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation();const k=S.key.toLowerCase(),Ne=A.current;if(Ne===0)return;const Te=Ee=>k==="p"?Ee>0?Ee-1:Ne-1:Ee<Ne-1?Ee+1:0;M.current?G(Te):V(Te);return}};return window.addEventListener("keydown",v,{capture:!0}),()=>{window.removeEventListener("keydown",v,{capture:!0})}},[t,e]);const ze=l.useCallback(v=>{v.target===v.currentTarget&&e()},[e]),ve=l.useCallback(()=>{V(0),G(0),Y(null)},[V]);l.useEffect(()=>{L>=se.length&&G(Math.max(0,se.length-1))},[se.length,L]);const Ke=l.useCallback(v=>{if(!te){pe(v);return}const S=se.length;if(v.key==="ArrowUp"||v.key==="ArrowDown"){if(v.preventDefault(),S===0)return;G(k=>v.key==="ArrowUp"?k>0?k-1:S-1:k<S-1?k+1:0);return}if(v.key==="Tab"){v.preventDefault(),ye();return}if(v.key==="Enter"){v.preventDefault();const k=se[L];k&&!ce&&Ie(k)}},[se,te,L,ye,Ie,ce,pe]);return t?c.jsx("div",{ref:y,className:"spotlight-overlay",onClick:ze,children:c.jsxs("div",{className:"spotlight-modal",children:[c.jsx(Qn,{ref:x,query:Q,onQueryChange:R,onKeyDown:Ke,onResetSelection:ve,commandMode:te,executingCommand:ce}),!te&&c.jsx(zn,{activeTab:$e,onSelect:Be}),te?c.jsx(Un,{ref:E,commands:se,selectedIndex:L,executing:ce,error:U,onSelectIndex:G,onExecute:v=>void Ie(v)}):c.jsx(Kn,{ref:E,results:ee,loadingTypes:ie,selectedIndex:q,query:Q,activeTab:$e,areaSections:Pe,highlightMatch:Qe,onSelectIndex:V}),c.jsx(On,{commandMode:te})]})}):J?c.jsx(Ts,{command:J.command,output:J.output,onClose:()=>oe(null)}):D?c.jsx(Gn,{detail:D,onClose:()=>b(null)}):null}export{er as FILE_ICON_NAMES,Xn as Spotlight,On as SpotlightFooter,Qn as SpotlightInput,Ft as SpotlightItem,Kn as SpotlightResults,tr as formatDuration,sr as formatRelativeTime,nr as getAgentIcon,kt as getFileIconFromPath,rr as getTypeLabel,Pn as useSpotlightSearch};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as a,l as s,F as n,e as i}from"./mermaid.core-
|
|
1
|
+
import{_ as a,l as s,F as n,e as i}from"./mermaid.core-B6sgvfs-.js";import{p}from"./cynefin-VYW2F7L2-1rocbocI.js";import"./main-D0r07JA_.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-DYBBrXTx.js";var g={parse:a(async r=>{const e=await p("info",r);s.debug(e)},"parse")},v={version:"11.16.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,o)=>{s.debug(`rendering info diagram
|
|
2
2
|
`+r);const t=n(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),l={draw:c},y={parser:g,db:m,renderer:l};export{y as diagram};
|
package/dist/assets/{ishikawaDiagram-FXEZZL3T-C52xQkXn.js → ishikawaDiagram-FXEZZL3T-DSEmTd2f.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as o,c as ot,a1 as ut,F as dt,al as yt,q as ft,k as pt,o as it,a as gt,b as kt,g as mt,s as wt,p as _t,e as bt}from"./mermaid.core-
|
|
1
|
+
import{_ as o,c as ot,a1 as ut,F as dt,al as yt,q as ft,k as pt,o as it,a as gt,b as kt,g as mt,s as wt,p as _t,e as bt}from"./mermaid.core-B6sgvfs-.js";import"./main-D0r07JA_.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-DYBBrXTx.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],N={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],p=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var W in this.yy)Object.prototype.hasOwnProperty.call(this.yy,W)&&(C.yy[W]=this.yy[W]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(j,"popStack");function z(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}o(z,"lex");for(var A,F,B,K,H={},X,V,et,Y;;){if(F=i[i.length-1],this.defaultActions[F]?B=this.defaultActions[F]:((A===null||typeof A>"u")&&(A=z()),B=v[F]&&v[F][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[F])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
|
|
2
2
|
`+b.showPosition()+`
|
|
3
3
|
Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+A);switch(B[0]){case 1:i.push(A),p.push(b.yytext),n.push(b.yylloc),i.push(B[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[B[1]][1],H.$=p[p.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(H,[w,S,I,C.yy,B[1],p,n].concat(R)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[B[1]][0]),p.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|
package/dist/assets/{journeyDiagram-5HDEW3XC-DyobJuKu.js → journeyDiagram-5HDEW3XC-3_c5LjHs.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as gt}from"./chunk-5VM5RSS4-
|
|
1
|
+
import{g as gt}from"./chunk-5VM5RSS4-D-B4g6BP.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-32BRIVSS-ClxbX6JR.js";import{g as _t,s as vt,a as bt,b as wt,p as Tt,o as St,_ as s,c as R,d as X,e as $t,q as Mt}from"./mermaid.core-B6sgvfs-.js";import{d as it}from"./arc-D8Dnwz7O.js";import"./main-D0r07JA_.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-DYBBrXTx.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
3
|
Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as c,l as te,c as W,F as fe,af as ye,ag as be,ah as me,ad as _e,D as K,i as G,Y as ke,Z as Ee,aa as Se,ab as le,ac as ce}from"./mermaid.core-
|
|
1
|
+
import{_ as c,l as te,c as W,F as fe,af as ye,ag as be,ah as me,ad as _e,D as K,i as G,Y as ke,Z as Ee,aa as Se,ab as le,ac as ce}from"./mermaid.core-B6sgvfs-.js";import{g as Ne}from"./chunk-5VM5RSS4-D-B4g6BP.js";import"./main-D0r07JA_.js";import"./vendor-react--Eh9ivFN.js";import"./vendor-three-DYBBrXTx.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],M=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:M}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:U,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:M}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:U,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Z=m.yylloc;e.push(Z);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,q,F={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Q="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Q="Parse error on line "+(z+1)+`:
|
|
2
2
|
`+m.showPosition()+`
|
|
3
3
|
Expecting `+Y.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Q="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Q,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:Z,expected:Y})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,Z=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],F.$=u[u.length-I],F._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(F._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),q=this.performAction.apply(F,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof q<"u")return q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(F.$),e.push(F._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=(function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b9 as j,ba as p,bb as w,bc as k,bd as q}from"./mermaid.core-
|
|
1
|
+
import{b9 as j,ba as p,bb as w,bc as k,bd as q}from"./mermaid.core-B6sgvfs-.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=N(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=N(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function N(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function d(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=d(u,e),f=t(a,f)):(e=d(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=d(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=N,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
|