trybeacon 0.1.85 → 0.1.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +23 -23
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/@modal/(.)settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/docs.html +1 -1
- package/.next/server/app/docs.rsc +1 -1
- package/.next/server/app/docs.segments/@modal/__DEFAULT__.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_full.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_index.segment.rsc +1 -1
- package/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
- package/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/.next/server/app/help.html +1 -1
- package/.next/server/app/help.rsc +1 -1
- package/.next/server/app/help.segments/@modal/__DEFAULT__.segment.rsc +1 -1
- package/.next/server/app/help.segments/_full.segment.rsc +1 -1
- package/.next/server/app/help.segments/_head.segment.rsc +1 -1
- package/.next/server/app/help.segments/_index.segment.rsc +1 -1
- package/.next/server/app/help.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/help.segments/help.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +1 -1
- package/.next/server/app/index.segments/@modal/__DEFAULT__.segment.rsc +1 -1
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/learn/page.js +3 -3
- package/.next/server/app/learn/page.js.nft.json +1 -1
- package/.next/server/app/learn/page_client-reference-manifest.js +1 -1
- package/.next/server/app/map/page.js +1 -1
- package/.next/server/app/map/page.js.nft.json +1 -1
- package/.next/server/app/map/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/plan/page.js +2 -2
- package/.next/server/app/plan/page.js.nft.json +1 -1
- package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
- package/.next/server/app/s/[token]/page.js +1 -1
- package/.next/server/app/s/[token]/page.js.nft.json +1 -1
- package/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +23 -23
- package/.next/server/chunks/7335.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/985-430599029183e18e.js +1 -0
- package/.next/static/chunks/app/learn/{page-3096f42957c4ae90.js → page-18821c98beca638e.js} +1 -1
- package/.next/static/chunks/app/map/{page-218e74604688302f.js → page-278aa8f1b90828be.js} +1 -1
- package/.next/static/chunks/app/plan/{page-3e3468c908c25fef.js → page-6085ec2d97f9c678.js} +2 -2
- package/.next/static/chunks/app/s/[token]/{page-a169c295bbc1ff1f.js → page-a00e023f723224c1.js} +1 -1
- package/.next/trace +47 -47
- package/.next/trace-build +1 -1
- package/package.json +1 -1
- package/.next/server/chunks/4041.js +0 -1
- package/.next/static/chunks/6873-5fc2a181f6b5c281.js +0 -1
- /package/.next/static/{UPbwAwhqupoUDhpSL38bT → DJSoomboyiqKwEIQ7ktag}/_buildManifest.js +0 -0
- /package/.next/static/{UPbwAwhqupoUDhpSL38bT → DJSoomboyiqKwEIQ7ktag}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5823],{27950:(e,t,o)=>{Promise.resolve().then(o.bind(o,44853)),Promise.resolve().then(o.bind(o,62079)),Promise.resolve().then(o.bind(o,96873)),Promise.resolve().then(o.bind(o,77260))},62079:(e,t,o)=>{"use strict";o.d(t,{FilesMapClient:()=>V});var s=o(95155),n=o(12115),r=o(80277),l=o(81750),a=o(6266),i=o(7679),d=o(98766),c=o(15629),u=o(79176),p=o(2982),h=o(64385);o(53255);var f=o(17356),m=o(24413),x=o(18986),g=o(9005),b=o(25583),y=o(82099),j=o(62311),k=o(9991),w=o(47409),v=o(91157),N=o(56895),M=o(16607),S=o(14983);let C=/(^|\/)tests?\/|\.(test|spec)\.[jt]sx?$/i;var A=o(44267),$=o(70947),z=o(98238),E=o(56614),D=o(28161);let I=/\.(py|go|rb|rs|java|php|ex|exs)$/i,R=/(^|\/)(app\/api|pages\/api|migrations|bin)\/|(^|\/)instrumentation\.[^/]+$/,O=e=>e.includes("/")?e.slice(0,e.indexOf("/")):"(root)";function T(e){let t=Math.max(14,.35*e.length),o=new Map;for(let t of e)o.set(t,O(t));for(let e=0;e<6;e++){let e=new Map;for(let t of o.values())e.set(t,(e.get(t)??0)+1);let s=!1;for(let[n,r]of o){if((e.get(r)??0)<=t||!n.startsWith(`${r}/`))continue;let l=n.slice(r.length+1);l.includes("/")&&(o.set(n,`${r}/${l.slice(0,l.indexOf("/"))}`),s=!0)}if(!s)break}return o}var P=o(29523),Z=o(70221),F=o(12410),L=o(91337),_=o(2060);function W(e){return 5+.5*Math.min(e,26)}let B={file:(0,n.memo)(function({data:e}){let t=(0,P.k)(Z.kz),o=!!e.touched,n=e.recency??0,r=e.inDegree??0,i=W(r),d=e.layer??null,c=2*!!d,u=r>0?` \xb7 imported by ${r}`:"",p=d?` \xb7 ${"fullstack"===d?"shared (used by frontend + backend)":D.YG[d].label.toLowerCase()}`:"",h=o?`${e.tooltip} \xb7 edited ${e.count??0}\xd7 this session${u}${p}`:e.untested?`${e.tooltip} \xb7 no test imports this file${u}${p}`:`${e.tooltip}${u}${p}`;return(0,s.jsxs)("div",{title:h,className:"relative flex flex-col items-center",children:[(0,s.jsx)(l.h7,{type:"target",position:a.yX.Top,isConnectable:!1,className:"!h-0 !w-0 !min-w-0 !border-0 !bg-transparent",style:{top:i+c,left:"50%"}}),(0,s.jsx)("span",{"aria-hidden":!0,className:(0,L.cn)("rounded-full",e.isNewest&&"animate-touch-pulse"),style:{padding:c,background:d?(0,D.A6)(d):void 0,boxShadow:o?`0 0 ${8+Math.round(14*n)}px ${2+Math.round(3*n)}px rgba(45,212,191,${(.35+.45*n).toFixed(2)})`:e.untested?"0 0 0 2px rgba(251,191,36,0.65)":"none"},children:(0,s.jsx)("span",{"aria-hidden":!0,className:"block rounded-full",style:{width:2*i,height:2*i,backgroundColor:e.dirColor}})}),o&&(e.count??0)>0&&(0,s.jsx)("span",{"aria-hidden":!0,className:"absolute -right-2 -top-2 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-teal-400 px-0.5 text-[8px] font-bold text-background ring-1 ring-background",children:e.count}),("full"===t||"mid"===t&&r>=4)&&(0,s.jsx)("span",{className:(0,L.cn)("pointer-events-none mt-1 max-w-44 truncate text-[10px] leading-tight",o?"font-semibold text-teal-100":"text-foreground/75"),children:e.label}),(0,s.jsx)(l.h7,{type:"source",position:a.yX.Bottom,isConnectable:!1,className:"!h-0 !w-0 !min-w-0 !border-0 !bg-transparent",style:{top:i+c,bottom:"auto",left:"50%"}})]})})};function U({regions:e,dominant:t}){return(0,s.jsx)(l.DX,{children:e.map(e=>{let o=t.get(e.key);return o&&"fullstack"!==o?(0,s.jsx)("div",{style:{position:"absolute",transform:`translate(${e.x-.15*e.w}px, ${e.y-.15*e.h}px)`,width:1.3*e.w,height:1.3*e.h,pointerEvents:"none",zIndex:0,background:`radial-gradient(closest-side, ${D.ZD[o]} 0%, transparent 72%)`,opacity:.1}},e.key):null})})}function V({files:e,edges:t,touched:o,hasFrontend:a=!1,classificationRoots:O=[]}){let G,X=(0,n.useMemo)(()=>(function(e,t){let o=function(e){if(!e?.length)return[];let t=new Set;for(let o of e){let e=o.trim().replace(/^\/+|\/+$/g,"");e&&t.add(e)}return[...t]}(t);if(!o.length)return T(e);let s=new Map,n=[];for(let t of e){let e=function(e,t){let o=null;for(let s of t)(e===s||e.startsWith(`${s}/`))&&(!o||s.length>o.length)&&(o=s);return o}(t,o);e?s.set(t,function(e,t){if(e===t||!e.startsWith(`${t}/`))return t;let o=e.slice(t.length+1);return o.includes("/")?`${t}/${o.slice(0,o.indexOf("/"))}`:t}(t,e)):n.push(t)}for(let[e,t]of T(n))s.set(e,t);return s})(e.map(e=>e.path),O),[e,O]),q=(0,n.useMemo)(()=>(function(e,t,o){let s=function(e){let t=new Map;for(let o of e.values())t.set(o,(t.get(o)??0)+1);let o=Array.from(t.entries()).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])),s=Math.max(1,Math.ceil(Math.sqrt(2.5*o.length))),n=new Map;return o.forEach(([e],t)=>{n.set(e,{x:t%s*1250,y:950*Math.floor(t/s)})}),n}(o),n=e=>s.get(o.get(e)??"(root)"),r=e.map(e=>{let t=function(e){let t=0x811c9dc5;for(let o=0;o<e.length;o++)t=(t^e.charCodeAt(o))*0x1000193>>>0;return{x:(t%10007/10007-.5)*900,y:((t>>>13)%10007/10007-.5)*900}}(e.path),o=n(e.path);return{id:e.path,x:o.x+.5*t.x,y:o.y+.5*t.y,pinned:!1,radius:W(e.inDegree??0)+22}}),l=t.filter(e=>e.from!==e.to).map(e=>({source:e.from,target:e.to})),a=(0,i.A)(r).force("link",(0,d.A)(l).id(e=>e.id).distance(100).strength(e=>{let t="object"==typeof e.source?e.source.id:String(e.source),s="object"==typeof e.target?e.target.id:String(e.target);return o.get(t)===o.get(s)?.5:.02})).force("charge",(0,c.A)().strength(-260).distanceMax(800)).force("collide",(0,u.A)().radius(e=>e.radius).strength(.6)).force("clusterX",(0,p.A)(e=>n(e.id).x).strength(.1)).force("clusterY",(0,h.A)(e=>n(e.id).y).strength(.115)).stop();for(let e=0;e<500;e++)a.tick();let f=new Map;for(let e of r)f.set(e.id,{x:e.x??0,y:e.y??0});return f})(e,t,X),[e,t,X]),J=(0,n.useMemo)(()=>(function(e,t){var o;let s=new Set;for(let e of t)o=e.from,C.test(o)&&s.add(e.to);let n=new Set;for(let t of e)C.test(t)||s.has(t)||n.add(t);return n})(e.map(e=>e.path),t),[e,t]),K=(0,n.useMemo)(()=>a?function(e,t){let o=new Map,s=new Map;for(let e of t){let t=s.get(e.from);t?t.push(e.to):s.set(e.from,[e.to])}let n=new Map;for(let t of e){let e=R.test(t)?"backend":D.An.test(t)?"frontend":I.test(t)?"backend":null;o.set(t,e),e&&n.set(t,e)}let r=e=>{let t=new Set,o=[];for(let[t,s]of n)s===e&&o.push(t);for(;o.length;){let e=o.pop();for(let n of s.get(e)??[])t.has(n)||(t.add(n),o.push(n))}return t},l=r("frontend"),a=r("backend");for(let t of e){if(o.get(t))continue;let e=l.has(t),s=a.has(t);e&&s?o.set(t,"fullstack"):e?o.set(t,"frontend"):s&&o.set(t,"backend")}return o}(e.map(e=>e.path),t):null,[a,e,t]),Q=(0,n.useMemo)(()=>{let e=new Map,t=Object.entries(o??{});if(!t.length)return e;let s=t.map(([,e])=>e.lastAt),n=Math.max(...s),r=Math.min(...s),l=n-r||1,a=t[0][0],i=t[0][1].lastAt;for(let[e,o]of t)o.lastAt>=i&&(a=e,i=o.lastAt);for(let[o,s]of t)e.set(o,{count:s.count,recency:(s.lastAt-r)/l,isNewest:o===a});return e},[o]),Y=Q.size>0,ee=(0,n.useMemo)(()=>Array.from(Q.entries()).map(([e,t])=>({path:e,count:t.count})),[Q]),et=(0,n.useMemo)(()=>e.map(e=>{let t=q.get(e.path)??{x:e.x,y:e.y},o=e.path.lastIndexOf("/"),s=o>=0?e.path.slice(o+1):e.path,n=Q.get(e.path);return{id:e.path,type:"file",position:t,data:{label:s,tooltip:e.path,untested:J.has(e.path),inDegree:e.inDegree??0,dirColor:(0,F.i3)(X.get(e.path)??"(root)"),layer:K?.get(e.path)??null,touched:!!n,count:n?.count??0,recency:n?.recency??0,isNewest:n?.isNewest??!1}}}),[e,q,J,Q,K,X]),eo=(0,n.useMemo)(()=>t.map(e=>({id:`${e.from}|${e.to}`,source:e.from,target:e.to,type:"straight",selectable:!1,focusable:!1,style:{pointerEvents:"none",...e.circular?{stroke:"#f87171",strokeDasharray:"5 3",strokeWidth:1.5,opacity:.6}:{stroke:"#8b8b94",strokeWidth:1,opacity:.3}}})),[t]),[es,en]=(0,n.useState)(et),[er,el]=(0,n.useState)(eo),[ea,ei]=(0,n.useState)(null),[ed,ec]=(0,n.useState)(null),[eu,ep]=(0,n.useState)(null),[eh,ef]=(0,n.useState)(!1),em=(0,_.G)(),[ex,eg]=(0,n.useState)(!1),[eb,ey]=(0,n.useState)(null),[ej,ek]=(0,n.useState)(!1),[ew,ev]=(0,n.useState)(""),[eN,eM]=(0,n.useState)(!1),[eS,eC]=(0,n.useState)("full"),eA=(0,n.useRef)(null),{tool:e$,setTool:ez,flowProps:eE}=(0,r.e)(),eD=(0,n.useCallback)(e=>{ei(e),ep(null);let t=eA.current?.getNode(e);t&&eA.current&&eA.current.setCenter(t.position.x+40,t.position.y+12,{zoom:1.4,duration:600})},[]),eI=(0,n.useCallback)(()=>{ei(null),ep(null);let e=!ex;if(eg(e),ek(e),e&&eA.current){let e=Array.from(Q.keys()).map(e=>({id:e}));e.length&&eA.current.fitView({nodes:e,duration:600,padding:.4})}},[ex,Q]),eR=(0,n.useMemo)(()=>(0,v.b)(e,t,X),[e,t,X]),eO=(0,n.useCallback)(e=>{eA.current&&(e.focusIds.length?eA.current.fitView({nodes:e.focusIds.map(e=>({id:e})),duration:700,padding:.3,maxZoom:1.1}):eA.current.fitView({duration:700,padding:.1}))},[]),eT=(0,N.W)(eR,eO);(0,n.useEffect)(()=>eM(!0),[]),(0,n.useEffect)(()=>en(et),[et]),(0,n.useEffect)(()=>el(eo),[eo]);let eP=(0,n.useCallback)(e=>en(t=>(0,l._0)(e,t)),[]),eZ=(0,n.useCallback)(e=>el(t=>(0,l.zW)(e,t)),[]),eF=(0,n.useCallback)((e,t,o)=>{fetch("/api/code-graph/position",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,x:t,y:o})})},[]),eL=(0,n.useMemo)(()=>new Set(t.filter(e=>e.circular).map(e=>`${e.from}|${e.to}`)),[t]),e_=(0,n.useMemo)(()=>{let e=new Set;for(let o of t)o.circular&&(e.add(o.from),e.add(o.to));return e},[t]),eW=ea??ed,eB=ew.trim().length>0,eU=(0,n.useMemo)(()=>{if(!eB)return null;let t=new Set;for(let o of e)(0,S.Qk)((0,S.zn)(o),ew)&&t.add(o.path);return t},[e,ew,eB]),eV=(0,n.useMemo)(()=>eB?(0,S.r2)(e,ew,e=>(0,S.zn)(e),e=>({id:e.path,label:e.path,sublabel:e.lang??void 0,kind:"file"})):[],[e,ew,eB]),eH=(0,n.useMemo)(()=>{if(eu){let e=er.find(e=>e.id===eu);return e?new Set([e.source,e.target]):null}if(eW){let e=new Set([eW]);for(let o of t)o.from===eW&&e.add(o.to),o.to===eW&&e.add(o.from);return e}return eh?e_:ex&&Y?new Set(Q.keys()):null},[eW,eu,eh,e_,t,er,ex,Y,Q]),eG=eT.focusIds,eX=eG??eU??eH,eq=eU??eG,eJ=(0,n.useMemo)(()=>{if(!eb||!K)return null;let t=new Set;for(let o of e)(0,z.F)(eb,K.get(o.path)??null)||t.add(o.path);return t},[eb,K,e]),eK=(0,n.useMemo)(()=>eX?es.map(e=>{let t=eX.has(e.id);return{...e,zIndex:t&&eq?10:e.zIndex,style:{...e.style,opacity:t?1:.15,boxShadow:t&&eq?S.RU:e.style?.boxShadow,borderRadius:t&&eq?9999:e.style?.borderRadius,transition:"opacity 120ms, box-shadow 120ms"}}}):eJ?es.map(e=>eJ.has(e.id)?{...e,style:{...e.style,opacity:.15,transition:"opacity 120ms"}}:e):es,[es,eX,eq,eJ]),eQ=(0,n.useMemo)(()=>eG?er.map(e=>eG.has(e.source)&&eG.has(e.target)?{...e,style:{...e.style,stroke:"#e4e4e7",opacity:.9,strokeWidth:1.4}}:{...e,style:{...e.style,opacity:.05}}):eU?er.map(e=>eU.has(e.source)&&eU.has(e.target)?{...e,style:{...e.style,stroke:"#e4e4e7",opacity:.95,strokeWidth:1.6}}:{...e,style:{...e.style,opacity:.05}}):eW||eu||eh||ex?er.map(e=>{let t=!1;return eu?t=e.id===eu:eW?t=e.source===eW||e.target===eW:eh?t=eL.has(e.id):ex&&(t=Q.has(e.source)&&Q.has(e.target)),t?{...e,style:{...e.style,stroke:"#e4e4e7",opacity:.95,strokeWidth:1.6}}:{...e,style:{...e.style,opacity:.05}}}):eJ?er.map(e=>eJ.has(e.source)||eJ.has(e.target)?{...e,style:{...e.style,opacity:.05}}:e):er,[er,eW,eu,eh,eL,ex,Q,eU,eJ,eG]),eY=(0,n.useMemo)(()=>{let e=es.map(e=>{let t=W(e.data.inDegree??0);return{id:e.id,group:X.get(e.id)??"(root)",x:e.position.x,y:e.position.y,w:2*t,h:2*t}});return(0,A.S)(e,{pad:60})},[es,X]),e0=(0,n.useMemo)(()=>{let t=new Map;if(!K)return t;let o=new Map;for(let t of e){let e=K.get(t.path);if(!e)continue;let s=X.get(t.path)??"(root)",n=o.get(s)??new Map;n.set(e,(n.get(e)??0)+1),o.set(s,n)}for(let[e,s]of o){let o=null,n=0,r=!1;for(let[e,t]of s)t>n?(o=e,n=t,r=!1):t===n&&(r=!0);t.set(e,r?null:o)}return t},[K,e,X]),e1=(0,n.useMemo)(()=>{let e=new Map;for(let t of X.values())e.set(t,(e.get(t)??0)+1);return Array.from(e.entries()).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>({group:e,count:t,color:(0,F.i3)(e)}))},[X]),e5=t.filter(e=>e.circular).length,e2=(0,n.useMemo)(()=>ea?t.filter(e=>e.from===ea).map(e=>e.to):[],[ea,t]),e4=(0,n.useMemo)(()=>ea?t.filter(e=>e.to===ea).map(e=>e.from):[],[ea,t]),e7=null!==ea||ej&&Y,e3=(0,n.useCallback)(()=>{ei(null),ek(!1),eg(!1)},[]);return eN?(0,s.jsxs)("div",{className:"canvas-dots relative h-screen w-full",children:[(0,s.jsxs)(l.Gc,{...eE,nodes:eK,edges:eQ,nodeTypes:B,onNodesChange:eP,onEdgesChange:eZ,onNodeClick:(e,t)=>{ei(t.id),ep(null)},onEdgeClick:(e,t)=>{ep(t.id),ei(null)},onPaneClick:()=>{ei(null),ep(null)},onNodeMouseEnter:(e,t)=>ec(t.id),onNodeMouseLeave:()=>ec(null),onInit:e=>{eA.current=e},onNodeDragStop:(e,t)=>eF(t.id,t.position.x,t.position.y),deleteKeyCode:null,colorMode:em,fitView:!0,fitViewOptions:{padding:.1,minZoom:.18,maxZoom:.9},minZoom:.05,panOnScroll:!0,zoomActivationKeyCode:["Meta","Control"],proOptions:{hideAttribution:!0},children:[(0,s.jsx)($.Z,{regions:"far"===eS?eY:[],tone:"category",lod:eS}),a&&(0,s.jsx)(U,{regions:"far"===eS?[]:eY,dominant:e0}),(0,s.jsx)(P.J,{onLod:eC,thresholds:Z.kz}),(0,s.jsx)(l.H2,{position:"bottom-right",className:"!overflow-hidden !rounded-xl !border !border-border [&_button]:!border-border [&_button]:!bg-card/70 [&_button]:!text-foreground [&_button]:!backdrop-blur"}),(0,s.jsx)(l.Zk,{position:"bottom-left",style:{marginBottom:118},children:(0,s.jsx)(r.H,{tool:e$,onChange:ez})}),(0,s.jsx)(l.Zk,{position:"bottom-right",style:{marginBottom:152},children:(0,s.jsx)(E.er,{title:"Legend",trigger:(e,t)=>(0,s.jsx)("button",{type:"button",onClick:t,title:"Legend",className:(0,L.cn)("glass flex size-8 items-center justify-center rounded-lg transition-colors",e?"text-foreground":"text-muted-foreground hover:text-foreground"),children:(0,s.jsx)(f.A,{className:"size-4"})}),children:(0,s.jsxs)("ul",{className:"space-y-1.5 text-[10.5px] text-muted-foreground",children:[(0,s.jsxs)("li",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block size-2.5 shrink-0 rounded-full bg-zinc-400"}),(0,s.jsx)("span",{children:"a file \xb7 bigger dot = more files import it"})]}),a&&(0,s.jsxs)("li",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block size-2.5 shrink-0 rounded-full",style:{boxShadow:`inset 0 0 0 2px ${D.ZD.frontend}`}}),(0,s.jsx)("span",{children:"colored ring \xb7 frontend / backend layer"})]}),(0,s.jsxs)("li",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block h-px w-6 bg-[#4a4a52]"}),(0,s.jsx)("span",{children:"line \xb7 imports another file"})]}),(0,s.jsxs)("li",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block h-px w-6 bg-red-400"}),(0,s.jsx)("span",{children:"red \xb7 part of an import cycle"})]}),(0,s.jsxs)("li",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{"aria-hidden":!0,className:"inline-flex shrink-0 gap-0.5",children:[(0,s.jsx)("span",{className:"inline-block size-2 rounded-full bg-violet-400"}),(0,s.jsx)("span",{className:"inline-block size-2 rounded-full bg-amber-400"})]}),(0,s.jsx)("span",{children:"dot color \xb7 its directory (chips, top-right)"})]})]})})}),(0,s.jsx)(l.of,{pannable:!0,zoomable:!0,position:"bottom-left",style:{width:140,height:90},className:"!overflow-hidden !rounded-xl !border !border-border !bg-card/50 !backdrop-blur",nodeColor:()=>"#555"}),eR.length>0&&!eT.active&&(0,s.jsx)(l.Zk,{position:"top-left",className:"!mt-14",children:(0,s.jsxs)("button",{type:"button",onClick:eT.start,title:"Guided, dependency-ordered walkthrough of the codebase",className:"glass flex items-center gap-1.5 rounded-xl px-3 py-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:[(0,s.jsx)(m.A,{className:"size-3.5"}),"Start tour"]})}),(0,s.jsx)(l.Zk,{position:"top-right",className:(0,L.cn)("glass rounded-full px-1 py-0.5 transition-[margin] duration-200",e7&&"!mr-[300px]"),children:(0,s.jsx)(j.Z,{active:"FILES",tabs:[{value:"ROADMAP",label:"Roadmap",href:"/map?view=ROADMAP"},{value:"ARCHITECTURE",label:"Architecture",href:"/map?view=ARCHITECTURE"},{value:"DATABASE",label:"Database",href:"/map?view=DATABASE"},{value:"FILES",label:"Files",href:"/map?view=FILES"}]})}),(0,s.jsx)(l.Zk,{position:"top-right",className:(0,L.cn)("glass !mt-24 flex max-w-[300px] flex-wrap items-center justify-end gap-x-2.5 gap-y-1 rounded-xl px-3 py-1.5 transition-[margin] duration-200",e7&&"!mr-[300px]"),children:e1.map(t=>(0,s.jsxs)("button",{type:"button",onClick:()=>{let o=e.filter(e=>(X.get(e.path)??"(root)")===t.group).map(e=>({id:e.path}));o.length&&eA.current?.fitView({nodes:o,duration:600,padding:.3,maxZoom:1})},title:`${t.count} files — click to zoom to ${t.group}`,className:"flex items-center gap-1.5 rounded px-1 py-0.5 text-[10px] text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"size-2 shrink-0 rounded-full",style:{backgroundColor:t.color}}),t.group]},t.group))}),(0,s.jsxs)(l.Zk,{position:"top-right",className:(0,L.cn)("!mt-14 flex items-center gap-2 transition-[margin] duration-200",e7&&"!mr-[300px]"),children:[(0,s.jsx)(k.X,{query:ew,onQuery:ev,hits:eV,placeholder:"Find a file…",onPick:e=>{ev(""),eD(e)},onZoomToMatches:()=>{eU?.size&&eA.current?.fitView({nodes:[...eU].map(e=>({id:e})),duration:600,padding:.3})}}),a&&(0,s.jsx)(z.o,{value:eb,onChange:ey,options:["frontend","backend"]}),(0,s.jsxs)("div",{className:"glass flex items-center gap-3 rounded-xl px-3 py-1.5 text-[11px]",children:[(0,s.jsxs)("span",{className:"text-muted-foreground",children:[e.length," files \xb7 ",t.length," imports"]}),e5>0&&(0,s.jsxs)("button",{type:"button",onClick:()=>{ef(e=>!e),ei(null),ep(null)},title:eh?"Show all imports":"Show only files involved in import cycles",className:(0,L.cn)("flex items-center gap-1.5 rounded-md px-1.5 py-0.5 transition-colors",eh?"bg-red-500/15 text-red-200 ring-1 ring-red-400/40":"text-red-300 hover:bg-red-500/10"),children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block h-0 w-5 border-t border-dashed",style:{borderColor:"#ef4444"}}),e5," circular"]}),Y&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("button",{type:"button",onClick:eI,title:ex?"Show all files again":"Focus + zoom to the files edited this session",className:(0,L.cn)("flex items-center gap-1.5 rounded-md px-1.5 py-0.5 transition-colors",ex?"bg-teal-500/15 text-teal-200 ring-1 ring-teal-400/40":"text-teal-300 hover:bg-teal-500/10"),children:[(0,s.jsx)(x.A,{className:"size-3"}),Q.size," edited"]})})]})]})]}),e7&&(0,s.jsxs)(y.b,{className:"absolute bottom-3 right-3 top-16 z-10 flex w-72 flex-col rounded-2xl",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3.5 py-2.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:ea?"File":"Edited this session"}),(0,s.jsx)("button",{onClick:e3,title:"Close panel",className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:(0,s.jsx)(g.A,{className:"size-4"})})]}),(0,s.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-3",children:ea?(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(b.A,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,s.jsx)("h2",{className:"break-all text-sm font-semibold leading-tight",children:ea.slice(ea.lastIndexOf("/")+1)})]}),(0,s.jsx)("div",{className:"mt-0.5 break-all font-mono text-[10px] text-muted-foreground",children:ea})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(G=Q.get(ea))?(0,s.jsxs)("span",{className:"rounded bg-teal-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-teal-300",children:["edited ",G.count,"\xd7"]}):null,J.has(ea)&&(0,s.jsx)("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-amber-300",children:"untested"})]}),(0,s.jsx)("button",{onClick:()=>fetch(`/api/open?path=${encodeURIComponent(ea)}`).catch(()=>{}),className:"w-full rounded-md border border-border px-2 py-1.5 text-[11px] text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:"Open in editor"}),(0,s.jsx)(H,{label:"Imports",paths:e2,onPick:eD}),(0,s.jsx)(H,{label:"Imported by",paths:e4,onPick:eD})]}):(0,s.jsx)(w.h,{files:ee.map(e=>({path:e.path,meta:`${e.count}\xd7`})),emptyLabel:"No files edited this session yet."})})]}),eT.active&&eT.step&&(0,s.jsx)(M.d,{steps:eR,index:eT.index,onPrev:eT.prev,onNext:eT.next,onExit:eT.stop,onGoto:eT.goto})]}):(0,s.jsx)("div",{className:"flex h-screen w-full items-center justify-center text-sm text-muted-foreground",children:"Loading graph…"})}function H({label:e,paths:t,onPick:o}){return t.length?(0,s.jsxs)("div",{children:[(0,s.jsxs)("h3",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:[e," (",t.length,")"]}),(0,s.jsx)(w.h,{files:t.map(e=>({path:e})),onSelect:o})]}):null}},77260:(e,t,o)=>{"use strict";o.d(t,{MapTabsShell:()=>a});var s=o(95155),n=o(12115),r=o(75514);let l=["ROADMAP","ARCHITECTURE","DATABASE"];function a({initialView:e,roadmap:t,architecture:o,database:i}){let[d,c]=(0,n.useState)(e),[u,p]=(0,n.useState)(()=>new Set([e])),h=(0,n.useCallback)(e=>{c(e),p(t=>t.has(e)?t:new Set(t).add(e));try{let t=new URL(window.location.href);t.searchParams.set("view",e),window.history.replaceState(window.history.state,"",t)}catch{}},[]),f={ROADMAP:t,ARCHITECTURE:o,DATABASE:i};return(0,s.jsx)(r.no.Provider,{value:{views:r.a4,switchTo:h},children:l.map(e=>u.has(e)?(0,s.jsx)("div",{className:d===e?"contents":"hidden",children:f[e]},e):null)})}}},e=>{e.O(0,[2574,3862,5004,277,8500,4888,2114,1569,5547,8710,6283,4752,6818,6873,4853,8441,3794,7358],()=>e(e.s=27950)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5823],{27950:(e,t,o)=>{Promise.resolve().then(o.bind(o,44853)),Promise.resolve().then(o.bind(o,62079)),Promise.resolve().then(o.bind(o,30985)),Promise.resolve().then(o.bind(o,77260))},62079:(e,t,o)=>{"use strict";o.d(t,{FilesMapClient:()=>V});var s=o(95155),n=o(12115),r=o(80277),l=o(81750),a=o(6266),i=o(7679),d=o(98766),c=o(15629),u=o(79176),p=o(2982),h=o(64385);o(53255);var f=o(17356),m=o(24413),x=o(18986),g=o(9005),b=o(25583),y=o(82099),j=o(62311),k=o(9991),w=o(47409),v=o(91157),N=o(56895),M=o(16607),S=o(14983);let C=/(^|\/)tests?\/|\.(test|spec)\.[jt]sx?$/i;var A=o(44267),$=o(70947),z=o(98238),E=o(56614),D=o(28161);let I=/\.(py|go|rb|rs|java|php|ex|exs)$/i,R=/(^|\/)(app\/api|pages\/api|migrations|bin)\/|(^|\/)instrumentation\.[^/]+$/,O=e=>e.includes("/")?e.slice(0,e.indexOf("/")):"(root)";function T(e){let t=Math.max(14,.35*e.length),o=new Map;for(let t of e)o.set(t,O(t));for(let e=0;e<6;e++){let e=new Map;for(let t of o.values())e.set(t,(e.get(t)??0)+1);let s=!1;for(let[n,r]of o){if((e.get(r)??0)<=t||!n.startsWith(`${r}/`))continue;let l=n.slice(r.length+1);l.includes("/")&&(o.set(n,`${r}/${l.slice(0,l.indexOf("/"))}`),s=!0)}if(!s)break}return o}var P=o(29523),Z=o(70221),F=o(12410),L=o(91337),_=o(2060);function W(e){return 5+.5*Math.min(e,26)}let B={file:(0,n.memo)(function({data:e}){let t=(0,P.k)(Z.kz),o=!!e.touched,n=e.recency??0,r=e.inDegree??0,i=W(r),d=e.layer??null,c=2*!!d,u=r>0?` \xb7 imported by ${r}`:"",p=d?` \xb7 ${"fullstack"===d?"shared (used by frontend + backend)":D.YG[d].label.toLowerCase()}`:"",h=o?`${e.tooltip} \xb7 edited ${e.count??0}\xd7 this session${u}${p}`:e.untested?`${e.tooltip} \xb7 no test imports this file${u}${p}`:`${e.tooltip}${u}${p}`;return(0,s.jsxs)("div",{title:h,className:"relative flex flex-col items-center",children:[(0,s.jsx)(l.h7,{type:"target",position:a.yX.Top,isConnectable:!1,className:"!h-0 !w-0 !min-w-0 !border-0 !bg-transparent",style:{top:i+c,left:"50%"}}),(0,s.jsx)("span",{"aria-hidden":!0,className:(0,L.cn)("rounded-full",e.isNewest&&"animate-touch-pulse"),style:{padding:c,background:d?(0,D.A6)(d):void 0,boxShadow:o?`0 0 ${8+Math.round(14*n)}px ${2+Math.round(3*n)}px rgba(45,212,191,${(.35+.45*n).toFixed(2)})`:e.untested?"0 0 0 2px rgba(251,191,36,0.65)":"none"},children:(0,s.jsx)("span",{"aria-hidden":!0,className:"block rounded-full",style:{width:2*i,height:2*i,backgroundColor:e.dirColor}})}),o&&(e.count??0)>0&&(0,s.jsx)("span",{"aria-hidden":!0,className:"absolute -right-2 -top-2 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-teal-400 px-0.5 text-[8px] font-bold text-background ring-1 ring-background",children:e.count}),("full"===t||"mid"===t&&r>=4)&&(0,s.jsx)("span",{className:(0,L.cn)("pointer-events-none mt-1 max-w-44 truncate text-[10px] leading-tight",o?"font-semibold text-teal-100":"text-foreground/75"),children:e.label}),(0,s.jsx)(l.h7,{type:"source",position:a.yX.Bottom,isConnectable:!1,className:"!h-0 !w-0 !min-w-0 !border-0 !bg-transparent",style:{top:i+c,bottom:"auto",left:"50%"}})]})})};function U({regions:e,dominant:t}){return(0,s.jsx)(l.DX,{children:e.map(e=>{let o=t.get(e.key);return o&&"fullstack"!==o?(0,s.jsx)("div",{style:{position:"absolute",transform:`translate(${e.x-.15*e.w}px, ${e.y-.15*e.h}px)`,width:1.3*e.w,height:1.3*e.h,pointerEvents:"none",zIndex:0,background:`radial-gradient(closest-side, ${D.ZD[o]} 0%, transparent 72%)`,opacity:.1}},e.key):null})})}function V({files:e,edges:t,touched:o,hasFrontend:a=!1,classificationRoots:O=[]}){let G,X=(0,n.useMemo)(()=>(function(e,t){let o=function(e){if(!e?.length)return[];let t=new Set;for(let o of e){let e=o.trim().replace(/^\/+|\/+$/g,"");e&&t.add(e)}return[...t]}(t);if(!o.length)return T(e);let s=new Map,n=[];for(let t of e){let e=function(e,t){let o=null;for(let s of t)(e===s||e.startsWith(`${s}/`))&&(!o||s.length>o.length)&&(o=s);return o}(t,o);e?s.set(t,function(e,t){if(e===t||!e.startsWith(`${t}/`))return t;let o=e.slice(t.length+1);return o.includes("/")?`${t}/${o.slice(0,o.indexOf("/"))}`:t}(t,e)):n.push(t)}for(let[e,t]of T(n))s.set(e,t);return s})(e.map(e=>e.path),O),[e,O]),q=(0,n.useMemo)(()=>(function(e,t,o){let s=function(e){let t=new Map;for(let o of e.values())t.set(o,(t.get(o)??0)+1);let o=Array.from(t.entries()).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])),s=Math.max(1,Math.ceil(Math.sqrt(2.5*o.length))),n=new Map;return o.forEach(([e],t)=>{n.set(e,{x:t%s*1250,y:950*Math.floor(t/s)})}),n}(o),n=e=>s.get(o.get(e)??"(root)"),r=e.map(e=>{let t=function(e){let t=0x811c9dc5;for(let o=0;o<e.length;o++)t=(t^e.charCodeAt(o))*0x1000193>>>0;return{x:(t%10007/10007-.5)*900,y:((t>>>13)%10007/10007-.5)*900}}(e.path),o=n(e.path);return{id:e.path,x:o.x+.5*t.x,y:o.y+.5*t.y,pinned:!1,radius:W(e.inDegree??0)+22}}),l=t.filter(e=>e.from!==e.to).map(e=>({source:e.from,target:e.to})),a=(0,i.A)(r).force("link",(0,d.A)(l).id(e=>e.id).distance(100).strength(e=>{let t="object"==typeof e.source?e.source.id:String(e.source),s="object"==typeof e.target?e.target.id:String(e.target);return o.get(t)===o.get(s)?.5:.02})).force("charge",(0,c.A)().strength(-260).distanceMax(800)).force("collide",(0,u.A)().radius(e=>e.radius).strength(.6)).force("clusterX",(0,p.A)(e=>n(e.id).x).strength(.1)).force("clusterY",(0,h.A)(e=>n(e.id).y).strength(.115)).stop();for(let e=0;e<500;e++)a.tick();let f=new Map;for(let e of r)f.set(e.id,{x:e.x??0,y:e.y??0});return f})(e,t,X),[e,t,X]),J=(0,n.useMemo)(()=>(function(e,t){var o;let s=new Set;for(let e of t)o=e.from,C.test(o)&&s.add(e.to);let n=new Set;for(let t of e)C.test(t)||s.has(t)||n.add(t);return n})(e.map(e=>e.path),t),[e,t]),K=(0,n.useMemo)(()=>a?function(e,t){let o=new Map,s=new Map;for(let e of t){let t=s.get(e.from);t?t.push(e.to):s.set(e.from,[e.to])}let n=new Map;for(let t of e){let e=R.test(t)?"backend":D.An.test(t)?"frontend":I.test(t)?"backend":null;o.set(t,e),e&&n.set(t,e)}let r=e=>{let t=new Set,o=[];for(let[t,s]of n)s===e&&o.push(t);for(;o.length;){let e=o.pop();for(let n of s.get(e)??[])t.has(n)||(t.add(n),o.push(n))}return t},l=r("frontend"),a=r("backend");for(let t of e){if(o.get(t))continue;let e=l.has(t),s=a.has(t);e&&s?o.set(t,"fullstack"):e?o.set(t,"frontend"):s&&o.set(t,"backend")}return o}(e.map(e=>e.path),t):null,[a,e,t]),Q=(0,n.useMemo)(()=>{let e=new Map,t=Object.entries(o??{});if(!t.length)return e;let s=t.map(([,e])=>e.lastAt),n=Math.max(...s),r=Math.min(...s),l=n-r||1,a=t[0][0],i=t[0][1].lastAt;for(let[e,o]of t)o.lastAt>=i&&(a=e,i=o.lastAt);for(let[o,s]of t)e.set(o,{count:s.count,recency:(s.lastAt-r)/l,isNewest:o===a});return e},[o]),Y=Q.size>0,ee=(0,n.useMemo)(()=>Array.from(Q.entries()).map(([e,t])=>({path:e,count:t.count})),[Q]),et=(0,n.useMemo)(()=>e.map(e=>{let t=q.get(e.path)??{x:e.x,y:e.y},o=e.path.lastIndexOf("/"),s=o>=0?e.path.slice(o+1):e.path,n=Q.get(e.path);return{id:e.path,type:"file",position:t,data:{label:s,tooltip:e.path,untested:J.has(e.path),inDegree:e.inDegree??0,dirColor:(0,F.i3)(X.get(e.path)??"(root)"),layer:K?.get(e.path)??null,touched:!!n,count:n?.count??0,recency:n?.recency??0,isNewest:n?.isNewest??!1}}}),[e,q,J,Q,K,X]),eo=(0,n.useMemo)(()=>t.map(e=>({id:`${e.from}|${e.to}`,source:e.from,target:e.to,type:"straight",selectable:!1,focusable:!1,style:{pointerEvents:"none",...e.circular?{stroke:"#f87171",strokeDasharray:"5 3",strokeWidth:1.5,opacity:.6}:{stroke:"#8b8b94",strokeWidth:1,opacity:.3}}})),[t]),[es,en]=(0,n.useState)(et),[er,el]=(0,n.useState)(eo),[ea,ei]=(0,n.useState)(null),[ed,ec]=(0,n.useState)(null),[eu,ep]=(0,n.useState)(null),[eh,ef]=(0,n.useState)(!1),em=(0,_.G)(),[ex,eg]=(0,n.useState)(!1),[eb,ey]=(0,n.useState)(null),[ej,ek]=(0,n.useState)(!1),[ew,ev]=(0,n.useState)(""),[eN,eM]=(0,n.useState)(!1),[eS,eC]=(0,n.useState)("full"),eA=(0,n.useRef)(null),{tool:e$,setTool:ez,flowProps:eE}=(0,r.e)(),eD=(0,n.useCallback)(e=>{ei(e),ep(null);let t=eA.current?.getNode(e);t&&eA.current&&eA.current.setCenter(t.position.x+40,t.position.y+12,{zoom:1.4,duration:600})},[]),eI=(0,n.useCallback)(()=>{ei(null),ep(null);let e=!ex;if(eg(e),ek(e),e&&eA.current){let e=Array.from(Q.keys()).map(e=>({id:e}));e.length&&eA.current.fitView({nodes:e,duration:600,padding:.4})}},[ex,Q]),eR=(0,n.useMemo)(()=>(0,v.b)(e,t,X),[e,t,X]),eO=(0,n.useCallback)(e=>{eA.current&&(e.focusIds.length?eA.current.fitView({nodes:e.focusIds.map(e=>({id:e})),duration:700,padding:.3,maxZoom:1.1}):eA.current.fitView({duration:700,padding:.1}))},[]),eT=(0,N.W)(eR,eO);(0,n.useEffect)(()=>eM(!0),[]),(0,n.useEffect)(()=>en(et),[et]),(0,n.useEffect)(()=>el(eo),[eo]);let eP=(0,n.useCallback)(e=>en(t=>(0,l._0)(e,t)),[]),eZ=(0,n.useCallback)(e=>el(t=>(0,l.zW)(e,t)),[]),eF=(0,n.useCallback)((e,t,o)=>{fetch("/api/code-graph/position",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,x:t,y:o})})},[]),eL=(0,n.useMemo)(()=>new Set(t.filter(e=>e.circular).map(e=>`${e.from}|${e.to}`)),[t]),e_=(0,n.useMemo)(()=>{let e=new Set;for(let o of t)o.circular&&(e.add(o.from),e.add(o.to));return e},[t]),eW=ea??ed,eB=ew.trim().length>0,eU=(0,n.useMemo)(()=>{if(!eB)return null;let t=new Set;for(let o of e)(0,S.Qk)((0,S.zn)(o),ew)&&t.add(o.path);return t},[e,ew,eB]),eV=(0,n.useMemo)(()=>eB?(0,S.r2)(e,ew,e=>(0,S.zn)(e),e=>({id:e.path,label:e.path,sublabel:e.lang??void 0,kind:"file"})):[],[e,ew,eB]),eH=(0,n.useMemo)(()=>{if(eu){let e=er.find(e=>e.id===eu);return e?new Set([e.source,e.target]):null}if(eW){let e=new Set([eW]);for(let o of t)o.from===eW&&e.add(o.to),o.to===eW&&e.add(o.from);return e}return eh?e_:ex&&Y?new Set(Q.keys()):null},[eW,eu,eh,e_,t,er,ex,Y,Q]),eG=eT.focusIds,eX=eG??eU??eH,eq=eU??eG,eJ=(0,n.useMemo)(()=>{if(!eb||!K)return null;let t=new Set;for(let o of e)(0,z.F)(eb,K.get(o.path)??null)||t.add(o.path);return t},[eb,K,e]),eK=(0,n.useMemo)(()=>eX?es.map(e=>{let t=eX.has(e.id);return{...e,zIndex:t&&eq?10:e.zIndex,style:{...e.style,opacity:t?1:.15,boxShadow:t&&eq?S.RU:e.style?.boxShadow,borderRadius:t&&eq?9999:e.style?.borderRadius,transition:"opacity 120ms, box-shadow 120ms"}}}):eJ?es.map(e=>eJ.has(e.id)?{...e,style:{...e.style,opacity:.15,transition:"opacity 120ms"}}:e):es,[es,eX,eq,eJ]),eQ=(0,n.useMemo)(()=>eG?er.map(e=>eG.has(e.source)&&eG.has(e.target)?{...e,style:{...e.style,stroke:"#e4e4e7",opacity:.9,strokeWidth:1.4}}:{...e,style:{...e.style,opacity:.05}}):eU?er.map(e=>eU.has(e.source)&&eU.has(e.target)?{...e,style:{...e.style,stroke:"#e4e4e7",opacity:.95,strokeWidth:1.6}}:{...e,style:{...e.style,opacity:.05}}):eW||eu||eh||ex?er.map(e=>{let t=!1;return eu?t=e.id===eu:eW?t=e.source===eW||e.target===eW:eh?t=eL.has(e.id):ex&&(t=Q.has(e.source)&&Q.has(e.target)),t?{...e,style:{...e.style,stroke:"#e4e4e7",opacity:.95,strokeWidth:1.6}}:{...e,style:{...e.style,opacity:.05}}}):eJ?er.map(e=>eJ.has(e.source)||eJ.has(e.target)?{...e,style:{...e.style,opacity:.05}}:e):er,[er,eW,eu,eh,eL,ex,Q,eU,eJ,eG]),eY=(0,n.useMemo)(()=>{let e=es.map(e=>{let t=W(e.data.inDegree??0);return{id:e.id,group:X.get(e.id)??"(root)",x:e.position.x,y:e.position.y,w:2*t,h:2*t}});return(0,A.S)(e,{pad:60})},[es,X]),e0=(0,n.useMemo)(()=>{let t=new Map;if(!K)return t;let o=new Map;for(let t of e){let e=K.get(t.path);if(!e)continue;let s=X.get(t.path)??"(root)",n=o.get(s)??new Map;n.set(e,(n.get(e)??0)+1),o.set(s,n)}for(let[e,s]of o){let o=null,n=0,r=!1;for(let[e,t]of s)t>n?(o=e,n=t,r=!1):t===n&&(r=!0);t.set(e,r?null:o)}return t},[K,e,X]),e1=(0,n.useMemo)(()=>{let e=new Map;for(let t of X.values())e.set(t,(e.get(t)??0)+1);return Array.from(e.entries()).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>({group:e,count:t,color:(0,F.i3)(e)}))},[X]),e5=t.filter(e=>e.circular).length,e2=(0,n.useMemo)(()=>ea?t.filter(e=>e.from===ea).map(e=>e.to):[],[ea,t]),e4=(0,n.useMemo)(()=>ea?t.filter(e=>e.to===ea).map(e=>e.from):[],[ea,t]),e7=null!==ea||ej&&Y,e3=(0,n.useCallback)(()=>{ei(null),ek(!1),eg(!1)},[]);return eN?(0,s.jsxs)("div",{className:"canvas-dots relative h-screen w-full",children:[(0,s.jsxs)(l.Gc,{...eE,nodes:eK,edges:eQ,nodeTypes:B,onNodesChange:eP,onEdgesChange:eZ,onNodeClick:(e,t)=>{ei(t.id),ep(null)},onEdgeClick:(e,t)=>{ep(t.id),ei(null)},onPaneClick:()=>{ei(null),ep(null)},onNodeMouseEnter:(e,t)=>ec(t.id),onNodeMouseLeave:()=>ec(null),onInit:e=>{eA.current=e},onNodeDragStop:(e,t)=>eF(t.id,t.position.x,t.position.y),deleteKeyCode:null,colorMode:em,fitView:!0,fitViewOptions:{padding:.1,minZoom:.18,maxZoom:.9},minZoom:.05,panOnScroll:!0,zoomActivationKeyCode:["Meta","Control"],proOptions:{hideAttribution:!0},children:[(0,s.jsx)($.Z,{regions:"far"===eS?eY:[],tone:"category",lod:eS}),a&&(0,s.jsx)(U,{regions:"far"===eS?[]:eY,dominant:e0}),(0,s.jsx)(P.J,{onLod:eC,thresholds:Z.kz}),(0,s.jsx)(l.H2,{position:"bottom-right",className:"!overflow-hidden !rounded-xl !border !border-border [&_button]:!border-border [&_button]:!bg-card/70 [&_button]:!text-foreground [&_button]:!backdrop-blur"}),(0,s.jsx)(l.Zk,{position:"bottom-left",style:{marginBottom:118},children:(0,s.jsx)(r.H,{tool:e$,onChange:ez})}),(0,s.jsx)(l.Zk,{position:"bottom-right",style:{marginBottom:152},children:(0,s.jsx)(E.er,{title:"Legend",trigger:(e,t)=>(0,s.jsx)("button",{type:"button",onClick:t,title:"Legend",className:(0,L.cn)("glass flex size-8 items-center justify-center rounded-lg transition-colors",e?"text-foreground":"text-muted-foreground hover:text-foreground"),children:(0,s.jsx)(f.A,{className:"size-4"})}),children:(0,s.jsxs)("ul",{className:"space-y-1.5 text-[10.5px] text-muted-foreground",children:[(0,s.jsxs)("li",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block size-2.5 shrink-0 rounded-full bg-zinc-400"}),(0,s.jsx)("span",{children:"a file \xb7 bigger dot = more files import it"})]}),a&&(0,s.jsxs)("li",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block size-2.5 shrink-0 rounded-full",style:{boxShadow:`inset 0 0 0 2px ${D.ZD.frontend}`}}),(0,s.jsx)("span",{children:"colored ring \xb7 frontend / backend layer"})]}),(0,s.jsxs)("li",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block h-px w-6 bg-[#4a4a52]"}),(0,s.jsx)("span",{children:"line \xb7 imports another file"})]}),(0,s.jsxs)("li",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block h-px w-6 bg-red-400"}),(0,s.jsx)("span",{children:"red \xb7 part of an import cycle"})]}),(0,s.jsxs)("li",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{"aria-hidden":!0,className:"inline-flex shrink-0 gap-0.5",children:[(0,s.jsx)("span",{className:"inline-block size-2 rounded-full bg-violet-400"}),(0,s.jsx)("span",{className:"inline-block size-2 rounded-full bg-amber-400"})]}),(0,s.jsx)("span",{children:"dot color \xb7 its directory (chips, top-right)"})]})]})})}),(0,s.jsx)(l.of,{pannable:!0,zoomable:!0,position:"bottom-left",style:{width:140,height:90},className:"!overflow-hidden !rounded-xl !border !border-border !bg-card/50 !backdrop-blur",nodeColor:()=>"#555"}),eR.length>0&&!eT.active&&(0,s.jsx)(l.Zk,{position:"top-left",className:"!mt-14",children:(0,s.jsxs)("button",{type:"button",onClick:eT.start,title:"Guided, dependency-ordered walkthrough of the codebase",className:"glass flex items-center gap-1.5 rounded-xl px-3 py-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:[(0,s.jsx)(m.A,{className:"size-3.5"}),"Start tour"]})}),(0,s.jsx)(l.Zk,{position:"top-right",className:(0,L.cn)("glass rounded-full px-1 py-0.5 transition-[margin] duration-200",e7&&"!mr-[300px]"),children:(0,s.jsx)(j.Z,{active:"FILES",tabs:[{value:"ROADMAP",label:"Roadmap",href:"/map?view=ROADMAP"},{value:"ARCHITECTURE",label:"Architecture",href:"/map?view=ARCHITECTURE"},{value:"DATABASE",label:"Database",href:"/map?view=DATABASE"},{value:"FILES",label:"Files",href:"/map?view=FILES"}]})}),(0,s.jsx)(l.Zk,{position:"top-right",className:(0,L.cn)("glass !mt-24 flex max-w-[300px] flex-wrap items-center justify-end gap-x-2.5 gap-y-1 rounded-xl px-3 py-1.5 transition-[margin] duration-200",e7&&"!mr-[300px]"),children:e1.map(t=>(0,s.jsxs)("button",{type:"button",onClick:()=>{let o=e.filter(e=>(X.get(e.path)??"(root)")===t.group).map(e=>({id:e.path}));o.length&&eA.current?.fitView({nodes:o,duration:600,padding:.3,maxZoom:1})},title:`${t.count} files — click to zoom to ${t.group}`,className:"flex items-center gap-1.5 rounded px-1 py-0.5 text-[10px] text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"size-2 shrink-0 rounded-full",style:{backgroundColor:t.color}}),t.group]},t.group))}),(0,s.jsxs)(l.Zk,{position:"top-right",className:(0,L.cn)("!mt-14 flex items-center gap-2 transition-[margin] duration-200",e7&&"!mr-[300px]"),children:[(0,s.jsx)(k.X,{query:ew,onQuery:ev,hits:eV,placeholder:"Find a file…",onPick:e=>{ev(""),eD(e)},onZoomToMatches:()=>{eU?.size&&eA.current?.fitView({nodes:[...eU].map(e=>({id:e})),duration:600,padding:.3})}}),a&&(0,s.jsx)(z.o,{value:eb,onChange:ey,options:["frontend","backend"]}),(0,s.jsxs)("div",{className:"glass flex items-center gap-3 rounded-xl px-3 py-1.5 text-[11px]",children:[(0,s.jsxs)("span",{className:"text-muted-foreground",children:[e.length," files \xb7 ",t.length," imports"]}),e5>0&&(0,s.jsxs)("button",{type:"button",onClick:()=>{ef(e=>!e),ei(null),ep(null)},title:eh?"Show all imports":"Show only files involved in import cycles",className:(0,L.cn)("flex items-center gap-1.5 rounded-md px-1.5 py-0.5 transition-colors",eh?"bg-red-500/15 text-red-200 ring-1 ring-red-400/40":"text-red-300 hover:bg-red-500/10"),children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"inline-block h-0 w-5 border-t border-dashed",style:{borderColor:"#ef4444"}}),e5," circular"]}),Y&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("button",{type:"button",onClick:eI,title:ex?"Show all files again":"Focus + zoom to the files edited this session",className:(0,L.cn)("flex items-center gap-1.5 rounded-md px-1.5 py-0.5 transition-colors",ex?"bg-teal-500/15 text-teal-200 ring-1 ring-teal-400/40":"text-teal-300 hover:bg-teal-500/10"),children:[(0,s.jsx)(x.A,{className:"size-3"}),Q.size," edited"]})})]})]})]}),e7&&(0,s.jsxs)(y.b,{className:"absolute bottom-3 right-3 top-16 z-10 flex w-72 flex-col rounded-2xl",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3.5 py-2.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:ea?"File":"Edited this session"}),(0,s.jsx)("button",{onClick:e3,title:"Close panel",className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:(0,s.jsx)(g.A,{className:"size-4"})})]}),(0,s.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-3",children:ea?(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,s.jsx)(b.A,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,s.jsx)("h2",{className:"break-all text-sm font-semibold leading-tight",children:ea.slice(ea.lastIndexOf("/")+1)})]}),(0,s.jsx)("div",{className:"mt-0.5 break-all font-mono text-[10px] text-muted-foreground",children:ea})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(G=Q.get(ea))?(0,s.jsxs)("span",{className:"rounded bg-teal-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-teal-300",children:["edited ",G.count,"\xd7"]}):null,J.has(ea)&&(0,s.jsx)("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-amber-300",children:"untested"})]}),(0,s.jsx)("button",{onClick:()=>fetch(`/api/open?path=${encodeURIComponent(ea)}`).catch(()=>{}),className:"w-full rounded-md border border-border px-2 py-1.5 text-[11px] text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:"Open in editor"}),(0,s.jsx)(H,{label:"Imports",paths:e2,onPick:eD}),(0,s.jsx)(H,{label:"Imported by",paths:e4,onPick:eD})]}):(0,s.jsx)(w.h,{files:ee.map(e=>({path:e.path,meta:`${e.count}\xd7`})),emptyLabel:"No files edited this session yet."})})]}),eT.active&&eT.step&&(0,s.jsx)(M.d,{steps:eR,index:eT.index,onPrev:eT.prev,onNext:eT.next,onExit:eT.stop,onGoto:eT.goto})]}):(0,s.jsx)("div",{className:"flex h-screen w-full items-center justify-center text-sm text-muted-foreground",children:"Loading graph…"})}function H({label:e,paths:t,onPick:o}){return t.length?(0,s.jsxs)("div",{children:[(0,s.jsxs)("h3",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:[e," (",t.length,")"]}),(0,s.jsx)(w.h,{files:t.map(e=>({path:e})),onSelect:o})]}):null}},77260:(e,t,o)=>{"use strict";o.d(t,{MapTabsShell:()=>a});var s=o(95155),n=o(12115),r=o(75514);let l=["ROADMAP","ARCHITECTURE","DATABASE"];function a({initialView:e,roadmap:t,architecture:o,database:i}){let[d,c]=(0,n.useState)(e),[u,p]=(0,n.useState)(()=>new Set([e])),h=(0,n.useCallback)(e=>{c(e),p(t=>t.has(e)?t:new Set(t).add(e));try{let t=new URL(window.location.href);t.searchParams.set("view",e),window.history.replaceState(window.history.state,"",t)}catch{}},[]),f={ROADMAP:t,ARCHITECTURE:o,DATABASE:i};return(0,s.jsx)(r.no.Provider,{value:{views:r.a4,switchTo:h},children:l.map(e=>u.has(e)?(0,s.jsx)("div",{className:d===e?"contents":"hidden",children:f[e]},e):null)})}}},e=>{e.O(0,[2574,3862,5004,277,8500,4888,2114,1569,5547,8710,6283,4752,6818,985,4853,8441,3794,7358],()=>e(e.s=27950)),_N_E=e.O()}]);
|