beads-map 0.2.4 → 0.3.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 (44) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +3 -3
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/next-minimal-server.js.nft.json +1 -1
  6. package/.next/next-server.js.nft.json +1 -1
  7. package/.next/prerender-manifest.json +1 -1
  8. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/_not-found.html +1 -1
  10. package/.next/server/app/_not-found.rsc +1 -1
  11. package/.next/server/app/api/beads/route.js +2 -2
  12. package/.next/server/app/api/beads/stream/route.js +3 -3
  13. package/.next/server/app/api/beads.body +1 -1
  14. package/.next/server/app/api/config/route.js +2 -2
  15. package/.next/server/app/index.html +1 -1
  16. package/.next/server/app/index.rsc +2 -2
  17. package/.next/server/app/page.js +3 -3
  18. package/.next/server/app/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app-paths-manifest.json +5 -5
  20. package/.next/server/functions-config-manifest.json +1 -1
  21. package/.next/server/pages/404.html +1 -1
  22. package/.next/server/pages/500.html +1 -1
  23. package/.next/server/server-reference-manifest.json +1 -1
  24. package/.next/static/chunks/971-bb44d52bcd9ee2a9.js +1 -0
  25. package/.next/static/chunks/app/page-68492e6aaf15a6dd.js +1 -0
  26. package/.next/static/css/c854bc2280bc4b27.css +3 -0
  27. package/README.md +12 -4
  28. package/app/api/config/route.ts +2 -0
  29. package/app/globals.css +12 -0
  30. package/app/page.tsx +111 -6
  31. package/components/BeadTooltip.tsx +222 -0
  32. package/components/BeadsGraph.tsx +264 -56
  33. package/components/ContextMenu.tsx +49 -3
  34. package/lib/parse-beads.ts +2 -0
  35. package/lib/types.ts +2 -0
  36. package/package.json +1 -1
  37. package/public/image.png +0 -0
  38. package/.next/server/app/api/config.body +0 -1
  39. package/.next/server/app/api/config.meta +0 -1
  40. package/.next/static/chunks/666-fb778298a77f3754.js +0 -1
  41. package/.next/static/chunks/app/page-13ee27a84e4a0c70.js +0 -1
  42. package/.next/static/css/dbf588b653aa4019.css +0 -3
  43. /package/.next/static/{5zW6ptqKxGc0tcnRau9j2 → ac0cLw5kGBDWoceTBnu21}/_buildManifest.js +0 -0
  44. /package/.next/static/{5zW6ptqKxGc0tcnRau9j2 → ac0cLw5kGBDWoceTBnu21}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{6284:function(e,t,n){Promise.resolve().then(n.bind(n,2133))},2133:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ef}});var r=n(3890),s=n(8496);let i={open:"#10b981",in_progress:"#f59e0b",blocked:"#ef4444",deferred:"#8b5cf6",closed:"#a1a1aa"},l={open:"Open",in_progress:"In Progress",blocked:"Blocked",deferred:"Deferred",closed:"Closed"},a={0:"P0 - Critical",1:"P1 - High",2:"P2 - Medium",3:"P3 - Low",4:"P4 - Backlog"},o={0:"#ef4444",1:"#f97316",2:"#3b82f6",3:"#a1a1aa",4:"#d4d4d8"},c={bug:"\uD83D\uDC1B",feature:"✨",task:"\uD83D\uDCDD",epic:"\uD83C\uDFAF",chore:"\uD83D\uDD27"};function d(e){return function(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=16777619*t>>>0;let n=t%360;return"hsl(".concat(n,", 65%, 55%)")}(e)}let u=new Proxy({},{get:(e,t)=>t.split(/[-_]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),has:()=>!0}),x=new Proxy({},{get:(e,t)=>d(t),has:()=>!0});function h(e){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;return"".concat(t,"->").concat(n,":").concat(e.type)}function m(e,t){if(!e)return{addedNodeIds:new Set(t.graphData.nodes.map(e=>e.id)),removedNodeIds:new Set,changedNodes:new Map,addedLinkKeys:new Set(t.graphData.links.map(h)),removedLinkKeys:new Set,hasChanges:!0};let n=new Map(e.graphData.nodes.map(e=>[e.id,e])),r=new Map(t.graphData.nodes.map(e=>[e.id,e])),s=new Set,i=new Set,l=new Map;for(let[e,t]of r)if(n.has(e)){let r=n.get(e),s=[];r.status!==t.status&&s.push({field:"status",from:r.status,to:t.status}),r.priority!==t.priority&&s.push({field:"priority",from:String(r.priority),to:String(t.priority)}),r.title!==t.title&&s.push({field:"title",from:r.title,to:t.title}),(r.owner||"")!==(t.owner||"")&&s.push({field:"owner",from:r.owner||"",to:t.owner||""}),s.length>0&&l.set(e,s)}else s.add(e);for(let e of n.keys())r.has(e)||i.add(e);let a=new Set(e.graphData.links.map(h)),o=new Set(t.graphData.links.map(h)),c=new Set,d=new Set;for(let e of o)a.has(e)||c.add(e);for(let e of a)o.has(e)||d.add(e);let u=s.size>0||i.size>0||l.size>0||c.size>0||d.size>0;return{addedNodeIds:s,removedNodeIds:i,changedNodes:l,addedLinkKeys:c,removedLinkKeys:d,hasChanges:u}}var p=n(6297),f=n(21),g=n(4295),v=n(2528);let b=null;function y(e){let t=e.blockerCount+e.dependentCount;return"epic"===e.issueType&&(t+=3),5+17*Math.min(t/6,1)}function j(e){return i[e.status]||i.open}function w(e){return 1-(1-e)*(1-e)}let k=new Map;function N(e,t){let n=k.get(e);if("loading"===n||"failed"===n)return null;if(n)return n;k.set(e,"loading");let r=new Image;return r.onload=()=>{k.set(e,r),t()},r.onerror=()=>{k.set(e,"failed")},r.src=e,null}function z(e,t,n,r,s,i){e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fillStyle="#e4e4e7",e.fill();let l=s.replace("@","").charAt(0).toUpperCase();e.font="600 ".concat(Math.min(7,Math.max(3,1.3*r)),"px 'Inter', system-ui, sans-serif"),e.textAlign="center",e.textBaseline="middle",e.fillStyle="#71717a",e.fillText(l,t,n+.3)}function C(e,t){let n=new Set([e]),r=[{id:e,depth:0}];for(;r.length>0;){let{id:e,depth:s}=r.shift();if(!(s>=2))for(let i of t){let t="object"==typeof i.source?i.source.id:i.source,l="object"==typeof i.target?i.target.id:i.target;t!==e||n.has(l)||(n.add(l),r.push({id:l,depth:s+1})),l!==e||n.has(t)||(n.add(t),r.push({id:t,depth:s+1}))}}return n}function M(e){let t=e.current;if(!t)return;let n=t.zoom();"number"!=typeof n||isNaN(n)||(t.zoom(1.000001*n,0),requestAnimationFrame(()=>{e.current&&e.current.zoom(n,0)}))}let S=(0,s.forwardRef)(function(e,t){let{nodes:a,links:o,selectedNode:c,hoveredNode:d,onNodeClick:u,onNodeHover:h,onBackgroundClick:m,onNodeRightClick:k,commentedNodeIds:S,claimedNodeAvatars:L,onAvatarHover:T,timelineActive:A,stats:I,sidebarOpen:E,collapsedEpicIds:B,onCollapseAll:W,onExpandAll:P}=e,F=(0,s.useRef)(null),R=(0,s.useRef)(null),_=(0,s.useRef)(null),O=(0,s.useRef)(0),U=(0,s.useRef)(()=>{}),[H,Y]=(0,s.useState)({width:800,height:600}),V=(0,s.useRef)(!1),[q,X]=(0,s.useState)({w:160,h:120}),K=q.w,Z=q.h,$=(0,s.useRef)(null),[J,G]=(0,s.useState)(b);(0,s.useEffect)(()=>{b||n.e(149).then(n.bind(n,3149)).then(e=>{b=e.default||e,G(()=>b)})},[]);let[Q,ee]=(0,s.useState)("dag"),et=(0,s.useRef)(c),en=(0,s.useRef)(d),er=(0,s.useRef)(new Set),es=(0,s.useRef)(S||new Map),ei=(0,s.useRef)(L||new Map),el=(0,s.useRef)(()=>{});el.current=()=>M(F);let ea=(0,s.useRef)(T);ea.current=T;let eo=(0,s.useRef)(null),ec=(0,s.useRef)({x:0,y:0}),ed=(0,s.useRef)(a),eu=(0,s.useRef)([]),{viewNodes:ex,viewLinks:eh}=(0,s.useMemo)(()=>{if(!B||0===B.size)return{viewNodes:a,viewLinks:o};let e=new Map;for(let t of o){let n="object"==typeof t.source?t.source.id:t.source,r="object"==typeof t.target?t.target.id:t.target;"parent-child"===t.type&&e.set(r,n)}let t=new Set(a.map(e=>e.id));for(let n of a)if(!e.has(n.id)&&n.id.includes(".")){let r=n.id.split(".")[0];t.has(r)&&e.set(n.id,r)}let n=new Set;for(let[t,r]of e)B.has(r)&&n.add(t);if(0===n.size)return{viewNodes:a,viewLinks:o};let r=new Map;for(let t of n)r.set(t,e.get(t));let s=new Map,i=new Map,l=new Map;for(let[e,t]of r){s.set(t,(s.get(t)||0)+1);let n=a.find(t=>t.id===e);n&&(i.set(t,(i.get(t)||0)+n.blockerCount),l.set(t,(l.get(t)||0)+n.dependentCount))}let c=a.filter(e=>!n.has(e.id)).map(e=>({...e,blockerCount:e.blockerCount+(i.get(e.id)||0),dependentCount:e.dependentCount+(l.get(e.id)||0),collapsedCount:s.get(e.id)||0})),d=[],u=new Set;for(let e of o){let t="object"==typeof e.source?e.source.id:e.source,s="object"==typeof e.target?e.target.id:e.target;if("parent-child"===e.type&&n.has(s)||(t=r.get(t)||t)===(s=r.get(s)||s))continue;let i="".concat(t,"->").concat(s,":").concat(e.type);u.has(i)||(u.add(i),d.push({source:t,target:s,type:e.type}))}return{viewNodes:c,viewLinks:d}},[a,o,B]);ed.current=ex,(0,s.useEffect)(()=>{let e=new Map;for(let t of o){let n="object"==typeof t.source?t.source.id:t.source,r="object"==typeof t.target?t.target.id:t.target;"parent-child"===t.type&&e.set(r,n)}let t=new Set(a.map(e=>e.id));for(let n of a)if(!e.has(n.id)&&n.id.includes(".")){let r=n.id.split(".")[0];t.has(r)&&e.set(n.id,r)}let n=new Map;for(let[t,r]of e){let e=n.get(r)||[];e.push(t),n.set(r,e)}let r=new Map(a.map(e=>[e.id,e])),s=[];for(let[e,t]of n){let n=r.get(e);n&&s.push({parentId:e,title:n.title||e,prefix:n.prefix,memberIds:[e,...t]})}eu.current=s},[a,o]),(0,s.useEffect)(()=>{et.current=c;let e=en.current||c;e?er.current=C(e.id,eh):er.current=new Set,M(F),cancelAnimationFrame(O.current),O.current=requestAnimationFrame(()=>U.current())},[c,eh]),(0,s.useEffect)(()=>{en.current=d;let e=d||et.current;e?er.current=C(e.id,eh):er.current=new Set,M(F),cancelAnimationFrame(O.current),O.current=requestAnimationFrame(()=>U.current())},[d,eh]),(0,s.useEffect)(()=>{es.current=S||new Map,M(F)},[S]),(0,s.useEffect)(()=>{ei.current=L||new Map,M(F)},[L]),(0,s.useEffect)(()=>{let e=R.current;if(!e)return;let t=t=>{let n;ec.current={x:t.clientX,y:t.clientY};let r=F.current,s=ea.current;if(!r||!s)return;let i=ei.current;if(0===i.size){eo.current&&(eo.current=null,s(null));return}let l=e.getBoundingClientRect(),a=t.clientX-l.left,o=t.clientY-l.top;try{n=r.screen2GraphCoords(a,o)}catch(e){return}let c=Math.max(4,10/(r.zoom()||1));for(let e of ed.current){if(null==e.x||null==e.y)continue;let r=i.get(e.id);if(!r)continue;let l=y(e),a=e.x+.7*l,o=e.y+.7*l,d=n.x-a,u=n.y-o;if(d*d+u*u<=c*c){eo.current!==e.id&&(eo.current=e.id,s({handle:r.handle,avatar:r.avatar,claimedAt:r.claimedAt,did:r.did,x:t.clientX,y:t.clientY}));return}}eo.current&&(eo.current=null,s(null))};return e.addEventListener("mousemove",t),()=>e.removeEventListener("mousemove",t)},[]),(0,s.useEffect)(()=>{let e=()=>{if(R.current){let e=R.current.getBoundingClientRect();Y({width:e.width,height:e.height})}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let em=(0,s.useCallback)(e=>{let t=F.current;if(!t)return;let n=ex.find(t=>t.id===e.id);n&&void 0!==n.x&&void 0!==n.y&&(t.centerAt(n.x,n.y,500),t.zoom(2.5,500),u(e))},[u,ex]);(0,s.useImperativeHandle)(t,()=>({focusNode:em}),[em]),(0,s.useEffect)(()=>{var e,t,n,r,s,i,l,a,o,c,d,u,x,h,m;let b=F.current;if(!b||0===ex.length)return;let j=()=>{b.d3Force("radial",null),b.d3Force("x",null),b.d3Force("y",null)},w=()=>{ex.forEach(e=>{delete e.fx,delete e.fy})};if("dag"===Q)j(),null===(e=b.d3Force("charge"))||void 0===e||e.strength(-80).distanceMax(300),null===(t=b.d3Force("link"))||void 0===t||t.distance(50).strength(.3),null===(n=b.d3Force("center"))||void 0===n||n.strength(.01),b.d3Force("collision",null);else if("radial"===Q){j(),w();let e=new Map;for(let t of eh){if("parent-child"===t.type)continue;let n="object"==typeof t.target?t.target.id:t.target,r="object"==typeof t.source?t.source.id:t.source;e.has(n)||e.set(n,[]),e.get(n).push(r)}let t=new Map,n=[];ex.forEach(r=>{e.has(r.id)||(t.set(r.id,0),n.push(r.id))});let l=0;for(;l<n.length;){let e=n[l++],r=t.get(e);for(let s of eh){if("parent-child"===s.type)continue;let i="object"==typeof s.source?s.source.id:s.source,l="object"==typeof s.target?s.target.id:s.target;i!==e||t.has(l)||(t.set(l,r+1),n.push(l))}}ex.forEach(e=>{var n;e._depth=null!==(n=t.get(e.id))&&void 0!==n?n:0}),Array.from(t.values());let a=Math.max(200,4*ex.length);null===(r=b.d3Force("charge"))||void 0===r||r.strength(-300).distanceMax(800),null===(s=b.d3Force("link"))||void 0===s||s.distance(150).strength(.15),null===(i=b.d3Force("center"))||void 0===i||i.strength(0),b.d3Force("radial",(0,p.Z)(e=>(e._depth||0)*a,0,0).strength(.8)),b.d3Force("x",null),b.d3Force("y",null),b.d3Force("collision",(0,f.Z)().radius(e=>y(e)+10).strength(.9))}else if("cluster"===Q){j(),w();let e=[...new Set(ex.map(e=>e.prefix))],t=Math.max(400,5*ex.length,150*e.length),n=new Map;e.forEach((r,s)=>{let i=2*Math.PI*s/e.length-Math.PI/2;n.set(r,{x:Math.cos(i)*t,y:Math.sin(i)*t})}),null===(l=b.d3Force("charge"))||void 0===l||l.strength(-200).distanceMax(600),null===(a=b.d3Force("link"))||void 0===a||a.distance(100).strength(.15),null===(o=b.d3Force("center"))||void 0===o||o.strength(0),b.d3Force("x",(0,g.Z)(e=>{var t;return(null===(t=n.get(e.prefix))||void 0===t?void 0:t.x)||0}).strength(.5)),b.d3Force("y",(0,v.Z)(e=>{var t;return(null===(t=n.get(e.prefix))||void 0===t?void 0:t.y)||0}).strength(.5)),b.d3Force("collision",(0,f.Z)().radius(e=>y(e)+10).strength(.9))}else"spread"===Q?(j(),w(),null===(c=b.d3Force("charge"))||void 0===c||c.strength(-300).distanceMax(500),null===(d=b.d3Force("link"))||void 0===d||d.distance(180).strength(.4),null===(u=b.d3Force("center"))||void 0===u||u.strength(.02),b.d3Force("collision",(0,f.Z)().radius(e=>y(e)+8).strength(.8))):(j(),w(),null===(x=b.d3Force("charge"))||void 0===x||x.strength(-180).distanceMax(400),null===(h=b.d3Force("link"))||void 0===h||h.distance(e=>{var t,n,r,s;return(((null===(t=e.source)||void 0===t?void 0:t.blockerCount)||0)+((null===(n=e.source)||void 0===n?void 0:n.dependentCount)||0)+(((null===(r=e.target)||void 0===r?void 0:r.blockerCount)||0)+((null===(s=e.target)||void 0===s?void 0:s.dependentCount)||0)))/2>4?90:120}).strength(.6),null===(m=b.d3Force("center"))||void 0===m||m.strength(.03),b.d3Force("collision",(0,f.Z)().radius(e=>y(e)+6).strength(.7)));b.d3ReheatSimulation();let k=setTimeout(()=>{F.current&&F.current.zoomToFit(400,60)},V.current?600:1e3);return V.current=!0,()=>clearTimeout(k)},[Q,ex,eh]);let ep=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(ep.current||!J||0===a.length)return;ep.current=!0;let e=setTimeout(()=>{ee("force")},15);return()=>clearTimeout(e)},[J,a.length]),(0,s.useEffect)(()=>{if(!A&&F.current&&a.length>0){let e=setTimeout(()=>{F.current.zoomToFit(400,60)},800);return()=>clearTimeout(e)}},[a.length,A]);let ef=(0,s.useMemo)(()=>{let e=Math.sqrt(ex.length)||1;return ex.forEach((t,n)=>{if(null==t.x&&null==t.y){let r=n*Math.PI*(3-Math.sqrt(5)),s=300*Math.sqrt(.5+n)/e;t.x=s*Math.cos(r),t.y=s*Math.sin(r)}}),{nodes:ex,links:eh}},[ex,eh]),eg=(0,s.useCallback)((e,t,n)=>{var r,s,l;let a=y(e),o=j(e),c=x[e.prefix]||"#a1a1aa",d=(null===(r=et.current)||void 0===r?void 0:r.id)===e.id,u=(null===(s=en.current)||void 0===s?void 0:s.id)===e.id,h=er.current,m=h.has(e.id),p=h.size>0,f=Date.now(),g=1,v=e._spawnTime;if(v){let e=f-v;e<500&&(g=1+2.70158*Math.pow((l=e/500)-1,3)+1.70158*Math.pow(l-1,2))}let b=1,k=1,C=e._removeTime;if(C){let e=f-C;if(e<400){let t=e/400;b=1-w(t),k=1-t}else b=0,k=0}let M=g*b;if(M<=.01)return;let S=a*M,L=n<=.1?0:n>=.2?1:(n-.1)/.1,T=(p&&!m?.15:"closed"===e.status?.5:1)*k*L;if(T<=.01)return;t.save(),t.globalAlpha=T,m&&p&&(t.shadowColor="#10b981",t.shadowBlur=d?20:u?16:10),n>.3&&(t.beginPath(),t.arc(e.x,e.y,S+2,0,2*Math.PI),t.strokeStyle=c,t.lineWidth=2,t.stroke()),t.beginPath(),t.arc(e.x,e.y,S,0,2*Math.PI),t.fillStyle=o,t.fill(),t.strokeStyle=d?"#10b981":u?"#3f3f46":"#e4e4e7",t.lineWidth=d?2.5:u?2:1,t.stroke(),t.shadowBlur=0;let A=e._changedAt;if(A){let n=f-A;if(n<800){let r=n/800,s=i[e.status]||"#a1a1aa";t.beginPath(),t.arc(e.x,e.y,S+4+20*r,0,2*Math.PI),t.strokeStyle=s,t.lineWidth=2*(1-r),t.globalAlpha=(1-r)*.6,t.stroke(),t.globalAlpha=T}}if(v){let n=f-v;if(n<500){let r=n/500;t.beginPath(),t.arc(e.x,e.y,S+6+8*r,0,2*Math.PI),t.strokeStyle="#10b981",t.lineWidth=3*(1-r),t.globalAlpha=(1-r)*.4,t.stroke(),t.globalAlpha=T}}if(e.priority<=1&&n>.5&&(t.font="".concat(Math.min(10,Math.max(4,12/n)),"px sans-serif"),t.textAlign="center",t.textBaseline="bottom",t.fillText(0===e.priority?"\uD83D\uDD25\uD83D\uDD25":"\uD83D\uDD25",e.x,e.y-S-2)),n>.5){let r=Math.min(7,Math.max(3,10/n));t.font="500 ".concat(r,"px 'Inter', system-ui, sans-serif"),t.textAlign="center",t.textBaseline="top",t.fillStyle="#3f3f46",t.globalAlpha=.85*T;let s=e.id;n>1.5?s=D(e.title||e.id,30):n>.9&&(s=D(e.title||e.id,18)),t.fillText(s,e.x,e.y+S+3);let i=e.collapsedCount;i&&i>0&&(t.font="400 ".concat(Math.min(5.5,Math.max(2.5,8/n)),"px 'Inter', system-ui, sans-serif"),t.fillStyle="#a1a1aa",t.fillText("".concat(i," task").concat(1!==i?"s":""),e.x,e.y+S+3+r+1))}let I=es.current.get(e.id);if(I&&I>0&&n>.4){let r=Math.min(6,Math.max(3.5,8/n)),s=e.x+.75*S,i=e.y-.75*S,l=I>99?"99+":String(I);t.save(),t.globalAlpha=Math.min(T,.95),t.beginPath(),t.arc(s,i,r,0,2*Math.PI),t.fillStyle="#ef4444",t.fill(),t.strokeStyle="#ffffff",t.lineWidth=Math.max(.8,1.2/n),t.stroke(),t.font="600 ".concat(Math.min(7,Math.max(3,1.3*r)),"px 'Inter', system-ui, sans-serif"),t.textAlign="center",t.textBaseline="middle",t.fillStyle="#ffffff",t.fillText(l,s,i+.3),t.restore()}let E=ei.current.get(e.id);if(E){let r=Math.max(4,10/n),s=e.x+.7*S,i=e.y+.7*S;if(t.save(),t.globalAlpha=1,E.avatar){let e=N(E.avatar,()=>el.current());e?(t.save(),t.beginPath(),t.arc(s,i,r,0,2*Math.PI),t.clip(),t.drawImage(e,s-r,i-r,2*r,2*r),t.restore()):z(t,s,i,r,E.handle,n)}else z(t,s,i,r,E.handle,n);t.beginPath(),t.arc(s,i,r,0,2*Math.PI),t.strokeStyle="#ffffff",t.lineWidth=Math.max(.8,1.2/n),t.stroke(),t.restore()}t.restore()},[]),ev=(0,s.useCallback)((e,t,n)=>{let r=e.source,s=e.target;if(void 0===r.x||void 0===s.x)return;let i=Date.now(),l=1,a=1,o=e._spawnTime;if(o){let e=i-o;if(e<500){let t=e/500;l=w(t),a=1+(1-t)*1.5}}let c=1,d=e._removeTime;if(d){let e=i-d;if(!(e<400))return;c=1-w(e/400)}let u=l*c;if(u<=.01)return;let x=r.id||e.source,h=s.id||e.target,m="parent-child"===e.type,p=er.current,f=p.size>0,g=f&&p.has(x)&&p.has(h),v=(m?f?g?.5:.05:.2:f?g?.8:.08:.35)*u*(n<=.1?0:n>=.2?1:(n-.1)/.1);if(v<=.01)return;t.save(),t.globalAlpha=v,m?(t.strokeStyle=g?"#71717a":"#a1a1aa",t.lineWidth=Math.max(.6,1.5/n)*a,t.setLineDash([4,3])):(t.strokeStyle=g?"#10b981":"#d4d4d8",t.lineWidth=(g?Math.max(2,2.5/n):Math.max(.8,1.2/n))*a);let b=s.x-r.x,j=s.y-r.y,k=Math.sqrt(b*b+j*j),N=(r.x+s.x)/2+.15*j,z=(r.y+s.y)/2-.15*b;if(t.beginPath(),t.moveTo(r.x,r.y),t.quadraticCurveTo(N,z,s.x,s.y),t.stroke(),m&&t.setLineDash([]),o){let e=i-o;e<300&&(t.save(),t.globalAlpha=(1-e/300)*.5,t.strokeStyle="#10b981",t.lineWidth=(m?3:4)/n,t.beginPath(),t.moveTo(r.x,r.y),t.quadraticCurveTo(N,z,s.x,s.y),t.stroke(),t.restore())}if(!m){let e=y(s);if(k<e+1){t.restore();return}let i=Math.min(8,6/n),l=1-e/k,a=r.x+l*b,o=r.y+l*j,c=Math.atan2(j,b);t.fillStyle=g?"#10b981":"#d4d4d8",t.beginPath(),t.moveTo(a,o),t.lineTo(a-i*Math.cos(c-Math.PI/7),o-i*Math.sin(c-Math.PI/7)),t.lineTo(a-i*Math.cos(c+Math.PI/7),o-i*Math.sin(c+Math.PI/7)),t.closePath(),t.fill()}t.restore()},[]),eb=(0,s.useCallback)((e,t)=>{let n=t>=.8?0:t<=.4?1:(.8-t)/.4;if(n<=.01)return;let r=eu.current;if(0===r.length)return;let s=new Map;for(let e of ex)null!=e.x&&null!=e.y&&s.set(e.id,{x:e.x,y:e.y});for(let i of(e.save(),r)){let r=0,l=0,a=0;for(let e of i.memberIds){let t=s.get(e);t&&(r+=t.x,l+=t.y,a++)}if(0===a)continue;let o=r/a,c=l/a,d=0;for(let e of i.memberIds){let t=s.get(e);if(t){let e=t.x-o,n=t.y-c,r=Math.sqrt(e*e+n*n);r>d&&(d=r)}}let u=d+30,h=x[i.prefix]||"hsl(0, 0%, 65%)";e.beginPath(),e.arc(o,c,u,0,2*Math.PI),e.globalAlpha=.05*n,e.fillStyle=h,e.fill(),e.globalAlpha=.25*n,e.strokeStyle=h,e.lineWidth=1.5/t,e.setLineDash([8/t,4/t]),e.stroke(),e.setLineDash([]);let m=Math.min(24,Math.max(10,14/t)),p=Math.min(12,Math.max(5,8/t)),f=.35*m;e.font="500 ".concat(p,"px 'Inter', system-ui, sans-serif"),e.textAlign="center",e.textBaseline="middle",e.globalAlpha=.45*n,e.fillStyle="#71717a",e.fillText(i.parentId,o,c-.5*m-f),e.font="600 ".concat(m,"px 'Inter', system-ui, sans-serif"),e.globalAlpha=.85*n,e.fillStyle="#18181b";let g=i.title.length>40?i.title.slice(0,39)+"…":i.title;e.fillText(g,o,c+.15*m);let v=Math.min(14,Math.max(6,9/t));e.font="400 ".concat(v,"px 'Inter', system-ui, sans-serif"),e.globalAlpha=.5*n,e.fillStyle="#71717a",e.fillText("".concat(i.memberIds.length," issue").concat(1!==i.memberIds.length?"s":""),o,c+.15*m+.7*m)}e.restore()},[ex,a]),ey=(0,s.useCallback)((e,t,n)=>{let r=y(e)+5;n.fillStyle=t,n.beginPath(),n.arc(e.x,e.y,r,0,2*Math.PI),n.fill()},[]),ej=(0,s.useCallback)(()=>{},[]),ew=(0,s.useCallback)(()=>{var e,t;let n=_.current,r=F.current;if(!n||!r)return;let s=n.getContext("2d");if(!s)return;let i=1/0,l=-1/0,a=1/0,o=-1/0,c=!1;for(let e of ex)null!=e.x&&null!=e.y&&(c=!0,e.x<i&&(i=e.x),e.x>l&&(l=e.x),e.y<a&&(a=e.y),e.y>o&&(o=e.y));if(!c)return;let d=(l+=40)-(i-=40)||1,u=(o+=40)-(a-=40)||1,x=K-16,h=Z-16,m=Math.min(x/d,h/u),p=8+(x-d*m)/2,f=8+(h-u*m)/2,g=window.devicePixelRatio||1;(n.width!==K*g||n.height!==Z*g)&&(n.width=K*g,n.height=Z*g,s.setTransform(g,0,0,g,0,0)),s.clearRect(0,0,K,Z),s.fillStyle="rgba(250, 250, 250, 0.92)",s.beginPath(),s.roundRect(0,0,K,Z,6),s.fill();let v=er.current,b=v.size>0,y=(null===(e=en.current)||void 0===e?void 0:e.id)||(null===(t=et.current)||void 0===t?void 0:t.id)||null;for(let e of eh){let t=e.source,n=e.target;if(null==t.x||null==n.x)continue;let r=t.id||e.source,l=n.id||e.target,o=b&&v.has(r)&&v.has(l);s.globalAlpha=b?o?.5:.04:.1,s.strokeStyle=o?"#10b981":"#a1a1aa",s.lineWidth=o?1:.5;let c=p+(t.x-i)*m,d=f+(t.y-a)*m,u=p+(n.x-i)*m,x=f+(n.y-a)*m;s.beginPath(),s.moveTo(c,d),s.lineTo(u,x),s.stroke()}for(let e of(s.globalAlpha=1,ex)){if(null==e.x||null==e.y)continue;let t=p+(e.x-i)*m,n=f+(e.y-a)*m,r=e.id===y,l=v.has(e.id);b&&!l?s.globalAlpha=.1:"closed"===e.status?s.globalAlpha=.35:s.globalAlpha=.85,s.fillStyle=j(e);let o="epic"===e.issueType?3:2;r?o=5:b&&l&&(o=4),r&&(s.globalAlpha=.4,s.fillStyle="#10b981",s.beginPath(),s.arc(t,n,o+2,0,2*Math.PI),s.fill(),s.globalAlpha=1,s.fillStyle=j(e)),s.fillRect(t-o/2,n-o/2,o,o)}s.globalAlpha=1;let w=ei.current;if(w.size>0)for(let e of ex){if(null==e.x||null==e.y)continue;let t=w.get(e.id);if(!t)continue;let n=p+(e.x-i)*m,r=f+(e.y-a)*m;if(s.save(),s.globalAlpha=1,t.avatar){let e=N(t.avatar,()=>el.current());e?(s.save(),s.beginPath(),s.arc(n,r,5,0,2*Math.PI),s.clip(),s.drawImage(e,n-5,r-5,10,10),s.restore()):(s.beginPath(),s.arc(n,r,5,0,2*Math.PI),s.fillStyle="#d4d4d8",s.fill())}else s.beginPath(),s.arc(n,r,5,0,2*Math.PI),s.fillStyle="#d4d4d8",s.fill();s.beginPath(),s.arc(n,r,5,0,2*Math.PI),s.strokeStyle="#ffffff",s.lineWidth=1,s.stroke(),s.restore()}try{let e=r.screen2GraphCoords(0,0),t=r.screen2GraphCoords(H.width,H.height),n=p+(e.x-i)*m,l=f+(e.y-a)*m,o=(t.x-e.x)*m,c=(t.y-e.y)*m,d=Math.max(0,n),u=Math.max(0,l),x=Math.min(K-d,o-(d-n)),h=Math.min(Z-u,c-(u-l));x>0&&h>0&&(s.fillStyle="rgba(16, 185, 129, 0.06)",s.fillRect(d,u,x,h),s.strokeStyle="rgba(16, 185, 129, 0.5)",s.lineWidth=1.5,s.strokeRect(d,u,x,h))}catch(e){}},[ex,eh,H,K,Z,8]);U.current=ew;let ek=(0,s.useCallback)(()=>{cancelAnimationFrame(O.current),O.current=requestAnimationFrame(()=>{ew()})},[ew]);(0,s.useEffect)(()=>{if(!J||0===a.length)return;let e=setInterval(()=>{ew()},200);return()=>clearInterval(e)},[J,a.length,ew]),(0,s.useEffect)(()=>{let e;let t=!0;return function n(){if(!t)return;let r=Date.now();(ex.some(e=>!!e._spawnTime&&r-e._spawnTime<500||!!e._removeTime&&r-e._removeTime<400||!!e._changedAt&&r-e._changedAt<800)||eh.some(e=>!!e._spawnTime&&r-e._spawnTime<500||!!e._removeTime&&r-e._removeTime<400))&&M(F),e=requestAnimationFrame(n)}(),()=>{t=!1,cancelAnimationFrame(e)}},[ex,eh]);let eN=(0,s.useCallback)(e=>{let t=F.current;if(!t)return;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX-n.left,s=e.clientY-n.top,i=1/0,l=-1/0,a=1/0,o=-1/0;for(let e of ex)null!=e.x&&null!=e.y&&(e.x<i&&(i=e.x),e.x>l&&(l=e.x),e.y<a&&(a=e.y),e.y>o&&(o=e.y));let c=(l+=40)-(i-=40)||1,d=(o+=40)-(a-=40)||1,u=K-16,x=Z-16,h=Math.min(u/c,x/d),m=i+(r-(8+(u-c*h)/2))/h,p=a+(s-(8+(x-d*h)/2))/h;t.centerAt(m,p,300)},[ex,K,Z,8]);return(0,r.jsxs)("div",{ref:R,className:"w-full h-full relative",children:[(0,r.jsxs)("div",{className:"absolute top-3 left-3 sm:top-4 sm:left-4 z-10 flex items-start gap-1.5 sm:gap-2",children:[(0,r.jsxs)("div",{className:"flex bg-white/90 backdrop-blur-sm rounded-lg border border-zinc-200 shadow-sm overflow-hidden",children:[(0,r.jsx)("button",{onClick:()=>ee("force"),className:"px-3 py-1.5 text-xs font-medium transition-colors ".concat("force"===Q?"bg-emerald-500 text-white":"text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50"),children:(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"4",cy:"4",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"12",cy:"3",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"3",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"13",cy:"11",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("line",{x1:"4",y1:"4",x2:"8",y2:"8",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"12",y1:"3",x2:"8",y2:"8",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"3",y1:"12",x2:"8",y2:"8",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"13",y1:"11",x2:"8",y2:"8",strokeOpacity:"0.5"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Force"})]})}),(0,r.jsx)("div",{className:"w-px bg-zinc-200"}),(0,r.jsx)("button",{onClick:()=>ee("dag"),className:"px-3 py-1.5 text-xs font-medium transition-colors ".concat("dag"===Q?"bg-emerald-500 text-white":"text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50"),children:(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"2.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"4",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"12",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"2",cy:"13.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"6",cy:"13.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"12",cy:"13.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("line",{x1:"8",y1:"4",x2:"4",y2:"6.5",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"8",y1:"4",x2:"12",y2:"6.5",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"4",y1:"9.5",x2:"2",y2:"12",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"4",y1:"9.5",x2:"6",y2:"12",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"12",y1:"9.5",x2:"12",y2:"12",strokeOpacity:"0.5"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"DAG"})]})}),(0,r.jsx)("div",{className:"w-px bg-zinc-200"}),(0,r.jsx)("button",{onClick:()=>ee("radial"),className:"px-3 py-1.5 text-xs font-medium transition-colors ".concat("radial"===Q?"bg-emerald-500 text-white":"text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50"),children:(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"2",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"8",cy:"8",r:"5",fill:"none",strokeOpacity:"0.5"}),(0,r.jsx)("circle",{cx:"8",cy:"8",r:"7.5",fill:"none",strokeOpacity:"0.3"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Radial"})]})}),(0,r.jsx)("div",{className:"w-px bg-zinc-200"}),(0,r.jsx)("button",{onClick:()=>ee("cluster"),className:"px-3 py-1.5 text-xs font-medium transition-colors ".concat("cluster"===Q?"bg-emerald-500 text-white":"text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50"),children:(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"3.5",cy:"4",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"6",cy:"6",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"3",cy:"7",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"11",cy:"10",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"13.5",cy:"11.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"11",cy:"13",r:"1.5",fill:"currentColor",stroke:"none"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Cluster"})]})}),(0,r.jsx)("div",{className:"w-px bg-zinc-200"}),(0,r.jsx)("button",{onClick:()=>ee("spread"),className:"px-3 py-1.5 text-xs font-medium transition-colors ".concat("spread"===Q?"bg-emerald-500 text-white":"text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50"),children:(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"2",cy:"2",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"14",cy:"3",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"3",cy:"14",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"13",cy:"13",r:"1.5",fill:"currentColor",stroke:"none"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Spread"})]})})]}),(W||P)&&(0,r.jsx)("button",{onClick:B&&B.size>0?P:W,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-white/90 backdrop-blur-sm rounded-lg border border-zinc-200 shadow-sm text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50 transition-colors",children:B&&B.size>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Expand all"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Collapse all"})]})})]}),!A&&(0,r.jsxs)("div",{className:"absolute bottom-4 z-10 bg-white/90 backdrop-blur-sm rounded-lg border border-zinc-200 shadow-sm px-3 py-2 text-xs text-zinc-400 transition-[right] duration-300 ease-out",style:{right:E?"calc(360px + 1rem)":"1rem"},children:[I&&(0,r.jsxs)("div",{className:"text-zinc-500 mb-1.5",children:[(0,r.jsx)("strong",{className:"text-zinc-700",children:I.total})," issues"," \xb7 ",(0,r.jsx)("strong",{className:"text-zinc-700",children:I.edges})," deps"," \xb7 ",(0,r.jsx)("strong",{className:"text-emerald-600",children:I.prefixes.length}),1===I.prefixes.length?" project":" projects"]}),(0,r.jsx)("div",{className:"hidden sm:flex flex-wrap gap-x-3 gap-y-1 mb-1.5",children:["open","in_progress","blocked","deferred","closed"].map(e=>(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i[e]}}),(0,r.jsx)("span",{className:"text-zinc-500",children:l[e]})]},e))}),(0,r.jsx)("div",{className:"hidden sm:flex flex-col gap-0.5 text-zinc-400",children:(0,r.jsx)("span",{children:"Size = importance \xb7 Ring = project"})}),(0,r.jsx)("span",{className:"sm:hidden",children:"Tap a node for details"})]}),(0,r.jsxs)("div",{className:"hidden sm:block absolute bottom-4 left-4 z-10",style:{width:K,height:Z},children:[(0,r.jsx)("canvas",{ref:_,width:K,height:Z,onClick:eN,className:"rounded-lg border border-zinc-200 shadow-sm cursor-crosshair",style:{width:K,height:Z}}),(0,r.jsx)("div",{className:"absolute top-0 left-2 right-2 h-1.5 cursor-n-resize hover:bg-zinc-300/40 rounded-t-lg transition-colors",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),$.current={edge:"top",startX:e.clientX,startY:e.clientY,startW:K,startH:Z};let t=e=>{if(!$.current)return;let t=$.current.startY-e.clientY,n=Math.max(80,Math.min(400,$.current.startH+t));X(e=>({...e,h:n}))},n=()=>{$.current=null,window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)}}),(0,r.jsx)("div",{className:"absolute top-2 right-0 bottom-2 w-1.5 cursor-e-resize hover:bg-zinc-300/40 rounded-r-lg transition-colors",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),$.current={edge:"right",startX:e.clientX,startY:e.clientY,startW:K,startH:Z};let t=e=>{if(!$.current)return;let t=e.clientX-$.current.startX,n=Math.max(100,Math.min(500,$.current.startW+t));X(e=>({...e,w:n}))},n=()=>{$.current=null,window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)}}),(0,r.jsx)("div",{className:"absolute top-0 right-0 w-3 h-3 cursor-ne-resize hover:bg-zinc-300/40 rounded-tr-lg transition-colors",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),$.current={edge:"top-right",startX:e.clientX,startY:e.clientY,startW:K,startH:Z};let t=e=>{if(!$.current)return;let t=e.clientX-$.current.startX,n=$.current.startY-e.clientY;X({w:Math.max(100,Math.min(500,$.current.startW+t)),h:Math.max(80,Math.min(400,$.current.startH+n))})},n=()=>{$.current=null,window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)}})]}),J?(0,r.jsx)(J,{ref:F,graphData:ef,width:H.width,height:H.height,nodeCanvasObject:eg,nodeCanvasObjectMode:()=>"replace",nodePointerAreaPaint:ey,onRenderFramePost:eb,linkCanvasObject:ev,linkCanvasObjectMode:()=>"replace",linkDirectionalParticles:e=>"parent-child"===e.type?0:2,linkDirectionalParticleSpeed:.004,linkDirectionalParticleWidth:2.5,linkDirectionalParticleColor:()=>"#10b981",dagMode:"dag"===Q?"td":void 0,dagLevelDistance:60,onDagError:ej,d3AlphaDecay:.02,d3VelocityDecay:.3,cooldownTicks:300,warmupTicks:50,onNodeClick:e=>u(e),onNodeHover:e=>h(e||null,ec.current.x,ec.current.y),onNodeRightClick:(e,t)=>{t.preventDefault(),null==k||k(e,t)},onBackgroundClick:m,onZoom:ek,backgroundColor:"transparent"}):(0,r.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,r.jsx)("div",{className:"text-zinc-400 text-sm animate-pulse-soft",children:"Loading graph engine..."})})]})});function D(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}var L=n(5777),T=n(7827),A=n(1720);function I(e){let{node:t,onClose:n}=e;return t.description?(0,A.createPortal)((0,r.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/40 backdrop-blur-sm",onClick:n,children:(0,r.jsxs)("div",{className:"bg-white rounded-xl shadow-2xl w-[90vw] max-w-2xl max-h-[80vh] flex flex-col",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)("span",{className:"text-xs font-mono font-semibold text-emerald-600 shrink-0",children:t.id}),(0,r.jsx)("span",{className:"text-sm font-semibold text-zinc-900 truncate",children:t.title})]}),(0,r.jsx)("button",{onClick:n,className:"shrink-0 p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto px-5 py-4 custom-scrollbar description-markdown text-sm text-zinc-700 leading-relaxed",children:(0,r.jsx)(L.UG,{remarkPlugins:[T.Z],children:t.description})})]})}),document.body):null}function E(e){let{className:t="w-3 h-3",filled:n=!1}=e;return n?(0,r.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M11.645 20.91l-.007-.003-.022-.012a15.247 15.247 0 01-.383-.218 25.18 25.18 0 01-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0112 5.052 5.5 5.5 0 0116.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 01-4.244 3.17 15.247 15.247 0 01-.383.219l-.022.012-.007.004-.003.001a.752.752 0 01-.704 0l-.003-.001z"})}):(0,r.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z"})})}function B(e){let t=new Date(e),n=Math.floor((new Date().getTime()-t.getTime())/1e3);if(n<60)return"just now";let r=Math.floor(n/60);if(r<60)return"".concat(r,"m ago");let s=Math.floor(r/60);if(s<24)return"".concat(s,"h ago");let i=Math.floor(s/24);return i<7?"".concat(i,"d ago"):t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function W(e){let{node:t,allNodes:n,onNodeNavigate:d,comments:h,onPostComment:m,onDeleteComment:p,onLikeComment:f,onReplyComment:g,isAuthenticated:v,currentDid:b,repoUrls:y}=e,[j,w]=(0,s.useState)(null),[k,N]=(0,s.useState)(""),[z,C]=(0,s.useState)(!1),[M,S]=(0,s.useState)(!1),D=e=>{w(e.uri),N("")},A=()=>{w(null),N("")},E=async()=>{if(k.trim()&&j&&g){C(!0);try{let e=t=>{for(let n of t){if(n.uri===j)return n;let t=e(n.replies);if(t)return t}},t=h?e(h):void 0;t&&await g(t,k.trim()),w(null),N("")}catch(e){console.error("Failed to post reply:",e)}finally{C(!1)}}};if(!t)return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-zinc-100 flex items-center justify-center mb-4",children:(0,r.jsx)("svg",{className:"w-6 h-6 text-zinc-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"})})}),(0,r.jsx)("p",{className:"text-sm text-zinc-500 leading-relaxed",children:"Click a node to see details"}),(0,r.jsx)("p",{className:"text-xs text-zinc-400 mt-1",children:"Hover to highlight connections"})]});let B=c[t.issueType]||"\uD83D\uDCCB",W=i[t.status]||i.open,P=l[t.status]||t.status,U=a[t.priority]||"P".concat(t.priority),H=o[t.priority]||"#a1a1aa",Y=u[t.prefix]||t.prefix,V=x[t.prefix]||"#a1a1aa",q=null==y?void 0:y[t.prefix],X=t.blockerIds.map(e=>n.find(t=>t.id===e)).filter(Boolean),K=t.dependentIds.map(e=>n.find(t=>t.id===e)).filter(Boolean),Z=e=>{try{let t=new Date(e),n=t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),r=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!1});return"".concat(n," at ").concat(r)}catch(t){return e}};return(0,r.jsxs)("div",{className:"animate-fade-in",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3 mb-4",children:[(0,r.jsx)("span",{className:"text-2xl mt-0.5",children:B}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)("span",{className:"text-xs font-mono font-semibold text-emerald-600",children:t.id})}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-zinc-900 mt-1 leading-snug",children:t.title})]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2 mb-4",children:[(0,r.jsxs)("span",{className:"status-badge",style:{backgroundColor:W+"18",color:W,border:"1px solid ".concat(W,"30")},children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full mr-1.5",style:{backgroundColor:W}}),P]}),(0,r.jsx)("span",{className:"status-badge",style:{backgroundColor:H+"15",color:H,border:"1px solid ".concat(H,"25")},children:U}),q?(0,r.jsxs)("a",{href:q,target:"_blank",rel:"noopener noreferrer",className:"status-badge hover:opacity-80 transition-opacity",style:{backgroundColor:V+"15",color:V,border:"1px solid ".concat(V,"25"),textDecoration:"none"},children:[Y,(0,r.jsx)("svg",{className:"w-2.5 h-2.5 ml-1 opacity-50",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})})]}):(0,r.jsx)("span",{className:"status-badge",style:{backgroundColor:V+"15",color:V,border:"1px solid ".concat(V,"25")},children:Y})]}),q&&(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsxs)("a",{href:q,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-[11px] text-zinc-400 hover:text-zinc-600 transition-colors",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:(0,r.jsx)("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),q.replace(/^https?:\/\//,"")]})}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[(0,r.jsx)(F,{label:"Blocks",value:t.blockerCount,color:t.blockerCount>0?"#f59e0b":void 0}),(0,r.jsx)(F,{label:"Blocked by",value:t.dependentCount,color:t.dependentCount>0?"#ef4444":void 0})]}),(0,r.jsxs)("div",{className:"space-y-1.5 mb-4 text-xs text-zinc-500",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{children:"Created"}),(0,r.jsx)("span",{className:"text-zinc-700 font-medium",children:Z(t.createdAt)})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{children:"Updated"}),(0,r.jsx)("span",{className:"text-zinc-700 font-medium",children:Z(t.updatedAt)})]}),t.closedAt&&(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{children:"Closed"}),(0,r.jsx)("span",{className:"text-zinc-700 font-medium",children:Z(t.closedAt)})]}),t.closeReason&&(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{children:"Reason"}),(0,r.jsx)("span",{className:"text-zinc-700 font-medium truncate ml-2",children:t.closeReason})]}),t.owner&&(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{children:"Owner"}),(0,r.jsx)("span",{className:"text-zinc-700 font-medium truncate ml-2",children:t.owner})]})]}),t.description&&(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("h4",{className:"text-xs font-semibold text-zinc-500 uppercase tracking-wider",children:"Description"}),(0,r.jsx)("button",{onClick:()=>S(!0),className:"text-[10px] text-zinc-400 hover:text-zinc-600 transition-colors",children:"View in window"})]}),(0,r.jsx)("div",{className:"text-xs text-zinc-600 leading-relaxed bg-zinc-50 rounded-lg p-3 max-h-40 overflow-y-auto custom-scrollbar border border-zinc-100 description-markdown",children:(0,r.jsx)(L.UG,{remarkPlugins:[T.Z],children:t.description})})]}),M&&t.description&&(0,r.jsx)(I,{node:t,onClose:()=>S(!1)}),X.length>0&&(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsxs)("h4",{className:"text-xs font-semibold text-zinc-500 uppercase tracking-wider mb-2",children:["Blocks (",X.length,")"]}),(0,r.jsx)("div",{className:"space-y-1",children:X.map(e=>(0,r.jsx)(R,{node:e,onClick:()=>d(e.id)},e.id))})]}),K.length>0&&(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsxs)("h4",{className:"text-xs font-semibold text-zinc-500 uppercase tracking-wider mb-2",children:["Blocked by (",K.length,")"]}),(0,r.jsx)("div",{className:"space-y-1",children:K.map(e=>(0,r.jsx)(R,{node:e,onClick:()=>d(e.id)},e.id))})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsxs)("h4",{className:"text-xs font-semibold text-zinc-500 uppercase tracking-wider mb-2",children:["Comments"," ",h&&h.length>0&&(0,r.jsx)("span",{className:"ml-1 px-1.5 py-0.5 bg-emerald-50 text-emerald-600 rounded-full text-[10px] font-medium",children:h.length})]}),h&&h.length>0?(0,r.jsx)("div",{className:"space-y-1",children:h.map(e=>(0,r.jsx)(_,{comment:e,currentDid:b,isAuthenticated:v,onDelete:p,onLike:f,onStartReply:D,replyingToUri:j,replyText:k,onReplyTextChange:N,onSubmitReply:E,onCancelReply:A,isSubmittingReply:z,depth:0},e.uri))}):(0,r.jsx)("p",{className:"text-xs text-zinc-400 italic",children:"No comments yet"}),v&&m?(0,r.jsx)(O,{onSubmit:m}):v?null:(0,r.jsx)("p",{className:"text-xs text-zinc-400 mt-2",children:"Sign in to leave a comment"})]})]})}function P(e){let{replyingTo:t,replyText:n,onTextChange:s,onSubmit:i,onCancel:l,isSubmitting:a}=e;return(0,r.jsxs)("div",{className:"mt-2 ml-4 pl-3 border-l border-emerald-200 space-y-1.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] text-zinc-400",children:[(0,r.jsx)("span",{children:"Replying to"}),(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(t.did),target:"_blank",rel:"noopener noreferrer",className:"font-medium text-zinc-600 hover:text-emerald-600 transition-colors",children:t.displayName||t.handle})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("input",{type:"text",value:n,onChange:e=>s(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||i()},placeholder:"Write a reply...",disabled:a,autoFocus:!0,className:"flex-1 px-2 py-1 text-xs bg-white border border-zinc-200 rounded placeholder-zinc-400 focus:outline-none focus:border-emerald-400 disabled:opacity-50"}),(0,r.jsx)("button",{onClick:i,disabled:!n.trim()||a,className:"px-2 py-1 text-[10px] font-medium text-emerald-600 hover:text-emerald-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:a?"...":"Reply"}),(0,r.jsx)("button",{onClick:l,disabled:a,className:"px-2 py-1 text-[10px] text-zinc-400 hover:text-zinc-600 disabled:opacity-50 transition-colors",children:"Cancel"})]})]})}function F(e){let{label:t,value:n,color:s}=e;return(0,r.jsxs)("div",{className:"bg-zinc-50 rounded-lg p-3 border border-zinc-100",children:[(0,r.jsx)("div",{className:"text-xl font-bold",style:{color:s||"#3f3f46"},children:n}),(0,r.jsx)("div",{className:"text-[10px] text-zinc-400 uppercase tracking-wider mt-0.5",children:t})]})}function R(e){let{node:t,onClick:n}=e,s=i[t.status]||i.open;return(0,r.jsxs)("button",{onClick:n,className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-md hover:bg-zinc-50 transition-colors text-left group border border-transparent hover:border-zinc-200",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:s}}),(0,r.jsx)("span",{className:"text-xs font-mono text-emerald-600 group-hover:text-emerald-700 shrink-0",children:t.id}),(0,r.jsx)("span",{className:"text-xs text-zinc-500 truncate",children:t.title})]})}function _(e){let{comment:t,currentDid:n,isAuthenticated:i,onDelete:l,onLike:a,onStartReply:o,replyingToUri:c,replyText:d,onReplyTextChange:u,onSubmitReply:x,onCancelReply:h,isSubmittingReply:m,depth:p}=e,[f,g]=(0,s.useState)(!1),[v,b]=(0,s.useState)(!1),y=n&&n===t.did,j=!!n&&t.likes.some(e=>e.did===n),w=c===t.uri,k=async()=>{if(l&&!f){g(!0);try{await l(t)}catch(e){console.error("Failed to delete comment:",e)}finally{g(!1)}}},N=async()=>{if(a&&!v){b(!0);try{await a(t)}catch(e){console.error("Failed to toggle like:",e)}finally{b(!1)}}};return(0,r.jsxs)("div",{className:"".concat(p>0?"ml-4 pl-3 border-l border-zinc-100":""),children:[(0,r.jsxs)("div",{className:"py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,r.jsx)("div",{className:"shrink-0 w-4 h-4 rounded-full bg-zinc-100 overflow-hidden",children:t.avatar?(0,r.jsx)("img",{src:t.avatar,alt:"",className:"w-full h-full object-cover"}):(0,r.jsx)("div",{className:"w-full h-full flex items-center justify-center text-[8px] font-medium text-zinc-400",children:(t.handle||t.did).charAt(0).toUpperCase()})}),(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(t.did),target:"_blank",rel:"noopener noreferrer",className:"text-xs font-medium text-zinc-600 truncate hover:text-emerald-600 transition-colors",children:t.displayName||t.handle||t.did.slice(0,16)+"..."}),(0,r.jsx)("span",{className:"text-[10px] text-zinc-300 shrink-0",children:B(t.createdAt)})]}),(0,r.jsx)("p",{className:"text-xs text-zinc-500 leading-relaxed whitespace-pre-wrap break-words",children:t.text}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-[10px]",children:[(0,r.jsxs)("button",{onClick:N,disabled:!i||v,className:"flex items-center gap-0.5 transition-colors ".concat(j?"text-rose-500":"text-zinc-300 hover:text-rose-500"," disabled:opacity-50"),children:[(0,r.jsx)(E,{className:"w-3 h-3",filled:j}),t.likes.length>0&&(0,r.jsx)("span",{children:t.likes.length})]}),(0,r.jsx)("button",{onClick:()=>o(t),disabled:!i,className:"transition-colors disabled:opacity-50 ".concat(w?"text-emerald-500":"text-zinc-300 hover:text-zinc-500"),children:"reply"}),y&&l&&(0,r.jsx)("button",{onClick:k,disabled:f,className:"ml-auto shrink-0 text-zinc-300 hover:text-red-400 disabled:opacity-50 transition-colors",children:f?"...":"delete"})]})]}),w&&(0,r.jsx)(P,{replyingTo:t,replyText:d,onTextChange:u,onSubmit:x,onCancel:h,isSubmitting:m}),t.replies.length>0&&(0,r.jsx)("div",{children:t.replies.map(e=>(0,r.jsx)(_,{comment:e,currentDid:n,isAuthenticated:i,onDelete:l,onLike:a,onStartReply:o,replyingToUri:c,replyText:d,onReplyTextChange:u,onSubmitReply:x,onCancelReply:h,isSubmittingReply:m,depth:p+1},e.uri))})]})}function O(e){let{onSubmit:t}=e,[n,i]=(0,s.useState)(""),[l,a]=(0,s.useState)(!1),o=async()=>{if(n.trim()&&!l){a(!0);try{await t(n.trim()),i("")}catch(e){console.error("Failed to post comment:",e)}finally{a(!1)}}};return(0,r.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,r.jsx)("textarea",{value:n,onChange:e=>i(e.target.value),placeholder:"Leave a comment...",rows:2,className:"w-full px-2.5 py-1.5 text-xs border border-zinc-200 rounded-md bg-zinc-50 text-zinc-700 placeholder-zinc-400 resize-none focus:outline-none focus:ring-1 focus:ring-emerald-500 focus:border-emerald-500"}),(0,r.jsx)("button",{onClick:o,disabled:!n.trim()||l,className:"px-3 py-1 text-xs font-medium text-white bg-emerald-500 rounded-md hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:l?"Sending...":"Comment"})]})}var U=n(7796);function H(){let{isAuthenticated:e,isLoading:t,session:n,login:i,logout:l}=(0,U.a)(),[a,o]=(0,s.useState)(!1),[c,d]=(0,s.useState)(!1),[u,x]=(0,s.useState)(""),[h,m]=(0,s.useState)(!1),[p,f]=(0,s.useState)(""),g=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!c)return;let e=e=>{g.current&&!g.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c]);let v=async e=>{if(e.preventDefault(),u.trim()){m(!0),f("");try{await i(u.trim())}catch(e){f(e instanceof Error?e.message:"Login failed"),m(!1)}}},b=async()=>{d(!1),await l()};return t?(0,r.jsx)("div",{className:"w-4 h-4 rounded-full border-2 border-zinc-200 border-t-zinc-400 animate-spin"}):e&&n?(0,r.jsxs)("div",{className:"relative",ref:g,children:[(0,r.jsxs)("button",{onClick:()=>d(e=>!e),className:"flex items-center gap-2 px-3 py-1.5 rounded-full hover:bg-zinc-50 transition-colors cursor-pointer",children:[n.avatar?(0,r.jsx)("img",{src:n.avatar,alt:n.handle,width:24,height:24,className:"rounded-full"}):(0,r.jsx)("div",{className:"w-6 h-6 rounded-full bg-emerald-100 flex items-center justify-center text-[11px] text-emerald-700 font-medium",children:(n.displayName||n.handle).charAt(0).toUpperCase()}),(0,r.jsx)("span",{className:"text-sm text-zinc-600 max-w-[100px] truncate",children:n.displayName||n.handle})]}),c&&(0,r.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-44 bg-white rounded-xl shadow-xl border border-zinc-100 py-2 z-50",children:[(0,r.jsxs)("a",{href:n.did?"https://www.impactindexer.org/data?did=".concat(n.did):"#",target:"_blank",rel:"noopener noreferrer",className:"block px-3 py-1.5 text-xs text-zinc-400 truncate hover:text-emerald-600 transition-colors",children:["@",n.handle]}),(0,r.jsx)("div",{className:"h-px bg-zinc-100 my-1"}),(0,r.jsxs)("button",{onClick:b,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-zinc-600 hover:bg-zinc-50 transition-colors cursor-pointer",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15m-3 0-3-3m0 0 3-3m-3 3H15"})}),"Sign out"]})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>o(!0),className:"px-4 py-1.5 text-sm font-medium text-zinc-600 rounded-full hover:text-zinc-900 hover:bg-zinc-50 transition-colors cursor-pointer whitespace-nowrap",children:"Sign in"}),a&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[20vh]",onClick:()=>o(!1),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/20 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative w-full max-w-sm mx-4 bg-white rounded-xl shadow-lg border border-zinc-200 p-6",onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-zinc-900 mb-1",children:"Sign in with ATProto"}),(0,r.jsx)("p",{className:"text-sm text-zinc-400 mb-5",children:"Enter your Bluesky handle to connect."}),(0,r.jsxs)("form",{onSubmit:v,children:[(0,r.jsx)("label",{htmlFor:"auth-handle",className:"block text-sm text-zinc-600 mb-1.5",children:"Handle"}),(0,r.jsx)("input",{id:"auth-handle",type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"alice.bsky.social",disabled:h,autoFocus:!0,className:"w-full px-3 py-2 text-sm bg-white border border-zinc-200 rounded-lg placeholder:text-zinc-300 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-400 disabled:opacity-50 disabled:cursor-not-allowed"}),(0,r.jsx)("p",{className:"text-xs text-zinc-300 mt-1.5",children:"Just a username? We'll add .bsky.social for you."}),p&&(0,r.jsx)("p",{className:"text-sm text-red-500 mt-2",children:p}),(0,r.jsxs)("div",{className:"flex gap-2 mt-5",children:[(0,r.jsx)("button",{type:"button",onClick:()=>o(!1),disabled:h,className:"flex-1 px-3 py-2 text-sm text-zinc-600 bg-zinc-50 rounded-lg hover:bg-zinc-100 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"}),(0,r.jsx)("button",{type:"submit",disabled:h||!u.trim(),className:"flex-1 px-3 py-2 text-sm text-white bg-emerald-600 rounded-lg hover:bg-emerald-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:h?"Connecting...":"Connect"})]})]})]})]})]})}function Y(e){let{className:t}=e;return(0,r.jsxs)("svg",{viewBox:"0 0 32 32",fill:"none",className:t,"aria-hidden":"true",children:[(0,r.jsx)("polygon",{points:"16,3 27,9.5 27,22.5 16,29 5,22.5 5,9.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",opacity:"0.7",strokeLinejoin:"round",children:(0,r.jsx)("animateTransform",{attributeName:"transform",type:"rotate",values:"0 16 16;360 16 16",dur:"40s",repeatCount:"indefinite"})}),(0,r.jsx)("polygon",{points:"16,8 22.5,11.5 22.5,20.5 16,24 9.5,20.5 9.5,11.5",stroke:"currentColor",strokeWidth:"0.8",fill:"none",opacity:"0.35",strokeLinejoin:"round",children:(0,r.jsx)("animateTransform",{attributeName:"transform",type:"rotate",values:"360 16 16;0 16 16",dur:"30s",repeatCount:"indefinite"})}),(0,r.jsx)("line",{x1:"16",y1:"16",x2:"16",y2:"3",stroke:"currentColor",strokeWidth:"0.6",opacity:"0.2",children:(0,r.jsx)("animate",{attributeName:"opacity",values:"0.15;0.35;0.15",dur:"3s",repeatCount:"indefinite"})}),(0,r.jsx)("line",{x1:"16",y1:"16",x2:"27",y2:"9.5",stroke:"currentColor",strokeWidth:"0.6",opacity:"0.2",children:(0,r.jsx)("animate",{attributeName:"opacity",values:"0.15;0.35;0.15",dur:"3s",repeatCount:"indefinite",begin:"0.5s"})}),(0,r.jsx)("line",{x1:"16",y1:"16",x2:"27",y2:"22.5",stroke:"currentColor",strokeWidth:"0.6",opacity:"0.2",children:(0,r.jsx)("animate",{attributeName:"opacity",values:"0.15;0.35;0.15",dur:"3s",repeatCount:"indefinite",begin:"1s"})}),(0,r.jsx)("line",{x1:"16",y1:"16",x2:"16",y2:"29",stroke:"currentColor",strokeWidth:"0.6",opacity:"0.2",children:(0,r.jsx)("animate",{attributeName:"opacity",values:"0.15;0.35;0.15",dur:"3s",repeatCount:"indefinite",begin:"1.5s"})}),(0,r.jsx)("line",{x1:"16",y1:"16",x2:"5",y2:"22.5",stroke:"currentColor",strokeWidth:"0.6",opacity:"0.2",children:(0,r.jsx)("animate",{attributeName:"opacity",values:"0.15;0.35;0.15",dur:"3s",repeatCount:"indefinite",begin:"2s"})}),(0,r.jsx)("line",{x1:"16",y1:"16",x2:"5",y2:"9.5",stroke:"currentColor",strokeWidth:"0.6",opacity:"0.2",children:(0,r.jsx)("animate",{attributeName:"opacity",values:"0.15;0.35;0.15",dur:"3s",repeatCount:"indefinite",begin:"2.5s"})}),(0,r.jsxs)("circle",{cx:"16",cy:"16",r:"2.5",fill:"currentColor",opacity:"0.8",children:[(0,r.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"3s",repeatCount:"indefinite"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.7;1;0.7",dur:"3s",repeatCount:"indefinite"})]}),(0,r.jsxs)("circle",{cx:"16",cy:"3",r:"1.5",fill:"currentColor",opacity:"0.5",children:[(0,r.jsx)("animate",{attributeName:"r",values:"1.2;2;1.2",dur:"2.5s",repeatCount:"indefinite"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"2.5s",repeatCount:"indefinite"})]}),(0,r.jsxs)("circle",{cx:"27",cy:"9.5",r:"1.5",fill:"currentColor",opacity:"0.5",children:[(0,r.jsx)("animate",{attributeName:"r",values:"1.2;2;1.2",dur:"2.5s",repeatCount:"indefinite",begin:"0.4s"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"2.5s",repeatCount:"indefinite",begin:"0.4s"})]}),(0,r.jsxs)("circle",{cx:"27",cy:"22.5",r:"1.5",fill:"currentColor",opacity:"0.5",children:[(0,r.jsx)("animate",{attributeName:"r",values:"1.2;2;1.2",dur:"2.5s",repeatCount:"indefinite",begin:"0.8s"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"2.5s",repeatCount:"indefinite",begin:"0.8s"})]}),(0,r.jsxs)("circle",{cx:"16",cy:"29",r:"1.5",fill:"currentColor",opacity:"0.5",children:[(0,r.jsx)("animate",{attributeName:"r",values:"1.2;2;1.2",dur:"2.5s",repeatCount:"indefinite",begin:"1.2s"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"2.5s",repeatCount:"indefinite",begin:"1.2s"})]}),(0,r.jsxs)("circle",{cx:"5",cy:"22.5",r:"1.5",fill:"currentColor",opacity:"0.5",children:[(0,r.jsx)("animate",{attributeName:"r",values:"1.2;2;1.2",dur:"2.5s",repeatCount:"indefinite",begin:"1.6s"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"2.5s",repeatCount:"indefinite",begin:"1.6s"})]}),(0,r.jsxs)("circle",{cx:"5",cy:"9.5",r:"1.5",fill:"currentColor",opacity:"0.5",children:[(0,r.jsx)("animate",{attributeName:"r",values:"1.2;2;1.2",dur:"2.5s",repeatCount:"indefinite",begin:"2s"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"2.5s",repeatCount:"indefinite",begin:"2s"})]}),(0,r.jsxs)("circle",{cx:"16",cy:"16",r:"10",stroke:"currentColor",strokeWidth:"0.4",fill:"none",opacity:"0.15",children:[(0,r.jsx)("animate",{attributeName:"r",values:"9;11;9",dur:"4s",repeatCount:"indefinite"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"4s",repeatCount:"indefinite"})]})]})}function V(e){var t;let{node:n,x:i,y:l,onClose:a,onSubmit:o,isAuthenticated:c,existingComments:d}=e,[u,h]=(0,s.useState)(""),[m,p]=(0,s.useState)(!1),f=(0,s.useRef)(null),g=(0,s.useRef)(null),[v,b]=(0,s.useState)({x:0,y:0}),[y,j]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!f.current)return;let e=f.current.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,r=i+14,s=l-e.height-14;r+e.width>t-16&&(r=t-e.width-16),r<16&&(r=16),s<16&&(s=l+28),s+e.height>n-16&&(s=n-e.height-16),b({x:r,y:s}),j(!0)},[i,l]),(0,s.useEffect)(()=>{if(c){let e=setTimeout(()=>{var e;return null===(e=g.current)||void 0===e?void 0:e.focus()},100);return()=>clearTimeout(e)}},[c]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&a()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a]),(0,s.useEffect)(()=>{let e=e=>{f.current&&!f.current.contains(e.target)&&a()},t=setTimeout(()=>{window.addEventListener("mousedown",e)},50);return()=>{clearTimeout(t),window.removeEventListener("mousedown",e)}},[a]);let w=(0,s.useCallback)(async()=>{if(u.trim()&&!m){p(!0);try{await o(u.trim()),h("")}catch(e){console.error("Failed to post comment:",e)}finally{p(!1)}}},[u,m,o]),k=(0,s.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),w())},[w]),N=x[n.prefix]||"#a1a1aa",z=(null==d?void 0:d.length)||0;return(0,r.jsxs)("div",{ref:f,style:{position:"fixed",left:v.x,top:v.y,width:320,zIndex:100,opacity:y?1:0,transform:y?"translateY(0)":"translateY(4px)",transition:"opacity 0.2s ease, transform 0.2s ease"},className:"bg-white border border-zinc-200 rounded-lg overflow-hidden",onContextMenu:e=>e.preventDefault(),children:[(0,r.jsx)("style",{children:"\n .comment-tooltip-shadow {\n box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.08);\n }\n "}),(0,r.jsxs)("div",{className:"comment-tooltip-shadow p-[18px_20px]",children:[(0,r.jsx)("div",{className:"rounded-sm mb-2.5",style:{width:24,height:2,background:N,opacity:.6}}),(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("span",{className:"text-xs font-mono text-emerald-600",children:n.id}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-zinc-800 leading-tight mt-0.5",children:n.title})]}),z>0&&d&&(0,r.jsxs)("div",{className:"mb-3 pb-3 border-b border-zinc-100",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-blue-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 20.25c4.97 0 9-3.694 9-8.25s-4.03-8.25-9-8.25S3 7.444 3 12c0 2.104.859 4.023 2.273 5.48.432.447.74 1.04.586 1.641a4.483 4.483 0 01-.923 1.785A5.969 5.969 0 006 21c1.282 0 2.47-.402 3.445-1.087.81.22 1.668.337 2.555.337z"})}),(0,r.jsxs)("span",{className:"text-[10px] font-medium text-zinc-500 uppercase tracking-wider",children:[z," comment",1!==z?"s":""]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[d.slice(0,2).map(e=>(0,r.jsxs)("div",{className:"flex gap-1.5",children:[(0,r.jsx)("div",{className:"shrink-0 w-4 h-4 rounded-full bg-zinc-100 overflow-hidden mt-0.5",children:e.avatar?(0,r.jsx)("img",{src:e.avatar,alt:"",className:"w-full h-full object-cover"}):(0,r.jsx)("div",{className:"w-full h-full flex items-center justify-center text-[7px] font-medium text-zinc-400",children:(e.handle||e.did).charAt(0).toUpperCase()})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(e.did),target:"_blank",rel:"noopener noreferrer",className:"text-[10px] font-medium text-zinc-500 hover:text-emerald-600 transition-colors",children:e.displayName||e.handle}),(0,r.jsx)("p",{className:"text-[11px] text-zinc-500 line-clamp-2 leading-tight",children:e.text})]})]},e.uri)),z>2&&(0,r.jsxs)("p",{className:"text-[10px] text-zinc-400 italic",children:["+",z-2," more — see detail panel"]})]})]}),c?(0,r.jsxs)("div",{children:[(0,r.jsx)("textarea",{ref:g,value:u,onChange:e=>h(e.target.value),onKeyDown:k,placeholder:"Leave a comment...",rows:3,className:"w-full px-2.5 py-2 text-xs border border-zinc-200 rounded-md bg-zinc-50 text-zinc-700 placeholder-zinc-400 resize-none focus:outline-none focus:ring-1 focus:ring-emerald-500 focus:border-emerald-500"}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,r.jsxs)("span",{className:"text-[10px] text-zinc-300",children:["undefined"!=typeof navigator&&(null===(t=navigator.platform)||void 0===t?void 0:t.includes("Mac"))?"⌘":"Ctrl","+Enter to send"]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:a,className:"px-2.5 py-1 text-[11px] text-zinc-400 hover:text-zinc-600 transition-colors",children:"Cancel"}),(0,r.jsx)("button",{onClick:w,disabled:!u.trim()||m,className:"px-3 py-1 text-[11px] font-medium text-white bg-emerald-500 rounded-md hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:m?(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsxs)("svg",{className:"w-3 h-3 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Sending"]}):"Send"})]})]})]}):(0,r.jsxs)("div",{className:"text-center py-3",children:[(0,r.jsx)("svg",{className:"w-5 h-5 text-zinc-300 mx-auto mb-1.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})}),(0,r.jsx)("p",{className:"text-xs text-zinc-400",children:"Sign in to comment"})]})]})]})}function q(e){let{node:t,x:n,y:i,onShowDescription:l,onAddComment:a,onClaimTask:o,onUnclaimTask:c,onCollapseEpic:d,onUncollapseEpic:u,onClose:x}=e,h=(0,s.useRef)(null),[m,p]=(0,s.useState)({x:0,y:0}),[f,g]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(!h.current)return;let e=h.current.getBoundingClientRect(),t=window.innerWidth,r=window.innerHeight,s=n+4,l=i+4;s+e.width>t-16&&(s=t-e.width-16),s<16&&(s=16),l+e.height>r-16&&(l=r-e.height-16),l<16&&(l=16),p({x:s,y:l}),g(!0)},[n,i]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&x()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[x]),(0,s.useEffect)(()=>{let e=e=>{h.current&&!h.current.contains(e.target)&&x()},t=setTimeout(()=>window.addEventListener("mousedown",e),50);return()=>{clearTimeout(t),window.removeEventListener("mousedown",e)}},[x]),(0,r.jsx)("div",{ref:h,style:{position:"fixed",left:m.x,top:m.y,zIndex:100,opacity:f?1:0,transform:f?"translateY(0)":"translateY(2px)",transition:"opacity 0.15s ease, transform 0.15s ease"},onContextMenu:e=>e.preventDefault(),children:(0,r.jsxs)("div",{className:"bg-white border border-zinc-200 rounded-lg overflow-hidden",style:{minWidth:180,boxShadow:"0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.06)"},children:[t.description&&(0,r.jsxs)("button",{onClick:l,className:"w-full px-3 py-2.5 text-xs text-zinc-700 hover:bg-zinc-50 flex items-center gap-2 transition-colors border-b border-zinc-100",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),"Show description"]}),(0,r.jsxs)("button",{onClick:a,className:"w-full px-3 py-2.5 text-xs text-zinc-700 hover:bg-zinc-50 flex items-center gap-2 transition-colors".concat(o||c||d||u?" border-b border-zinc-100":""),children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 20.25c4.97 0 9-3.694 9-8.25s-4.03-8.25-9-8.25S3 7.444 3 12c0 2.104.859 4.023 2.273 5.48.432.447.74 1.04.586 1.641a4.483 4.483 0 01-.923 1.785A5.969 5.969 0 006 21c1.282 0 2.47-.402 3.445-1.087.81.22 1.668.337 2.555.337z"})}),"Add comment"]}),o&&(0,r.jsxs)("button",{onClick:o,className:"w-full px-3 py-2.5 text-xs text-zinc-700 hover:bg-zinc-50 flex items-center gap-2 transition-colors".concat(d||u?" border-b border-zinc-100":""),children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})}),"Claim task"]}),c&&(0,r.jsxs)("button",{onClick:c,className:"w-full px-3 py-2.5 text-xs text-red-500 hover:bg-red-50 flex items-center gap-2 transition-colors".concat(d||u?" border-b border-zinc-100":""),children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-red-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M22 10.5h-6m-2.25-4.125a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zM4 19.235v-.11a6.375 6.375 0 0112.75 0v.109A12.318 12.318 0 0110.374 21c-2.331 0-4.512-.645-6.374-1.766z"})}),"Unclaim task"]}),d&&(0,r.jsxs)("button",{onClick:d,className:"w-full px-3 py-2.5 text-xs text-zinc-700 hover:bg-zinc-50 flex items-center gap-2 transition-colors",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})}),"Collapse epic"]}),u&&(0,r.jsxs)("button",{onClick:u,className:"w-full px-3 py-2.5 text-xs text-zinc-700 hover:bg-zinc-50 flex items-center gap-2 transition-colors",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),"Uncollapse epic"]})]})})}let X={bg:"#FFFFFF",border:"#E5E7EB",borderLight:"#F3F4F6",shadow:"rgba(0,0,0,0.08)",text:"#131316",textMuted:"#737680",textDim:"#7F818B"};function K(e){let{node:t,x:n,y:i,prefixColor:l,allNodes:c}=e,d=(0,s.useRef)(null),[u,x]=(0,s.useState)({x:0,y:0});(0,s.useEffect)(()=>{if(!d.current)return;let e=d.current.getBoundingClientRect(),t=n+14,r=i-e.height-14;t+e.width>window.innerWidth-16&&(t=n-e.width-14),t<16&&(t=16),r<16&&(r=i+14+8),r+e.height>window.innerHeight-16&&(r=window.innerHeight-e.height-16),x({x:t,y:r})},[n,i]);let h=t.dependentIds.map(e=>{let t=c.find(t=>t.id===e);return t?{id:e,title:t.title}:{id:e,title:e}}).filter(Boolean),m=a[t.priority]||"P".concat(t.priority),p=o[t.priority]||"#a1a1aa";return(0,r.jsxs)("div",{ref:d,className:"bead-tooltip",style:{position:"fixed",left:u.x,top:u.y,width:280,zIndex:100,pointerEvents:"none",background:X.bg,border:"1px solid ".concat(X.border),boxShadow:"0 8px 32px ".concat(X.shadow,", 0 2px 8px ").concat(X.shadow),borderRadius:8,padding:"16px 18px",animation:"beadTooltipFade 0.2s ease"},children:[(0,r.jsx)("div",{style:{width:24,height:2,background:l,opacity:.5,marginBottom:10,borderRadius:1}}),(0,r.jsx)("div",{style:{fontSize:14,fontWeight:600,color:X.text,lineHeight:1.25,marginBottom:12,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:t.title}),(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:Z,children:"Created"}),(0,r.jsx)("div",{style:$,children:B(t.createdAt)})]}),t.owner&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:Z,children:"Owner"}),(0,r.jsx)("div",{style:$,children:t.owner})]}),(t.assignee||t.createdBy)&&(0,r.jsxs)("div",{children:[t.assignee&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:Z,children:"Assignee"}),(0,r.jsx)("div",{style:$,children:t.assignee})]}),t.createdBy&&!t.assignee&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:Z,children:"Created by"}),(0,r.jsx)("div",{style:$,children:t.createdBy})]}),t.createdBy&&t.assignee&&t.createdBy!==t.assignee&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{...Z,marginTop:4},children:"Created by"}),(0,r.jsx)("div",{style:$,children:t.createdBy})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:Z,children:"Blocked by"}),0===h.length?(0,r.jsx)("div",{style:{...$,color:"#10b981"},children:"None"}):(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:3},children:h.map(e=>(0,r.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,r.jsx)("span",{style:{fontSize:10,fontFamily:"monospace",color:X.textDim,flexShrink:0},children:e.id}),(0,r.jsx)("span",{style:{fontSize:12,color:X.textMuted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]},e.id))})]}),(0,r.jsxs)("div",{style:{borderTop:"1px solid ".concat(X.borderLight),paddingTop:8},children:[(0,r.jsx)("div",{style:Z,children:"Priority"}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,r.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",background:p,flexShrink:0}}),(0,r.jsx)("span",{style:$,children:m})]})]})]})]})}let Z={fontSize:10,fontWeight:600,letterSpacing:1.5,textTransform:"uppercase",color:"#7F818B",marginBottom:3},$={fontSize:12,color:"#737680",lineHeight:1.45};function J(e){let{isOpen:t,onClose:n,allComments:s,onNodeNavigate:i,isAuthenticated:l,currentDid:a,onLikeComment:o,onDeleteComment:c}=e;return(0,r.jsxs)("aside",{className:"hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white border-l border-zinc-200 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ".concat(t?"translate-x-0":"translate-x-full"),children:[(0,r.jsxs)("div",{className:"shrink-0 px-5 py-3 border-b border-zinc-100 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"All Comments"}),s.length>0&&(0,r.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-50 text-emerald-600 rounded-full text-[10px] font-medium",children:s.length})]}),(0,r.jsx)("button",{onClick:n,className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors rounded-full hover:bg-zinc-100",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-5 py-3",children:s.length>0?(0,r.jsx)("div",{className:"space-y-0",children:s.filter(e=>!e.replyTo).map(e=>(0,r.jsx)(G,{comment:e,currentDid:a,isAuthenticated:l,onNodeNavigate:i,onLike:o,onDelete:c,depth:0},e.uri))}):(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)("svg",{className:"w-8 h-8 text-zinc-200 mb-3",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 011.037-.443 48.282 48.282 0 005.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})}),(0,r.jsx)("p",{className:"text-xs text-zinc-400",children:"No comments yet"}),(0,r.jsx)("p",{className:"text-[10px] text-zinc-300 mt-1",children:"Right-click a node to leave a comment"})]})}),(0,r.jsx)("div",{className:"shrink-0 px-5 py-2.5 border-t border-zinc-100 bg-zinc-50/50",children:(0,r.jsxs)("div",{className:"text-[10px] text-zinc-400",children:[s.length," comment",1!==s.length?"s":""," across all issues"]})})]})}function G(e){let{comment:t,currentDid:n,isAuthenticated:i,onNodeNavigate:l,onLike:a,onDelete:o,depth:c}=e,[d,u]=(0,s.useState)(!1),[x,h]=(0,s.useState)(!1),m=n&&n===t.did,p=!!n&&t.likes.some(e=>e.did===n),f=async()=>{if(a&&!d){u(!0);try{await a(t)}catch(e){console.error("Failed to toggle like:",e)}finally{u(!1)}}},g=async()=>{if(o&&!x){h(!0);try{await o(t)}catch(e){console.error("Failed to delete comment:",e)}finally{h(!1)}}};return(0,r.jsxs)("div",{className:"".concat(c>0?"ml-4 pl-3 border-l border-zinc-100":""),children:[(0,r.jsxs)("div",{className:"py-3 ".concat(0===c?"border-b border-zinc-50":""),children:[0===c&&(0,r.jsx)("button",{onClick:()=>l(t.nodeId),className:"inline-flex items-center px-1.5 py-0.5 mb-1.5 rounded text-[10px] font-mono bg-emerald-50 text-emerald-600 hover:bg-emerald-100 transition-colors",children:t.nodeId}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,r.jsx)("div",{className:"shrink-0 w-4 h-4 rounded-full bg-zinc-100 overflow-hidden",children:t.avatar?(0,r.jsx)("img",{src:t.avatar,alt:"",className:"w-full h-full object-cover"}):(0,r.jsx)("div",{className:"w-full h-full flex items-center justify-center text-[8px] font-medium text-zinc-400",children:(t.handle||t.did).charAt(0).toUpperCase()})}),(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(t.did),target:"_blank",rel:"noopener noreferrer",className:"text-xs font-medium text-zinc-600 truncate hover:text-emerald-600 transition-colors",children:t.displayName||t.handle||t.did.slice(0,16)+"..."}),(0,r.jsx)("span",{className:"text-[10px] text-zinc-300 shrink-0",children:B(t.createdAt)})]}),(0,r.jsx)("p",{className:"text-xs text-zinc-500 leading-relaxed whitespace-pre-wrap break-words",children:t.text}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-[10px]",children:[(0,r.jsxs)("button",{onClick:f,disabled:!i||d,className:"flex items-center gap-0.5 transition-colors ".concat(p?"text-rose-500":"text-zinc-300 hover:text-rose-500"," disabled:opacity-50"),children:[(0,r.jsx)(E,{className:"w-3 h-3",filled:p}),t.likes.length>0&&(0,r.jsx)("span",{children:t.likes.length})]}),m&&o&&(0,r.jsx)("button",{onClick:g,disabled:x,className:"ml-auto text-zinc-300 hover:text-red-400 disabled:opacity-50 transition-colors",children:x?"...":"delete"})]})]}),t.replies.length>0&&(0,r.jsx)("div",{children:t.replies.map(e=>(0,r.jsx)(G,{comment:e,currentDid:n,isAuthenticated:i,onNodeNavigate:l,onLike:a,onDelete:o,depth:c+1},e.uri))})]})}function Q(e){let{type:t,className:n}=e,s=n||"w-3.5 h-3.5 shrink-0";switch(t){case"node-created":return(0,r.jsxs)("svg",{className:"".concat(s," text-emerald-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,r.jsx)("line",{x1:"8",y1:"5",x2:"8",y2:"11"}),(0,r.jsx)("line",{x1:"5",y1:"8",x2:"11",y2:"8"})]});case"node-closed":return(0,r.jsxs)("svg",{className:"".concat(s," text-zinc-400"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,r.jsx)("polyline",{points:"5.5,8 7.5,10 10.5,6"})]});case"node-status-changed":return(0,r.jsx)("svg",{className:"".concat(s," text-amber-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)("path",{d:"M3 8h10M10 5l3 3-3 3"})});case"node-priority-changed":return(0,r.jsx)("svg",{className:"".concat(s," text-amber-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)("path",{d:"M8 3v7M5 6l3-3 3 3M4 13h8"})});case"node-title-changed":return(0,r.jsx)("svg",{className:"".concat(s," text-amber-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)("path",{d:"M3 4h10M3 8h6M3 12h8"})});case"node-owner-changed":return(0,r.jsxs)("svg",{className:"".concat(s," text-amber-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"6",cy:"6",r:"2.5"}),(0,r.jsx)("path",{d:"M1.5 13c0-2 1.8-3.5 4.5-3.5M10 9l2 2 3-3"})]});case"link-added":return(0,r.jsx)("svg",{className:"".concat(s," text-blue-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)("path",{d:"M6.5 9.5l3-3M4 11a2.5 2.5 0 003.5 0l1-1M8.5 6a2.5 2.5 0 013.5 0l0 0"})});case"link-removed":return(0,r.jsxs)("svg",{className:"".concat(s," text-red-400"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("path",{d:"M4 11a2.5 2.5 0 003.5 0l1-1M8.5 6a2.5 2.5 0 013.5 0l0 0"}),(0,r.jsx)("line",{x1:"3",y1:"3",x2:"13",y2:"13",strokeWidth:"1.5"})]});case"comment-added":case"reply-added":return(0,r.jsx)("svg",{className:"".concat(s," text-blue-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)("path",{d:"M2 4.5a1.5 1.5 0 011.5-1.5h9A1.5 1.5 0 0114 4.5v5a1.5 1.5 0 01-1.5 1.5H5L2 14V4.5z"})});case"task-claimed":return(0,r.jsxs)("svg",{className:"".concat(s," text-emerald-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"5.5",r:"2.5"}),(0,r.jsx)("path",{d:"M3 13.5c0-2.5 2.2-4.5 5-4.5s5 2 5 4.5"})]});case"task-unclaimed":return(0,r.jsxs)("svg",{className:"".concat(s," text-red-400"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"5.5",r:"2.5"}),(0,r.jsx)("path",{d:"M3 13.5c0-2.5 2.2-4.5 5-4.5s5 2 5 4.5"}),(0,r.jsx)("line",{x1:"11",y1:"3",x2:"13",y2:"5"})]});case"like-added":return(0,r.jsx)("svg",{className:"".concat(s," text-rose-400"),viewBox:"0 0 16 16",fill:"currentColor",children:(0,r.jsx)("path",{d:"M8 13.7l-.6-.5C4 10.2 2 8.3 2 6a3 3 0 016-1 3 3 0 016 1c0 2.3-2 4.2-5.4 7.2l-.6.5z"})})}}function ee(e){switch(e){case"node-created":case"task-claimed":return"bg-emerald-400";case"node-closed":return"bg-zinc-300";case"node-status-changed":case"node-priority-changed":case"node-title-changed":case"node-owner-changed":return"bg-amber-400";case"link-added":case"comment-added":case"reply-added":return"bg-blue-400";case"link-removed":case"task-unclaimed":return"bg-red-300";case"like-added":return"bg-rose-300"}}function et(e){var t,n,r;switch(e.type){case"node-created":{let n=(null===(t=e.meta)||void 0===t?void 0:t.issueType)||"task";return"".concat(n," created")}case"node-closed":return"closed".concat(e.detail&&"Closed"!==e.detail?" (".concat(e.detail,")"):"");case"node-status-changed":return e.detail||"status changed";case"node-priority-changed":return"priority ".concat(e.detail||"changed");case"node-title-changed":return"title updated";case"node-owner-changed":return"owner ".concat(e.detail||"changed");case"link-added":return"dep added: ".concat((null===(n=e.meta)||void 0===n?void 0:n.target)||"");case"link-removed":return"dep removed: ".concat((null===(r=e.meta)||void 0===r?void 0:r.target)||"");case"comment-added":return e.detail||"commented";case"reply-added":return e.detail||"replied";case"task-claimed":return"claimed this task";case"task-unclaimed":return"unclaimed this task";case"like-added":return e.detail||"liked a comment"}}function en(e){let{event:t,onNodeClick:n}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-2 py-2 px-3 group hover:bg-zinc-50/60 transition-colors",children:[(0,r.jsx)("div",{className:"w-1 h-1 rounded-full shrink-0 ".concat(ee(t.type))}),(0,r.jsx)(Q,{type:t.type,className:"w-3 h-3 shrink-0"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 text-[11px] text-zinc-600 truncate",children:[t.actor?(0,r.jsxs)(r.Fragment,{children:[t.actor.did?(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(t.actor.did),target:"_blank",rel:"noopener noreferrer",className:"font-medium text-zinc-800 hover:text-emerald-600 transition-colors",children:t.actor.handle.split(".")[0]}):(0,r.jsx)("span",{className:"font-medium text-zinc-800",children:t.actor.handle.split(".")[0]})," "]}):n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>n(t.nodeId),className:"font-medium text-zinc-700 hover:text-emerald-600 transition-colors",children:t.nodeId})," "]}):null,(0,r.jsx)("span",{className:"text-zinc-500",children:et(t)})]}),(0,r.jsx)("span",{className:"text-[10px] text-zinc-400 shrink-0 tabular-nums opacity-0 group-hover:opacity-100 transition-opacity",children:B(new Date(t.time).toISOString())})]})}function er(e){var t;let{event:n,onNodeClick:s}=e;return(0,r.jsxs)("div",{className:"flex gap-3 py-3 px-4 hover:bg-zinc-50/50 transition-colors group",children:[(0,r.jsx)("div",{className:"w-0.5 self-stretch rounded-full shrink-0 ".concat(ee(n.type))}),(0,r.jsx)("div",{className:"mt-0.5 shrink-0",children:(null===(t=n.actor)||void 0===t?void 0:t.avatar)?(0,r.jsx)("img",{src:n.actor.avatar,alt:n.actor.handle,className:"w-7 h-7 rounded-full ring-1 ring-zinc-100"}):n.actor?(0,r.jsx)("div",{className:"w-7 h-7 rounded-full bg-zinc-100 flex items-center justify-center text-[11px] font-medium text-zinc-500",children:n.actor.handle.charAt(0).toUpperCase()}):(0,r.jsx)("div",{className:"w-7 h-7 rounded-full bg-zinc-50 flex items-center justify-center",children:(0,r.jsx)(Q,{type:n.type,className:"w-3.5 h-3.5"})})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-baseline gap-1.5 text-[12px] leading-snug",children:[n.actor&&(n.actor.did?(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(n.actor.did),target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-zinc-800 hover:text-emerald-600 transition-colors truncate max-w-[140px]",children:n.actor.handle.split(".")[0]}):(0,r.jsx)("span",{className:"font-semibold text-zinc-800 truncate max-w-[140px]",children:n.actor.handle.split(".")[0]})),(0,r.jsx)("span",{className:"text-zinc-500",children:et(n)})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[s&&(0,r.jsx)("button",{onClick:()=>s(n.nodeId),className:"inline-flex items-center px-1.5 py-0.5 text-[10px] font-mono font-medium text-emerald-700 bg-emerald-50 rounded-md hover:bg-emerald-100 transition-colors",children:n.nodeId}),n.nodeTitle&&(0,r.jsx)("span",{className:"text-[11px] text-zinc-400 truncate",children:n.nodeTitle})]})]}),(0,r.jsx)("span",{className:"text-[10px] text-zinc-400 shrink-0 tabular-nums mt-0.5",children:B(new Date(n.time).toISOString())})]})}function es(e){let{event:t,variant:n="compact",onNodeClick:s}=e;return"compact"===n?(0,r.jsx)(en,{event:t,onNodeClick:s}):(0,r.jsx)(er,{event:t,onNodeClick:s})}function ei(e){let{events:t,collapsed:n,onToggleCollapse:s,onExpandPanel:i,onNodeClick:l}=e,a=t.filter(e=>Date.now()-e.time<3e5).length;return n?(0,r.jsxs)("button",{onClick:s,className:"group flex items-center gap-2 px-3 py-2 bg-white/90 backdrop-blur-sm rounded-full border border-zinc-200/80 shadow-sm hover:bg-white hover:shadow-md transition-all",title:"Show activity feed",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5 text-zinc-400 group-hover:text-emerald-500 transition-colors",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,r.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,r.jsx)("span",{className:"text-xs text-zinc-500 group-hover:text-zinc-700 transition-colors",children:"Activity"}),a>0&&(0,r.jsx)("span",{className:"text-[10px] font-medium text-white bg-emerald-500 rounded-full px-1.5 py-0.5 min-w-[18px] text-center leading-tight",children:a})]}):(0,r.jsxs)("div",{className:"w-72 bg-white/95 backdrop-blur-sm rounded-xl border border-zinc-200/80 shadow-lg overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3.5 py-2.5 border-b border-zinc-100/80",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),(0,r.jsx)("span",{className:"text-[11px] font-semibold text-zinc-600",children:"Live Activity"})]}),(0,r.jsx)("button",{onClick:s,className:"text-zinc-400 hover:text-zinc-600 transition-colors p-1 -mr-0.5 rounded-full hover:bg-zinc-100",title:"Collapse",children:(0,r.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})})]}),(0,r.jsx)("div",{className:"py-0.5 max-h-[260px] overflow-y-auto custom-scrollbar",children:0===t.length?(0,r.jsxs)("div",{className:"py-6 text-center",children:[(0,r.jsxs)("svg",{className:"w-5 h-5 text-zinc-200 mx-auto mb-1.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,r.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,r.jsx)("p",{className:"text-[11px] text-zinc-400",children:"No activity yet"})]}):t.slice(0,6).map((e,t)=>(0,r.jsx)("div",{className:0===t?"bg-emerald-50/30":"",children:(0,r.jsx)(es,{event:e,variant:"compact",onNodeClick:l})},e.id))}),t.length>0&&(0,r.jsxs)("div",{className:"flex items-center justify-between px-3.5 py-2 border-t border-zinc-100/80 bg-zinc-50/30",children:[(0,r.jsxs)("span",{className:"text-[10px] text-zinc-400",children:[t.length," event",1!==t.length?"s":""]}),(0,r.jsxs)("button",{onClick:i,className:"text-[11px] text-emerald-600 hover:text-emerald-700 transition-colors font-medium flex items-center gap-1",children:["See all",(0,r.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]})]})}function el(e,t){let n=new Set(e.map(e=>e.id)),r=[...e];for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>t.time-e.time),r.slice(0,200)}let ea=[{key:"issues",label:"Issues",icon:"circle"},{key:"deps",label:"Deps",icon:"link"},{key:"comments",label:"Comments",icon:"chat"},{key:"claims",label:"Claims",icon:"user"},{key:"likes",label:"Likes",icon:"heart"}];function eo(e){let{events:t,isOpen:n,onClose:i,onNodeClick:l}=e,[a,o]=(0,s.useState)(""),[c,d]=(0,s.useState)(new Set(ea.map(e=>e.key))),u=e=>{d(t=>{let n=new Set(t);return n.has(e)?n.size>1&&n.delete(e):n.add(e),n})},x=(0,s.useMemo)(()=>{let e=t;if(e=e.filter(e=>c.has(function(e){switch(e){case"node-created":case"node-closed":case"node-status-changed":case"node-priority-changed":case"node-title-changed":case"node-owner-changed":return"issues";case"link-added":case"link-removed":return"deps";case"comment-added":case"reply-added":return"comments";case"task-claimed":case"task-unclaimed":return"claims";case"like-added":return"likes"}}(e.type))),a.trim()){let t=a.trim().toLowerCase();e=e.filter(e=>{var n;return e.nodeId.toLowerCase().includes(t)||e.nodeTitle&&e.nodeTitle.toLowerCase().includes(t)||(null===(n=e.actor)||void 0===n?void 0:n.handle)&&e.actor.handle.toLowerCase().includes(t)||e.detail&&e.detail.toLowerCase().includes(t)})}return e},[t,c,a]),h=(0,s.useMemo)(()=>(function(e){let t=new Map,n=[];for(let r of e){let e=function(e){let t=Date.now()-e,n=t/36e5,r=t/864e5;return n<1?"Just now":n<24?"Today":r<2?"Yesterday":r<7?"This week":r<30?"This month":"Older"}(r.time);t.has(e)||(t.set(e,[]),n.push(e)),t.get(e).push(r)}return n.map(e=>({label:e,events:t.get(e)}))})(x),[x]),m=c.size===ea.length;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("aside",{className:"hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white border-l border-zinc-200 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ".concat(n?"translate-x-0":"translate-x-full"),children:[(0,r.jsxs)("div",{className:"shrink-0 px-5 py-3 border-b border-zinc-100 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"Activity"}),t.length>0&&(0,r.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-50 text-emerald-600 rounded-full text-[10px] font-medium",children:t.length})]}),(0,r.jsx)("button",{onClick:i,className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors rounded-full hover:bg-zinc-100",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"px-4 pt-3 pb-2 shrink-0",children:(0,r.jsxs)("div",{className:"flex items-center bg-zinc-50/80 rounded-full border border-zinc-200/60 overflow-hidden",children:[(0,r.jsx)("div",{className:"pl-3 pr-1 text-zinc-400",children:(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,r.jsx)("input",{type:"text",value:a,onChange:e=>o(e.target.value),placeholder:"Search activity...",className:"flex-1 px-2 py-2 text-xs text-zinc-800 bg-transparent outline-none placeholder:text-zinc-400"}),a&&(0,r.jsx)("button",{onClick:()=>o(""),className:"pr-3 text-zinc-400 hover:text-zinc-600",children:(0,r.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5 px-4 pb-3 shrink-0",children:ea.map(e=>{let t=c.has(e.key);return(0,r.jsx)("button",{onClick:()=>u(e.key),className:"px-2.5 py-1 text-[11px] font-medium rounded-full border transition-all ".concat(t?"bg-emerald-50 text-emerald-700 border-emerald-200 shadow-sm":"bg-white text-zinc-400 border-zinc-200 hover:text-zinc-600 hover:border-zinc-300"),children:e.label},e.key)})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar border-t border-zinc-100",children:0===x.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)("svg",{className:"w-8 h-8 text-zinc-200 mb-3",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,r.jsx)("p",{className:"text-xs text-zinc-400",children:a.trim()?"No activity matching your search":"No activity yet"}),a.trim()&&(0,r.jsx)("button",{onClick:()=>o(""),className:"text-[11px] text-emerald-600 hover:text-emerald-700 mt-1.5",children:"Clear search"})]}):h.map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"sticky top-0 z-[1] px-4 py-1.5 bg-zinc-50/95 backdrop-blur-sm border-b border-zinc-100/60",children:(0,r.jsx)("span",{className:"text-[10px] font-semibold text-zinc-400 uppercase tracking-wider",children:e.label})}),(0,r.jsx)("div",{className:"divide-y divide-zinc-50",children:e.events.map(e=>(0,r.jsx)(es,{event:e,variant:"full",onNodeClick:l},e.id))})]},e.label))}),(0,r.jsx)("div",{className:"shrink-0 px-5 py-2.5 border-t border-zinc-100 bg-zinc-50/50",children:(0,r.jsxs)("div",{className:"text-[10px] text-zinc-400",children:[x.length," event",1!==x.length?"s":"",!m&&" (filtered)",a.trim()&&' matching "'.concat(a.trim(),'"')]})})]}),(0,r.jsx)("div",{className:"md:hidden fixed inset-x-0 bottom-0 z-20 transition-transform duration-300 ease-out ".concat(n?"translate-y-0":"translate-y-full"),children:(0,r.jsxs)("div",{className:"bg-white rounded-t-2xl shadow-xl border-t border-zinc-200 max-h-[60vh] flex flex-col",children:[(0,r.jsx)("div",{className:"flex justify-center pt-3 pb-1",children:(0,r.jsx)("div",{className:"w-8 h-1 bg-zinc-300 rounded-full"})}),(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h2",{className:"text-sm font-semibold text-zinc-900",children:"Activity"}),t.length>0&&(0,r.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-50 text-emerald-600 rounded-full text-[10px] font-medium",children:t.length})]}),(0,r.jsx)("button",{onClick:i,className:"p-1 text-zinc-400 hover:text-zinc-600",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5 px-5 pb-3",children:ea.map(e=>(0,r.jsx)("button",{onClick:()=>u(e.key),className:"px-2.5 py-1 text-[11px] font-medium rounded-full border transition-colors ".concat(c.has(e.key)?"bg-emerald-50 text-emerald-700 border-emerald-200":"bg-white text-zinc-400 border-zinc-200"),children:e.label},e.key))}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:0===x.length?(0,r.jsx)("div",{className:"py-8 text-center text-xs text-zinc-400",children:"No activity matching filters"}):h.map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"sticky top-0 z-[1] px-5 py-1.5 bg-zinc-50/95 backdrop-blur-sm border-b border-zinc-100/60",children:(0,r.jsx)("span",{className:"text-[10px] font-semibold text-zinc-400 uppercase tracking-wider",children:e.label})}),(0,r.jsx)("div",{className:"divide-y divide-zinc-50",children:e.events.map(e=>(0,r.jsx)(es,{event:e,variant:"full",onNodeClick:l},e.id))})]},e.label))})]})})]})}let ec=new Map,ed=new Map;async function eu(e){let t=ec.get(e);if(t)return t;let n=ed.get(e);if(n)return n;let r=(async()=>{try{let t=await fetch("https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=".concat(encodeURIComponent(e)));if(!t.ok)throw Error("Profile fetch failed: ".concat(t.status));let n=await t.json(),r={did:e,handle:n.handle||e,displayName:n.displayName||void 0,avatar:n.avatar||void 0};return ec.set(e,r),r}catch(n){let t={did:e,handle:e.slice(0,20)+"..."};return ec.set(e,t),t}finally{ed.delete(e)}})();return ed.set(e,r),r}async function ex(e){let t;let n=[],r=!0,s=0;for(;r&&s<5;){var i,l;let a=await fetch("https://hypergoat-app-production.up.railway.app/graphql",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:"\n query FetchRecords($collection: String!, $first: Int, $after: String) {\n records(collection: $collection, first: $first, after: $after) {\n edges {\n node {\n cid\n collection\n did\n rkey\n uri\n value\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n",variables:{collection:e,first:100,after:t}})});if(!a.ok)throw Error("Indexer fetch failed: ".concat(a.status));let o=await a.json();if(null===(i=o.errors)||void 0===i?void 0:i.length)throw Error(o.errors[0].message);let c=null===(l=o.data)||void 0===l?void 0:l.records;if(!c)break;for(let e of c.edges)n.push(e.node);r=c.pageInfo.hasNextPage,t=c.pageInfo.endCursor,s++}return n}function eh(e){let{totalSteps:t,currentStep:n,currentTime:i,isPlaying:l,speed:a,onStepChange:o,onPlayPause:c,onSpeedChange:d}=e,u=(0,s.useCallback)(e=>{o(Number(e.target.value))},[o]),x=(0,s.useCallback)(()=>{d(1===a?2:2===a?4:1)},[a,d]),h=t>1;return(0,r.jsx)("div",{className:"bg-white/90 backdrop-blur-sm rounded-lg border border-zinc-200 shadow-sm px-3 py-2 min-w-[280px] max-w-[480px]",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:c,disabled:!h,className:"shrink-0 w-6 h-6 flex items-center justify-center rounded transition-colors ".concat(l?"text-emerald-500 hover:text-emerald-600":"text-zinc-500 hover:text-zinc-700"," disabled:opacity-40 disabled:cursor-not-allowed"),children:l?(0,r.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"currentColor",children:[(0,r.jsx)("rect",{x:"3",y:"2",width:"3.5",height:"12",rx:"1"}),(0,r.jsx)("rect",{x:"9.5",y:"2",width:"3.5",height:"12",rx:"1"})]}):(0,r.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"currentColor",children:(0,r.jsx)("path",{d:"M4 2l10 6-10 6V2z"})})}),(0,r.jsx)("input",{type:"range",min:0,max:Math.max(t-1,0),value:n,onChange:u,disabled:!h,className:"timeline-slider flex-1 h-4 disabled:opacity-40"}),(0,r.jsxs)("span",{className:"shrink-0 text-xs text-zinc-500 font-medium text-right whitespace-nowrap",children:[(0,r.jsxs)("span",{className:"text-zinc-400",children:[n+1,"/",t]})," ",new Date(i).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]}),(0,r.jsxs)("button",{onClick:x,className:"shrink-0 px-1.5 py-0.5 text-[10px] font-semibold rounded transition-colors ".concat(a>1?"bg-emerald-500 text-white":"text-zinc-500 border border-zinc-200 hover:text-zinc-700"),children:[a,"x"]})]})})}function em(e,t,n){let r=Date.now(),s=new Map(e.graphData.nodes.map(e=>[e.id,e])),i=new Set(e.graphData.links.map(h)),l=t.graphData.nodes.map(e=>{let i=s.get(e.id);if(!i){let n=function(e,t,n){for(let r of t){let t="object"==typeof r.source?r.source.id:r.source,s="object"==typeof r.target?r.target.id:r.target;if(t===e&&n.has(s)){let e=n.get(s);if(null!=e.x&&null!=e.y)return{x:e.x,y:e.y}}if(s===e&&n.has(t)){let e=n.get(t);if(null!=e.x&&null!=e.y)return{x:e.x,y:e.y}}}return null}(e.id,t.graphData.links,s);return{...e,_spawnTime:r,x:n?n.x+(Math.random()-.5)*40:void 0,y:n?n.y+(Math.random()-.5)*40:void 0}}let l={...e,x:i.x,y:i.y,fx:i.fx,fy:i.fy};if(n.changedNodes.has(e.id)){let t=n.changedNodes.get(e.id).find(e=>"status"===e.field);t&&(l._changedAt=r,l._prevStatus=t.from)}return l});for(let e of n.removedNodeIds){let t=s.get(e);t&&l.push({...t,_removeTime:r})}let a=t.graphData.links.map(e=>{let t=h(e);return i.has(t)?e:{...e,_spawnTime:r}});for(let t of n.removedLinkKeys){let n=e.graphData.links.find(e=>h(e)===t);n&&a.push({source:"object"==typeof n.source?n.source.id:n.source,target:"object"==typeof n.target?n.target.id:n.target,type:n.type,_removeTime:r})}return{...t,graphData:{nodes:l,links:a}}}let ep={open:"bg-emerald-500",in_progress:"bg-amber-500",blocked:"bg-red-500",deferred:"bg-violet-500",closed:"bg-zinc-400"};function ef(){var e,t,n;let[i,l]=(0,s.useState)(null),[a,o]=(0,s.useState)(!0),[c,u]=(0,s.useState)(null),[x,h]=(0,s.useState)(null),[p,f]=(0,s.useState)(null),[g,v]=(0,s.useState)(new Set),[b,y]=(0,s.useState)("Beads"),[j,w]=(0,s.useState)(0),[k,N]=(0,s.useState)({}),{isAuthenticated:z,session:C}=(0,U.a)(),{commentsByNode:M,commentedNodeIds:D,allComments:L,refetch:T}=function(){let[e,t]=(0,s.useState)(new Map),[n,r]=(0,s.useState)(new Map),[i,l]=(0,s.useState)([]),[a,o]=(0,s.useState)(!0),[c,d]=(0,s.useState)(null),u=(0,s.useRef)(!1),x=(0,s.useCallback)(async()=>{try{o(!0),d(null);let[e,n]=await Promise.all([ex("org.impactindexer.review.comment"),ex("org.impactindexer.review.like")]),s=e.filter(e=>{let t=e.value.subject;return(null==t?void 0:t.uri)&&"string"==typeof t.uri&&t.uri.startsWith("beads:")}),i=new Map;for(let e of n){let t=e.value.subject;if((null==t?void 0:t.uri)&&"string"==typeof t.uri&&t.uri.startsWith("at://")){let n=i.get(t.uri)||[];n.push(e),i.set(t.uri,n)}}let a=new Set;for(let e of s)a.add(e.did);for(let e of n)a.add(e.did);let c=await Promise.all([...a].map(e=>eu(e))),x=new Map(c.map(e=>[e.did,e])),h=[];for(let e of s){let t=e.value,n=t.subject.uri.replace(/^beads:/,""),r=t.text||"",s=t.createdAt||"",l=t.replyTo||void 0,a=x.get(e.did),o=(i.get(e.uri)||[]).map(e=>{let t=x.get(e.did),n=e.value;return{did:e.did,handle:(null==t?void 0:t.handle)||e.did.slice(0,20)+"...",displayName:null==t?void 0:t.displayName,avatar:null==t?void 0:t.avatar,createdAt:n.createdAt||"",uri:e.uri,rkey:e.rkey}}),c={did:e.did,handle:(null==a?void 0:a.handle)||e.did.slice(0,20)+"...",displayName:null==a?void 0:a.displayName,avatar:null==a?void 0:a.avatar,text:r,createdAt:s,uri:e.uri,rkey:e.rkey,nodeId:n,replyTo:l,likes:o,replies:[]};h.push(c)}let m=new Map;for(let e of h)m.set(e.uri,e);let p=[];for(let e of h){if(e.replyTo){let t=m.get(e.replyTo);if(t){t.replies.push(e);continue}}p.push(e)}p.sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()),function e(t){for(let n of t)n.replies.sort((e,t)=>new Date(e.createdAt).getTime()-new Date(t.createdAt).getTime()),e(n.replies)}(p);let f=new Map;for(let e of p){let t=f.get(e.nodeId)||[];t.push(e),f.set(e.nodeId,t)}let g=new Map;for(let e of h)g.set(e.nodeId,(g.get(e.nodeId)||0)+1);let v=[...h].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());u.current||(t(f),r(g),l(v))}catch(e){if(!u.current){let t=e instanceof Error?e.message:"Failed to fetch comments";console.error("Failed to fetch beads comments:",e),d(t)}}finally{u.current||o(!1)}},[]);return(0,s.useEffect)(()=>(u.current=!1,x(),()=>{u.current=!0}),[x]),{commentsByNode:e,commentedNodeIds:n,allComments:i,isLoading:a,error:c,refetch:x}}(),[A,E]=(0,s.useState)(new Map),[P,F]=(0,s.useState)(new Set),R=(0,s.useMemo)(()=>{let e=new Map;if(L)for(let t of L){if(e.has(t.nodeId)||P.has(t.nodeId))continue;let n=t.text.trim();n.startsWith("@")&&-1===n.indexOf(" ")&&e.set(t.nodeId,{avatar:t.avatar,handle:t.handle,claimedAt:t.createdAt,did:t.did,rkey:t.rkey})}for(let[t,n]of A)e.has(t)||P.has(t)||e.set(t,n);return e},[L,A,P]),[_,O]=(0,s.useState)(!1),[X,Z]=(0,s.useState)([]),[$,G]=(0,s.useState)(!1),[Q,ee]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!i)return;let e=function(e,t,n){let r=[],s=new Set;function i(e){s.has(e.id)||(s.add(e.id),r.push(e))}for(let t of e){if(t.createdAt){let e=new Date(t.createdAt).getTime();isNaN(e)||i({id:"node-created:".concat(t.id,":").concat(e),type:"node-created",time:e,nodeId:t.id,nodeTitle:t.title,detail:t.issueType,meta:{issueType:t.issueType,prefix:t.prefix}})}if(t.closedAt){let e=new Date(t.closedAt).getTime();isNaN(e)||i({id:"node-closed:".concat(t.id,":").concat(e),type:"node-closed",time:e,nodeId:t.id,nodeTitle:t.title,detail:t.closeReason||"Closed",meta:{prefix:t.prefix}})}}for(let e of t)if(e.createdAt){let t=new Date(e.createdAt).getTime();if(!isNaN(t)){let n="object"==typeof e.source?e.source.id:e.source,r="object"==typeof e.target?e.target.id:e.target;i({id:"link-added:".concat(n,"->").concat(r,":").concat(t),type:"link-added",time:t,nodeId:n,detail:"".concat(e.type," ").concat(r),meta:{linkType:e.type,target:r}})}}if(n)for(let e of n){let t=new Date(e.createdAt).getTime();if(isNaN(t))continue;let n={handle:e.handle,avatar:e.avatar,did:e.did};for(let r of(i(e.text.startsWith("@")&&-1===e.text.trim().indexOf(" ")?{id:"task-claimed:".concat(e.nodeId,":").concat(t),type:"task-claimed",time:t,nodeId:e.nodeId,actor:n,detail:e.text}:e.replyTo?{id:"reply-added:".concat(e.nodeId,":").concat(e.rkey),type:"reply-added",time:t,nodeId:e.nodeId,actor:n,detail:e.text.length>80?e.text.slice(0,80)+"...":e.text}:{id:"comment-added:".concat(e.nodeId,":").concat(e.rkey),type:"comment-added",time:t,nodeId:e.nodeId,actor:n,detail:e.text.length>80?e.text.slice(0,80)+"...":e.text}),e.likes)){let t=new Date(r.createdAt).getTime();isNaN(t)||i({id:"like-added:".concat(e.nodeId,":").concat(r.rkey),type:"like-added",time:t,nodeId:e.nodeId,actor:{handle:r.handle,avatar:r.avatar,did:r.did},detail:"Liked comment by ".concat(e.handle)})}}return r.sort((e,t)=>t.time-e.time),r}(i.graphData.nodes,i.graphData.links,L);Z(t=>el(t,e))},[i,L]);let[et,en]=(0,s.useState)(null),[er,es]=(0,s.useState)(null),[ea,ec]=(0,s.useState)(null),[ed,ef]=(0,s.useState)(null),[eg,ev]=(0,s.useState)(null),[eb,ey]=(0,s.useState)(!1),[ej,ew]=(0,s.useState)(""),[ek,eN]=(0,s.useState)(0),[ez,eC]=(0,s.useState)(!1),[eM,eS]=(0,s.useState)(0),[eD,eL]=(0,s.useState)(!1),[eT,eA]=(0,s.useState)(1),[eI,eE]=(0,s.useState)(null),eB=(0,s.useRef)(null),eW=(0,s.useRef)(null),eP=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=null,t=null,n=null,r=!0;return function s(){(e=new EventSource("/api/beads/stream")).onmessage=e=>{if(r)try{let t=JSON.parse(e.data);if(t.error){u(t.error),o(!1);return}let n=eP.current,r=m(n,t);if(!n){eP.current=t,l(t),o(!1);return}if(!r.hasChanges)return;let s=function(e,t){let n=[],r=Date.now(),s=new Map(t.map(e=>[e.id,e]));for(let t of e.addedNodeIds){let e=s.get(t);n.push({id:"node-created:".concat(t,":").concat(r),type:"node-created",time:r,nodeId:t,nodeTitle:null==e?void 0:e.title,detail:(null==e?void 0:e.issueType)||"task",meta:e?{issueType:e.issueType,prefix:e.prefix}:void 0})}for(let t of e.removedNodeIds)n.push({id:"node-closed:".concat(t,":").concat(r),type:"node-closed",time:r,nodeId:t,detail:"Removed"});for(let[t,i]of e.changedNodes){let e=s.get(t);for(let s of i){let i;switch(s.field){case"status":default:i="node-status-changed";break;case"priority":i="node-priority-changed";break;case"title":i="node-title-changed";break;case"owner":i="node-owner-changed"}n.push({id:"".concat(i,":").concat(t,":").concat(r,":").concat(s.field),type:i,time:r,nodeId:t,nodeTitle:null==e?void 0:e.title,detail:"".concat(s.from," → ").concat(s.to),meta:{field:s.field,from:s.from,to:s.to}})}}for(let t of e.addedLinkKeys){let e=t.match(/^(.+)->(.+):(.+)$/);if(e){let[,s,i,l]=e;n.push({id:"link-added:".concat(t,":").concat(r),type:"link-added",time:r,nodeId:s,detail:"".concat(l," ").concat(i),meta:{linkType:l,target:i}})}}for(let t of e.removedLinkKeys){let e=t.match(/^(.+)->(.+):(.+)$/);if(e){let[,s,i,l]=e;n.push({id:"link-removed:".concat(t,":").concat(r),type:"link-removed",time:r,nodeId:s,detail:"".concat(l," ").concat(i),meta:{linkType:l,target:i}})}}return n}(r,t.graphData.nodes);s.length>0&&Z(e=>el(e,s));let i=em(n,t,r);eP.current=i,l(i)}catch(e){console.error("Failed to parse SSE message:",e)}},e.onerror=()=>{(null==e?void 0:e.readyState)===EventSource.CLOSED&&(t=setTimeout(s,5e3))},n=setTimeout(()=>{r&&!eP.current&&fetch("/api/beads").then(e=>e.json()).then(e=>{r&&!eP.current&&(eP.current=e,l(e),o(!1))}).catch(()=>{})},5e3)}(),()=>{r=!1,null==e||e.close(),t&&clearTimeout(t),n&&clearTimeout(n)}},[]),(0,s.useEffect)(()=>{fetch("/api/config").then(e=>e.json()).then(e=>{e.name&&y(e.name),e.repoCount&&w(e.repoCount),e.repoUrls&&N(e.repoUrls)}).catch(()=>{})},[]),(0,s.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>{let e=Date.now(),t=i.graphData.nodes.filter(t=>!t._removeTime||e-t._removeTime<600),n=i.graphData.links.filter(t=>!t._removeTime||e-t._removeTime<600);(t.length!==i.graphData.nodes.length||n.length!==i.graphData.links.length)&&l(e=>e?{...e,graphData:{nodes:t,links:n}}:e)},700);return()=>clearTimeout(e)},[i]);let eF=(0,s.useMemo)(()=>i?function(e,t){let n=[];for(let t of e){let e=new Date(t.createdAt).getTime();if(isNaN(e)||n.push({time:e,type:"node-created",id:t.id}),t.closedAt){let e=new Date(t.closedAt).getTime();isNaN(e)||n.push({time:e,type:"node-closed",id:t.id})}}n.sort((e,t)=>e.time-t.time);let r=n.length>0?n[0].time:Date.now(),s=n.length>0?n[n.length-1].time:Date.now();return{events:n,minTime:r,maxTime:s}}(i.graphData.nodes,i.graphData.links):null,[i]),eR=(0,s.useCallback)(()=>{eC(e=>{let t=!e;return t&&eS(-1),eL(!1),eE(null),t})},[]);(0,s.useEffect)(()=>{if(!eD||!ez||!eF)return;let e=setInterval(()=>{eS(e=>{let t=e+1;return t>=eF.events.length?(eL(!1),e):t})},2e3/eT);return()=>clearInterval(e)},[eD,ez,eT,eF]),(0,s.useEffect)(()=>{if(!ez||!i||!eF)return;if(-1===eM){eE(e=>{let t={...i,graphData:{nodes:[],links:[]}};if(!e)return t;let n=m(e,t);return n.hasChanges?em(e,t,n):e});return}if(0===eF.events.length)return;let e=eF.events[eM];if(!e)return;let t=function(e,t,n){let r=new Set,s=[];for(let t of e){let e=new Date(t.createdAt).getTime();if(isNaN(e)||e>n)continue;r.add(t.id);let i=t.status;if(t.closedAt){let e=new Date(t.closedAt).getTime();!isNaN(e)&&e<=n?i="closed":"closed"===t.status&&(i="open")}i!==t.status?s.push({...t,status:i}):s.push(t)}let i=[];for(let e of t){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;r.has(t)&&r.has(n)&&i.push({...e,source:t,target:n})}return{nodes:s,links:i}}(i.graphData.nodes,i.graphData.links,e.time),n={...i,graphData:{nodes:t.nodes,links:t.links}};eE(e=>{if(!e)return n;let t=m(e,n);return t.hasChanges?em(e,n,t):e})},[ez,i,eF,eM]);let e_=(0,s.useCallback)(e=>{h(t=>(null==t?void 0:t.id)===e.id?null:e),O(!1),G(!1)},[]),eO=(0,s.useCallback)((e,t,n)=>{f(e),ev(e?{node:e,x:t,y:n}:null)},[]),eU=(0,s.useCallback)(e=>{v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),eH=(0,s.useMemo)(()=>{if(!i)return new Set;let{nodes:e,links:t}=i.graphData,n=new Set;for(let e of t)if("parent-child"===e.type){let t="object"==typeof e.source?e.source.id:e.source;n.add(t)}let r=new Set(e.map(e=>e.id));for(let t of e)if(t.id.includes(".")){let e=t.id.split(".")[0];r.has(e)&&n.add(e)}return n},[i]),eY=(0,s.useCallback)(()=>{v(new Set(eH))},[eH]),eV=(0,s.useCallback)(()=>{v(new Set)},[]),eq=(0,s.useCallback)(()=>{h(null),en(null),es(null)},[]),eX=(0,s.useCallback)((e,t)=>{es(null),ev(null),e.description||z||"epic"===e.issueType?en({node:e,x:t.clientX,y:t.clientY}):es({node:e,x:t.clientX,y:t.clientY})},[z]),eK=(0,s.useCallback)(async(e,t)=>{let n=await fetch("/api/records",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collection:"org.impactindexer.review.comment",record:{$type:"org.impactindexer.review.comment",subject:{uri:"beads:".concat(e),type:"record"},text:t,createdAt:new Date().toISOString()}})});if(!n.ok)throw Error((await n.json()).error||"Failed to post comment");await T()},[T]),eZ=(0,s.useCallback)(async e=>{if(!(null==C?void 0:C.handle))return;let t=C.avatar;if(!t&&C.did)try{let e=await fetch("https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=".concat(encodeURIComponent(C.did)));e.ok&&(t=(await e.json()).avatar)}catch(e){}E(n=>{let r=new Map(n);return r.set(e,{avatar:t,claimedAt:new Date().toISOString(),handle:C.handle}),r}),await eK(e,"@".concat(C.handle)),setTimeout(()=>T(),3e3)},[null==C?void 0:C.handle,null==C?void 0:C.did,null==C?void 0:C.avatar,eK,T]),e$=(0,s.useCallback)(async e=>{let t=await fetch("/api/records?collection=".concat(encodeURIComponent("org.impactindexer.review.comment"),"&rkey=").concat(encodeURIComponent(e.rkey)),{method:"DELETE"});if(!t.ok)throw Error((await t.json()).error||"Failed to delete comment");await T()},[T]),eJ=(0,s.useCallback)(async e=>{let t=R.get(e);t&&(F(t=>new Set(t).add(e)),E(t=>{let n=new Map(t);return n.delete(e),n}),t.rkey?(await e$({rkey:t.rkey}),F(t=>{let n=new Set(t);return n.delete(e),n})):setTimeout(async()=>{await T(),F(t=>{let n=new Set(t);return n.delete(e),n})},3e3))},[R,e$,T]),eG=(0,s.useCallback)(async e=>{let t=e.likes.find(e=>e.did===(null==C?void 0:C.did));if(t){let e=await fetch("/api/records?collection=".concat(encodeURIComponent("org.impactindexer.review.like"),"&rkey=").concat(encodeURIComponent(t.rkey)),{method:"DELETE"});if(!e.ok)throw Error((await e.json()).error||"Failed to unlike")}else{let t=await fetch("/api/records",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collection:"org.impactindexer.review.like",record:{subject:{uri:e.uri,type:"record"},createdAt:new Date().toISOString()}})});if(!t.ok)throw Error((await t.json()).error||"Failed to like")}await T()},[null==C?void 0:C.did,T]),eQ=(0,s.useCallback)(async(e,t)=>{let n=await fetch("/api/records",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collection:"org.impactindexer.review.comment",record:{subject:{uri:"beads:".concat(e.nodeId),type:"record"},text:t,replyTo:e.uri,createdAt:new Date().toISOString()}})});if(!n.ok)throw Error((await n.json()).error||"Failed to post reply");await T()},[T]),e0=(0,s.useCallback)(e=>{if(!i)return;let t=i.graphData.nodes.find(t=>t.id===e);t&&h(t)},[i]),e1=(0,s.useMemo)(()=>{let e=new Map;if(!L)return e;let t=new Map;for(let e of L)t.has(e.nodeId)||t.set(e.nodeId,new Set),t.get(e.nodeId).add(e.handle),e.displayName&&t.get(e.nodeId).add(e.displayName);for(let[n,r]of t)e.set(n,Array.from(r).join(" "));return e},[L]),e5=(0,s.useMemo)(()=>{if(!i||!ej.trim())return[];let e=ej.toLowerCase();return i.graphData.nodes.filter(t=>{let n=e1.get(t.id)||"";return"".concat(t.id," ").concat(t.title," ").concat(t.prefix," ").concat(t.owner||""," ").concat(t.assignee||""," ").concat(t.createdBy||""," ").concat(n).toLowerCase().includes(e)}).slice(0,8)},[ej,i,e1]);(0,s.useEffect)(()=>{eN(0)},[ej]);let e2=(0,s.useCallback)(e=>{var t;null===(t=eB.current)||void 0===t||t.focusNode(e),ey(!1),ew(""),eN(0)},[]);(0,s.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key&&(e.preventDefault(),ey(!0),setTimeout(()=>{var e;return null===(e=eW.current)||void 0===e?void 0:e.focus()},50)),"Escape"===e.key&&eb&&(ey(!1),ew(""),eN(0))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[eb]);let e4=(0,s.useCallback)(e=>{"ArrowDown"===e.key?(e.preventDefault(),eN(e=>Math.min(e+1,e5.length-1))):"ArrowUp"===e.key?(e.preventDefault(),eN(e=>Math.max(e-1,0))):"Enter"===e.key&&e5.length>0&&(e.preventDefault(),e2(e5[ek]))},[e5,ek,e2]);return a?(0,r.jsxs)("div",{className:"h-screen flex flex-col items-center justify-center bg-white",children:[(0,r.jsxs)("div",{className:"relative mb-6",children:[(0,r.jsx)("div",{className:"w-12 h-12 border-2 border-zinc-200 border-t-emerald-500 rounded-full animate-spin"}),(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,r.jsx)("div",{className:"w-2 h-2 rounded-full bg-emerald-500"})})]}),(0,r.jsx)("p",{className:"text-sm text-zinc-500 animate-pulse-soft",children:"Loading beads graph..."}),(0,r.jsx)("p",{className:"text-xs text-zinc-400 mt-1",children:"Parsing issues and dependencies"})]}):c?(0,r.jsx)("div",{className:"h-screen flex items-center justify-center bg-white",children:(0,r.jsxs)("div",{className:"max-w-sm text-center",children:[(0,r.jsx)("div",{className:"w-14 h-14 mx-auto mb-4 bg-red-50 rounded-full flex items-center justify-center",children:(0,r.jsx)("svg",{className:"w-7 h-7 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,r.jsx)("h2",{className:"text-lg font-semibold text-zinc-900 mb-1",children:"Unable to load data"}),(0,r.jsx)("p",{className:"text-sm text-zinc-500 mb-4",children:c}),(0,r.jsxs)("button",{onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2 px-4 py-2 bg-emerald-600 text-white text-sm rounded-lg hover:bg-emerald-700 transition-colors",children:[(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Try Again"]})]})}):i?(0,r.jsxs)("div",{className:"h-screen flex flex-col overflow-hidden bg-white",children:[(0,r.jsx)("header",{className:"sticky top-0 z-50 shrink-0 bg-white/95 backdrop-blur-sm border-b border-zinc-200/80",children:(0,r.jsxs)("div",{className:"px-6 h-14 flex items-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 shrink-0 group",children:[(0,r.jsx)(Y,{className:"w-8 h-8 text-emerald-500 transition-transform group-hover:scale-105"}),(0,r.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,r.jsx)("h1",{className:"text-[15px] font-semibold text-zinc-900 tracking-tight",children:b}),(0,r.jsx)("span",{className:"font-normal text-zinc-400 text-[15px] hidden sm:inline",children:"heartbeads"}),j>1&&(0,r.jsxs)("span",{className:"text-[10px] text-zinc-400 bg-zinc-100 rounded-full px-1.5 py-0.5 font-medium hidden sm:inline",children:[j," repos"]})]})]}),(0,r.jsx)("div",{className:"flex-1 flex justify-center px-4",children:(0,r.jsx)("div",{className:"relative w-full max-w-md",children:eb?(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsxs)("div",{className:"flex items-center bg-white rounded-full border border-zinc-200 shadow-sm overflow-hidden",children:[(0,r.jsx)("div",{className:"pl-3 pr-1 text-zinc-400",children:(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,r.jsx)("input",{ref:eW,type:"text",value:ej,onChange:e=>ew(e.target.value),onKeyDown:e4,placeholder:"Search issues...",className:"flex-1 px-2 py-1.5 text-xs text-zinc-800 bg-transparent outline-none placeholder:text-zinc-400",autoFocus:!0}),(0,r.jsx)("button",{onClick:()=>{ey(!1),ew(""),eN(0)},className:"px-2 py-1.5 text-zinc-400 hover:text-zinc-600",children:(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),ej.trim()&&(0,r.jsxs)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-white rounded-xl border border-zinc-100 shadow-xl overflow-hidden max-h-72 overflow-y-auto z-50",children:[0===e5.length?(0,r.jsx)("div",{className:"px-3 py-3 text-xs text-zinc-400 text-center",children:"No matching issues"}):e5.map((e,t)=>(0,r.jsxs)("button",{onClick:()=>e2(e),onMouseEnter:()=>eN(t),className:"w-full text-left px-3 py-2 text-xs transition-colors flex items-start gap-2.5 ".concat(t===ek?"bg-emerald-50":"hover:bg-zinc-50"),children:[(0,r.jsx)("div",{className:"shrink-0 mt-1",children:(0,r.jsx)("div",{className:"w-2 h-2 rounded-full ".concat(ep[e.status]||"bg-zinc-400")})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"font-medium text-zinc-600 shrink-0",children:e.id}),e.priority<=1&&(0,r.jsx)("span",{className:"text-[10px]",children:0===e.priority?"\uD83D\uDD25\uD83D\uDD25":"\uD83D\uDD25"})]}),(0,r.jsx)("div",{className:"text-zinc-400 truncate mt-0.5",children:e.title})]}),(0,r.jsx)("span",{className:"shrink-0 text-[10px] text-zinc-400 bg-zinc-100 rounded px-1 py-0.5 mt-0.5",children:e.prefix})]},e.id)),e5.length>0&&(0,r.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-zinc-400 border-t border-zinc-100 bg-zinc-50/50 flex items-center justify-between",children:[(0,r.jsxs)("span",{children:[e5.length," result",1!==e5.length?"s":""]}),(0,r.jsxs)("span",{children:[(0,r.jsx)("kbd",{className:"px-1 py-0.5 bg-white rounded border border-zinc-200 text-[9px] font-mono",children:"Enter"})," ","to focus"]})]})]})]}):(0,r.jsxs)("button",{onClick:()=>{ey(!0),setTimeout(()=>{var e;return null===(e=eW.current)||void 0===e?void 0:e.focus()},50)},className:"w-full flex items-center gap-2 px-3.5 py-1.5 text-sm text-zinc-400 rounded-full bg-zinc-50/80 border border-zinc-200/60 hover:text-zinc-500 hover:border-zinc-300 hover:bg-zinc-100/50 transition-all",title:"Search issues (Ctrl+F)",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,r.jsx)("span",{className:"flex-1 text-left",children:"Search issues..."}),(0,r.jsxs)("kbd",{className:"hidden sm:inline-block px-1 py-0.5 bg-zinc-100 rounded border border-zinc-200 text-[9px] font-mono text-zinc-400",children:["undefined"!=typeof navigator&&(null===(e=navigator.platform)||void 0===e?void 0:e.includes("Mac"))?"⌘":"Ctrl","F"]})]})})}),(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-1 shrink-0",children:[(0,r.jsxs)("button",{onClick:eR,className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ".concat(ez?"text-emerald-700 bg-emerald-50":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50"),children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,r.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Replay"})]}),(0,r.jsxs)("button",{onClick:()=>{O(e=>!e),_||(h(null),G(!1))},className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ".concat(_?"text-emerald-700 bg-emerald-50":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50"),children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 011.037-.443 48.282 48.282 0 005.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Comments"})]}),(0,r.jsxs)("button",{onClick:()=>{G(e=>!e),$||(h(null),O(!1))},className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ".concat($?"text-emerald-700 bg-emerald-50":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50"),children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,r.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Activity"})]}),(0,r.jsx)("div",{className:"w-px h-5 bg-zinc-200 mx-2"}),(0,r.jsx)(H,{})]})]})}),(0,r.jsxs)("div",{className:"flex-1 flex overflow-hidden relative",children:[(0,r.jsxs)("div",{className:"flex-1 relative bg-zinc-50/50",children:[(0,r.jsx)("div",{className:"absolute inset-0 opacity-[0.03]",style:{backgroundImage:"radial-gradient(circle, #000 1px, transparent 1px)",backgroundSize:"24px 24px"}}),(0,r.jsx)(S,{ref:eB,nodes:ez&&eI?eI.graphData.nodes:i.graphData.nodes,links:ez&&eI?eI.graphData.links:i.graphData.links,selectedNode:x,hoveredNode:p,onNodeClick:e_,onNodeHover:eO,onBackgroundClick:eq,onNodeRightClick:eX,commentedNodeIds:D,claimedNodeAvatars:R,onAvatarHover:ef,timelineActive:ez,stats:i.stats,sidebarOpen:!!x||_||$,collapsedEpicIds:g,onCollapseAll:eY,onExpandAll:eV}),ez&&eF&&eF.events.length>0&&(0,r.jsx)("div",{className:"absolute bottom-4 z-10 transition-[right] duration-300 ease-out",style:{right:x||_||$?"calc(360px + 1rem)":"1rem"},children:(0,r.jsx)(eh,{totalSteps:eF.events.length,currentStep:Math.max(eM,0),currentTime:eM>=0&&null!==(n=null===(t=eF.events[eM])||void 0===t?void 0:t.time)&&void 0!==n?n:eF.minTime,isPlaying:eD,speed:eT,onStepChange:eS,onPlayPause:()=>eL(e=>!e),onSpeedChange:eA})}),!x&&!_&&!$&&!ez&&(0,r.jsx)("div",{className:"absolute top-3 right-3 sm:top-4 sm:right-4 z-10",children:(0,r.jsx)(ei,{events:X,collapsed:Q,onToggleCollapse:()=>ee(e=>!e),onExpandPanel:()=>{G(!0),h(null),O(!1)},onNodeClick:e=>{let t=null==i?void 0:i.graphData.nodes.find(t=>t.id===e);t&&e2(t)}})}),et&&(0,r.jsx)(q,{node:et.node,x:et.x,y:et.y,onShowDescription:()=>{ec(et.node),en(null)},onAddComment:()=>{es({node:et.node,x:et.x,y:et.y}),en(null)},onClaimTask:z&&!R.has(et.node.id)?()=>{eZ(et.node.id),en(null)}:void 0,onUnclaimTask:(()=>{if(!z)return;let e=R.get(et.node.id);if(e&&(e.did===(null==C?void 0:C.did)||!e.did))return()=>{eJ(et.node.id),en(null)}})(),onCollapseEpic:"epic"!==et.node.issueType||g.has(et.node.id)?void 0:()=>{eU(et.node.id),en(null)},onUncollapseEpic:"epic"===et.node.issueType&&g.has(et.node.id)?()=>{eU(et.node.id),en(null)}:void 0,onClose:()=>en(null)}),er&&(0,r.jsx)(V,{node:er.node,x:er.x,y:er.y,onClose:()=>es(null),onSubmit:async e=>{await eK(er.node.id,e),es(null)},isAuthenticated:z,existingComments:M.get(er.node.id)}),ea&&(0,r.jsx)(I,{node:ea,onClose:()=>ec(null)}),eg&&!ed&&(0,r.jsx)(K,{node:eg.node,x:eg.x,y:eg.y,prefixColor:d(eg.node.prefix),allNodes:ez&&eI?eI.graphData.nodes:i.graphData.nodes}),ed&&(0,r.jsx)("div",{style:{position:"fixed",left:ed.x+12,top:ed.y-8,zIndex:90,pointerEvents:"none"},children:(0,r.jsxs)("div",{className:"flex items-center gap-2 bg-white border border-zinc-200 rounded-lg shadow-lg px-2.5 py-2",children:[ed.avatar?(0,r.jsx)("img",{src:ed.avatar,alt:"",className:"w-6 h-6 rounded-full shrink-0"}):(0,r.jsx)("div",{className:"w-6 h-6 rounded-full bg-zinc-200 flex items-center justify-center text-[10px] font-medium text-zinc-500 shrink-0",children:ed.handle.charAt(0).toUpperCase()}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsxs)("span",{className:"text-xs text-zinc-700 whitespace-nowrap",children:[ed.did?(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(ed.did),target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-zinc-800 hover:text-emerald-600 transition-colors",style:{pointerEvents:"auto"},children:ed.handle}):(0,r.jsx)("span",{className:"font-semibold text-zinc-800",children:ed.handle})," claimed this task"]}),(0,r.jsx)("span",{className:"text-[10px] text-zinc-400",children:B(ed.claimedAt)})]})]})})]}),(0,r.jsxs)("aside",{className:"hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white border-l border-zinc-200 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ".concat(x?"translate-x-0":"translate-x-full"),children:[(0,r.jsxs)("div",{className:"shrink-0 px-5 py-3 border-b border-zinc-100 flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"Node Detail"}),(0,r.jsx)("button",{onClick:()=>{h(null)},className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors rounded-full hover:bg-zinc-100",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-5 py-4 space-y-5",children:(0,r.jsx)(W,{node:x,allNodes:i.graphData.nodes,onNodeNavigate:e0,comments:x?M.get(x.id):void 0,onPostComment:x?e=>eK(x.id,e):void 0,onDeleteComment:e$,onLikeComment:eG,onReplyComment:eQ,isAuthenticated:z,currentDid:null==C?void 0:C.did,repoUrls:k})})]}),(0,r.jsx)("div",{className:"md:hidden fixed inset-x-0 bottom-0 z-20 transform transition-transform duration-300 ease-out ".concat(x?"translate-y-0":"translate-y-full"),children:(0,r.jsxs)("div",{className:"bg-white rounded-t-2xl border-t border-zinc-200 shadow-lg max-h-[60vh] flex flex-col",children:[(0,r.jsxs)("div",{className:"shrink-0 flex items-center justify-between px-4 pt-3 pb-2",children:[(0,r.jsx)("div",{className:"w-8 h-1 bg-zinc-300 rounded-full mx-auto"}),(0,r.jsx)("button",{onClick:()=>h(null),className:"absolute right-3 top-3 p-1 text-zinc-400 hover:text-zinc-600",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-4 pb-6 space-y-4",children:(0,r.jsx)(W,{node:x,allNodes:i.graphData.nodes,onNodeNavigate:e0,comments:x?M.get(x.id):void 0,onPostComment:x?e=>eK(x.id,e):void 0,onDeleteComment:e$,onLikeComment:eG,onReplyComment:eQ,isAuthenticated:z,currentDid:null==C?void 0:C.did,repoUrls:k})})]})}),(0,r.jsx)(J,{isOpen:_,onClose:()=>O(!1),allComments:L,onNodeNavigate:e=>{e0(e),O(!1)},isAuthenticated:z,currentDid:null==C?void 0:C.did,onLikeComment:eG,onDeleteComment:e$}),(0,r.jsx)(eo,{events:X,isOpen:$,onClose:()=>G(!1),onNodeClick:e=>{let t=null==i?void 0:i.graphData.nodes.find(t=>t.id===e);t&&(e2(t),G(!1))}})]})]}):null}},7796:function(e,t,n){"use strict";n.d(t,{AuthProvider:function(){return l},a:function(){return a}});var r=n(3890),s=n(8496);let i=(0,s.createContext)(null);function l(e){let{children:t}=e,[n,l]=(0,s.useState)({status:"idle",session:null,error:null,isLoading:!0});(0,s.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/status");if(t.ok){let n=await t.json();if(n.did&&!e){l({status:"authenticated",session:{did:n.did,handle:n.handle||n.did,displayName:n.displayName,avatar:n.avatar},error:null,isLoading:!1});return}}}catch(e){console.error("Failed to check auth status:",e)}e||l(e=>({...e,isLoading:!1}))})(),()=>{e=!0}},[]);let a=(0,s.useCallback)(async e=>{l(e=>({...e,status:"authorizing",isLoading:!0,error:null}));try{let t=e.includes(".")?e:"".concat(e,".bsky.social"),n=await fetch("/api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({handle:t,returnTo:window.location.pathname+window.location.search})});if(!n.ok){let e=await n.json();throw Error(e.error||"Login failed")}let r=await n.json();window.location.href=r.redirectUrl}catch(t){let e=t instanceof Error?t:Error("Login failed");throw l({status:"error",session:null,error:e,isLoading:!1}),e}},[]),o=(0,s.useCallback)(async()=>{try{await fetch("/api/logout",{method:"POST"})}catch(e){console.error("Logout request failed:",e)}l({status:"idle",session:null,error:null,isLoading:!1})},[]);return(0,r.jsx)(i.Provider,{value:{state:n,login:a,logout:o},children:t})}function a(){let e=(0,s.useContext)(i);if(!e)throw Error("useAuth must be used within an AuthProvider");let{state:t,login:n,logout:r}=e;return{status:t.status,session:t.session,error:t.error,isLoading:t.isLoading,isAuthenticated:"authenticated"===t.status,login:n,logout:r}}}},function(e){e.O(0,[971,649,945,744],function(){return e(e.s=6284)}),_N_E=e.O()}]);
@@ -0,0 +1,3 @@
1
+ *,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*
2
+ ! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com
3
+ */*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:JetBrains Mono,Fira Code,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}body,html{height:100%;overflow:hidden}body{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1));--tw-text-opacity:1;color:rgb(39 39 42/var(--tw-text-opacity,1));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"rlig" 1,"calt" 1}.\!container{width:100%!important}.container{width:100%}@media (min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.status-badge{display:inline-flex;align-items:center;border-radius:9999px;padding:.125rem .5rem;font-size:.75rem;line-height:1rem;font-weight:500}.custom-scrollbar::-webkit-scrollbar{width:4px}.custom-scrollbar::-webkit-scrollbar-track{background-color:transparent}.custom-scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.custom-scrollbar::-webkit-scrollbar-thumb:hover{--tw-bg-opacity:1;background-color:rgb(212 212 216/var(--tw-bg-opacity,1))}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.bottom-0{bottom:0}.bottom-2{bottom:.5rem}.bottom-4{bottom:1rem}.left-0{left:0}.left-2{left:.5rem}.left-3{left:.75rem}.left-4{left:1rem}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.top-0{top:0}.top-2{top:.5rem}.top-3{top:.75rem}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[1\]{z-index:1}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.-mr-0\.5{margin-right:-.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-1\.5{margin-right:.375rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-5{margin-top:1.25rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-40{max-height:10rem}.max-h-72{max-height:18rem}.max-h-\[260px\]{max-height:260px}.max-h-\[60vh\]{max-height:60vh}.max-h-\[80vh\]{max-height:80vh}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-44{width:11rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-\[360px\]{width:360px}.w-\[90vw\]{width:90vw}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0}.min-w-\[18px\]{min-width:18px}.min-w-\[280px\]{min-width:280px}.max-w-2xl{max-width:42rem}.max-w-\[100px\]{max-width:100px}.max-w-\[140px\]{max-width:140px}.max-w-\[480px\]{max-width:480px}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.translate-x-0{--tw-translate-x:0px}.translate-x-0,.translate-x-full{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x:100%}.translate-y-0{--tw-translate-y:0px}.translate-y-0,.translate-y-full{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y:100%}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-crosshair{cursor:crosshair}.cursor-e-resize{cursor:e-resize}.cursor-n-resize{cursor:n-resize}.cursor-ne-resize{cursor:ne-resize}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-1{row-gap:.25rem}.gap-y-1\.5{row-gap:.375rem}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-zinc-50>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(250 250 250/var(--tw-divide-opacity,1))}.self-stretch{align-self:stretch}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-t-lg{border-top-left-radius:.5rem}.rounded-t-lg,.rounded-tr-lg{border-top-right-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-emerald-200{--tw-border-opacity:1;border-color:rgb(167 243 208/var(--tw-border-opacity,1))}.border-transparent{border-color:transparent}.border-zinc-100{--tw-border-opacity:1;border-color:rgb(244 244 245/var(--tw-border-opacity,1))}.border-zinc-100\/60{border-color:hsla(240,5%,96%,.6)}.border-zinc-100\/80{border-color:hsla(240,5%,96%,.8)}.border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.border-zinc-200\/60{border-color:hsla(240,6%,90%,.6)}.border-zinc-200\/80{border-color:hsla(240,6%,90%,.8)}.border-zinc-50{--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.border-t-emerald-500{--tw-border-opacity:1;border-top-color:rgb(16 185 129/var(--tw-border-opacity,1))}.border-t-zinc-400{--tw-border-opacity:1;border-top-color:rgb(161 161 170/var(--tw-border-opacity,1))}.bg-amber-400{--tw-bg-opacity:1;background-color:rgb(251 191 36/var(--tw-bg-opacity,1))}.bg-amber-500{--tw-bg-opacity:1;background-color:rgb(245 158 11/var(--tw-bg-opacity,1))}.bg-black\/20{background-color:rgba(0,0,0,.2)}.bg-black\/40{background-color:rgba(0,0,0,.4)}.bg-blue-400{--tw-bg-opacity:1;background-color:rgb(96 165 250/var(--tw-bg-opacity,1))}.bg-emerald-100{--tw-bg-opacity:1;background-color:rgb(209 250 229/var(--tw-bg-opacity,1))}.bg-emerald-400{--tw-bg-opacity:1;background-color:rgb(52 211 153/var(--tw-bg-opacity,1))}.bg-emerald-50{--tw-bg-opacity:1;background-color:rgb(236 253 245/var(--tw-bg-opacity,1))}.bg-emerald-50\/30{background-color:rgba(236,253,245,.3)}.bg-emerald-500{--tw-bg-opacity:1;background-color:rgb(16 185 129/var(--tw-bg-opacity,1))}.bg-emerald-600{--tw-bg-opacity:1;background-color:rgb(5 150 105/var(--tw-bg-opacity,1))}.bg-red-300{--tw-bg-opacity:1;background-color:rgb(252 165 165/var(--tw-bg-opacity,1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.bg-rose-300{--tw-bg-opacity:1;background-color:rgb(253 164 175/var(--tw-bg-opacity,1))}.bg-transparent{background-color:transparent}.bg-violet-500{--tw-bg-opacity:1;background-color:rgb(139 92 246/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-white\/90{background-color:hsla(0,0%,100%,.9)}.bg-white\/95{background-color:hsla(0,0%,100%,.95)}.bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.bg-zinc-300{--tw-bg-opacity:1;background-color:rgb(212 212 216/var(--tw-bg-opacity,1))}.bg-zinc-400{--tw-bg-opacity:1;background-color:rgb(161 161 170/var(--tw-bg-opacity,1))}.bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.bg-zinc-50\/30{background-color:hsla(0,0%,98%,.3)}.bg-zinc-50\/50{background-color:hsla(0,0%,98%,.5)}.bg-zinc-50\/80{background-color:hsla(0,0%,98%,.8)}.bg-zinc-50\/95{background-color:hsla(0,0%,98%,.95)}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:.25rem}.p-3{padding:.75rem}.p-6{padding:1.5rem}.p-\[18px_20px\]{padding:18px 20px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-6{padding-bottom:1.5rem}.pl-3{padding-left:.75rem}.pr-1{padding-right:.25rem}.pr-3{padding-right:.75rem}.pt-3{padding-top:.75rem}.pt-\[20vh\]{padding-top:20vh}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,Fira Code,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[15px\]{font-size:15px}.text-\[7px\]{font-size:7px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.text-amber-500{--tw-text-opacity:1;color:rgb(245 158 11/var(--tw-text-opacity,1))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.text-emerald-500{--tw-text-opacity:1;color:rgb(16 185 129/var(--tw-text-opacity,1))}.text-emerald-600{--tw-text-opacity:1;color:rgb(5 150 105/var(--tw-text-opacity,1))}.text-emerald-700{--tw-text-opacity:1;color:rgb(4 120 87/var(--tw-text-opacity,1))}.text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-rose-400{--tw-text-opacity:1;color:rgb(251 113 133/var(--tw-text-opacity,1))}.text-rose-500{--tw-text-opacity:1;color:rgb(244 63 94/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.text-zinc-600{--tw-text-opacity:1;color:rgb(82 82 91/var(--tw-text-opacity,1))}.text-zinc-700{--tw-text-opacity:1;color:rgb(63 63 70/var(--tw-text-opacity,1))}.text-zinc-800{--tw-text-opacity:1;color:rgb(39 39 42/var(--tw-text-opacity,1))}.text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.placeholder-zinc-400::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.placeholder-zinc-400::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.opacity-\[0\.03\]{opacity:.03}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-2xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-lg,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring,.ring-1{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-zinc-100{--tw-ring-opacity:1;--tw-ring-color:rgb(244 244 245/var(--tw-ring-opacity,1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[right\]{transition-property:right;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes fadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.animate-fade-in{animation:fadeIn .3s ease-out forwards}@keyframes pulseSoft{0%,to{opacity:1}50%{opacity:.6}}.animate-pulse-soft{animation:pulseSoft 2s ease-in-out infinite}@keyframes beadTooltipFade{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.description-markdown h1,.description-markdown h2,.description-markdown h3,.description-markdown h4{margin-top:.5rem;margin-bottom:.25rem;font-weight:600;--tw-text-opacity:1;color:rgb(63 63 70/var(--tw-text-opacity,1))}.description-markdown h1{font-size:.85rem}.description-markdown h2{font-size:.8rem}.description-markdown h3{font-size:.75rem}.description-markdown h4{font-size:.7rem}.description-markdown p{margin-bottom:.375rem}.description-markdown p:last-child{margin-bottom:0}.description-markdown ol,.description-markdown ul{margin-bottom:.375rem}.description-markdown ol>:not([hidden])~:not([hidden]),.description-markdown ul>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.description-markdown ol,.description-markdown ul{padding-left:1rem}.description-markdown ul{list-style-type:disc}.description-markdown ol{list-style-type:decimal}.description-markdown code{border-radius:.25rem;background-color:hsla(240,6%,90%,.6);padding:.125rem .25rem;font-family:JetBrains Mono,Fira Code,monospace;font-size:10px;--tw-text-opacity:1;color:rgb(63 63 70/var(--tw-text-opacity,1))}.description-markdown pre{margin-bottom:.375rem;overflow-x:auto;border-radius:.375rem;background-color:hsla(240,6%,90%,.6);padding:.5rem}.description-markdown pre code{background-color:transparent;padding:0;font-size:10px}.description-markdown a{--tw-text-opacity:1;color:rgb(5 150 105/var(--tw-text-opacity,1));text-decoration-line:underline;text-underline-offset:2px}.description-markdown a:hover{--tw-text-opacity:1;color:rgb(4 120 87/var(--tw-text-opacity,1))}.description-markdown blockquote{margin-top:.375rem;margin-bottom:.375rem;border-left-width:2px;--tw-border-opacity:1;border-color:rgb(212 212 216/var(--tw-border-opacity,1));padding-left:.5rem;font-style:italic;--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.description-markdown table{margin-bottom:.375rem;width:100%;border-collapse:collapse;font-size:10px}.description-markdown th{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1));padding-bottom:.125rem;padding-right:.5rem;text-align:left;font-weight:600;--tw-text-opacity:1;color:rgb(82 82 91/var(--tw-text-opacity,1))}.description-markdown td{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(244 244 245/var(--tw-border-opacity,1));padding-top:.125rem;padding-bottom:.125rem;padding-right:.5rem}.description-markdown hr{margin-top:.5rem;margin-bottom:.5rem;--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.description-markdown strong{font-weight:600;--tw-text-opacity:1;color:rgb(63 63 70/var(--tw-text-opacity,1))}.description-markdown img{max-width:100%;border-radius:.25rem}.timeline-slider{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;cursor:pointer}.timeline-slider::-webkit-slider-runnable-track{height:4px;background:#e4e4e7;border-radius:2px}.timeline-slider::-webkit-slider-thumb{-webkit-appearance:none;width:12px;height:12px;background:#10b981;border-radius:50%;margin-top:-4px;cursor:pointer;-webkit-transition:transform .1s ease;transition:transform .1s ease}.timeline-slider::-webkit-slider-thumb:hover{transform:scale(1.2)}.timeline-slider::-moz-range-track{height:4px;background:#e4e4e7;border-radius:2px;border:none}.timeline-slider::-moz-range-thumb{width:12px;height:12px;background:#10b981;border-radius:50%;border:none;cursor:pointer}.force-graph-container canvas{border-radius:.5rem;touch-action:none}.placeholder\:text-zinc-300::-moz-placeholder{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.placeholder\:text-zinc-300::placeholder{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.placeholder\:text-zinc-400::-moz-placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.placeholder\:text-zinc-400::placeholder{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.hover\:border-zinc-200:hover{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.hover\:border-zinc-300:hover{--tw-border-opacity:1;border-color:rgb(212 212 216/var(--tw-border-opacity,1))}.hover\:bg-emerald-100:hover{--tw-bg-opacity:1;background-color:rgb(209 250 229/var(--tw-bg-opacity,1))}.hover\:bg-emerald-600:hover{--tw-bg-opacity:1;background-color:rgb(5 150 105/var(--tw-bg-opacity,1))}.hover\:bg-emerald-700:hover{--tw-bg-opacity:1;background-color:rgb(4 120 87/var(--tw-bg-opacity,1))}.hover\:bg-red-50:hover{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.hover\:bg-white:hover{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.hover\:bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\:bg-zinc-100\/50:hover{background-color:hsla(240,5%,96%,.5)}.hover\:bg-zinc-300\/40:hover{background-color:hsla(240,5%,84%,.4)}.hover\:bg-zinc-50:hover{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.hover\:bg-zinc-50\/50:hover{background-color:hsla(0,0%,98%,.5)}.hover\:bg-zinc-50\/60:hover{background-color:hsla(0,0%,98%,.6)}.hover\:text-emerald-600:hover{--tw-text-opacity:1;color:rgb(5 150 105/var(--tw-text-opacity,1))}.hover\:text-emerald-700:hover{--tw-text-opacity:1;color:rgb(4 120 87/var(--tw-text-opacity,1))}.hover\:text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\:text-rose-500:hover{--tw-text-opacity:1;color:rgb(244 63 94/var(--tw-text-opacity,1))}.hover\:text-zinc-500:hover{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\:text-zinc-600:hover{--tw-text-opacity:1;color:rgb(82 82 91/var(--tw-text-opacity,1))}.hover\:text-zinc-700:hover{--tw-text-opacity:1;color:rgb(63 63 70/var(--tw-text-opacity,1))}.hover\:text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\:border-emerald-400:focus{--tw-border-opacity:1;border-color:rgb(52 211 153/var(--tw-border-opacity,1))}.focus\:border-emerald-500:focus{--tw-border-opacity:1;border-color:rgb(16 185 129/var(--tw-border-opacity,1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-1:focus,.focus\:ring-2:focus{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring-emerald-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(16 185 129/var(--tw-ring-opacity,1))}.focus\:ring-emerald-500\/30:focus{--tw-ring-color:rgba(16,185,129,.3)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:scale-105{--tw-scale-x:1.05;--tw-scale-y:1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:text-emerald-500{--tw-text-opacity:1;color:rgb(16 185 129/var(--tw-text-opacity,1))}.group:hover .group-hover\:text-emerald-700{--tw-text-opacity:1;color:rgb(4 120 87/var(--tw-text-opacity,1))}.group:hover .group-hover\:text-zinc-700{--tw-text-opacity:1;color:rgb(63 63 70/var(--tw-text-opacity,1))}.group:hover .group-hover\:opacity-100{opacity:1}@media (min-width:640px){.sm\:left-4{left:1rem}.sm\:right-4{right:1rem}.sm\:top-4{top:1rem}.sm\:block{display:block}.sm\:inline-block{display:inline-block}.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:gap-2{gap:.5rem}}@media (min-width:768px){.md\:flex{display:flex}.md\:hidden{display:none}}
package/README.md CHANGED
@@ -12,12 +12,18 @@ See your entire project's issues, epics, and dependencies as a live, explorable
12
12
 
13
13
  ### Graph Visualization
14
14
 
15
- - **Force-directed & DAG layouts** -- Switch between organic force simulation and clean top-down directed acyclic graph views. Force mode uses collision avoidance and variable link distances; DAG mode uses topological layering.
16
- - **Epics collapse** -- Toggle between full task view and collapsed epic view that rolls child tasks into their parent nodes. Shows collapsed task count on each epic.
15
+ - **5 graph layouts** -- Switch between layout modes via the toolbar:
16
+ - **Force** -- Organic force simulation with collision avoidance and variable link distances
17
+ - **DAG** -- Clean top-down directed acyclic graph with topological layering
18
+ - **Radial** -- Concentric rings by dependency depth. Root nodes (no blockers) sit at center, deeper dependencies on outer rings. Ring spacing scales with node count.
19
+ - **Cluster** -- Groups nodes spatially by project prefix. Each prefix gets its own cluster center arranged in a circle. Cross-project dependencies stretch visibly between clusters.
20
+ - **Spread** -- Like Force but maximally spaced for readability and screenshots. Stronger repulsion, wider link distances.
21
+ - **Collapse / Expand** -- Collapse all epics at once with a single button, or right-click individual epics to collapse/uncollapse them. Shows collapsed task count on each epic node.
17
22
  - **Visual encoding** -- Node size = dependency importance (connection count), fill color = status, ring color = project prefix. Larger nodes are more connected; epics get a size boost.
18
23
  - **Dependency arrows** -- Solid emerald arrows with flow particles for blocking relationships, dashed zinc lines for parent-child hierarchy. Curved links with configurable curvature.
19
24
  - **Semantic zoom** -- When zooming out, individual nodes smoothly fade and are replaced by epic cluster labels at each cluster's centroid. Clusters show the epic title, ID, and member count, surrounded by a dashed circle in the project's prefix color.
20
25
  - **Spawn & exit animations** -- New nodes pop in with an overshoot easing (easeOutBack), removed nodes shrink out, and status changes trigger a ripple animation. New links flash bright emerald on arrival.
26
+ - **Hover tooltips** -- Hover over any node to see a tooltip card with the issue title, creation date, blocker list, priority, owner, and assignee. Smart viewport clamping (prefers above cursor, flips below).
21
27
  - **Resizable minimap** -- Always-visible minimap (bottom-left) showing all nodes, links, claimed avatars, and the current viewport rectangle. Click to navigate. Drag the top, right, or top-right corner handles to resize (100-500px wide, 80-400px tall).
22
28
 
23
29
  ### Live Updates
@@ -34,7 +40,7 @@ See your entire project's issues, epics, and dependencies as a live, explorable
34
40
 
35
41
  ### Search
36
42
 
37
- - **Smart search** -- `Cmd/Ctrl+F` to fuzzy search across all issues by ID, title, or project prefix. Keyboard navigation through results.
43
+ - **Smart search** -- `Cmd/Ctrl+F` to fuzzy search across all issues by ID, title, project prefix, owner, assignee, or commenter username. Keyboard navigation through results.
38
44
 
39
45
  ### Right-Click Context Menu
40
46
 
@@ -43,6 +49,7 @@ See your entire project's issues, epics, and dependencies as a live, explorable
43
49
  - **Add comment** -- Opens the comment tooltip for posting
44
50
  - **Claim task** -- Posts a claim comment (`@handle`) to mark yourself as working on the issue (only shown when authenticated and node is unclaimed)
45
51
  - **Unclaim task** -- Removes your claim from the node (only shown when you are the claimant)
52
+ - **Collapse/Uncollapse epic** -- Toggle individual epic collapse on right-click (only shown on epic nodes)
46
53
 
47
54
  ### Task Claiming
48
55
 
@@ -193,6 +200,7 @@ beads-map/
193
200
  │ ├── AuthButton.tsx # Sign-in modal + avatar dropdown (rounded-full pill style)
194
201
  │ ├── BeadsGraph.tsx # Force graph: paintNode/paintLink, minimap, semantic zoom, avatars
195
202
  │ ├── BeadsLogo.tsx # Animated hexagonal network SVG logo
203
+ │ ├── BeadTooltip.tsx # Hover tooltip: title, date, blockers, priority, owner
196
204
  │ ├── CommentTooltip.tsx # Floating right-click comment tooltip
197
205
  │ ├── ContextMenu.tsx # Right-click context menu: description, comment, claim/unclaim
198
206
  │ ├── DescriptionModal.tsx # Full-screen markdown description modal (portaled to body)
@@ -251,7 +259,7 @@ beads-map/
251
259
 
252
260
  - [Next.js 14](https://nextjs.org/) (App Router)
253
261
  - [react-force-graph-2d](https://github.com/vasturiano/react-force-graph) for canvas-based graph rendering
254
- - [d3-force](https://github.com/d3/d3-force) (forceCollide for collision avoidance)
262
+ - [d3-force](https://github.com/d3/d3-force) (forceCollide, forceRadial, forceX, forceY for layout modes)
255
263
  - [Tailwind CSS](https://tailwindcss.com/) for styling
256
264
  - [TypeScript](https://www.typescriptlang.org/) throughout
257
265
  - [@atproto/oauth-client-node](https://github.com/bluesky-social/atproto) + [@atproto/api](https://github.com/bluesky-social/atproto) for ATProto authentication and record CRUD
@@ -4,6 +4,8 @@ import { readFileSync, existsSync } from "fs";
4
4
  import { join } from "path";
5
5
  import { parse as parseYaml } from "yaml";
6
6
 
7
+ export const dynamic = "force-dynamic";
8
+
7
9
  export async function GET() {
8
10
  try {
9
11
  const discovery = discoverBeadsDir();
package/app/globals.css CHANGED
@@ -77,6 +77,18 @@
77
77
  .animate-pulse-soft {
78
78
  animation: pulseSoft 2s ease-in-out infinite;
79
79
  }
80
+
81
+ /* Bead tooltip fade-in */
82
+ @keyframes beadTooltipFade {
83
+ from {
84
+ opacity: 0;
85
+ transform: translateY(4px);
86
+ }
87
+ to {
88
+ opacity: 1;
89
+ transform: translateY(0);
90
+ }
91
+ }
80
92
  }
81
93
 
82
94
  /* Markdown prose inside description box */