bit-office 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +412 -396
- package/dist/index.js.map +1 -1
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/262.71aab99cc60a53d6.js +1 -0
- package/dist/web/_next/static/chunks/29.3f310d0e1e39b284.js +1 -0
- package/dist/web/_next/static/chunks/337.37c047a79777052d.js +1 -0
- package/dist/web/_next/static/chunks/{368.17f62d3909ec67e9.js → 368.3f346c171a638292.js} +1 -1
- package/dist/web/_next/static/chunks/606.4e73b23e56d12bdb.js +1 -0
- package/dist/web/_next/static/chunks/729.826ca49d46677d86.js +1 -0
- package/dist/web/_next/static/chunks/853.3ac80a6e5f45c12f.js +1 -0
- package/dist/web/_next/static/chunks/895.ba8d7f302ee0082f.js +1 -0
- package/dist/web/_next/static/chunks/999.bd3853e8dc65d694.js +1 -0
- package/dist/web/_next/static/chunks/app/office/page-6eabeff9ea24f0b8.js +1 -0
- package/dist/web/_next/static/chunks/app/pair/{page-67f86e4adcdf34ea.js → page-ec98149563ab8ea8.js} +1 -1
- package/dist/web/_next/static/chunks/{webpack-dcd361e024700880.js → webpack-1cd76fe3b13e8777.js} +1 -1
- package/dist/web/_next/static/css/620fea4ddbe8c89c.css +3 -0
- package/dist/web/index.html +2 -2
- package/dist/web/index.txt +2 -2
- package/dist/web/join.html +2 -2
- package/dist/web/join.txt +2 -2
- package/dist/web/office.html +3 -3
- package/dist/web/office.txt +3 -3
- package/dist/web/pair.html +2 -2
- package/dist/web/pair.txt +3 -3
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/web/_next/static/chunks/262.c930af897fc1ae41.js +0 -1
- package/dist/web/_next/static/chunks/29.5e4e3e30b02d00ad.js +0 -1
- package/dist/web/_next/static/chunks/337.98f156e48f146063.js +0 -1
- package/dist/web/_next/static/chunks/606.64076fb5c9a76eb8.js +0 -1
- package/dist/web/_next/static/chunks/729.f8f9847d2d765724.js +0 -1
- package/dist/web/_next/static/chunks/853.0c23af6158d43fda.js +0 -1
- package/dist/web/_next/static/chunks/895.b20c839956b4d7fa.js +0 -1
- package/dist/web/_next/static/chunks/999.59e64ccb62c7e043.js +0 -1
- package/dist/web/_next/static/chunks/app/office/page-21b29ce2f5b4492f.js +0 -1
- package/dist/web/_next/static/css/c62e12508f039ceb.css +0 -3
- /package/dist/web/_next/static/{a77xldHdc_0TOGcqwFr4L → 5vHCPBj0Ikhb0tVooPDGd}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{a77xldHdc_0TOGcqwFr4L → 5vHCPBj0Ikhb0tVooPDGd}/_ssgManifest.js +0 -0
package/dist/web/404.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--5vHCPBj0Ikhb0tVooPDGd--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/620fea4ddbe8c89c.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-1cd76fe3b13e8777.js"/><script src="/_next/static/chunks/4d67e943-e6a0fd3b5c397505.js" async=""></script><script src="/_next/static/chunks/388-5a04e93e2531cfb7.js" async=""></script><script src="/_next/static/chunks/main-app-baad86574bd560af.js" async=""></script><script src="/_next/static/chunks/767-52fa35b605461336.js" async=""></script><script src="/_next/static/chunks/276-7203e26618727a54.js" async=""></script><script src="/_next/static/chunks/app/layout-a57e585fdbd6e50f.js" async=""></script><meta name="theme-color" content="#1a1530"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous"/><meta name="robots" content="noindex"/><title>Open Office</title><meta name="description" content="Control your AI agents from anywhere"/><link rel="manifest" href="/manifest.json"/><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400&family=Press+Start+2P&display=swap" rel="stylesheet"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body style="margin:0;background-color:#16122a;color:#eddcb8;font-family:system-ui, sans-serif"><div hidden=""><!--$--><!--/$--></div><div style="display:flex;align-items:center;justify-content:center;min-height:100vh"><h1 style="font-family:JetBrains Mono, monospace;font-size:1.2rem">404 — Not Found</h1></div><!--$--><!--/$--><script>
|
|
2
2
|
document.addEventListener('visibilitychange', function() {
|
|
3
3
|
document.body.classList.toggle('term-paused', document.hidden);
|
|
4
4
|
});
|
|
@@ -62,4 +62,4 @@
|
|
|
62
62
|
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', scan);
|
|
63
63
|
else scan();
|
|
64
64
|
})();
|
|
65
|
-
</script><script src="/_next/static/chunks/webpack-
|
|
65
|
+
</script><script src="/_next/static/chunks/webpack-1cd76fe3b13e8777.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[8163,[\"767\",\"static/chunks/767-52fa35b605461336.js\",\"276\",\"static/chunks/276-7203e26618727a54.js\",\"177\",\"static/chunks/app/layout-a57e585fdbd6e50f.js\"],\"TooltipProvider\"]\n3:I[9653,[],\"\"]\n4:I[1329,[],\"\"]\n9:I[5719,[],\"\"]\n:HL[\"/_next/static/css/620fea4ddbe8c89c.css\",\"style\"]\n5:Tb25,"])</script><script>self.__next_f.push([1,"\n (function() {\n var attached = new WeakSet();\n var timers = new WeakMap();\n function addScrollbar(el) {\n if (attached.has(el)) return;\n var cs = getComputedStyle(el);\n var ov = cs.overflowY;\n if (ov !== 'auto' \u0026\u0026 ov !== 'scroll') return;\n if (cs.position === 'static') el.style.position = 'relative';\n var track = document.createElement('div');\n track.className = 'custom-scrollbar';\n var thumb = document.createElement('div');\n thumb.className = 'custom-scrollbar-thumb';\n track.appendChild(thumb);\n el.appendChild(track);\n attached.add(el);\n function update() {\n var sh = el.scrollHeight, ch = el.clientHeight;\n if (sh \u003c= ch) { track.classList.remove('visible'); return; }\n var ratio = ch / sh;\n var thumbH = Math.max(20, ratio * ch);\n var scrollRatio = el.scrollTop / (sh - ch);\n var thumbTop = scrollRatio * (ch - thumbH);\n thumb.style.height = thumbH + 'px';\n thumb.style.top = (el.scrollTop + thumbTop) + 'px';\n track.classList.add('visible');\n clearTimeout(timers.get(el));\n timers.set(el, setTimeout(function() { track.classList.remove('visible'); }, 1200));\n }\n el.addEventListener('scroll', update, { passive: true });\n new ResizeObserver(update).observe(el);\n // Observe subtree content changes (e.g. streaming chat messages)\n var contentTimer = 0;\n new MutationObserver(function() {\n if (contentTimer) return;\n contentTimer = setTimeout(function() { contentTimer = 0; update(); }, 150);\n }).observe(el, { childList: true, subtree: true, characterData: true });\n update();\n }\n function scan() {\n document.querySelectorAll('[data-scrollbar]').forEach(function(el) {\n addScrollbar(el);\n });\n }\n var scanTimer = 0;\n var mo = new MutationObserver(function() {\n if (scanTimer) return;\n scanTimer = setTimeout(function() { scanTimer = 0; scan(); }, 300);\n });\n mo.observe(document.body, { childList: true, subtree: true });\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', scan);\n else scan();\n })();\n "])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"5vHCPBj0Ikhb0tVooPDGd\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/620fea4ddbe8c89c.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"meta\",null,{\"name\":\"theme-color\",\"content\":\"#1a1530\"}],[\"$\",\"meta\",null,{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.googleapis.com\"}],[\"$\",\"link\",null,{\"rel\":\"preconnect\",\"href\":\"https://fonts.gstatic.com\",\"crossOrigin\":\"anonymous\"}],[\"$\",\"link\",null,{\"href\":\"https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400\u0026family=Press+Start+2P\u0026display=swap\",\"rel\":\"stylesheet\"}]]}],[\"$\",\"body\",null,{\"style\":{\"margin\":0,\"backgroundColor\":\"#16122a\",\"color\":\"#eddcb8\",\"fontFamily\":\"system-ui, sans-serif\"},\"children\":[[\"$\",\"$L2\",null,{\"delayDuration\":300,\"skipDelayDuration\":100,\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"div\",null,{\"style\":{\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"minHeight\":\"100vh\"},\"children\":[\"$\",\"h1\",null,{\"style\":{\"fontFamily\":\"JetBrains Mono, monospace\",\"fontSize\":\"1.2rem\"},\"children\":\"404 — Not Found\"}]}],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n document.addEventListener('visibilitychange', function() {\\n document.body.classList.toggle('term-paused', document.hidden);\\n });\\n \"}}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n if ('serviceWorker' in navigator \u0026\u0026 location.hostname === 'localhost') {\\n navigator.serviceWorker.getRegistrations().then(function(regs) {\\n for (var r of regs) r.unregister();\\n });\\n }\\n \"}}],[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"$5\"}}]]}]]}]]}],{\"children\":[\"/_not-found\",\"$L6\",{\"children\":[\"__PAGE__\",\"$L7\",{},null,false]},null,false]},null,false],\"$L8\",false]],\"m\":\"$undefined\",\"G\":[\"$9\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"a:I[9096,[],\"OutletBoundary\"]\nc:I[913,[],\"AsyncMetadataOutlet\"]\ne:I[9096,[],\"ViewportBoundary\"]\n10:I[9096,[],\"MetadataBoundary\"]\n11:\"$Sreact.suspense\"\n6:[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}]\n7:[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"div\",null,{\"style\":{\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"minHeight\":\"100vh\"},\"children\":[\"$\",\"h1\",null,{\"style\":{\"fontFamily\":\"JetBrains Mono, monospace\",\"fontSize\":\"1.2rem\"},\"children\":\"404 — Not Found\"}]}],null,[\"$\",\"$La\",null,{\"children\":[\"$Lb\",[\"$\",\"$Lc\",null,{\"promise\":\"$@d\"}]]}]]}]\n8:[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$Le\",null,{\"children\":\"$Lf\"}],null],[\"$\",\"$L10\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$11\",null,{\"fallback\":null,\"children\":\"$L12\"}]}]}]]}]\n"])</script><script>self.__next_f.push([1,"f:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nb:null\n"])</script><script>self.__next_f.push([1,"d:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Open Office\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Control your AI agents from anywhere\"}],[\"$\",\"link\",\"2\",{\"rel\":\"manifest\",\"href\":\"/manifest.json\",\"crossOrigin\":\"$undefined\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"12:\"$d:metadata\"\n"])</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[73,262],{73:(e,t,o)=>{o.r(t),o.d(t,{default:()=>i});var n=o(206),r=o(1406),l=o(2988);let i=function(e){let{palette:t,zoom:o=3,ready:i}=e,a=(0,r.useRef)(null);return(0,r.useEffect)(()=>{var e,n;let r=a.current;if(!r)return;let i=(0,l.Cr)(t);if(!i)return;let s=i.length,d=null!=(n=null==(e=i[0])?void 0:e.length)?n:0;r.width=d*o,r.height=s*o;let c=r.getContext("2d");if(c){c.clearRect(0,0,r.width,r.height);for(let e=0;e<s;e++)for(let t=0;t<d;t++){let n=i[e][t];n&&(c.fillStyle=n,c.fillRect(t*o,e*o,o,o))}}},[t,o,i]),(0,n.jsx)("canvas",{ref:a,style:{width:16*o,height:32*o,imageRendering:"pixelated"}})}},262:(e,t,o)=>{o.r(t),o.d(t,{default:()=>g});var n=o(206),r=o(1406),l=o(2001),i=o(5192),a=o(138),s=o(7821),d=o(7877),c=o(4932),p=o(73),f=o(1310),u=o(370),x=o(9362);let g=function(e){let{agentDefs:t,onHire:o,onCreate:g,onEdit:m,onDelete:h,onClose:y,assetsReady:v,detectedBackends:b}=e,[j,C]=(0,r.useState)("claude"),[S,k]=(0,r.useState)(null),[w,D]=(0,r.useState)(null),[z,M]=(0,r.useState)(()=>(0,d.SD)()),[A,I]=(0,r.useState)(""),T=t.filter(e=>e.isBuiltin&&"dev"===e.teamRole),Y=t.filter(e=>!e.isBuiltin&&"dev"===e.teamRole),N=(e,t)=>{let o=(null==w?void 0:w.id)===e.id;return(0,n.jsxs)("button",{onClick:()=>{(null==w?void 0:w.id)===e.id?D(null):(D(e),M((0,d.SD)()))},onMouseEnter:()=>k(e.id),onMouseLeave:()=>k(null),title:e.skills?"Skills: ".concat(e.skills):e.role,style:{display:"flex",flexDirection:"column",alignItems:"center",padding:"12px 6px 10px",position:"relative",border:"1px solid ".concat(o?c.DM:c.KD),backgroundColor:o?"".concat(c.DM,"12"):"transparent",cursor:"pointer",textAlign:"center",transition:"border-color 0.15s, background-color 0.15s"},children:[(0,n.jsx)(p.default,{palette:e.palette,zoom:2,ready:v}),(0,n.jsx)("div",{style:{fontSize:12,color:o?c.DM:c.Y0,marginTop:6,width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)"},children:e.role}),S===e.id&&(0,n.jsxs)("span",{style:{position:"absolute",top:4,right:4,display:"flex",gap:2,alignItems:"center"},children:[(0,n.jsx)("span",{onClick:t=>{t.stopPropagation(),m(e)},style:{fontSize:15,color:c.Y0,cursor:"pointer",padding:"2px 4px"},title:"Edit",children:"✎"}),t&&(0,n.jsx)("span",{onClick:t=>{t.stopPropagation(),h(e.id)},style:{fontSize:16,color:c.v_,cursor:"pointer",padding:"2px 4px",fontWeight:700},title:"Delete",children:"\xd7"})]})]},e.id)};return(0,n.jsx)(f.A,{open:!0,onClose:y,maxWidth:440,zIndex:100,title:"Hire Agent",className:"max-h-[min(712px,85vh)]",footer:(0,n.jsx)(u.A,{variant:"dim",onClick:y,children:"Cancel"}),children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{style:{marginBottom:12},children:[(0,n.jsx)("div",{style:{fontSize:12,color:c.Y0,marginBottom:5,fontFamily:"var(--font-mono)",letterSpacing:"0.05em"},children:"AI BACKEND"}),(0,n.jsx)("div",{style:{display:"flex",gap:4},children:s.GN.map(e=>{let t=!b||0===b.length||b.includes(e.id),o=j===e.id;return(0,n.jsxs)("button",{onClick:()=>C(e.id),style:{flex:1,padding:"6px 4px",fontSize:13,fontWeight:600,border:o?"1px solid ".concat(c.DM):"1px solid ".concat(c.KD),backgroundColor:o?c.DM+"20":"transparent",color:o?c.DM:c.Y0,cursor:"pointer",fontFamily:"var(--font-mono)",opacity:t?1:.7},children:[(0,n.jsx)("span",{style:{display:"inline-block",width:5,height:5,borderRadius:"50%",backgroundColor:t?c.$C:c.O2,marginRight:4,verticalAlign:"middle"}}),e.name]},e.id)})})]}),(0,n.jsxs)("div",{"data-scrollbar":!0,style:{maxHeight:"55vh",overflowY:"auto",overflowX:"hidden"},children:[(0,n.jsx)("div",{style:{fontSize:12,color:c.Y0,marginBottom:5,fontFamily:"var(--font-mono)",letterSpacing:"0.05em"},children:"BUILT-IN AGENTS"}),(0,n.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:5,marginBottom:10},children:T.map(e=>N(e,!1))}),(0,n.jsx)("div",{style:{fontSize:12,color:c.Y0,marginBottom:5,fontFamily:"var(--font-mono)",letterSpacing:"0.05em"},children:"MY AGENTS"}),(0,n.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:5,marginBottom:10},children:[Y.map(e=>N(e,!0)),(0,n.jsxs)("button",{onClick:g,style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"12px 6px 10px",border:"1px dashed ".concat(c.KD),backgroundColor:"transparent",cursor:"pointer",textAlign:"center",transition:"border-color 0.15s, color 0.15s",color:c.Y0,minHeight:80},onMouseEnter:e=>{e.currentTarget.style.borderColor=c.DM,e.currentTarget.style.color=c.DM},onMouseLeave:e=>{e.currentTarget.style.borderColor=c.KD,e.currentTarget.style.color=c.Y0},children:[(0,n.jsx)("span",{style:{fontSize:24,lineHeight:1,fontWeight:300},children:"+"}),(0,n.jsx)("span",{style:{fontSize:11,marginTop:4,fontFamily:"var(--font-mono)"},children:"Create New"})]})]})]}),w&&(0,n.jsx)("div",{style:{position:"fixed",inset:0,zIndex:200,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.5)"},onClick:e=>{e.target===e.currentTarget&&D(null)},children:(0,n.jsxs)("div",{style:{width:360,maxWidth:"90vw",padding:"16px",border:"1px solid ".concat(c.DM,"50"),backgroundColor:c.lr,boxShadow:"0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px ".concat(c.DM,"15"),display:"flex",flexDirection:"column",gap:10},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,n.jsx)(p.default,{palette:w.palette,zoom:2,ready:v}),(0,n.jsx)("div",{style:{fontSize:13,color:c.DM,fontFamily:"var(--font-mono)",fontWeight:600,flex:1},children:w.role}),(0,n.jsx)("button",{onClick:()=>D(null),style:{background:"none",border:"none",cursor:"pointer",color:c.Y0,fontSize:18,padding:"2px 4px",lineHeight:1},children:"\xd7"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:{fontSize:11,color:c.Y0,marginBottom:3,fontFamily:"var(--font-mono)",letterSpacing:"0.05em"},children:"WORKING DIRECTORY"}),(0,n.jsxs)("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[(0,n.jsx)(x.A,{type:"text",value:A,onChange:e=>I(e.target.value),placeholder:"~/.open-office/projects",style:{flex:1}}),(0,n.jsx)(u.A,{variant:"dim",onClick:()=>{let e=(0,l.Ak)(6);a.sX.set(e,e=>I(e)),(0,i.S8)({type:"PICK_FOLDER",requestId:e})},children:"Browse"})]}),(0,n.jsx)("div",{style:{fontSize:10,color:c.Y0,marginTop:2,fontFamily:"var(--font-mono)",opacity:.7},children:"Empty = default workspace"})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[(0,n.jsx)("span",{style:{fontSize:11,color:c.Y0,fontFamily:"var(--font-mono)",letterSpacing:"0.05em"},children:"NAME"}),(0,n.jsx)("button",{onClick:()=>M((0,d.SD)()),title:"Randomize name",style:{background:"none",border:"none",cursor:"pointer",color:c.Y0,fontSize:13,padding:0,lineHeight:1,fontFamily:"var(--font-mono)"},onMouseEnter:e=>{e.currentTarget.style.color=c.DM},onMouseLeave:e=>{e.currentTarget.style.color=c.Y0},children:"↻"})]}),(0,n.jsx)(x.A,{type:"text",value:z,onChange:e=>M(e.target.value),placeholder:"Agent display name"})]}),(0,n.jsx)(u.A,{variant:"primary",onClick:()=>{w&&o(w,j,A||void 0,z.trim()||void 0)},style:{padding:"9px",fontWeight:700,width:"100%"},children:"hire"})]})})]})})}},9362:(e,t,o)=>{o.d(t,{A:()=>a});var n=o(206),r=o(1406),l=o(9385);let i=r.forwardRef((e,t)=>{let{className:o,type:r,...i}=e;return(0,n.jsx)("input",{type:r,className:(0,l.cn)("flex w-full px-2.5 py-1 h-7","border border-border bg-background text-foreground","font-mono text-term leading-4","outline-none focus-visible:outline-none transition-colors duration-fast","placeholder:text-term-green-dim placeholder:opacity-50","focus:border-term-green-dim","disabled:cursor-not-allowed disabled:opacity-50",o),ref:t,...i})});i.displayName="Input",r.forwardRef((e,t)=>{let{className:o,...r}=e;return(0,n.jsx)("textarea",{className:(0,l.cn)("flex w-full px-2.5 py-1 resize-none","border border-border bg-background text-foreground","font-mono text-term leading-4","outline-none focus-visible:outline-none transition-colors duration-fast","placeholder:text-term-green-dim placeholder:opacity-50","focus:border-term-green-dim","disabled:cursor-not-allowed disabled:opacity-50",o),ref:t,...r})}).displayName="Textarea";let a=(0,r.forwardRef)(function(e,t){let{inline:o,className:r,...a}=e;return(0,n.jsx)(i,{ref:t,className:(0,l.cn)(o&&"border-none bg-transparent text-term-text-bright caret-accent px-1.5 py-1.5 focus:border-none focus:shadow-none",r),...a})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29],{6029:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});var r=n(206),l=n(1406),s=n(9385),a=n(5192),o=n(138),d=n(786),i=n(1310),c=n(370),u=n(9362);function m(e){let{label:t,hint:n,children:l}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,r.jsxs)("label",{className:"text-term text-muted-foreground shrink-0 w-[100px] text-right",children:[t,n&&(0,r.jsx)("span",{className:"block text-[10px] opacity-50 mt-0.5",children:n})]}),(0,r.jsx)("div",{className:"flex-1 min-w-0",children:l})]})}function x(e){let{isOpen:t,onClose:n,soundEnabled:x,onSoundEnabledChange:p,consoleCols:g=3,consoleRows:b=1,onConsoleColsChange:f,onConsoleRowsChange:h}=e,[j,N]=(0,l.useState)(""),[v,k]=(0,l.useState)(""),[w,S]=(0,l.useState)(!1),[C,y]=(0,l.useState)(null),[A,T]=(0,l.useState)(!1),[E,D]=(0,l.useState)(!1),[F,I]=(0,l.useState)(!0),[R,_]=(0,l.useState)(!0),[B,G]=(0,l.useState)(""),[U,O]=(0,l.useState)(""),[z,V]=(0,l.useState)(!1),[Z,H]=(0,l.useState)(!1),[J,K]=(0,l.useState)(null),[M,W]=(0,l.useState)(!1),L=(0,o.hK)(e=>e.configData),P=(0,o.hK)(e=>e.configResult);(0,l.useEffect)(()=>{t&&(0,a.S8)({type:"GET_CONFIG"})},[t]),(0,l.useEffect)(()=>{if(L){var e,t,n,r,l,s,a,o,d;N(null!=(t=L.telegramBotToken)?t:""),k(null!=(n=null==(e=L.telegramAllowedUsers)?void 0:e.join(", "))?n:""),T(null!=(r=L.telegramConnected)&&r),I(null==(l=L.worktreeEnabled)||l),_(null==(s=L.autoMergeEnabled)||s),G(null!=(a=L.tunnelToken)?a:""),O(null!=(o=L.tunnelBaseUrl)?o:""),V(null!=(d=L.tunnelRunning)&&d)}},[L]),(0,l.useEffect)(()=>{if(P&&w){S(!1),y(P.message),void 0!==P.telegramConnected&&T(P.telegramConnected);let e=setTimeout(()=>y(null),5e3);return()=>clearTimeout(e)}if(P&&Z){H(!1),void 0!==P.tunnelRunning&&V(P.tunnelRunning),K(P.tunnelRunning?"Tunnel started":"Tunnel not running");let e=setTimeout(()=>K(null),5e3);return()=>clearTimeout(e)}},[P]);let $=e=>(0,s.cn)("w-3.5 h-3.5 border-2 border-muted-foreground rounded-sm shrink-0","flex items-center justify-center text-[11px] leading-none",e?"bg-accent text-background":"bg-transparent"),q="flex items-center justify-between w-full px-3 py-2 text-term text-foreground bg-transparent border-none cursor-pointer text-left font-mono transition-colors duration-fast hover:bg-white/5";return(0,r.jsxs)(i.A,{open:t,onClose:n,maxWidth:520,zIndex:100,title:"Settings",children:[(0,r.jsxs)("div",{className:"border-b border-term-border-dim pb-3 mb-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-3",children:[(0,r.jsx)("span",{className:(0,s.cn)("inline-block w-2 h-2 rounded-full shrink-0",A?"bg-sem-green":"bg-muted-foreground")}),(0,r.jsxs)("span",{className:"text-[13px] text-foreground font-medium",children:["Telegram ",A?"(connected)":"(disconnected)"]})]}),(0,r.jsx)(m,{label:"Bot Token",children:(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(u.A,{type:E?"text":"password",value:j,onChange:e=>N(e.target.value),placeholder:"123456:ABC-DEF...",className:"flex-1",onFocus:()=>{j.includes("...")&&N("")}}),(0,r.jsx)(c.A,{variant:"dim",size:"sm",onClick:()=>D(!E),title:E?"Hide":"Show",children:E?"\uD83D\uDE48":"\uD83D\uDC41"})]})}),(0,r.jsx)(m,{label:"Allowed IDs",hint:"comma-sep, empty=all",children:(0,r.jsx)(u.A,{type:"text",value:v,onChange:e=>k(e.target.value),placeholder:"123456789, 987654321"})}),(0,r.jsxs)("div",{className:"flex items-center gap-2 pl-[112px]",children:[(0,r.jsx)(c.A,{variant:"primary",onClick:()=>{S(!0),y(null);let e=v.split(",").map(e=>e.trim()).filter(Boolean);(0,a.S8)({type:"SAVE_CONFIG",telegramBotToken:j.includes("...")?void 0:j,telegramAllowedUsers:e})},disabled:w,children:w?"Saving...":"Save & Connect"}),C&&(0,r.jsx)("span",{className:(0,s.cn)("text-term",C.includes("Failed")||C.includes("not")?"text-sem-red":"text-sem-green"),children:C})]})]}),(0,r.jsxs)("div",{className:"border-b border-term-border-dim pb-3 mb-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-3",children:[(0,r.jsx)("span",{className:(0,s.cn)("inline-block w-2 h-2 rounded-full shrink-0",z?"bg-sem-green":"bg-muted-foreground")}),(0,r.jsxs)("span",{className:"text-[13px] text-foreground font-medium",children:["Tunnel ",z?"(running)":"(stopped)"]})]}),(0,r.jsx)(m,{label:"Token",children:(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(u.A,{type:M?"text":"password",value:B,onChange:e=>G(e.target.value),placeholder:"eyJ...",className:"flex-1",onFocus:()=>{B.includes("...")&&G("")}}),(0,r.jsx)(c.A,{variant:"dim",size:"sm",onClick:()=>W(!M),title:M?"Hide":"Show",children:M?"\uD83D\uDE48":"\uD83D\uDC41"})]})}),(0,r.jsx)(m,{label:"Public URL",children:(0,r.jsx)(u.A,{type:"text",value:U,onChange:e=>O(e.target.value),placeholder:"https://office.example.com"})}),(0,r.jsxs)("div",{className:"flex items-center gap-2 pl-[112px]",children:[(0,r.jsx)(c.A,{variant:"primary",onClick:()=>{H(!0),K(null),(0,a.S8)({type:"SAVE_CONFIG",tunnelToken:B.includes("...")?void 0:B,tunnelBaseUrl:U})},disabled:Z,children:Z?"Saving...":"Save & Start"}),J&&(0,r.jsx)("span",{className:(0,s.cn)("text-term",J.includes("not")||J.includes("Failed")?"text-sem-red":"text-sem-green"),children:J})]})]}),(0,r.jsxs)("div",{className:"mb-1",children:[(0,r.jsxs)("button",{onClick:()=>{let e=!F;I(e),(0,a.S8)({type:"SAVE_CONFIG",worktreeEnabled:e})},className:q,title:"Each agent works in its own git worktree branch, merged on completion",children:[(0,r.jsx)("span",{children:"Agent Isolation"}),(0,r.jsx)("span",{className:$(F),children:F?"✓":""})]}),(0,r.jsxs)("button",{onClick:()=>{let e=!R;_(e),(0,a.S8)({type:"SAVE_CONFIG",autoMergeEnabled:e})},className:q,title:"Auto-merge agent changes to main on task completion. Turn off to review before merging.",children:[(0,r.jsx)("span",{children:"Auto-merge"}),(0,r.jsx)("span",{className:$(R),children:R?"✓":""})]}),(0,r.jsxs)("button",{onClick:()=>{let e=!x;p(e),localStorage.setItem("office-sound-enabled",JSON.stringify(e))},className:q,children:[(0,r.jsx)("span",{children:"Sound Notifications"}),(0,r.jsx)("span",{className:$(x),children:x?"✓":""})]})]}),(0,r.jsxs)("div",{className:"border-b border-term-border-dim pb-3 mb-2",children:[(0,r.jsx)("span",{className:"text-[13px] text-foreground font-medium block mb-2",children:"Console Grid"}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(m,{label:"Columns",children:(0,r.jsx)("div",{className:"flex items-center gap-1.5",children:[1,2,3,4].map(e=>(0,r.jsx)("button",{onClick:()=>null==f?void 0:f(e),className:(0,s.cn)("w-8 h-7 text-term font-mono border rounded cursor-pointer transition-colors duration-150",g===e?"border-accent bg-accent/20 text-accent":"border-muted-foreground/30 bg-transparent text-muted-foreground hover:border-muted-foreground"),children:e},e))})}),(0,r.jsx)(m,{label:"Rows",children:(0,r.jsx)("div",{className:"flex items-center gap-1.5",children:[1,2,3].map(e=>(0,r.jsx)("button",{onClick:()=>null==h?void 0:h(e),className:(0,s.cn)("w-8 h-7 text-term font-mono border rounded cursor-pointer transition-colors duration-150",b===e?"border-accent bg-accent/20 text-accent":"border-muted-foreground/30 bg-transparent text-muted-foreground hover:border-muted-foreground"),children:e},e))})})]}),(0,r.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-1 pl-[112px]",children:[g," \xd7 ",b," = ",g*b," agents per page"]})]}),(0,r.jsxs)("div",{className:"border-t border-term-border-dim mt-1 pt-2 text-[11px] text-muted-foreground font-mono leading-snug select-text",title:"From monorepo root package.json at build time",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"opacity-75",children:"Web UI"})," ",(0,r.jsxs)("span",{className:"text-foreground",children:["v",d.h]})]}),d.Z?(0,r.jsxs)("div",{className:"mt-0.5 text-[10px] opacity-90",children:["build ",d.Z.replace("T"," ").replace(/\.\d{3}Z$/," UTC")]}):null]})]})}},9362:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(206),l=n(1406),s=n(9385);let a=l.forwardRef((e,t)=>{let{className:n,type:l,...a}=e;return(0,r.jsx)("input",{type:l,className:(0,s.cn)("flex w-full px-2.5 py-1 h-7","border border-border bg-background text-foreground","font-mono text-term leading-4","outline-none focus-visible:outline-none transition-colors duration-fast","placeholder:text-term-green-dim placeholder:opacity-50","focus:border-term-green-dim","disabled:cursor-not-allowed disabled:opacity-50",n),ref:t,...a})});a.displayName="Input",l.forwardRef((e,t)=>{let{className:n,...l}=e;return(0,r.jsx)("textarea",{className:(0,s.cn)("flex w-full px-2.5 py-1 resize-none","border border-border bg-background text-foreground","font-mono text-term leading-4","outline-none focus-visible:outline-none transition-colors duration-fast","placeholder:text-term-green-dim placeholder:opacity-50","focus:border-term-green-dim","disabled:cursor-not-allowed disabled:opacity-50",n),ref:t,...l})}).displayName="Textarea";let o=(0,l.forwardRef)(function(e,t){let{inline:n,className:l,...o}=e;return(0,r.jsx)(a,{ref:t,className:(0,s.cn)(n&&"border-none bg-transparent text-term-text-bright caret-accent px-1.5 py-1.5 focus:border-none focus:shadow-none",l),...o})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[337],{3337:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(206),r=a(1406),l=a(5282),o=a(4932),s=a(9385);let i=(0,l.default)(()=>Promise.all([a.e(767),a.e(853)]).then(a.bind(a,6853)),{loadableGenerated:{webpack:()=>[6853]},ssr:!1}),c=(0,l.default)(()=>a.e(73).then(a.bind(a,73)),{loadableGenerated:{webpack:()=>[73]},ssr:!1}),d=(0,r.memo)(function(e){let{agentId:t,data:a,meta:l,assetsReady:o,panePrompts:s,onPanePromptChange:d,isOwner:u,isCollaborator:g,isSpectator:m,panePendingImages:p,onPanePendingImagesChange:v,suggestions:h,suggestText:b,onSuggestTextChange:f,onSubmit:x,onCancel:M,onFire:C,onApproval:k,onApprovePlan:w,onQuickApprove:T,onEndProject:y,onSuggest:A,onPreview:E,onReview:I,detectedBackends:P,onLoadMore:R,onPasteImage:L,onPasteText:N,onDropImage:j,reviewerOverlay:S,onReviewerLoadMore:_,onApplyReviewFixes:D,onDismissReview:H,autoMerge:X,pendingMerge:F,lastMergeCommit:U,lastMergeMessage:Y,undoCount:B,onMerge:O,onRevert:z,onUndoMerge:J,scrollFrozen:G}=e,Q=(0,r.useRef)(t);Q.current=t;let W=(0,r.useCallback)(e=>d(Q.current,e),[d]),K=(0,r.useCallback)(e=>v(Q.current,e),[v]),q=(0,r.useCallback)(()=>x(Q.current),[x]),V=(0,r.useCallback)(()=>M(Q.current),[M]),Z=(0,r.useCallback)(()=>w(Q.current),[w]),$=(0,r.useCallback)(()=>T(Q.current),[T]),ee=(0,r.useCallback)(()=>y(Q.current),[y]),et=(0,r.useCallback)(()=>R(Q.current),[R]),ea=(0,r.useCallback)(e=>L(Q.current,e),[L]),en=(0,r.useCallback)(e=>N(Q.current,e),[N]),er=(0,r.useCallback)(e=>j(Q.current,e),[j]),el=(0,r.useCallback)(I?(e,t)=>I(Q.current,e,t):void 0,[I]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(i,{agentId:t,name:a.name,role:a.role,backend:a.backend,status:a.status,cwd:a.cwd,workDir:a.workDir,messages:a.messages,visibleMessages:a.visibleMessages,hasMoreMessages:a.hasMoreMessages,tokenUsage:a.tokenUsage,isTeamLead:a.isTeamLead,isTeamMember:a.isTeamMember,isExternal:a.isExternal,teamId:a.teamId,teamPhase:a.teamPhase,pendingApproval:a.pendingApproval,awaitingApproval:a.awaitingApproval,lastLogLine:a.lastLogLine,busy:a.busy,pid:a.pid,isOwner:u,isCollaborator:g,isSpectator:m,prompt:s.get(t)||"",onPromptChange:W,pendingImages:p.get(t)||[],onPendingImagesChange:K,suggestions:h,suggestText:b,onSuggestTextChange:f,onSubmit:q,onCancel:V,onFire:C,onApproval:k,onApprovePlan:Z,onQuickApprove:$,onEndProject:ee,onSuggest:A,onPreview:E,onReview:el,detectedBackends:P,onLoadMore:et,onPasteImage:ea,onPasteText:en,onDropImage:er,reviewerOverlay:S,onReviewerLoadMore:_,onApplyReviewFixes:D,onDismissReview:H,autoMerge:a.autoMerge,pendingMerge:a.pendingMerge,lastMergeCommit:a.lastMergeCommit,lastMergeMessage:a.lastMergeMessage,undoCount:a.undoCount,onMerge:O?()=>O(t):void 0,onRevert:z?()=>z(t):void 0,onUndoMerge:J?()=>J(t):void 0,scrollFrozen:G,hideInfoRole:!!l,inlineAvatar:l?{name:l.name,palette:l.palette,isTeamLead:l.isTeamLead,assetsReady:null!=o&&o,AvatarComponent:c}:null})})}),u=(0,r.memo)(function(e){var t;let{openPanes:a,getAgentData:l,paneOffset:i,onPaneOffsetChange:c,panePrompts:u,onPanePromptChange:g,isOwner:m,isCollaborator:p,isSpectator:v,panePendingImages:h,onPanePendingImagesChange:b,suggestions:f,suggestText:x,onSuggestTextChange:M,onSubmit:C,onCancel:k,onFire:w,onApproval:T,onApprovePlan:y,onQuickApprove:A,onEndProject:E,onSuggest:I,onPreview:P,onReview:R,onLoadMore:L,onPasteImage:N,onPasteText:j,onDropImage:S,reviewOverlay:_,getReviewerData:D,onReviewerLoadMore:H,onApplyReviewFixes:X,onDismissReview:F,detectedBackends:U,scrollFrozen:Y,agentMeta:B,assetsReady:O,showHireButton:z,hireLabel:J="hire",onHire:G,showTeamControls:Q,teamBusy:W,onMerge:K,onRevert:q,onUndoMerge:V,onStopTeam:Z,onFireTeam:$,cols:ee,rows:et}=e,ea=null!=ee?ee:3,en=null!=et?et:1,er=ea*en,[el,eo]=(0,r.useState)(0),[es,ei]=(0,r.useState)(null),ec=(0,r.useRef)(null),ed=Math.max(1,Math.ceil(a.length/er)),eu=a.length>0&&a.length%er==0,eg=z&&G&&eu?ed+1:ed,em=[];for(let e=0;e<a.length;e+=er)em.push(a.slice(e,e+er));for(;em.length<eg;)em.push([]);let ep=Math.max(0,Math.min(el,eg-1));ep!==el&&(eo(ep),c(ep*er)),(0,r.useEffect)(()=>{let e=setTimeout(()=>{document.activeElement instanceof HTMLElement&&("INPUT"===document.activeElement.tagName||"TEXTAREA"===document.activeElement.tagName)&&document.activeElement.blur()},50);return()=>clearTimeout(e)},[el]);let ev=(0,r.useCallback)(e=>{let t=Math.max(0,Math.min(e,eg-1));eo(e=>e===t?e:(ei(t>e?"left":"right"),t)),c(t*er)},[eg,c]);(0,r.useEffect)(()=>{let e=e=>{var t;let a=null==(t=e.target)?void 0:t.tagName;"INPUT"!==a&&"TEXTAREA"!==a&&"SELECT"!==a&&(eg<=1||("ArrowLeft"===e.key?(e.preventDefault(),ev(el-1)):"ArrowRight"===e.key&&(e.preventDefault(),ev(el+1))))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[el,eg,ev]);let eh=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let e=ec.current;if(!e||eg<=1)return;let t=t=>{let a=t.target;for(;a&&a!==e;){if("TEXTAREA"===a.tagName||"INPUT"===a.tagName)return;let{overflowY:e}=getComputedStyle(a);if(("auto"===e||"scroll"===e)&&a.scrollHeight>a.clientHeight)return;a=a.parentElement}let n=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;!(30>Math.abs(n))&&(eh.current||(eh.current=!0,setTimeout(()=>{eh.current=!1},400),n>0?ev(el+1):ev(el-1)))};return e.addEventListener("wheel",t,{passive:!0}),()=>e.removeEventListener("wheel",t)},[el,eg,ev]);let eb=(0,r.useRef)(null),ef=(0,r.useCallback)(e=>{eb.current={startX:e.touches[0].clientX,startY:e.touches[0].clientY}},[]),ex=(0,r.useCallback)(e=>{if(!eb.current||eg<=1)return;let t=e.changedTouches[0].clientX-eb.current.startX,a=e.changedTouches[0].clientY-eb.current.startY;eb.current=null,50>Math.abs(t)||Math.abs(t)<Math.abs(a)||(t<0?ev(el+1):ev(el-1))},[el,eg,ev]),eM=null!=(t=em[el])?t:[],eC=er-eM.length,ek=z&&G&&eC>0?0:-1,ew=[];for(let e of eM)ew.push({type:"agent",agentId:e});for(let e=0;e<eC;e++)ew.push({type:"placeholder",index:e});return(0,n.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",style:{position:"relative"},children:[Q&&(0,n.jsxs)("div",{style:{position:"absolute",top:38,right:14,zIndex:10,display:"flex",gap:6,alignItems:"center"},children:[W&&Z&&(0,n.jsx)("button",{onClick:Z,title:"Stop Team",className:"tb tb-sm",style:{color:"var(--term-accent)",borderColor:"var(--term-accent)"},children:"stop"}),$&&(0,n.jsx)("button",{onClick:$,title:"Fire Team",className:"tb tb-sm",style:{color:"var(--term-text)",borderColor:"var(--term-text)"},children:"fire team"})]}),(0,n.jsx)("div",{ref:ec,onTouchStart:ef,onTouchEnd:ex,className:(0,s.cn)("mpv-grid flex-1 min-h-0","left"===es?"mpv-slide-left":"right"===es?"mpv-slide-right":"mpv-page-fade"),style:{display:"grid",gridTemplateColumns:"repeat(".concat(ea,", 1fr)"),gridTemplateRows:"repeat(".concat(en,", 1fr)")},children:ew.map(e=>{if("agent"===e.type){let{agentId:t}=e,a=l(t);if(!a)return null;let r=null==B?void 0:B.find(e=>e.agentId===t);return(0,n.jsx)("div",{className:"mpv-cell",style:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",position:"relative",overflow:"hidden",borderLeft:"1px solid ".concat(o.KD),borderBottom:en>1?"1px solid ".concat(o.JH):void 0},children:(0,n.jsx)(d,{agentId:t,data:a,meta:r,assetsReady:O,panePrompts:u,onPanePromptChange:g,isOwner:m,isCollaborator:p,isSpectator:v,panePendingImages:h,onPanePendingImagesChange:b,suggestions:f,suggestText:x,onSuggestTextChange:M,onSubmit:C,onCancel:k,onFire:w,onApproval:T,onApprovePlan:y,onQuickApprove:A,onEndProject:E,onSuggest:I,onPreview:P,onReview:R,detectedBackends:U,onLoadMore:L,onPasteImage:N,onPasteText:j,onDropImage:S,reviewerOverlay:(null==_?void 0:_.sourceAgentId)===t&&D?D(_.reviewerAgentId):null,onReviewerLoadMore:(null==_?void 0:_.sourceAgentId)===t&&H?()=>H(_.reviewerAgentId):void 0,onApplyReviewFixes:(null==_?void 0:_.sourceAgentId)===t?X:void 0,onDismissReview:(null==_?void 0:_.sourceAgentId)===t?F:void 0,autoMerge:a.autoMerge,pendingMerge:a.pendingMerge,lastMergeCommit:a.lastMergeCommit,lastMergeMessage:a.lastMergeMessage,onMerge:K?()=>K(t):void 0,onRevert:q?()=>q(t):void 0,onUndoMerge:V?()=>V(t):void 0,scrollFrozen:Y})},t)}let{index:t}=e;return(0,n.jsx)("div",{className:"mpv-placeholder",style:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",position:"relative",borderLeft:"1px solid ".concat(o.JH),borderBottom:en>1?"1px solid ".concat(o.JH):void 0},children:t===ek&&G&&(0,n.jsx)("button",{onClick:G,title:"Hire an agent","aria-label":"Hire an agent",className:"mpv-placeholder-hire",children:(0,n.jsx)("span",{className:"mpv-placeholder-hire-icon",children:"+"})})},"placeholder-".concat(t))})},el),(0,n.jsx)("div",{className:"term-info-bar flex justify-center items-center px-3 py-1.5 font-mono text-[11px] text-muted-foreground bg-term-panel shrink-0 relative gap-2 border-t border-term-border-dim shadow-[0_-3px_8px_-2px_rgba(0,0,0,0.5),inset_0_1px_0_rgba(255,255,255,0.04)]",children:eg>1&&(0,n.jsx)("div",{className:"mpv-dots",children:Array.from({length:eg},(e,t)=>(0,n.jsx)("button",{className:"mpv-dot".concat(el===t?" mpv-dot-active":""),onClick:()=>ev(t),"aria-label":"Page ".concat(t+1)},t))})})]})})}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[368],{368:(e,t,r)=>{r.r(t),r.d(t,{default:()=>B});var l=r(206),i=r(1406),a=r(5195);function n(e,t,r,l){let i=r.length,n=i>0?r[0].length:0;if(t<0||t>=i||e<0||e>=n)return!1;let s=r[t][e];return!(s===a.nb.WALL||s===a.nb.VOID||l.has("".concat(e,",").concat(t)))}function s(e,t){let r=e.length,l=r>0?e[0].length:0,i=[];for(let a=0;a<r;a++)for(let r=0;r<l;r++)n(r,a,e,t)&&i.push({col:r,row:a});return i}let o=[{dc:0,dr:-1},{dc:0,dr:1},{dc:-1,dr:0},{dc:1,dr:0}];function c(e,t,r,l,i,a){if(e===r&&t===l||!n(r,l,i,a))return[];let s=t<<10|e,c=l<<10|r,h=new Set;h.add(s);let u=new Map,d=[e,t],f=0;for(;f<d.length;){let e=d[f++],t=d[f++],r=t<<10|e;if(r===c){let e=[],t=c;for(;t!==s;)e.push({col:1023&t,row:t>>10}),t=u.get(t);return e.reverse(),e}for(let l of o){let s=e+l.dc,o=t+l.dr,c=o<<10|s;!h.has(c)&&n(s,o,i,a)&&(h.add(c),u.set(c,r),d.push(s,o))}}return[]}var h=r(2243);let u=new Set(["Read","Grep","Glob","WebFetch","WebSearch"]);function d(e,t){return{x:e*a.dn+a.dn/2,y:t*a.dn+a.dn/2}}function f(e,t,r,l){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n=arguments.length>5?arguments[5]:void 0,s=l?l.seatCol:1,o=l?l.seatRow:1,c=d(s,o),u=null!=n?n:l?a.Lp.TYPE:a.Lp.IDLE;return{id:e,state:u,dir:l?l.facingDir:a.OP.DOWN,x:c.x,y:c.y,tileCol:s,tileRow:o,path:[],moveProgress:0,currentTool:null,palette:t,hueShift:i,frame:0,frameTimer:0,wanderTimer:u===a.Lp.IDLE?g(h.wj,h.k8):0,wanderCount:0,wanderLimit:m(h.Rb,h.he),isActive:u===a.Lp.TYPE,seatId:r,bubbleType:null,bubbleTimer:0,speechText:null,speechTimer:0,seatTimer:0,isSubagent:!1,parentAgentId:null,matrixEffect:null,matrixEffectTimer:0,matrixEffectSeeds:[],isExternal:!1,label:null,labelColor:null}}function g(e,t){return e+Math.random()*(t-e)}function m(e,t){return e+Math.floor(Math.random()*(t-e+1))}let b=Array(101),p=Array(101),w=Array(101);for(let e=0;e<101;e++){let t=(e/100).toFixed(2);b[e]="rgba(0,255,65,".concat(t,")"),p[e]="rgba(0,170,40,".concat(t,")"),w[e]="rgba(0,85,20,".concat(t,")")}function T(e){return b[Math.round(100*Math.min(1,Math.max(0,e)))]}function y(e,t){return e<h.Wn?T(t):e<h.WJ?p[Math.round(100*Math.min(1,Math.max(0,t)))]:w[Math.round(100*Math.min(1,Math.max(0,t)))]}function I(e,t,r){return(7*e+13*t+31*Math.floor(r*h.vU)&255)<h.gB}function C(){let e=[];for(let t=0;t<h.W3;t++)e.push(Math.random());return e}var x=r(9631),v=r(9892);class S{markDirty(){var e;this.dirty=!0,null==(e=this.onDirty)||e.call(this)}computeCharacterScale(){let e=Math.max(h.wh,h.YK),t=Math.max(this.layout.cols,this.layout.rows);return t<=e?1:Math.pow(t/e,.75)}setBackgroundImage(e){this.backgroundImage=e,this.markDirty()}setLayout(e){for(let t of(this.layout=e,this.tileMap=(0,x.MB)(e),this.characterScale=this.computeCharacterScale(),this.seats=(0,x.CW)(e.furniture),this.blockedTiles=(0,x.AI)(e.furniture),this.furniture=(0,x.Co)(e.furniture),this.walkableTiles=s(this.tileMap,this.blockedTiles),this.characters.values())){if(t.seatId){let e=this.seats.get(t.seatId);if(e)e.assigned=!0;else{t.seatId=null;let e=this.findFreeSeat();e&&(this.seats.get(e).assigned=!0,t.seatId=e)}}if(t.seatId){let e=this.seats.get(t.seatId);t.tileCol=e.seatCol,t.tileRow=e.seatRow,t.dir=e.facingDir}else if(this.walkableTiles.length>0){let e=this.walkableTiles[Math.floor(Math.random()*this.walkableTiles.length)];t.tileCol=e.col,t.tileRow=e.row}t.x=t.tileCol*a.dn+a.dn/2,t.y=t.tileRow*a.dn+a.dn/2,t.path=[],t.moveProgress=0}this.rebuildFurnitureInstances(),this.markDirty()}addCharacter(e,t,r,l,i,n){if(this.agentIdToCharId.has(e))return;let s=this.nextCharId++;this.agentIdToCharId.set(e,s),this.charIdToAgentId.set(s,e);let{palette:o,hueShift:c}=void 0!==r?{palette:r,hueShift:0}:this.pickDiversePalette(),h=this.walkableTiles.length>0?this.walkableTiles[Math.floor(Math.random()*this.walkableTiles.length)]:{col:1,row:1},u=f(s,o,null,null,c,a.Lp.IDLE);u.x=h.col*a.dn+a.dn/2,u.y=h.row*a.dn+a.dn/2,u.tileCol=h.col,u.tileRow=h.row,l&&(u.isExternal=!0),i&&(u.label=i),n&&(u.labelColor=n),u.matrixEffect="spawn",u.matrixEffectTimer=0,u.matrixEffectSeeds=C(),this.characters.set(s,u),this._charListDirty=!0,this.markDirty()}removeCharacter(e){let t=this.agentIdToCharId.get(e);if(void 0===t)return;let r=this.characters.get(t);if(r&&"despawn"!==r.matrixEffect){if(r.seatId){let e=this.seats.get(r.seatId);e&&(e.assigned=!1)}this.selectedCharId===t&&(this.selectedCharId=null),r.matrixEffect="despawn",r.matrixEffectTimer=0,r.matrixEffectSeeds=C(),r.bubbleType=null,this.markDirty()}}updateCharacterStatus(e,t,r){let l=this.agentIdToCharId.get(e);if(void 0===l)return;let i=this.characters.get(l);if(!i)return;this.markDirty();let a=i.isActive,n="working"===t||"waiting_approval"===t;if(i.isActive=n,r&&!i.seatId){if(i.restSeatId){let e=this.seats.get(i.restSeatId);e&&(e.assigned=!1),i.restSeatId=null,i.seatTimer=0}let e=this.findFreeSeat();e&&(this.seats.get(e).assigned=!0,i.seatId=e),this.rebuildFurnitureInstances()}if(!n&&a){if(r);else{if(i.seatId){let e=this.seats.get(i.seatId);e&&(e.assigned=!1),i.seatId=null}i.seatTimer=-1,i.path=[],i.moveProgress=0}this.rebuildFurnitureInstances()}else if(n&&!a){if(!i.seatId){if(i.restSeatId){let e=this.seats.get(i.restSeatId);e&&(e.assigned=!1),i.restSeatId=null,i.seatTimer=0}let e=this.findFreeSeat();e&&(this.seats.get(e).assigned=!0,i.seatId=e)}this.rebuildFurnitureInstances()}}selectCharacter(e){let t=this.selectedCharId;if(null===e)this.selectedCharId=null;else{let t=this.agentIdToCharId.get(e);this.selectedCharId=null!=t?t:null}this.selectedCharId!==t&&this.markDirty()}showBubble(e,t){let r=this.agentIdToCharId.get(e);if(void 0===r)return;let l=this.characters.get(r);l&&("permission"===t||"working"===t?(l.bubbleType=t,l.bubbleTimer=0):(l.bubbleType="waiting",l.bubbleTimer=h.WK),this.markDirty())}clearBubble(e){let t=this.agentIdToCharId.get(e);if(void 0===t)return;let r=this.characters.get(t);r&&("permission"===r.bubbleType||"working"===r.bubbleType?(r.bubbleType=null,r.bubbleTimer=0):"waiting"===r.bubbleType&&(r.bubbleTimer=Math.min(r.bubbleTimer,h.M_)),this.markDirty())}showSpeechBubble(e,t){let r=this.agentIdToCharId.get(e);if(void 0===r)return;let l=this.characters.get(r);l&&(l.speechText=t.length>h.lO?t.slice(0,h.lO)+"...":t,l.speechTimer=h.Jk,this.markDirty())}getCharacters(){return this._charListDirty&&(this._cachedChars=Array.from(this.characters.values()),this._charListDirty=!1),this._cachedChars}getLayout(){return this.layout}getSelectedCharId(){return this.selectedCharId}getHoveredCharId(){return this.hoveredCharId}getAgentId(e){var t;return null!=(t=this.charIdToAgentId.get(e))?t:null}getAgentAtPixel(e,t){let r=this.characterScale,l=this.getCharacters(),i=null,n=-1/0;for(let o of l){if("despawn"===o.matrixEffect)continue;let l=o.state===a.Lp.TYPE?h.iE:0,c=o.y+l,u=o.x-h.Ns*r,d=o.x+h.Ns*r,f=c-h.o3*r;if(e>=u&&e<=d&&t>=f&&t<=c&&o.y>n){var s;n=o.y,i=null!=(s=this.charIdToAgentId.get(o.id))?s:null}}return i}setHoveredCharAtPixel(e,t){let r=this.hoveredCharId,l=this.characterScale,i=this.getCharacters(),n=null,s=-1/0;for(let r of i){if("despawn"===r.matrixEffect)continue;let i=r.state===a.Lp.TYPE?h.iE:0,o=r.y+i,c=r.x-h.Ns*l,u=r.x+h.Ns*l,d=o-h.o3*l;e>=c&&e<=u&&t>=d&&t<=o&&r.y>s&&(s=r.y,n=r.id)}this.hoveredCharId=n,this.hoveredCharId!==r&&this.markDirty()}update(e){this.needsTick=!1;let t=[];for(let r of this.characters.values()){let l=r.x,i=r.y,n=r.state,s=r.frame,o=r.dir,u=r.bubbleType,f=r.speechText,b=r.matrixEffect,p=r.matrixEffectTimer;if(r.matrixEffect){r.matrixEffectTimer+=e,r.matrixEffectTimer>=a.Pz&&("spawn"===r.matrixEffect?(r.matrixEffect=null,r.matrixEffectTimer=0,r.matrixEffectSeeds=[]):t.push(r.id)),this.dirty=!0;continue}if(r.isActive&&!r.seatId&&r.state===a.Lp.IDLE){let e=this.findFreeSeat();e&&(this.seats.get(e).assigned=!0,r.seatId=e)}this.withOwnSeatUnblocked(r,()=>(function(e,t,r,l,i,n){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7?arguments[7]:void 0;switch(e.frameTimer+=t,e.state){case a.Lp.TYPE:if(e.frameTimer>=h.S3&&(e.frameTimer-=h.S3,e.frame=(e.frame+1)%2),!e.isActive){if(e.seatTimer>0){e.seatTimer-=t;break}e.seatTimer=0,e.state=a.Lp.IDLE,e.frame=0,e.frameTimer=0,e.wanderTimer=g(h.wj,h.k8),e.wanderCount=0,e.wanderLimit=m(h.Rb,h.he)}break;case a.Lp.IDLE:if(e.frame=0,e.seatTimer<0&&(e.seatTimer=0),e.isActive){if(e.restSeatId){let t=l.get(e.restSeatId);t&&(t.assigned=!1),e.restSeatId=null,e.seatTimer=0}if(!e.seatId)break;let t=l.get(e.seatId);if(t){let r=c(e.tileCol,e.tileRow,t.seatCol,t.seatRow,i,n);r.length>0?(e.path=r,e.moveProgress=0,e.state=a.Lp.WALK):(e.state=a.Lp.TYPE,e.dir=t.facingDir),e.frame=0,e.frameTimer=0}break}if(e.restSeatId&&e.seatTimer>0){if(e.seatTimer-=t,e.seatTimer<=0){e.seatTimer=0;let t=l.get(e.restSeatId);t&&(t.assigned=!1),e.restSeatId=null,e.wanderTimer=g(h.wj,h.k8)}break}if(e.wanderTimer-=t,e.wanderTimer<=0){if(e.wanderCount>=e.wanderLimit&&e.seatId){let t=e.restSeatId?l.get(e.restSeatId):null;t&&(t.assigned=!1),e.restSeatId=null;let r=l.get(e.seatId);if(r){let t=c(e.tileCol,e.tileRow,r.seatCol,r.seatRow,i,n);if(t.length>0){e.path=t,e.moveProgress=0,e.state=a.Lp.WALK,e.frame=0,e.frameTimer=0;break}}}if(o&&!e.restSeatId&&.3>Math.random()){let t=o();if(t){let r=l.get(t);if(r){let l="".concat(r.seatCol,",").concat(r.seatRow),s=n.has(l);s&&n.delete(l);let o=c(e.tileCol,e.tileRow,r.seatCol,r.seatRow,i,n);if(s&&n.add(l),o.length>0){r.assigned=!0,e.restSeatId=t,e.path=o,e.moveProgress=0,e.state=a.Lp.WALK,e.frame=0,e.frameTimer=0,e.wanderCount++;break}}}}if(r.length>0){let t=r[Math.floor(Math.random()*r.length)],l=c(e.tileCol,e.tileRow,t.col,t.row,i,n);l.length>0&&(e.path=l,e.moveProgress=0,e.state=a.Lp.WALK,e.frame=0,e.frameTimer=0,e.wanderCount++)}e.wanderTimer=g(h.wj,h.k8)}break;case a.Lp.WALK:{if(e.frameTimer>=h.lY&&(e.frameTimer-=h.lY,e.frame=(e.frame+1)%4),0===e.path.length){let t=d(e.tileCol,e.tileRow);if(e.x=t.x,e.y=t.y,e.isActive)if(e.seatId){let t=l.get(e.seatId);t&&e.tileCol===t.seatCol&&e.tileRow===t.seatRow?(e.state=a.Lp.TYPE,e.dir=t.facingDir):e.state=a.Lp.IDLE}else e.state=a.Lp.IDLE;else{if(e.restSeatId){let t=l.get(e.restSeatId);if(t&&e.tileCol===t.seatCol&&e.tileRow===t.seatRow){e.state=a.Lp.IDLE,e.dir=t.facingDir,e.seatTimer=g(h.Ot,h.Ww),e.frame=0,e.frameTimer=0;break}}if(e.seatId){let t=l.get(e.seatId);if(t&&e.tileCol===t.seatCol&&e.tileRow===t.seatRow){e.state=a.Lp.TYPE,e.dir=t.facingDir,e.seatTimer<0?e.seatTimer=0:e.seatTimer=g(h.Ot,h.Ww),e.wanderCount=0,e.wanderLimit=m(h.Rb,h.he),e.frame=0,e.frameTimer=0;break}}e.state=a.Lp.IDLE,e.wanderTimer=g(h.wj,h.k8)}e.frame=0,e.frameTimer=0;break}let r=e.path[0];e.dir=function(e,t,r,l){let i=r-e;return i>0?a.OP.RIGHT:i<0?a.OP.LEFT:l-t>0?a.OP.DOWN:a.OP.UP}(e.tileCol,e.tileRow,r.col,r.row),e.moveProgress+=h.XE/a.dn*t*s;let o=d(e.tileCol,e.tileRow),u=d(r.col,r.row),f=Math.min(e.moveProgress,1);if(e.x=o.x+(u.x-o.x)*f,e.y=o.y+(u.y-o.y)*f,e.moveProgress>=1&&(e.tileCol=r.col,e.tileRow=r.row,e.x=u.x,e.y=u.y,e.path.shift(),e.moveProgress=0),e.isActive&&e.seatId){let t=l.get(e.seatId);if(t){let r=e.path[e.path.length-1];if(!r||r.col!==t.seatCol||r.row!==t.seatRow){let r=c(e.tileCol,e.tileRow,t.seatCol,t.seatRow,i,n);r.length>0&&(e.path=r,e.moveProgress=0)}}}}}})(r,e,this.walkableTiles,this.seats,this.tileMap,this.blockedTiles,this.characterScale,()=>this.findFreeRestSeat())),"waiting"===r.bubbleType&&(r.bubbleTimer-=e,r.bubbleTimer<=0&&(r.bubbleType=null,r.bubbleTimer=0)),r.speechText&&(r.speechTimer-=e,r.speechTimer<=0&&(r.speechText=null,r.speechTimer=0)),(r.x!==l||r.y!==i||r.state!==n||r.frame!==s||r.dir!==o||r.bubbleType!==u||r.speechText!==f||r.matrixEffect!==b||r.matrixEffectTimer!==p)&&(this.dirty=!0),!this.needsTick&&(r.state===a.Lp.IDLE&&(r.wanderTimer>0||r.seatTimer>0)||r.state===a.Lp.TYPE&&!r.isActive&&r.seatTimer>0||"waiting"===r.bubbleType&&r.bubbleTimer>0||r.speechText&&r.speechTimer>0)&&(this.needsTick=!0)}for(let e of(t.length>0&&(this.dirty=!0,this._charListDirty=!0),t)){let t=this.charIdToAgentId.get(e);this.characters.delete(e),t&&(this.agentIdToCharId.delete(t),this.charIdToAgentId.delete(e))}}spawnTestCharacters(){this.clearTestCharacters();let e=0;for(let[t,r]of this.seats){if(r.isRest||r.assigned)continue;let l="__test_".concat(e),i=this.nextCharId++;this.agentIdToCharId.set(l,i),this.charIdToAgentId.set(i,l);let n=e%h.ic;r.assigned=!0;let s=f(i,n,t,r,0,a.Lp.TYPE);s.isActive=!0,this.characters.set(i,s),e++}this._charListDirty=!0,this.rebuildFurnitureInstances()}clearTestCharacters(){let e=[];for(let[t,r]of this.agentIdToCharId){if(!t.startsWith("__test_"))continue;let l=this.characters.get(r);if(null==l?void 0:l.seatId){let e=this.seats.get(l.seatId);e&&(e.assigned=!1)}this.characters.delete(r),this.charIdToAgentId.delete(r),e.push(t)}for(let t of e)this.agentIdToCharId.delete(t);e.length>0&&(this._charListDirty=!0,this.rebuildFurnitureInstances())}hasTestCharacters(){for(let e of this.agentIdToCharId.keys())if(e.startsWith("__test_"))return!0;return!1}findFreeSeat(){for(let[e,t]of this.seats)if(!t.assigned&&!t.isRest)return e;return null}findFreeRestSeat(){let e=[...this.seats.entries()].filter(e=>{let[,t]=e;return t.isRest&&!t.assigned});if(0===e.length)return null;let[t]=e[Math.floor(Math.random()*e.length)];return t}pickDiversePalette(){let e=Array(h.ic).fill(0);for(let t of this.characters.values())!t.isSubagent&&e[t.palette]++;let t=Math.min(...e),r=[];for(let l=0;l<h.ic;l++)e[l]===t&&r.push(l);let l=r[Math.floor(Math.random()*r.length)],i=0;return t>0&&(i=h.qt+Math.floor(Math.random()*h.p7)),{palette:l,hueShift:i}}ownSeatKey(e){if(!e.seatId)return null;let t=this.seats.get(e.seatId);return t?"".concat(t.seatCol,",").concat(t.seatRow):null}withOwnSeatUnblocked(e,t){let r=this.ownSeatKey(e),l=e.restSeatId?(()=>{let t=this.seats.get(e.restSeatId);return t?"".concat(t.seatCol,",").concat(t.seatRow):null})():null;r&&this.blockedTiles.delete(r),l&&this.blockedTiles.delete(l);let i=t();return r&&this.blockedTiles.add(r),l&&this.blockedTiles.add(l),i}rebuildFurnitureInstances(){let e=new Set;for(let t of this.characters.values()){if(!t.isActive||!t.seatId)continue;let r=this.seats.get(t.seatId);if(!r)continue;let l=r.facingDir===a.OP.RIGHT?1:r.facingDir===a.OP.LEFT?-1:0,i=r.facingDir===a.OP.DOWN?1:r.facingDir===a.OP.UP?-1:0;for(let t=1;t<=h.Xo;t++)e.add("".concat(r.seatCol+l*t,",").concat(r.seatRow+i*t));for(let t=1;t<=h.ou;t++){let a=r.seatCol+l*t,n=r.seatRow+i*t;0!==l?(e.add("".concat(a,",").concat(n-1)),e.add("".concat(a,",").concat(n+1))):(e.add("".concat(a-1,",").concat(n)),e.add("".concat(a+1,",").concat(n)))}}if(0===e.size){this.furniture=(0,x.Co)(this.layout.furniture);return}let t=this.layout.furniture.map(t=>{let r=(0,v.Um)(t.type);if(!r)return t;for(let l=0;l<r.footprintH;l++)for(let i=0;i<r.footprintW;i++)if(e.has("".concat(t.col+i,",").concat(t.row+l))){let e=(0,v.xr)(t.type);if(e!==t.type)return{...t,type:e};return t}return t});this.furniture=(0,x.Co)(t)}constructor(e){this.backgroundImage=null,this.characters=new Map,this.selectedCharId=null,this.hoveredCharId=null,this.characterScale=1,this.dirty=!0,this.needsTick=!1,this.onDirty=null,this._cachedChars=[],this._charListDirty=!0,this.agentIdToCharId=new Map,this.charIdToAgentId=new Map,this.nextCharId=1,this.layout=e||(0,x.kr)(),this.tileMap=(0,x.MB)(this.layout),this.seats=(0,x.CW)(this.layout.furniture),this.blockedTiles=(0,x.AI)(this.layout.furniture),this.furniture=(0,x.Co)(this.layout.furniture),this.walkableTiles=s(this.tileMap,this.blockedTiles),this.characterScale=this.computeCharacterScale()}}var k=r(5702),M=r(2988),R=r(4777),E=r(5055);let L=new Map;function A(e,t,r){let l="".concat(r,"|").concat(t),i=L.get(l);if(void 0!==i)return i;if(e.font=r,i=Math.ceil(e.measureText(t).width),L.size>=200){let e=100;for(let t of L.keys()){if(e--<=0)break;L.delete(t)}}return L.set(l,i),i}var P=r(4932),D=r(4296),F=r(1204);class Y{wake(){var e;null==(e=this.wakeLoop)||e.call(this)}addAgent(e,t){this.officeState.addCharacter(e,t.name,t.palette,t.isExternal,t.label,t.labelColor),this.wake()}removeAgent(e){this.officeState.removeCharacter(e),this.wake()}updateAgent(e,t,r,l){this.officeState.updateCharacterStatus(e,t,l),r?this.officeState.showBubble(e,r):this.officeState.clearBubble(e),this.wake()}showSpeechBubble(e,t){this.officeState.showSpeechBubble(e,t),this.wake()}selectAgent(e){this.officeState.selectCharacter(e),this.wake()}dispose(){var e;null==(e=this.stopLoop)||e.call(this),this.stopLoop=null,this.wakeLoop=null}getOfficeState(){return this.officeState}constructor(e,t,r){this.officeState=e,this.stopLoop=t,this.wakeLoop=null!=r?r:null}}function B(e){let{onAdapterReady:t,onAgentClick:r,editMode:n,editorRef:s,onTileClick:o,onTileRightClick:c,onGhostMove:d,onDragStart:f,onDragMove:g,onDragEnd:m,onDeleteBtnClick:b,onRotateBtnClick:p,officeStateRef:w,onAssetsLoaded:C,zoomRef:x,panRef:L}=e,B=(0,i.useRef)(null),[W,X]=(0,i.useState)(!1),_=(0,i.useRef)(r);_.current=r;let O=(0,i.useRef)(C);O.current=C;let U=(0,i.useRef)(n);U.current=n;let z=(0,i.useRef)(!1),H=(0,i.useRef)({x:0,y:0,panX:0,panY:0}),N=(0,i.useRef)({offsetX:0,offsetY:0}),V=(0,i.useRef)(null),j=(0,i.useRef)(null),q=(0,i.useCallback)((e,t)=>{let r=w.current;if(!r)return 4;let l=r.layout.cols*h.dn,i=r.layout.rows*h.dn;return Math.max(h.DH,Math.min(e/l,t/i))},[w]),K=(0,i.useCallback)(()=>{let e=B.current;if(!e)return;let t=e.parentElement;if(!t)return;let r=window.devicePixelRatio||1,l=t.clientWidth,i=t.clientHeight;e.width=l*r,e.height=i*r,e.style.width="".concat(l,"px"),e.style.height="".concat(i,"px");let a=e.getContext("2d");a&&a.scale(r,r),x.current=q(l,i),L.current={x:0,y:0}},[q,x,L]);(0,i.useEffect)(()=>{let e=!1;return(0,D.F)().then(t=>{e||((0,v.ar)(t.tilesetSprites),X(!0))}).catch(t=>{console.warn("[PixelOfficeScene] Asset loading failed, using fallbacks:",t),e||X(!0)}),()=>{e=!0}},[]),(0,i.useEffect)(()=>{var e;let r,l,i,n,o,c;if(!W)return;let d=B.current;if(!d)return;let f=new S;w.current=f,null==(e=O.current)||e.call(O),K();let g=new ResizeObserver(()=>K());d.parentElement&&g.observe(d.parentElement);let m=window.devicePixelRatio||1,{stop:b,wake:p}=function(e,t){let r=e.getContext("2d");r.imageSmoothingEnabled=!1;let l=0,i=0,a=!1,n=!0,s=0,o=!1,c=new ResizeObserver(()=>{n=!0,d()});c.observe(e);let u=e=>{if(a)return;o=!1;let c=0===l?0:Math.min((e-l)/1e3,h.O9);if(l=e,t.update(c),n||!t.isDirty||t.isDirty()?(s=0,n=!1,r.imageSmoothingEnabled=!1,t.render(r)):s++,s>=10){var d;if(null==(d=t.needsTick)?void 0:d.call(t)){i=requestAnimationFrame(u);return}o=!0,l=0;return}i=requestAnimationFrame(u)};function d(){if(!a){if(!o){s=0;return}o=!1,s=0,i=requestAnimationFrame(u)}}return i=requestAnimationFrame(u),{stop:()=>{a=!0,cancelAnimationFrame(i),c.disconnect()},wake:d}}(d,{update:e=>{f.update(e)},isDirty:(r=0,l=0,i=0,n=-1,o=-1,c=null,()=>{let e=x.current,t=L.current.x,a=L.current.y,h=e!==r||t!==l||a!==i;if(r=e,l=t,i=a,f.dirty||h)return f.dirty=!1,!0;if(U.current){let e=s.current,t=e.ghostCol!==n||e.ghostRow!==o,r=e.selectedFurnitureUid!==c;return n=e.ghostCol,o=e.ghostRow,c=e.selectedFurnitureUid,t||r}return!1}),needsTick:()=>f.needsTick,render:e=>{let t,r=d.width/m,l=d.height/m,i=x.current,n=L.current,o=s.current;if(U.current){let e=null;if(o.activeTool===a.VF.FURNITURE_PLACE&&o.selectedFurnitureType){let t=(0,v.Um)(o.selectedFurnitureType);t&&(e=t.sprite)}if(o.dragUid){let t=f.layout.furniture.find(e=>e.uid===o.dragUid);if(t){let r=(0,v.Um)(t.type);r&&(e=r.sprite)}}let r=!1,l=0,i=0,n=1,s=1,h=!1;if(o.selectedFurnitureUid){let e=f.layout.furniture.find(e=>e.uid===o.selectedFurnitureUid);if(e){var c,g;let t=(0,v.Um)(e.type);r=!0,l=e.col,i=e.row,n=null!=(c=null==t?void 0:t.footprintW)?c:1,s=null!=(g=null==t?void 0:t.footprintH)?g:1,h=(0,v.ZZ)(e.type)}}t={showGrid:!0,ghostSprite:e,ghostCol:o.ghostCol,ghostRow:o.ghostRow,ghostValid:o.ghostValid,hasSelection:r,selectedCol:l,selectedRow:i,selectedW:n,selectedH:s,isRotatable:h,deleteButtonBounds:null,rotateButtonBounds:null,showGhostBorder:!0,ghostBorderHoverCol:o.ghostCol,ghostBorderHoverRow:o.ghostRow}}N.current=function(e,t,r,l,i,n,s,o,c,d,f,g,m,b,p,w,C){let x=null!=C?C:1;e.clearRect(0,0,t,r);let v=null!=m?m:l.length>0?l[0].length:0,S=null!=b?b:l.length,L=v*a.dn*s,P=S*a.dn*s,D=Math.floor((t-L)/2)+Math.round(o),F=Math.floor((r-P)/2)+Math.round(c);w&&(e.save(),e.imageSmoothingEnabled=!1,e.drawImage(w,D,F,L,P),e.restore()),w||function(e,t,r,l,i,n,s){let o=a.dn*i,c=(0,R.$0)(),u=t.length,d=u>0?t[0].length:0,f=null!=s?s:d;for(let s=0;s<u;s++)for(let u=0;u<d;u++){var g;let d=t[s][u];if(d===a.nb.VOID)continue;if(d===a.nb.WALL||!c){if(d===a.nb.WALL){let t=s*f+u,r=null==n?void 0:n[t];e.fillStyle=r?(0,E.og)(r):R.ty}else e.fillStyle=h.q3;e.fillRect(r+u*o,l+s*o,o,o);continue}let m=s*f+u,b=null!=(g=null==n?void 0:n[m])?g:{h:0,s:0,b:0,c:0},p=(0,R.To)(d,b),w=(0,k.k)(p,i);e.drawImage(w,r+u*o,l+s*o)}}(e,l,D,F,s,g,m);let Y=!w&&(0,E.BN)()?(0,E.vb)(l,g,m):[];return!function(e,t,r,l,i,n,s,o){let c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,d=[],f=n*c;for(let e of t){let t=(0,k.k)(e.sprite,n),r=l+e.x*n,a=i+e.y*n;d.push({zY:e.zY,draw:e=>{e.drawImage(t,r,a)}})}for(let e of r){let t=(0,M.Ih)(e.palette,e.hueShift),r=function(e,t){switch(e.state){case a.Lp.TYPE:var r;if((r=e.currentTool)&&u.has(r))return t.reading[e.dir][e.frame%2];return t.typing[e.dir][e.frame%2];case a.Lp.WALK:return t.walk[e.dir][e.frame%4];case a.Lp.IDLE:default:return t.walk[e.dir][1]}}(e,t),c=(0,k.k)(r,f),g=e.state===a.Lp.TYPE?h.iE:0,m=Math.round(l+e.x*n-c.width/2),b=Math.round(i+(e.y+g)*n-c.height),p=e.y+a.dn/2+h.Sg;if(e.matrixEffect){let t=e;d.push({zY:p,draw:e=>{!function(e,t,r,l,i,n){let s=t.matrixEffectTimer/a.Pz,o="spawn"===t.matrixEffect,c=t.matrixEffectTimer,u=h.wN+h.M1;for(let a=0;a<h.W3;a++){var d,f;let g=Math.max(0,Math.min(1,(s-(null!=(d=t.matrixEffectSeeds[a])?d:0)*h.hI)/(1-h.hI)))*u;for(let t=0;t<h.wN;t++){let s=null==(f=r[t])?void 0:f[a],u=s&&""!==s,d=g-t,m=l+a*n,b=i+t*n;if(o)if(d<0)continue;else if(d<1)e.fillStyle=h.zw,e.fillRect(m,b,n,n);else if(d<h.M1){let r=d/h.M1;if(u){e.fillStyle=s,e.fillRect(m,b,n,n);let l=(1-r)*h.Nd;I(a,t,c)&&(e.fillStyle=T(l),e.fillRect(m,b,n,n))}else if(I(a,t,c)){let t=(1-r)*h.gi;e.fillStyle=y(r,t),e.fillRect(m,b,n,n)}}else u&&(e.fillStyle=s,e.fillRect(m,b,n,n));else if(d<0)u&&(e.fillStyle=s,e.fillRect(m,b,n,n));else if(d<1)e.fillStyle=h.zw,e.fillRect(m,b,n,n);else if(d<h.M1&&I(a,t,c)){let t=d/h.M1,r=(1-t)*h.gi;e.fillStyle=y(t,r),e.fillRect(m,b,n,n)}}}}(e,t,r,m,b,f)}});continue}let w=null!==s&&e.id===s,C=null!==o&&e.id===o;if(w||C){let e=w?h.O1:h.y9,t=(0,k.Y)(r),l=(0,k.k)(t,f),i=m-f,a=b-f;d.push({zY:p-h.F2,draw:t=>{t.save(),t.globalAlpha=e,t.drawImage(l,i,a),t.restore()}})}d.push({zY:p,draw:e=>{e.drawImage(c,m,b)}})}for(let t of(d.sort((e,t)=>e.zY-t.zY),d))t.draw(e)}(e,Y.length>0?[...Y,...i]:i,n,D,F,s,d,f,x),!function(e,t,r,l,i){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=i*n,o=Math.max(1,Math.round(s));for(let u of t){var c;if(!u.label||"despawn"===u.matrixEffect)continue;let t=Math.max(6,Math.round(3.5*s)),d="bold ".concat(t,"px monospace"),f=A(e,u.label,d);e.save(),e.imageSmoothingEnabled=!1,e.font=d;let g=2*o,m=+o,b=f+2*g,p=t+2*m,w=u.state===a.Lp.TYPE?h.PA:0,T=Math.round(r+u.x*i-b/2),y=Math.round(l+(u.y+w-26*n)*i-p),I=null!=(c=u.labelColor)?c:"#8a7a6a";e.fillStyle="#222",e.fillRect(T-o,y,b+2*o,p+o),e.fillRect(T,y-o,b,p+2*o),e.fillStyle=I,e.fillRect(T,y,b,p),e.fillStyle="#fff",e.textBaseline="top",e.fillText(u.label,T+g,y+m),e.restore()}}(e,n,D,F,s,x),!function(e,t,r,l,i){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=i*n;for(let o of t){if(!o.bubbleType)continue;let t="permission"===o.bubbleType?M.$D:"working"===o.bubbleType?M.j9:M.VQ,c=1;"waiting"===o.bubbleType&&o.bubbleTimer<h.v3&&(c=o.bubbleTimer/h.v3);let u=(0,k.k)(t,s),d=o.state===a.Lp.TYPE?h.PA:0,f=Math.round(r+o.x*i-u.width/2),g=Math.round(l+(o.y+d-h.$L*n)*i-u.height-i);e.save(),c<1&&(e.globalAlpha=c),e.drawImage(u,f,g),e.restore()}}(e,n,D,F,s,x),!function(e,t,r,l,i){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=i*n,o=Math.max(1,Math.round(s));for(let c of t){if(!c.speechText)continue;let t=1;if(c.speechTimer<h.nW&&(t=Math.max(0,c.speechTimer/h.nW)),t<=0)continue;let u=Math.max(7,Math.round(4.5*s)),d="".concat(u,"px monospace"),f=A(e,c.speechText,d);e.save(),e.imageSmoothingEnabled=!1,e.font=d;let g=3*o,m=2*o,b=f+2*g,p=u+2*m,w=3*o,T=c.state===a.Lp.TYPE?h.PA:0,y=Math.round(r+c.x*i-b/2),I=Math.round(l+(c.y+T-h.$L*n)*i-p-w-4*o);t<1&&(e.globalAlpha=t),e.fillStyle="#333",e.fillRect(y-o,I,b+2*o,p+o),e.fillRect(y,I-o,b,p+2*o),e.fillStyle="#fff",e.fillRect(y,I,b,p);let C=Math.round(y+b/2);e.fillStyle="#333",e.fillRect(C-2*o,I+p,4*o,o),e.fillRect(C-o,I+p+o,2*o,o),e.fillRect(C,I+p+2*o,o,o),e.fillStyle="#fff",e.fillRect(C-o,I+p,2*o,o),e.fillRect(C,I+p+o,o,o),e.fillStyle="#222",e.textBaseline="top",e.fillText(c.speechText,y+g,I+m),e.restore()}}(e,n,D,F,s,x),p&&(p.showGrid&&function(e,t,r,l,i,n,s){let o=a.dn*l;e.strokeStyle=h.AL,e.lineWidth=1,e.beginPath();for(let l=0;l<=i;l++){let i=t+l*o+.5;e.moveTo(i,r),e.lineTo(i,r+n*o)}for(let l=0;l<=n;l++){let a=r+l*o+.5;e.moveTo(t,a),e.lineTo(t+i*o,a)}if(e.stroke(),s){e.save(),e.strokeStyle=h.fJ,e.lineWidth=1,e.setLineDash(h.i);for(let l=0;l<n;l++)for(let n=0;n<i;n++){var c;(null==(c=s[l])?void 0:c[n])===a.nb.VOID&&e.strokeRect(t+n*o+.5,r+l*o+.5,o-1,o-1)}e.restore()}}(e,D,F,s,v,S,l),p.showGhostBorder&&function(e,t,r,l,i,n,s,o){let c=a.dn*l;e.save();let u=[];for(let e=-1;e<=i;e++)u.push({c:e,r:-1}),u.push({c:e,r:n});for(let e=0;e<n;e++)u.push({c:-1,r:e}),u.push({c:i,r:e});for(let{c:l,r:i}of u){let a=t+l*c,n=r+i*c,u=l===s&&i===o;u&&(e.fillStyle=h.Mo,e.fillRect(a,n,c,c)),e.strokeStyle=u?h.pr:h.gD,e.lineWidth=1,e.setLineDash(h.i),e.strokeRect(a+.5,n+.5,c-1,c-1)}e.restore()}(e,D,F,s,v,S,p.ghostBorderHoverCol,p.ghostBorderHoverRow),p.ghostSprite&&p.ghostCol>=0&&function(e,t,r,l,i,n,s,o){let c=(0,k.k)(t,o),u=n+r*a.dn*o,d=s+l*a.dn*o;e.save(),e.globalAlpha=h.qD,e.drawImage(c,u,d),e.globalAlpha=h.W7,e.fillStyle=i?h.TE:h.oj,e.fillRect(u,d,c.width,c.height),e.restore()}(e,p.ghostSprite,p.ghostCol,p.ghostRow,p.ghostValid,D,F,s),p.hasSelection?(!function(e,t,r,l,i,n,s,o){let c=a.dn*o;e.save(),e.strokeStyle=h.Ii,e.lineWidth=2,e.setLineDash(h.n6),e.strokeRect(n+t*c+1,s+r*c+1,l*c-2,i*c-2),e.restore()}(e,p.selectedCol,p.selectedRow,p.selectedW,p.selectedH,D,F,s),p.deleteButtonBounds=function(e,t,r,l,i,n,s,o){let c=a.dn*o,u=n+(t+l)*c+1,d=s+r*c-1,f=Math.max(h.l0,o*h.YX);e.save(),e.beginPath(),e.arc(u,d,f,0,2*Math.PI),e.fillStyle=h.Zz,e.fill(),e.strokeStyle="#fff",e.lineWidth=Math.max(h.SS,o*h.zY),e.lineCap="round";let g=f*h.R_;return e.beginPath(),e.moveTo(u-g,d-g),e.lineTo(u+g,d+g),e.moveTo(u+g,d-g),e.lineTo(u-g,d+g),e.stroke(),e.restore(),{cx:u,cy:d,radius:f}}(e,p.selectedCol,p.selectedRow,p.selectedW,p.selectedH,D,F,s),p.isRotatable?p.rotateButtonBounds=function(e,t,r,l,i,n,s,o){let c=a.dn*o,u=Math.max(h.l0,o*h.YX),d=n+t*c-1,f=s+r*c-1;e.save(),e.beginPath(),e.arc(d,f,u,0,2*Math.PI),e.fillStyle=h.BD,e.fill(),e.strokeStyle="#fff",e.lineWidth=Math.max(h.SS,o*h.zY),e.lineCap="round";let g=u*h.R_;e.beginPath(),e.arc(d,f,g,-(.8*Math.PI),.7*Math.PI),e.stroke();let m=.7*Math.PI,b=d+g*Math.cos(m),p=f+g*Math.sin(m),w=.35*u;return e.beginPath(),e.moveTo(b+.6*w,p-.3*w),e.lineTo(b,p),e.lineTo(b+.7*w,p+.5*w),e.stroke(),e.restore(),{cx:d,cy:f,radius:u}}(e,p.selectedCol,p.selectedRow,p.selectedW,p.selectedH,D,F,s):p.rotateButtonBounds=null):(p.deleteButtonBounds=null,p.rotateButtonBounds=null)),{offsetX:D,offsetY:F}}(e,r,l,f.tileMap,f.furniture,f.getCharacters(),i,n.x,n.y,f.getSelectedCharId(),f.getHoveredCharId(),f.layout.tileColors,f.layout.cols,f.layout.rows,t,f.backgroundImage,f.characterScale),V.current=null!=t?t:null}});j.current=p,f.onDirty=p;let C=new Y(f,b,p);return t(C),()=>{C.dispose(),w.current=null,g.disconnect()}},[W,K,w,x,L,s,t]);let G=(0,i.useCallback)((e,t)=>{let r=B.current;if(!r)return{x:0,y:0};let l=r.getBoundingClientRect(),i=x.current,{offsetX:a,offsetY:n}=N.current;return{x:(e-l.left-a)/i,y:(t-l.top-n)/i}},[x]),Z=(0,i.useCallback)((e,t)=>({col:Math.floor(e/h.dn),row:Math.floor(t/h.dn)}),[]),$=(0,i.useCallback)((e,t)=>{let r=G(e,t);return Z(r.x,r.y)},[G,Z]),J=(0,i.useCallback)(e=>{if(z.current=!0,H.current={x:e.clientX,y:e.clientY,panX:L.current.x,panY:L.current.y},U.current&&s.current.selectedFurnitureUid){var t;let r=$(e.clientX,e.clientY),l=null==(t=w.current)?void 0:t.layout;if(l){let e=(0,F.iH)(l,r.col,r.row);e&&e.uid===s.current.selectedFurnitureUid&&(null==f||f(r.col,r.row))}}},[L,s,w,$,f]),Q=(0,i.useCallback)(e=>{var t,r;let l=w.current;if(l&&!U.current){let t=G(e.clientX,e.clientY);l.setHoveredCharAtPixel(t.x,t.y),l.dirty&&(null==(r=j.current)||r.call(j))}if(U.current){let t=$(e.clientX,e.clientY);s.current.dragUid?null==g||g(t.col,t.row):null==d||d(t.col,t.row)}if(!z.current||!h.eR||s.current.dragUid)return;let i=e.clientX-H.current.x,a=e.clientY-H.current.y;L.current={x:H.current.panX+i,y:H.current.panY+a},null==(t=j.current)||t.call(j)},[G,$,w,L,s,g,d]),ee=(0,i.useCallback)(e=>{let t=z.current;if(z.current=!1,s.current.dragUid){let t=$(e.clientX,e.clientY);null==m||m(t.col,t.row);return}let r=Math.abs(e.clientX-H.current.x),l=Math.abs(e.clientY-H.current.y);if(t&&(r>5||l>5))return;let i=w.current;if(!i)return;if(U.current){let t=V.current;if(t){let r=B.current;if(r){let l=r.getBoundingClientRect(),i=e.clientX-l.left,a=e.clientY-l.top;if(t.deleteButtonBounds){let{cx:e,cy:r,radius:l}=t.deleteButtonBounds;if(Math.sqrt((i-e)**2+(a-r)**2)<=l){null==b||b();return}}if(t.rotateButtonBounds){let{cx:e,cy:r,radius:l}=t.rotateButtonBounds;if(Math.sqrt((i-e)**2+(a-r)**2)<=l){null==p||p();return}}}}let r=$(e.clientX,e.clientY);null==o||o(r.col,r.row);return}let a=G(e.clientX,e.clientY),n=i.getAgentAtPixel(a.x,a.y);n&&_.current(n)},[G,$,w,s,o,m,b,p]),et=(0,i.useCallback)(e=>{if(!U.current)return;e.preventDefault();let t=$(e.clientX,e.clientY);null==c||c(t.col,t.row)},[$,c]),er=(0,i.useCallback)(e=>{},[]),el=(0,i.useRef)([]),ei=(0,i.useRef)(0),ea=(0,i.useCallback)(e=>{if(el.current=Array.from(e.touches),2===e.touches.length){let t=e.touches[0].clientX-e.touches[1].clientX,r=e.touches[0].clientY-e.touches[1].clientY;ei.current=Math.sqrt(t*t+r*r)}else 1===e.touches.length&&(z.current=!0,H.current={x:e.touches[0].clientX,y:e.touches[0].clientY,panX:L.current.x,panY:L.current.y})},[L]),en=(0,i.useCallback)(e=>{var t,r;if(2===e.touches.length){let r=e.touches[0].clientX-e.touches[1].clientX,l=e.touches[0].clientY-e.touches[1].clientY,i=Math.sqrt(r*r+l*l),a=i-ei.current;Math.abs(a)>20&&(x.current=Math.max(h.DH,Math.min(h.ZV,x.current+(a>0?1:-1))),ei.current=i,null==(t=j.current)||t.call(j))}else if(1===e.touches.length&&z.current&&h.eR){let t=e.touches[0].clientX-H.current.x,l=e.touches[0].clientY-H.current.y;L.current={x:H.current.panX+t,y:H.current.panY+l},null==(r=j.current)||r.call(j)}},[x,L]),es=(0,i.useCallback)(e=>{if(0===e.touches.length&&1===el.current.length){let e=el.current[0],t=Math.abs(e.clientX-H.current.x),r=Math.abs(e.clientY-H.current.y);if(t<10&&r<10)if(U.current){let t=$(e.clientX,e.clientY);null==o||o(t.col,t.row)}else{let t=w.current;if(t){let r=G(e.clientX,e.clientY),l=t.getAgentAtPixel(r.x,r.y);l&&_.current(l)}}}z.current=!1,el.current=Array.from(e.touches)},[G,$,w,o]),eo=n?s.current.activeTool===a.VF.ERASE?"crosshair":s.current.activeTool===a.VF.EYEDROPPER?"copy":s.current.activeTool===a.VF.FURNITURE_PLACE?"cell":s.current.dragUid?"grabbing":"default":"grab";return(0,l.jsxs)("div",{style:{width:"100%",height:"100%",overflow:"hidden",backgroundColor:P.lr},children:[!W&&(0,l.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:"#6b7280",fontSize:14,fontFamily:"system-ui, sans-serif",zIndex:10},children:"Loading office..."}),(0,l.jsx)("canvas",{ref:B,onPointerDown:J,onPointerMove:Q,onPointerUp:ee,onContextMenu:et,onWheel:er,onTouchStart:ea,onTouchMove:en,onTouchEnd:es,style:{display:"block",width:"100%",height:"100%",touchAction:"none",cursor:eo}})]})}},5702:(e,t,r)=>{r.d(t,{Y:()=>a,k:()=>n});let l=new Map,i=new WeakMap;function a(e){let t=i.get(e);if(t)return t;let r=e.length,l=e[0].length,a=[];for(let e=0;e<r+2;e++)a.push(Array(l+2).fill(""));for(let t=0;t<r;t++)for(let r=0;r<l;r++){if(""===e[t][r])continue;let l=t+1,i=r+1;""===a[l-1][i]&&(a[l-1][i]="#FFFFFF"),""===a[l+1][i]&&(a[l+1][i]="#FFFFFF"),""===a[l][i-1]&&(a[l][i-1]="#FFFFFF"),""===a[l][i+1]&&(a[l][i+1]="#FFFFFF")}for(let t=0;t<r;t++)for(let r=0;r<l;r++)""!==e[t][r]&&(a[t+1][r+1]="");return i.set(e,a),a}function n(e,t){let r=Math.round(100*t)/100,i=l.get(r);i||(i=new WeakMap,l.set(r,i));let a=i.get(e);if(a)return a;let n=e.length,s=e[0].length,o=document.createElement("canvas");o.width=s*r,o.height=n*r;let c=o.getContext("2d");c.imageSmoothingEnabled=!1;for(let t=0;t<n;t++)for(let l=0;l<s;l++){let i=e[t][l];""!==i&&(c.fillStyle=i,c.fillRect(l*r,t*r,r,r))}return i.set(e,o),o}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[368],{368:(e,t,r)=>{r.r(t),r.d(t,{default:()=>B});var l=r(206),i=r(1406),a=r(5195);function n(e,t,r,l){let i=r.length,n=i>0?r[0].length:0;if(t<0||t>=i||e<0||e>=n)return!1;let s=r[t][e];return!(s===a.nb.WALL||s===a.nb.VOID||l.has("".concat(e,",").concat(t)))}function s(e,t){let r=e.length,l=r>0?e[0].length:0,i=[];for(let a=0;a<r;a++)for(let r=0;r<l;r++)n(r,a,e,t)&&i.push({col:r,row:a});return i}let o=[{dc:0,dr:-1},{dc:0,dr:1},{dc:-1,dr:0},{dc:1,dr:0}];function c(e,t,r,l,i,a){if(e===r&&t===l||!n(r,l,i,a))return[];let s=t<<10|e,c=l<<10|r,h=new Set;h.add(s);let u=new Map,d=[e,t],f=0;for(;f<d.length;){let e=d[f++],t=d[f++],r=t<<10|e;if(r===c){let e=[],t=c;for(;t!==s;)e.push({col:1023&t,row:t>>10}),t=u.get(t);return e.reverse(),e}for(let l of o){let s=e+l.dc,o=t+l.dr,c=o<<10|s;!h.has(c)&&n(s,o,i,a)&&(h.add(c),u.set(c,r),d.push(s,o))}}return[]}var h=r(2243);let u=new Set(["Read","Grep","Glob","WebFetch","WebSearch"]);function d(e,t){return{x:e*a.dn+a.dn/2,y:t*a.dn+a.dn/2}}function f(e,t,r,l){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n=arguments.length>5?arguments[5]:void 0,s=l?l.seatCol:1,o=l?l.seatRow:1,c=d(s,o),u=null!=n?n:l?a.Lp.TYPE:a.Lp.IDLE;return{id:e,state:u,dir:l?l.facingDir:a.OP.DOWN,x:c.x,y:c.y,tileCol:s,tileRow:o,path:[],moveProgress:0,currentTool:null,palette:t,hueShift:i,frame:0,frameTimer:0,wanderTimer:u===a.Lp.IDLE?g(h.wj,h.k8):0,wanderCount:0,wanderLimit:m(h.Rb,h.he),isActive:u===a.Lp.TYPE,seatId:r,bubbleType:null,bubbleTimer:0,speechText:null,speechTimer:0,seatTimer:0,isSubagent:!1,parentAgentId:null,matrixEffect:null,matrixEffectTimer:0,matrixEffectSeeds:[],isExternal:!1,label:null,labelColor:null}}function g(e,t){return e+Math.random()*(t-e)}function m(e,t){return e+Math.floor(Math.random()*(t-e+1))}let b=Array(101),p=Array(101),w=Array(101);for(let e=0;e<101;e++){let t=(e/100).toFixed(2);b[e]="rgba(0,255,65,".concat(t,")"),p[e]="rgba(0,170,40,".concat(t,")"),w[e]="rgba(0,85,20,".concat(t,")")}function T(e){return b[Math.round(100*Math.min(1,Math.max(0,e)))]}function y(e,t){return e<h.Wn?T(t):e<h.WJ?p[Math.round(100*Math.min(1,Math.max(0,t)))]:w[Math.round(100*Math.min(1,Math.max(0,t)))]}function I(e,t,r){return(7*e+13*t+31*Math.floor(r*h.vU)&255)<h.gB}function C(){let e=[];for(let t=0;t<h.W3;t++)e.push(Math.random());return e}var x=r(9631),v=r(9892);class S{markDirty(){var e;this.dirty=!0,null==(e=this.onDirty)||e.call(this)}computeCharacterScale(){let e=Math.max(h.wh,h.YK),t=Math.max(this.layout.cols,this.layout.rows);return t<=e?1:Math.pow(t/e,.75)}setBackgroundImage(e){this.backgroundImage=e,this.markDirty()}setLayout(e){for(let t of(this.layout=e,this.tileMap=(0,x.MB)(e),this.characterScale=this.computeCharacterScale(),this.seats=(0,x.CW)(e.furniture),this.blockedTiles=(0,x.AI)(e.furniture),this.furniture=(0,x.Co)(e.furniture),this.walkableTiles=s(this.tileMap,this.blockedTiles),this.characters.values())){if(t.seatId){let e=this.seats.get(t.seatId);if(e)e.assigned=!0;else{t.seatId=null;let e=this.findFreeSeat();e&&(this.seats.get(e).assigned=!0,t.seatId=e)}}if(t.seatId){let e=this.seats.get(t.seatId);t.tileCol=e.seatCol,t.tileRow=e.seatRow,t.dir=e.facingDir}else if(this.walkableTiles.length>0){let e=this.walkableTiles[Math.floor(Math.random()*this.walkableTiles.length)];t.tileCol=e.col,t.tileRow=e.row}t.x=t.tileCol*a.dn+a.dn/2,t.y=t.tileRow*a.dn+a.dn/2,t.path=[],t.moveProgress=0}this.rebuildFurnitureInstances(),this.markDirty()}addCharacter(e,t,r,l,i,n){if(this.agentIdToCharId.has(e))return;let s=this.nextCharId++;this.agentIdToCharId.set(e,s),this.charIdToAgentId.set(s,e);let{palette:o,hueShift:c}=void 0!==r?{palette:r,hueShift:0}:this.pickDiversePalette(),h=this.walkableTiles.length>0?this.walkableTiles[Math.floor(Math.random()*this.walkableTiles.length)]:{col:1,row:1},u=f(s,o,null,null,c,a.Lp.IDLE);u.x=h.col*a.dn+a.dn/2,u.y=h.row*a.dn+a.dn/2,u.tileCol=h.col,u.tileRow=h.row,l&&(u.isExternal=!0),i&&(u.label=i),n&&(u.labelColor=n),u.matrixEffect="spawn",u.matrixEffectTimer=0,u.matrixEffectSeeds=C(),this.characters.set(s,u),this._charListDirty=!0,this.markDirty()}removeCharacter(e){let t=this.agentIdToCharId.get(e);if(void 0===t)return;let r=this.characters.get(t);if(r&&"despawn"!==r.matrixEffect){if(r.seatId){let e=this.seats.get(r.seatId);e&&(e.assigned=!1)}this.selectedCharId===t&&(this.selectedCharId=null),r.matrixEffect="despawn",r.matrixEffectTimer=0,r.matrixEffectSeeds=C(),r.bubbleType=null,this.markDirty()}}updateCharacterStatus(e,t,r){let l=this.agentIdToCharId.get(e);if(void 0===l)return;let i=this.characters.get(l);if(!i)return;this.markDirty();let a=i.isActive,n="working"===t||"waiting_approval"===t;if(i.isActive=n,r&&!i.seatId){if(i.restSeatId){let e=this.seats.get(i.restSeatId);e&&(e.assigned=!1),i.restSeatId=null,i.seatTimer=0}let e=this.findFreeSeat();e&&(this.seats.get(e).assigned=!0,i.seatId=e),this.rebuildFurnitureInstances()}if(!n&&a){if(r);else{if(i.seatId){let e=this.seats.get(i.seatId);e&&(e.assigned=!1),i.seatId=null}i.seatTimer=-1,i.path=[],i.moveProgress=0}this.rebuildFurnitureInstances()}else if(n&&!a){if(!i.seatId){if(i.restSeatId){let e=this.seats.get(i.restSeatId);e&&(e.assigned=!1),i.restSeatId=null,i.seatTimer=0}let e=this.findFreeSeat();e&&(this.seats.get(e).assigned=!0,i.seatId=e)}this.rebuildFurnitureInstances()}}selectCharacter(e){let t=this.selectedCharId;if(null===e)this.selectedCharId=null;else{let t=this.agentIdToCharId.get(e);this.selectedCharId=null!=t?t:null}this.selectedCharId!==t&&this.markDirty()}showBubble(e,t){let r=this.agentIdToCharId.get(e);if(void 0===r)return;let l=this.characters.get(r);l&&("permission"===t||"working"===t?(l.bubbleType=t,l.bubbleTimer=0):(l.bubbleType="waiting",l.bubbleTimer=h.WK),this.markDirty())}clearBubble(e){let t=this.agentIdToCharId.get(e);if(void 0===t)return;let r=this.characters.get(t);r&&("permission"===r.bubbleType||"working"===r.bubbleType?(r.bubbleType=null,r.bubbleTimer=0):"waiting"===r.bubbleType&&(r.bubbleTimer=Math.min(r.bubbleTimer,h.M_)),this.markDirty())}showSpeechBubble(e,t){let r=this.agentIdToCharId.get(e);if(void 0===r)return;let l=this.characters.get(r);l&&(l.speechText=t.length>h.lO?t.slice(0,h.lO)+"...":t,l.speechTimer=h.Jk,this.markDirty())}getCharacters(){return this._charListDirty&&(this._cachedChars=Array.from(this.characters.values()),this._charListDirty=!1),this._cachedChars}getLayout(){return this.layout}getSelectedCharId(){return this.selectedCharId}getHoveredCharId(){return this.hoveredCharId}getAgentId(e){var t;return null!=(t=this.charIdToAgentId.get(e))?t:null}getAgentAtPixel(e,t){let r=this.characterScale,l=this.getCharacters(),i=null,n=-1/0;for(let o of l){if("despawn"===o.matrixEffect)continue;let l=o.state===a.Lp.TYPE?h.iE:0,c=o.y+l,u=o.x-h.Ns*r,d=o.x+h.Ns*r,f=c-h.o3*r;if(e>=u&&e<=d&&t>=f&&t<=c&&o.y>n){var s;n=o.y,i=null!=(s=this.charIdToAgentId.get(o.id))?s:null}}return i}setHoveredCharAtPixel(e,t){let r=this.hoveredCharId,l=this.characterScale,i=this.getCharacters(),n=null,s=-1/0;for(let r of i){if("despawn"===r.matrixEffect)continue;let i=r.state===a.Lp.TYPE?h.iE:0,o=r.y+i,c=r.x-h.Ns*l,u=r.x+h.Ns*l,d=o-h.o3*l;e>=c&&e<=u&&t>=d&&t<=o&&r.y>s&&(s=r.y,n=r.id)}this.hoveredCharId=n,this.hoveredCharId!==r&&this.markDirty()}update(e){this.needsTick=!1;let t=[];for(let r of this.characters.values()){let l=r.x,i=r.y,n=r.state,s=r.frame,o=r.dir,u=r.bubbleType,f=r.speechText,b=r.matrixEffect,p=r.matrixEffectTimer;if(r.matrixEffect){r.matrixEffectTimer+=e,r.matrixEffectTimer>=a.Pz&&("spawn"===r.matrixEffect?(r.matrixEffect=null,r.matrixEffectTimer=0,r.matrixEffectSeeds=[]):t.push(r.id)),this.dirty=!0;continue}if(r.isActive&&!r.seatId&&r.state===a.Lp.IDLE){let e=this.findFreeSeat();e&&(this.seats.get(e).assigned=!0,r.seatId=e)}this.withOwnSeatUnblocked(r,()=>(function(e,t,r,l,i,n){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1,o=arguments.length>7?arguments[7]:void 0;switch(e.frameTimer+=t,e.state){case a.Lp.TYPE:if(e.frameTimer>=h.S3&&(e.frameTimer-=h.S3,e.frame=(e.frame+1)%2),!e.isActive){if(e.seatTimer>0){e.seatTimer-=t;break}e.seatTimer=0,e.state=a.Lp.IDLE,e.frame=0,e.frameTimer=0,e.wanderTimer=g(h.wj,h.k8),e.wanderCount=0,e.wanderLimit=m(h.Rb,h.he)}break;case a.Lp.IDLE:if(e.frame=0,e.seatTimer<0&&(e.seatTimer=0),e.isActive){if(e.restSeatId){let t=l.get(e.restSeatId);t&&(t.assigned=!1),e.restSeatId=null,e.seatTimer=0}if(!e.seatId)break;let t=l.get(e.seatId);if(t){let r=c(e.tileCol,e.tileRow,t.seatCol,t.seatRow,i,n);r.length>0?(e.path=r,e.moveProgress=0,e.state=a.Lp.WALK):(e.state=a.Lp.TYPE,e.dir=t.facingDir),e.frame=0,e.frameTimer=0}break}if(e.restSeatId&&e.seatTimer>0){if(e.seatTimer-=t,e.seatTimer<=0){e.seatTimer=0;let t=l.get(e.restSeatId);t&&(t.assigned=!1),e.restSeatId=null,e.wanderTimer=g(h.wj,h.k8)}break}if(e.wanderTimer-=t,e.wanderTimer<=0){if(e.wanderCount>=e.wanderLimit&&e.seatId){let t=e.restSeatId?l.get(e.restSeatId):null;t&&(t.assigned=!1),e.restSeatId=null;let r=l.get(e.seatId);if(r){let t=c(e.tileCol,e.tileRow,r.seatCol,r.seatRow,i,n);if(t.length>0){e.path=t,e.moveProgress=0,e.state=a.Lp.WALK,e.frame=0,e.frameTimer=0;break}}}if(o&&!e.restSeatId&&.3>Math.random()){let t=o();if(t){let r=l.get(t);if(r){let l="".concat(r.seatCol,",").concat(r.seatRow),s=n.has(l);s&&n.delete(l);let o=c(e.tileCol,e.tileRow,r.seatCol,r.seatRow,i,n);if(s&&n.add(l),o.length>0){r.assigned=!0,e.restSeatId=t,e.path=o,e.moveProgress=0,e.state=a.Lp.WALK,e.frame=0,e.frameTimer=0,e.wanderCount++;break}}}}if(r.length>0){let t=r[Math.floor(Math.random()*r.length)],l=c(e.tileCol,e.tileRow,t.col,t.row,i,n);l.length>0&&(e.path=l,e.moveProgress=0,e.state=a.Lp.WALK,e.frame=0,e.frameTimer=0,e.wanderCount++)}e.wanderTimer=g(h.wj,h.k8)}break;case a.Lp.WALK:{if(e.frameTimer>=h.lY&&(e.frameTimer-=h.lY,e.frame=(e.frame+1)%4),0===e.path.length){let t=d(e.tileCol,e.tileRow);if(e.x=t.x,e.y=t.y,e.isActive)if(e.seatId){let t=l.get(e.seatId);t&&e.tileCol===t.seatCol&&e.tileRow===t.seatRow?(e.state=a.Lp.TYPE,e.dir=t.facingDir):e.state=a.Lp.IDLE}else e.state=a.Lp.IDLE;else{if(e.restSeatId){let t=l.get(e.restSeatId);if(t&&e.tileCol===t.seatCol&&e.tileRow===t.seatRow){e.state=a.Lp.IDLE,e.dir=t.facingDir,e.seatTimer=g(h.Ot,h.Ww),e.frame=0,e.frameTimer=0;break}}if(e.seatId){let t=l.get(e.seatId);if(t&&e.tileCol===t.seatCol&&e.tileRow===t.seatRow){e.state=a.Lp.TYPE,e.dir=t.facingDir,e.seatTimer<0?e.seatTimer=0:e.seatTimer=g(h.Ot,h.Ww),e.wanderCount=0,e.wanderLimit=m(h.Rb,h.he),e.frame=0,e.frameTimer=0;break}}e.state=a.Lp.IDLE,e.wanderTimer=g(h.wj,h.k8)}e.frame=0,e.frameTimer=0;break}let r=e.path[0];e.dir=function(e,t,r,l){let i=r-e;return i>0?a.OP.RIGHT:i<0?a.OP.LEFT:l-t>0?a.OP.DOWN:a.OP.UP}(e.tileCol,e.tileRow,r.col,r.row),e.moveProgress+=h.XE/a.dn*t*s;let o=d(e.tileCol,e.tileRow),u=d(r.col,r.row),f=Math.min(e.moveProgress,1);if(e.x=o.x+(u.x-o.x)*f,e.y=o.y+(u.y-o.y)*f,e.moveProgress>=1&&(e.tileCol=r.col,e.tileRow=r.row,e.x=u.x,e.y=u.y,e.path.shift(),e.moveProgress=0),e.isActive&&e.seatId){let t=l.get(e.seatId);if(t){let r=e.path[e.path.length-1];if(!r||r.col!==t.seatCol||r.row!==t.seatRow){let r=c(e.tileCol,e.tileRow,t.seatCol,t.seatRow,i,n);r.length>0&&(e.path=r,e.moveProgress=0)}}}}}})(r,e,this.walkableTiles,this.seats,this.tileMap,this.blockedTiles,this.characterScale,()=>this.findFreeRestSeat())),"waiting"===r.bubbleType&&(r.bubbleTimer-=e,r.bubbleTimer<=0&&(r.bubbleType=null,r.bubbleTimer=0)),r.speechText&&(r.speechTimer-=e,r.speechTimer<=0&&(r.speechText=null,r.speechTimer=0)),(r.x!==l||r.y!==i||r.state!==n||r.frame!==s||r.dir!==o||r.bubbleType!==u||r.speechText!==f||r.matrixEffect!==b||r.matrixEffectTimer!==p)&&(this.dirty=!0),!this.needsTick&&(r.state===a.Lp.IDLE&&(r.wanderTimer>0||r.seatTimer>0)||r.state===a.Lp.TYPE&&!r.isActive&&r.seatTimer>0||"waiting"===r.bubbleType&&r.bubbleTimer>0||r.speechText&&r.speechTimer>0)&&(this.needsTick=!0)}for(let e of(t.length>0&&(this.dirty=!0,this._charListDirty=!0),t)){let t=this.charIdToAgentId.get(e);this.characters.delete(e),t&&(this.agentIdToCharId.delete(t),this.charIdToAgentId.delete(e))}}spawnTestCharacters(){this.clearTestCharacters();let e=0;for(let[t,r]of this.seats){if(r.isRest||r.assigned)continue;let l="__test_".concat(e),i=this.nextCharId++;this.agentIdToCharId.set(l,i),this.charIdToAgentId.set(i,l);let n=e%h.ic;r.assigned=!0;let s=f(i,n,t,r,0,a.Lp.TYPE);s.isActive=!0,this.characters.set(i,s),e++}this._charListDirty=!0,this.rebuildFurnitureInstances()}clearTestCharacters(){let e=[];for(let[t,r]of this.agentIdToCharId){if(!t.startsWith("__test_"))continue;let l=this.characters.get(r);if(null==l?void 0:l.seatId){let e=this.seats.get(l.seatId);e&&(e.assigned=!1)}this.characters.delete(r),this.charIdToAgentId.delete(r),e.push(t)}for(let t of e)this.agentIdToCharId.delete(t);e.length>0&&(this._charListDirty=!0,this.rebuildFurnitureInstances())}hasTestCharacters(){for(let e of this.agentIdToCharId.keys())if(e.startsWith("__test_"))return!0;return!1}findFreeSeat(){for(let[e,t]of this.seats)if(!t.assigned&&!t.isRest)return e;return null}findFreeRestSeat(){let e=[...this.seats.entries()].filter(e=>{let[,t]=e;return t.isRest&&!t.assigned});if(0===e.length)return null;let[t]=e[Math.floor(Math.random()*e.length)];return t}pickDiversePalette(){let e=Array(h.ic).fill(0);for(let t of this.characters.values())!t.isSubagent&&e[t.palette]++;let t=Math.min(...e),r=[];for(let l=0;l<h.ic;l++)e[l]===t&&r.push(l);let l=r[Math.floor(Math.random()*r.length)],i=0;return t>0&&(i=h.qt+Math.floor(Math.random()*h.p7)),{palette:l,hueShift:i}}ownSeatKey(e){if(!e.seatId)return null;let t=this.seats.get(e.seatId);return t?"".concat(t.seatCol,",").concat(t.seatRow):null}withOwnSeatUnblocked(e,t){let r=this.ownSeatKey(e),l=e.restSeatId?(()=>{let t=this.seats.get(e.restSeatId);return t?"".concat(t.seatCol,",").concat(t.seatRow):null})():null;r&&this.blockedTiles.delete(r),l&&this.blockedTiles.delete(l);let i=t();return r&&this.blockedTiles.add(r),l&&this.blockedTiles.add(l),i}rebuildFurnitureInstances(){let e=new Set;for(let t of this.characters.values()){if(!t.isActive||!t.seatId)continue;let r=this.seats.get(t.seatId);if(!r)continue;let l=r.facingDir===a.OP.RIGHT?1:r.facingDir===a.OP.LEFT?-1:0,i=r.facingDir===a.OP.DOWN?1:r.facingDir===a.OP.UP?-1:0;for(let t=1;t<=h.Xo;t++)e.add("".concat(r.seatCol+l*t,",").concat(r.seatRow+i*t));for(let t=1;t<=h.ou;t++){let a=r.seatCol+l*t,n=r.seatRow+i*t;0!==l?(e.add("".concat(a,",").concat(n-1)),e.add("".concat(a,",").concat(n+1))):(e.add("".concat(a-1,",").concat(n)),e.add("".concat(a+1,",").concat(n)))}}if(0===e.size){this.furniture=(0,x.Co)(this.layout.furniture);return}let t=this.layout.furniture.map(t=>{let r=(0,v.Um)(t.type);if(!r)return t;for(let l=0;l<r.footprintH;l++)for(let i=0;i<r.footprintW;i++)if(e.has("".concat(t.col+i,",").concat(t.row+l))){let e=(0,v.xr)(t.type);if(e!==t.type)return{...t,type:e};return t}return t});this.furniture=(0,x.Co)(t)}constructor(e){this.backgroundImage=null,this.characters=new Map,this.selectedCharId=null,this.hoveredCharId=null,this.characterScale=1,this.dirty=!0,this.needsTick=!1,this.onDirty=null,this._cachedChars=[],this._charListDirty=!0,this.agentIdToCharId=new Map,this.charIdToAgentId=new Map,this.nextCharId=1,this.layout=e||(0,x.kr)(),this.tileMap=(0,x.MB)(this.layout),this.seats=(0,x.CW)(this.layout.furniture),this.blockedTiles=(0,x.AI)(this.layout.furniture),this.furniture=(0,x.Co)(this.layout.furniture),this.walkableTiles=s(this.tileMap,this.blockedTiles),this.characterScale=this.computeCharacterScale()}}var k=r(5702),M=r(2988),R=r(4777),E=r(5055);let L=new Map;function A(e,t,r){let l="".concat(r,"|").concat(t),i=L.get(l);if(void 0!==i)return i;if(e.font=r,i=Math.ceil(e.measureText(t).width),L.size>=200){let e=100;for(let t of L.keys()){if(e--<=0)break;L.delete(t)}}return L.set(l,i),i}var P=r(4932),D=r(4296),F=r(1204);class Y{wake(){var e;null==(e=this.wakeLoop)||e.call(this)}addAgent(e,t){this.officeState.addCharacter(e,t.name,t.palette,t.isExternal,t.label,t.labelColor),this.wake()}removeAgent(e){this.officeState.removeCharacter(e),this.wake()}updateAgent(e,t,r,l){this.officeState.updateCharacterStatus(e,t,l),r?this.officeState.showBubble(e,r):this.officeState.clearBubble(e),this.wake()}showSpeechBubble(e,t){this.officeState.showSpeechBubble(e,t),this.wake()}selectAgent(e){this.officeState.selectCharacter(e),this.wake()}dispose(){var e;null==(e=this.stopLoop)||e.call(this),this.stopLoop=null,this.wakeLoop=null}getOfficeState(){return this.officeState}constructor(e,t,r){this.officeState=e,this.stopLoop=t,this.wakeLoop=null!=r?r:null}}function B(e){let{onAdapterReady:t,onAgentClick:r,editMode:n,editorRef:s,onTileClick:o,onTileRightClick:c,onGhostMove:d,onDragStart:f,onDragMove:g,onDragEnd:m,onDeleteBtnClick:b,onRotateBtnClick:p,officeStateRef:w,onAssetsLoaded:C,zoomRef:x,panRef:L}=e,B=(0,i.useRef)(null),[W,X]=(0,i.useState)(!1),_=(0,i.useRef)(r);_.current=r;let O=(0,i.useRef)(C);O.current=C;let U=(0,i.useRef)(n);U.current=n;let z=(0,i.useRef)(!1),H=(0,i.useRef)({x:0,y:0,panX:0,panY:0}),N=(0,i.useRef)({offsetX:0,offsetY:0}),V=(0,i.useRef)(null),j=(0,i.useRef)(null),q=(0,i.useCallback)((e,t)=>{let r=w.current;if(!r)return 4;let l=r.layout.cols*h.dn,i=r.layout.rows*h.dn;return Math.max(h.DH,Math.min(e/l,t/i))},[w]),K=(0,i.useCallback)(()=>{let e=B.current;if(!e)return;let t=e.parentElement;if(!t)return;let r=window.devicePixelRatio||1,l=t.clientWidth,i=t.clientHeight;e.width=l*r,e.height=i*r,e.style.width="".concat(l,"px"),e.style.height="".concat(i,"px");let a=e.getContext("2d");a&&a.scale(r,r),x.current=q(l,i),L.current={x:0,y:0}},[q,x,L]);(0,i.useEffect)(()=>{let e=!1;return(0,D.F)().then(t=>{e||((0,v.ar)(t.tilesetSprites),X(!0))}).catch(t=>{console.warn("[PixelOfficeScene] Asset loading failed, using fallbacks:",t),e||X(!0)}),()=>{e=!0}},[]),(0,i.useEffect)(()=>{var e;let r,l,i,n,o,c;if(!W)return;let d=B.current;if(!d)return;let f=new S;w.current=f,null==(e=O.current)||e.call(O),K();let g=new ResizeObserver(()=>K());d.parentElement&&g.observe(d.parentElement);let m=window.devicePixelRatio||1,{stop:b,wake:p}=function(e,t){let r=e.getContext("2d");r.imageSmoothingEnabled=!1;let l=0,i=0,a=!1,n=!0,s=0,o=!1,c=new ResizeObserver(()=>{n=!0,d()});c.observe(e);let u=e=>{if(a)return;o=!1;let c=0===l?0:Math.min((e-l)/1e3,h.O9);if(l=e,t.update(c),n||!t.isDirty||t.isDirty()?(s=0,n=!1,r.imageSmoothingEnabled=!1,t.render(r)):s++,s>=10){var d;if(null==(d=t.needsTick)?void 0:d.call(t)){i=requestAnimationFrame(u);return}o=!0,l=0;return}i=requestAnimationFrame(u)};function d(){if(!a){if(!o){s=0;return}o=!1,s=0,i=requestAnimationFrame(u)}}return i=requestAnimationFrame(u),{stop:()=>{a=!0,cancelAnimationFrame(i),c.disconnect()},wake:d}}(d,{update:e=>{f.update(e)},isDirty:(r=0,l=0,i=0,n=-1,o=-1,c=null,()=>{let e=x.current,t=L.current.x,a=L.current.y,h=e!==r||t!==l||a!==i;if(r=e,l=t,i=a,f.dirty||h)return f.dirty=!1,!0;if(U.current){let e=s.current,t=e.ghostCol!==n||e.ghostRow!==o,r=e.selectedFurnitureUid!==c;return n=e.ghostCol,o=e.ghostRow,c=e.selectedFurnitureUid,t||r}return!1}),needsTick:()=>f.needsTick,render:e=>{let t,r=d.width/m,l=d.height/m,i=x.current,n=L.current,o=s.current;if(U.current){let e=null;if(o.activeTool===a.VF.FURNITURE_PLACE&&o.selectedFurnitureType){let t=(0,v.Um)(o.selectedFurnitureType);t&&(e=t.sprite)}if(o.dragUid){let t=f.layout.furniture.find(e=>e.uid===o.dragUid);if(t){let r=(0,v.Um)(t.type);r&&(e=r.sprite)}}let r=!1,l=0,i=0,n=1,s=1,h=!1;if(o.selectedFurnitureUid){let e=f.layout.furniture.find(e=>e.uid===o.selectedFurnitureUid);if(e){var c,g;let t=(0,v.Um)(e.type);r=!0,l=e.col,i=e.row,n=null!=(c=null==t?void 0:t.footprintW)?c:1,s=null!=(g=null==t?void 0:t.footprintH)?g:1,h=(0,v.ZZ)(e.type)}}t={showGrid:!0,ghostSprite:e,ghostCol:o.ghostCol,ghostRow:o.ghostRow,ghostValid:o.ghostValid,hasSelection:r,selectedCol:l,selectedRow:i,selectedW:n,selectedH:s,isRotatable:h,deleteButtonBounds:null,rotateButtonBounds:null,showGhostBorder:!0,ghostBorderHoverCol:o.ghostCol,ghostBorderHoverRow:o.ghostRow}}N.current=function(e,t,r,l,i,n,s,o,c,d,f,g,m,b,p,w,C){let x=null!=C?C:1;e.clearRect(0,0,t,r);let v=null!=m?m:l.length>0?l[0].length:0,S=null!=b?b:l.length,L=v*a.dn*s,P=S*a.dn*s,D=Math.floor((t-L)/2)+Math.round(o),F=Math.floor((r-P)/2)+Math.round(c);w&&(e.save(),e.imageSmoothingEnabled=!1,e.drawImage(w,D,F,L,P),e.restore()),w||function(e,t,r,l,i,n,s){let o=a.dn*i,c=(0,R.$0)(),u=t.length,d=u>0?t[0].length:0,f=null!=s?s:d;for(let s=0;s<u;s++)for(let u=0;u<d;u++){var g;let d=t[s][u];if(d===a.nb.VOID)continue;if(d===a.nb.WALL||!c){if(d===a.nb.WALL){let t=s*f+u,r=null==n?void 0:n[t];e.fillStyle=r?(0,E.og)(r):R.ty}else e.fillStyle=h.q3;e.fillRect(r+u*o,l+s*o,o,o);continue}let m=s*f+u,b=null!=(g=null==n?void 0:n[m])?g:{h:0,s:0,b:0,c:0},p=(0,R.To)(d,b),w=(0,k.k)(p,i);e.drawImage(w,r+u*o,l+s*o)}}(e,l,D,F,s,g,m);let Y=!w&&(0,E.BN)()?(0,E.vb)(l,g,m):[];return!function(e,t,r,l,i,n,s,o){let c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,d=[],f=n*c;for(let e of t){let t=(0,k.k)(e.sprite,n),r=l+e.x*n,a=i+e.y*n;d.push({zY:e.zY,draw:e=>{e.drawImage(t,r,a)}})}for(let e of r){let t=(0,M.Ih)(e.palette,e.hueShift),r=function(e,t){if(!t)return null;switch(e.state){case a.Lp.TYPE:var r;if((r=e.currentTool)&&u.has(r))return t.reading[e.dir][e.frame%2];return t.typing[e.dir][e.frame%2];case a.Lp.WALK:return t.walk[e.dir][e.frame%4];case a.Lp.IDLE:default:return t.walk[e.dir][1]}}(e,t);if(!r)continue;let c=(0,k.k)(r,f),g=e.state===a.Lp.TYPE?h.iE:0,m=Math.round(l+e.x*n-c.width/2),b=Math.round(i+(e.y+g)*n-c.height),p=e.y+a.dn/2+h.Sg;if(e.matrixEffect){let t=e;d.push({zY:p,draw:e=>{!function(e,t,r,l,i,n){let s=t.matrixEffectTimer/a.Pz,o="spawn"===t.matrixEffect,c=t.matrixEffectTimer,u=h.wN+h.M1;for(let a=0;a<h.W3;a++){var d,f;let g=Math.max(0,Math.min(1,(s-(null!=(d=t.matrixEffectSeeds[a])?d:0)*h.hI)/(1-h.hI)))*u;for(let t=0;t<h.wN;t++){let s=null==(f=r[t])?void 0:f[a],u=s&&""!==s,d=g-t,m=l+a*n,b=i+t*n;if(o)if(d<0)continue;else if(d<1)e.fillStyle=h.zw,e.fillRect(m,b,n,n);else if(d<h.M1){let r=d/h.M1;if(u){e.fillStyle=s,e.fillRect(m,b,n,n);let l=(1-r)*h.Nd;I(a,t,c)&&(e.fillStyle=T(l),e.fillRect(m,b,n,n))}else if(I(a,t,c)){let t=(1-r)*h.gi;e.fillStyle=y(r,t),e.fillRect(m,b,n,n)}}else u&&(e.fillStyle=s,e.fillRect(m,b,n,n));else if(d<0)u&&(e.fillStyle=s,e.fillRect(m,b,n,n));else if(d<1)e.fillStyle=h.zw,e.fillRect(m,b,n,n);else if(d<h.M1&&I(a,t,c)){let t=d/h.M1,r=(1-t)*h.gi;e.fillStyle=y(t,r),e.fillRect(m,b,n,n)}}}}(e,t,r,m,b,f)}});continue}let w=null!==s&&e.id===s,C=null!==o&&e.id===o;if(w||C){let e=w?h.O1:h.y9,t=(0,k.Y)(r),l=(0,k.k)(t,f),i=m-f,a=b-f;d.push({zY:p-h.F2,draw:t=>{t.save(),t.globalAlpha=e,t.drawImage(l,i,a),t.restore()}})}d.push({zY:p,draw:e=>{e.drawImage(c,m,b)}})}for(let t of(d.sort((e,t)=>e.zY-t.zY),d))t.draw(e)}(e,Y.length>0?[...Y,...i]:i,n,D,F,s,d,f,x),!function(e,t,r,l,i){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=i*n,o=Math.max(1,Math.round(s));for(let u of t){var c;if(!u.label||"despawn"===u.matrixEffect)continue;let t=Math.max(6,Math.round(3.5*s)),d="bold ".concat(t,"px monospace"),f=A(e,u.label,d);e.save(),e.imageSmoothingEnabled=!1,e.font=d;let g=2*o,m=+o,b=f+2*g,p=t+2*m,w=u.state===a.Lp.TYPE?h.PA:0,T=Math.round(r+u.x*i-b/2),y=Math.round(l+(u.y+w-26*n)*i-p),I=null!=(c=u.labelColor)?c:"#8a7a6a";e.fillStyle="#222",e.fillRect(T-o,y,b+2*o,p+o),e.fillRect(T,y-o,b,p+2*o),e.fillStyle=I,e.fillRect(T,y,b,p),e.fillStyle="#fff",e.textBaseline="top",e.fillText(u.label,T+g,y+m),e.restore()}}(e,n,D,F,s,x),!function(e,t,r,l,i){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=i*n;for(let o of t){if(!o.bubbleType)continue;let t="permission"===o.bubbleType?M.$D:"working"===o.bubbleType?M.j9:M.VQ,c=1;"waiting"===o.bubbleType&&o.bubbleTimer<h.v3&&(c=o.bubbleTimer/h.v3);let u=(0,k.k)(t,s),d=o.state===a.Lp.TYPE?h.PA:0,f=Math.round(r+o.x*i-u.width/2),g=Math.round(l+(o.y+d-h.$L*n)*i-u.height-i);e.save(),c<1&&(e.globalAlpha=c),e.drawImage(u,f,g),e.restore()}}(e,n,D,F,s,x),!function(e,t,r,l,i){let n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=i*n,o=Math.max(1,Math.round(s));for(let c of t){if(!c.speechText)continue;let t=1;if(c.speechTimer<h.nW&&(t=Math.max(0,c.speechTimer/h.nW)),t<=0)continue;let u=Math.max(7,Math.round(4.5*s)),d="".concat(u,"px monospace"),f=A(e,c.speechText,d);e.save(),e.imageSmoothingEnabled=!1,e.font=d;let g=3*o,m=2*o,b=f+2*g,p=u+2*m,w=3*o,T=c.state===a.Lp.TYPE?h.PA:0,y=Math.round(r+c.x*i-b/2),I=Math.round(l+(c.y+T-h.$L*n)*i-p-w-4*o);t<1&&(e.globalAlpha=t),e.fillStyle="#333",e.fillRect(y-o,I,b+2*o,p+o),e.fillRect(y,I-o,b,p+2*o),e.fillStyle="#fff",e.fillRect(y,I,b,p);let C=Math.round(y+b/2);e.fillStyle="#333",e.fillRect(C-2*o,I+p,4*o,o),e.fillRect(C-o,I+p+o,2*o,o),e.fillRect(C,I+p+2*o,o,o),e.fillStyle="#fff",e.fillRect(C-o,I+p,2*o,o),e.fillRect(C,I+p+o,o,o),e.fillStyle="#222",e.textBaseline="top",e.fillText(c.speechText,y+g,I+m),e.restore()}}(e,n,D,F,s,x),p&&(p.showGrid&&function(e,t,r,l,i,n,s){let o=a.dn*l;e.strokeStyle=h.AL,e.lineWidth=1,e.beginPath();for(let l=0;l<=i;l++){let i=t+l*o+.5;e.moveTo(i,r),e.lineTo(i,r+n*o)}for(let l=0;l<=n;l++){let a=r+l*o+.5;e.moveTo(t,a),e.lineTo(t+i*o,a)}if(e.stroke(),s){e.save(),e.strokeStyle=h.fJ,e.lineWidth=1,e.setLineDash(h.i);for(let l=0;l<n;l++)for(let n=0;n<i;n++){var c;(null==(c=s[l])?void 0:c[n])===a.nb.VOID&&e.strokeRect(t+n*o+.5,r+l*o+.5,o-1,o-1)}e.restore()}}(e,D,F,s,v,S,l),p.showGhostBorder&&function(e,t,r,l,i,n,s,o){let c=a.dn*l;e.save();let u=[];for(let e=-1;e<=i;e++)u.push({c:e,r:-1}),u.push({c:e,r:n});for(let e=0;e<n;e++)u.push({c:-1,r:e}),u.push({c:i,r:e});for(let{c:l,r:i}of u){let a=t+l*c,n=r+i*c,u=l===s&&i===o;u&&(e.fillStyle=h.Mo,e.fillRect(a,n,c,c)),e.strokeStyle=u?h.pr:h.gD,e.lineWidth=1,e.setLineDash(h.i),e.strokeRect(a+.5,n+.5,c-1,c-1)}e.restore()}(e,D,F,s,v,S,p.ghostBorderHoverCol,p.ghostBorderHoverRow),p.ghostSprite&&p.ghostCol>=0&&function(e,t,r,l,i,n,s,o){let c=(0,k.k)(t,o),u=n+r*a.dn*o,d=s+l*a.dn*o;e.save(),e.globalAlpha=h.qD,e.drawImage(c,u,d),e.globalAlpha=h.W7,e.fillStyle=i?h.TE:h.oj,e.fillRect(u,d,c.width,c.height),e.restore()}(e,p.ghostSprite,p.ghostCol,p.ghostRow,p.ghostValid,D,F,s),p.hasSelection?(!function(e,t,r,l,i,n,s,o){let c=a.dn*o;e.save(),e.strokeStyle=h.Ii,e.lineWidth=2,e.setLineDash(h.n6),e.strokeRect(n+t*c+1,s+r*c+1,l*c-2,i*c-2),e.restore()}(e,p.selectedCol,p.selectedRow,p.selectedW,p.selectedH,D,F,s),p.deleteButtonBounds=function(e,t,r,l,i,n,s,o){let c=a.dn*o,u=n+(t+l)*c+1,d=s+r*c-1,f=Math.max(h.l0,o*h.YX);e.save(),e.beginPath(),e.arc(u,d,f,0,2*Math.PI),e.fillStyle=h.Zz,e.fill(),e.strokeStyle="#fff",e.lineWidth=Math.max(h.SS,o*h.zY),e.lineCap="round";let g=f*h.R_;return e.beginPath(),e.moveTo(u-g,d-g),e.lineTo(u+g,d+g),e.moveTo(u+g,d-g),e.lineTo(u-g,d+g),e.stroke(),e.restore(),{cx:u,cy:d,radius:f}}(e,p.selectedCol,p.selectedRow,p.selectedW,p.selectedH,D,F,s),p.isRotatable?p.rotateButtonBounds=function(e,t,r,l,i,n,s,o){let c=a.dn*o,u=Math.max(h.l0,o*h.YX),d=n+t*c-1,f=s+r*c-1;e.save(),e.beginPath(),e.arc(d,f,u,0,2*Math.PI),e.fillStyle=h.BD,e.fill(),e.strokeStyle="#fff",e.lineWidth=Math.max(h.SS,o*h.zY),e.lineCap="round";let g=u*h.R_;e.beginPath(),e.arc(d,f,g,-(.8*Math.PI),.7*Math.PI),e.stroke();let m=.7*Math.PI,b=d+g*Math.cos(m),p=f+g*Math.sin(m),w=.35*u;return e.beginPath(),e.moveTo(b+.6*w,p-.3*w),e.lineTo(b,p),e.lineTo(b+.7*w,p+.5*w),e.stroke(),e.restore(),{cx:d,cy:f,radius:u}}(e,p.selectedCol,p.selectedRow,p.selectedW,p.selectedH,D,F,s):p.rotateButtonBounds=null):(p.deleteButtonBounds=null,p.rotateButtonBounds=null)),{offsetX:D,offsetY:F}}(e,r,l,f.tileMap,f.furniture,f.getCharacters(),i,n.x,n.y,f.getSelectedCharId(),f.getHoveredCharId(),f.layout.tileColors,f.layout.cols,f.layout.rows,t,f.backgroundImage,f.characterScale),V.current=null!=t?t:null}});j.current=p,f.onDirty=p;let C=new Y(f,b,p);return t(C),()=>{C.dispose(),w.current=null,g.disconnect()}},[W,K,w,x,L,s,t]);let G=(0,i.useCallback)((e,t)=>{let r=B.current;if(!r)return{x:0,y:0};let l=r.getBoundingClientRect(),i=x.current,{offsetX:a,offsetY:n}=N.current;return{x:(e-l.left-a)/i,y:(t-l.top-n)/i}},[x]),Z=(0,i.useCallback)((e,t)=>({col:Math.floor(e/h.dn),row:Math.floor(t/h.dn)}),[]),$=(0,i.useCallback)((e,t)=>{let r=G(e,t);return Z(r.x,r.y)},[G,Z]),J=(0,i.useCallback)(e=>{if(z.current=!0,H.current={x:e.clientX,y:e.clientY,panX:L.current.x,panY:L.current.y},U.current&&s.current.selectedFurnitureUid){var t;let r=$(e.clientX,e.clientY),l=null==(t=w.current)?void 0:t.layout;if(l){let e=(0,F.iH)(l,r.col,r.row);e&&e.uid===s.current.selectedFurnitureUid&&(null==f||f(r.col,r.row))}}},[L,s,w,$,f]),Q=(0,i.useCallback)(e=>{var t,r;let l=w.current;if(l&&!U.current){let t=G(e.clientX,e.clientY);l.setHoveredCharAtPixel(t.x,t.y),l.dirty&&(null==(r=j.current)||r.call(j))}if(U.current){let t=$(e.clientX,e.clientY);s.current.dragUid?null==g||g(t.col,t.row):null==d||d(t.col,t.row)}if(!z.current||!h.eR||s.current.dragUid)return;let i=e.clientX-H.current.x,a=e.clientY-H.current.y;L.current={x:H.current.panX+i,y:H.current.panY+a},null==(t=j.current)||t.call(j)},[G,$,w,L,s,g,d]),ee=(0,i.useCallback)(e=>{let t=z.current;if(z.current=!1,s.current.dragUid){let t=$(e.clientX,e.clientY);null==m||m(t.col,t.row);return}let r=Math.abs(e.clientX-H.current.x),l=Math.abs(e.clientY-H.current.y);if(t&&(r>5||l>5))return;let i=w.current;if(!i)return;if(U.current){let t=V.current;if(t){let r=B.current;if(r){let l=r.getBoundingClientRect(),i=e.clientX-l.left,a=e.clientY-l.top;if(t.deleteButtonBounds){let{cx:e,cy:r,radius:l}=t.deleteButtonBounds;if(Math.sqrt((i-e)**2+(a-r)**2)<=l){null==b||b();return}}if(t.rotateButtonBounds){let{cx:e,cy:r,radius:l}=t.rotateButtonBounds;if(Math.sqrt((i-e)**2+(a-r)**2)<=l){null==p||p();return}}}}let r=$(e.clientX,e.clientY);null==o||o(r.col,r.row);return}let a=G(e.clientX,e.clientY),n=i.getAgentAtPixel(a.x,a.y);n&&_.current(n)},[G,$,w,s,o,m,b,p]),et=(0,i.useCallback)(e=>{if(!U.current)return;e.preventDefault();let t=$(e.clientX,e.clientY);null==c||c(t.col,t.row)},[$,c]),er=(0,i.useCallback)(e=>{},[]),el=(0,i.useRef)([]),ei=(0,i.useRef)(0),ea=(0,i.useCallback)(e=>{if(el.current=Array.from(e.touches),2===e.touches.length){let t=e.touches[0].clientX-e.touches[1].clientX,r=e.touches[0].clientY-e.touches[1].clientY;ei.current=Math.sqrt(t*t+r*r)}else 1===e.touches.length&&(z.current=!0,H.current={x:e.touches[0].clientX,y:e.touches[0].clientY,panX:L.current.x,panY:L.current.y})},[L]),en=(0,i.useCallback)(e=>{var t,r;if(2===e.touches.length){let r=e.touches[0].clientX-e.touches[1].clientX,l=e.touches[0].clientY-e.touches[1].clientY,i=Math.sqrt(r*r+l*l),a=i-ei.current;Math.abs(a)>20&&(x.current=Math.max(h.DH,Math.min(h.ZV,x.current+(a>0?1:-1))),ei.current=i,null==(t=j.current)||t.call(j))}else if(1===e.touches.length&&z.current&&h.eR){let t=e.touches[0].clientX-H.current.x,l=e.touches[0].clientY-H.current.y;L.current={x:H.current.panX+t,y:H.current.panY+l},null==(r=j.current)||r.call(j)}},[x,L]),es=(0,i.useCallback)(e=>{if(0===e.touches.length&&1===el.current.length){let e=el.current[0],t=Math.abs(e.clientX-H.current.x),r=Math.abs(e.clientY-H.current.y);if(t<10&&r<10)if(U.current){let t=$(e.clientX,e.clientY);null==o||o(t.col,t.row)}else{let t=w.current;if(t){let r=G(e.clientX,e.clientY),l=t.getAgentAtPixel(r.x,r.y);l&&_.current(l)}}}z.current=!1,el.current=Array.from(e.touches)},[G,$,w,o]),eo=n?s.current.activeTool===a.VF.ERASE?"crosshair":s.current.activeTool===a.VF.EYEDROPPER?"copy":s.current.activeTool===a.VF.FURNITURE_PLACE?"cell":s.current.dragUid?"grabbing":"default":"grab";return(0,l.jsxs)("div",{style:{width:"100%",height:"100%",overflow:"hidden",backgroundColor:P.lr},children:[!W&&(0,l.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:"#6b7280",fontSize:14,fontFamily:"system-ui, sans-serif",zIndex:10},children:"Loading office..."}),(0,l.jsx)("canvas",{ref:B,onPointerDown:J,onPointerMove:Q,onPointerUp:ee,onContextMenu:et,onWheel:er,onTouchStart:ea,onTouchMove:en,onTouchEnd:es,style:{display:"block",width:"100%",height:"100%",touchAction:"none",cursor:eo}})]})}},5702:(e,t,r)=>{r.d(t,{Y:()=>a,k:()=>n});let l=new Map,i=new WeakMap;function a(e){let t=i.get(e);if(t)return t;let r=e.length,l=e[0].length,a=[];for(let e=0;e<r+2;e++)a.push(Array(l+2).fill(""));for(let t=0;t<r;t++)for(let r=0;r<l;r++){if(""===e[t][r])continue;let l=t+1,i=r+1;""===a[l-1][i]&&(a[l-1][i]="#FFFFFF"),""===a[l+1][i]&&(a[l+1][i]="#FFFFFF"),""===a[l][i-1]&&(a[l][i-1]="#FFFFFF"),""===a[l][i+1]&&(a[l][i+1]="#FFFFFF")}for(let t=0;t<r;t++)for(let r=0;r<l;r++)""!==e[t][r]&&(a[t+1][r+1]="");return i.set(e,a),a}function n(e,t){let r=Math.round(100*t)/100,i=l.get(r);i||(i=new WeakMap,l.set(r,i));let a=i.get(e);if(a)return a;let n=e.length,s=e[0].length,o=document.createElement("canvas");o.width=s*r,o.height=n*r;let c=o.getContext("2d");c.imageSmoothingEnabled=!1;for(let t=0;t<n;t++)for(let l=0;l<s;l++){let i=e[t][l];""!==i&&(c.fillStyle=i,c.fillRect(l*r,t*r,r,r))}return i.set(e,o),o}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[606],{606:(e,t,r)=>{r.r(t),r.d(t,{ConfettiOverlay:()=>c,default:()=>d});var a=r(206),n=r(1406),o=r(5192),l=r(7877),i=r(1310),s=r(370);function c(){let e=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let t,r=e.current;if(!r)return;let a=r.getContext("2d");if(!a)return;r.width=window.innerWidth,r.height=window.innerHeight;let n=["#ff6b6b","#feca57","#48dbfb","#ff9ff3","#54a0ff","#5f27cd","#01a3a4","#ff5e57","#0abde3","#10ac84"],o=[],l=r.width,i=r.height;for(let e=0;e<120;e++)o.push({x:Math.random()*l,y:-Math.random()*i*.8,vx:(Math.random()-.5)*2,vy:1.5+3*Math.random(),w:6+8*Math.random(),h:4+6*Math.random(),rot:Math.random()*Math.PI*2,rotSpeed:(Math.random()-.5)*.15,color:n[Math.floor(Math.random()*n.length)],alpha:1});let s=performance.now(),c=e=>{let r=e-s,n=r>2200?Math.max(0,1-(r-2200)/800):1;for(let t of(a.clearRect(0,0,l,i),o))t.x+=t.vx+.5*Math.sin(.002*e+t.rot),t.y+=t.vy,t.rot+=t.rotSpeed,t.x<-20&&(t.x=l+20),t.x>l+20&&(t.x=-20),t.y>i+20&&(t.y=-10,t.x=Math.random()*l),a.save(),a.translate(t.x,t.y),a.rotate(t.rot),a.globalAlpha=n,a.fillStyle=t.color,a.fillRect(-t.w/2,-t.h/2,t.w,t.h),a.restore();r<3e3&&(t=requestAnimationFrame(c))};return t=requestAnimationFrame(c),()=>cancelAnimationFrame(t)},[]),(0,a.jsx)("canvas",{ref:e,className:"fixed inset-0 z-[10000] pointer-events-none"})}let d=function(e){let{previewUrl:t,previewPath:r,onPreview:n,onDismiss:c,previewCmd:d,previewPort:h,projectDir:f,entryFile:m}=e,x={previewUrl:t,previewCmd:d,previewPort:h,previewPath:r,entryFile:m},u=(0,l.P9)(x),v=!u&&(0,l.iv)({previewPath:r,previewCmd:d,previewPort:h,projectDir:f,entryFile:m});return(0,a.jsx)(i.A,{open:!0,onClose:c,maxWidth:420,zIndex:9999,footer:(0,a.jsxs)(a.Fragment,{children:[u&&(0,a.jsxs)(s.A,{variant:"success",onClick:()=>{let e=(0,l.iv)({previewPath:r,previewCmd:d,previewPort:h,projectDir:f,entryFile:m});e&&(0,o.S8)(e);let t=(0,l.vG)(x);t&&n(t)},children:["▶"," Preview"]}),v&&(0,a.jsxs)(s.A,{onClick:()=>{let e=(0,l.iv)({previewPath:r,previewCmd:d,previewPort:h,projectDir:f,entryFile:m});e&&(0,o.S8)(e),c()},style:{borderColor:"var(--term-sem-blue)",color:"var(--term-sem-blue)"},children:["▶"," Launch"]}),(0,a.jsx)(s.A,{variant:"dim",onClick:c,children:"OK"})]}),children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"text-[34px] mb-2.5 text-accent",children:"★"}),(0,a.jsx)("div",{className:"px-font text-accent text-sm mb-2.5 tracking-wide",children:"Mission Complete!"}),(0,a.jsx)("div",{className:"text-muted-foreground text-sm leading-[1.7] font-mono",children:"Your task has been completed successfully. Ready for the next mission whenever you are."})]})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[729],{9729:(e,t,l)=>{l.r(t),l.d(t,{default:()=>c});var a=l(206),n=l(1406),r=l(4932);function c(e){let{open:t,onClose:l,actions:c=[],currentTheme:i,onThemeChange:s,onOpenSettings:o,onOpenHistory:u,onHire:p}=e,[h,d]=(0,n.useState)(""),[m,f]=(0,n.useState)(0),g=(0,n.useRef)(null),v=(0,n.useRef)(null),b=(0,n.useMemo)(()=>{let e=[];o&&e.push({id:"settings",label:"Settings",icon:"⚙",group:"Navigation",action:()=>{o(),l()}}),u&&e.push({id:"history",label:"Project History",icon:"◶",group:"Navigation",action:()=>{u(),l()}}),p&&e.push({id:"hire",label:"Hire Team",icon:"+",group:"Actions",action:()=>{p(),l()}});let t=new Set(["gruvbox","nord","dracula","slate","black-metal","owl","vague","iceberg-dark","office","catppuccin","everforest"]),a=Object.entries(r.aD).filter(e=>{let[l]=e;return!t.has(l)}).map(e=>{let[t,a]=e;return{id:"theme:".concat(t),label:a.name,icon:i===t?"●":"○",hint:i===t?"active":void 0,group:"Themes",action:()=>{s?s(t):(0,r.c8)(t),l()}}});return[...e,...c.map(e=>({...e,action:()=>{e.action(),l()}})),...a]},[c,i,s,o,u,p,l]),k=(0,n.useMemo)(()=>{if(!h.trim())return b;let e=h.toLowerCase();return b.filter(t=>{var l;return t.label.toLowerCase().includes(e)||(null==(l=t.group)?void 0:l.toLowerCase().includes(e))||t.id.toLowerCase().includes(e)})},[b,h]);(0,n.useEffect)(()=>{t&&(d(""),f(0),setTimeout(()=>{var e;return null==(e=g.current)?void 0:e.focus()},50))},[t]),(0,n.useEffect)(()=>{f(e=>Math.min(e,Math.max(0,k.length-1)))},[k.length]),(0,n.useEffect)(()=>{var e;let t=v.current;if(!t)return;let l=t.children[m];null==l||null==(e=l.scrollIntoView)||e.call(l,{block:"nearest"})},[m]);let x=(0,n.useCallback)(e=>{let t=k[e];t&&t.action()},[k]),N=(0,n.useCallback)(e=>{"ArrowDown"===e.key?(e.preventDefault(),f(e=>(e+1)%Math.max(1,k.length))):"ArrowUp"===e.key?(e.preventDefault(),f(e=>(e-1+k.length)%Math.max(1,k.length))):"Enter"===e.key?(e.preventDefault(),x(m)):"Escape"===e.key&&(e.preventDefault(),l())},[k.length,m,x,l]);if(!t)return null;let C="";return(0,a.jsx)("div",{className:"cp-backdrop",onClick:l,children:(0,a.jsxs)("div",{className:"cp-container",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("input",{ref:g,className:"cp-input",value:h,onChange:e=>d(e.target.value),onKeyDown:N,placeholder:"Type a command...",spellCheck:!1,autoComplete:"off"}),(0,a.jsxs)("div",{ref:v,className:"cp-list",children:[0===k.length&&(0,a.jsx)("div",{className:"cp-empty",children:"No matching commands"}),k.map((e,t)=>{let l=e.group&&e.group!==C;return e.group&&(C=e.group),(0,a.jsxs)("div",{children:[l&&(0,a.jsx)("div",{className:"cp-group-label",children:e.group}),(0,a.jsxs)("button",{className:"cp-item".concat(t===m?" cp-item-active":""),onClick:()=>x(t),onMouseEnter:()=>f(t),children:[e.icon&&(0,a.jsx)("span",{className:"cp-item-icon",children:e.icon}),(0,a.jsx)("span",{className:"cp-item-label",children:e.label}),e.hint&&(0,a.jsx)("span",{className:"cp-item-hint",children:e.hint})]})]},e.id)})]})]})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[853],{6853:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});var r=n(206),o=n(1406);function i(e){let{msgCount:t,frozen:n=!1,key:r="",forcePin:i=!1}=e,l=(0,o.useRef)(null),a=(0,o.useRef)(!0),s=(0,o.useRef)(!1),d=(0,o.useRef)(0),c=()=>{var e,t;return null!=(t=null==(e=l.current)?void 0:e.parentElement)?t:null},p=()=>{let e=l.current;e&&(e.scrollIntoView({block:"end",behavior:"instant"}),a.current=!0)},x=()=>{!n&&a.current&&(d.current||(d.current=requestAnimationFrame(()=>{d.current=0,a.current&&!n&&p()})))},u=(0,o.useRef)(i);(0,o.useLayoutEffect)(()=>{i&&!u.current&&(a.current=!0),u.current=i},[i]),(0,o.useLayoutEffect)(()=>{!n&&a.current&&p()},[r,t,n]),(0,o.useEffect)(()=>{let e=c();if(!e)return;let t=0,r=()=>{s.current||n||(cancelAnimationFrame(t),t=requestAnimationFrame(()=>{a.current=e.scrollHeight-e.scrollTop-e.clientHeight<=80}))};return e.addEventListener("scroll",r,{passive:!0}),()=>{e.removeEventListener("scroll",r),cancelAnimationFrame(t)}},[r,n]),(0,o.useEffect)(()=>{let e=c();if(!e)return;let t=new ResizeObserver(()=>{n||(s.current=!0,x(),requestAnimationFrame(()=>{s.current=!1}))});return t.observe(e),()=>{t.disconnect(),s.current=!1}},[r,n]),(0,o.useEffect)(()=>{let e=c();if(!e)return;let t=new MutationObserver(()=>{n||x()});return t.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>t.disconnect()},[r,n]),(0,o.useEffect)(()=>{let e=()=>{!n&&a.current&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{a.current&&!n&&p()})})},t=()=>{"visible"===document.visibilityState&&e()};return document.addEventListener("visibilitychange",t),window.addEventListener("focus",e),()=>{document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",e)}},[r,n]);let m=(0,o.useRef)(n);return(0,o.useEffect)(()=>{let e=m.current;m.current=n,e&&!n&&(a.current=!0,requestAnimationFrame(()=>p()))},[n]),(0,o.useEffect)(()=>()=>{d.current&&(cancelAnimationFrame(d.current),d.current=0)},[]),l}var l=n(7821),a=n(4932),s=n(7877),d=n(7580),c=n(370),p=n(9362);function x(e){let{message:t,hint:n,className:o}=e,i=["te",o].filter(Boolean).join(" ");return(0,r.jsxs)("div",{className:i,children:[(0,r.jsx)("span",{className:"te-msg",children:t}),n&&(0,r.jsx)("span",{className:"te-hint",children:n})]})}n(1310),(0,n(8688).F)("inline-flex items-center gap-1 px-1.5 py-px font-mono text-[10px] font-medium tracking-wide whitespace-nowrap leading-snug border",{variants:{variant:{green:"text-sem-green bg-sem-green/8 border-sem-green/25",yellow:"text-sem-yellow bg-sem-yellow/8 border-sem-yellow/25",red:"text-sem-red bg-sem-red/8 border-sem-red/25",blue:"text-sem-blue bg-sem-blue/8 border-sem-blue/25",purple:"text-sem-purple bg-sem-purple/8 border-sem-purple/25",dim:"text-term-green-dim bg-term-green-dim/8 border-term-green-dim/20"}},defaultVariants:{variant:"dim"}});var u=n(8163),m=n(9385);let g=(0,n(5282).default)(()=>Promise.resolve().then(n.bind(n,7580)),{loadableGenerated:{webpack:()=>[7580]},ssr:!1});function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(!e)return;let n=getComputedStyle(e),r=parseInt(n.lineHeight)||20,o=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom),i=parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),l=r*t;e.style.height="0";let a=e.scrollHeight,s="border-box"===n.boxSizing,d=s?a+i:a-o,c=Math.max(s?r+o+i:r,Math.min(d,l+(s?o+i:0)));e.style.height=c+"px",e.style.overflowY=(s?d-o-i:d)>l?"auto":"hidden"}function h(e){let{onLoadMore:t}=e,n=(0,o.useRef)(null),i=(0,o.useRef)(t);return i.current=t,(0,o.useEffect)(()=>{var e;let t=n.current;if(!t)return;let r=new IntersectionObserver(e=>{let[t]=e;t.isIntersecting&&i.current()},{threshold:0,root:null!=(e=t.closest("[data-scrollbar]"))?e:t.parentElement,rootMargin:"100px 0px 0px 0px"});return r.observe(t),()=>r.disconnect()},[]),(0,r.jsx)("div",{ref:n,style:{height:1,flexShrink:0}})}let b=(0,o.memo)(function(e){var t;let{visibleMessages:n,hasMoreMessages:o,messages:i,name:l,agentId:s,onPreview:d,onReview:c,isTeamLead:p,isTeamMember:u,teamPhase:m,detectedBackends:f,onLoadMore:b,busy:v,pendingApproval:y,lastLogLine:w,chatEndRef:j,isOwner:k,onApproval:R}=e;return(0,r.jsxs)(r.Fragment,{children:[p&&(()=>{if(!m)return null;let e={create:{color:a.KE,icon:"\uD83D\uDCAC",hint:"Chat with your team lead to define the project"},design:{color:a.O2,icon:"\uD83D\uDCCB",hint:"Review the plan — approve it or give feedback"},execute:{color:a.O2,icon:"⚡",hint:"Team is building your project"},complete:{color:a.$C,icon:"✓",hint:"Review results — give feedback or end project"}}[m];return e?(0,r.jsxs)("div",{style:{padding:"6px 10px",marginBottom:8,borderLeft:"2px solid ".concat(a.Y0),display:"flex",alignItems:"center",gap:6,fontSize:a.Z8,fontFamily:a.Rw},children:[(0,r.jsx)("span",{style:{color:a.Y0,textTransform:"uppercase",letterSpacing:"0.05em"},children:m}),(0,r.jsx)("span",{style:{color:a.Y0},children:e.hint})]}):null})(),0===i.length&&(0,r.jsx)(x,{message:u?"managed by Team Lead":"no messages yet",hint:u?void 0:"send a message to get started"}),o&&(0,r.jsx)(h,{onLoadMore:b}),n.map(e=>(0,r.jsx)(g,{msg:e,agentName:l,onPreview:d,onReview:c,isTeamLead:p,isTeamMember:u,teamPhase:p?m:null,detectedBackends:f},e.id)),y&&(0,r.jsxs)("div",{style:{marginBottom:8,padding:12,borderLeft:"2px solid ".concat(a.O2),fontSize:a.Z8,fontFamily:a.Rw},children:[(0,r.jsx)("div",{style:{color:a.O2,marginBottom:6},children:y.title}),(0,r.jsx)("div",{style:{color:a.lR,marginBottom:10,lineHeight:1.65},children:y.summary}),k&&(0,r.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,r.jsx)("button",{className:"term-btn",onClick:()=>R(y.approvalId,"yes"),style:{flex:1,padding:"6px",border:"1px solid ".concat(a.Y0),backgroundColor:"transparent",color:a.$C,cursor:"pointer",fontSize:a.Z8,fontFamily:a.Rw},children:"approve"}),(0,r.jsx)("button",{className:"term-btn",onClick:()=>R(y.approvalId,"no"),style:{flex:1,padding:"6px",border:"1px solid ".concat(a.Y0),backgroundColor:"transparent",color:a.v_,cursor:"pointer",fontSize:a.Z8,fontFamily:a.Rw},children:"reject"})]})]}),v&&!y&&i.length>0&&(null==(t=i[i.length-1])?void 0:t.text)&&(()=>{var e,t,n;let o=w||(null==(n=i[i.length-1])||null==(t=n.text)||null==(e=t.split("\n").filter(Boolean).pop())?void 0:e.slice(0,60))||null;return(0,r.jsxs)("div",{style:{padding:"4px 0",display:"flex",alignItems:"center",gap:6},children:[(0,r.jsx)("span",{style:{color:a.Y0},className:"working-dots",children:(0,r.jsx)("span",{className:"working-dots-mid"})}),o&&(0,r.jsx)("span",{style:{color:a.Y0,fontSize:a.Z8,fontFamily:a.Rw},children:o.slice(0,60)})]})})(),(0,r.jsx)("div",{ref:j})]})});function v(e){let{onApplyReviewFixes:t,onDismissReview:n}=e,[i,l]=(0,o.useState)(""),s=(0,o.useRef)(null);return(0,o.useEffect)(()=>{setTimeout(()=>{var e;return null==(e=s.current)?void 0:e.focus()},100)},[]),(0,r.jsxs)("div",{className:"px-3.5 py-2 font-mono text-term shrink-0",style:{background:"color-mix(in srgb, ".concat(a.DM," 5%, ").concat(a.gc,")"),boxShadow:"inset 0 1px 0 ".concat(a.DM,"10")},children:[t&&(0,r.jsx)("div",{className:"flex gap-1.5 items-center mb-2",children:(0,r.jsx)(p.A,{ref:s,type:"text",value:i,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),t(i||void 0))},placeholder:"Add feedback for the fix...",className:"",style:{flex:1}})}),(0,r.jsxs)("div",{className:"flex gap-2 justify-center",children:[t&&(0,r.jsx)(c.A,{variant:"success",size:"sm",onClick:()=>t(i||void 0),children:"apply fixes"}),n&&(0,r.jsx)(c.A,{variant:"ghost",size:"sm",onClick:n,children:"Dismiss"})]})]})}function y(e){let{color:t,font:n}=e,i=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let e,r=i.current;if(!r)return;let o=r.getContext("2d");if(!o)return;let l=[];function a(e){let t=window.devicePixelRatio||1,n=Math.max(r.width/t,r.clientWidth||300),o=Math.max(r.height/t,r.clientHeight||150);return{x:Math.random()*n,y:e?Math.random()*o:-(.3*Math.random()+.1)*o,digits:Array.from({length:12},()=>Math.random()>.5?"1":"0"),opacity:.12+.14*Math.random(),speed:60+40*Math.random()}}function s(){let e=window.devicePixelRatio||1,t=r.getBoundingClientRect();r.width=t.width*e,r.height=t.height*e,o.setTransform(e,0,0,e,0,0)}s();let d=new ResizeObserver(s);d.observe(r);for(let e=0;e<6;e++)l.push(a(!0));let c=performance.now();return e=requestAnimationFrame(function i(s){let d=(s-c)/1e3;c=s;let p=window.devicePixelRatio||1,x=Math.max(r.width/p,r.clientWidth||300),u=Math.max(r.height/p,r.clientHeight||150);for(let e of(o.clearRect(0,0,x,u),o.font="".concat(14,"px ").concat(n),o.textAlign="center",l)){e.y+=e.speed*d,o.fillStyle=t,o.globalAlpha=e.opacity;for(let t=0;t<e.digits.length;t++){let n=e.y+20*t;n>-20&&n<u+20&&o.fillText(e.digits[t],e.x,n)}e.y>u+20&&Object.assign(e,a(!1))}o.globalAlpha=1,e=requestAnimationFrame(i)}),()=>{cancelAnimationFrame(e),d.disconnect()}},[t,n]),(0,r.jsx)("canvas",{ref:i,style:{position:"absolute",inset:0,width:"100%",height:"100%",pointerEvents:"none"}})}let w=(0,o.memo)(function(e){var t,n,c,p;let{agentId:w,name:j,role:k,backend:R,status:S,cwd:N,workDir:C,messages:D,visibleMessages:M,hasMoreMessages:z,tokenUsage:F,isTeamLead:T,isTeamMember:E,isExternal:L,teamId:Z,teamPhase:A,pendingApproval:I,awaitingApproval:_,lastLogLine:H,busy:Y,pid:P,isOwner:B,isCollaborator:O,isSpectator:$,prompt:W,onPromptChange:K,pendingImages:q,onPendingImagesChange:U,suggestions:G,suggestText:V,onSuggestTextChange:J,onSubmit:X,onCancel:Q,onFire:ee,onApproval:et,onApprovePlan:en,onEndProject:er,onSuggest:eo,onPreview:ei,onLoadMore:el,onPasteImage:ea,onPasteText:es,onDropImage:ed,onQuickApprove:ec,onReview:ep,detectedBackends:ex,autoMerge:eu,pendingMerge:em,lastMergeCommit:eg,lastMergeMessage:ef,undoCount:eh,onMerge:eb,onRevert:ev,onUndoMerge:ey,reviewerOverlay:ew,onReviewerLoadMore:ej,onApplyReviewFixes:ek,onDismissReview:eR,scrollFrozen:eS,hideInfoRole:eN,inlineAvatar:eC}=e,eD=(0,l.DY)(),eM=null!=(n=eD[S])?n:eD.idle,ez=(0,o.useRef)(W),eF=""!==ez.current&&""===W;ez.current=W;let eT=i({msgCount:D.length,frozen:eS,key:w,forcePin:eF}),eE=(0,o.useRef)(null);(0,o.useEffect)(()=>{!W&&eE.current&&(eE.current.style.height="auto")},[W]);let[eL,eZ]=(0,o.useState)(!1),eA=(0,o.useRef)(null);(0,o.useEffect)(()=>{let e=eA.current;if(!e)return;let t=0,n=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>{eZ(e.scrollHeight-e.scrollTop-e.clientHeight>120)})};return e.addEventListener("scroll",n,{passive:!0}),()=>{e.removeEventListener("scroll",n),cancelAnimationFrame(t)}},[w]);let eI=(0,o.useCallback)(()=>{var e;null==(e=eT.current)||e.scrollIntoView({block:"end",behavior:"smooth"}),eZ(!1)},[eT]),e_=i({msgCount:null!=(c=null==ew?void 0:ew.messages.length)?c:0,frozen:!1,key:null!=(p=null==ew?void 0:ew.agentId)?p:""});return(0,r.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 relative",children:[(0,r.jsxs)("div",{className:(0,m.cn)("term-info-bar flex items-center gap-2 px-3 py-2 bg-term-surface font-mono text-term shrink-0","working"===S?"ap-status-working":"waiting_approval"===S?"ap-status-waiting":"done"===S?"ap-status-done":"error"===S?"ap-status-error":"ap-status-idle"),style:{borderBottom:"1px solid ".concat(a.JH),boxShadow:"0 2px 6px -1px rgba(0,0,0,0.45), inset 0 -1px 0 rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.03)"},children:[eC&&(()=>{var e,t,n;let o=eC.AvatarComponent,i=R?null!=(n=null==(e=l.GN.find(e=>e.id===R))?void 0:e.name)?n:R:null,s=null==k||null==(t=k.split("—")[0])?void 0:t.trim();return(0,r.jsxs)(r.Fragment,{children:[o&&(0,r.jsx)("div",{className:"relative w-[24px] h-[28px] overflow-hidden rounded-sm shrink-0",style:{border:"1px solid ".concat(a.JH)},children:(0,r.jsx)("div",{className:"-mt-px",children:(0,r.jsx)(o,{palette:eC.palette,zoom:1.5,ready:eC.assetsReady})})}),(0,r.jsx)("span",{className:"text-[13px] text-term-text-bright font-medium tracking-tight shrink-0",children:eC.name}),eC.isTeamLead&&(0,r.jsx)("span",{className:"text-[9px] font-mono font-bold text-sem-yellow px-[3px] leading-[15px] rounded-sm shrink-0",style:{border:"1px solid ".concat(a.O2,"40")},children:"LEAD"}),i&&(0,r.jsx)("span",{className:"text-[11px] text-term-text opacity-60 shrink-0 tracking-wide",children:i}),s&&(0,r.jsx)("span",{className:"text-[11px] text-term-text opacity-45 shrink-0 tracking-wide hidden sm:inline",children:s})]})})(),!eN&&!eC&&(0,r.jsx)("span",{className:"text-term-text-bright shrink-0 tracking-tight",children:null==k||null==(t=k.split("—")[0])?void 0:t.trim()}),(N||C)&&(()=>{var e;let t=null!=(e=null!=N?N:C)?e:"",n=t.replace(/^\/Users\/[^/]+/,"~");return(0,r.jsxs)(u.m_,{children:[(0,r.jsx)(u.k$,{asChild:!0,children:(0,r.jsx)("span",{className:"term-path-scroll",style:{color:a.lR,flexShrink:1,minWidth:0,opacity:.5,overflow:"hidden",whiteSpace:"nowrap",direction:"rtl",textAlign:"left",fontSize:a.Z8-1},children:(0,r.jsx)("bdi",{children:n})})}),(0,r.jsx)(u.ZI,{side:"bottom",className:"max-w-xs break-all",children:t})]})})(),(0,r.jsx)("span",{className:"flex-1"}),(0,r.jsxs)(u.m_,{children:[(0,r.jsx)(u.k$,{asChild:!0,children:(0,r.jsx)("span",{className:"shrink-0 w-[7px] h-[7px] rounded-full",style:{backgroundColor:eM.color,boxShadow:Y?"0 0 6px ".concat(eM.color,"60"):"none",animation:Y?"px-pulse-gold 1.5s ease infinite":"none"}})}),(0,r.jsx)(u.ZI,{side:"bottom",children:eM.label})]}),F.inputTokens>0&&(0,r.jsx)(d.TokenBadge,{inputTokens:F.inputTokens,outputTokens:F.outputTokens}),!Z&&B&&(0,r.jsxs)(u.m_,{children:[(0,r.jsx)(u.k$,{asChild:!0,children:(0,r.jsx)("button",{className:"tdx",onClick:e=>{e.stopPropagation(),ee(w)},"aria-label":"Fire agent",children:"✕"})}),(0,r.jsx)(u.ZI,{side:"bottom",children:"Fire agent"})]})]}),L&&(0,r.jsxs)("div",{className:"flex-1 flex flex-col bg-background min-h-0 overflow-hidden",children:[(0,r.jsxs)("div",{className:"px-3 py-2 bg-term-panel shrink-0 shadow-[0_3px_6px_-2px_rgba(0,0,0,0.45),inset_0_-1px_0_rgba(0,0,0,0.5),inset_0_1px_0_rgba(255,255,255,0.03)]",children:[(0,r.jsx)("div",{className:"font-mono text-term text-muted-foreground mb-1 tracking-wide",children:"EXTERNAL PROCESS"}),(0,r.jsxs)("div",{className:"flex gap-3 font-mono text-term text-muted-foreground flex-wrap",children:[(0,r.jsx)("span",{children:null!=R?R:"unknown"}),(0,r.jsxs)("span",{children:["PID ",null!=P?P:"—"]}),(0,r.jsx)("span",{className:"term-path-scroll max-w-[300px]",title:null!=N?N:void 0,children:null!=N?N:"—"})]})]}),(0,r.jsxs)("div",{"data-scrollbar":!0,className:"crt-screen flex-1 overflow-y-auto px-2.5 py-2 flex flex-col min-h-0",children:[0===D.length&&(0,r.jsx)(x,{message:"waiting for output"}),z&&(0,r.jsx)(h,{onLoadMore:el}),M.map(e=>(0,r.jsx)(g,{msg:e,agentName:j},e.id)),(0,r.jsx)("div",{ref:eT})]}),(0,r.jsx)("div",{className:"px-3 py-1.5 bg-muted font-mono text-term text-muted-foreground text-center shrink-0",children:"Read-only — this process is running externally"})]}),ew&&(0,r.jsxs)("div",{style:{position:"absolute",inset:0,zIndex:20,display:"flex",flexDirection:"column",background:"color-mix(in srgb, ".concat(a.DM," 4%, ").concat(a.lr,")"),animation:"review-overlay-in 0.3s ease-out",overflow:"hidden"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"7px 14px",background:"color-mix(in srgb, ".concat(a.DM," 6%, ").concat(a.gc,")"),boxShadow:"inset 0 -1px 0 ".concat(a.DM,"15"),fontSize:a.Z8,fontFamily:a.Rw,flexShrink:0},children:[(0,r.jsx)("span",{style:{color:a.DM,fontSize:9,fontWeight:600,padding:"1px 6px",borderRadius:3,background:"".concat(a.DM,"18"),letterSpacing:"0.04em",textTransform:"uppercase"},children:"REVIEW"}),(0,r.jsx)("span",{style:{color:a.oj},children:ew.name}),ew.busy&&(0,r.jsx)("span",{className:"working-dots",style:{color:a.DM},children:(0,r.jsx)("span",{className:"working-dots-mid"})}),!ew.busy&&ew.verdict&&"UNKNOWN"!==ew.verdict&&(0,r.jsx)("span",{style:{fontSize:9,fontWeight:600,padding:"1px 6px",borderRadius:3,letterSpacing:"0.04em",textTransform:"uppercase",color:"PASS"===ew.verdict?a.$C:a.v_,background:"PASS"===ew.verdict?"".concat(a.$C,"18"):"".concat(a.v_,"18")},children:ew.verdict}),!ew.busy&&"error"===ew.status&&(0,r.jsx)("span",{style:{color:a.v_,fontSize:9,fontWeight:600,padding:"1px 6px",borderRadius:3,background:"".concat(a.v_,"18"),letterSpacing:"0.04em",textTransform:"uppercase"},children:"ERROR"}),(0,r.jsx)("span",{style:{flex:1}}),ew.tokenUsage.inputTokens>0&&(0,r.jsx)(d.TokenBadge,{inputTokens:ew.tokenUsage.inputTokens,outputTokens:ew.tokenUsage.outputTokens}),ew.busy&&eR&&(0,r.jsx)("button",{onClick:eR,style:{padding:"1px 6px",border:"1px solid ".concat(a.KD),borderRadius:3,backgroundColor:"transparent",color:a.Y0,fontSize:a.Z8,fontFamily:a.Rw,cursor:"pointer",flexShrink:0,lineHeight:1.2},onMouseEnter:e=>{e.currentTarget.style.color=a.lR},onMouseLeave:e=>{e.currentTarget.style.color=a.Y0},children:"\xd7"})]}),ew.busy?(0,r.jsxs)("div",{style:{flex:1,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:0},children:[(0,r.jsx)("div",{className:"review-scan-grid",style:{position:"absolute",inset:0,opacity:.06,backgroundImage:"linear-gradient(".concat(a.DM," 1px, transparent 1px), linear-gradient(90deg, ").concat(a.DM," 1px, transparent 1px)"),backgroundSize:"24px 24px"}}),(0,r.jsx)(y,{color:a.DM,font:a.Rw}),(0,r.jsx)("div",{className:"review-scan-sweep",style:{position:"absolute",left:0,right:0,height:2,background:"linear-gradient(90deg, transparent, ".concat(a.DM,", transparent)"),boxShadow:"0 0 20px 4px ".concat(a.DM,"50, 0 0 60px 8px ").concat(a.DM,"20"),animation:"review-scan-sweep 2.4s ease-in-out infinite"}}),(0,r.jsx)("div",{className:"review-scan-trail",style:{position:"absolute",left:0,right:0,height:40,background:"linear-gradient(180deg, ".concat(a.DM,"12, transparent)"),animation:"review-scan-sweep 2.4s ease-in-out infinite"}}),(0,r.jsxs)("div",{style:{position:"relative",zIndex:1,textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:10},children:[(0,r.jsxs)("div",{style:{position:"relative",width:40,height:40},children:[(0,r.jsx)("div",{className:"review-scan-ring",style:{position:"absolute",inset:0,borderRadius:"50%",border:"1.5px solid ".concat(a.DM,"60"),animation:"review-scan-pulse 2s ease-in-out infinite"}}),(0,r.jsx)("div",{style:{position:"absolute",inset:8,borderRadius:"50%",background:"radial-gradient(circle, ".concat(a.DM,"30, transparent 70%)"),animation:"review-scan-pulse 2s ease-in-out infinite 0.3s"}}),(0,r.jsx)("div",{style:{position:"absolute",top:"50%",left:"50%",width:4,height:4,marginTop:-2,marginLeft:-2,borderRadius:"50%",backgroundColor:a.DM,boxShadow:"0 0 8px ".concat(a.DM)}})]}),(0,r.jsx)("span",{style:{fontFamily:a.Rw,fontSize:a.Z8,color:a.DM,letterSpacing:"0.08em",textTransform:"uppercase",fontWeight:500,opacity:.8},children:"reviewing"})]}),[{top:12,left:12,borderTop:"1px solid ".concat(a.DM,"30"),borderLeft:"1px solid ".concat(a.DM,"30")},{top:12,right:12,borderTop:"1px solid ".concat(a.DM,"30"),borderRight:"1px solid ".concat(a.DM,"30")},{bottom:12,left:12,borderBottom:"1px solid ".concat(a.DM,"30"),borderLeft:"1px solid ".concat(a.DM,"30")},{bottom:12,right:12,borderBottom:"1px solid ".concat(a.DM,"30"),borderRight:"1px solid ".concat(a.DM,"30")}].map((e,t)=>(0,r.jsx)("div",{style:{position:"absolute",width:16,height:16,...e}},t))]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{"data-scrollbar":!0,className:"term-dotgrid term-chat-area",style:{flex:1,overflowY:"auto",padding:"8px 14px",display:"flex",flexDirection:"column",minHeight:0},children:[(()=>{let e=ew.visibleMessages.filter(e=>"user"!==e.role&&e.text);return e.length>0?e.map(e=>(0,r.jsx)(g,{msg:e,agentName:ew.name},e.id)):ew.reviewResultText?(0,r.jsx)("div",{style:{color:"error"===ew.status?a.v_:a.lR,fontSize:a.Z8,fontFamily:a.Rw,padding:"8px 0",wordBreak:"break-word",lineHeight:1.7},className:"chat-markdown",children:(0,r.jsx)(d.MdContent,{text:ew.reviewResultText})}):(0,r.jsx)("div",{style:{color:a.Y0,fontSize:a.Z8,fontFamily:a.Rw,padding:"8px 0"},children:"(No review content)"})})(),(0,r.jsx)("div",{ref:e_})]}),(0,r.jsx)(v,{onApplyReviewFixes:"PASS"!==ew.verdict?ek:void 0,onDismissReview:eR})]})]}),!L&&(0,r.jsxs)("div",{onPaste:ea,onDragOver:e=>{var t,n;(null==(n=e.dataTransfer)||null==(t=n.types)?void 0:t.includes("Files"))&&(e.preventDefault(),e.currentTarget.style.outline="2px solid ".concat(a.O2,"60"))},onDragLeave:e=>{e.currentTarget.style.outline="none"},onDrop:e=>{e.currentTarget.style.outline="none",ed(e)},className:"crt-screen flex-1 flex flex-col bg-background min-h-0 overflow-hidden",children:[(0,r.jsxs)("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[(0,r.jsx)("div",{ref:eA,"data-scrollbar":!0,className:"term-dotgrid term-chat-area flex-1 overflow-y-auto px-3.5 pt-3.5 pb-2.5 flex flex-col min-h-0",children:(0,r.jsx)(b,{visibleMessages:M,hasMoreMessages:z,messages:D,name:j,agentId:w,onPreview:ei,onReview:ew||eR?void 0:ep,isTeamLead:T,isTeamMember:E,teamPhase:A,detectedBackends:ex,onLoadMore:el,busy:Y,pendingApproval:I,lastLogLine:H,chatEndRef:eT,isOwner:B,onApproval:et})}),(0,r.jsxs)("div",{className:"scroll-pill".concat(eL?" visible":""),onClick:eI,role:"button","aria-label":"Scroll to bottom",children:[(0,r.jsx)("span",{className:"scroll-pill-arrow",children:"↓"}),"new messages"]}),!Y&&B&&!Z&&!E&&!em&&(null!=eh?eh:0)>0&&ey&&(0,r.jsxs)("button",{className:"term-btn",onClick:ey,style:{position:"absolute",bottom:8,right:14,display:"inline-flex",alignItems:"center",gap:5,padding:"4px 12px",border:"1px solid color-mix(in srgb, var(--term-accent) 55%, transparent)",backgroundColor:"var(--term-bg)",color:"var(--term-accent)",fontSize:a.Z8,cursor:"pointer",fontFamily:a.Rw,zIndex:2,borderRadius:3,opacity:.85},children:[(0,r.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M2 6l4-4 4 4"}),(0,r.jsx)("path",{d:"M6 2v8a4 4 0 0 0 4 4h2"})]}),"Undo (",eh,")"]})]}),!$&&G.length>0&&(0,r.jsxs)("div",{"data-scrollbar":!0,style:{padding:"6px 10px",backgroundColor:a.lr,maxHeight:120,overflowY:"auto",boxShadow:"inset 0 1px 0 rgba(255,255,255,0.03), 0 -2px 4px rgba(0,0,0,0.2)"},children:[(0,r.jsx)("div",{style:{fontSize:a.Z8,color:a.Y0,fontFamily:a.Rw,marginBottom:4,letterSpacing:"0.05em"},children:"SUGGESTIONS"}),G.slice(-10).map((e,t)=>(0,r.jsxs)("div",{style:{fontSize:a.Z8,color:a.lR,marginBottom:2,lineHeight:1.65,fontFamily:a.Rw},children:[(0,r.jsxs)("span",{style:{color:a.Y0},children:[e.author,":"]})," ",e.text]},t))]}),q.length>0&&(0,r.jsxs)("div",{style:{padding:"6px 10px",backgroundColor:a.lr,display:"flex",gap:6,flexWrap:"wrap",alignItems:"center",boxShadow:"inset 0 1px 0 rgba(255,255,255,0.03), 0 -2px 4px rgba(0,0,0,0.2)"},children:[q.map((e,t)=>(0,r.jsxs)("div",{style:{position:"relative",display:"inline-block"},children:[(0,r.jsx)("img",{src:e.dataUrl,alt:e.name,style:{height:48,borderRadius:4,border:"1px solid ".concat(a.JH)}}),(0,r.jsx)("button",{onClick:()=>U(q.filter((e,n)=>n!==t)),style:{position:"absolute",top:-4,right:-4,width:16,height:16,borderRadius:"50%",border:"none",backgroundColor:a.v_,color:"#fff",fontSize:10,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,lineHeight:1},children:"\xd7"})]},t)),(0,r.jsxs)("span",{style:{fontSize:a.Z8,color:a.Y0,fontFamily:a.Rw},children:[q.length," image",q.length>1?"s":""," attached"]})]}),(()=>{let e=T?A:null;return $?(0,r.jsx)("div",{className:"px-2.5 py-2 bg-muted shrink-0 font-mono text-term text-muted-foreground text-center shadow-[0_-3px_6px_-2px_rgba(0,0,0,0.35),inset_0_1px_0_rgba(255,255,255,0.03)]",children:"Watching — read-only mode"}):O?(0,r.jsx)("div",{style:{padding:"8px 10px",background:a.gc,flexShrink:0,boxShadow:"0 -3px 6px -2px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.03)"},children:(0,r.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,r.jsx)("textarea",{rows:1,value:V,onChange:e=>{J(e.target.value),f(e.currentTarget)},onKeyDown:e=>(0,s.$$)(e)&&(e.preventDefault(),eo()),placeholder:"Share an idea...",maxLength:500,style:{flex:1,padding:"6px 10px",border:"1px solid ".concat(a.KD),backgroundColor:a.lr,color:a.lR,fontSize:a.Z8,outline:"none",resize:"none",lineHeight:"20px",fontFamily:a.Rw}}),(0,r.jsx)("button",{onClick:eo,disabled:!V.trim(),style:{padding:"6px 14px",border:"1px solid ".concat(a.Y0),backgroundColor:"transparent",color:V.trim()?a.lR:a.Y0,fontSize:a.Z8,cursor:V.trim()?"pointer":"default",fontFamily:a.Rw},children:"suggest"})]})}):(0,r.jsx)("div",{className:"term-input-area px-3 py-2 bg-term-panel shrink-0",children:E?(0,r.jsx)("div",{className:"text-center text-muted-foreground font-mono text-term py-2",children:"Tasks are assigned by the Team Lead"}):"execute"===e?(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[(0,r.jsxs)("div",{className:"term-input-well",children:[(0,r.jsx)("span",{style:{color:Y?a.Y0:a.DM,fontSize:a.Z8,fontFamily:a.Rw,padding:"6px 0 6px 8px",flexShrink:0,textShadow:"none"},children:">"}),(0,r.jsx)("textarea",{ref:eE,rows:1,className:"term-input",value:W,onPaste:es,onChange:e=>{K(e.target.value),f(e.currentTarget)},onKeyDown:e=>{if("Escape"===e.key&&Y)return void Q();(0,s.$$)(e)&&(e.preventDefault(),X())},placeholder:Y?"esc stop \xb7 type to continue":"",style:{flex:1,padding:"6px 5px",border:"none",backgroundColor:"transparent",color:a.oj,fontSize:a.Z8,outline:"none",fontFamily:a.Rw,fontWeight:400,caretColor:a.DM,resize:"none",lineHeight:"20px"}})]}),!Y&&(0,r.jsx)("span",{onClick:er,style:{padding:"2px 8px 4px",color:a.Y0,fontSize:12,cursor:"pointer",fontFamily:a.Rw},children:"close project"})]}):"design"!==e||Y?"complete"!==e||Y?Y||!B||Z||E||!em?_&&!Y?(0,r.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center",padding:"4px 0"},children:[(0,r.jsx)("button",{className:"term-btn",onClick:ec,style:{padding:"5px 14px",border:"1px solid ".concat(a.DM,"60"),backgroundColor:"transparent",color:a.DM,fontSize:a.Z8,cursor:"pointer",fontFamily:a.Rw,flexShrink:0},children:"approve"}),(0,r.jsxs)("div",{className:"term-input-well",style:{flex:1},children:[(0,r.jsx)("span",{style:{color:a.Y0,fontSize:a.Z8,fontFamily:a.Rw,padding:"0 0 0 6px"},children:">"}),(0,r.jsx)("textarea",{ref:eE,rows:1,className:"term-input",value:W,onPaste:es,onChange:e=>{K(e.target.value),f(e.currentTarget)},onKeyDown:e=>{(0,s.$$)(e)&&(e.preventDefault(),X())},placeholder:"or give feedback...",style:{flex:1,padding:"5px 6px",border:"none",backgroundColor:"transparent",color:a.oj,fontSize:a.Z8,outline:"none",fontFamily:a.Rw,caretColor:a.DM,resize:"none",lineHeight:"20px"}})]})]}):(0,r.jsxs)("div",{className:"term-input-well",children:[(0,r.jsx)("span",{style:{color:Y?a.Y0:a.DM,fontSize:a.Z8,fontFamily:a.Rw,padding:"6px 0 6px 8px",flexShrink:0,textShadow:"none"},children:">"}),(0,r.jsx)("textarea",{ref:eE,rows:1,className:"term-input",value:W,onPaste:es,onChange:e=>{K(e.target.value),f(e.currentTarget)},onKeyDown:e=>{if("Escape"===e.key&&Y)return void Q();(0,s.$$)(e)&&(e.preventDefault(),X())},placeholder:Y?"esc stop \xb7 type to continue":"",style:{flex:1,padding:"6px 5px",border:"none",backgroundColor:"transparent",color:a.oj,fontSize:a.Z8,outline:"none",fontFamily:a.Rw,fontWeight:400,caretColor:a.DM,resize:"none",lineHeight:"20px"},autoFocus:!0})]}):(0,r.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center",padding:"4px 0"},children:[!eu&&eb&&(0,r.jsxs)("button",{className:"term-btn",onClick:eb,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"5px 14px",border:"1px solid ".concat(a.DM,"60"),backgroundColor:"transparent",color:a.DM,fontSize:a.Z8,cursor:"pointer",fontFamily:a.Rw,flexShrink:0},children:[(0,r.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("path",{d:"M12 3v6M4 3v10M4 13l4-4 4 0"})}),"Merge"]}),!eu&&ev&&(0,r.jsxs)("button",{className:"term-btn",onClick:ev,style:{display:"inline-flex",alignItems:"center",gap:5,padding:"5px 14px",border:"1px solid ".concat(a.O2,"40"),backgroundColor:"transparent",color:a.O2,fontSize:a.Z8,cursor:"pointer",fontFamily:a.Rw,flexShrink:0},children:[(0,r.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M2 6l4-4 4 4"}),(0,r.jsx)("path",{d:"M6 2v8a4 4 0 0 0 4 4h2"})]}),"Revert"]}),(0,r.jsxs)("div",{className:"term-input-well",style:{flex:1,display:"flex",alignItems:"center"},children:[(0,r.jsx)("span",{style:{color:a.Y0,fontSize:a.Z8,fontFamily:a.Rw,padding:"0 0 0 8px",flexShrink:0},children:">"}),(0,r.jsx)("textarea",{ref:eE,rows:1,className:"term-input",value:W,onPaste:es,onChange:e=>{K(e.target.value),f(e.currentTarget)},onKeyDown:e=>{(0,s.$$)(e)&&(e.preventDefault(),X())},placeholder:"send a new task...",style:{flex:1,padding:"5px 6px",border:"none",backgroundColor:"transparent",color:a.oj,fontSize:a.Z8,outline:"none",fontFamily:a.Rw,caretColor:a.DM,resize:"none",lineHeight:"20px"}})]})]}):(0,r.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center",padding:"4px 0"},children:[(0,r.jsxs)("div",{className:"term-input-well",style:{flex:1},children:[(0,r.jsx)("span",{style:{color:a.Y0,fontSize:a.Z8,fontFamily:a.Rw,padding:"0 0 0 6px"},children:">"}),(0,r.jsx)("textarea",{ref:eE,rows:1,className:"term-input",value:W,onPaste:es,onChange:e=>{K(e.target.value),f(e.currentTarget)},onKeyDown:e=>{(0,s.$$)(e)&&(e.preventDefault(),X())},placeholder:"request changes...",style:{flex:1,padding:"5px 6px",border:"none",backgroundColor:"transparent",color:a.oj,fontSize:a.Z8,outline:"none",fontFamily:a.Rw,caretColor:a.DM,resize:"none",lineHeight:"20px"}})]}),(0,r.jsx)("button",{onClick:er,style:{padding:"5px 14px",border:"1px solid ".concat(a.O2,"40"),backgroundColor:"transparent",color:a.O2,fontSize:a.Z8,cursor:"pointer",fontFamily:a.Rw,flexShrink:0},children:"Close Project"})]}):(0,r.jsxs)("div",{style:{display:"flex",gap:6,alignItems:"center",padding:"4px 0"},children:[(0,r.jsx)("button",{className:"term-btn",onClick:en,style:{padding:"5px 14px",border:"1px solid ".concat(a.DM,"60"),backgroundColor:"transparent",color:a.DM,fontSize:a.Z8,cursor:"pointer",fontFamily:a.Rw,flexShrink:0},children:"approve"}),(0,r.jsxs)("div",{className:"term-input-well",style:{flex:1},children:[(0,r.jsx)("span",{style:{color:a.Y0,fontSize:a.Z8,fontFamily:a.Rw,padding:"0 0 0 6px"},children:">"}),(0,r.jsx)("textarea",{ref:eE,rows:1,className:"term-input",value:W,onPaste:es,onChange:e=>{K(e.target.value),f(e.currentTarget)},onKeyDown:e=>{(0,s.$$)(e)&&(e.preventDefault(),X())},placeholder:"or give feedback...",style:{flex:1,padding:"5px 6px",border:"none",backgroundColor:"transparent",color:a.oj,fontSize:a.Z8,outline:"none",fontFamily:a.Rw,caretColor:a.DM,resize:"none",lineHeight:"20px"}})]})]})})})()]})]})})},8163:(e,t,n)=>{n.d(t,{TooltipProvider:()=>a,ZI:()=>c,k$:()=>d,m_:()=>s});var r=n(206),o=n(1406),i=n(3767),l=n(9385);let a=i.Kq,s=i.bL,d=i.l9,c=o.forwardRef((e,t)=>{let{className:n,sideOffset:o=4,...a}=e;return(0,r.jsx)(i.ZL,{children:(0,r.jsx)(i.UC,{ref:t,sideOffset:o,className:(0,l.cn)("z-[50000] overflow-hidden","px-2.5 py-1.5","bg-term-panel border border-border shadow-lg","font-mono text-[11px] text-foreground","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2",n),...a})})});c.displayName=i.UC.displayName},9362:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(206),o=n(1406),i=n(9385);let l=o.forwardRef((e,t)=>{let{className:n,type:o,...l}=e;return(0,r.jsx)("input",{type:o,className:(0,i.cn)("flex w-full px-2.5 py-1 h-7","border border-border bg-background text-foreground","font-mono text-term leading-4","outline-none focus-visible:outline-none transition-colors duration-fast","placeholder:text-term-green-dim placeholder:opacity-50","focus:border-term-green-dim","disabled:cursor-not-allowed disabled:opacity-50",n),ref:t,...l})});l.displayName="Input",o.forwardRef((e,t)=>{let{className:n,...o}=e;return(0,r.jsx)("textarea",{className:(0,i.cn)("flex w-full px-2.5 py-1 resize-none","border border-border bg-background text-foreground","font-mono text-term leading-4","outline-none focus-visible:outline-none transition-colors duration-fast","placeholder:text-term-green-dim placeholder:opacity-50","focus:border-term-green-dim","disabled:cursor-not-allowed disabled:opacity-50",n),ref:t,...o})}).displayName="Textarea";let a=(0,o.forwardRef)(function(e,t){let{inline:n,className:o,...a}=e;return(0,r.jsx)(l,{ref:t,className:(0,i.cn)(n&&"border-none bg-transparent text-term-text-bright caret-accent px-1.5 py-1.5 focus:border-none focus:shadow-none",o),...a})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[73,895],{73:(e,t,n)=>{n.r(t),n.d(t,{default:()=>a});var l=n(206),r=n(1406),o=n(2988);let a=function(e){let{palette:t,zoom:n=3,ready:a}=e,i=(0,r.useRef)(null);return(0,r.useEffect)(()=>{var e,l;let r=i.current;if(!r)return;let a=(0,o.Cr)(t);if(!a)return;let s=a.length,d=null!=(l=null==(e=a[0])?void 0:e.length)?l:0;r.width=d*n,r.height=s*n;let c=r.getContext("2d");if(c){c.clearRect(0,0,r.width,r.height);for(let e=0;e<s;e++)for(let t=0;t<d;t++){let l=a[e][t];l&&(c.fillStyle=l,c.fillRect(t*n,e*n,n,n))}}},[t,n,a]),(0,l.jsx)("canvas",{ref:i,style:{width:16*n,height:32*n,imageRendering:"pixelated"}})}},5895:(e,t,n)=>{n.r(t),n.d(t,{default:()=>g});var l=n(206),r=n(1406),o=n(2001),a=n(7821),i=n(4932),s=n(73),d=n(1310),c=n(370),u=n(9362),m=n(138);let p="#e5c07b";function x(e){let{value:t,onSelect:n}=e,[o,s]=(0,r.useState)(""),[d,c]=(0,r.useState)(!1),m=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=e=>{m.current&&!m.current.contains(e.target)&&c(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let p=o.toLowerCase(),x=p?a.XB.map(e=>({...e,agents:e.agents.filter(t=>t.name.toLowerCase().includes(p)||t.desc.toLowerCase().includes(p)||e.label.toLowerCase().includes(p))})).filter(e=>e.agents.length>0):a.XB;return(0,l.jsxs)("div",{ref:m,style:{position:"relative"},children:[(0,l.jsx)(u.A,{value:d?o:t,onChange:e=>{s(e.target.value),d||c(!0)},onFocus:()=>{c(!0),s("")},placeholder:"Search roles or type custom..."}),d&&(0,l.jsxs)("div",{"data-scrollbar":!0,style:{position:"absolute",top:"100%",left:0,right:0,zIndex:200,maxHeight:250,overflowY:"auto",backgroundColor:i.lr,border:"1px solid ".concat(i.KD),borderTop:"none"},children:[x.map(e=>(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{padding:"4px 10px",fontSize:10,color:i.Y0,fontFamily:"var(--font-mono)",textTransform:"uppercase",letterSpacing:"0.05em",backgroundColor:i.lr,position:"sticky",top:0},children:e.label}),e.agents.map(e=>(0,l.jsx)("div",{onClick:()=>{n(e.name),c(!1),s("")},style:{padding:"5px 10px",fontSize:13,fontFamily:"var(--font-mono)",color:e.name===t?i.DM:i.lR,cursor:"pointer",backgroundColor:e.name===t?"".concat(i.DM,"18"):"transparent"},onMouseEnter:n=>{e.name!==t&&(n.currentTarget.style.backgroundColor=i.nY)},onMouseLeave:n=>{e.name!==t&&(n.currentTarget.style.backgroundColor="transparent")},children:e.name},e.name))]},e.category)),0===x.length&&o.trim()&&(0,l.jsxs)("div",{onClick:()=>{n(o.trim()),c(!1),s("")},style:{padding:"8px 10px",fontSize:13,fontFamily:"var(--font-mono)",color:i.Y0,cursor:"pointer"},children:['Use custom: "',o.trim(),'"']})]})]})}function f(e){let{onSave:t,onCancel:n}=e,[o,a]=(0,r.useState)(""),[i,s]=(0,r.useState)("");return(0,l.jsxs)("div",{style:{border:"1px solid ".concat(p,"40"),backgroundColor:"".concat(p,"08"),padding:10,marginTop:6},children:[(0,l.jsx)("div",{style:{fontSize:11,color:p,marginBottom:6,fontFamily:"var(--font-mono)",letterSpacing:"0.05em"},children:"NEW SKILL FILE"}),(0,l.jsx)(u.A,{value:o,onChange:e=>a(e.target.value),placeholder:"Skill name (e.g. tdd, react-patterns)",style:{marginBottom:6}}),(0,l.jsx)("textarea",{className:"ti ti-textarea",value:i,onChange:e=>s(e.target.value),placeholder:"# Skill Title\n\nPaste or type skill content in Markdown...",rows:5,style:{resize:"vertical",marginBottom:6,width:"100%",boxSizing:"border-box"}}),(0,l.jsxs)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:[(0,l.jsx)(c.A,{variant:"dim",onClick:n,style:{padding:"4px 10px",fontSize:12},children:"Cancel"}),(0,l.jsx)(c.A,{variant:"primary",onClick:()=>{let e=o.trim().toLowerCase().replace(/[^a-z0-9_-]/g,"-").replace(/^-|-$/g,"");e&&i.trim()&&t(e,i)},disabled:!o.trim()||!i.trim(),style:{padding:"4px 10px",fontSize:12},children:"Save Skill"})]})]})}let g=function(e){var t,n,u;let{onSave:p,onClose:g,assetsReady:h,editAgent:y,sendCommand:v}=e,[b,j]=(0,r.useState)(null!=(t=null==y?void 0:y.palette)?t:Math.floor(6*Math.random())),[S,C]=(0,r.useState)(()=>{if(!(null==y?void 0:y.role))return 0;let e=a.os.indexOf(y.role);return e>=0?e:-1}),[k,w]=(0,r.useState)(()=>(null==y?void 0:y.role)?a.os.indexOf(y.role)>=0?"":y.role:""),z=(0,m.hK)(e=>e.availableSkills),[L,N]=(0,r.useState)(()=>{var e;return new Set(null!=(e=null==y?void 0:y.skillFiles)?e:[])}),[A,F]=(0,r.useState)(!1);(0,r.useEffect)(()=>{null==v||v({type:"LIST_SKILLS"})},[v]);let I=S>=0?a.os[S]:k.trim(),R=e=>{N(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[E,B]=(0,r.useState)(()=>{if(!y)return 0;let e=a.eU.findIndex(e=>e.value===y.personality);return e>=0?e:4}),[D,M]=(0,r.useState)(null!=(n=null==y?void 0:y.personality)?n:""),Y=E<3?a.eU[E].value:D,T=null!=(u=null==y?void 0:y.name)?u:I;return(0,l.jsxs)(d.A,{open:!0,onClose:g,maxWidth:440,zIndex:110,title:y?"Edit Agent":"Create Agent",className:"max-h-[min(712px,85vh)]",footer:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.A,{variant:"primary",onClick:()=>{var e,t,n;if(!I.trim())return;let l=y?y.id:(T.trim().toLowerCase().replace(/[^a-z0-9\u4e00-\u9fff]+/g,"-").replace(/^-|-$/g,"")||"agent")+"-".concat((0,o.Ak)(4)),r=Array.from(L);p({id:l,name:T.trim(),role:I,skills:null!=(e=a.Qw.get(I))?e:"",personality:Y,palette:b,isBuiltin:null!=(t=null==y?void 0:y.isBuiltin)&&t,teamRole:null!=(n=null==y?void 0:y.teamRole)?n:"dev",...r.length>0?{skillFiles:r}:{}})},disabled:!I.trim(),style:{flex:1,fontWeight:700},children:y?"Save":"Create"}),(0,l.jsx)(c.A,{variant:"dim",onClick:g,children:"Cancel"})]}),children:[(0,l.jsxs)("div",{className:"mb-3",children:[(0,l.jsx)("div",{className:"text-term text-muted-foreground font-mono tracking-wide mb-1",children:"AVATAR"}),(0,l.jsx)("div",{className:"flex gap-1",children:[0,1,2,3,4,5].map(e=>(0,l.jsx)("button",{onClick:()=>j(e),style:{padding:3,border:b===e?"2px solid ".concat(i.DM):"2px solid ".concat(i.KD),backgroundColor:b===e?"".concat(i.DM,"18"):"transparent",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,l.jsx)(s.default,{palette:e,zoom:2,ready:h})},e))})]}),(0,l.jsxs)("div",{style:{marginBottom:8,position:"relative"},children:[(0,l.jsx)("div",{className:"text-term text-muted-foreground font-mono tracking-wide mb-1",children:"ROLE"}),(0,l.jsx)(x,{value:I,onSelect:e=>{let t=a.os.indexOf(e);t>=0?C(t):(C(-1),w(e))}}),a.Qw.get(I)&&(0,l.jsx)("div",{style:{fontSize:11,color:i.Y0,marginTop:4,fontFamily:"var(--font-mono)",lineHeight:1.4},children:a.Qw.get(I)})]}),(0,l.jsxs)("div",{style:{marginBottom:8},children:[(0,l.jsxs)("div",{style:{fontSize:12,color:i.Y0,marginBottom:4,fontFamily:"var(--font-mono)",letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,l.jsx)("span",{children:"SKILL FILES"}),(0,l.jsx)("span",{style:{fontSize:10,color:i.Y0,fontWeight:400},children:".md instructions auto-loaded by AI"})]}),z.length>0&&(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:3,marginBottom:6},children:z.map(e=>{let t=L.has(e.name);return(0,l.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 8px",cursor:"pointer",fontSize:13,fontFamily:"var(--font-mono)",color:t?i.lR:i.Y0,backgroundColor:t?"".concat(i.DM,"0c"):"transparent",border:"1px solid ".concat(t?i.DM+"30":"transparent")},children:[(0,l.jsx)("input",{type:"checkbox",checked:t,onChange:()=>R(e.name),style:{accentColor:i.DM,cursor:"pointer"}}),(0,l.jsx)("span",{style:{flex:1},children:e.title}),e.isFolder&&(0,l.jsx)("span",{style:{fontSize:10,color:i.Y0,opacity:.6},title:"Folder with multiple files",children:"[dir]"})]},e.name)})}),(()=>{let e=new Set(z.map(e=>e.name)),t=Array.from(L).filter(t=>!e.has(t));return 0===t.length?null:(0,l.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:6},children:t.map(e=>(0,l.jsxs)("span",{style:{padding:"2px 8px",fontSize:12,fontFamily:"var(--font-mono)",border:"1px solid ".concat(i.KD),color:i.Y0,opacity:.5,display:"flex",alignItems:"center",gap:4},children:[e,(0,l.jsx)("span",{onClick:()=>R(e),style:{cursor:"pointer",fontSize:14,lineHeight:1},children:"\xd7"})]},e))})})(),0===z.length&&!A&&(0,l.jsx)("div",{style:{fontSize:12,color:i.Y0,fontFamily:"var(--font-mono)",marginBottom:4,opacity:.7},children:"No skill files yet."}),A?(0,l.jsx)(f,{onSave:(e,t)=>{null==v||v({type:"SAVE_SKILL",name:e,content:t}),N(t=>new Set(t).add(e)),F(!1)},onCancel:()=>F(!1)}):(0,l.jsx)(c.A,{variant:"dim",onClick:()=>F(!0),style:{padding:"4px 10px",fontSize:12,width:"100%"},children:"+ Create Skill File"})]}),(0,l.jsxs)("div",{style:{marginBottom:10},children:[(0,l.jsx)("div",{className:"text-term text-muted-foreground font-mono tracking-wide mb-1",children:"PERSONALITY"}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-x-2 gap-y-1",children:[a.eU.map((e,t)=>(0,l.jsxs)("label",{className:"flex items-center gap-1.5 px-1.5 py-1 cursor-pointer font-mono text-[13px]",style:{color:E===t?i.lR:i.Y0},children:[(0,l.jsx)("input",{type:"radio",name:"personality",checked:E===t,onChange:()=>B(t),style:{accentColor:i.DM,cursor:"pointer"}}),e.label]},t)),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 px-1.5 py-1 cursor-pointer font-mono text-[13px]",style:{color:3===E?i.lR:i.Y0},children:[(0,l.jsx)("input",{type:"radio",name:"personality",checked:3===E,onChange:()=>B(3),style:{accentColor:i.DM,cursor:"pointer"}}),"Custom"]})]}),3===E&&(0,l.jsx)("textarea",{className:"ti ti-textarea mt-1.5",value:D,onChange:e=>M(e.target.value),placeholder:"Describe the personality...",rows:2,style:{resize:"vertical"}})]})]})}},9362:(e,t,n)=>{n.d(t,{A:()=>i});var l=n(206),r=n(1406),o=n(9385);let a=r.forwardRef((e,t)=>{let{className:n,type:r,...a}=e;return(0,l.jsx)("input",{type:r,className:(0,o.cn)("flex w-full px-2.5 py-1 h-7","border border-border bg-background text-foreground","font-mono text-term leading-4","outline-none focus-visible:outline-none transition-colors duration-fast","placeholder:text-term-green-dim placeholder:opacity-50","focus:border-term-green-dim","disabled:cursor-not-allowed disabled:opacity-50",n),ref:t,...a})});a.displayName="Input",r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,l.jsx)("textarea",{className:(0,o.cn)("flex w-full px-2.5 py-1 resize-none","border border-border bg-background text-foreground","font-mono text-term leading-4","outline-none focus-visible:outline-none transition-colors duration-fast","placeholder:text-term-green-dim placeholder:opacity-50","focus:border-term-green-dim","disabled:cursor-not-allowed disabled:opacity-50",n),ref:t,...r})}).displayName="Textarea";let i=(0,r.forwardRef)(function(e,t){let{inline:n,className:r,...i}=e;return(0,l.jsx)(a,{ref:t,className:(0,o.cn)(n&&"border-none bg-transparent text-term-text-bright caret-accent px-1.5 py-1.5 focus:border-none focus:shadow-none",r),...i})})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[73,999],{73:(e,t,l)=>{l.r(t),l.d(t,{default:()=>i});var o=l(206),r=l(1406),n=l(2988);let i=function(e){let{palette:t,zoom:l=3,ready:i}=e,a=(0,r.useRef)(null);return(0,r.useEffect)(()=>{var e,o;let r=a.current;if(!r)return;let i=(0,n.Cr)(t);if(!i)return;let d=i.length,s=null!=(o=null==(e=i[0])?void 0:e.length)?o:0;r.width=s*l,r.height=d*l;let c=r.getContext("2d");if(c){c.clearRect(0,0,r.width,r.height);for(let e=0;e<d;e++)for(let t=0;t<s;t++){let o=i[e][t];o&&(c.fillStyle=o,c.fillRect(t*l,e*l,l,l))}}},[t,l,i]),(0,o.jsx)("canvas",{ref:a,style:{width:16*l,height:32*l,imageRendering:"pixelated"}})}},7999:(e,t,l)=>{l.r(t),l.d(t,{default:()=>m});var o=l(206),r=l(1406),n=l(2001),i=l(5192),a=l(138),d=l(7821),s=l(4932),c=l(73),p=l(1310),f=l(370),u=l(9362);let m=function(e){var t,l;let{agentDefs:m,onCreateTeam:x,onClose:g,assetsReady:h,detectedBackends:v}=e,y=m.find(e=>"leader"===e.teamRole),b=m.find(e=>"reviewer"===e.teamRole),j=m.filter(e=>"dev"===e.teamRole),[k,w]=(0,r.useState)(null!=(l=null==(t=j[0])?void 0:t.id)?l:""),[C,S]=(0,r.useState)({}),[E,R]=(0,r.useState)(""),z=[];return y&&z.push({def:y,label:"LEAD"}),b&&z.push({def:b,label:"REVIEWER"}),(0,o.jsxs)(p.A,{open:!0,onClose:g,maxWidth:540,zIndex:100,title:"Hire Team",footer:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(f.A,{variant:"primary",onClick:()=>{if(!y)return;let e=[];k&&e.push(k),b&&e.push(b.id),x(y.id,e,C,E||void 0)},disabled:!y,style:{flex:1,fontWeight:700},children:"Create Team"}),(0,o.jsx)(f.A,{variant:"dim",onClick:g,children:"Cancel"})]}),children:[(0,o.jsxs)("div",{style:{marginBottom:12},children:[(0,o.jsx)("div",{style:{fontSize:12,color:s.Y0,marginBottom:5,fontFamily:"var(--font-mono)",letterSpacing:"0.05em"},children:"PROJECT DIRECTORY"}),(0,o.jsxs)("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[(0,o.jsx)(u.A,{type:"text",value:E,onChange:e=>R(e.target.value),placeholder:"Paste path or click Browse",style:{flex:1}}),(0,o.jsx)(f.A,{variant:"dim",onClick:()=>{let e=(0,n.Ak)(6);a.sX.set(e,e=>R(e)),(0,i.S8)({type:"PICK_FOLDER",requestId:e})},children:"Browse"})]}),(0,o.jsx)("div",{style:{fontSize:10,color:s.Y0,marginTop:3,fontFamily:"var(--font-mono)",opacity:.7},children:"Empty = default workspace"})]}),(0,o.jsx)("div",{style:{fontSize:12,color:s.Y0,marginBottom:6,fontFamily:"var(--font-mono)",letterSpacing:"0.05em"},children:"SELECT TEAM MEMBERS"}),(0,o.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:12},children:[z.map(e=>{var t;let{def:l,label:r}=e;return(0,o.jsxs)("div",{title:l.skills?"Skills: ".concat(l.skills):void 0,style:{display:"flex",alignItems:"center",gap:8,padding:"7px 10px",border:"1px solid ".concat(s.O2,"70"),backgroundColor:s.nY,textAlign:"left"},children:[(0,o.jsx)(c.default,{palette:l.palette,zoom:2,ready:h}),(0,o.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,o.jsxs)("div",{style:{fontSize:15,fontWeight:700,color:s.oj},children:[l.name," ",(0,o.jsx)("span",{style:{color:s.O2,fontSize:11,fontFamily:"var(--font-mono)"},children:r})]}),(0,o.jsx)("div",{style:{fontSize:13,color:s.Y0},children:l.role})]}),(0,o.jsx)("select",{value:null!=(t=C[l.id])?t:"claude",onClick:e=>e.stopPropagation(),onChange:e=>S(t=>({...t,[l.id]:e.target.value})),style:{padding:"3px 6px",border:"1px solid ".concat(s.KD),backgroundColor:s.lr,color:s.Y0,fontSize:12,cursor:"pointer",fontFamily:"var(--font-mono)"},children:d.GN.map(e=>(0,o.jsxs)("option",{value:e.id,children:[e.name,v&&v.length>0&&!v.includes(e.id)?" (?)":""]},e.id))})]},l.id)}),(0,o.jsx)("div",{style:{fontSize:12,color:s.Y0,marginTop:4,marginBottom:4,fontFamily:"var(--font-mono)",letterSpacing:"0.05em"},children:"DEV AGENT (pick 1)"}),(0,o.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:5},children:j.map(e=>{var t;let l=k===e.id;return(0,o.jsxs)("button",{onClick:()=>w(e.id),title:e.skills?"Skills: ".concat(e.skills):void 0,style:{display:"flex",flexDirection:"column",alignItems:"center",padding:"12px 6px 10px",border:l?"1px solid ".concat(s.DM,"60"):"1px solid ".concat(s.KD),backgroundColor:l?"".concat(s.DM,"0a"):"transparent",cursor:"pointer",textAlign:"center",opacity:l?1:.5,transition:"opacity 0.15s, border-color 0.15s, background-color 0.15s"},children:[(0,o.jsx)(c.default,{palette:e.palette,zoom:2,ready:h}),(0,o.jsx)("div",{style:{fontSize:14,fontWeight:700,color:s.oj,marginTop:6,width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),(0,o.jsx)("div",{style:{fontSize:12,color:s.Y0,marginTop:2,width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.role}),(0,o.jsx)("select",{value:null!=(t=C[e.id])?t:"claude",onClick:t=>{t.stopPropagation(),w(e.id)},onChange:t=>{w(e.id),S(l=>({...l,[e.id]:t.target.value}))},style:{marginTop:6,padding:"3px 6px",border:"1px solid ".concat(s.KD),backgroundColor:s.lr,color:s.Y0,fontSize:12,cursor:"pointer",fontFamily:"var(--font-mono)"},children:d.GN.map(e=>(0,o.jsxs)("option",{value:e.id,children:[e.name,v&&v.length>0&&!v.includes(e.id)?" (?)":""]},e.id))})]},e.id)})})]})]})}},9362:(e,t,l)=>{l.d(t,{A:()=>a});var o=l(206),r=l(1406),n=l(9385);let i=r.forwardRef((e,t)=>{let{className:l,type:r,...i}=e;return(0,o.jsx)("input",{type:r,className:(0,n.cn)("flex w-full px-2.5 py-1 h-7","border border-border bg-background text-foreground","font-mono text-term leading-4","outline-none focus-visible:outline-none transition-colors duration-fast","placeholder:text-term-green-dim placeholder:opacity-50","focus:border-term-green-dim","disabled:cursor-not-allowed disabled:opacity-50",l),ref:t,...i})});i.displayName="Input",r.forwardRef((e,t)=>{let{className:l,...r}=e;return(0,o.jsx)("textarea",{className:(0,n.cn)("flex w-full px-2.5 py-1 resize-none","border border-border bg-background text-foreground","font-mono text-term leading-4","outline-none focus-visible:outline-none transition-colors duration-fast","placeholder:text-term-green-dim placeholder:opacity-50","focus:border-term-green-dim","disabled:cursor-not-allowed disabled:opacity-50",l),ref:t,...r})}).displayName="Textarea";let a=(0,r.forwardRef)(function(e,t){let{inline:l,className:r,...a}=e;return(0,o.jsx)(i,{ref:t,className:(0,n.cn)(l&&"border-none bg-transparent text-term-text-bright caret-accent px-1.5 py-1.5 focus:border-none focus:shadow-none",r),...a})})}}]);
|