1import{r as u,j as e}from"./react-PPJ0mPjh.js";import{i as S,a as L,H as _,P as y,d as v}from"./index-rOgc0dK-.js";import{c as I,g as w,H as g,a8 as j,J as P,a as p}from"./index-osEr2qXk.js";import"./mantine-DyaIkVVa.js";var m=I("chart-dots","IconChartDots",[["path",{d:"M3 3v18h18",key:"svg-0"}],["path",{d:"M9 9m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M19 7m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-2"}],["path",{d:"M14 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M10.16 10.62l2.34 2.88",key:"svg-4"}],["path",{d:"M15.088 13.328l2.837 -4.586",key:"svg-5"}]]),M=I("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);const R="_canvas_1j9zm_13",U="_node_1j9zm_39",C="_border_1j9zm_45",G="_inner_1j9zm_75",O="_header_1j9zm_83",H="_title_1j9zm_92",D="_badge_1j9zm_101",A="_body_1j9zm_110",B="_sub_1j9zm_114",V="_foot_1j9zm_123",W="_cloud_1j9zm_135",q="_cloudInner_1j9zm_168",F="_handle_1j9zm_181",a={canvas:R,node:U,border:C,inner:G,header:O,title:H,badge:D,body:A,sub:B,foot:V,cloud:W,cloudInner:q,handle:F};function Q({data:t}){const n=t.icon;return e.jsxs("div",{className:a.node,children:[e.jsx("div",{className:a.cloud,children:e.jsx("div",{className:a.cloudInner,children:e.jsx(n,{size:15,stroke:1.6})})}),e.jsx(_,{type:"target",position:y.Top,className:a.handle}),e.jsx("div",{className:a.border,children:e.jsxs("div",{className:a.inner,children:[e.jsxs("div",{className:a.header,children:[e.jsx("span",{className:a.title,children:t.title}),e.jsx("span",{className:a.badge,style:{backgroundColor:t.color},children:t.badge})]}),e.jsxs("div",{className:a.body,children:[e.jsx("span",{className:a.sub,children:t.sub}),t.foot&&e.jsxs("div",{className:a.foot,children:[e.jsx(w,{size:11}),t.foot]})]})]})}),e.jsx(_,{type:"source",position:y.Bottom,className:a.handle})]})}const X={apNode:Q},k="#10b981",Y="#2a8af6",b="#336791",x="#6b7280",h="#22b8cf",Z="#8b5cf6",z="#e92a67",N=[{id:"create",data:{icon:g,title:"api/users/create",badge:"POST",color:k,sub:"HTTP interface"}},{id:"validate",data:{icon:j,title:"ValidateBody",badge:"Assert",color:x,sub:"email · username · password",foot:"3 assertions"}},{id:"reject",data:{icon:M,title:"Respond 400",badge:"On failure",color:z,sub:"invalid request body"}},{id:"hash",data:{icon:P,title:"HashPassword",badge:"Transform",color:Z,sub:"bcrypt · cost 12",foot:"1 transform"}},{id:"createUser",data:{icon:p,title:"CreateUser",badge:"PostgreSQL",color:b,sub:"INSERT INTO users"}},{id:"trackSignup",data:{icon:m,title:"TrackSignup",badge:"Metric",color:h,sub:"app_users_created_total"}},{id:"list",data:{icon:g,title:"api/users",badge:"GET",color:Y,sub:"HTTP interface"}},{id:"listUsers",data:{icon:p,title:"ListUsers",badge:"PostgreSQL",color:b,sub:"SELECT ⦠LIMIT 50"}},{id:"trackList",data:{icon:m,title:"TrackListRequest",badge:"Metric",color:h,sub:"app_users_listed_total"}},{id:"get",data:{icon:g,title:"api/users/get",badge:"POST",color:k,sub:"HTTP interface"}},{id:"validateGet",data:{icon:j,title:"ValidateBody",badge:"Assert",color:x,sub:"id required",foot:"1 assertion"}},{id:"getUser",data:{icon:p,title:"GetUser",badge:"PostgreSQL",color:b,sub:"SELECT ⦠WHERE id",foot:"404 assertion"}},{id:"trackLookup",data:{icon:m,title:"TrackLookup",badge:"Metric",color:h,sub:"app_users_looked_up_total"}}],i={stroke:"#22d3ee",strokeWidth:2},J={stroke:z,strokeWidth:2},T=[{id:"e1",source:"create",target:"validate",animated:!0,style:i},{id:"e2",source:"validate",target:"hash",animated:!0,style:i},{id:"e3",source:"validate",target:"reject",style:J},{id:"e4",source:"hash",target:"createUser",animated:!0,style:i},{id:"e5",source:"createUser",target:"trackSignup",animated:!0,style:i},{id:"e6",source:"list",target:"listUsers",animated:!0,style:i},{id:"e7",source:"listUsers",target:"trackList",animated:!0,style:i},{id:"e8",source:"get",target:"validateGet",animated:!0,style:i},{id:"e9",source:"validateGet",target:"getUser",animated:!0,style:i},{id:"e10",source:"getUser",target:"trackLookup",animated:!0,style:i}];function K(t,n){const s=new v.graphlib.Graph;s.setGraph({rankdir:"TB",nodesep:38,ranksep:48,marginx:10,marginy:10}),s.setDefaultEdgeLabel(()=>({}));const c=244,d=104;return t.forEach(o=>s.setNode(o.id,{width:c,height:d}
1)),n.forEach(o=>s.setEdge(o.source,o.target)),v.layout(s),t.map(o=>{const{x:r,y:l}=s.node(o.id);return{...o,type:"apNode",position:{x:r-c/2,y:l-d/2}}})}const E=.08,f=new Map;function $(t){const n=t?t.join(","):"*";if(f.has(n))return f.get(n);const s=t?new Set(t):null,c=s?N.filter(r=>s.has(r.id)):N,d=(s?T.filter(r=>s.has(r.source)&&s.has(r.target)):T).map(r=>({...r,type:"smoothstep"})),o={nodes:K(c,d),edges:d};return f.set(n,o),o}function oe({only:t}){const{nodes:n,edges:s}=$(t),[c,d]=u.useState(null),o=u.useRef(null);return u.useEffect(()=>{const r=o.current;if(!c||!r||typeof ResizeObserver>"u")return;const l=new ResizeObserver(()=>{r.clientWidth>0&&r.clientHeight>0&&c.fitView({padding:E})});return l.observe(r),()=>l.disconnect()},[c]),e.jsx("div",{className:a.canvas,ref:o,children:e.jsx(S,{onInit:d,defaultNodes:n,defaultEdges:s,nodeTypes:X,fitView:!0,fitViewOptions:{padding:E},nodesConnectable:!1,nodesDraggable:!0,elementsSelectable:!1,zoomOnScroll:!1,panOnDrag:!1,panOnScroll:!1,preventScrolling:!1,minZoom:.3,maxZoom:1.6,style:{background:"transparent"},children:e.jsx(L,{variant:"dots",gap:18,size:1,color:"rgba(255,255,255,0.09)"})})})}export{oe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.