tide-commander 1.22.0 → 1.24.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.
Files changed (43) hide show
  1. package/dist/assets/{BossLogsModal-CePVQGGC.js → BossLogsModal-BYAF8UI-.js} +1 -1
  2. package/dist/assets/{BossSpawnModal-BmXNtJmQ.js → BossSpawnModal-CXu6f6_v.js} +1 -1
  3. package/dist/assets/{ControlsModal-DVW8_y-c.js → ControlsModal-Cl_eQN29.js} +1 -1
  4. package/dist/assets/{DockerLogsModal-CnjeFG_m.js → DockerLogsModal-DvSr5OXj.js} +1 -1
  5. package/dist/assets/{EmbeddedEditor-0tNWNtIX.js → EmbeddedEditor-DoYdDZZ5.js} +1 -1
  6. package/dist/assets/{IframeModal-DPKliErV.js → IframeModal-D-i3O2aa.js} +1 -1
  7. package/dist/assets/{LogViewerModal-DjFERy1q.js → LogViewerModal--6BvTYOV.js} +1 -1
  8. package/dist/assets/{PM2LogsModal-BdrDzBKN.js → PM2LogsModal-CfBk5CbU.js} +1 -1
  9. package/dist/assets/{RestoreArchivedAreaModal-C9Jty3uX.js → RestoreArchivedAreaModal-CXXgfat7.js} +1 -1
  10. package/dist/assets/{SaveSnapshotModal-BogH6B68.js → SaveSnapshotModal-L5GjVk4Y.js} +1 -1
  11. package/dist/assets/{Scene2DCanvas-C-EHxBDJ.js → Scene2DCanvas-DNLpdat4.js} +1 -1
  12. package/dist/assets/SceneManager-bRgSJ3LI.js +104 -0
  13. package/dist/assets/{SkillsPanel-4bYUVDD1.js → SkillsPanel-GG3e2iVs.js} +1 -1
  14. package/dist/assets/{SnapshotManager-dcBksD__.js → SnapshotManager-B12zEZn4.js} +1 -1
  15. package/dist/assets/{SpawnModal-CEBkvClP.js → SpawnModal-DIK_3nJi.js} +1 -1
  16. package/dist/assets/{SubordinateAssignmentModal-g96zYdR8.js → SubordinateAssignmentModal-BTqrKrNP.js} +1 -1
  17. package/dist/assets/{SupervisorPanel-CfawQ-rh.js → SupervisorPanel-D7tYXoOh.js} +1 -1
  18. package/dist/assets/addon-clipboard-Ckztrdv4.js +12 -0
  19. package/dist/assets/addon-fit-YJmn1quW.js +12 -0
  20. package/dist/assets/addon-web-links-BWjmmSgS.js +12 -0
  21. package/dist/assets/{camera-BpvymDJk.js → camera-DSlm3njy.js} +1 -1
  22. package/dist/assets/{index-f5zczb4c.js → index-DOBnKC06.js} +1 -1
  23. package/dist/assets/index-DVNwScVn.js +20 -0
  24. package/dist/assets/{index-fWf-CKPH.js → index-DZPLG54i.js} +1 -1
  25. package/dist/assets/{index-CZU7Dls2.js → index-DjZ_7rJp.js} +2 -2
  26. package/dist/assets/{index-DoomnNC9.js → index-XOt8Pjgn.js} +1 -1
  27. package/dist/assets/{index-Cz1f0Mcl.js → index-_dgQnVA5.js} +1 -1
  28. package/dist/assets/{index-fuR0GoKR.js → index-mpaRxASJ.js} +1 -1
  29. package/dist/assets/{index-DTWYW1SI.js → index-ucFpbgKK.js} +1 -1
  30. package/dist/assets/main-DFVf4Fc5.js +152 -0
  31. package/dist/assets/main-PF2eqGtY.css +1 -0
  32. package/dist/assets/{web-CXErRaMb.js → web-Bm52eWGV.js} +1 -1
  33. package/dist/assets/{web-Dih_6Qy-.js → web-CUqR-3k9.js} +1 -1
  34. package/dist/assets/xterm-6GBZ9nXN.css +32 -0
  35. package/dist/assets/xterm-BqvuqXEL.js +27 -0
  36. package/dist/index.html +2 -2
  37. package/dist/src/packages/server/services/terminal-proxy.js +5 -1
  38. package/dist/src/packages/server/services/terminal-service.js +33 -0
  39. package/package.json +5 -1
  40. package/dist/assets/SceneManager-BTM8quei.js +0 -104
  41. package/dist/assets/index-BRLcCUq6.js +0 -20
  42. package/dist/assets/main-CwZKW-kQ.css +0 -1
  43. package/dist/assets/main-D8ST500w.js +0 -146
@@ -1 +1 @@
1
- import{u as M,f as N,r as m,s as u,j as r}from"./main-D8ST500w.js";import{L as v}from"./LogViewerModal-DjFERy1q.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function C(o){const n=["#3498db","#2ecc71","#9b59b6","#e67e22","#1abc9c","#e74c3c","#f1c40f","#00bcd4"];let a=0;for(let t=0;t<o.length;t++)a=o.charCodeAt(t)+((a<<5)-a);return n[Math.abs(a)%n.length]}function w({building:o,isOpen:n,onClose:a}){const{t}=M(["terminal","common"]),{bossStreamingLogs:b,buildings:f}=N(),l=b.get(o.id)||[],[i,d]=m.useState(null),c=o.subordinateBuildingIds||[],g=c.map(e=>f.get(e)).filter(e=>e!==void 0);m.useEffect(()=>(n&&c.length>0&&u.startBossLogStreaming(o.id),()=>{o.id&&u.stopBossLogStreaming(o.id)}),[n,o.id,c.length]);const h=m.useMemo(()=>{const e=new Set;return l.forEach(s=>e.add(s.subordinateName)),Array.from(e)},[l]),p=m.useMemo(()=>(i?l.filter(s=>s.subordinateName===i):l).map((s,j)=>({text:s.chunk,lineNumber:j+1,sourceLabel:s.subordinateName,sourceColor:C(s.subordinateName),isError:s.isError})),[l,i]),x=g.some(e=>{var s;return(s=e.pm2)==null?void 0:s.enabled}),S=h.length>1?r.jsxs("select",{className:"toolbar-btn source-filter",value:i||"",onChange:e=>d(e.target.value||null),children:[r.jsx("option",{value:"",children:t("terminal:logs.allSources")}),h.map(e=>r.jsx("option",{value:e,children:e},e))]}):void 0,L=i?r.jsxs("div",{className:"shortcut",style:{marginLeft:"auto"},children:[r.jsxs("span",{children:[t("terminal:logs.filtered"),": ",i]}),r.jsx("button",{style:{background:"transparent",border:"none",color:"inherit",cursor:"pointer",marginLeft:"0.5rem"},onClick:()=>d(null),children:"x"})]}):void 0;return r.jsx(v,{isOpen:n,onClose:a,title:`${o.name} - ${t("terminal:logs.bossLogs")}`,icon:"👑",lines:p,isStreaming:c.length>0,streamingIndicatorLabel:`${g.length} ${t("terminal:logs.units")}`,onClear:()=>u.clearBossStreamingLogs(o.id),emptyMessage:x?l.length===0?t("terminal:logs.waitingForLogs"):t("terminal:logs.noMatchingLogs"):t("terminal:logs.noPM2Subordinates"),extraToolbar:S,extraFooter:L,modalClassName:"boss-logs-modal"})}export{w as BossLogsModal};
1
+ import{u as M,f as N,r as m,s as u,j as r}from"./main-DFVf4Fc5.js";import{L as v}from"./LogViewerModal--6BvTYOV.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function C(o){const n=["#3498db","#2ecc71","#9b59b6","#e67e22","#1abc9c","#e74c3c","#f1c40f","#00bcd4"];let a=0;for(let t=0;t<o.length;t++)a=o.charCodeAt(t)+((a<<5)-a);return n[Math.abs(a)%n.length]}function w({building:o,isOpen:n,onClose:a}){const{t}=M(["terminal","common"]),{bossStreamingLogs:b,buildings:f}=N(),l=b.get(o.id)||[],[i,d]=m.useState(null),c=o.subordinateBuildingIds||[],g=c.map(e=>f.get(e)).filter(e=>e!==void 0);m.useEffect(()=>(n&&c.length>0&&u.startBossLogStreaming(o.id),()=>{o.id&&u.stopBossLogStreaming(o.id)}),[n,o.id,c.length]);const h=m.useMemo(()=>{const e=new Set;return l.forEach(s=>e.add(s.subordinateName)),Array.from(e)},[l]),p=m.useMemo(()=>(i?l.filter(s=>s.subordinateName===i):l).map((s,j)=>({text:s.chunk,lineNumber:j+1,sourceLabel:s.subordinateName,sourceColor:C(s.subordinateName),isError:s.isError})),[l,i]),x=g.some(e=>{var s;return(s=e.pm2)==null?void 0:s.enabled}),S=h.length>1?r.jsxs("select",{className:"toolbar-btn source-filter",value:i||"",onChange:e=>d(e.target.value||null),children:[r.jsx("option",{value:"",children:t("terminal:logs.allSources")}),h.map(e=>r.jsx("option",{value:e,children:e},e))]}):void 0,L=i?r.jsxs("div",{className:"shortcut",style:{marginLeft:"auto"},children:[r.jsxs("span",{children:[t("terminal:logs.filtered"),": ",i]}),r.jsx("button",{style:{background:"transparent",border:"none",color:"inherit",cursor:"pointer",marginLeft:"0.5rem"},onClick:()=>d(null),children:"x"})]}):void 0;return r.jsx(v,{isOpen:n,onClose:a,title:`${o.name} - ${t("terminal:logs.bossLogs")}`,icon:"👑",lines:p,isStreaming:c.length>0,streamingIndicatorLabel:`${g.length} ${t("terminal:logs.units")}`,onClear:()=>u.clearBossStreamingLogs(o.id),emptyMessage:x?l.length===0?t("terminal:logs.waitingForLogs"):t("terminal:logs.noMatchingLogs"):t("terminal:logs.noPM2Subordinates"),extraToolbar:S,extraFooter:L,modalClassName:"boss-logs-modal"})}export{w as BossLogsModal};
@@ -1 +1 @@
1
- import{u as $e,f as Ae,E as Le,D as Ee,r as t,I as De,S as se,p as _e,J as R,A as ae,W as O,X as j,j as s,M as Ie,N as Be,P,O as A,U as L,V as Re,s as Oe}from"./main-D8ST500w.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function ne(p){const h=j.filter(S=>!p.has(`Boss ${S}`));return h.length===0?`Boss ${j[Math.floor(Math.random()*j.length)]}-${Date.now()%1e3}`:`Boss ${h[Math.floor(Math.random()*h.length)]}`}function Ue({isOpen:p,onClose:h,onSpawnStart:S,onSpawnEnd:E,spawnPosition:le}){const{t:n}=$e(["terminal","common"]),{agents:g}=Ae(),o=Le(),C=Ee(),[r,d]=t.useState(""),[k,te]=t.useState(()=>De(se.LAST_CWD)),[c,D]=t.useState("boss"),[T,q]=t.useState(!1),[ie,M]=t.useState(!1),[F,ce]=t.useState(!0),[U,oe]=t.useState("bypass"),[m,W]=t.useState("claude"),[f,N]=t.useState({fullAuto:!0,sandbox:"workspace-write",approvalMode:"on-request",search:!1}),[G,re]=t.useState("haiku"),[K,de]=t.useState("gpt-5.3-codex"),[v,y]=t.useState(new Set),[z,_]=t.useState(new Set),[u,ue]=t.useState(""),[b,pe]=t.useState(""),[J,me]=t.useState(""),$=t.useRef(null),I=t.useRef(!1),H=t.useRef(!1),x=t.useMemo(()=>C.filter(e=>e.enabled),[C]),X=t.useMemo(()=>{if(!b.trim())return x;const e=b.toLowerCase();return x.filter(a=>a.name.toLowerCase().includes(e)||a.description.toLowerCase().includes(e)||a.slug.toLowerCase().includes(e))},[x,b]),he=t.useMemo(()=>{var a;const e=o.find(l=>l.id===c);return(a=e==null?void 0:e.defaultSkillIds)!=null&&a.length?C.filter(l=>e.defaultSkillIds.includes(l.id)):[]},[o,c,C]),we=["full-notifications","streaming-exec","task-label","report-task-to-boss"];t.useEffect(()=>{if(p&&!H.current&&x.length>0){const a=x.filter(l=>we.includes(l.slug)).map(l=>l.id);a.length>0&&_(new Set(a))}H.current=p},[p,x]);const xe=t.useCallback(e=>{_(a=>{const l=new Set(a);return l.has(e)?l.delete(e):l.add(e),l})},[]),i=t.useMemo(()=>o.find(e=>e.id===c),[o,c]),fe=t.useMemo(()=>{if(i!=null&&i.model)return i.model},[i]),be=t.useMemo(()=>{if(i!=null&&i.customModelPath)return _e(`/api/custom-models/${i.id}`)},[i]),je=i==null?void 0:i.modelScale,Ne=t.useMemo(()=>i?"scout":c==="boss"?"architect":c,[c,i]),V=Array.from(g.values()).filter(e=>!e.isBoss&&e.class!=="boss"&&!e.bossId),Y=t.useMemo(()=>{if(!u.trim())return o;const e=u.toLowerCase();return o.filter(a=>a.name.toLowerCase().includes(e)||a.description.toLowerCase().includes(e)||a.id.toLowerCase().includes(e))},[o,u]),Q=t.useMemo(()=>{if(!u.trim())return R;const e=u.toLowerCase();return R.filter(a=>{const l=ae[a.id];return l?a.name.toLowerCase().includes(e)||a.id.toLowerCase().includes(e)||l.description.toLowerCase().includes(e):!1})},[u]),Z=t.useMemo(()=>{if(!u.trim())return!0;const e=u.toLowerCase(),a=O.boss;return"boss".includes(e)||a.description.toLowerCase().includes(e)},[u]);t.useEffect(()=>{if(p&&!I.current){I.current=!0;const e=new Set(Array.from(g.values()).map(l=>l.name)),a=o.find(l=>l.id===c);if(a){const l=j.filter(w=>!e.has(`${a.name} ${w}`));if(l.length===0){const w=j[Math.floor(Math.random()*j.length)];d(`${a.name} ${w}-${Date.now()%1e3}`)}else d(`${a.name} ${l[Math.floor(Math.random()*l.length)]}`)}else d(ne(e));y(new Set),$.current&&($.current.focus(),$.current.select())}else p||(I.current=!1)},[p,g]),t.useEffect(()=>{if(!p)return;const e=o.find(a=>a.id===c);if(e)if(r.startsWith("Boss ")){const a=r.substring(5);d(`${e.name} ${a}`)}else{const a=o.find(l=>r.startsWith(l.name+" "));if(a){const l=r.substring(a.name.length+1);d(`${e.name} ${l}`)}else d(`${e.name} ${r}`)}else{const a=o.find(l=>r.startsWith(l.name+" "));if(a){const l=r.substring(a.name.length+1);d(`Boss ${l}`)}else r.startsWith("Boss ")||d(`Boss ${r}`)}},[c]);const ve=()=>{if(M(!1),!k.trim()){M(!0);return}if(!r.trim()){const l=new Set(Array.from(g.values()).map(w=>w.name));d(ne(l));return}Re(se.LAST_CWD,k),S();const e=J.trim()||void 0,a=Array.from(z);Oe.spawnBossAgent(r.trim(),c,k.trim(),le||void 0,Array.from(v),m==="claude"?F:!1,U,m,m==="codex"?f:void 0,m==="codex"?K:void 0,m==="claude"?G:void 0,e,a),d(""),y(new Set),_(new Set),E(),h()},Se=()=>{q(!1),d(""),y(new Set),E(),h()},ge=()=>{q(!1),M(!0),E()};t.useEffect(()=>(window.__bossSpawnModalSuccess=Se,window.__bossSpawnModalError=ge,()=>{delete window.__bossSpawnModalSuccess,delete window.__bossSpawnModalError}),[r]);const Ce=e=>{e.target===e.currentTarget&&h()},ke=e=>{e.key==="Escape"&&h()},Me=e=>{const a=new Set(v);a.has(e)?a.delete(e):a.add(e),y(a)};if(!p)return null;const B=O.boss;return s.jsx("div",{className:`modal-overlay ${p?"visible":""}`,onClick:Ce,onKeyDown:ke,children:s.jsxs("div",{className:"modal boss-spawn-modal",children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("span",{className:"boss-header-icon",children:B.icon}),n("terminal:spawn.deployBossTitle")]}),s.jsxs("div",{className:"modal-body spawn-modal-body",children:[s.jsxs("div",{className:"spawn-top-section",children:[s.jsx("div",{className:"spawn-preview-compact",children:s.jsx(Ie,{agentClass:Ne,modelFile:fe,customModelUrl:be,modelScale:je,width:100,height:120})}),s.jsxs("div",{className:"spawn-class-section",children:[s.jsx("div",{className:"spawn-class-label",children:n("terminal:spawn.bossClass")}),o.length+R.length+1>6&&s.jsx("input",{type:"text",className:"spawn-input class-search-input",placeholder:n("terminal:spawn.filterClasses"),value:u,onChange:e=>ue(e.target.value)}),s.jsxs("div",{className:"class-selector-inline",children:[Y.map(e=>s.jsxs("button",{className:`class-chip ${c===e.id?"selected":""}`,onClick:()=>D(e.id),title:e.description,children:[s.jsx("span",{className:"class-chip-icon",children:e.icon}),s.jsx("span",{className:"class-chip-name",children:e.name})]},e.id)),Z&&s.jsxs("button",{className:`class-chip ${c==="boss"?"selected":""}`,onClick:()=>D("boss"),title:B.description,children:[s.jsx("span",{className:"class-chip-icon",children:B.icon}),s.jsx("span",{className:"class-chip-name",children:n("terminal:spawn.bossClassName")})]}),Q.map(e=>{const a=ae[e.id];return a?s.jsxs("button",{className:`class-chip ${c===e.id?"selected":""}`,onClick:()=>D(e.id),title:a.description,children:[s.jsx("span",{className:"class-chip-icon",children:a.icon}),s.jsx("span",{className:"class-chip-name",children:e.name})]},e.id):null}),u&&Y.length===0&&!Z&&Q.length===0&&s.jsx("div",{className:"class-search-empty",children:n("terminal:spawn.noClassesMatch",{query:u})})]})]})]}),s.jsxs("div",{className:"spawn-form-section",children:[s.jsxs("div",{className:"spawn-form-row",children:[s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.name")}),s.jsx("input",{ref:$,type:"text",className:"spawn-input",placeholder:n("terminal:spawn.bossNamePlaceholder"),value:r,onChange:e=>d(e.target.value)})]}),s.jsxs("div",{className:"spawn-field spawn-field-wide",children:[s.jsx("label",{className:"spawn-label",children:n("terminal:spawn.workingDir")}),s.jsx(Be,{value:k,onChange:e=>{te(e),M(!1)},placeholder:n("terminal:spawn.workingDirPlaceholder"),className:"spawn-input",hasError:ie,directoriesOnly:!0})]})]}),s.jsxs("div",{className:"spawn-form-row",children:[s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.runtime")}),s.jsxs("div",{className:"spawn-select-row",children:[s.jsxs("button",{className:`spawn-select-btn ${m==="claude"?"selected":""}`,onClick:()=>W("claude"),title:n("terminal:spawn.useClaudeCli"),children:[s.jsx("img",{src:"/assets/claude.ico",alt:"Claude",className:"spawn-provider-icon"}),s.jsx("span",{children:"Claude"})]}),s.jsxs("button",{className:`spawn-select-btn ${m==="codex"?"selected":""}`,onClick:()=>W("codex"),title:n("terminal:spawn.useCodexCli"),children:[s.jsx("img",{src:"/assets/codex.ico",alt:"Codex",className:"spawn-provider-icon"}),s.jsx("span",{children:"Codex"})]})]})]}),s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.permissions")}),s.jsx("div",{className:"spawn-select-row",children:Object.keys(P).map(e=>s.jsxs("button",{className:`spawn-select-btn ${U===e?"selected":""}`,onClick:()=>oe(e),title:P[e].description,children:[s.jsx("span",{children:e==="bypass"?"⚡":"🔐"}),s.jsx("span",{children:P[e].label})]},e))})]})]}),s.jsxs("div",{className:"spawn-form-row",children:[s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.model")}),m==="claude"?s.jsx("div",{className:"spawn-select-row",children:Object.keys(A).map(e=>s.jsxs("button",{className:`spawn-select-btn ${G===e?"selected":""}`,onClick:()=>re(e),title:A[e].description,children:[s.jsx("span",{children:A[e].icon}),s.jsx("span",{children:A[e].label})]},e))}):m==="codex"?s.jsx("div",{className:"spawn-select-row spawn-select-row--codex-models",children:Object.keys(L).map(e=>s.jsxs("button",{className:`spawn-select-btn ${K===e?"selected":""}`,onClick:()=>de(e),title:L[e].description,children:[s.jsx("span",{children:L[e].icon}),s.jsx("span",{children:L[e].label})]},e))}):s.jsx("div",{className:"spawn-inline-hint",children:n("terminal:spawn.codex.configuration")})]}),s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.browser")}),s.jsx("div",{className:"spawn-form-row spawn-options-row",children:s.jsxs("label",{className:"spawn-checkbox",children:[s.jsx("input",{type:"checkbox",checked:F,onChange:e=>ce(e.target.checked),disabled:m!=="claude"}),s.jsx("span",{children:n("terminal:spawn.chromeBrowser")})]})})]})]}),m==="codex"&&s.jsx("div",{className:"spawn-form-row",children:s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("terminal:spawn.codex.config")}),s.jsxs("div",{className:"spawn-options-row",style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs("label",{className:"spawn-checkbox",children:[s.jsx("input",{type:"checkbox",checked:f.fullAuto!==!1,onChange:e=>N(a=>({...a,fullAuto:e.target.checked}))}),s.jsx("span",{children:n("terminal:spawn.codex.useFullAuto")})]}),s.jsxs("label",{className:"spawn-checkbox",children:[s.jsx("input",{type:"checkbox",checked:!!f.search,onChange:e=>N(a=>({...a,search:e.target.checked}))}),s.jsx("span",{children:n("terminal:spawn.codex.enableSearch")})]}),f.fullAuto===!1&&s.jsxs(s.Fragment,{children:[s.jsxs("select",{className:"spawn-input",value:f.sandbox||"workspace-write",onChange:e=>N(a=>({...a,sandbox:e.target.value})),children:[s.jsx("option",{value:"read-only",children:n("terminal:spawn.codex.sandboxReadOnly")}),s.jsx("option",{value:"workspace-write",children:n("terminal:spawn.codex.sandboxWorkspaceWrite")}),s.jsx("option",{value:"danger-full-access",children:n("terminal:spawn.codex.sandboxDangerFullAccess")})]}),s.jsxs("select",{className:"spawn-input",value:f.approvalMode||"on-request",onChange:e=>N(a=>({...a,approvalMode:e.target.value})),children:[s.jsx("option",{value:"untrusted",children:n("terminal:spawn.codex.approvalsUntrusted")}),s.jsx("option",{value:"on-failure",children:n("terminal:spawn.codex.approvalsOnFailure")}),s.jsx("option",{value:"on-request",children:n("terminal:spawn.codex.approvalsOnRequest")}),s.jsx("option",{value:"never",children:n("terminal:spawn.codex.approvalsNever")})]})]}),s.jsx("input",{type:"text",className:"spawn-input",placeholder:n("terminal:spawn.codex.profileOptional"),value:f.profile||"",onChange:e=>N(a=>({...a,profile:e.target.value||void 0}))})]})]})}),x.length>0&&s.jsxs("div",{className:"spawn-skills-section",children:[s.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.skills")," ",s.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]})]}),x.length>6&&s.jsx("input",{type:"text",className:"spawn-input skill-search-input",placeholder:n("terminal:spawn.filterSkills"),value:b,onChange:e=>pe(e.target.value)}),s.jsxs("div",{className:"spawn-skills-inline",children:[X.map(e=>{const a=z.has(e.id);return he.some(w=>w.id===e.id)?null:s.jsxs("button",{className:`spawn-skill-chip ${a?"selected":""}`,onClick:()=>xe(e.id),title:e.description,children:[a&&s.jsx("span",{className:"spawn-skill-check",children:"✓"}),s.jsx("span",{children:e.name}),e.builtin&&s.jsx("span",{className:"spawn-skill-builtin",children:"TC"})]},e.id)}),b&&X.length===0&&s.jsx("div",{className:"skill-search-empty",children:n("terminal:spawn.noSkillsMatch",{query:b})})]})]}),s.jsxs("div",{className:"spawn-custom-instructions-section",children:[s.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.customInstructions")," ",s.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]})]}),s.jsx("textarea",{className:"spawn-input spawn-textarea",placeholder:n("terminal:spawn.customInstructionsBossPlaceholder"),value:J,onChange:e=>me(e.target.value),rows:3})]}),s.jsxs("div",{className:"spawn-subordinates-section",children:[s.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.initialSubordinates")," ",s.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]})]}),s.jsx("div",{className:"subordinates-selector-compact",children:V.length===0?s.jsx("div",{className:"subordinates-empty",children:n("terminal:spawn.noAvailableAgents")}):V.map(e=>{const a=v.has(e.id),l=O[e.class],w=o.find(ye=>ye.id===e.class),ee=l||w||{icon:"🤖",color:"#888888"};return s.jsxs("button",{className:`subordinate-chip ${a?"selected":""}`,onClick:()=>Me(e.id),children:[a&&s.jsx("span",{className:"subordinate-check",children:"✓"}),s.jsx("span",{className:"subordinate-chip-icon",style:{color:ee.color},children:ee.icon}),s.jsx("span",{className:"subordinate-chip-name",children:e.name})]},e.id)})}),v.size>0&&s.jsxs("div",{className:"subordinates-count",children:[v.size," ",n("common:labels.selected").toLowerCase()]})]})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:h,children:n("common:buttons.cancel")}),s.jsx("button",{className:"btn btn-boss",onClick:ve,disabled:T,children:n(T?"common:buttons.deploying":"common:buttons2.deployBoss")})]})]})})}export{Ue as BossSpawnModal};
1
+ import{u as $e,f as Ae,E as Le,D as Ee,r as t,I as De,S as se,p as _e,J as R,A as ae,W as O,X as j,j as s,M as Ie,N as Be,P,O as A,U as L,V as Re,s as Oe}from"./main-DFVf4Fc5.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function ne(p){const h=j.filter(S=>!p.has(`Boss ${S}`));return h.length===0?`Boss ${j[Math.floor(Math.random()*j.length)]}-${Date.now()%1e3}`:`Boss ${h[Math.floor(Math.random()*h.length)]}`}function Ue({isOpen:p,onClose:h,onSpawnStart:S,onSpawnEnd:E,spawnPosition:le}){const{t:n}=$e(["terminal","common"]),{agents:g}=Ae(),o=Le(),C=Ee(),[r,d]=t.useState(""),[k,te]=t.useState(()=>De(se.LAST_CWD)),[c,D]=t.useState("boss"),[T,q]=t.useState(!1),[ie,M]=t.useState(!1),[F,ce]=t.useState(!0),[U,oe]=t.useState("bypass"),[m,W]=t.useState("claude"),[f,N]=t.useState({fullAuto:!0,sandbox:"workspace-write",approvalMode:"on-request",search:!1}),[G,re]=t.useState("haiku"),[K,de]=t.useState("gpt-5.3-codex"),[v,y]=t.useState(new Set),[z,_]=t.useState(new Set),[u,ue]=t.useState(""),[b,pe]=t.useState(""),[J,me]=t.useState(""),$=t.useRef(null),I=t.useRef(!1),H=t.useRef(!1),x=t.useMemo(()=>C.filter(e=>e.enabled),[C]),X=t.useMemo(()=>{if(!b.trim())return x;const e=b.toLowerCase();return x.filter(a=>a.name.toLowerCase().includes(e)||a.description.toLowerCase().includes(e)||a.slug.toLowerCase().includes(e))},[x,b]),he=t.useMemo(()=>{var a;const e=o.find(l=>l.id===c);return(a=e==null?void 0:e.defaultSkillIds)!=null&&a.length?C.filter(l=>e.defaultSkillIds.includes(l.id)):[]},[o,c,C]),we=["full-notifications","streaming-exec","task-label","report-task-to-boss"];t.useEffect(()=>{if(p&&!H.current&&x.length>0){const a=x.filter(l=>we.includes(l.slug)).map(l=>l.id);a.length>0&&_(new Set(a))}H.current=p},[p,x]);const xe=t.useCallback(e=>{_(a=>{const l=new Set(a);return l.has(e)?l.delete(e):l.add(e),l})},[]),i=t.useMemo(()=>o.find(e=>e.id===c),[o,c]),fe=t.useMemo(()=>{if(i!=null&&i.model)return i.model},[i]),be=t.useMemo(()=>{if(i!=null&&i.customModelPath)return _e(`/api/custom-models/${i.id}`)},[i]),je=i==null?void 0:i.modelScale,Ne=t.useMemo(()=>i?"scout":c==="boss"?"architect":c,[c,i]),V=Array.from(g.values()).filter(e=>!e.isBoss&&e.class!=="boss"&&!e.bossId),Y=t.useMemo(()=>{if(!u.trim())return o;const e=u.toLowerCase();return o.filter(a=>a.name.toLowerCase().includes(e)||a.description.toLowerCase().includes(e)||a.id.toLowerCase().includes(e))},[o,u]),Q=t.useMemo(()=>{if(!u.trim())return R;const e=u.toLowerCase();return R.filter(a=>{const l=ae[a.id];return l?a.name.toLowerCase().includes(e)||a.id.toLowerCase().includes(e)||l.description.toLowerCase().includes(e):!1})},[u]),Z=t.useMemo(()=>{if(!u.trim())return!0;const e=u.toLowerCase(),a=O.boss;return"boss".includes(e)||a.description.toLowerCase().includes(e)},[u]);t.useEffect(()=>{if(p&&!I.current){I.current=!0;const e=new Set(Array.from(g.values()).map(l=>l.name)),a=o.find(l=>l.id===c);if(a){const l=j.filter(w=>!e.has(`${a.name} ${w}`));if(l.length===0){const w=j[Math.floor(Math.random()*j.length)];d(`${a.name} ${w}-${Date.now()%1e3}`)}else d(`${a.name} ${l[Math.floor(Math.random()*l.length)]}`)}else d(ne(e));y(new Set),$.current&&($.current.focus(),$.current.select())}else p||(I.current=!1)},[p,g]),t.useEffect(()=>{if(!p)return;const e=o.find(a=>a.id===c);if(e)if(r.startsWith("Boss ")){const a=r.substring(5);d(`${e.name} ${a}`)}else{const a=o.find(l=>r.startsWith(l.name+" "));if(a){const l=r.substring(a.name.length+1);d(`${e.name} ${l}`)}else d(`${e.name} ${r}`)}else{const a=o.find(l=>r.startsWith(l.name+" "));if(a){const l=r.substring(a.name.length+1);d(`Boss ${l}`)}else r.startsWith("Boss ")||d(`Boss ${r}`)}},[c]);const ve=()=>{if(M(!1),!k.trim()){M(!0);return}if(!r.trim()){const l=new Set(Array.from(g.values()).map(w=>w.name));d(ne(l));return}Re(se.LAST_CWD,k),S();const e=J.trim()||void 0,a=Array.from(z);Oe.spawnBossAgent(r.trim(),c,k.trim(),le||void 0,Array.from(v),m==="claude"?F:!1,U,m,m==="codex"?f:void 0,m==="codex"?K:void 0,m==="claude"?G:void 0,e,a),d(""),y(new Set),_(new Set),E(),h()},Se=()=>{q(!1),d(""),y(new Set),E(),h()},ge=()=>{q(!1),M(!0),E()};t.useEffect(()=>(window.__bossSpawnModalSuccess=Se,window.__bossSpawnModalError=ge,()=>{delete window.__bossSpawnModalSuccess,delete window.__bossSpawnModalError}),[r]);const Ce=e=>{e.target===e.currentTarget&&h()},ke=e=>{e.key==="Escape"&&h()},Me=e=>{const a=new Set(v);a.has(e)?a.delete(e):a.add(e),y(a)};if(!p)return null;const B=O.boss;return s.jsx("div",{className:`modal-overlay ${p?"visible":""}`,onClick:Ce,onKeyDown:ke,children:s.jsxs("div",{className:"modal boss-spawn-modal",children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("span",{className:"boss-header-icon",children:B.icon}),n("terminal:spawn.deployBossTitle")]}),s.jsxs("div",{className:"modal-body spawn-modal-body",children:[s.jsxs("div",{className:"spawn-top-section",children:[s.jsx("div",{className:"spawn-preview-compact",children:s.jsx(Ie,{agentClass:Ne,modelFile:fe,customModelUrl:be,modelScale:je,width:100,height:120})}),s.jsxs("div",{className:"spawn-class-section",children:[s.jsx("div",{className:"spawn-class-label",children:n("terminal:spawn.bossClass")}),o.length+R.length+1>6&&s.jsx("input",{type:"text",className:"spawn-input class-search-input",placeholder:n("terminal:spawn.filterClasses"),value:u,onChange:e=>ue(e.target.value)}),s.jsxs("div",{className:"class-selector-inline",children:[Y.map(e=>s.jsxs("button",{className:`class-chip ${c===e.id?"selected":""}`,onClick:()=>D(e.id),title:e.description,children:[s.jsx("span",{className:"class-chip-icon",children:e.icon}),s.jsx("span",{className:"class-chip-name",children:e.name})]},e.id)),Z&&s.jsxs("button",{className:`class-chip ${c==="boss"?"selected":""}`,onClick:()=>D("boss"),title:B.description,children:[s.jsx("span",{className:"class-chip-icon",children:B.icon}),s.jsx("span",{className:"class-chip-name",children:n("terminal:spawn.bossClassName")})]}),Q.map(e=>{const a=ae[e.id];return a?s.jsxs("button",{className:`class-chip ${c===e.id?"selected":""}`,onClick:()=>D(e.id),title:a.description,children:[s.jsx("span",{className:"class-chip-icon",children:a.icon}),s.jsx("span",{className:"class-chip-name",children:e.name})]},e.id):null}),u&&Y.length===0&&!Z&&Q.length===0&&s.jsx("div",{className:"class-search-empty",children:n("terminal:spawn.noClassesMatch",{query:u})})]})]})]}),s.jsxs("div",{className:"spawn-form-section",children:[s.jsxs("div",{className:"spawn-form-row",children:[s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.name")}),s.jsx("input",{ref:$,type:"text",className:"spawn-input",placeholder:n("terminal:spawn.bossNamePlaceholder"),value:r,onChange:e=>d(e.target.value)})]}),s.jsxs("div",{className:"spawn-field spawn-field-wide",children:[s.jsx("label",{className:"spawn-label",children:n("terminal:spawn.workingDir")}),s.jsx(Be,{value:k,onChange:e=>{te(e),M(!1)},placeholder:n("terminal:spawn.workingDirPlaceholder"),className:"spawn-input",hasError:ie,directoriesOnly:!0})]})]}),s.jsxs("div",{className:"spawn-form-row",children:[s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.runtime")}),s.jsxs("div",{className:"spawn-select-row",children:[s.jsxs("button",{className:`spawn-select-btn ${m==="claude"?"selected":""}`,onClick:()=>W("claude"),title:n("terminal:spawn.useClaudeCli"),children:[s.jsx("img",{src:"/assets/claude.ico",alt:"Claude",className:"spawn-provider-icon"}),s.jsx("span",{children:"Claude"})]}),s.jsxs("button",{className:`spawn-select-btn ${m==="codex"?"selected":""}`,onClick:()=>W("codex"),title:n("terminal:spawn.useCodexCli"),children:[s.jsx("img",{src:"/assets/codex.ico",alt:"Codex",className:"spawn-provider-icon"}),s.jsx("span",{children:"Codex"})]})]})]}),s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.permissions")}),s.jsx("div",{className:"spawn-select-row",children:Object.keys(P).map(e=>s.jsxs("button",{className:`spawn-select-btn ${U===e?"selected":""}`,onClick:()=>oe(e),title:P[e].description,children:[s.jsx("span",{children:e==="bypass"?"⚡":"🔐"}),s.jsx("span",{children:P[e].label})]},e))})]})]}),s.jsxs("div",{className:"spawn-form-row",children:[s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.model")}),m==="claude"?s.jsx("div",{className:"spawn-select-row",children:Object.keys(A).map(e=>s.jsxs("button",{className:`spawn-select-btn ${G===e?"selected":""}`,onClick:()=>re(e),title:A[e].description,children:[s.jsx("span",{children:A[e].icon}),s.jsx("span",{children:A[e].label})]},e))}):m==="codex"?s.jsx("div",{className:"spawn-select-row spawn-select-row--codex-models",children:Object.keys(L).map(e=>s.jsxs("button",{className:`spawn-select-btn ${K===e?"selected":""}`,onClick:()=>de(e),title:L[e].description,children:[s.jsx("span",{children:L[e].icon}),s.jsx("span",{children:L[e].label})]},e))}):s.jsx("div",{className:"spawn-inline-hint",children:n("terminal:spawn.codex.configuration")})]}),s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("common:labels.browser")}),s.jsx("div",{className:"spawn-form-row spawn-options-row",children:s.jsxs("label",{className:"spawn-checkbox",children:[s.jsx("input",{type:"checkbox",checked:F,onChange:e=>ce(e.target.checked),disabled:m!=="claude"}),s.jsx("span",{children:n("terminal:spawn.chromeBrowser")})]})})]})]}),m==="codex"&&s.jsx("div",{className:"spawn-form-row",children:s.jsxs("div",{className:"spawn-field",children:[s.jsx("label",{className:"spawn-label",children:n("terminal:spawn.codex.config")}),s.jsxs("div",{className:"spawn-options-row",style:{display:"flex",flexDirection:"column",gap:8},children:[s.jsxs("label",{className:"spawn-checkbox",children:[s.jsx("input",{type:"checkbox",checked:f.fullAuto!==!1,onChange:e=>N(a=>({...a,fullAuto:e.target.checked}))}),s.jsx("span",{children:n("terminal:spawn.codex.useFullAuto")})]}),s.jsxs("label",{className:"spawn-checkbox",children:[s.jsx("input",{type:"checkbox",checked:!!f.search,onChange:e=>N(a=>({...a,search:e.target.checked}))}),s.jsx("span",{children:n("terminal:spawn.codex.enableSearch")})]}),f.fullAuto===!1&&s.jsxs(s.Fragment,{children:[s.jsxs("select",{className:"spawn-input",value:f.sandbox||"workspace-write",onChange:e=>N(a=>({...a,sandbox:e.target.value})),children:[s.jsx("option",{value:"read-only",children:n("terminal:spawn.codex.sandboxReadOnly")}),s.jsx("option",{value:"workspace-write",children:n("terminal:spawn.codex.sandboxWorkspaceWrite")}),s.jsx("option",{value:"danger-full-access",children:n("terminal:spawn.codex.sandboxDangerFullAccess")})]}),s.jsxs("select",{className:"spawn-input",value:f.approvalMode||"on-request",onChange:e=>N(a=>({...a,approvalMode:e.target.value})),children:[s.jsx("option",{value:"untrusted",children:n("terminal:spawn.codex.approvalsUntrusted")}),s.jsx("option",{value:"on-failure",children:n("terminal:spawn.codex.approvalsOnFailure")}),s.jsx("option",{value:"on-request",children:n("terminal:spawn.codex.approvalsOnRequest")}),s.jsx("option",{value:"never",children:n("terminal:spawn.codex.approvalsNever")})]})]}),s.jsx("input",{type:"text",className:"spawn-input",placeholder:n("terminal:spawn.codex.profileOptional"),value:f.profile||"",onChange:e=>N(a=>({...a,profile:e.target.value||void 0}))})]})]})}),x.length>0&&s.jsxs("div",{className:"spawn-skills-section",children:[s.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.skills")," ",s.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]})]}),x.length>6&&s.jsx("input",{type:"text",className:"spawn-input skill-search-input",placeholder:n("terminal:spawn.filterSkills"),value:b,onChange:e=>pe(e.target.value)}),s.jsxs("div",{className:"spawn-skills-inline",children:[X.map(e=>{const a=z.has(e.id);return he.some(w=>w.id===e.id)?null:s.jsxs("button",{className:`spawn-skill-chip ${a?"selected":""}`,onClick:()=>xe(e.id),title:e.description,children:[a&&s.jsx("span",{className:"spawn-skill-check",children:"✓"}),s.jsx("span",{children:e.name}),e.builtin&&s.jsx("span",{className:"spawn-skill-builtin",children:"TC"})]},e.id)}),b&&X.length===0&&s.jsx("div",{className:"skill-search-empty",children:n("terminal:spawn.noSkillsMatch",{query:b})})]})]}),s.jsxs("div",{className:"spawn-custom-instructions-section",children:[s.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.customInstructions")," ",s.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]})]}),s.jsx("textarea",{className:"spawn-input spawn-textarea",placeholder:n("terminal:spawn.customInstructionsBossPlaceholder"),value:J,onChange:e=>me(e.target.value),rows:3})]}),s.jsxs("div",{className:"spawn-subordinates-section",children:[s.jsxs("label",{className:"spawn-label",children:[n("terminal:spawn.initialSubordinates")," ",s.jsxs("span",{className:"spawn-label-hint",children:["(",n("common:labels.optional"),")"]})]}),s.jsx("div",{className:"subordinates-selector-compact",children:V.length===0?s.jsx("div",{className:"subordinates-empty",children:n("terminal:spawn.noAvailableAgents")}):V.map(e=>{const a=v.has(e.id),l=O[e.class],w=o.find(ye=>ye.id===e.class),ee=l||w||{icon:"🤖",color:"#888888"};return s.jsxs("button",{className:`subordinate-chip ${a?"selected":""}`,onClick:()=>Me(e.id),children:[a&&s.jsx("span",{className:"subordinate-check",children:"✓"}),s.jsx("span",{className:"subordinate-chip-icon",style:{color:ee.color},children:ee.icon}),s.jsx("span",{className:"subordinate-chip-name",children:e.name})]},e.id)})}),v.size>0&&s.jsxs("div",{className:"subordinates-count",children:[v.size," ",n("common:labels.selected").toLowerCase()]})]})]})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{className:"btn btn-secondary",onClick:h,children:n("common:buttons.cancel")}),s.jsx("button",{className:"btn btn-boss",onClick:ve,disabled:T,children:n(T?"common:buttons.deploying":"common:buttons2.deployBoss")})]})]})})}export{Ue as BossSpawnModal};
@@ -1 +1 @@
1
- import{u as S,aY as I,r as m,aZ as X,aX as w,j as e,f as _,a_ as W,a$ as Z,q as U,h as q,s as y,b0 as z,b1 as A}from"./main-D8ST500w.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function H({shortcut:t,onUpdate:a}){const{t:s}=S(["config","terminal"]),o=I(),[l,h]=m.useState(!1),[i,j]=m.useState(null),b=m.useRef(null),v=m.useMemo(()=>i?X(o,i,t.id,t.context):[],[i,o,t.id,t.context]);m.useEffect(()=>{if(!l)return;const p=c=>{if(c.preventDefault(),c.stopPropagation(),c.key==="Escape"&&!c.ctrlKey&&!c.altKey&&!c.shiftKey&&!c.metaKey){h(!1),j(null);return}if(["Control","Alt","Shift","Meta"].includes(c.key))return;let f=c.key;c.code.startsWith("Key")&&c.code.length===4?f=c.code.charAt(3).toLowerCase():c.code.startsWith("Digit")&&c.code.length===6?f=c.code.charAt(5):c.code==="Space"&&(f="Space");const x={key:f,modifiers:{ctrl:c.ctrlKey,alt:c.altKey,shift:c.shiftKey,meta:c.metaKey}};j(x)};return document.addEventListener("keydown",p,!0),()=>document.removeEventListener("keydown",p,!0)},[l]),m.useEffect(()=>{if(!l)return;const p=c=>{b.current&&!b.current.contains(c.target)&&(i&&v.length===0&&a(i),h(!1),j(null))};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[l,i,v,a]);const k=()=>{l?(i&&v.length===0&&a(i),h(!1),j(null)):(h(!0),j(null))},g=p=>{p.stopPropagation(),a({key:"",modifiers:{}})};let d;return l?i?d=w({...t,...i}):d=s("config:shortcuts.pressKeys"):t.key?d=w(t):d=s("config:shortcuts.notSet"),e.jsxs("div",{className:"key-capture-container",children:[e.jsx("button",{ref:b,className:`key-capture-input ${l?"capturing":""} ${v.length>0?"conflict":""} ${t.enabled?"":"disabled"}`,onClick:k,title:s(l?"config:shortcuts.pressKeysOrClick":"config:shortcuts.clickToChange"),children:e.jsx("span",{className:"key-capture-value",children:d})}),t.key&&!l&&e.jsx("button",{className:"key-capture-clear",onClick:g,title:s("config:shortcuts.clearShortcut"),children:"×"}),v.length>0&&e.jsx("div",{className:"key-capture-conflict",children:s("config:shortcuts.conflictsWith",{names:v.map(p=>s(`terminal:controls.shortcuts.${p.id}.name`,{defaultValue:p.name})).join(", ")})})]})}const V={global:"terminal:controls.contextGlobal",commander:"terminal:controls.contextCommander",toolbox:"terminal:controls.contextToolbox"},Q={global:"terminal:controls.contextGlobalDesc",commander:"terminal:controls.contextCommanderDesc",toolbox:"terminal:controls.contextToolboxDesc"},R={camera:["camera-pan","camera-orbit","camera-rotate","camera-zoom","camera-tilt"],interaction:["primary-action","selection-box","context-menu","move-command"]},J={camera:"terminal:controls.cameraControls",interaction:"terminal:controls.interaction"};function oe({isOpen:t,onClose:a}){const{t:s}=S(["terminal","common"]),o=_(),l=W(),h=Z(),[i,j]=m.useState("keyboard"),[b,v]=m.useState(""),[k,g]=m.useState("all"),[d,p]=m.useState(!1),[c,f]=m.useState(null),x=U.useRef(null),{handleMouseDown:D,handleClick:M}=q(a);if(m.useEffect(()=>{if(!t||d)return;const r=n=>{n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),a())};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[t,a,d]),m.useEffect(()=>{t||(v(""),p(!1),f(null))},[t]),m.useEffect(()=>{if(!t||!d)return;const r=n=>{if(n.key==="Escape"){n.preventDefault(),n.stopPropagation(),p(!1),f(null);return}if(["Control","Alt","Shift","Meta"].includes(n.key))return;n.preventDefault(),n.stopPropagation();let u=n.key;n.code.startsWith("Key")&&n.code.length===4?u=n.code.charAt(3).toLowerCase():n.code.startsWith("Digit")&&n.code.length===6?u=n.code.charAt(5):n.code==="Space"&&(u="Space"),f({key:u,modifiers:{ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey,meta:n.metaKey}})};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[t,d]),!t)return null;const E=o.shortcuts.filter(r=>{const n=s(`terminal:controls.shortcuts.${r.id}.name`,{defaultValue:r.name}),u=s(`terminal:controls.shortcuts.${r.id}.description`,{defaultValue:r.description});if(d&&c){const O=C=>C===" "||C==="Space"?"Space":C.length===1?C.toLowerCase():C,$=O(r.key),B=O(c.key);if(!(B.length===1&&/^[a-zA-Z]$/.test($)?`Key${$.toUpperCase()}`==`Key${B.toUpperCase()}`:$===B))return!1;const K=r.modifiers,T=c.modifiers;return(K.ctrl||!1)===(T.ctrl||!1)&&(K.alt||!1)===(T.alt||!1)&&(K.shift||!1)===(T.shift||!1)&&(K.meta||!1)===(T.meta||!1)}if(!b)return!0;const N=b.toLowerCase();return n.toLowerCase().includes(N)||u.toLowerCase().includes(N)||w(r).toLowerCase().includes(N)}),L=E.reduce((r,n)=>(r[n.context]||(r[n.context]=[]),r[n.context].push(n),r),{}),G=(r,n)=>{y.updateShortcut(r,n)},F=()=>{i==="keyboard"?confirm(s("terminal:controls.confirmResetKeyboard"))&&y.resetShortcuts():i==="mouse"?confirm(s("terminal:controls.confirmResetMouse"))&&y.resetMouseControls():i==="trackpad"&&confirm(s("terminal:controls.confirmResetTrackpad"))&&y.resetMouseControls()},P=["global","commander","toolbox"],Y=l.bindings.reduce((r,n)=>(R.camera.includes(n.action)?r.camera.push(n):R.interaction.includes(n.action)&&r.interaction.push(n),r),{camera:[],interaction:[]});return e.jsx("div",{className:"shortcuts-modal-overlay",onMouseDown:D,onClick:M,children:e.jsxs("div",{className:"shortcuts-modal controls-modal",children:[e.jsxs("div",{className:"shortcuts-modal-header",children:[e.jsxs("div",{className:"shortcuts-modal-title",children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),e.jsx("span",{children:s("terminal:controls.title")})]}),e.jsx("button",{className:"shortcuts-modal-close",onClick:a,children:"×"})]}),e.jsxs("div",{className:"controls-main-tabs",children:[e.jsxs("button",{className:`controls-main-tab ${i==="keyboard"?"active":""}`,onClick:()=>j("keyboard"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]}),s("terminal:controls.keyboard")]}),e.jsxs("button",{className:`controls-main-tab ${i==="mouse"?"active":""}`,onClick:()=>j("mouse"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"6",y:"3",width:"12",height:"18",rx:"6"}),e.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"11"})]}),s("terminal:controls.mouse")]}),e.jsxs("button",{className:`controls-main-tab ${i==="trackpad"?"active":""}`,onClick:()=>j("trackpad"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),s("terminal:controls.trackpad")]})]}),i==="keyboard"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[d?e.jsxs("div",{className:"shortcuts-search find-by-shortcut-active",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]}),c?e.jsxs("span",{className:"find-by-shortcut-display",children:[w({key:c.key,modifiers:c.modifiers}),e.jsx("button",{className:"shortcuts-search-clear",onClick:()=>f(null),children:"×"})]}):e.jsx("span",{className:"find-by-shortcut-prompt",children:s("terminal:controls.pressKeyCombination")})]}):e.jsxs("div",{className:"shortcuts-search",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("path",{d:"M21 21l-4.35-4.35"})]}),e.jsx("input",{ref:x,type:"text",placeholder:s("terminal:controls.searchShortcuts"),value:b,onChange:r=>v(r.target.value),autoFocus:!0}),b&&e.jsx("button",{className:"shortcuts-search-clear",onClick:()=>v(""),children:"×"})]}),e.jsx("button",{className:`shortcuts-find-by-key-btn ${d?"active":""}`,onClick:()=>{p(!d),f(null),v("")},title:s(d?"terminal:controls.switchToTextSearch":"terminal:controls.findByPressingKeys"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]})}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:F,children:s("common:buttons.reset")})]}),e.jsxs("div",{className:"shortcuts-context-tabs",children:[e.jsxs("button",{className:`shortcuts-context-tab ${k==="all"?"active":""}`,onClick:()=>g("all"),children:[s("common:labels.all"),e.jsx("span",{className:"shortcuts-context-tab-count",children:E.length})]}),P.map(r=>{var u;const n=((u=L[r])==null?void 0:u.length)||0;return e.jsxs("button",{className:`shortcuts-context-tab ${k===r?"active":""}`,onClick:()=>g(r),children:[s(V[r]),e.jsx("span",{className:"shortcuts-context-tab-count",children:n})]},r)})]}),e.jsxs("div",{className:"shortcuts-modal-content",children:[P.map(r=>{const n=L[r]||[];return n.length===0||k!=="all"&&k!==r?null:e.jsxs("div",{className:"shortcuts-context-group",children:[k==="all"&&e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:s(V[r])}),e.jsx("span",{className:"shortcuts-context-description",children:s(Q[r])})]}),e.jsx("div",{className:"shortcuts-grid",children:n.map(u=>e.jsxs("div",{className:"shortcut-item",children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:s(`terminal:controls.shortcuts.${u.id}.name`,{defaultValue:u.name})}),e.jsx("span",{className:"shortcut-item-description",children:s(`terminal:controls.shortcuts.${u.id}.description`,{defaultValue:u.description})})]}),e.jsx(H,{shortcut:u,onUpdate:N=>G(u.id,N)})]},u.id))})]},r)}),E.length===0&&e.jsx("div",{className:"shortcuts-empty",children:d?c?e.jsx("p",{children:s("terminal:controls.noShortcutBoundTo",{keys:w({key:c.key,modifiers:c.modifiers})})}):e.jsx("p",{children:s("terminal:controls.pressKeyCombinationToFind")}):e.jsx("p",{children:s("terminal:controls.noShortcutsFound",{query:b})})})]})]}),i==="mouse"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[e.jsx("span",{className:"mouse-controls-subtitle",children:s("terminal:controls.cameraAndInteraction")}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:F,children:s("common:buttons.reset")})]}),e.jsxs("div",{className:"shortcuts-modal-content mouse-controls-content",children:[e.jsx("div",{className:"mouse-controls-bindings",children:Object.entries(Y).map(([r,n])=>e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsx("div",{className:"shortcuts-context-header",children:e.jsx("span",{className:"shortcuts-context-label",children:s(J[r])})}),e.jsx("div",{className:"shortcuts-grid",children:n.map(u=>e.jsx(ee,{binding:u},u.id))})]},r))}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:s("terminal:controls.sensitivity")}),e.jsx("span",{className:"shortcuts-context-description",children:s("terminal:controls.adjustCameraSpeed")})]}),e.jsx(te,{sensitivity:l.sensitivity})]})]})]}),i==="trackpad"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[e.jsx("span",{className:"mouse-controls-subtitle",children:s("terminal:controls.trackpadGestureSettings")}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:F,children:s("common:buttons.reset")})]}),e.jsx("div",{className:"shortcuts-modal-content trackpad-controls-content",children:e.jsx(se,{config:h})})]}),e.jsx("div",{className:"shortcuts-modal-footer",children:e.jsx("span",{className:"shortcuts-modal-hint",children:s(i==="keyboard"?d?"terminal:controls.hintFindByShortcut":"terminal:controls.hintKeyboard":i==="mouse"?"terminal:controls.hintMouse":"terminal:controls.hintTrackpad")})})]})})}function ee({binding:t}){const{t:a}=S(["terminal"]),s=W(),[o,l]=m.useState(!1),[h,i]=m.useState(null);m.useEffect(()=>{if(!o)return;const d=x=>{x.preventDefault(),x.stopPropagation();const M={0:"left",1:"middle",2:"right",3:"back",4:"forward"}[x.button];M&&i({button:M,modifiers:{ctrl:x.ctrlKey,alt:x.altKey,shift:x.shiftKey,meta:x.metaKey}})},p=x=>{x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),l(!1),i(null))},c=()=>{h&&z(s.bindings,h,t.id).length===0&&y.updateMouseBinding(t.id,{button:h.button,modifiers:h.modifiers}),l(!1),i(null)},f=setTimeout(()=>{document.addEventListener("mousedown",d,!0),document.addEventListener("keydown",p,!0),document.addEventListener("click",c,!0)},100);return()=>{clearTimeout(f),document.removeEventListener("mousedown",d,!0),document.removeEventListener("keydown",p,!0),document.removeEventListener("click",c,!0)}},[o,h,t.id,s.bindings]);const j=h?z(s.bindings,h,t.id):[],b=a(`terminal:controls.mouseBindings.${t.id}.name`,{defaultValue:t.name}),v=a(`terminal:controls.mouseBindings.${t.id}.description`,{defaultValue:t.description}),k=d=>a(`terminal:controls.mouseButtons.${d}`,{defaultValue:d}),g=h?A({...t,...h},k):A(t,k);return e.jsxs("div",{className:`shortcut-item ${t.enabled?"":"disabled"}`,children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:b}),e.jsx("span",{className:"shortcut-item-description",children:v})]}),e.jsxs("div",{className:"key-capture-container",children:[e.jsx("button",{className:`key-capture-input ${o?"capturing":""} ${j.length>0?"conflict":""}`,onClick:()=>l(!0),children:o?h?e.jsx("span",{className:"key-capture-value",style:{color:"#f1fa8c"},children:g}):e.jsx("span",{style:{color:"#6272a4",fontStyle:"italic"},children:a("terminal:controls.clickToCapture")}):e.jsx("span",{className:"key-capture-value",children:g})}),j.length>0&&e.jsxs("span",{className:"key-capture-conflict",children:[a("terminal:controls.conflicts"),": ",j.map(d=>a(`terminal:controls.mouseBindings.${d.id}.name`,{defaultValue:d.name})).join(", ")]})]})]})}function te({sensitivity:t}){const{t:a}=S(["terminal"]),s=m.useCallback((o,l)=>{y.updateCameraSensitivity({[o]:l})},[]);return e.jsxs("div",{className:"sensitivity-inline-settings",children:[e.jsxs("div",{className:"sensitivity-sliders",children:[e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:a("terminal:controls.panSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:t.panSpeed,onChange:o=>s("panSpeed",parseFloat(o.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[t.panSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:a("terminal:controls.orbitSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:t.orbitSpeed,onChange:o=>s("orbitSpeed",parseFloat(o.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[t.orbitSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:a("terminal:controls.zoomSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:t.zoomSpeed,onChange:o=>s("zoomSpeed",parseFloat(o.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[t.zoomSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:a("terminal:controls.smoothing")}),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:t.smoothing,onChange:o=>s("smoothing",parseFloat(o.target.value))}),e.jsx("span",{className:"sensitivity-slider-value",children:t.smoothing.toFixed(1)})]})]}),e.jsxs("div",{className:"sensitivity-checkboxes-inline",children:[e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:t.invertPanX,onChange:o=>s("invertPanX",o.target.checked)}),e.jsx("span",{children:a("terminal:controls.invertPanX")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:t.invertPanY,onChange:o=>s("invertPanY",o.target.checked)}),e.jsx("span",{children:a("terminal:controls.invertPanY")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:t.invertOrbitX,onChange:o=>s("invertOrbitX",o.target.checked)}),e.jsx("span",{children:a("terminal:controls.invertOrbitX")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:t.invertOrbitY,onChange:o=>s("invertOrbitY",o.target.checked)}),e.jsx("span",{children:a("terminal:controls.invertOrbitY")})]})]})]})}function se({config:t}){const{t:a}=S(["terminal"]),s=m.useCallback((l,h)=>{y.updateTrackpadConfig({[l]:h})},[]),o=m.useCallback((l,h)=>{y.updateTrackpadConfig({sensitivity:{[l]:h}})},[]);return e.jsxs("div",{className:"trackpad-settings",children:[e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:a("terminal:controls.trackpadGestures")}),e.jsx("span",{className:"shortcuts-context-description",children:a("terminal:controls.enableTrackpadSupport")})]}),e.jsx("div",{className:"trackpad-toggle-row",children:e.jsxs("label",{className:"trackpad-toggle",children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:l=>s("enabled",l.target.checked)}),e.jsx("span",{className:"trackpad-toggle-label",children:a("terminal:controls.enableTrackpadGestures")})]})})]}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:a("terminal:controls.gestureControls")}),e.jsx("span",{className:"shortcuts-context-description",children:a("terminal:controls.enableDisableGestures")})]}),e.jsxs("div",{className:"trackpad-gestures-grid",children:[e.jsxs("label",{className:`trackpad-gesture-item ${t.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:t.pinchToZoom,onChange:l=>s("pinchToZoom",l.target.checked),disabled:!t.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:a("terminal:controls.pinchToZoom")}),e.jsx("span",{className:"trackpad-gesture-desc",children:a("terminal:controls.pinchToZoomDesc")})]})]}),e.jsxs("label",{className:`trackpad-gesture-item ${t.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:t.twoFingerPan,onChange:l=>s("twoFingerPan",l.target.checked),disabled:!t.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:a("terminal:controls.twoFingerPan")}),e.jsx("span",{className:"trackpad-gesture-desc",children:a("terminal:controls.twoFingerPanDesc")})]})]}),e.jsxs("label",{className:`trackpad-gesture-item ${t.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:t.shiftTwoFingerOrbit,onChange:l=>s("shiftTwoFingerOrbit",l.target.checked),disabled:!t.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:a("terminal:controls.shiftTwoFingerOrbit")}),e.jsx("span",{className:"trackpad-gesture-desc",children:a("terminal:controls.shiftTwoFingerOrbitDesc")})]})]})]})]}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:a("terminal:controls.sensitivity")}),e.jsx("span",{className:"shortcuts-context-description",children:a("terminal:controls.adjustGestureSensitivity")})]}),e.jsxs("div",{className:"trackpad-sensitivity-sliders",children:[e.jsxs("div",{className:`trackpad-slider-row ${!t.enabled||!t.pinchToZoom?"disabled":""}`,children:[e.jsx("label",{children:a("terminal:controls.zoom")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:t.sensitivity.zoom,onChange:l=>o("zoom",parseFloat(l.target.value)),disabled:!t.enabled||!t.pinchToZoom}),e.jsxs("span",{className:"trackpad-slider-value",children:[t.sensitivity.zoom.toFixed(1),"x"]})]}),e.jsxs("div",{className:`trackpad-slider-row ${!t.enabled||!t.twoFingerPan?"disabled":""}`,children:[e.jsx("label",{children:a("terminal:controls.pan")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:t.sensitivity.pan,onChange:l=>o("pan",parseFloat(l.target.value)),disabled:!t.enabled||!t.twoFingerPan}),e.jsxs("span",{className:"trackpad-slider-value",children:[t.sensitivity.pan.toFixed(1),"x"]})]}),e.jsxs("div",{className:`trackpad-slider-row ${!t.enabled||!t.shiftTwoFingerOrbit?"disabled":""}`,children:[e.jsx("label",{children:a("terminal:controls.orbit")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:t.sensitivity.orbit,onChange:l=>o("orbit",parseFloat(l.target.value)),disabled:!t.enabled||!t.shiftTwoFingerOrbit}),e.jsxs("span",{className:"trackpad-slider-value",children:[t.sensitivity.orbit.toFixed(1),"x"]})]})]})]})]})}export{oe as ControlsModal};
1
+ import{u as S,a_ as Y,r as m,a$ as _,aZ as w,j as e,f as X,b0 as W,b1 as Z,q as U,h as q,s as y,b2 as z,b3 as A}from"./main-DFVf4Fc5.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function H({shortcut:t,onUpdate:a}){const{t:s}=S(["config","terminal"]),o=Y(),[l,h]=m.useState(!1),[i,j]=m.useState(null),f=m.useRef(null),v=m.useMemo(()=>i?_(o,i,t.id,t.context):[],[i,o,t.id,t.context]);m.useEffect(()=>{if(!l)return;const p=c=>{if(c.preventDefault(),c.stopPropagation(),c.key==="Escape"&&!c.ctrlKey&&!c.altKey&&!c.shiftKey&&!c.metaKey){h(!1),j(null);return}if(["Control","Alt","Shift","Meta"].includes(c.key))return;let b=c.key;c.code.startsWith("Key")&&c.code.length===4?b=c.code.charAt(3).toLowerCase():c.code.startsWith("Digit")&&c.code.length===6?b=c.code.charAt(5):c.code==="Space"&&(b="Space");const x={key:b,modifiers:{ctrl:c.ctrlKey,alt:c.altKey,shift:c.shiftKey,meta:c.metaKey}};j(x)};return document.addEventListener("keydown",p,!0),()=>document.removeEventListener("keydown",p,!0)},[l]),m.useEffect(()=>{if(!l)return;const p=c=>{f.current&&!f.current.contains(c.target)&&(i&&v.length===0&&a(i),h(!1),j(null))};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[l,i,v,a]);const k=()=>{l?(i&&v.length===0&&a(i),h(!1),j(null)):(h(!0),j(null))},g=p=>{p.stopPropagation(),a({key:"",modifiers:{}})};let d;return l?i?d=w({...t,...i}):d=s("config:shortcuts.pressKeys"):t.key?d=w(t):d=s("config:shortcuts.notSet"),e.jsxs("div",{className:"key-capture-container",children:[e.jsx("button",{ref:f,className:`key-capture-input ${l?"capturing":""} ${v.length>0?"conflict":""} ${t.enabled?"":"disabled"}`,onClick:k,title:s(l?"config:shortcuts.pressKeysOrClick":"config:shortcuts.clickToChange"),children:e.jsx("span",{className:"key-capture-value",children:d})}),t.key&&!l&&e.jsx("button",{className:"key-capture-clear",onClick:g,title:s("config:shortcuts.clearShortcut"),children:"×"}),v.length>0&&e.jsx("div",{className:"key-capture-conflict",children:s("config:shortcuts.conflictsWith",{names:v.map(p=>s(`terminal:controls.shortcuts.${p.id}.name`,{defaultValue:p.name})).join(", ")})})]})}const V={global:"terminal:controls.contextGlobal",commander:"terminal:controls.contextCommander",toolbox:"terminal:controls.contextToolbox"},Q={global:"terminal:controls.contextGlobalDesc",commander:"terminal:controls.contextCommanderDesc",toolbox:"terminal:controls.contextToolboxDesc"},R={camera:["camera-pan","camera-orbit","camera-rotate","camera-zoom","camera-tilt"],interaction:["primary-action","selection-box","context-menu","move-command"]},J={camera:"terminal:controls.cameraControls",interaction:"terminal:controls.interaction"};function oe({isOpen:t,onClose:a}){const{t:s}=S(["terminal","common"]),o=X(),l=W(),h=Z(),[i,j]=m.useState("keyboard"),[f,v]=m.useState(""),[k,g]=m.useState("all"),[d,p]=m.useState(!1),[c,b]=m.useState(null),x=U.useRef(null),{handleMouseDown:D,handleClick:M}=q(a);if(m.useEffect(()=>{if(!t||d)return;const r=n=>{n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),a())};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[t,a,d]),m.useEffect(()=>{t||(v(""),p(!1),b(null))},[t]),m.useEffect(()=>{if(!t||!d)return;const r=n=>{if(n.key==="Escape"){n.preventDefault(),n.stopPropagation(),p(!1),b(null);return}if(["Control","Alt","Shift","Meta"].includes(n.key))return;n.preventDefault(),n.stopPropagation();let u=n.key;n.code.startsWith("Key")&&n.code.length===4?u=n.code.charAt(3).toLowerCase():n.code.startsWith("Digit")&&n.code.length===6?u=n.code.charAt(5):n.code==="Space"&&(u="Space"),b({key:u,modifiers:{ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey,meta:n.metaKey}})};return document.addEventListener("keydown",r,!0),()=>document.removeEventListener("keydown",r,!0)},[t,d]),!t)return null;const E=o.shortcuts.filter(r=>{const n=s(`terminal:controls.shortcuts.${r.id}.name`,{defaultValue:r.name}),u=s(`terminal:controls.shortcuts.${r.id}.description`,{defaultValue:r.description});if(d&&c){const O=C=>C===" "||C==="Space"?"Space":C.length===1?C.toLowerCase():C,$=O(r.key),B=O(c.key);if(!(B.length===1&&/^[a-zA-Z]$/.test($)?`Key${$.toUpperCase()}`==`Key${B.toUpperCase()}`:$===B))return!1;const K=r.modifiers,T=c.modifiers;return(K.ctrl||!1)===(T.ctrl||!1)&&(K.alt||!1)===(T.alt||!1)&&(K.shift||!1)===(T.shift||!1)&&(K.meta||!1)===(T.meta||!1)}if(!f)return!0;const N=f.toLowerCase();return n.toLowerCase().includes(N)||u.toLowerCase().includes(N)||w(r).toLowerCase().includes(N)}),L=E.reduce((r,n)=>(r[n.context]||(r[n.context]=[]),r[n.context].push(n),r),{}),G=(r,n)=>{y.updateShortcut(r,n)},F=()=>{i==="keyboard"?confirm(s("terminal:controls.confirmResetKeyboard"))&&y.resetShortcuts():i==="mouse"?confirm(s("terminal:controls.confirmResetMouse"))&&y.resetMouseControls():i==="trackpad"&&confirm(s("terminal:controls.confirmResetTrackpad"))&&y.resetMouseControls()},P=["global","commander","toolbox"],I=l.bindings.reduce((r,n)=>(R.camera.includes(n.action)?r.camera.push(n):R.interaction.includes(n.action)&&r.interaction.push(n),r),{camera:[],interaction:[]});return e.jsx("div",{className:"shortcuts-modal-overlay",onMouseDown:D,onClick:M,children:e.jsxs("div",{className:"shortcuts-modal controls-modal",children:[e.jsxs("div",{className:"shortcuts-modal-header",children:[e.jsxs("div",{className:"shortcuts-modal-title",children:[e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),e.jsx("span",{children:s("terminal:controls.title")})]}),e.jsx("button",{className:"shortcuts-modal-close",onClick:a,children:"×"})]}),e.jsxs("div",{className:"controls-main-tabs",children:[e.jsxs("button",{className:`controls-main-tab ${i==="keyboard"?"active":""}`,onClick:()=>j("keyboard"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]}),s("terminal:controls.keyboard")]}),e.jsxs("button",{className:`controls-main-tab ${i==="mouse"?"active":""}`,onClick:()=>j("mouse"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"6",y:"3",width:"12",height:"18",rx:"6"}),e.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"11"})]}),s("terminal:controls.mouse")]}),e.jsxs("button",{className:`controls-main-tab ${i==="trackpad"?"active":""}`,onClick:()=>j("trackpad"),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),s("terminal:controls.trackpad")]})]}),i==="keyboard"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[d?e.jsxs("div",{className:"shortcuts-search find-by-shortcut-active",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]}),c?e.jsxs("span",{className:"find-by-shortcut-display",children:[w({key:c.key,modifiers:c.modifiers}),e.jsx("button",{className:"shortcuts-search-clear",onClick:()=>b(null),children:"×"})]}):e.jsx("span",{className:"find-by-shortcut-prompt",children:s("terminal:controls.pressKeyCombination")})]}):e.jsxs("div",{className:"shortcuts-search",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("path",{d:"M21 21l-4.35-4.35"})]}),e.jsx("input",{ref:x,type:"text",placeholder:s("terminal:controls.searchShortcuts"),value:f,onChange:r=>v(r.target.value),autoFocus:!0}),f&&e.jsx("button",{className:"shortcuts-search-clear",onClick:()=>v(""),children:"×"})]}),e.jsx("button",{className:`shortcuts-find-by-key-btn ${d?"active":""}`,onClick:()=>{p(!d),b(null),v("")},title:s(d?"terminal:controls.switchToTextSearch":"terminal:controls.findByPressingKeys"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),e.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M6 12h.01M18 12h.01M8 16h8"})]})}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:F,children:s("common:buttons.reset")})]}),e.jsxs("div",{className:"shortcuts-context-tabs",children:[e.jsxs("button",{className:`shortcuts-context-tab ${k==="all"?"active":""}`,onClick:()=>g("all"),children:[s("common:labels.all"),e.jsx("span",{className:"shortcuts-context-tab-count",children:E.length})]}),P.map(r=>{var u;const n=((u=L[r])==null?void 0:u.length)||0;return e.jsxs("button",{className:`shortcuts-context-tab ${k===r?"active":""}`,onClick:()=>g(r),children:[s(V[r]),e.jsx("span",{className:"shortcuts-context-tab-count",children:n})]},r)})]}),e.jsxs("div",{className:"shortcuts-modal-content",children:[P.map(r=>{const n=L[r]||[];return n.length===0||k!=="all"&&k!==r?null:e.jsxs("div",{className:"shortcuts-context-group",children:[k==="all"&&e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:s(V[r])}),e.jsx("span",{className:"shortcuts-context-description",children:s(Q[r])})]}),e.jsx("div",{className:"shortcuts-grid",children:n.map(u=>e.jsxs("div",{className:"shortcut-item",children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:s(`terminal:controls.shortcuts.${u.id}.name`,{defaultValue:u.name})}),e.jsx("span",{className:"shortcut-item-description",children:s(`terminal:controls.shortcuts.${u.id}.description`,{defaultValue:u.description})})]}),e.jsx(H,{shortcut:u,onUpdate:N=>G(u.id,N)})]},u.id))})]},r)}),E.length===0&&e.jsx("div",{className:"shortcuts-empty",children:d?c?e.jsx("p",{children:s("terminal:controls.noShortcutBoundTo",{keys:w({key:c.key,modifiers:c.modifiers})})}):e.jsx("p",{children:s("terminal:controls.pressKeyCombinationToFind")}):e.jsx("p",{children:s("terminal:controls.noShortcutsFound",{query:f})})})]})]}),i==="mouse"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[e.jsx("span",{className:"mouse-controls-subtitle",children:s("terminal:controls.cameraAndInteraction")}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:F,children:s("common:buttons.reset")})]}),e.jsxs("div",{className:"shortcuts-modal-content mouse-controls-content",children:[e.jsx("div",{className:"mouse-controls-bindings",children:Object.entries(I).map(([r,n])=>e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsx("div",{className:"shortcuts-context-header",children:e.jsx("span",{className:"shortcuts-context-label",children:s(J[r])})}),e.jsx("div",{className:"shortcuts-grid",children:n.map(u=>e.jsx(ee,{binding:u},u.id))})]},r))}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:s("terminal:controls.sensitivity")}),e.jsx("span",{className:"shortcuts-context-description",children:s("terminal:controls.adjustCameraSpeed")})]}),e.jsx(te,{sensitivity:l.sensitivity})]})]})]}),i==="trackpad"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shortcuts-modal-toolbar",children:[e.jsx("span",{className:"mouse-controls-subtitle",children:s("terminal:controls.trackpadGestureSettings")}),e.jsx("button",{className:"shortcuts-reset-all-btn",onClick:F,children:s("common:buttons.reset")})]}),e.jsx("div",{className:"shortcuts-modal-content trackpad-controls-content",children:e.jsx(se,{config:h})})]}),e.jsx("div",{className:"shortcuts-modal-footer",children:e.jsx("span",{className:"shortcuts-modal-hint",children:s(i==="keyboard"?d?"terminal:controls.hintFindByShortcut":"terminal:controls.hintKeyboard":i==="mouse"?"terminal:controls.hintMouse":"terminal:controls.hintTrackpad")})})]})})}function ee({binding:t}){const{t:a}=S(["terminal"]),s=W(),[o,l]=m.useState(!1),[h,i]=m.useState(null);m.useEffect(()=>{if(!o)return;const d=x=>{x.preventDefault(),x.stopPropagation();const M={0:"left",1:"middle",2:"right",3:"back",4:"forward"}[x.button];M&&i({button:M,modifiers:{ctrl:x.ctrlKey,alt:x.altKey,shift:x.shiftKey,meta:x.metaKey}})},p=x=>{x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),l(!1),i(null))},c=()=>{h&&z(s.bindings,h,t.id).length===0&&y.updateMouseBinding(t.id,{button:h.button,modifiers:h.modifiers}),l(!1),i(null)},b=setTimeout(()=>{document.addEventListener("mousedown",d,!0),document.addEventListener("keydown",p,!0),document.addEventListener("click",c,!0)},100);return()=>{clearTimeout(b),document.removeEventListener("mousedown",d,!0),document.removeEventListener("keydown",p,!0),document.removeEventListener("click",c,!0)}},[o,h,t.id,s.bindings]);const j=h?z(s.bindings,h,t.id):[],f=a(`terminal:controls.mouseBindings.${t.id}.name`,{defaultValue:t.name}),v=a(`terminal:controls.mouseBindings.${t.id}.description`,{defaultValue:t.description}),k=d=>a(`terminal:controls.mouseButtons.${d}`,{defaultValue:d}),g=h?A({...t,...h},k):A(t,k);return e.jsxs("div",{className:`shortcut-item ${t.enabled?"":"disabled"}`,children:[e.jsxs("div",{className:"shortcut-item-info",children:[e.jsx("span",{className:"shortcut-item-name",children:f}),e.jsx("span",{className:"shortcut-item-description",children:v})]}),e.jsxs("div",{className:"key-capture-container",children:[e.jsx("button",{className:`key-capture-input ${o?"capturing":""} ${j.length>0?"conflict":""}`,onClick:()=>l(!0),children:o?h?e.jsx("span",{className:"key-capture-value",style:{color:"#f1fa8c"},children:g}):e.jsx("span",{style:{color:"#6272a4",fontStyle:"italic"},children:a("terminal:controls.clickToCapture")}):e.jsx("span",{className:"key-capture-value",children:g})}),j.length>0&&e.jsxs("span",{className:"key-capture-conflict",children:[a("terminal:controls.conflicts"),": ",j.map(d=>a(`terminal:controls.mouseBindings.${d.id}.name`,{defaultValue:d.name})).join(", ")]})]})]})}function te({sensitivity:t}){const{t:a}=S(["terminal"]),s=m.useCallback((o,l)=>{y.updateCameraSensitivity({[o]:l})},[]);return e.jsxs("div",{className:"sensitivity-inline-settings",children:[e.jsxs("div",{className:"sensitivity-sliders",children:[e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:a("terminal:controls.panSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:t.panSpeed,onChange:o=>s("panSpeed",parseFloat(o.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[t.panSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:a("terminal:controls.orbitSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:t.orbitSpeed,onChange:o=>s("orbitSpeed",parseFloat(o.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[t.orbitSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:a("terminal:controls.zoomSpeed")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:t.zoomSpeed,onChange:o=>s("zoomSpeed",parseFloat(o.target.value))}),e.jsxs("span",{className:"sensitivity-slider-value",children:[t.zoomSpeed.toFixed(1),"x"]})]}),e.jsxs("div",{className:"sensitivity-slider-row",children:[e.jsx("label",{children:a("terminal:controls.smoothing")}),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:t.smoothing,onChange:o=>s("smoothing",parseFloat(o.target.value))}),e.jsx("span",{className:"sensitivity-slider-value",children:t.smoothing.toFixed(1)})]})]}),e.jsxs("div",{className:"sensitivity-checkboxes-inline",children:[e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:t.invertPanX,onChange:o=>s("invertPanX",o.target.checked)}),e.jsx("span",{children:a("terminal:controls.invertPanX")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:t.invertPanY,onChange:o=>s("invertPanY",o.target.checked)}),e.jsx("span",{children:a("terminal:controls.invertPanY")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:t.invertOrbitX,onChange:o=>s("invertOrbitX",o.target.checked)}),e.jsx("span",{children:a("terminal:controls.invertOrbitX")})]}),e.jsxs("label",{className:"sensitivity-checkbox-inline",children:[e.jsx("input",{type:"checkbox",checked:t.invertOrbitY,onChange:o=>s("invertOrbitY",o.target.checked)}),e.jsx("span",{children:a("terminal:controls.invertOrbitY")})]})]})]})}function se({config:t}){const{t:a}=S(["terminal"]),s=m.useCallback((l,h)=>{y.updateTrackpadConfig({[l]:h})},[]),o=m.useCallback((l,h)=>{y.updateTrackpadConfig({sensitivity:{[l]:h}})},[]);return e.jsxs("div",{className:"trackpad-settings",children:[e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:a("terminal:controls.trackpadGestures")}),e.jsx("span",{className:"shortcuts-context-description",children:a("terminal:controls.enableTrackpadSupport")})]}),e.jsx("div",{className:"trackpad-toggle-row",children:e.jsxs("label",{className:"trackpad-toggle",children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:l=>s("enabled",l.target.checked)}),e.jsx("span",{className:"trackpad-toggle-label",children:a("terminal:controls.enableTrackpadGestures")})]})})]}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:a("terminal:controls.gestureControls")}),e.jsx("span",{className:"shortcuts-context-description",children:a("terminal:controls.enableDisableGestures")})]}),e.jsxs("div",{className:"trackpad-gestures-grid",children:[e.jsxs("label",{className:`trackpad-gesture-item ${t.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:t.pinchToZoom,onChange:l=>s("pinchToZoom",l.target.checked),disabled:!t.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:a("terminal:controls.pinchToZoom")}),e.jsx("span",{className:"trackpad-gesture-desc",children:a("terminal:controls.pinchToZoomDesc")})]})]}),e.jsxs("label",{className:`trackpad-gesture-item ${t.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:t.twoFingerPan,onChange:l=>s("twoFingerPan",l.target.checked),disabled:!t.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:a("terminal:controls.twoFingerPan")}),e.jsx("span",{className:"trackpad-gesture-desc",children:a("terminal:controls.twoFingerPanDesc")})]})]}),e.jsxs("label",{className:`trackpad-gesture-item ${t.enabled?"":"disabled"}`,children:[e.jsx("input",{type:"checkbox",checked:t.shiftTwoFingerOrbit,onChange:l=>s("shiftTwoFingerOrbit",l.target.checked),disabled:!t.enabled}),e.jsxs("div",{className:"trackpad-gesture-info",children:[e.jsx("span",{className:"trackpad-gesture-name",children:a("terminal:controls.shiftTwoFingerOrbit")}),e.jsx("span",{className:"trackpad-gesture-desc",children:a("terminal:controls.shiftTwoFingerOrbitDesc")})]})]})]})]}),e.jsxs("div",{className:"shortcuts-context-group",children:[e.jsxs("div",{className:"shortcuts-context-header",children:[e.jsx("span",{className:"shortcuts-context-label",children:a("terminal:controls.sensitivity")}),e.jsx("span",{className:"shortcuts-context-description",children:a("terminal:controls.adjustGestureSensitivity")})]}),e.jsxs("div",{className:"trackpad-sensitivity-sliders",children:[e.jsxs("div",{className:`trackpad-slider-row ${!t.enabled||!t.pinchToZoom?"disabled":""}`,children:[e.jsx("label",{children:a("terminal:controls.zoom")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:t.sensitivity.zoom,onChange:l=>o("zoom",parseFloat(l.target.value)),disabled:!t.enabled||!t.pinchToZoom}),e.jsxs("span",{className:"trackpad-slider-value",children:[t.sensitivity.zoom.toFixed(1),"x"]})]}),e.jsxs("div",{className:`trackpad-slider-row ${!t.enabled||!t.twoFingerPan?"disabled":""}`,children:[e.jsx("label",{children:a("terminal:controls.pan")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:t.sensitivity.pan,onChange:l=>o("pan",parseFloat(l.target.value)),disabled:!t.enabled||!t.twoFingerPan}),e.jsxs("span",{className:"trackpad-slider-value",children:[t.sensitivity.pan.toFixed(1),"x"]})]}),e.jsxs("div",{className:`trackpad-slider-row ${!t.enabled||!t.shiftTwoFingerOrbit?"disabled":""}`,children:[e.jsx("label",{children:a("terminal:controls.orbit")}),e.jsx("input",{type:"range",min:"0.1",max:"3",step:"0.1",value:t.sensitivity.orbit,onChange:l=>o("orbit",parseFloat(l.target.value)),disabled:!t.enabled||!t.shiftTwoFingerOrbit}),e.jsxs("span",{className:"trackpad-slider-value",children:[t.sensitivity.orbit.toFixed(1),"x"]})]})]})]})]})}export{oe as ControlsModal};
@@ -1,2 +1,2 @@
1
- import{u as l,f as L,r as m,s as r,j as x}from"./main-D8ST500w.js";import{L as S}from"./LogViewerModal-DjFERy1q.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function B({building:t,isOpen:o,onClose:n}){var a;const{t:i}=l(["terminal"]),{streamingBuildingLogs:c,streamingBuildingIds:g}=L(),s=c.get(t.id)||"",p=g.has(t.id);m.useEffect(()=>{var e;return o&&((e=t.docker)!=null&&e.enabled)&&r.startLogStreaming(t.id,200),()=>{t.id&&r.stopLogStreaming(t.id)}},[o,t.id,(a=t.docker)==null?void 0:a.enabled]);const d=m.useMemo(()=>s.split(`
1
+ import{u as l,f as L,r as m,s as r,j as x}from"./main-DFVf4Fc5.js";import{L as S}from"./LogViewerModal--6BvTYOV.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function B({building:t,isOpen:o,onClose:n}){var a;const{t:i}=l(["terminal"]),{streamingBuildingLogs:c,streamingBuildingIds:g}=L(),s=c.get(t.id)||"",p=g.has(t.id);m.useEffect(()=>{var e;return o&&((e=t.docker)!=null&&e.enabled)&&r.startLogStreaming(t.id,200),()=>{t.id&&r.stopLogStreaming(t.id)}},[o,t.id,(a=t.docker)==null?void 0:a.enabled]);const d=m.useMemo(()=>s.split(`
2
2
  `).map((e,f)=>({text:e,lineNumber:f+1})),[s]);return x.jsx(S,{isOpen:o,onClose:n,title:`${t.name} - ${i("terminal:logs.dockerLogs")}`,icon:"🐳",lines:d,isStreaming:p,onClear:()=>r.clearStreamingLogs(t.id)})}export{B as DockerLogsModal};
@@ -1,4 +1,4 @@
1
- import{r as je,j as eO}from"./main-D8ST500w.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";let xs=[],ec=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,O=0;e<t.length;e++)(e%2?ec:xs).push(O=O+t[e])})();function gu(t){if(t<768)return!1;for(let e=0,O=xs.length;;){let i=e+O>>1;if(t<xs[i])O=i;else if(t>=ec[i])e=i+1;else return!0;if(e==O)return!1}}function Bo(t){return t>=127462&&t<=127487}const No=8205;function Su(t,e,O=!0,i=!0){return(O?Oc:Xu)(t,e,i)}function Oc(t,e,O){if(e==t.length)return e;e&&tc(t.charCodeAt(e))&&ic(t.charCodeAt(e-1))&&e--;let i=wn(t,e);for(e+=Fo(i);e<t.length;){let r=wn(t,e);if(i==No||r==No||O&&gu(r))e+=Fo(r),i=r;else if(Bo(r)){let n=0,s=e-2;for(;s>=0&&Bo(wn(t,s));)n++,s-=2;if(n%2==0)break;e+=2}else break}return e}function Xu(t,e,O){for(;e>0;){let i=Oc(t,e-2,O);if(i<e)return i;e--}return 0}function wn(t,e){let O=t.charCodeAt(e);if(!ic(O)||e+1==t.length)return O;let i=t.charCodeAt(e+1);return tc(i)?(O-55296<<10)+(i-56320)+65536:O}function tc(t){return t>=56320&&t<57344}function ic(t){return t>=55296&&t<56320}function Fo(t){return t<65536?1:2}class G{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,O,i){[e,O]=Zt(this,e,O);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(O,this.length,r,1),sO.from(r,this.length-(O-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,O=this.length){[e,O]=Zt(this,e,O);let i=[];return this.decompose(e,O,i,0),sO.from(i,O-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let O=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new ti(this),n=new ti(e);for(let s=O,a=O;;){if(r.next(s),n.next(s),s=0,r.lineBreak!=n.lineBreak||r.done!=n.done||r.value!=n.value)return!1;if(a+=r.value.length,r.done||a>=i)return!0}}iter(e=1){return new ti(this,e)}iterRange(e,O=this.length){return new rc(this,e,O)}iterLines(e,O){let i;if(e==null)i=this.iter();else{O==null&&(O=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,O==this.lines+1?this.length:O<=1?0:this.line(O-1).to))}return new nc(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?G.empty:e.length<=32?new ie(e):sO.from(ie.split(e,[]))}}class ie extends G{constructor(e,O=Tu(e)){super(),this.text=e,this.length=O}get lines(){return this.text.length}get children(){return null}lineInner(e,O,i,r){for(let n=0;;n++){let s=this.text[n],a=r+s.length;if((O?i:a)>=e)return new yu(r,a,i,s);r=a+1,i++}}decompose(e,O,i,r){let n=e<=0&&O>=this.length?this:new ie(Ho(this.text,e,O),Math.min(O,this.length)-Math.max(0,e));if(r&1){let s=i.pop(),a=ur(n.text,s.text.slice(),0,n.length);if(a.length<=32)i.push(new ie(a,s.length+n.length));else{let o=a.length>>1;i.push(new ie(a.slice(0,o)),new ie(a.slice(o)))}}else i.push(n)}replace(e,O,i){if(!(i instanceof ie))return super.replace(e,O,i);[e,O]=Zt(this,e,O);let r=ur(this.text,ur(i.text,Ho(this.text,0,e)),O),n=this.length+i.length-(O-e);return r.length<=32?new ie(r,n):sO.from(ie.split(r,[]),n)}sliceString(e,O=this.length,i=`
1
+ import{r as je,j as eO}from"./main-DFVf4Fc5.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";let xs=[],ec=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,O=0;e<t.length;e++)(e%2?ec:xs).push(O=O+t[e])})();function gu(t){if(t<768)return!1;for(let e=0,O=xs.length;;){let i=e+O>>1;if(t<xs[i])O=i;else if(t>=ec[i])e=i+1;else return!0;if(e==O)return!1}}function Bo(t){return t>=127462&&t<=127487}const No=8205;function Su(t,e,O=!0,i=!0){return(O?Oc:Xu)(t,e,i)}function Oc(t,e,O){if(e==t.length)return e;e&&tc(t.charCodeAt(e))&&ic(t.charCodeAt(e-1))&&e--;let i=wn(t,e);for(e+=Fo(i);e<t.length;){let r=wn(t,e);if(i==No||r==No||O&&gu(r))e+=Fo(r),i=r;else if(Bo(r)){let n=0,s=e-2;for(;s>=0&&Bo(wn(t,s));)n++,s-=2;if(n%2==0)break;e+=2}else break}return e}function Xu(t,e,O){for(;e>0;){let i=Oc(t,e-2,O);if(i<e)return i;e--}return 0}function wn(t,e){let O=t.charCodeAt(e);if(!ic(O)||e+1==t.length)return O;let i=t.charCodeAt(e+1);return tc(i)?(O-55296<<10)+(i-56320)+65536:O}function tc(t){return t>=56320&&t<57344}function ic(t){return t>=55296&&t<56320}function Fo(t){return t<65536?1:2}class G{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,O,i){[e,O]=Zt(this,e,O);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(O,this.length,r,1),sO.from(r,this.length-(O-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,O=this.length){[e,O]=Zt(this,e,O);let i=[];return this.decompose(e,O,i,0),sO.from(i,O-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let O=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new ti(this),n=new ti(e);for(let s=O,a=O;;){if(r.next(s),n.next(s),s=0,r.lineBreak!=n.lineBreak||r.done!=n.done||r.value!=n.value)return!1;if(a+=r.value.length,r.done||a>=i)return!0}}iter(e=1){return new ti(this,e)}iterRange(e,O=this.length){return new rc(this,e,O)}iterLines(e,O){let i;if(e==null)i=this.iter();else{O==null&&(O=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,O==this.lines+1?this.length:O<=1?0:this.line(O-1).to))}return new nc(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?G.empty:e.length<=32?new ie(e):sO.from(ie.split(e,[]))}}class ie extends G{constructor(e,O=Tu(e)){super(),this.text=e,this.length=O}get lines(){return this.text.length}get children(){return null}lineInner(e,O,i,r){for(let n=0;;n++){let s=this.text[n],a=r+s.length;if((O?i:a)>=e)return new yu(r,a,i,s);r=a+1,i++}}decompose(e,O,i,r){let n=e<=0&&O>=this.length?this:new ie(Ho(this.text,e,O),Math.min(O,this.length)-Math.max(0,e));if(r&1){let s=i.pop(),a=ur(n.text,s.text.slice(),0,n.length);if(a.length<=32)i.push(new ie(a,s.length+n.length));else{let o=a.length>>1;i.push(new ie(a.slice(0,o)),new ie(a.slice(o)))}}else i.push(n)}replace(e,O,i){if(!(i instanceof ie))return super.replace(e,O,i);[e,O]=Zt(this,e,O);let r=ur(this.text,ur(i.text,Ho(this.text,0,e)),O),n=this.length+i.length-(O-e);return r.length<=32?new ie(r,n):sO.from(ie.split(r,[]),n)}sliceString(e,O=this.length,i=`
2
2
  `){[e,O]=Zt(this,e,O);let r="";for(let n=0,s=0;n<=O&&s<this.text.length;s++){let a=this.text[s],o=n+a.length;n>e&&s&&(r+=i),e<o&&O>n&&(r+=a.slice(Math.max(0,e-n),O-n)),n=o+1}return r}flatten(e){for(let O of this.text)e.push(O)}scanIdentical(){return 0}static split(e,O){let i=[],r=-1;for(let n of e)i.push(n),r+=n.length+1,i.length==32&&(O.push(new ie(i,r)),i=[],r=-1);return r>-1&&O.push(new ie(i,r)),O}}class sO extends G{constructor(e,O){super(),this.children=e,this.length=O,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,O,i,r){for(let n=0;;n++){let s=this.children[n],a=r+s.length,o=i+s.lines-1;if((O?o:a)>=e)return s.lineInner(e,O,i,r);r=a+1,i=o+1}}decompose(e,O,i,r){for(let n=0,s=0;s<=O&&n<this.children.length;n++){let a=this.children[n],o=s+a.length;if(e<=o&&O>=s){let l=r&((s<=e?1:0)|(o>=O?2:0));s>=e&&o<=O&&!l?i.push(a):a.decompose(e-s,O-s,i,l)}s=o+1}}replace(e,O,i){if([e,O]=Zt(this,e,O),i.lines<this.lines)for(let r=0,n=0;r<this.children.length;r++){let s=this.children[r],a=n+s.length;if(e>=n&&O<=a){let o=s.replace(e-n,O-n,i),l=this.lines-s.lines+o.lines;if(o.lines<l>>4&&o.lines>l>>6){let Q=this.children.slice();return Q[r]=o,new sO(Q,this.length-(O-e)+i.length)}return super.replace(n,a,o)}n=a+1}return super.replace(e,O,i)}sliceString(e,O=this.length,i=`
3
3
  `){[e,O]=Zt(this,e,O);let r="";for(let n=0,s=0;n<this.children.length&&s<=O;n++){let a=this.children[n],o=s+a.length;s>e&&n&&(r+=i),e<o&&O>s&&(r+=a.sliceString(e-s,O-s,i)),s=o+1}return r}flatten(e){for(let O of this.children)O.flatten(e)}scanIdentical(e,O){if(!(e instanceof sO))return 0;let i=0,[r,n,s,a]=O>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=O,n+=O){if(r==s||n==a)return i;let o=this.children[r],l=e.children[n];if(o!=l)return i+o.scanIdentical(l,O);i+=o.length+1}}static from(e,O=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let f of e)i+=f.lines;if(i<32){let f=[];for(let d of e)d.flatten(f);return new ie(f,O)}let r=Math.max(32,i>>5),n=r<<1,s=r>>1,a=[],o=0,l=-1,Q=[];function $(f){let d;if(f.lines>n&&f instanceof sO)for(let u of f.children)$(u);else f.lines>s&&(o>s||!o)?(h(),a.push(f)):f instanceof ie&&o&&(d=Q[Q.length-1])instanceof ie&&f.lines+d.lines<=32?(o+=f.lines,l+=f.length+1,Q[Q.length-1]=new ie(d.text.concat(f.text),d.length+1+f.length)):(o+f.lines>r&&h(),o+=f.lines,l+=f.length+1,Q.push(f))}function h(){o!=0&&(a.push(Q.length==1?Q[0]:sO.from(Q,l)),l=-1,o=Q.length=0)}for(let f of e)$(f);return h(),a.length==1?a[0]:new sO(a,O)}}G.empty=new ie([""],0);function Tu(t){let e=-1;for(let O of t)e+=O.length+1;return e}function ur(t,e,O=0,i=1e9){for(let r=0,n=0,s=!0;n<t.length&&r<=i;n++){let a=t[n],o=r+a.length;o>=O&&(o>i&&(a=a.slice(0,i-r)),r<O&&(a=a.slice(O-r)),s?(e[e.length-1]+=a,s=!1):e.push(a)),r=o+1}return e}function Ho(t,e,O){return ur(t,[""],e,O)}class ti{constructor(e,O=1){this.dir=O,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[O>0?1:(e instanceof ie?e.text.length:e.children.length)<<1]}nextInner(e,O){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],n=this.offsets[i],s=n>>1,a=r instanceof ie?r.text.length:r.children.length;if(s==(O>0?a:0)){if(i==0)return this.done=!0,this.value="",this;O>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((n&1)==(O>0?0:1)){if(this.offsets[i]+=O,e==0)return this.lineBreak=!0,this.value=`
4
4
  `,this;e--}else if(r instanceof ie){let o=r.text[s+(O<0?-1:0)];if(this.offsets[i]+=O,o.length>Math.max(0,e))return this.value=e==0?o:O>0?o.slice(e):o.slice(0,o.length-e),this;e-=o.length}else{let o=r.children[s+(O<0?-1:0)];e>o.length?(e-=o.length,this.offsets[i]+=O):(O<0&&this.offsets[i]--,this.nodes.push(o),this.offsets.push(O>0?1:(o instanceof ie?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class rc{constructor(e,O,i){this.value="",this.done=!1,this.cursor=new ti(e,O>i?-1:1),this.pos=O>i?e.length:0,this.from=Math.min(O,i),this.to=Math.max(O,i)}nextInner(e,O){if(O<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,O<0?this.pos-this.to:this.from-this.pos);let i=O<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*O,this.value=r.length<=i?r:O<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class nc{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:O,lineBreak:i,value:r}=this.inner.next(e);return O&&this.afterBreak?(this.value="",this.afterBreak=!1):O?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(G.prototype[Symbol.iterator]=function(){return this.iter()},ti.prototype[Symbol.iterator]=rc.prototype[Symbol.iterator]=nc.prototype[Symbol.iterator]=function(){return this});let yu=class{constructor(e,O,i,r){this.from=e,this.to=O,this.number=i,this.text=r}get length(){return this.to-this.from}};function Zt(t,e,O){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,O))]}function oe(t,e,O=!0,i=!0){return Su(t,e,O,i)}function bu(t){return t>=56320&&t<57344}function xu(t){return t>=55296&&t<56320}function $t(t,e){let O=t.charCodeAt(e);if(!xu(O)||e+1==t.length)return O;let i=t.charCodeAt(e+1);return bu(i)?(O-55296<<10)+(i-56320)+65536:O}function sc(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Ri(t){return t<65536?1:2}const ws=/\r\n?|\n/;var de=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(de||(de={}));class hO{constructor(e){this.sections=e}get length(){let e=0;for(let O=0;O<this.sections.length;O+=2)e+=this.sections[O];return e}get newLength(){let e=0;for(let O=0;O<this.sections.length;O+=2){let i=this.sections[O+1];e+=i<0?this.sections[O]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let O=0,i=0,r=0;O<this.sections.length;){let n=this.sections[O++],s=this.sections[O++];s<0?(e(i,r,n),r+=n):r+=s,i+=n}}iterChangedRanges(e,O=!1){Ys(this,e,O)}get invertedDesc(){let e=[];for(let O=0;O<this.sections.length;){let i=this.sections[O++],r=this.sections[O++];r<0?e.push(i,r):e.push(r,i)}return new hO(e)}composeDesc(e){return this.empty?e:e.empty?this:ac(this,e)}mapDesc(e,O=!1){return e.empty?this:ks(this,e,O)}mapPos(e,O=-1,i=de.Simple){let r=0,n=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],o=this.sections[s++],l=r+a;if(o<0){if(l>e)return n+(e-r);n+=a}else{if(i!=de.Simple&&l>=e&&(i==de.TrackDel&&r<e&&l>e||i==de.TrackBefore&&r<e||i==de.TrackAfter&&l>e))return null;if(l>e||l==e&&O<0&&!a)return e==r||O<0?n:n+o;n+=o}r=l}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return n}touchesRange(e,O=e){for(let i=0,r=0;i<this.sections.length&&r<=O;){let n=this.sections[i++],s=this.sections[i++],a=r+n;if(s>=0&&r<=O&&a>=e)return r<e&&a>O?"cover":!0;r=a}return!1}toString(){let e="";for(let O=0;O<this.sections.length;){let i=this.sections[O++],r=this.sections[O++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(O=>typeof O!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new hO(e)}static create(e){return new hO(e)}}class ne extends hO{constructor(e,O){super(e),this.inserted=O}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Ys(this,(O,i,r,n,s)=>e=e.replace(r,r+(i-O),s),!1),e}mapDesc(e,O=!1){return ks(this,e,O,!0)}invert(e){let O=this.sections.slice(),i=[];for(let r=0,n=0;r<O.length;r+=2){let s=O[r],a=O[r+1];if(a>=0){O[r]=a,O[r+1]=s;let o=r>>1;for(;i.length<o;)i.push(G.empty);i.push(s?e.slice(n,n+s):G.empty)}n+=s}return new ne(O,i)}compose(e){return this.empty?e:e.empty?this:ac(this,e,!0)}map(e,O=!1){return e.empty?this:ks(this,e,O,!0)}iterChanges(e,O=!1){Ys(this,e,O)}get desc(){return hO.create(this.sections)}filter(e){let O=[],i=[],r=[],n=new ci(this);e:for(let s=0,a=0;;){let o=s==e.length?1e9:e[s++];for(;a<o||a==o&&n.len==0;){if(n.done)break e;let Q=Math.min(n.len,o-a);fe(r,Q,-1);let $=n.ins==-1?-1:n.off==0?n.ins:0;fe(O,Q,$),$>0&&VO(i,O,n.text),n.forward(Q),a+=Q}let l=e[s++];for(;a<l;){if(n.done)break e;let Q=Math.min(n.len,l-a);fe(O,Q,-1),fe(r,Q,n.ins==-1?-1:n.off==0?n.ins:0),n.forward(Q),a+=Q}}return{changes:new ne(O,i),filtered:hO.create(r)}}toJSON(){let e=[];for(let O=0;O<this.sections.length;O+=2){let i=this.sections[O],r=this.sections[O+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[O>>1].toJSON()))}return e}static of(e,O,i){let r=[],n=[],s=0,a=null;function o(Q=!1){if(!Q&&!r.length)return;s<O&&fe(r,O-s,-1);let $=new ne(r,n);a=a?a.compose($.map(a)):$,r=[],n=[],s=0}function l(Q){if(Array.isArray(Q))for(let $ of Q)l($);else if(Q instanceof ne){if(Q.length!=O)throw new RangeError(`Mismatched change set length (got ${Q.length}, expected ${O})`);o(),a=a?a.compose(Q.map(a)):Q}else{let{from:$,to:h=$,insert:f}=Q;if($>h||$<0||h>O)throw new RangeError(`Invalid change range ${$} to ${h} (in doc of length ${O})`);let d=f?typeof f=="string"?G.of(f.split(i||ws)):f:G.empty,u=d.length;if($==h&&u==0)return;$<s&&o(),$>s&&fe(r,$-s,-1),fe(r,h-$,u),VO(n,r,d),s=h}}return l(e),o(!a),a}static empty(e){return new ne(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let O=[],i=[];for(let r=0;r<e.length;r++){let n=e[r];if(typeof n=="number")O.push(n,-1);else{if(!Array.isArray(n)||typeof n[0]!="number"||n.some((s,a)=>a&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(n.length==1)O.push(n[0],0);else{for(;i.length<r;)i.push(G.empty);i[r]=G.of(n.slice(1)),O.push(n[0],i[r].length)}}}return new ne(O,i)}static createSet(e,O){return new ne(e,O)}}function fe(t,e,O,i=!1){if(e==0&&O<=0)return;let r=t.length-2;r>=0&&O<=0&&O==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=O:i?(t[r]+=e,t[r+1]+=O):t.push(e,O)}function VO(t,e,O){if(O.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(O);else{for(;t.length<i;)t.push(G.empty);t.push(O)}}function Ys(t,e,O){let i=t.inserted;for(let r=0,n=0,s=0;s<t.sections.length;){let a=t.sections[s++],o=t.sections[s++];if(o<0)r+=a,n+=a;else{let l=r,Q=n,$=G.empty;for(;l+=a,Q+=o,o&&i&&($=$.append(i[s-2>>1])),!(O||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],o=t.sections[s++];e(r,l,n,Q,$),r=l,n=Q}}}function ks(t,e,O,i=!1){let r=[],n=i?[]:null,s=new ci(t),a=new ci(e);for(let o=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let l=Math.min(s.len,a.len);fe(r,l,-1),s.forward(l),a.forward(l)}else if(a.ins>=0&&(s.ins<0||o==s.i||s.off==0&&(a.len<s.len||a.len==s.len&&!O))){let l=a.len;for(fe(r,a.ins,-1);l;){let Q=Math.min(s.len,l);s.ins>=0&&o<s.i&&s.len<=Q&&(fe(r,0,s.ins),n&&VO(n,r,s.text),o=s.i),s.forward(Q),l-=Q}a.next()}else if(s.ins>=0){let l=0,Q=s.len;for(;Q;)if(a.ins==-1){let $=Math.min(Q,a.len);l+=$,Q-=$,a.forward($)}else if(a.ins==0&&a.len<Q)Q-=a.len,a.next();else break;fe(r,l,o<s.i?s.ins:0),n&&o<s.i&&VO(n,r,s.text),o=s.i,s.forward(s.len-Q)}else{if(s.done&&a.done)return n?ne.createSet(r,n):hO.create(r);throw new Error("Mismatched change set lengths")}}}function ac(t,e,O=!1){let i=[],r=O?[]:null,n=new ci(t),s=new ci(e);for(let a=!1;;){if(n.done&&s.done)return r?ne.createSet(i,r):hO.create(i);if(n.ins==0)fe(i,n.len,0,a),n.next();else if(s.len==0&&!s.done)fe(i,0,s.ins,a),r&&VO(r,i,s.text),s.next();else{if(n.done||s.done)throw new Error("Mismatched change set lengths");{let o=Math.min(n.len2,s.len),l=i.length;if(n.ins==-1){let Q=s.ins==-1?-1:s.off?0:s.ins;fe(i,o,Q,a),r&&Q&&VO(r,i,s.text)}else s.ins==-1?(fe(i,n.off?0:n.len,o,a),r&&VO(r,i,n.textBit(o))):(fe(i,n.off?0:n.len,s.off?0:s.ins,a),r&&!s.off&&VO(r,i,s.text));a=(n.ins>o||s.ins>=0&&s.len>o)&&(a||i.length>l),n.forward2(o),s.forward(o)}}}}class ci{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,O=this.i-2>>1;return O>=e.length?G.empty:e[O]}textBit(e){let{inserted:O}=this.set,i=this.i-2>>1;return i>=O.length&&!e?G.empty:O[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class JO{constructor(e,O,i){this.from=e,this.to=O,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,O=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,O):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new JO(i,r,this.flags)}extend(e,O=e){if(e<=this.anchor&&O>=this.anchor)return P.range(e,O);let i=Math.abs(e-this.anchor)>Math.abs(O-this.anchor)?e:O;return P.range(this.anchor,i)}eq(e,O=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!O||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return P.range(e.anchor,e.head)}static create(e,O,i){return new JO(e,O,i)}}class P{constructor(e,O){this.ranges=e,this.mainIndex=O}map(e,O=-1){return e.empty?this:P.create(this.ranges.map(i=>i.map(e,O)),this.mainIndex)}eq(e,O=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],O))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new P([this.main],0)}addRange(e,O=!0){return P.create([e].concat(this.ranges),O?0:this.mainIndex+1)}replaceRange(e,O=this.mainIndex){let i=this.ranges.slice();return i[O]=e,P.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new P(e.ranges.map(O=>JO.fromJSON(O)),e.main)}static single(e,O=e){return new P([P.range(e,O)],0)}static create(e,O=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let n=e[r];if(n.empty?n.from<=i:n.from<i)return P.normalized(e.slice(),O);i=n.to}return new P(e,O)}static cursor(e,O=0,i,r){return JO.create(e,e,(O==0?0:O<0?8:16)|(i==null?7:Math.min(6,i))|(r??16777215)<<6)}static range(e,O,i,r){let n=(i??16777215)<<6|(r==null?7:Math.min(6,r));return O<e?JO.create(O,e,48|n):JO.create(e,O,(O>e?8:0)|n)}static normalized(e,O=0){let i=e[O];e.sort((r,n)=>r.from-n.from),O=e.indexOf(i);for(let r=1;r<e.length;r++){let n=e[r],s=e[r-1];if(n.empty?n.from<=s.to:n.from<s.to){let a=s.from,o=Math.max(n.to,s.to);r<=O&&O--,e.splice(--r,2,n.anchor>n.head?P.range(o,a):P.range(a,o))}}return new P(e,O)}}function oc(t,e){for(let O of t.ranges)if(O.to>e)throw new RangeError("Selection points outside of document")}let Aa=0;class k{constructor(e,O,i,r,n){this.combine=e,this.compareInput=O,this.compare=i,this.isStatic=r,this.id=Aa++,this.default=e([]),this.extensions=typeof n=="function"?n(this):n}get reader(){return this}static define(e={}){return new k(e.combine||(O=>O),e.compareInput||((O,i)=>O===i),e.compare||(e.combine?(O,i)=>O===i:Ea),!!e.static,e.enables)}of(e){return new pr([],this,0,e)}compute(e,O){if(this.isStatic)throw new Error("Can't compute a static facet");return new pr(e,this,1,O)}computeN(e,O){if(this.isStatic)throw new Error("Can't compute a static facet");return new pr(e,this,2,O)}from(e,O){return O||(O=i=>i),this.compute([e],i=>O(i.field(e)))}}function Ea(t,e){return t==e||t.length==e.length&&t.every((O,i)=>O===e[i])}class pr{constructor(e,O,i,r){this.dependencies=e,this.facet=O,this.type=i,this.value=r,this.id=Aa++}dynamicSlot(e){var O;let i=this.value,r=this.facet.compareInput,n=this.id,s=e[n]>>1,a=this.type==2,o=!1,l=!1,Q=[];for(let $ of this.dependencies)$=="doc"?o=!0:$=="selection"?l=!0:(((O=e[$.id])!==null&&O!==void 0?O:1)&1)==0&&Q.push(e[$.id]);return{create($){return $.values[s]=i($),1},update($,h){if(o&&h.docChanged||l&&(h.docChanged||h.selection)||Zs($,Q)){let f=i($);if(a?!Ko(f,$.values[s],r):!r(f,$.values[s]))return $.values[s]=f,1}return 0},reconfigure:($,h)=>{let f,d=h.config.address[n];if(d!=null){let u=_r(h,d);if(this.dependencies.every(p=>p instanceof k?h.facet(p)===$.facet(p):p instanceof Ue?h.field(p,!1)==$.field(p,!1):!0)||(a?Ko(f=i($),u,r):r(f=i($),u)))return $.values[s]=u,0}else f=i($);return $.values[s]=f,1}}}}function Ko(t,e,O){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!O(t[i],e[i]))return!1;return!0}function Zs(t,e){let O=!1;for(let i of e)ii(t,i)&1&&(O=!0);return O}function wu(t,e,O){let i=O.map(o=>t[o.id]),r=O.map(o=>o.type),n=i.filter(o=>!(o&1)),s=t[e.id]>>1;function a(o){let l=[];for(let Q=0;Q<i.length;Q++){let $=_r(o,i[Q]);if(r[Q]==2)for(let h of $)l.push(h);else l.push($)}return e.combine(l)}return{create(o){for(let l of i)ii(o,l);return o.values[s]=a(o),1},update(o,l){if(!Zs(o,n))return 0;let Q=a(o);return e.compare(Q,o.values[s])?0:(o.values[s]=Q,1)},reconfigure(o,l){let Q=Zs(o,i),$=l.config.facets[e.id],h=l.facet(e);if($&&!Q&&Ea(O,$))return o.values[s]=h,0;let f=a(o);return e.compare(f,h)?(o.values[s]=h,0):(o.values[s]=f,1)}}}const Ii=k.define({static:!0});class Ue{constructor(e,O,i,r,n){this.id=e,this.createF=O,this.updateF=i,this.compareF=r,this.spec=n,this.provides=void 0}static define(e){let O=new Ue(Aa++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(O.provides=e.provide(O)),O}create(e){let O=e.facet(Ii).find(i=>i.field==this);return((O==null?void 0:O.create)||this.createF)(e)}slot(e){let O=e[this.id]>>1;return{create:i=>(i.values[O]=this.create(i),1),update:(i,r)=>{let n=i.values[O],s=this.updateF(n,r);return this.compareF(n,s)?0:(i.values[O]=s,1)},reconfigure:(i,r)=>{let n=i.facet(Ii),s=r.facet(Ii),a;return(a=n.find(o=>o.field==this))&&a!=s.find(o=>o.field==this)?(i.values[O]=a.create(i),1):r.config.address[this.id]!=null?(i.values[O]=r.field(this),0):(i.values[O]=this.create(i),1)}}}init(e){return[this,Ii.of({field:this,create:e})]}get extension(){return this}}const FO={lowest:4,low:3,default:2,high:1,highest:0};function Lt(t){return e=>new lc(e,t)}const ct={highest:Lt(FO.highest),high:Lt(FO.high),default:Lt(FO.default),low:Lt(FO.low),lowest:Lt(FO.lowest)};class lc{constructor(e,O){this.inner=e,this.prec=O}}class $n{of(e){return new _s(this,e)}reconfigure(e){return $n.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class _s{constructor(e,O){this.compartment=e,this.inner=O}}class Zr{constructor(e,O,i,r,n,s){for(this.base=e,this.compartments=O,this.dynamicSlots=i,this.address=r,this.staticValues=n,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let O=this.address[e.id];return O==null?e.default:this.staticValues[O>>1]}static resolve(e,O,i){let r=[],n=Object.create(null),s=new Map;for(let h of Yu(e,O,s))h instanceof Ue?r.push(h):(n[h.facet.id]||(n[h.facet.id]=[])).push(h);let a=Object.create(null),o=[],l=[];for(let h of r)a[h.id]=l.length<<1,l.push(f=>h.slot(f));let Q=i==null?void 0:i.config.facets;for(let h in n){let f=n[h],d=f[0].facet,u=Q&&Q[h]||[];if(f.every(p=>p.type==0))if(a[d.id]=o.length<<1|1,Ea(u,f))o.push(i.facet(d));else{let p=d.combine(f.map(m=>m.value));o.push(i&&d.compare(p,i.facet(d))?i.facet(d):p)}else{for(let p of f)p.type==0?(a[p.id]=o.length<<1|1,o.push(p.value)):(a[p.id]=l.length<<1,l.push(m=>p.dynamicSlot(m)));a[d.id]=l.length<<1,l.push(p=>wu(p,d,f))}}let $=l.map(h=>h(a));return new Zr(e,s,$,a,o,n)}}function Yu(t,e,O){let i=[[],[],[],[],[]],r=new Map;function n(s,a){let o=r.get(s);if(o!=null){if(o<=a)return;let l=i[o].indexOf(s);l>-1&&i[o].splice(l,1),s instanceof _s&&O.delete(s.compartment)}if(r.set(s,a),Array.isArray(s))for(let l of s)n(l,a);else if(s instanceof _s){if(O.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let l=e.get(s.compartment)||s.inner;O.set(s.compartment,l),n(l,a)}else if(s instanceof lc)n(s.inner,s.prec);else if(s instanceof Ue)i[a].push(s),s.provides&&n(s.provides,a);else if(s instanceof pr)i[a].push(s),s.facet.extensions&&n(s.facet.extensions,FO.default);else{let l=s.extension;if(!l)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);n(l,a)}}return n(t,FO.default),i.reduce((s,a)=>s.concat(a))}function ii(t,e){if(e&1)return 2;let O=e>>1,i=t.status[O];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[O]=4;let r=t.computeSlot(t,t.config.dynamicSlots[O]);return t.status[O]=2|r}function _r(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const Qc=k.define(),vs=k.define({combine:t=>t.some(e=>e),static:!0}),$c=k.define({combine:t=>t.length?t[0]:void 0,static:!0}),cc=k.define(),hc=k.define(),fc=k.define(),dc=k.define({combine:t=>t.length?t[0]:!1});class ZO{constructor(e,O){this.type=e,this.value=O}static define(){return new ku}}class ku{of(e){return new ZO(this,e)}}class Zu{constructor(e){this.map=e}of(e){return new j(this,e)}}class j{constructor(e,O){this.type=e,this.value=O}map(e){let O=this.type.map(this.value,e);return O===void 0?void 0:O==this.value?this:new j(this.type,O)}is(e){return this.type==e}static define(e={}){return new Zu(e.map||(O=>O))}static mapEffects(e,O){if(!e.length)return e;let i=[];for(let r of e){let n=r.map(O);n&&i.push(n)}return i}}j.reconfigure=j.define();j.appendConfig=j.define();class re{constructor(e,O,i,r,n,s){this.startState=e,this.changes=O,this.selection=i,this.effects=r,this.annotations=n,this.scrollIntoView=s,this._doc=null,this._state=null,i&&oc(i,O.newLength),n.some(a=>a.type==re.time)||(this.annotations=n.concat(re.time.of(Date.now())))}static create(e,O,i,r,n,s){return new re(e,O,i,r,n,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let O of this.annotations)if(O.type==e)return O.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let O=this.annotation(re.userEvent);return!!(O&&(O==e||O.length>e.length&&O.slice(0,e.length)==e&&O[e.length]=="."))}}re.time=ZO.define();re.userEvent=ZO.define();re.addToHistory=ZO.define();re.remote=ZO.define();function _u(t,e){let O=[];for(let i=0,r=0;;){let n,s;if(i<t.length&&(r==e.length||e[r]>=t[i]))n=t[i++],s=t[i++];else if(r<e.length)n=e[r++],s=e[r++];else return O;!O.length||O[O.length-1]<n?O.push(n,s):O[O.length-1]<s&&(O[O.length-1]=s)}}function uc(t,e,O){var i;let r,n,s;return O?(r=e.changes,n=ne.empty(e.changes.length),s=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),n=t.changes.mapDesc(e.changes,!0),s=t.changes.compose(r)),{changes:s,selection:e.selection?e.selection.map(n):(i=t.selection)===null||i===void 0?void 0:i.map(r),effects:j.mapEffects(t.effects,r).concat(j.mapEffects(e.effects,n)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Rs(t,e,O){let i=e.selection,r=Tt(e.annotations);return e.userEvent&&(r=r.concat(re.userEvent.of(e.userEvent))),{changes:e.changes instanceof ne?e.changes:ne.of(e.changes||[],O,t.facet($c)),selection:i&&(i instanceof P?i:P.single(i.anchor,i.head)),effects:Tt(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function pc(t,e,O){let i=Rs(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(O=!1);for(let n=1;n<e.length;n++){e[n].filter===!1&&(O=!1);let s=!!e[n].sequential;i=uc(i,Rs(t,e[n],s?i.changes.newLength:t.doc.length),s)}let r=re.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return Ru(O?vu(r):r)}function vu(t){let e=t.startState,O=!0;for(let r of e.facet(cc)){let n=r(t);if(n===!1){O=!1;break}Array.isArray(n)&&(O=O===!0?n:_u(O,n))}if(O!==!0){let r,n;if(O===!1)n=t.changes.invertedDesc,r=ne.empty(e.doc.length);else{let s=t.changes.filter(O);r=s.changes,n=s.filtered.mapDesc(s.changes).invertedDesc}t=re.create(e,r,t.selection&&t.selection.map(n),j.mapEffects(t.effects,n),t.annotations,t.scrollIntoView)}let i=e.facet(hc);for(let r=i.length-1;r>=0;r--){let n=i[r](t);n instanceof re?t=n:Array.isArray(n)&&n.length==1&&n[0]instanceof re?t=n[0]:t=pc(e,Tt(n),!1)}return t}function Ru(t){let e=t.startState,O=e.facet(fc),i=t;for(let r=O.length-1;r>=0;r--){let n=O[r](t);n&&Object.keys(n).length&&(i=uc(i,Rs(e,n,t.changes.newLength),!0))}return i==t?t:re.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}const zu=[];function Tt(t){return t==null?zu:Array.isArray(t)?t:[t]}var J=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(J||(J={}));const qu=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let zs;try{zs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Vu(t){if(zs)return zs.test(t);for(let e=0;e<t.length;e++){let O=t[e];if(/\w/.test(O)||O>"€"&&(O.toUpperCase()!=O.toLowerCase()||qu.test(O)))return!0}return!1}function Uu(t){return e=>{if(!/\S/.test(e))return J.Space;if(Vu(e))return J.Word;for(let O=0;O<t.length;O++)if(e.indexOf(t[O])>-1)return J.Word;return J.Other}}class A{constructor(e,O,i,r,n,s){this.config=e,this.doc=O,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=n,s&&(s._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)ii(this,a<<1);this.computeSlot=null}field(e,O=!0){let i=this.config.address[e.id];if(i==null){if(O)throw new RangeError("Field is not present in this state");return}return ii(this,i),_r(this,i)}update(...e){return pc(this,e,!0)}applyTransaction(e){let O=this.config,{base:i,compartments:r}=O;for(let a of e.effects)a.is($n.reconfigure)?(O&&(r=new Map,O.compartments.forEach((o,l)=>r.set(l,o)),O=null),r.set(a.value.compartment,a.value.extension)):a.is(j.reconfigure)?(O=null,i=a.value):a.is(j.appendConfig)&&(O=null,i=Tt(i).concat(a.value));let n;O?n=e.startState.values.slice():(O=Zr.resolve(i,r,this),n=new A(O,this.doc,this.selection,O.dynamicSlots.map(()=>null),(o,l)=>l.reconfigure(o,this),null).values);let s=e.startState.facet(vs)?e.newSelection:e.newSelection.asSingle();new A(O,e.newDoc,s,n,(a,o)=>o.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(O=>({changes:{from:O.from,to:O.to,insert:e},range:P.cursor(O.from+e.length)}))}changeByRange(e){let O=this.selection,i=e(O.ranges[0]),r=this.changes(i.changes),n=[i.range],s=Tt(i.effects);for(let a=1;a<O.ranges.length;a++){let o=e(O.ranges[a]),l=this.changes(o.changes),Q=l.map(r);for(let h=0;h<a;h++)n[h]=n[h].map(Q);let $=r.mapDesc(l,!0);n.push(o.range.map($)),r=r.compose(Q),s=j.mapEffects(s,Q).concat(j.mapEffects(Tt(o.effects),$))}return{changes:r,selection:P.create(n,O.mainIndex),effects:s}}changes(e=[]){return e instanceof ne?e:ne.of(e,this.doc.length,this.facet(A.lineSeparator))}toText(e){return G.of(e.split(this.facet(A.lineSeparator)||ws))}sliceDoc(e=0,O=this.doc.length){return this.doc.sliceString(e,O,this.lineBreak)}facet(e){let O=this.config.address[e.id];return O==null?e.default:(ii(this,O),_r(this,O))}toJSON(e){let O={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof Ue&&this.config.address[r.id]!=null&&(O[i]=r.spec.toJSON(this.field(e[i]),this))}return O}static fromJSON(e,O={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let n in i)if(Object.prototype.hasOwnProperty.call(e,n)){let s=i[n],a=e[n];r.push(s.init(o=>s.spec.fromJSON(a,o)))}}return A.create({doc:e.doc,selection:P.fromJSON(e.selection),extensions:O.extensions?r.concat([O.extensions]):r})}static create(e={}){let O=Zr.resolve(e.extensions||[],new Map),i=e.doc instanceof G?e.doc:G.of((e.doc||"").split(O.staticFacet(A.lineSeparator)||ws)),r=e.selection?e.selection instanceof P?e.selection:P.single(e.selection.anchor,e.selection.head):P.single(0);return oc(r,i.length),O.staticFacet(vs)||(r=r.asSingle()),new A(O,i,r,O.dynamicSlots.map(()=>null),(n,s)=>s.create(n),null)}get tabSize(){return this.facet(A.tabSize)}get lineBreak(){return this.facet(A.lineSeparator)||`
@@ -1 +1 @@
1
- import{u as K,r as a,j as e}from"./main-D8ST500w.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function ae({url:l,title:W,isOpen:g,onClose:I,initialWidth:H=480,initialHeight:B=360,minWidth:M=320,minHeight:b=240}){const{t:n}=K(["terminal","common"]),[Z,h]=a.useState(!0),[L,k]=a.useState(!1),[o,$]=a.useState({width:H,height:B}),[s,y]=a.useState(null),[f,z]=a.useState(1),[O,R]=a.useState(!1),[T,X]=a.useState(!1),N=a.useRef(null),U=a.useRef(null),d=a.useRef(null),r=a.useRef(null);a.useEffect(()=>{if(g&&!s){const t=Math.max(50,(window.innerWidth-o.width)/2),c=Math.max(50,(window.innerHeight-o.height)/2);y({x:t,y:c})}},[g,s,o.width,o.height]),a.useEffect(()=>{h(!0),k(!1)},[l]);const A=a.useCallback(()=>{h(!1)},[]),V=a.useCallback(()=>{h(!1),k(!0)},[]),Y=a.useCallback(()=>{N.current&&(h(!0),k(!1),N.current.src=l)},[l]),_=a.useCallback(()=>{window.open(l,"_blank")},[l]),q=a.useCallback(()=>{z(t=>Math.min(2,t+.25))},[]),F=a.useCallback(()=>{z(t=>Math.max(.25,t-.25))},[]),G=a.useCallback(()=>{z(1)},[]),J=a.useCallback(t=>{if(t.target.closest(".iframe-modal-btn"))return;t.preventDefault(),R(!0),d.current={startX:t.clientX,startY:t.clientY,startPosX:(s==null?void 0:s.x)??0,startPosY:(s==null?void 0:s.y)??0};const c=m=>{if(!d.current)return;const w=m.clientX-d.current.startX,j=m.clientY-d.current.startY;y({x:Math.max(0,Math.min(window.innerWidth-100,d.current.startPosX+w)),y:Math.max(0,Math.min(window.innerHeight-50,d.current.startPosY+j))})},x=()=>{d.current=null,R(!1),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",x)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",x)},[s]),i=a.useCallback((t,c)=>{t.preventDefault(),t.stopPropagation(),X(!0);const x={startX:t.clientX,startY:t.clientY,startW:o.width,startH:o.height,startPosX:(s==null?void 0:s.x)??0,startPosY:(s==null?void 0:s.y)??0,direction:c};r.current=x;const m=j=>{if(!r.current)return;const p=j.clientX-r.current.startX,C=j.clientY-r.current.startY,v=r.current.direction;let E=r.current.startW,D=r.current.startH,P=r.current.startPosX,S=r.current.startPosY;if(v.includes("e")&&(E=Math.max(M,r.current.startW+p)),v.includes("w")){const u=r.current.startW-p;u>=M&&(E=u,P=r.current.startPosX+p)}if(v.includes("s")&&(D=Math.max(b,r.current.startH+C)),v.includes("n")){const u=r.current.startH-C;u>=b&&(D=u,S=r.current.startPosY+C)}$({width:E,height:D}),y({x:P,y:S})},w=()=>{r.current=null,X(!1),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",w)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",w)},[o,s,M,b]);return g?e.jsxs("div",{ref:U,className:`iframe-modal ${O?"dragging":""} ${T?"resizing":""}`,style:{left:(s==null?void 0:s.x)??0,top:(s==null?void 0:s.y)??0,width:o.width,height:o.height},children:[e.jsxs("div",{className:"iframe-modal-toolbar",onMouseDown:J,children:[e.jsx("div",{className:"iframe-modal-title",title:l,children:W||l}),e.jsxs("div",{className:"iframe-modal-actions",children:[e.jsx("button",{className:"iframe-modal-btn",onClick:F,title:n("terminal:iframeModal.zoomOut"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}),e.jsxs("button",{className:"iframe-modal-btn iframe-modal-zoom-label",onClick:G,title:n("terminal:iframeModal.resetZoom"),children:[Math.round(f*100),"%"]}),e.jsx("button",{className:"iframe-modal-btn",onClick:q,title:n("terminal:iframeModal.zoomIn"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),e.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}),e.jsx("div",{className:"iframe-modal-separator"}),e.jsx("button",{className:"iframe-modal-btn",onClick:Y,title:n("terminal:iframeModal.refresh"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M23 4v6h-6M1 20v-6h6"}),e.jsx("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]})}),e.jsx("button",{className:"iframe-modal-btn",onClick:_,title:n("terminal:iframeModal.openInBrowser"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}),e.jsx("button",{className:"iframe-modal-btn iframe-modal-close",onClick:I,title:n("common:buttons.close"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),e.jsxs("div",{className:"iframe-modal-content",children:[Z&&e.jsxs("div",{className:"iframe-modal-loading",children:[e.jsx("div",{className:"iframe-modal-spinner"}),e.jsx("span",{children:n("common:status.loading")})]}),L&&e.jsxs("div",{className:"iframe-modal-error",children:[e.jsx("span",{children:n("terminal:iframeModal.failedToLoad")}),e.jsx("button",{onClick:Y,children:n("terminal:iframeModal.retry")})]}),e.jsx("iframe",{ref:N,src:l,className:"iframe-modal-frame",onLoad:A,onError:V,style:{display:L?"none":"block",transform:`scale(${f})`,transformOrigin:"top left",width:`${100/f}%`,height:`${100/f}%`}})]}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-n",onMouseDown:t=>i(t,"n")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-s",onMouseDown:t=>i(t,"s")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-e",onMouseDown:t=>i(t,"e")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-w",onMouseDown:t=>i(t,"w")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-ne",onMouseDown:t=>i(t,"ne")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-nw",onMouseDown:t=>i(t,"nw")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-se",onMouseDown:t=>i(t,"se")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-sw",onMouseDown:t=>i(t,"sw")})]}):null}export{ae as IframeModal,ae as default};
1
+ import{u as K,r as a,j as e}from"./main-DFVf4Fc5.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function ae({url:l,title:W,isOpen:g,onClose:I,initialWidth:H=480,initialHeight:B=360,minWidth:M=320,minHeight:b=240}){const{t:n}=K(["terminal","common"]),[Z,h]=a.useState(!0),[L,k]=a.useState(!1),[o,$]=a.useState({width:H,height:B}),[s,y]=a.useState(null),[f,z]=a.useState(1),[O,R]=a.useState(!1),[T,X]=a.useState(!1),N=a.useRef(null),U=a.useRef(null),d=a.useRef(null),r=a.useRef(null);a.useEffect(()=>{if(g&&!s){const t=Math.max(50,(window.innerWidth-o.width)/2),c=Math.max(50,(window.innerHeight-o.height)/2);y({x:t,y:c})}},[g,s,o.width,o.height]),a.useEffect(()=>{h(!0),k(!1)},[l]);const A=a.useCallback(()=>{h(!1)},[]),V=a.useCallback(()=>{h(!1),k(!0)},[]),Y=a.useCallback(()=>{N.current&&(h(!0),k(!1),N.current.src=l)},[l]),_=a.useCallback(()=>{window.open(l,"_blank")},[l]),q=a.useCallback(()=>{z(t=>Math.min(2,t+.25))},[]),F=a.useCallback(()=>{z(t=>Math.max(.25,t-.25))},[]),G=a.useCallback(()=>{z(1)},[]),J=a.useCallback(t=>{if(t.target.closest(".iframe-modal-btn"))return;t.preventDefault(),R(!0),d.current={startX:t.clientX,startY:t.clientY,startPosX:(s==null?void 0:s.x)??0,startPosY:(s==null?void 0:s.y)??0};const c=m=>{if(!d.current)return;const w=m.clientX-d.current.startX,j=m.clientY-d.current.startY;y({x:Math.max(0,Math.min(window.innerWidth-100,d.current.startPosX+w)),y:Math.max(0,Math.min(window.innerHeight-50,d.current.startPosY+j))})},x=()=>{d.current=null,R(!1),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",x)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",x)},[s]),i=a.useCallback((t,c)=>{t.preventDefault(),t.stopPropagation(),X(!0);const x={startX:t.clientX,startY:t.clientY,startW:o.width,startH:o.height,startPosX:(s==null?void 0:s.x)??0,startPosY:(s==null?void 0:s.y)??0,direction:c};r.current=x;const m=j=>{if(!r.current)return;const p=j.clientX-r.current.startX,C=j.clientY-r.current.startY,v=r.current.direction;let E=r.current.startW,D=r.current.startH,P=r.current.startPosX,S=r.current.startPosY;if(v.includes("e")&&(E=Math.max(M,r.current.startW+p)),v.includes("w")){const u=r.current.startW-p;u>=M&&(E=u,P=r.current.startPosX+p)}if(v.includes("s")&&(D=Math.max(b,r.current.startH+C)),v.includes("n")){const u=r.current.startH-C;u>=b&&(D=u,S=r.current.startPosY+C)}$({width:E,height:D}),y({x:P,y:S})},w=()=>{r.current=null,X(!1),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",w)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",w)},[o,s,M,b]);return g?e.jsxs("div",{ref:U,className:`iframe-modal ${O?"dragging":""} ${T?"resizing":""}`,style:{left:(s==null?void 0:s.x)??0,top:(s==null?void 0:s.y)??0,width:o.width,height:o.height},children:[e.jsxs("div",{className:"iframe-modal-toolbar",onMouseDown:J,children:[e.jsx("div",{className:"iframe-modal-title",title:l,children:W||l}),e.jsxs("div",{className:"iframe-modal-actions",children:[e.jsx("button",{className:"iframe-modal-btn",onClick:F,title:n("terminal:iframeModal.zoomOut"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}),e.jsxs("button",{className:"iframe-modal-btn iframe-modal-zoom-label",onClick:G,title:n("terminal:iframeModal.resetZoom"),children:[Math.round(f*100),"%"]}),e.jsx("button",{className:"iframe-modal-btn",onClick:q,title:n("terminal:iframeModal.zoomIn"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),e.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}),e.jsx("div",{className:"iframe-modal-separator"}),e.jsx("button",{className:"iframe-modal-btn",onClick:Y,title:n("terminal:iframeModal.refresh"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M23 4v6h-6M1 20v-6h6"}),e.jsx("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]})}),e.jsx("button",{className:"iframe-modal-btn",onClick:_,title:n("terminal:iframeModal.openInBrowser"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})}),e.jsx("button",{className:"iframe-modal-btn iframe-modal-close",onClick:I,title:n("common:buttons.close"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),e.jsxs("div",{className:"iframe-modal-content",children:[Z&&e.jsxs("div",{className:"iframe-modal-loading",children:[e.jsx("div",{className:"iframe-modal-spinner"}),e.jsx("span",{children:n("common:status.loading")})]}),L&&e.jsxs("div",{className:"iframe-modal-error",children:[e.jsx("span",{children:n("terminal:iframeModal.failedToLoad")}),e.jsx("button",{onClick:Y,children:n("terminal:iframeModal.retry")})]}),e.jsx("iframe",{ref:N,src:l,className:"iframe-modal-frame",onLoad:A,onError:V,style:{display:L?"none":"block",transform:`scale(${f})`,transformOrigin:"top left",width:`${100/f}%`,height:`${100/f}%`}})]}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-n",onMouseDown:t=>i(t,"n")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-s",onMouseDown:t=>i(t,"s")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-e",onMouseDown:t=>i(t,"e")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-w",onMouseDown:t=>i(t,"w")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-ne",onMouseDown:t=>i(t,"ne")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-nw",onMouseDown:t=>i(t,"nw")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-se",onMouseDown:t=>i(t,"se")}),e.jsx("div",{className:"iframe-modal-resize-handle iframe-modal-resize-sw",onMouseDown:t=>i(t,"sw")})]}):null}export{ae as IframeModal,ae as default};
@@ -1 +1 @@
1
- import{u as ue,r as l,h as he,j as e,i as de}from"./main-D8ST500w.js";function ge({isOpen:E,onClose:w,title:Q,icon:_,lines:c,isStreaming:P,onClear:q,emptyMessage:U,streamingIndicatorLabel:z,extraToolbar:J,extraFooter:X,modalClassName:Y}){const{t:a}=ue(["terminal","common"]),[u,$]=l.useState(""),[h,L]=l.useState(!1),[x,S]=l.useState(!1),[M,R]=l.useState(""),[k,p]=l.useState(!0),[D,Z]=l.useState(!0),[O,B]=l.useState(null),[r,ee]=l.useState([]),[m,j]=l.useState(0),[v,te]=l.useState(!1),[T,se]=l.useState(5),[F,C]=l.useState(null),[y,le]=l.useState(!0),o=l.useRef(null),I=l.useRef(null),A=l.useRef(null),H=l.useRef(!1),V=l.useRef(0),K=l.useMemo(()=>c.map(t=>t.text),[c]),b=l.useMemo(()=>{if(!u)return C(null),null;try{const t=v?u:u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=new RegExp(t,"gi");return C(null),s}catch(t){return C(t.message),null}},[u,v]),N=l.useMemo(()=>{if(!b)return[];const t=[];for(let s=0;s<K.length;s++)b.test(K[s])&&t.push(s),b.lastIndex=0;return t},[K,b]);l.useEffect(()=>{ee(N),m>=N.length&&j(Math.max(0,N.length-1))},[N]);const ne=l.useMemo(()=>{const t=c.map((i,f)=>({entry:i,originalIndex:f}));if(!u||!b||y)return t;if(N.length===0)return[];const s=new Set;for(const i of N){const f=Math.max(0,i-T),ie=Math.min(c.length-1,i+T);for(let G=f;G<=ie;G++)s.add(G)}const n=Array.from(s).sort((i,f)=>i-f),d=[];for(let i=0;i<n.length;i++){const f=n[i];i>0&&f-n[i-1]>1&&d.push({entry:{text:"",lineNumber:-1},originalIndex:-1,isSeparator:!0}),d.push({entry:c[f],originalIndex:f})}return d},[c,u,b,N,T,y]);l.useEffect(()=>{k&&o.current&&c.length>V.current&&(H.current=!0,requestAnimationFrame(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight),setTimeout(()=>{H.current=!1},50)})),V.current=c.length},[c.length,k]),l.useEffect(()=>{h&&I.current&&I.current.focus()},[h]),l.useEffect(()=>{x&&A.current&&A.current.focus()},[x]);const g=l.useCallback(t=>{if(!o.current)return;const n=t*18;o.current.scrollTop=n-100,B(t),setTimeout(()=>B(null),2e3)},[]);l.useEffect(()=>{if(!E)return;const t=s=>{if(s.key==="Escape"){s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation(),h?L(!1):x?S(!1):w();return}if(s.key==="/"&&!h&&!x&&(s.preventDefault(),L(!0)),s.key==="g"&&s.ctrlKey&&(s.preventDefault(),S(!0)),s.key==="End"&&s.ctrlKey&&o.current&&(o.current.scrollTop=o.current.scrollHeight),s.key==="Home"&&s.ctrlKey&&o.current&&(o.current.scrollTop=0),(s.key==="F3"||s.key==="Enter"&&h)&&r.length>0)if(s.preventDefault(),s.shiftKey){const n=(m-1+r.length)%r.length;j(n),g(r[n])}else{const n=(m+1)%r.length;j(n),g(r[n])}if(!h&&!x&&r.length>0){if(s.key==="n"&&!s.ctrlKey){s.preventDefault();const n=(m+1)%r.length;j(n),g(r[n])}else if(s.key==="N"){s.preventDefault();const n=(m-1+r.length)%r.length;j(n),g(r[n])}}!h&&!x&&o.current&&(s.key==="j"?(s.preventDefault(),o.current.scrollTop+=60,p(!1)):s.key==="k"?(s.preventDefault(),o.current.scrollTop-=60,p(!1)):s.key==="G"&&!s.ctrlKey?(s.preventDefault(),o.current.scrollTop=o.current.scrollHeight,p(!0)):s.key==="g"&&!s.ctrlKey&&(s.preventDefault(),o.current.scrollTop=0,p(!1)))};return window.addEventListener("keydown",t,{capture:!0}),()=>window.removeEventListener("keydown",t,{capture:!0})},[E,h,x,r,m,w,g]);const W=l.useCallback(()=>{const t=parseInt(M,10);!isNaN(t)&&t>0&&t<=c.length&&(g(t-1),p(!1)),S(!1),R("")},[M,c.length,g]),re=l.useCallback(()=>{if(H.current||!o.current)return;const{scrollTop:t,scrollHeight:s,clientHeight:n}=o.current,d=s-t-n<50;!d&&k&&p(!1),d&&!k&&p(!0)},[k]),ae=l.useCallback(t=>{if(!u||!b)return t;const s=v?u:u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");try{const n=new RegExp(`(${s})`,"gi");return t.replace(n,'<mark class="search-highlight">$1</mark>')}catch{return t}},[u,b,v]),{handleMouseDown:oe,handleClick:ce}=he(w);return E?e.jsx("div",{className:"pm2-logs-modal-overlay",onMouseDown:oe,onClick:ce,children:e.jsxs("div",{className:`pm2-logs-modal ${Y||""}`,children:[e.jsxs("div",{className:"pm2-logs-modal-header",children:[e.jsxs("div",{className:"header-left",children:[e.jsx("span",{className:"modal-icon",children:_}),e.jsx("span",{className:"modal-title",children:Q}),P&&e.jsxs("span",{className:"streaming-indicator",title:"Live streaming",children:[e.jsx("span",{className:"pulse"}),z||a("terminal:logs.live")]})]}),e.jsxs("div",{className:"header-right",children:[e.jsx("span",{className:"line-count",children:a("terminal:logs.lines",{count:c.length})}),e.jsx("button",{className:"modal-close",onClick:w,title:a("terminal:logs.closeEsc"),children:"×"})]})]}),e.jsxs("div",{className:"pm2-logs-modal-toolbar",children:[e.jsxs("div",{className:"toolbar-left",children:[e.jsxs("button",{className:`toolbar-btn ${h?"active":""}`,onClick:()=>L(!h),title:a("terminal:logs.searchShortcut"),children:["🔍 ",a("terminal:logs.search")]}),e.jsxs("button",{className:"toolbar-btn",onClick:()=>S(!0),title:a("terminal:logs.goToLineShortcut"),children:["⏬ ",a("terminal:logs.goToLine")]}),J,e.jsxs("button",{className:`toolbar-btn ${D?"active":""}`,onClick:()=>Z(!D),title:a("terminal:logs.toggleWrap"),children:["↩ ",a("terminal:logs.wrap")]}),e.jsxs("button",{className:`toolbar-btn ${k?"active":""}`,onClick:()=>p(!k),title:a("terminal:logs.autoScrollToBottom"),children:["↓ ",a("terminal:logs.auto")]})]}),e.jsx("div",{className:"toolbar-right",children:e.jsxs("button",{className:"toolbar-btn danger",onClick:q,title:a("terminal:logs.clear"),children:["🗑 ",a("terminal:logs.clear")]})})]}),h&&e.jsxs("div",{className:"pm2-logs-search-bar",children:[e.jsx("input",{ref:I,type:"text",placeholder:a(v?"terminal:logs.regexPlaceholder":"terminal:logs.searchPlaceholder"),value:u,onChange:t=>{$(t.target.value),j(0)},onKeyDown:t=>{t.key==="Escape"&&(L(!1),$(""),C(null))}}),e.jsx("button",{className:`toolbar-btn small ${v?"active":""}`,onClick:()=>te(!v),title:"Toggle regex mode",children:".*"}),e.jsx("button",{className:`toolbar-btn small ${y?"active":""}`,onClick:()=>le(!y),title:y?"Show all lines (highlight matches)":"Show only context around matches",children:y?"All":"Ctx"}),e.jsxs("div",{className:`context-control ${y?"hidden":""}`,title:"Lines of context around matches",children:[e.jsx("label",{children:"±"}),e.jsx("input",{type:"number",min:"0",max:"100",value:T,onChange:t=>se(Math.max(0,parseInt(t.target.value)||0)),className:"context-input"})]}),e.jsx("button",{className:"toolbar-btn small",onClick:()=>{if(r.length===0)return;const t=(m-1+r.length)%r.length;j(t),g(r[t])},disabled:r.length===0,title:"Previous match (Shift+F3)",children:"▲"}),e.jsx("button",{className:"toolbar-btn small",onClick:()=>{if(r.length===0)return;const t=(m+1)%r.length;j(t),g(r[t])},disabled:r.length===0,title:"Next match (F3)",children:"▼"}),u&&e.jsx("span",{className:"match-count",children:F?e.jsx("span",{className:"regex-error",title:F,children:a("terminal:logs.invalidRegex")}):r.length>0?`${m+1}/${r.length}`:a("terminal:logs.noMatches")}),e.jsx("button",{className:"search-close",onClick:()=>{L(!1),$(""),C(null)},children:"×"})]}),x&&e.jsxs("div",{className:"pm2-logs-goto-line",children:[e.jsxs("label",{children:[a("terminal:logs.goToLineLabel"),":"]}),e.jsx("input",{ref:A,type:"number",min:"1",max:c.length,placeholder:`1-${c.length}`,value:M,onChange:t=>R(t.target.value),onKeyDown:t=>{t.key==="Enter"?W():t.key==="Escape"&&(S(!1),R(""))}}),e.jsx("button",{onClick:W,children:a("terminal:logs.go")}),e.jsx("button",{onClick:()=>S(!1),children:a("common:buttons.cancel")})]}),e.jsx("div",{ref:o,className:`pm2-logs-content ${D?"wrap":"nowrap"}`,onScroll:re,children:c.length===0?e.jsx("div",{className:"logs-empty",children:U||a(P?"terminal:logs.waitingForLogs":"terminal:logs.noLogs")}):e.jsx("div",{className:"logs-lines",children:ne.map((t,s)=>{if("isSeparator"in t&&t.isSeparator)return e.jsxs("div",{className:"log-separator",children:[e.jsx("span",{className:"separator-line"}),e.jsx("span",{className:"separator-label",children:"…"}),e.jsx("span",{className:"separator-line"})]},`sep-${s}`);const{entry:n,originalIndex:d}=t,i=u&&N.includes(d);return e.jsxs("div",{className:`log-line ${O===d?"highlighted":""} ${r[m]===d?"current-match":""} ${i?"match-line":""} ${n.isError?"error-line":""}`,children:[e.jsx("span",{className:"line-number",children:n.lineNumber}),n.sourceLabel&&e.jsxs("span",{className:"boss-log-source",style:{color:n.sourceColor},children:["[",n.sourceLabel,"]"]}),e.jsx("span",{className:"line-content",dangerouslySetInnerHTML:{__html:ae(de(n.text))}})]},d)})})}),e.jsxs("div",{className:"pm2-logs-modal-footer",children:[e.jsxs("span",{className:"shortcut",children:[e.jsx("kbd",{children:"j"}),"/",e.jsx("kbd",{children:"k"})," Scroll"]}),e.jsxs("span",{className:"shortcut",children:[e.jsx("kbd",{children:"g"}),"/",e.jsx("kbd",{children:"G"})," Top/Bottom"]}),e.jsxs("span",{className:"shortcut",children:[e.jsx("kbd",{children:"/"})," Search"]}),e.jsxs("span",{className:"shortcut",children:[e.jsx("kbd",{children:"n"}),"/",e.jsx("kbd",{children:"N"})," Next/Prev match"]}),e.jsxs("span",{className:"shortcut",children:[e.jsx("kbd",{children:"Ctrl+G"})," Go to line"]}),e.jsxs("span",{className:"shortcut",children:[e.jsx("kbd",{children:"Esc"})," Close"]}),X]})]})}):null}export{ge as L};
1
+ import{u as ue,r as l,h as he,j as e,i as de}from"./main-DFVf4Fc5.js";function ge({isOpen:E,onClose:w,title:Q,icon:_,lines:c,isStreaming:P,onClear:q,emptyMessage:U,streamingIndicatorLabel:z,extraToolbar:J,extraFooter:X,modalClassName:Y}){const{t:a}=ue(["terminal","common"]),[u,$]=l.useState(""),[h,L]=l.useState(!1),[x,S]=l.useState(!1),[M,R]=l.useState(""),[k,p]=l.useState(!0),[D,Z]=l.useState(!0),[O,B]=l.useState(null),[r,ee]=l.useState([]),[m,j]=l.useState(0),[v,te]=l.useState(!1),[T,se]=l.useState(5),[F,C]=l.useState(null),[y,le]=l.useState(!0),o=l.useRef(null),I=l.useRef(null),A=l.useRef(null),H=l.useRef(!1),V=l.useRef(0),K=l.useMemo(()=>c.map(t=>t.text),[c]),b=l.useMemo(()=>{if(!u)return C(null),null;try{const t=v?u:u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=new RegExp(t,"gi");return C(null),s}catch(t){return C(t.message),null}},[u,v]),N=l.useMemo(()=>{if(!b)return[];const t=[];for(let s=0;s<K.length;s++)b.test(K[s])&&t.push(s),b.lastIndex=0;return t},[K,b]);l.useEffect(()=>{ee(N),m>=N.length&&j(Math.max(0,N.length-1))},[N]);const ne=l.useMemo(()=>{const t=c.map((i,f)=>({entry:i,originalIndex:f}));if(!u||!b||y)return t;if(N.length===0)return[];const s=new Set;for(const i of N){const f=Math.max(0,i-T),ie=Math.min(c.length-1,i+T);for(let G=f;G<=ie;G++)s.add(G)}const n=Array.from(s).sort((i,f)=>i-f),d=[];for(let i=0;i<n.length;i++){const f=n[i];i>0&&f-n[i-1]>1&&d.push({entry:{text:"",lineNumber:-1},originalIndex:-1,isSeparator:!0}),d.push({entry:c[f],originalIndex:f})}return d},[c,u,b,N,T,y]);l.useEffect(()=>{k&&o.current&&c.length>V.current&&(H.current=!0,requestAnimationFrame(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight),setTimeout(()=>{H.current=!1},50)})),V.current=c.length},[c.length,k]),l.useEffect(()=>{h&&I.current&&I.current.focus()},[h]),l.useEffect(()=>{x&&A.current&&A.current.focus()},[x]);const g=l.useCallback(t=>{if(!o.current)return;const n=t*18;o.current.scrollTop=n-100,B(t),setTimeout(()=>B(null),2e3)},[]);l.useEffect(()=>{if(!E)return;const t=s=>{if(s.key==="Escape"){s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation(),h?L(!1):x?S(!1):w();return}if(s.key==="/"&&!h&&!x&&(s.preventDefault(),L(!0)),s.key==="g"&&s.ctrlKey&&(s.preventDefault(),S(!0)),s.key==="End"&&s.ctrlKey&&o.current&&(o.current.scrollTop=o.current.scrollHeight),s.key==="Home"&&s.ctrlKey&&o.current&&(o.current.scrollTop=0),(s.key==="F3"||s.key==="Enter"&&h)&&r.length>0)if(s.preventDefault(),s.shiftKey){const n=(m-1+r.length)%r.length;j(n),g(r[n])}else{const n=(m+1)%r.length;j(n),g(r[n])}if(!h&&!x&&r.length>0){if(s.key==="n"&&!s.ctrlKey){s.preventDefault();const n=(m+1)%r.length;j(n),g(r[n])}else if(s.key==="N"){s.preventDefault();const n=(m-1+r.length)%r.length;j(n),g(r[n])}}!h&&!x&&o.current&&(s.key==="j"?(s.preventDefault(),o.current.scrollTop+=60,p(!1)):s.key==="k"?(s.preventDefault(),o.current.scrollTop-=60,p(!1)):s.key==="G"&&!s.ctrlKey?(s.preventDefault(),o.current.scrollTop=o.current.scrollHeight,p(!0)):s.key==="g"&&!s.ctrlKey&&(s.preventDefault(),o.current.scrollTop=0,p(!1)))};return window.addEventListener("keydown",t,{capture:!0}),()=>window.removeEventListener("keydown",t,{capture:!0})},[E,h,x,r,m,w,g]);const W=l.useCallback(()=>{const t=parseInt(M,10);!isNaN(t)&&t>0&&t<=c.length&&(g(t-1),p(!1)),S(!1),R("")},[M,c.length,g]),re=l.useCallback(()=>{if(H.current||!o.current)return;const{scrollTop:t,scrollHeight:s,clientHeight:n}=o.current,d=s-t-n<50;!d&&k&&p(!1),d&&!k&&p(!0)},[k]),ae=l.useCallback(t=>{if(!u||!b)return t;const s=v?u:u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");try{const n=new RegExp(`(${s})`,"gi");return t.replace(n,'<mark class="search-highlight">$1</mark>')}catch{return t}},[u,b,v]),{handleMouseDown:oe,handleClick:ce}=he(w);return E?e.jsx("div",{className:"pm2-logs-modal-overlay",onMouseDown:oe,onClick:ce,children:e.jsxs("div",{className:`pm2-logs-modal ${Y||""}`,children:[e.jsxs("div",{className:"pm2-logs-modal-header",children:[e.jsxs("div",{className:"header-left",children:[e.jsx("span",{className:"modal-icon",children:_}),e.jsx("span",{className:"modal-title",children:Q}),P&&e.jsxs("span",{className:"streaming-indicator",title:"Live streaming",children:[e.jsx("span",{className:"pulse"}),z||a("terminal:logs.live")]})]}),e.jsxs("div",{className:"header-right",children:[e.jsx("span",{className:"line-count",children:a("terminal:logs.lines",{count:c.length})}),e.jsx("button",{className:"modal-close",onClick:w,title:a("terminal:logs.closeEsc"),children:"×"})]})]}),e.jsxs("div",{className:"pm2-logs-modal-toolbar",children:[e.jsxs("div",{className:"toolbar-left",children:[e.jsxs("button",{className:`toolbar-btn ${h?"active":""}`,onClick:()=>L(!h),title:a("terminal:logs.searchShortcut"),children:["🔍 ",a("terminal:logs.search")]}),e.jsxs("button",{className:"toolbar-btn",onClick:()=>S(!0),title:a("terminal:logs.goToLineShortcut"),children:["⏬ ",a("terminal:logs.goToLine")]}),J,e.jsxs("button",{className:`toolbar-btn ${D?"active":""}`,onClick:()=>Z(!D),title:a("terminal:logs.toggleWrap"),children:["↩ ",a("terminal:logs.wrap")]}),e.jsxs("button",{className:`toolbar-btn ${k?"active":""}`,onClick:()=>p(!k),title:a("terminal:logs.autoScrollToBottom"),children:["↓ ",a("terminal:logs.auto")]})]}),e.jsx("div",{className:"toolbar-right",children:e.jsxs("button",{className:"toolbar-btn danger",onClick:q,title:a("terminal:logs.clear"),children:["🗑 ",a("terminal:logs.clear")]})})]}),h&&e.jsxs("div",{className:"pm2-logs-search-bar",children:[e.jsx("input",{ref:I,type:"text",placeholder:a(v?"terminal:logs.regexPlaceholder":"terminal:logs.searchPlaceholder"),value:u,onChange:t=>{$(t.target.value),j(0)},onKeyDown:t=>{t.key==="Escape"&&(L(!1),$(""),C(null))}}),e.jsx("button",{className:`toolbar-btn small ${v?"active":""}`,onClick:()=>te(!v),title:"Toggle regex mode",children:".*"}),e.jsx("button",{className:`toolbar-btn small ${y?"active":""}`,onClick:()=>le(!y),title:y?"Show all lines (highlight matches)":"Show only context around matches",children:y?"All":"Ctx"}),e.jsxs("div",{className:`context-control ${y?"hidden":""}`,title:"Lines of context around matches",children:[e.jsx("label",{children:"±"}),e.jsx("input",{type:"number",min:"0",max:"100",value:T,onChange:t=>se(Math.max(0,parseInt(t.target.value)||0)),className:"context-input"})]}),e.jsx("button",{className:"toolbar-btn small",onClick:()=>{if(r.length===0)return;const t=(m-1+r.length)%r.length;j(t),g(r[t])},disabled:r.length===0,title:"Previous match (Shift+F3)",children:"▲"}),e.jsx("button",{className:"toolbar-btn small",onClick:()=>{if(r.length===0)return;const t=(m+1)%r.length;j(t),g(r[t])},disabled:r.length===0,title:"Next match (F3)",children:"▼"}),u&&e.jsx("span",{className:"match-count",children:F?e.jsx("span",{className:"regex-error",title:F,children:a("terminal:logs.invalidRegex")}):r.length>0?`${m+1}/${r.length}`:a("terminal:logs.noMatches")}),e.jsx("button",{className:"search-close",onClick:()=>{L(!1),$(""),C(null)},children:"×"})]}),x&&e.jsxs("div",{className:"pm2-logs-goto-line",children:[e.jsxs("label",{children:[a("terminal:logs.goToLineLabel"),":"]}),e.jsx("input",{ref:A,type:"number",min:"1",max:c.length,placeholder:`1-${c.length}`,value:M,onChange:t=>R(t.target.value),onKeyDown:t=>{t.key==="Enter"?W():t.key==="Escape"&&(S(!1),R(""))}}),e.jsx("button",{onClick:W,children:a("terminal:logs.go")}),e.jsx("button",{onClick:()=>S(!1),children:a("common:buttons.cancel")})]}),e.jsx("div",{ref:o,className:`pm2-logs-content ${D?"wrap":"nowrap"}`,onScroll:re,children:c.length===0?e.jsx("div",{className:"logs-empty",children:U||a(P?"terminal:logs.waitingForLogs":"terminal:logs.noLogs")}):e.jsx("div",{className:"logs-lines",children:ne.map((t,s)=>{if("isSeparator"in t&&t.isSeparator)return e.jsxs("div",{className:"log-separator",children:[e.jsx("span",{className:"separator-line"}),e.jsx("span",{className:"separator-label",children:"…"}),e.jsx("span",{className:"separator-line"})]},`sep-${s}`);const{entry:n,originalIndex:d}=t,i=u&&N.includes(d);return e.jsxs("div",{className:`log-line ${O===d?"highlighted":""} ${r[m]===d?"current-match":""} ${i?"match-line":""} ${n.isError?"error-line":""}`,children:[e.jsx("span",{className:"line-number",children:n.lineNumber}),n.sourceLabel&&e.jsxs("span",{className:"boss-log-source",style:{color:n.sourceColor},children:["[",n.sourceLabel,"]"]}),e.jsx("span",{className:"line-content",dangerouslySetInnerHTML:{__html:ae(de(n.text))}})]},d)})})}),e.jsxs("div",{className:"pm2-logs-modal-footer",children:[e.jsxs("span",{className:"shortcut",children:[e.jsx("kbd",{children:"j"}),"/",e.jsx("kbd",{children:"k"})," Scroll"]}),e.jsxs("span",{className:"shortcut",children:[e.jsx("kbd",{children:"g"}),"/",e.jsx("kbd",{children:"G"})," Top/Bottom"]}),e.jsxs("span",{className:"shortcut",children:[e.jsx("kbd",{children:"/"})," Search"]}),e.jsxs("span",{className:"shortcut",children:[e.jsx("kbd",{children:"n"}),"/",e.jsx("kbd",{children:"N"})," Next/Prev match"]}),e.jsxs("span",{className:"shortcut",children:[e.jsx("kbd",{children:"Ctrl+G"})," Go to line"]}),e.jsxs("span",{className:"shortcut",children:[e.jsx("kbd",{children:"Esc"})," Close"]}),X]})]})}):null}export{ge as L};
@@ -1,2 +1,2 @@
1
- import{u as L,f as d,r as m,s as o,j as x}from"./main-D8ST500w.js";import{L as S}from"./LogViewerModal-DjFERy1q.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function $({building:t,isOpen:e,onClose:n}){var a;const{t:i}=L(["terminal"]),{streamingBuildingLogs:p,streamingBuildingIds:c}=d(),r=p.get(t.id)||"",g=c.has(t.id);m.useEffect(()=>{var s;return e&&((s=t.pm2)!=null&&s.enabled)&&o.startLogStreaming(t.id,200),()=>{t.id&&o.stopLogStreaming(t.id)}},[e,t.id,(a=t.pm2)==null?void 0:a.enabled]);const f=m.useMemo(()=>r.split(`
1
+ import{u as L,f as d,r as m,s as o,j as x}from"./main-DFVf4Fc5.js";import{L as S}from"./LogViewerModal--6BvTYOV.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function $({building:t,isOpen:e,onClose:n}){var a;const{t:i}=L(["terminal"]),{streamingBuildingLogs:p,streamingBuildingIds:c}=d(),r=p.get(t.id)||"",g=c.has(t.id);m.useEffect(()=>{var s;return e&&((s=t.pm2)!=null&&s.enabled)&&o.startLogStreaming(t.id,200),()=>{t.id&&o.stopLogStreaming(t.id)}},[e,t.id,(a=t.pm2)==null?void 0:a.enabled]);const f=m.useMemo(()=>r.split(`
2
2
  `).map((s,l)=>({text:s,lineNumber:l+1})),[r]);return x.jsx(S,{isOpen:e,onClose:n,title:`${t.name} - ${i("terminal:logs.pm2Logs")}`,icon:"📄",lines:f,isStreaming:g,onClear:()=>o.clearStreamingLogs(t.id)})}export{$ as PM2LogsModal};
@@ -1 +1 @@
1
- import{u as m,B as f,j as e,s as d}from"./main-D8ST500w.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function N(r){const t=Date.now()-r,i=Math.floor(t/1e3),a=Math.floor(i/60),c=Math.floor(a/60),n=Math.floor(c/24);return n>0?`${n} day${n>1?"s":""} ago`:c>0?`${c} hour${c>1?"s":""} ago`:a>0?`${a} min${a>1?"s":""} ago`:"just now"}function k({isOpen:r,restorePosition:l,onClose:t,onRestored:i}){const{t:a}=m(["terminal","common"]),c=f(),n=Array.from(c.values()).filter(s=>s.archived===!0),o=(s,j)=>{const x=j?void 0:l||void 0;d.restoreArchivedArea(s,x),i==null||i(),t()},h=()=>{for(const s of n)d.restoreArchivedArea(s.id);i==null||i(),t()},v=s=>{s.target===s.currentTarget&&t()},u=s=>{s.key==="Escape"&&t()};return r?e.jsx("div",{className:`modal-overlay ${r?"visible":""}`,onClick:v,onKeyDown:u,children:e.jsxs("div",{className:"modal restore-archived-modal",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("span",{className:"header-icon",children:"📦"}),a("terminal:areas.restoreArchivedZone")]}),e.jsx("div",{className:"modal-body restore-archived-body",children:n.length===0?e.jsx("div",{className:"archived-empty",children:a("terminal:areas.noArchivedZones")}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"restore-info",children:a("terminal:areas.restoreInfo")}),e.jsx("div",{className:"archived-list",children:n.map(s=>e.jsx(g,{area:s,onRestoreHere:()=>o(s.id,!1),onRestoreOriginal:()=>o(s.id,!0),hasRestorePosition:!!l},s.id))}),n.length>1&&e.jsx("div",{className:"restore-all-section",children:e.jsx("button",{className:"btn btn-secondary",onClick:h,children:a("terminal:areas.restoreAllOriginal")})})]})}),e.jsx("div",{className:"modal-footer",children:e.jsx("button",{className:"btn btn-secondary",onClick:t,children:a("common:buttons.cancel")})})]})}):null}function g({area:r,onRestoreHere:l,onRestoreOriginal:t,hasRestorePosition:i}){const{t:a}=m(["terminal","common"]),c=r.assignedAgentIds.length,n=r.directories.length;return e.jsxs("div",{className:"archived-item",children:[e.jsx("div",{className:"archived-item-color",style:{backgroundColor:r.color}}),e.jsxs("div",{className:"archived-item-info",children:[e.jsx("div",{className:"archived-item-name",children:r.name}),e.jsxs("div",{className:"archived-item-meta",children:[e.jsx("span",{className:"archived-item-type",children:r.type}),c>0&&e.jsx("span",{className:"archived-item-agents",children:a("terminal:areas.agentCount",{count:c})}),n>0&&e.jsx("span",{className:"archived-item-dirs",children:a("terminal:areas.folderCount",{count:n})}),r.archivedAt&&e.jsx("span",{className:"archived-item-time",children:N(r.archivedAt)})]})]}),e.jsxs("div",{className:"archived-item-actions",children:[i&&e.jsx("button",{className:"btn btn-small btn-primary",onClick:l,title:a("terminal:areas.placeAtClickedPosition"),children:a("terminal:areas.restoreHere")}),e.jsx("button",{className:"btn btn-small",onClick:t,title:a("terminal:areas.restoreToOriginal"),children:a(i?"terminal:areas.original":"terminal:areas.restore")})]})]})}export{k as RestoreArchivedAreaModal};
1
+ import{u as m,B as f,j as e,s as d}from"./main-DFVf4Fc5.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function N(r){const t=Date.now()-r,i=Math.floor(t/1e3),a=Math.floor(i/60),c=Math.floor(a/60),n=Math.floor(c/24);return n>0?`${n} day${n>1?"s":""} ago`:c>0?`${c} hour${c>1?"s":""} ago`:a>0?`${a} min${a>1?"s":""} ago`:"just now"}function k({isOpen:r,restorePosition:l,onClose:t,onRestored:i}){const{t:a}=m(["terminal","common"]),c=f(),n=Array.from(c.values()).filter(s=>s.archived===!0),o=(s,j)=>{const x=j?void 0:l||void 0;d.restoreArchivedArea(s,x),i==null||i(),t()},h=()=>{for(const s of n)d.restoreArchivedArea(s.id);i==null||i(),t()},v=s=>{s.target===s.currentTarget&&t()},u=s=>{s.key==="Escape"&&t()};return r?e.jsx("div",{className:`modal-overlay ${r?"visible":""}`,onClick:v,onKeyDown:u,children:e.jsxs("div",{className:"modal restore-archived-modal",children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("span",{className:"header-icon",children:"📦"}),a("terminal:areas.restoreArchivedZone")]}),e.jsx("div",{className:"modal-body restore-archived-body",children:n.length===0?e.jsx("div",{className:"archived-empty",children:a("terminal:areas.noArchivedZones")}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"restore-info",children:a("terminal:areas.restoreInfo")}),e.jsx("div",{className:"archived-list",children:n.map(s=>e.jsx(g,{area:s,onRestoreHere:()=>o(s.id,!1),onRestoreOriginal:()=>o(s.id,!0),hasRestorePosition:!!l},s.id))}),n.length>1&&e.jsx("div",{className:"restore-all-section",children:e.jsx("button",{className:"btn btn-secondary",onClick:h,children:a("terminal:areas.restoreAllOriginal")})})]})}),e.jsx("div",{className:"modal-footer",children:e.jsx("button",{className:"btn btn-secondary",onClick:t,children:a("common:buttons.cancel")})})]})}):null}function g({area:r,onRestoreHere:l,onRestoreOriginal:t,hasRestorePosition:i}){const{t:a}=m(["terminal","common"]),c=r.assignedAgentIds.length,n=r.directories.length;return e.jsxs("div",{className:"archived-item",children:[e.jsx("div",{className:"archived-item-color",style:{backgroundColor:r.color}}),e.jsxs("div",{className:"archived-item-info",children:[e.jsx("div",{className:"archived-item-name",children:r.name}),e.jsxs("div",{className:"archived-item-meta",children:[e.jsx("span",{className:"archived-item-type",children:r.type}),c>0&&e.jsx("span",{className:"archived-item-agents",children:a("terminal:areas.agentCount",{count:c})}),n>0&&e.jsx("span",{className:"archived-item-dirs",children:a("terminal:areas.folderCount",{count:n})}),r.archivedAt&&e.jsx("span",{className:"archived-item-time",children:N(r.archivedAt)})]})]}),e.jsxs("div",{className:"archived-item-actions",children:[i&&e.jsx("button",{className:"btn btn-small btn-primary",onClick:l,title:a("terminal:areas.placeAtClickedPosition"),children:a("terminal:areas.restoreHere")}),e.jsx("button",{className:"btn btn-small",onClick:t,title:a("terminal:areas.restoreToOriginal"),children:a(i?"terminal:areas.original":"terminal:areas.restore")})]})]})}export{k as RestoreArchivedAreaModal};
@@ -1 +1 @@
1
- import{u as D,r as h,j as s}from"./main-D8ST500w.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function B({isOpen:t,onClose:n,agent:d,outputCount:b,trackedFiles:p,onSave:g,isSaving:l=!1,error:x}){const{t:a}=D(["terminal","common"]),m=h.useCallback(()=>{const z=new Date().toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});return`${d.name} - ${z}`},[d.name]),[r,u]=h.useState(m()),[j,N]=h.useState("");h.useEffect(()=>{t&&(u(m()),N(""))},[t,m]);const y=async e=>{e.preventDefault(),r.trim()&&await g({agentId:d.id,title:r.trim(),description:j.trim()||void 0})},w=e=>{e.key==="Escape"&&n()};if(!t)return null;const i=(p==null?void 0:p.files)||[],o=i.filter(e=>e.type==="created"),c=i.filter(e=>e.type==="modified");return s.jsx("div",{className:"modal-overlay visible",onClick:n,onKeyDown:w,children:s.jsxs("div",{className:"modal snapshot-modal",onClick:e=>e.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("span",{className:"snapshot-modal-icon",children:"⭐"}),a("terminal:snapshot.save")]}),s.jsxs("form",{onSubmit:y,children:[s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"snapshot-field",children:[s.jsxs("label",{className:"snapshot-label",children:[a("common:labels.title")," ",s.jsx("span",{className:"snapshot-required",children:"*"})]}),s.jsx("input",{type:"text",className:"snapshot-input",value:r,onChange:e=>u(e.target.value),placeholder:a("terminal:snapshot.enterTitle"),autoFocus:!0,disabled:l})]}),s.jsxs("div",{className:"snapshot-field",children:[s.jsxs("label",{className:"snapshot-label",children:[a("common:labels.description")," ",s.jsx("span",{className:"snapshot-optional",children:a("common:labels.optional")})]}),s.jsx("textarea",{className:"snapshot-textarea",value:j,onChange:e=>N(e.target.value),placeholder:a("terminal:snapshot.whatWasAccomplished"),rows:3,disabled:l})]}),s.jsxs("div",{className:"snapshot-preview",children:[s.jsx("div",{className:"snapshot-preview-header",children:a("terminal:snapshot.whatWillBeCaptured")}),s.jsxs("div",{className:"snapshot-preview-stats",children:[s.jsxs("div",{className:"snapshot-stat",children:[s.jsx("span",{className:"snapshot-stat-icon",children:"💬"}),s.jsx("span",{className:"snapshot-stat-value",children:b}),s.jsx("span",{className:"snapshot-stat-label",children:a("terminal:snapshot.messages")})]}),s.jsxs("div",{className:"snapshot-stat",children:[s.jsx("span",{className:"snapshot-stat-icon",children:"📄"}),s.jsx("span",{className:"snapshot-stat-value",children:i.length}),s.jsx("span",{className:"snapshot-stat-label",children:a("terminal:snapshot.files")})]})]}),i.length>0&&s.jsxs("div",{className:"snapshot-files-preview",children:[o.length>0&&s.jsxs("div",{className:"snapshot-file-group",children:[s.jsxs("div",{className:"snapshot-file-group-label",children:[s.jsx("span",{className:"snapshot-file-type created",children:"+"}),a("terminal:snapshot.createdFiles",{count:o.length})]}),s.jsxs("div",{className:"snapshot-file-list",children:[o.slice(0,5).map(e=>s.jsxs("div",{className:"snapshot-file-item",children:[s.jsx("span",{className:"snapshot-file-path",title:e.path,children:v(e.path)}),e.size!==void 0&&s.jsx("span",{className:"snapshot-file-size",children:f(e.size)})]},e.path)),o.length>5&&s.jsx("div",{className:"snapshot-file-more",children:a("terminal:snapshot.more",{count:o.length-5})})]})]}),c.length>0&&s.jsxs("div",{className:"snapshot-file-group",children:[s.jsxs("div",{className:"snapshot-file-group-label",children:[s.jsx("span",{className:"snapshot-file-type modified",children:"~"}),a("terminal:snapshot.modifiedFiles",{count:c.length})]}),s.jsxs("div",{className:"snapshot-file-list",children:[c.slice(0,5).map(e=>s.jsxs("div",{className:"snapshot-file-item",children:[s.jsx("span",{className:"snapshot-file-path",title:e.path,children:v(e.path)}),e.size!==void 0&&s.jsx("span",{className:"snapshot-file-size",children:f(e.size)})]},e.path)),c.length>5&&s.jsx("div",{className:"snapshot-file-more",children:a("terminal:snapshot.more",{count:c.length-5})})]})]})]}),i.length===0&&s.jsx("div",{className:"snapshot-no-files",children:a("terminal:snapshot.noFilesChanged")})]}),x&&s.jsx("div",{className:"snapshot-error",children:x})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:n,disabled:l,children:a("common:buttons.cancel")}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:!r.trim()||l,children:l?a("terminal:snapshot.saving"):`⭐ ${a("terminal:snapshot.save")}`})]})]})]})})}function v(t){const n=t.split("/");return n[n.length-1]||t}function f(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}export{B as SaveSnapshotModal};
1
+ import{u as D,r as h,j as s}from"./main-DFVf4Fc5.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-BvqnFOow.js";function B({isOpen:t,onClose:n,agent:d,outputCount:b,trackedFiles:p,onSave:g,isSaving:l=!1,error:x}){const{t:a}=D(["terminal","common"]),m=h.useCallback(()=>{const z=new Date().toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});return`${d.name} - ${z}`},[d.name]),[r,u]=h.useState(m()),[j,N]=h.useState("");h.useEffect(()=>{t&&(u(m()),N(""))},[t,m]);const y=async e=>{e.preventDefault(),r.trim()&&await g({agentId:d.id,title:r.trim(),description:j.trim()||void 0})},w=e=>{e.key==="Escape"&&n()};if(!t)return null;const i=(p==null?void 0:p.files)||[],o=i.filter(e=>e.type==="created"),c=i.filter(e=>e.type==="modified");return s.jsx("div",{className:"modal-overlay visible",onClick:n,onKeyDown:w,children:s.jsxs("div",{className:"modal snapshot-modal",onClick:e=>e.stopPropagation(),children:[s.jsxs("div",{className:"modal-header",children:[s.jsx("span",{className:"snapshot-modal-icon",children:"⭐"}),a("terminal:snapshot.save")]}),s.jsxs("form",{onSubmit:y,children:[s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"snapshot-field",children:[s.jsxs("label",{className:"snapshot-label",children:[a("common:labels.title")," ",s.jsx("span",{className:"snapshot-required",children:"*"})]}),s.jsx("input",{type:"text",className:"snapshot-input",value:r,onChange:e=>u(e.target.value),placeholder:a("terminal:snapshot.enterTitle"),autoFocus:!0,disabled:l})]}),s.jsxs("div",{className:"snapshot-field",children:[s.jsxs("label",{className:"snapshot-label",children:[a("common:labels.description")," ",s.jsx("span",{className:"snapshot-optional",children:a("common:labels.optional")})]}),s.jsx("textarea",{className:"snapshot-textarea",value:j,onChange:e=>N(e.target.value),placeholder:a("terminal:snapshot.whatWasAccomplished"),rows:3,disabled:l})]}),s.jsxs("div",{className:"snapshot-preview",children:[s.jsx("div",{className:"snapshot-preview-header",children:a("terminal:snapshot.whatWillBeCaptured")}),s.jsxs("div",{className:"snapshot-preview-stats",children:[s.jsxs("div",{className:"snapshot-stat",children:[s.jsx("span",{className:"snapshot-stat-icon",children:"💬"}),s.jsx("span",{className:"snapshot-stat-value",children:b}),s.jsx("span",{className:"snapshot-stat-label",children:a("terminal:snapshot.messages")})]}),s.jsxs("div",{className:"snapshot-stat",children:[s.jsx("span",{className:"snapshot-stat-icon",children:"📄"}),s.jsx("span",{className:"snapshot-stat-value",children:i.length}),s.jsx("span",{className:"snapshot-stat-label",children:a("terminal:snapshot.files")})]})]}),i.length>0&&s.jsxs("div",{className:"snapshot-files-preview",children:[o.length>0&&s.jsxs("div",{className:"snapshot-file-group",children:[s.jsxs("div",{className:"snapshot-file-group-label",children:[s.jsx("span",{className:"snapshot-file-type created",children:"+"}),a("terminal:snapshot.createdFiles",{count:o.length})]}),s.jsxs("div",{className:"snapshot-file-list",children:[o.slice(0,5).map(e=>s.jsxs("div",{className:"snapshot-file-item",children:[s.jsx("span",{className:"snapshot-file-path",title:e.path,children:v(e.path)}),e.size!==void 0&&s.jsx("span",{className:"snapshot-file-size",children:f(e.size)})]},e.path)),o.length>5&&s.jsx("div",{className:"snapshot-file-more",children:a("terminal:snapshot.more",{count:o.length-5})})]})]}),c.length>0&&s.jsxs("div",{className:"snapshot-file-group",children:[s.jsxs("div",{className:"snapshot-file-group-label",children:[s.jsx("span",{className:"snapshot-file-type modified",children:"~"}),a("terminal:snapshot.modifiedFiles",{count:c.length})]}),s.jsxs("div",{className:"snapshot-file-list",children:[c.slice(0,5).map(e=>s.jsxs("div",{className:"snapshot-file-item",children:[s.jsx("span",{className:"snapshot-file-path",title:e.path,children:v(e.path)}),e.size!==void 0&&s.jsx("span",{className:"snapshot-file-size",children:f(e.size)})]},e.path)),c.length>5&&s.jsx("div",{className:"snapshot-file-more",children:a("terminal:snapshot.more",{count:c.length-5})})]})]})]}),i.length===0&&s.jsx("div",{className:"snapshot-no-files",children:a("terminal:snapshot.noFilesChanged")})]}),x&&s.jsx("div",{className:"snapshot-error",children:x})]}),s.jsxs("div",{className:"modal-footer",children:[s.jsx("button",{type:"button",className:"btn btn-secondary",onClick:n,disabled:l,children:a("common:buttons.cancel")}),s.jsx("button",{type:"submit",className:"btn btn-primary",disabled:!r.trim()||l,children:l?a("terminal:snapshot.saving"):`⭐ ${a("terminal:snapshot.save")}`})]})]})]})})}function v(t){const n=t.split("/");return n[n.length-1]||t}function f(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}export{B as SaveSnapshotModal};