bit-office 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/dist/index.js +1983 -362
  2. package/dist/index.js.map +1 -1
  3. package/dist/web/out/404.html +50 -2
  4. package/dist/web/out/Office Tileset/Office Tileset All 16x16.png +0 -0
  5. package/dist/web/out/_next/static/chunks/757.6d61de28074ba8d4.js +1 -0
  6. package/dist/web/out/_next/static/chunks/904.36d527a30eef4423.js +1 -0
  7. package/dist/web/out/_next/static/chunks/989-4c2c2b3a6c2f8a4a.js +1 -0
  8. package/dist/web/out/_next/static/chunks/app/office/page-e71fd886e7258e88.js +1 -0
  9. package/dist/web/out/_next/static/chunks/app/pair/page-667d7c599a584eb6.js +1 -0
  10. package/dist/web/out/_next/static/chunks/{webpack-131b3d260a3d9ce4.js → webpack-6eaa423ee729538f.js} +1 -1
  11. package/dist/web/out/index.html +50 -2
  12. package/dist/web/out/index.txt +67 -17
  13. package/dist/web/out/office.html +50 -2
  14. package/dist/web/out/office.txt +68 -17
  15. package/dist/web/out/pair.html +50 -2
  16. package/dist/web/out/pair.txt +68 -17
  17. package/dist/web/out/pixel-agents-layout.json +1 -2802
  18. package/dist/web/out/sw.js +1 -1
  19. package/package.json +2 -1
  20. package/dist/web/out/_next/static/chunks/757.6b9b9f11f348e673.js +0 -1
  21. package/dist/web/out/_next/static/chunks/904.4649cb92e3c1355c.js +0 -1
  22. package/dist/web/out/_next/static/chunks/989-f3ebca68e0b5e7ee.js +0 -1
  23. package/dist/web/out/_next/static/chunks/app/office/page-75459bb9d7bfe004.js +0 -1
  24. package/dist/web/out/_next/static/chunks/app/pair/page-932b6cbad193cd3d.js +0 -1
  25. /package/dist/web/out/_next/static/{KVUUasWqYxW6SNCIo9Tbn → e3jju679hIWY5j_P8PYTf}/_buildManifest.js +0 -0
  26. /package/dist/web/out/_next/static/{KVUUasWqYxW6SNCIo9Tbn → e3jju679hIWY5j_P8PYTf}/_ssgManifest.js +0 -0
@@ -1,7 +1,55 @@
1
- <!DOCTYPE html><!--KVUUasWqYxW6SNCIo9Tbn--><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="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-131b3d260a3d9ce4.js"/><script src="/_next/static/chunks/4d67e943-e6a0fd3b5c397505.js" async=""></script><script src="/_next/static/chunks/977-26ddf708be8caf79.js" async=""></script><script src="/_next/static/chunks/main-app-4f4b0701adf58469.js" async=""></script><meta name="robots" content="noindex"/><meta name="theme-color" content="#1a1a2e"/><title>404: This page could not be found.</title><title>Bit Office</title><meta name="description" content="Control your AI agents from anywhere"/><link rel="manifest" href="/manifest.json"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body style="margin:0;background-color:#1a1a2e;color:#fff;font-family:system-ui, sans-serif"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script>
1
+ <!DOCTYPE html><!--e3jju679hIWY5j_P8PYTf--><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="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-6eaa423ee729538f.js"/><script src="/_next/static/chunks/4d67e943-e6a0fd3b5c397505.js" async=""></script><script src="/_next/static/chunks/977-26ddf708be8caf79.js" async=""></script><script src="/_next/static/chunks/main-app-4f4b0701adf58469.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"/><title>404: This page could not be found.</title><meta name="robots" content="noindex"/><title>Bit 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=Press+Start+2P&amp;display=swap" rel="stylesheet"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body style="margin:0;background-color:#1a1530;color:#eddcb8;font-family:system-ui, sans-serif"><div hidden=""><!--$--><!--/$--></div><style>
2
+ :root {
3
+ --px-bg-deep: #16122a;
4
+ --px-bg-panel: #1e1a30;
5
+ --px-bg-card: #231e38;
6
+ --px-bg-chat: #1a1530;
7
+ --px-border: #3d2e54;
8
+ --px-border-warm: #5a3d14;
9
+ --px-gold: #e8b040;
10
+ --px-gold-dim: #a87820;
11
+ --px-text: #eddcb8;
12
+ --px-text-muted: #9a8a68;
13
+ --px-text-dim: #6a5a48;
14
+ --px-amber: #e0900a;
15
+ --px-amber-bg: rgba(232, 176, 64, 0.14);
16
+ }
17
+ * {
18
+ scrollbar-width: thin;
19
+ scrollbar-color: #5a3d14 #1a1530;
20
+ }
21
+ *::-webkit-scrollbar {
22
+ width: 4px;
23
+ height: 4px;
24
+ }
25
+ *::-webkit-scrollbar-track {
26
+ background: transparent;
27
+ }
28
+ *::-webkit-scrollbar-thumb {
29
+ background: #3d2d10;
30
+ border-radius: 0;
31
+ }
32
+ *::-webkit-scrollbar-thumb:hover {
33
+ background: #e8b040;
34
+ }
35
+ *::-webkit-scrollbar-corner {
36
+ background: transparent;
37
+ }
38
+ .px-font {
39
+ font-family: 'Press Start 2P', monospace;
40
+ }
41
+ @keyframes px-blink {
42
+ 0%, 49% { opacity: 1; }
43
+ 50%, 100% { opacity: 0; }
44
+ }
45
+ @keyframes px-pulse-gold {
46
+ 0%, 100% { box-shadow: 0 0 0 0 rgba(200,155,48,0); }
47
+ 50% { box-shadow: 0 0 8px 2px rgba(200,155,48,0.25); }
48
+ }
49
+ </style><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script>
2
50
  if ('serviceWorker' in navigator && location.hostname === 'localhost') {
3
51
  navigator.serviceWorker.getRegistrations().then(function(regs) {
4
52
  for (var r of regs) r.unregister();
5
53
  });
6
54
  }
7
- </script><script src="/_next/static/chunks/webpack-131b3d260a3d9ce4.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[9653,[],\"\"]\n3:I[1329,[],\"\"]\n4:I[9096,[],\"OutletBoundary\"]\n6:I[913,[],\"AsyncMetadataOutlet\"]\n8:I[9096,[],\"ViewportBoundary\"]\na:I[9096,[],\"MetadataBoundary\"]\nb:\"$Sreact.suspense\"\nd:I[5719,[],\"\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"KVUUasWqYxW6SNCIo9Tbn\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"meta\",null,{\"name\":\"theme-color\",\"content\":\"#1a1a2e\"}],[\"$\",\"meta\",null,{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"}]]}],[\"$\",\"body\",null,{\"style\":{\"margin\":0,\"backgroundColor\":\"#1a1a2e\",\"color\":\"#fff\",\"fontFamily\":\"system-ui, sans-serif\"},\"children\":[[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}],[\"$\",\"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 \"}}]]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$L5\",[\"$\",\"$L6\",null,{\"promise\":\"$@7\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],null],[\"$\",\"$La\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$b\",null,{\"fallback\":null,\"children\":\"$Lc\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n5:null\n"])</script><script>self.__next_f.push([1,"7:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Bit 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,"c:\"$7:metadata\"\n"])</script></body></html>
55
+ </script><script src="/_next/static/chunks/webpack-6eaa423ee729538f.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n3:I[9653,[],\"\"]\n4:I[1329,[],\"\"]\n9:I[5719,[],\"\"]\n2:T5c9,"])</script><script>self.__next_f.push([1,"\n :root {\n --px-bg-deep: #16122a;\n --px-bg-panel: #1e1a30;\n --px-bg-card: #231e38;\n --px-bg-chat: #1a1530;\n --px-border: #3d2e54;\n --px-border-warm: #5a3d14;\n --px-gold: #e8b040;\n --px-gold-dim: #a87820;\n --px-text: #eddcb8;\n --px-text-muted: #9a8a68;\n --px-text-dim: #6a5a48;\n --px-amber: #e0900a;\n --px-amber-bg: rgba(232, 176, 64, 0.14);\n }\n * {\n scrollbar-width: thin;\n scrollbar-color: #5a3d14 #1a1530;\n }\n *::-webkit-scrollbar {\n width: 4px;\n height: 4px;\n }\n *::-webkit-scrollbar-track {\n background: transparent;\n }\n *::-webkit-scrollbar-thumb {\n background: #3d2d10;\n border-radius: 0;\n }\n *::-webkit-scrollbar-thumb:hover {\n background: #e8b040;\n }\n *::-webkit-scrollbar-corner {\n background: transparent;\n }\n .px-font {\n font-family: 'Press Start 2P', monospace;\n }\n @keyframes px-blink {\n 0%, 49% { opacity: 1; }\n 50%, 100% { opacity: 0; }\n }\n @keyframes px-pulse-gold {\n 0%, 100% { box-shadow: 0 0 0 0 rgba(200,155,48,0); }\n 50% { box-shadow: 0 0 8px 2px rgba(200,155,48,0.25); }\n }\n "])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"e3jju679hIWY5j_P8PYTf\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"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=Press+Start+2P\u0026display=swap\",\"rel\":\"stylesheet\"}]]}],[\"$\",\"body\",null,{\"style\":{\"margin\":0,\"backgroundColor\":\"#1a1530\",\"color\":\"#eddcb8\",\"fontFamily\":\"system-ui, sans-serif\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"$2\"}}],[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}],[\"$\",\"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 \"}}]]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$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\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],\"$L5\",\"$L6\"]}]}]],null,\"$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\"\n5:[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}]\n6:[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]\n7:[\"$\",\"$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\":\"Bit 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([[757],{3757:(e,o,t)=>{t.r(o),t.d(o,{default:()=>d});var n=t(206),r=t(1406);let a={position:"absolute",bottom:10,left:10,zIndex:15,display:"flex",alignItems:"center",gap:2,background:"#1e1a30",border:"1px solid #3d2e54",borderRadius:0,padding:"3px 4px",boxShadow:"2px 2px 0px rgba(0,0,0,0.6)"},l={padding:"5px 10px",fontSize:"11px",fontFamily:"monospace",color:"#7a6858",background:"transparent",border:"1px solid transparent",borderRadius:0,cursor:"pointer",letterSpacing:"0.03em"},s={...l,background:"rgba(200, 155, 48, 0.12)",border:"1px solid #e8b04060",color:"#e8b040"};function d(e){let{editMode:o,onToggleEditMode:t,onOpenSettings:d}=e,[i,u]=(0,r.useState)(null);return(0,n.jsxs)("div",{style:a,children:[(0,n.jsx)("button",{onClick:t,onMouseEnter:()=>u("edit"),onMouseLeave:()=>u(null),style:o?s:{...l,background:"edit"===i?"rgba(200,155,48,0.08)":l.background,color:"edit"===i?"#a08a6c":l.color},title:"Edit office layout",children:"Layout"}),(0,n.jsx)("button",{onClick:d,onMouseEnter:()=>u("settings"),onMouseLeave:()=>u(null),style:{...l,background:"settings"===i?"rgba(200,155,48,0.08)":l.background,color:"settings"===i?"#a08a6c":l.color},title:"Settings",children:"Settings"})]})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[904],{5702:(e,t,r)=>{r.d(t,{Y:()=>i,k:()=>a});let l=new Map,n=new WeakMap;function i(e){let t=n.get(e);if(t)return t;let r=e.length,l=e[0].length,i=[];for(let e=0;e<r+2;e++)i.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,n=r+1;""===i[l-1][n]&&(i[l-1][n]="#FFFFFF"),""===i[l+1][n]&&(i[l+1][n]="#FFFFFF"),""===i[l][n-1]&&(i[l][n-1]="#FFFFFF"),""===i[l][n+1]&&(i[l][n+1]="#FFFFFF")}for(let t=0;t<r;t++)for(let r=0;r<l;r++)""!==e[t][r]&&(i[t+1][r+1]="");return n.set(e,i),i}function a(e,t){let r=l.get(t);r||(r=new WeakMap,l.set(t,r));let n=r.get(e);if(n)return n;let i=e.length,a=e[0].length,o=document.createElement("canvas");o.width=a*t,o.height=i*t;let s=o.getContext("2d");s.imageSmoothingEnabled=!1;for(let r=0;r<i;r++)for(let l=0;l<a;l++){let n=e[r][l];""!==n&&(s.fillStyle=n,s.fillRect(l*t,r*t,t,t))}return r.set(e,o),o}},6904:(e,t,r)=>{r.r(t),r.d(t,{default:()=>k});var l=r(206),n=r(1406),i=r(8474),a=r(5195);function o(e,t,r,l){let n=r.length,i=n>0?r[0].length:0;if(t<0||t>=n||e<0||e>=i)return!1;let o=r[t][e];return!(o===a.nb.WALL||o===a.nb.VOID||l.has("".concat(e,",").concat(t)))}function s(e,t){let r=e.length,l=r>0?e[0].length:0,n=[];for(let i=0;i<r;i++)for(let r=0;r<l;r++)o(r,i,e,t)&&n.push({col:r,row:i});return n}function u(e,t,r,l,n,i){if(e===r&&t===l)return[];let a=(e,t)=>"".concat(e,",").concat(t),s=a(e,t),u=a(r,l);if(!o(r,l,n,i))return[];let c=new Set;c.add(s);let h=new Map,f=[{col:e,row:t}],d=[{dc:0,dr:-1},{dc:0,dr:1},{dc:-1,dr:0},{dc:1,dr:0}];for(;f.length>0;){let e=f.shift(),t=a(e.col,e.row);if(t===u){let e=[],t=u;for(;t!==s;){let[r,l]=t.split(",").map(Number);e.unshift({col:r,row:l}),t=h.get(t)}return e}for(let r of d){let l=e.col+r.dc,s=e.row+r.dr,u=a(l,s);!c.has(u)&&o(l,s,n,i)&&(c.add(u),h.set(u,t),f.push({col:l,row:s}))}}return[]}var c=r(2243);let h=new Set(["Read","Grep","Glob","WebFetch","WebSearch"]);function f(e,t){return{x:e*a.dn+a.dn/2,y:t*a.dn+a.dn/2}}function d(e,t,r,l){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=l?l.seatCol:1,o=l?l.seatRow:1,s=f(i,o);return{id:e,state:a.Lp.TYPE,dir:l?l.facingDir:a.OP.DOWN,x:s.x,y:s.y,tileCol:i,tileRow:o,path:[],moveProgress:0,currentTool:null,palette:t,hueShift:n,frame:0,frameTimer:0,wanderTimer:0,wanderCount:0,wanderLimit:m(c.Rb,c.he),isActive:!0,seatId:r,bubbleType:null,bubbleTimer:0,speechText:null,speechTimer:0,seatTimer:0,isSubagent:!1,parentAgentId:null,matrixEffect:null,matrixEffectTimer:0,matrixEffectSeeds:[]}}function g(e,t){return e+Math.random()*(t-e)}function m(e,t){return e+Math.floor(Math.random()*(t-e+1))}function b(e,t,r){return(7*e+13*t+31*Math.floor(r*c.vU)&255)<c.gB}function p(){let e=[];for(let t=0;t<c.W3;t++)e.push(Math.random());return e}var w=r(9631),T=r(9892);class y{setLayout(e){for(let t of(this.layout=e,this.tileMap=(0,w.MB)(e),this.seats=(0,w.CW)(e.furniture),this.blockedTiles=(0,w.AI)(e.furniture),this.furniture=(0,w.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)}}this.rebuildFurnitureInstances()}addCharacter(e,t,r){let l;if(this.agentIdToCharId.has(e))return;let n=this.nextCharId++;this.agentIdToCharId.set(e,n),this.charIdToAgentId.set(n,e);let{palette:i,hueShift:o}=void 0!==r?{palette:r,hueShift:0}:this.pickDiversePalette(),s=this.findFreeSeat();if(s){let e=this.seats.get(s);e.assigned=!0,l=d(n,i,s,e,o)}else{let e=this.walkableTiles.length>0?this.walkableTiles[Math.floor(Math.random()*this.walkableTiles.length)]:{col:1,row:1};(l=d(n,i,null,null,o)).x=e.col*a.dn+a.dn/2,l.y=e.row*a.dn+a.dn/2,l.tileCol=e.col,l.tileRow=e.row}l.matrixEffect="spawn",l.matrixEffectTimer=0,l.matrixEffectSeeds=p(),this.characters.set(n,l)}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=p(),r.bubbleType=null}}updateCharacterStatus(e,t){let r=this.agentIdToCharId.get(e);if(void 0===r)return;let l=this.characters.get(r);if(!l)return;let n=l.isActive,i="working"===t||"waiting_approval"===t;l.isActive=i,!i&&n?(l.seatTimer=-1,l.path=[],l.moveProgress=0,this.rebuildFurnitureInstances()):i&&!n&&this.rebuildFurnitureInstances()}selectCharacter(e){if(null===e){this.selectedCharId=null;return}let t=this.agentIdToCharId.get(e);this.selectedCharId=null!=t?t:null}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=c.WK))}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,c.M_)))}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>c.lO?t.slice(0,c.lO)+"...":t,l.speechTimer=c.Jk)}getCharacters(){return Array.from(this.characters.values())}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){for(let l of this.getCharacters().sort((e,t)=>t.y-e.y)){if("despawn"===l.matrixEffect)continue;let n=l.state===a.Lp.TYPE?c.iE:0,i=l.y+n,o=l.x-c.Ns,s=l.x+c.Ns,u=i-c.o3;if(e>=o&&e<=s&&t>=u&&t<=i){var r;return null!=(r=this.charIdToAgentId.get(l.id))?r:null}}return null}setHoveredCharAtPixel(e,t){for(let r of this.getCharacters().sort((e,t)=>t.y-e.y)){if("despawn"===r.matrixEffect)continue;let l=r.state===a.Lp.TYPE?c.iE:0,n=r.y+l,i=r.x-c.Ns,o=r.x+c.Ns,s=n-c.o3;if(e>=i&&e<=o&&t>=s&&t<=n){this.hoveredCharId=r.id;return}}this.hoveredCharId=null}update(e){let t=[];for(let r of this.characters.values()){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));continue}this.withOwnSeatUnblocked(r,()=>(function(e,t,r,l,n,i){switch(e.frameTimer+=t,e.state){case a.Lp.TYPE:if(e.frameTimer>=c.S3&&(e.frameTimer-=c.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(c.wj,c.k8),e.wanderCount=0,e.wanderLimit=m(c.Rb,c.he)}break;case a.Lp.IDLE:if(e.frame=0,e.seatTimer<0&&(e.seatTimer=0),e.isActive){if(!e.seatId){e.state=a.Lp.TYPE,e.frame=0,e.frameTimer=0;break}let t=l.get(e.seatId);if(t){let r=u(e.tileCol,e.tileRow,t.seatCol,t.seatRow,n,i);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.wanderTimer-=t,e.wanderTimer<=0){if(e.wanderCount>=e.wanderLimit&&e.seatId){let t=l.get(e.seatId);if(t){let r=u(e.tileCol,e.tileRow,t.seatCol,t.seatRow,n,i);if(r.length>0){e.path=r,e.moveProgress=0,e.state=a.Lp.WALK,e.frame=0,e.frameTimer=0;break}}}if(r.length>0){let t=r[Math.floor(Math.random()*r.length)],l=u(e.tileCol,e.tileRow,t.col,t.row,n,i);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(c.wj,c.k8)}break;case a.Lp.WALK:{if(e.frameTimer>=c.lY&&(e.frameTimer-=c.lY,e.frame=(e.frame+1)%4),0===e.path.length){let t=f(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.TYPE;else{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(c.Ot,c.Ww),e.wanderCount=0,e.wanderLimit=m(c.Rb,c.he),e.frame=0,e.frameTimer=0;break}}e.state=a.Lp.IDLE,e.wanderTimer=g(c.wj,c.k8)}e.frame=0,e.frameTimer=0;break}let r=e.path[0];e.dir=function(e,t,r,l){let n=r-e;return n>0?a.OP.RIGHT:n<0?a.OP.LEFT:l-t>0?a.OP.DOWN:a.OP.UP}(e.tileCol,e.tileRow,r.col,r.row),e.moveProgress+=c.XE/a.dn*t;let o=f(e.tileCol,e.tileRow),s=f(r.col,r.row),h=Math.min(e.moveProgress,1);if(e.x=o.x+(s.x-o.x)*h,e.y=o.y+(s.y-o.y)*h,e.moveProgress>=1&&(e.tileCol=r.col,e.tileRow=r.row,e.x=s.x,e.y=s.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=u(e.tileCol,e.tileRow,t.seatCol,t.seatRow,n,i);r.length>0&&(e.path=r,e.moveProgress=0)}}}}}})(r,e,this.walkableTiles,this.seats,this.tileMap,this.blockedTiles)),"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))}for(let e of t){let t=this.charIdToAgentId.get(e);this.characters.delete(e),t&&(this.agentIdToCharId.delete(t),this.charIdToAgentId.delete(e))}}findFreeSeat(){for(let[e,t]of this.seats)if(!t.assigned)return e;return null}pickDiversePalette(){let e=Array(c.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<c.ic;l++)e[l]===t&&r.push(l);let l=r[Math.floor(Math.random()*r.length)],n=0;return t>0&&(n=c.qt+Math.floor(Math.random()*c.p7)),{palette:l,hueShift:n}}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);r&&this.blockedTiles.delete(r);let l=t();return r&&this.blockedTiles.add(r),l}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,n=r.facingDir===a.OP.DOWN?1:r.facingDir===a.OP.UP?-1:0;for(let t=1;t<=c.Xo;t++)e.add("".concat(r.seatCol+l*t,",").concat(r.seatRow+n*t));for(let t=1;t<=c.ou;t++){let i=r.seatCol+l*t,a=r.seatRow+n*t;0!==l?(e.add("".concat(i,",").concat(a-1)),e.add("".concat(i,",").concat(a+1))):(e.add("".concat(i-1,",").concat(a)),e.add("".concat(i+1,",").concat(a)))}}if(0===e.size){this.furniture=(0,w.Co)(this.layout.furniture);return}let t=this.layout.furniture.map(t=>{let r=(0,T.Um)(t.type);if(!r)return t;for(let l=0;l<r.footprintH;l++)for(let n=0;n<r.footprintW;n++)if(e.has("".concat(t.col+n,",").concat(t.row+l))){let e=(0,T.xr)(t.type);if(e!==t.type)return{...t,type:e};return t}return t});this.furniture=(0,w.Co)(t)}constructor(e){this.characters=new Map,this.selectedCharId=null,this.hoveredCharId=null,this.agentIdToCharId=new Map,this.charIdToAgentId=new Map,this.nextCharId=1,this.layout=e||(0,w.kr)(),this.tileMap=(0,w.MB)(this.layout),this.seats=(0,w.CW)(this.layout.furniture),this.blockedTiles=(0,w.AI)(this.layout.furniture),this.furniture=(0,w.Co)(this.layout.furniture),this.walkableTiles=s(this.tileMap,this.blockedTiles)}}var C=r(5702),v=r(2988),x=r(4777),I=r(5055),M=r(4296),R=r(1204);function k(e){let{onAgentClick:t,selectedAgent:r,editMode:o,editorRef:s,onTileClick:u,onTileRightClick:f,onGhostMove:d,onDragStart:g,onDragMove:m,onDragEnd:p,onDeleteBtnClick:w,onRotateBtnClick:k,stateRef:S,onAssetsLoaded:E,zoomRef:L,panRef:P}=e,A=(0,n.useRef)(null),Y=(0,n.useRef)(null),F=(0,n.useRef)(new Set),B=(0,n.useRef)(new Map),W=(0,n.useRef)(new Map),D=(0,n.useRef)(0),[X,O]=(0,n.useState)(!1),U=(0,n.useRef)(null),z=(0,n.useRef)(t);z.current=t;let H=(0,n.useRef)(o);H.current=o;let N=(0,n.useRef)(!1),V=(0,n.useRef)({x:0,y:0,panX:0,panY:0}),_=(0,n.useRef)({offsetX:0,offsetY:0});(0,n.useRef)(0);let j=(0,n.useRef)(null),q=(0,n.useCallback)((e,t)=>{let r=S.current;if(!r)return 4;let l=r.layout.cols*c.dn,n=r.layout.rows*c.dn;return Math.max(c.DH,Math.floor(Math.min(e/l,t/n)))},[S]),G=(0,n.useCallback)(()=>{let e=A.current;if(!e)return;let t=e.parentElement;if(!t)return;let r=window.devicePixelRatio||1,l=t.clientWidth,n=t.clientHeight;e.width=l*r,e.height=n*r,e.style.width="".concat(l,"px"),e.style.height="".concat(n,"px");let i=e.getContext("2d");i&&i.scale(r,r),L.current=q(l,n),P.current={x:0,y:0}},[q,L,P]);(0,n.useEffect)(()=>{let e=!1;return(0,M.F)().then(t=>{e||((0,T.ar)(t.tilesetSprites),U.current=t.layout,O(!0),null==E||E())}).catch(t=>{console.warn("[OfficeCanvas] Asset loading failed, using fallbacks:",t),e||(O(!0),null==E||E())}),()=>{e=!0}},[E]),(0,n.useEffect)(()=>{var e,t;if(!X)return;let r=A.current;if(!r)return;let l=new y(null!=(e=U.current)?e:void 0);S.current=l,G(),window.addEventListener("resize",G);let n=i.f.getState();for(let[e,r]of n.agents)l.addCharacter(e,r.name,r.palette),l.updateCharacterStatus(e,r.status),F.current.add(e),B.current.set(e,r.messages.length),W.current.set(e,null!=(t=r.lastLogLine)?t:null);D.current=n.teamMessages.length;let o=window.devicePixelRatio||1,u=function(e,t){let r=e.getContext("2d");r.imageSmoothingEnabled=!1;let l=0,n=0,i=!1,a=e=>{if(i)return;let o=0===l?0:Math.min((e-l)/1e3,c.O9);l=e,t.update(o),r.imageSmoothingEnabled=!1,t.render(r),n=requestAnimationFrame(a)};return n=requestAnimationFrame(a),()=>{i=!0,cancelAnimationFrame(n)}}(r,{update:e=>{l.update(e)},render:e=>{let t,n=r.width/o,i=r.height/o,u=L.current,f=P.current,d=s.current;if(H.current){let e=null;if(d.activeTool===a.VF.FURNITURE_PLACE&&d.selectedFurnitureType){let t=(0,T.Um)(d.selectedFurnitureType);t&&(e=t.sprite)}if(d.dragUid){let t=l.layout.furniture.find(e=>e.uid===d.dragUid);if(t){let r=(0,T.Um)(t.type);r&&(e=r.sprite)}}let r=!1,n=0,i=0,o=1,s=1,u=!1;if(d.selectedFurnitureUid){let e=l.layout.furniture.find(e=>e.uid===d.selectedFurnitureUid);if(e){var g,m;let t=(0,T.Um)(e.type);r=!0,n=e.col,i=e.row,o=null!=(g=null==t?void 0:t.footprintW)?g:1,s=null!=(m=null==t?void 0:t.footprintH)?m:1,u=(0,T.ZZ)(e.type)}}t={showGrid:!0,ghostSprite:e,ghostCol:d.ghostCol,ghostRow:d.ghostRow,ghostValid:d.ghostValid,hasSelection:r,selectedCol:n,selectedRow:i,selectedW:o,selectedH:s,isRotatable:u,deleteButtonBounds:null,rotateButtonBounds:null,showGhostBorder:!0,ghostBorderHoverCol:d.ghostCol,ghostBorderHoverRow:d.ghostRow}}_.current=function(e,t,r,l,n,i,o,s,u,f,d,g,m,p,w){e.clearRect(0,0,t,r);let T=null!=m?m:l.length>0?l[0].length:0,y=null!=p?p:l.length,M=T*a.dn*o,R=y*a.dn*o,k=Math.floor((t-M)/2)+Math.round(s),S=Math.floor((r-R)/2)+Math.round(u);!function(e,t,r,l,n,i,o){let s=a.dn*n,u=(0,x.$0)(),h=t.length,f=h>0?t[0].length:0,d=null!=o?o:f;for(let o=0;o<h;o++)for(let h=0;h<f;h++){var g;let f=t[o][h];if(f===a.nb.VOID)continue;if(f===a.nb.WALL||!u){if(f===a.nb.WALL){let t=o*d+h,r=null==i?void 0:i[t];e.fillStyle=r?(0,I.og)(r):x.ty}else e.fillStyle=c.q3;e.fillRect(r+h*s,l+o*s,s,s);continue}let m=o*d+h,b=null!=(g=null==i?void 0:i[m])?g:{h:0,s:0,b:0,c:0},p=(0,x.To)(f,b),w=(0,C.k)(p,n);e.drawImage(w,r+h*s,l+o*s)}}(e,l,k,S,o,g,m);let E=(0,I.BN)()?(0,I.vb)(l,g,m):[];return!function(e,t,r,l,n,i,o,s){let u=[];for(let e of t){let t=(0,C.k)(e.sprite,i),r=l+e.x*i,a=n+e.y*i;u.push({zY:e.zY,draw:e=>{e.drawImage(t,r,a)}})}for(let e of r){let t=(0,v.Ih)(e.palette,e.hueShift),r=function(e,t){switch(e.state){case a.Lp.TYPE:var r;if((r=e.currentTool)&&h.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),f=(0,C.k)(r,i),d=e.state===a.Lp.TYPE?c.iE:0,g=Math.round(l+e.x*i-f.width/2),m=Math.round(n+(e.y+d)*i-f.height),p=e.y+a.dn/2+c.Sg;if(e.matrixEffect){let t=e;u.push({zY:p,draw:e=>{!function(e,t,r,l,n,i){let o=t.matrixEffectTimer/a.Pz,s="spawn"===t.matrixEffect,u=t.matrixEffectTimer,h=c.wN+c.M1;for(let a=0;a<c.W3;a++){var f,d;let g=Math.max(0,Math.min(1,(o-(null!=(f=t.matrixEffectSeeds[a])?f:0)*c.hI)/(1-c.hI)))*h;for(let t=0;t<c.wN;t++){let o=null==(d=r[t])?void 0:d[a],h=o&&""!==o,f=g-t,m=l+a*i,p=n+t*i;if(s)if(f<0)continue;else if(f<1)e.fillStyle=c.zw,e.fillRect(m,p,i,i);else if(f<c.M1){let r=f/c.M1;if(h){e.fillStyle=o,e.fillRect(m,p,i,i);let l=(1-r)*c.Nd;b(a,t,u)&&(e.fillStyle="rgba(0, 255, 65, ".concat(l,")"),e.fillRect(m,p,i,i))}else if(b(a,t,u)){let t=(1-r)*c.gi;e.fillStyle=r<c.Wn?"rgba(0, 255, 65, ".concat(t,")"):r<c.WJ?"rgba(0, 170, 40, ".concat(t,")"):"rgba(0, 85, 20, ".concat(t,")"),e.fillRect(m,p,i,i)}}else h&&(e.fillStyle=o,e.fillRect(m,p,i,i));else if(f<0)h&&(e.fillStyle=o,e.fillRect(m,p,i,i));else if(f<1)e.fillStyle=c.zw,e.fillRect(m,p,i,i);else if(f<c.M1&&b(a,t,u)){let t=f/c.M1,r=(1-t)*c.gi;e.fillStyle=t<c.Wn?"rgba(0, 255, 65, ".concat(r,")"):t<c.WJ?"rgba(0, 170, 40, ".concat(r,")"):"rgba(0, 85, 20, ".concat(r,")"),e.fillRect(m,p,i,i)}}}}(e,t,r,g,m,i)}});continue}let w=null!==o&&e.id===o,T=null!==s&&e.id===s;if(w||T){let e=w?c.O1:c.y9,t=(0,C.Y)(r),l=(0,C.k)(t,i),n=g-i,a=m-i;u.push({zY:p-c.F2,draw:t=>{t.save(),t.globalAlpha=e,t.drawImage(l,n,a),t.restore()}})}u.push({zY:p,draw:e=>{e.drawImage(f,g,m)}})}for(let t of(u.sort((e,t)=>e.zY-t.zY),u))t.draw(e)}(e,E.length>0?[...E,...n]:n,i,k,S,o,f,d),!function(e,t,r,l,n){for(let i of t){if(!i.bubbleType)continue;let t="permission"===i.bubbleType?v.$D:"working"===i.bubbleType?v.j9:v.VQ,o=1;"waiting"===i.bubbleType&&i.bubbleTimer<c.v3&&(o=i.bubbleTimer/c.v3);let s=(0,C.k)(t,n),u=i.state===a.Lp.TYPE?c.PA:0,h=Math.round(r+i.x*n-s.width/2),f=Math.round(l+(i.y+u-c.$L)*n-s.height-n);e.save(),o<1&&(e.globalAlpha=o),e.drawImage(s,h,f),e.restore()}}(e,i,k,S,o),!function(e,t,r,l,n){let i=Math.max(1,Math.round(n));for(let o of t){if(!o.speechText)continue;let t=1;if(o.speechTimer<c.nW&&(t=Math.max(0,o.speechTimer/c.nW)),t<=0)continue;let s=Math.max(7,Math.round(4.5*n));e.save(),e.imageSmoothingEnabled=!1,e.font="".concat(s,"px monospace");let u=Math.ceil(e.measureText(o.speechText).width),h=3*i,f=2*i,d=u+2*h,g=s+2*f,m=3*i,b=o.state===a.Lp.TYPE?c.PA:0,p=Math.round(r+o.x*n-d/2),w=Math.round(l+(o.y+b-c.$L)*n-g-m-4*i);t<1&&(e.globalAlpha=t),e.fillStyle="#333",e.fillRect(p-i,w,d+2*i,g+i),e.fillRect(p,w-i,d,g+2*i),e.fillStyle="#fff",e.fillRect(p,w,d,g);let T=Math.round(p+d/2);e.fillStyle="#333",e.fillRect(T-2*i,w+g,4*i,i),e.fillRect(T-i,w+g+i,2*i,i),e.fillRect(T,w+g+2*i,i,i),e.fillStyle="#fff",e.fillRect(T-i,w+g,2*i,i),e.fillRect(T,w+g+i,i,i),e.fillStyle="#222",e.textBaseline="top",e.fillText(o.speechText,p+h,w+f),e.restore()}}(e,i,k,S,o),w&&(w.showGrid&&function(e,t,r,l,n,i,o){let s=a.dn*l;e.strokeStyle=c.AL,e.lineWidth=1,e.beginPath();for(let l=0;l<=n;l++){let n=t+l*s+.5;e.moveTo(n,r),e.lineTo(n,r+i*s)}for(let l=0;l<=i;l++){let i=r+l*s+.5;e.moveTo(t,i),e.lineTo(t+n*s,i)}if(e.stroke(),o){e.save(),e.strokeStyle=c.fJ,e.lineWidth=1,e.setLineDash(c.i);for(let l=0;l<i;l++)for(let i=0;i<n;i++){var u;(null==(u=o[l])?void 0:u[i])===a.nb.VOID&&e.strokeRect(t+i*s+.5,r+l*s+.5,s-1,s-1)}e.restore()}}(e,k,S,o,T,y,l),w.showGhostBorder&&function(e,t,r,l,n,i,o,s){let u=a.dn*l;e.save();let h=[];for(let e=-1;e<=n;e++)h.push({c:e,r:-1}),h.push({c:e,r:i});for(let e=0;e<i;e++)h.push({c:-1,r:e}),h.push({c:n,r:e});for(let{c:l,r:n}of h){let i=t+l*u,a=r+n*u,h=l===o&&n===s;h&&(e.fillStyle=c.Mo,e.fillRect(i,a,u,u)),e.strokeStyle=h?c.pr:c.gD,e.lineWidth=1,e.setLineDash(c.i),e.strokeRect(i+.5,a+.5,u-1,u-1)}e.restore()}(e,k,S,o,T,y,w.ghostBorderHoverCol,w.ghostBorderHoverRow),w.ghostSprite&&w.ghostCol>=0&&function(e,t,r,l,n,i,o,s){let u=(0,C.k)(t,s),h=i+r*a.dn*s,f=o+l*a.dn*s;e.save(),e.globalAlpha=c.qD,e.drawImage(u,h,f),e.globalAlpha=c.W7,e.fillStyle=n?c.TE:c.oj,e.fillRect(h,f,u.width,u.height),e.restore()}(e,w.ghostSprite,w.ghostCol,w.ghostRow,w.ghostValid,k,S,o),w.hasSelection?(!function(e,t,r,l,n,i,o,s){let u=a.dn*s;e.save(),e.strokeStyle=c.Ii,e.lineWidth=2,e.setLineDash(c.n6),e.strokeRect(i+t*u+1,o+r*u+1,l*u-2,n*u-2),e.restore()}(e,w.selectedCol,w.selectedRow,w.selectedW,w.selectedH,k,S,o),w.deleteButtonBounds=function(e,t,r,l,n,i,o,s){let u=a.dn*s,h=i+(t+l)*u+1,f=o+r*u-1,d=Math.max(c.l0,s*c.YX);e.save(),e.beginPath(),e.arc(h,f,d,0,2*Math.PI),e.fillStyle=c.Zz,e.fill(),e.strokeStyle="#fff",e.lineWidth=Math.max(c.SS,s*c.zY),e.lineCap="round";let g=d*c.R_;return e.beginPath(),e.moveTo(h-g,f-g),e.lineTo(h+g,f+g),e.moveTo(h+g,f-g),e.lineTo(h-g,f+g),e.stroke(),e.restore(),{cx:h,cy:f,radius:d}}(e,w.selectedCol,w.selectedRow,w.selectedW,w.selectedH,k,S,o),w.isRotatable?w.rotateButtonBounds=function(e,t,r,l,n,i,o,s){let u=a.dn*s,h=Math.max(c.l0,s*c.YX),f=i+t*u-1,d=o+r*u-1;e.save(),e.beginPath(),e.arc(f,d,h,0,2*Math.PI),e.fillStyle=c.BD,e.fill(),e.strokeStyle="#fff",e.lineWidth=Math.max(c.SS,s*c.zY),e.lineCap="round";let g=h*c.R_;e.beginPath(),e.arc(f,d,g,-(.8*Math.PI),.7*Math.PI),e.stroke();let m=.7*Math.PI,b=f+g*Math.cos(m),p=d+g*Math.sin(m),w=.35*h;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:f,cy:d,radius:h}}(e,w.selectedCol,w.selectedRow,w.selectedW,w.selectedH,k,S,o):w.rotateButtonBounds=null):(w.deleteButtonBounds=null,w.rotateButtonBounds=null)),{offsetX:k,offsetY:S}}(e,n,i,l.tileMap,l.furniture,l.getCharacters(),u,f.x,f.y,l.getSelectedCharId(),l.getHoveredCharId(),l.layout.tileColors,l.layout.cols,l.layout.rows,t),j.current=null!=t?t:null}});return Y.current=u,()=>{u(),Y.current=null,S.current=null,F.current.clear(),window.removeEventListener("resize",G)}},[X,G,S,L,P,s]),(0,n.useEffect)(()=>i.f.subscribe(e=>{let t=S.current;if(!t)return;let r=new Set(e.agents.keys());for(let[r,n]of e.agents){var l;F.current.has(r)||(t.addCharacter(r,n.name,n.palette),F.current.add(r)),t.updateCharacterStatus(r,n.status),n.pendingApproval?t.showBubble(r,"permission"):"working"===n.status?t.showBubble(r,"working"):"done"===n.status||"error"===n.status?t.showBubble(r,"waiting"):t.clearBubble(r);let e=null!=(l=B.current.get(r))?l:0,i=n.messages.length;if(i>e){let e=n.messages[i-1];e&&"user"!==e.role&&t.showSpeechBubble(r,e.text)}B.current.set(r,i);let a=W.current.get(r);n.lastLogLine&&n.lastLogLine!==a&&t.showSpeechBubble(r,n.lastLogLine),W.current.set(r,n.lastLogLine)}let n=D.current;if(e.teamMessages.length>n)for(let r=n;r<e.teamMessages.length;r++){let l=e.teamMessages[r],n=l.toAgentName,i=n?"".concat(n,": ").concat(l.message):l.message;t.showSpeechBubble(l.fromAgentId,i)}for(let l of(D.current=e.teamMessages.length,F.current))r.has(l)||(t.removeCharacter(l),F.current.delete(l),B.current.delete(l),W.current.delete(l))}),[S]),(0,n.useEffect)(()=>{var e;null==(e=S.current)||e.selectCharacter(r)},[r,S]);let K=(0,n.useCallback)((e,t)=>{let r=A.current;if(!r)return{x:0,y:0};let l=r.getBoundingClientRect(),n=L.current,{offsetX:i,offsetY:a}=_.current;return{x:(e-l.left-i)/n,y:(t-l.top-a)/n}},[L]),J=(0,n.useCallback)((e,t)=>({col:Math.floor(e/c.dn),row:Math.floor(t/c.dn)}),[]),Z=(0,n.useCallback)((e,t)=>{let r=K(e,t);return J(r.x,r.y)},[K,J]),$=(0,n.useCallback)(e=>{if(N.current=!0,V.current={x:e.clientX,y:e.clientY,panX:P.current.x,panY:P.current.y},H.current&&s.current.selectedFurnitureUid){var t;let r=Z(e.clientX,e.clientY),l=null==(t=S.current)?void 0:t.layout;if(l){let e=(0,R.iH)(l,r.col,r.row);e&&e.uid===s.current.selectedFurnitureUid&&(null==g||g(r.col,r.row))}}},[P,s,S,Z,g]),Q=(0,n.useCallback)(e=>{let t=S.current;if(t&&!H.current){let r=K(e.clientX,e.clientY);t.setHoveredCharAtPixel(r.x,r.y)}if(H.current){let t=Z(e.clientX,e.clientY);s.current.dragUid?null==m||m(t.col,t.row):null==d||d(t.col,t.row)}if(!N.current||s.current.dragUid)return;let r=e.clientX-V.current.x,l=e.clientY-V.current.y;P.current={x:V.current.panX+r,y:V.current.panY+l}},[K,Z,S,P,s,m,d]),ee=(0,n.useCallback)(e=>{let t=N.current;if(N.current=!1,s.current.dragUid){let t=Z(e.clientX,e.clientY);null==p||p(t.col,t.row);return}let r=Math.abs(e.clientX-V.current.x),l=Math.abs(e.clientY-V.current.y);if(t&&(r>5||l>5))return;let n=S.current;if(!n)return;if(H.current){let t=j.current;if(t){let r=A.current;if(r){let l=r.getBoundingClientRect(),n=e.clientX-l.left,i=e.clientY-l.top;if(t.deleteButtonBounds){let{cx:e,cy:r,radius:l}=t.deleteButtonBounds;if(Math.sqrt((n-e)**2+(i-r)**2)<=l){null==w||w();return}}if(t.rotateButtonBounds){let{cx:e,cy:r,radius:l}=t.rotateButtonBounds;if(Math.sqrt((n-e)**2+(i-r)**2)<=l){null==k||k();return}}}}let r=Z(e.clientX,e.clientY);null==u||u(r.col,r.row);return}let i=K(e.clientX,e.clientY),a=n.getAgentAtPixel(i.x,i.y);a&&z.current(a)},[K,Z,S,s,u,p,w,k]),et=(0,n.useCallback)(e=>{if(!H.current)return;e.preventDefault();let t=Z(e.clientX,e.clientY);null==f||f(t.col,t.row)},[Z,f]),er=(0,n.useCallback)(e=>{},[]),el=(0,n.useRef)([]),en=(0,n.useRef)(0),ei=(0,n.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;en.current=Math.sqrt(t*t+r*r)}else 1===e.touches.length&&(N.current=!0,V.current={x:e.touches[0].clientX,y:e.touches[0].clientY,panX:P.current.x,panY:P.current.y})},[P]),ea=(0,n.useCallback)(e=>{if(2===e.touches.length){let t=e.touches[0].clientX-e.touches[1].clientX,r=e.touches[0].clientY-e.touches[1].clientY,l=Math.sqrt(t*t+r*r),n=l-en.current;Math.abs(n)>20&&(L.current=Math.max(c.DH,Math.min(c.ZV,L.current+(n>0?1:-1))),en.current=l)}else if(1===e.touches.length&&N.current){let t=e.touches[0].clientX-V.current.x,r=e.touches[0].clientY-V.current.y;P.current={x:V.current.panX+t,y:V.current.panY+r}}},[L,P]),eo=(0,n.useCallback)(e=>{if(0===e.touches.length&&1===el.current.length){let e=el.current[0],t=Math.abs(e.clientX-V.current.x),r=Math.abs(e.clientY-V.current.y);if(t<10&&r<10)if(H.current){let t=Z(e.clientX,e.clientY);null==u||u(t.col,t.row)}else{let t=S.current;if(t){let r=K(e.clientX,e.clientY),l=t.getAgentAtPixel(r.x,r.y);l&&z.current(l)}}}N.current=!1,el.current=Array.from(e.touches)},[K,Z,S,u]),es=o?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:"#12121f"},children:[!X&&(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:A,onPointerDown:$,onPointerMove:Q,onPointerUp:ee,onContextMenu:et,onWheel:er,onTouchStart:ei,onTouchMove:ea,onTouchEnd:eo,style:{display:"block",width:"100%",height:"100%",touchAction:"none",cursor:es}})]})}}}]);