@reddb-io/ui 0.4.4 → 0.4.6
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/build/404.html +10 -10
- package/build/_app/immutable/chunks/BT_NlJ9b.js +9 -0
- package/build/_app/immutable/chunks/{CRcUHjOC.js → BdKYr7lO.js} +1 -1
- package/build/_app/immutable/chunks/{QTZ_pxoY.js → Br0XzNbS.js} +1 -1
- package/build/_app/immutable/chunks/{C3QbliX6.js → BspwW-rP.js} +1 -1
- package/build/_app/immutable/chunks/{Dblyp_YC.js → DD7_KB97.js} +1 -1
- package/build/_app/immutable/chunks/{RBJGFHIL.js → xVmvYz1F.js} +7 -7
- package/build/_app/immutable/entry/{app.DyPXqkIP.js → app.BwQs72pA.js} +2 -2
- package/build/_app/immutable/entry/start.Dokw79m9.js +1 -0
- package/build/_app/immutable/nodes/{0.jHk_xbql.js → 0.Bn0HCj5G.js} +1 -1
- package/build/_app/immutable/nodes/{1.DG6cNRZC.js → 1.C2fTzfSV.js} +1 -1
- package/build/_app/immutable/nodes/{10.Cf1044jB.js → 10.C6p9_zpN.js} +1 -1
- package/build/_app/immutable/nodes/{15.B_-RXVqx.js → 15.CZkgDcbY.js} +1 -1
- package/build/_app/version.json +1 -1
- package/build/analytics.html +10 -10
- package/build/appearance.html +10 -10
- package/build/ask.html +10 -10
- package/build/cluster.html +10 -10
- package/build/collections.html +10 -10
- package/build/graph.html +11 -11
- package/build/index.html +10 -10
- package/build/query.html +10 -10
- package/build/redwire-ws-spike.html +10 -10
- package/build/security.html +10 -10
- package/build/settings.html +10 -10
- package/build/shadow-dom-spike.html +11 -11
- package/dist/embed/{AnalyticsView-Bc4NYbS5.js → AnalyticsView-Bq4u563e.js} +4 -4
- package/dist/embed/{AnalyticsView-Bc4NYbS5.js.map → AnalyticsView-Bq4u563e.js.map} +1 -1
- package/dist/embed/{RedUiEmbedRoot-BUcz7vnW.js → RedUiEmbedRoot-C29ndra1.js} +8725 -8708
- package/dist/embed/RedUiEmbedRoot-C29ndra1.js.map +1 -0
- package/dist/embed/{index-C3zysLt8.js → index-BAYmeM5z.js} +125 -125
- package/dist/embed/{index-C3zysLt8.js.map → index-BAYmeM5z.js.map} +1 -1
- package/dist/embed/{index-client-esdlRozF.js → index-client-Duv8Z53P.js} +2 -2
- package/dist/embed/{index-client-esdlRozF.js.map → index-client-Duv8Z53P.js.map} +1 -1
- package/dist/embed/index.js +1 -1
- package/dist/embed/{sigma.esm-Ds5a5Bdj.js → sigma.esm-Daj5mOac.js} +2 -2
- package/dist/embed/{sigma.esm-Ds5a5Bdj.js.map → sigma.esm-Daj5mOac.js.map} +1 -1
- package/package.json +3 -3
- package/src/lib/ConnectDropdown.svelte +3 -1
- package/src/lib/reddb/client.ts +4 -1
- package/src/lib/reddb/connection-string.ts +18 -2
- package/build/_app/immutable/chunks/Uan23_-U.js +0 -9
- package/build/_app/immutable/entry/start.BBR6s3gw.js +0 -1
- package/dist/embed/RedUiEmbedRoot-BUcz7vnW.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.
|
|
2
|
-
var q=e=>{throw TypeError(e)};var G=(e,t,r)=>t.has(e)||q("Cannot "+r);var i=(e,t,r)=>(G(e,t,"read from private field"),r?r.call(e):t.get(e)),L=(e,t,r)=>t.has(e)?q("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),A=(e,t,r,n)=>(G(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);import{p as D,c as I,b as T,_ as o}from"../chunks/CN4cKZHK.js";import{bm as R,L as Q,at as l,as as U,af as W,b0 as X,b9 as Z,bP as $,bO as tt,bH as et,aq as y,bw as rt,b6 as at,bz as V,a6 as st,bg as ot,bG as it,bN as x}from"../chunks/CGFL56WJ.js";import{m as nt,p as _t,y as mt,a as b,e as w,k as M,x as ct,v as ut}from"../chunks/nuKvOE41.js";import"../chunks/Bzak7iHL.js";import{a as lt}from"../chunks/Btd6PFkC.js";import{i as k}from"../chunks/DCJ0QyYH.js";function dt(e){return class extends ft{constructor(t){super({component:e,...t})}}}var d,m;class ft{constructor(t){L(this,d);L(this,m);var E;var r=new Map,n=(a,s)=>{var f=X(s,!1,!1);return r.set(a,f),f};const u=new Proxy({...t.props||{},$$events:{}},{get(a,s){return l(r.get(s)??n(s,Reflect.get(a,s)))},has(a,s){return s===Q?!0:(l(r.get(s)??n(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,f){return R(r.get(s)??n(s,f),f),Reflect.set(a,s,f)}});A(this,m,(t.hydrate?nt:_t)(t.component,{target:t.target,anchor:t.anchor,props:u,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((E=t==null?void 0:t.props)!=null&&E.$$host)||t.sync===!1)&&U(),A(this,d,u.$$events);for(const a of Object.keys(i(this,m)))a==="$set"||a==="$destroy"||a==="$on"||W(this,a,{get(){return i(this,m)[a]},set(s){i(this,m)[a]=s},enumerable:!0});i(this,m).$set=a=>{Object.assign(u,a)},i(this,m).$destroy=()=>{mt(i(this,m))}}$set(t){i(this,m).$set(t)}$on(t,r){i(this,d)[t]=i(this,d)[t]||[];const n=(...u)=>r.call(this,...u);return i(this,d)[t].push(n),()=>{i(this,d)[t]=i(this,d)[t].filter(u=>u!==n)}}$destroy(){i(this,m).$destroy()}}d=new WeakMap,m=new WeakMap;const Dt={};var vt=M('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),ht=M("<!> <!>",1);function gt(e,t){Z(t,!0);let r=D(t,"components",23,()=>[]),n=D(t,"data_0",3,null),u=D(t,"data_1",3,null);$(()=>t.stores.page.set(t.page)),tt(()=>{t.stores,t.page,t.constructors,r(),t.form,n(),u(),t.stores.page.notify()});let E=V(!1),a=V(!1),s=V(null);lt(()=>{const _=t.stores.page.subscribe(()=>{l(E)&&(R(a,!0),et().then(()=>{R(s,document.title||"untitled page",!0)}))});return R(E,!0),_});const f=x(()=>t.constructors[1]);var j=ht(),C=y(j);{var H=_=>{const v=x(()=>t.constructors[0]);var h=w(),P=y(h);I(P,()=>l(v),(g,p)=>{T(p(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(c,pt)=>{var S=w(),F=y(S);I(F,()=>l(f),(J,K)=>{T(K(J,{get data(){return u()},get form(){return t.form},get params(){return t.page.params}}),O=>r()[1]=O,()=>{var O;return(O=r())==null?void 0:O[1]})}),b(c,S)},$$slots:{default:!0}}),c=>r()[0]=c,()=>{var c;return(c=r())==null?void 0:c[0]})}),b(_,h)},N=_=>{const v=x(()=>t.constructors[0]);var h=w(),P=y(h);I(P,()=>l(v),(g,p)=>{T(p(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),c=>r()[0]=c,()=>{var c;return(c=r())==null?void 0:c[0]})}),b(_,h)};k(C,_=>{t.constructors[1]?_(H):_(N,-1)})}var Y=rt(C,2);{var B=_=>{var v=vt(),h=st(v);{var P=g=>{var p=ct();it(()=>ut(p,l(s))),b(g,p)};k(h,g=>{l(a)&&g(P)})}ot(v),b(_,v)};k(Y,_=>{l(E)&&_(B)})}b(e,j),at()}const It=dt(gt),Tt=[()=>o(()=>import("../nodes/0.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.Bn0HCj5G.js","../chunks/Bzak7iHL.js","../chunks/CGFL56WJ.js","../chunks/DIeogL5L.js","../chunks/nuKvOE41.js","../chunks/xVmvYz1F.js","../chunks/DCJ0QyYH.js","../chunks/CN4cKZHK.js","../chunks/Btd6PFkC.js","../chunks/BRBZjpE2.js","../assets/link-2.RXcH7ryE.css","../chunks/Br0XzNbS.js","../chunks/BdKYr7lO.js","../chunks/BT_NlJ9b.js","../chunks/69_IOA4Y.js","../assets/Workspace.DM2E1WiF.css","../assets/0.TxVXAdoK.css","../nodes/1.C2fTzfSV.js","../nodes/2.CAG5_cGP.js","../nodes/3.CAG5_cGP.js","../nodes/4.CAG5_cGP.js","../nodes/5.CAG5_cGP.js","../nodes/6.CAG5_cGP.js","../nodes/7.CAG5_cGP.js","../nodes/8.CAG5_cGP.js","../nodes/9.CAG5_cGP.js","../nodes/10.C6p9_zpN.js","../chunks/BgOTHNR5.js","../nodes/11.CAG5_cGP.js","../nodes/12.B0WbW-6G.js","../nodes/13.CAG5_cGP.js","../nodes/14.CAG5_cGP.js","../nodes/15.CZkgDcbY.js","../assets/15.Dblyk0Kr.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var q=e=>{throw TypeError(e)};var G=(e,t,r)=>t.has(e)||q("Cannot "+r);var i=(e,t,r)=>(G(e,t,"read from private field"),r?r.call(e):t.get(e)),L=(e,t,r)=>t.has(e)?q("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),A=(e,t,r,n)=>(G(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);import{p as D,c as I,b as T,_ as o}from"../chunks/CN4cKZHK.js";import{bm as R,L as Q,at as l,as as U,af as W,b0 as X,b9 as Z,bP as $,bO as tt,bH as et,aq as y,bw as rt,b6 as at,bz as V,a6 as st,bg as ot,bG as it,bN as x}from"../chunks/CGFL56WJ.js";import{m as nt,p as _t,y as mt,a as b,e as w,k as M,x as ct,v as ut}from"../chunks/nuKvOE41.js";import"../chunks/Bzak7iHL.js";import{a as lt}from"../chunks/Btd6PFkC.js";import{i as k}from"../chunks/DCJ0QyYH.js";function dt(e){return class extends ft{constructor(t){super({component:e,...t})}}}var d,m;class ft{constructor(t){L(this,d);L(this,m);var E;var r=new Map,n=(a,s)=>{var f=X(s,!1,!1);return r.set(a,f),f};const u=new Proxy({...t.props||{},$$events:{}},{get(a,s){return l(r.get(s)??n(s,Reflect.get(a,s)))},has(a,s){return s===Q?!0:(l(r.get(s)??n(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,f){return R(r.get(s)??n(s,f),f),Reflect.set(a,s,f)}});A(this,m,(t.hydrate?nt:_t)(t.component,{target:t.target,anchor:t.anchor,props:u,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError})),(!((E=t==null?void 0:t.props)!=null&&E.$$host)||t.sync===!1)&&U(),A(this,d,u.$$events);for(const a of Object.keys(i(this,m)))a==="$set"||a==="$destroy"||a==="$on"||W(this,a,{get(){return i(this,m)[a]},set(s){i(this,m)[a]=s},enumerable:!0});i(this,m).$set=a=>{Object.assign(u,a)},i(this,m).$destroy=()=>{mt(i(this,m))}}$set(t){i(this,m).$set(t)}$on(t,r){i(this,d)[t]=i(this,d)[t]||[];const n=(...u)=>r.call(this,...u);return i(this,d)[t].push(n),()=>{i(this,d)[t]=i(this,d)[t].filter(u=>u!==n)}}$destroy(){i(this,m).$destroy()}}d=new WeakMap,m=new WeakMap;const Dt={};var vt=M('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),ht=M("<!> <!>",1);function gt(e,t){Z(t,!0);let r=D(t,"components",23,()=>[]),n=D(t,"data_0",3,null),u=D(t,"data_1",3,null);$(()=>t.stores.page.set(t.page)),tt(()=>{t.stores,t.page,t.constructors,r(),t.form,n(),u(),t.stores.page.notify()});let E=V(!1),a=V(!1),s=V(null);lt(()=>{const _=t.stores.page.subscribe(()=>{l(E)&&(R(a,!0),et().then(()=>{R(s,document.title||"untitled page",!0)}))});return R(E,!0),_});const f=x(()=>t.constructors[1]);var j=ht(),C=y(j);{var H=_=>{const v=x(()=>t.constructors[0]);var h=w(),P=y(h);I(P,()=>l(v),(g,p)=>{T(p(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(c,pt)=>{var S=w(),F=y(S);I(F,()=>l(f),(J,K)=>{T(K(J,{get data(){return u()},get form(){return t.form},get params(){return t.page.params}}),O=>r()[1]=O,()=>{var O;return(O=r())==null?void 0:O[1]})}),b(c,S)},$$slots:{default:!0}}),c=>r()[0]=c,()=>{var c;return(c=r())==null?void 0:c[0]})}),b(_,h)},N=_=>{const v=x(()=>t.constructors[0]);var h=w(),P=y(h);I(P,()=>l(v),(g,p)=>{T(p(g,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),c=>r()[0]=c,()=>{var c;return(c=r())==null?void 0:c[0]})}),b(_,h)};k(C,_=>{t.constructors[1]?_(H):_(N,-1)})}var Y=rt(C,2);{var B=_=>{var v=vt(),h=st(v);{var P=g=>{var p=ct();it(()=>ut(p,l(s))),b(g,p)};k(h,g=>{l(a)&&g(P)})}ot(v),b(_,v)};k(Y,_=>{l(E)&&_(B)})}b(e,j),at()}const It=dt(gt),Tt=[()=>o(()=>import("../nodes/0.Bn0HCj5G.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url),()=>o(()=>import("../nodes/1.C2fTzfSV.js"),__vite__mapDeps([17,1,2,3,4,12,11,8]),import.meta.url),()=>o(()=>import("../nodes/2.CAG5_cGP.js"),__vite__mapDeps([18,1,14,3]),import.meta.url),()=>o(()=>import("../nodes/3.CAG5_cGP.js"),__vite__mapDeps([19,1,14,3]),import.meta.url),()=>o(()=>import("../nodes/4.CAG5_cGP.js"),__vite__mapDeps([20,1,14,3]),import.meta.url),()=>o(()=>import("../nodes/5.CAG5_cGP.js"),__vite__mapDeps([21,1,14,3]),import.meta.url),()=>o(()=>import("../nodes/6.CAG5_cGP.js"),__vite__mapDeps([22,1,14,3]),import.meta.url),()=>o(()=>import("../nodes/7.CAG5_cGP.js"),__vite__mapDeps([23,1,14,3]),import.meta.url),()=>o(()=>import("../nodes/8.CAG5_cGP.js"),__vite__mapDeps([24,1,14,3]),import.meta.url),()=>o(()=>import("../nodes/9.CAG5_cGP.js"),__vite__mapDeps([25,1,14,3]),import.meta.url),()=>o(()=>import("../nodes/10.C6p9_zpN.js"),__vite__mapDeps([26,1,8,2,3,4,6,5,7,9,10,27,12,11]),import.meta.url),()=>o(()=>import("../nodes/11.CAG5_cGP.js"),__vite__mapDeps([28,1,14,3]),import.meta.url),()=>o(()=>import("../nodes/12.B0WbW-6G.js"),__vite__mapDeps([29,1,2,3,4,6,27,9]),import.meta.url),()=>o(()=>import("../nodes/13.CAG5_cGP.js"),__vite__mapDeps([30,1,14,3]),import.meta.url),()=>o(()=>import("../nodes/14.CAG5_cGP.js"),__vite__mapDeps([31,1,14,3]),import.meta.url),()=>o(()=>import("../nodes/15.CZkgDcbY.js"),__vite__mapDeps([32,1,14,3,8,2,4,27,7,6,13,9,5,10,15,33]),import.meta.url)],Vt=[],xt={"/":[2],"/analytics":[3],"/appearance":[4],"/ask":[5],"/cluster":[8],"/collections":[9],"/c/[collection]":[6],"/c/[collection]/p/[subpage]":[7],"/graph":[10],"/query":[11],"/redwire-ws-spike":[12],"/security":[13],"/settings":[14],"/shadow-dom-spike":[15]},z={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},Et=Object.fromEntries(Object.entries(z.transport).map(([e,t])=>[e,t.decode])),wt=Object.fromEntries(Object.entries(z.transport).map(([e,t])=>[e,t.encode])),kt=!1,jt=(e,t)=>Et[e](t);export{jt as decode,Et as decoders,xt as dictionary,wt as encoders,kt as hash,z as hooks,Dt as matchers,Tt as nodes,It as root,Vt as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o,s as r}from"../chunks/Br0XzNbS.js";export{o as load_css,r as start};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../chunks/Bzak7iHL.js";import{aq as w,b3 as T,a6 as c,b2 as K,bg as d,bw as b,at as s,bG as j,bN as _,b9 as Q,b6 as U}from"../chunks/CGFL56WJ.js";import{h as V,e as y,c as X,a as p,v as M,i as P,k as q}from"../chunks/nuKvOE41.js";import{D as B,f as C}from"../chunks/
|
|
1
|
+
import"../chunks/Bzak7iHL.js";import{aq as w,b3 as T,a6 as c,b2 as K,bg as d,bw as b,at as s,bG as j,bN as _,b9 as Q,b6 as U}from"../chunks/CGFL56WJ.js";import{h as V,e as y,c as X,a as p,v as M,i as P,k as q}from"../chunks/nuKvOE41.js";import{D as B,f as C}from"../chunks/xVmvYz1F.js";import{i as G}from"../chunks/DCJ0QyYH.js";import{g as Z,b as v}from"../chunks/Br0XzNbS.js";import{p as z}from"../chunks/BdKYr7lO.js";import{R as $,t as D,p as ee,W as te}from"../chunks/BT_NlJ9b.js";const re="auto",ae=!1,oe="never",be=Object.freeze(Object.defineProperty({__proto__:null,prerender:re,ssr:ae,trailingSlash:oe},Symbol.toStringTag,{value:"Module"}));var ne=q('<pre class="m-0 max-h-52 w-full max-w-2xl overflow-auto rounded-lg border border-line-1 bg-bg-1 p-3 text-left font-mono text-[11px] leading-relaxed text-fg-3"> </pre>'),se=q(`<div role="alert" class="flex h-full w-full flex-col items-center justify-center gap-5 overflow-auto bg-bg-0 px-6 py-10 text-center"><div class="flex flex-col items-center gap-2"><!> <h1 class="type-h2 m-0 text-fg-0">Something crashed while rendering</h1> <p class="m-0 max-w-lg text-[13px] leading-relaxed text-fg-2">The workspace hit an unexpected error. Your connection is untouched —
|
|
2
2
|
retry the render, or reload the window to start clean.</p></div> <p class="m-0 max-w-lg break-words font-mono text-[12px] text-primary-text"> </p> <!> <div class="flex items-center gap-2"><button type="button" class="inline-flex h-9 items-center gap-1.5 rounded-lg bg-accent px-3 text-[12px] font-medium text-white hover:bg-accent/90"><!> Retry render</button> <button type="button" class="inline-flex h-9 items-center gap-1.5 rounded-lg border border-line-1 bg-bg-1 px-3 text-[12px] font-medium text-fg-1 hover:bg-bg-2"><!> Reload window</button></div></div>`);function ie(e,a){function o(){typeof window<"u"&&window.location.reload()}function i(r){return r instanceof Error?r.message||r.name:String(r)}function h(r){return r instanceof Error&&r.stack?r.stack:null}var g=y(),k=w(g);X(k,{failed:(m,t=T,n=T)=>{var f=se(),R=c(f),H=c(R);C(H,{class:"size-8 text-fg-3",strokeWidth:1.4}),K(4),d(R);var S=b(R,2),L=c(S,!0);d(S);var E=b(S,2);{var N=l=>{var u=ne(),I=c(u,!0);d(u),j(J=>M(I,J),[()=>h(t())]),p(l,u)},Y=_(()=>h(t()));G(E,l=>{s(Y)&&l(N)})}var O=b(E,2),x=c(O),A=c(x);C(A,{class:"size-3.5",strokeWidth:2}),K(),d(x);var W=b(x,2),F=c(W);$(F,{class:"size-3.5",strokeWidth:2}),K(),d(W),d(O),d(f),j(l=>M(L,l),[()=>i(t())]),P("click",x,function(...l){var u;(u=n())==null||u.apply(this,l)}),P("click",W,o),p(m,f)}},m=>{var t=y(),n=w(t);B(n,()=>a.children),p(m,t)}),p(e,g)}V(["click"]);function le(e){return e instanceof MouseEvent?e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey:!1}function ce(){const e=_(()=>ee(z.url.pathname.slice(v.length)||"/"));return{get view(){return s(e).view},get collection(){return s(e).collection},get subpage(){return s(e).subpage},get path(){return z.url.pathname},href:a=>v+D(a),go:(a,o,i)=>{le(o)||(o==null||o.preventDefault(),Z(v+D(a),{replaceState:i??!1}))}}}function ve(e,a){Q(a,!0);const o=ce(),i=_(()=>z.url.pathname.slice(v.length)||"/"),h=_(()=>s(i)==="/graph"||s(i)==="/shadow-dom-spike"||s(i)==="/redwire-ws-spike");var g=y(),k=w(g);{var r=t=>{var n=y(),f=w(n);B(f,()=>a.children),p(t,n)},m=t=>{ie(t,{children:(n,f)=>{te(n,{get router(){return o}})}})};G(k,t=>{s(h)?t(r):t(m,-1)})}p(e,g),U()}export{ve as component,be as universal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/Bzak7iHL.js";import{b9 as v,aq as b,bw as u,bG as c,b6 as g,a6 as s,bg as o}from"../chunks/CGFL56WJ.js";import{a as l,k as _,v as p}from"../chunks/nuKvOE41.js";import{p as m}from"../chunks/
|
|
1
|
+
import"../chunks/Bzak7iHL.js";import{b9 as v,aq as b,bw as u,bG as c,b6 as g,a6 as s,bg as o}from"../chunks/CGFL56WJ.js";import{a as l,k as _,v as p}from"../chunks/nuKvOE41.js";import{p as m}from"../chunks/BdKYr7lO.js";var x=_("<h1> </h1> <p> </p>",1);function E(i,f){v(f,!0);var a=x(),r=b(a),h=s(r,!0);o(r);var t=u(r,2),n=s(t,!0);o(t),c(()=>{var e;p(h,m.status),p(n,(e=m.error)==null?void 0:e.message)}),l(i,a),g()}export{E as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/Bzak7iHL.js";import{a as jt}from"../chunks/Btd6PFkC.js";import{b9 as Et,b6 as Gt,bm as f,al as Nt,$ as At,a6 as i,at as n,bg as s,bz as H,aq as X,bw as v,b2 as Je,bG as j,bN as re}from"../chunks/CGFL56WJ.js";import{h as Mt,a as h,k as S,v as y,i as V,j as Ft,x as ke,e as Rt}from"../chunks/nuKvOE41.js";import{i as R}from"../chunks/DCJ0QyYH.js";import{I as xe,j as Tt,F as He,f as Dt,E as Ot,c as Pt,L as Ut,u as qt,G as Bt,n as Re,t as Te}from"../chunks/RBJGFHIL.js";import{h as Jt}from"../chunks/BgOTHNR5.js";import{e as Ve,j as Ye,r as Ht,d as Vt,k as Yt}from"../chunks/BRBZjpE2.js";import{s as _e,r as he,b as Kt}from"../chunks/CN4cKZHK.js";import{p as Qt}from"../chunks/CRcUHjOC.js";const Ze={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]]};Ze.node;function Zt(e,t){let o=he(t,["$$slots","$$events","$$legacy"]);xe(e,_e(()=>o,{get icon(){return Ze}}))}const We={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]]};We.node;function Wt(e,t){let o=he(t,["$$slots","$$events","$$legacy"]);xe(e,_e(()=>o,{get icon(){return We}}))}const Xe={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6"}]]};Xe.node;function Se(e,t){let o=he(t,["$$slots","$$events","$$legacy"]);xe(e,_e(()=>o,{get icon(){return Xe}}))}const et={name:"circle-dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"12",r:"10"}]]};et.node;function Xt(e,t){let o=he(t,["$$slots","$$events","$$legacy"]);xe(e,_e(()=>o,{get icon(){return et}}))}const tt={name:"upload",size:24,node:[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]]};tt.node;function en(e,t){let o=he(t,["$$slots","$$events","$$legacy"]);xe(e,_e(()=>o,{get icon(){return tt}}))}const Le=1;class $ extends Error{constructor(t){super(t),this.name="GraphContractError"}}function ee(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Y(e,t){for(const o of t){const r=e[o];if(r!=null&&r!=="")return r}}function tn(e){const t=Y(e,["version","schema_version","schemaVersion"]);if(typeof t!="string"||t.trim()==="")throw new $(`Graph export is missing a "version" string. This viewer supports the version ${Le}.x contract.`);const o=Number.parseInt(t.split(".")[0]??"",10);if(!Number.isFinite(o))throw new $(`Graph export declares an unparseable version "${t}". This viewer supports version ${Le}.x.`);if(o!==Le)throw new $(`Unsupported graph export version "${t}". This viewer supports version ${Le}.x.`);return t}function nn(e,t){if(!ee(e))throw new $(`Graph node at index ${t} is not an object.`);const o=Y(e,["id","rid","_id","uid"]);if(o===void 0)throw new $(`Graph node at index ${t} is missing the required "id" field.`);const r=String(o),a=Y(e,["label","name","title"]),u=Y(e,["type","node_type","kind"]),m=e.community;return{id:r,label:a!==void 0?String(a):r,type:u!==void 0?String(u):void 0,community:typeof m=="number"?m:void 0,data:e}}function on(e,t){if(!ee(e))throw new $(`Graph edge at index ${t} is not an object.`);const o=Y(e,["source","from","src","start","from_rid"]);if(o===void 0)throw new $(`Graph edge at index ${t} is missing the required "source" field.`);const r=Y(e,["target","to","dst","end","to_rid"]);if(r===void 0)throw new $(`Graph edge at index ${t} is missing the required "target" field.`);const a=Y(e,["kind","type","label","rel"]),u=String(o),m=String(r),b=Y(e,["id","rid"]);return{id:b!==void 0?String(b):`${u}->${m}:${a??""}#${t}`,source:u,target:m,type:a!==void 0?String(a):void 0,data:e}}function rn(e){if(e==null)return[];if(!Array.isArray(e))throw new $('Graph export "communities" must be an array when present.');return e.map((t,o)=>{if(!ee(t))throw new $(`Community at index ${o} is not an object.`);if(typeof t.id!="number")throw new $(`Community at index ${o} is missing a numeric "id".`);const r=t.id;return{id:r,label:typeof t.label=="string"?t.label:`Community ${r}`,color:typeof t.color=="string"?t.color:Tt(r),size:typeof t.size=="number"?t.size:0}})}function an(e,t){const o={};for(const a of e)o[a.id]={...a.data,id:a.id,label:a.label,...a.type!==void 0?{node_type:a.type}:{}};const r={};for(const a of t)r[a.id]={...a.data,source:a.source,target:a.target,...a.type!==void 0?{type:a.type}:{}};return{ok:!0,query:"",capability:"graph",record_count:e.length+t.length,result:{columns:["nodes","edges"],records:[{values:{},nodes:o,edges:r}]}}}function sn(e){if(!ee(e))throw new $('Graph export must be a JSON object with "version" and graph data.');const t=ee(e.contract)?e.contract:null,o=tn(t??e),r=t??(ee(e.graph)?e.graph:e),a=r.nodes,u=r.edges;if(!Array.isArray(a))throw new $('Graph export "nodes" must be an array.');if(!Array.isArray(u))throw new $('Graph export "edges" must be an array.');const m=a.map(nn),b=u.map(on),d=rn(e.communities??r.communities);return{version:o,model:{nodes:m,edges:b,communities:d},result:an(m,b),meta:ee(e.meta)?e.meta:{}}}function nt(e){let t;try{t=JSON.parse(e)}catch(o){const r=o instanceof Error?o.message:String(o);throw new $(`Graph export is not valid JSON: ${r}`)}return sn(t)}async function ln(e,t={}){const o=t.fetch??globalThis.fetch;if(typeof o!="function")throw new $("No fetch implementation available to load the graph.");let r;try{r=await o(e)}catch(u){const m=u instanceof Error?u.message:String(u);throw new $(`Failed to fetch graph from "${e}": ${m}`)}if(!r.ok)throw new $(`Failed to load graph from "${e}": HTTP ${r.status} ${r.statusText}`.trim());const a=await r.text();return nt(a)}const cn=["layer","layer_name","layerName","layer_id","layerId","domain","namespace"],dn=["community","community_name","communityName","community_id","communityId"],pn=["component","component_name","componentName","component_id","componentId","package","module","service","collection","file","path"],ot={id:"unassigned",label:"Unassigned",color:"#94a3b8"},un=/^(#[0-9a-f]{3,8}|rgba?\([\d\s.,%+-]+\)|hsla?\([\d\s.,%+-]+\)|oklch\([\d\s.%+-]+(?:\/\s*[\d.]+%?)?\))$/i;function vn(e){const t=e.trim();return un.test(t)?t:ot.color}function be(e,t){for(const o of t){const r=e[o];if(!(r==null||r==="")&&(typeof r=="string"||typeof r=="number"))return String(r)}return null}function ze(e,t){return`${e}:${t.toLowerCase().replace(/[^a-z0-9._:/-]+/g,"-")}`}function fn(e){return new Map(e.communities.map(t=>[t.id,{label:t.label,color:vn(t.color)}]))}function mn(e,t){const o=be(e.data,cn);if(o)return{id:ze("layer",o),label:o,color:"#94a3b8"};if(typeof e.community=="number"){const a=t.get(e.community);return{id:`community:${e.community}`,label:(a==null?void 0:a.label)??`Community ${e.community}`,color:(a==null?void 0:a.color)??"#94a3b8"}}const r=be(e.data,dn);return r?{id:ze("community",r),label:r,color:"#94a3b8"}:ot}function gn(e){const t=be(e.data,pn);if(t)return{id:ze("component",t),label:t};const o=e.type??be(e.data,["node_type","kind"]);return o?{id:ze("type",o),label:`${o} nodes`}:{id:"component:unassigned",label:"Unassigned"}}function Ke(e,t){let o=0,r=0,a=0;for(const u of t){const m=e.has(u.source),b=e.has(u.target);!m&&!b||(o+=1,m&&b?r+=1:a+=1)}return{connectionCount:o,internalConnectionCount:r,externalConnectionCount:a}}function bn(e,t){let o=0,r=0;for(const a of t)a.source===e.id&&(r+=1),a.target===e.id&&(o+=1);return{id:e.id,label:e.label,type:e.type??be(e.data,["node_type","kind"])??"node",degree:o+r,incoming:o,outgoing:r}}function Qe(e,t){const o=t.nodeCount-e.nodeCount;if(o!==0)return o;const r=t.connectionCount-e.connectionCount;if(r!==0)return r;const a=e.label.localeCompare(t.label);return a!==0?a:e.id.localeCompare(t.id)}function xn(e){const t=fn(e),o=new Map;for(const a of e.nodes){const u=mn(a,t),m=o.get(u.id);m?m.nodes.push(a):o.set(u.id,{...u,nodes:[a]})}return{layers:[...o.values()].map(a=>{const u=a.nodes.map(w=>w.id),m=new Set(u),b=Ke(m,e.edges),d=new Map;for(const w of a.nodes){const _=gn(w),C=d.get(_.id);C?C.nodes.push(w):d.set(_.id,{..._,nodes:[w]})}const O=[...d.values()].map(w=>{const _=w.nodes.map(P=>P.id),C=Ke(new Set(_),e.edges);return{id:w.id,label:w.label,nodeCount:w.nodes.length,nodeIds:_,nodes:w.nodes.map(P=>bn(P,e.edges)).sort((P,ae)=>ae.degree-P.degree||P.label.localeCompare(ae.label)),...C}}).sort(Qe);return{id:a.id,label:a.label,color:a.color,nodeCount:a.nodes.length,componentCount:O.length,nodeIds:u,components:O,...b}}).sort(Qe)}}function _n(e,t){const o=t===null?null:new Set(t),r=o?e.nodes.filter(d=>o.has(d.id)):e.nodes,a=new Set(r.map(d=>d.id)),u=e.edges.filter(d=>a.has(d.source)&&a.has(d.target)),m={};for(const d of r)m[d.id]={...d.data,id:d.id,label:d.label,...d.type!==void 0?{node_type:d.type}:{}};const b={};for(const d of u)b[d.id]={...d.data,source:d.source,target:d.target,...d.type!==void 0?{type:d.type}:{}};return{ok:!0,query:"",capability:"graph",record_count:r.length+u.length,result:{columns:["nodes","edges"],records:[{values:{},nodes:m,edges:b}]}}}var hn=S('<button type="button" aria-label="Back" class="inline-flex size-6 items-center justify-center rounded border border-line-1 text-fg-3 hover:border-line-2 hover:text-fg-1"><!></button>'),yn=S('<span class="inline-flex size-6 items-center justify-center rounded border border-line-1 text-fg-3"><!></span>'),$n=S('<!> <button type="button"> </button>',1),wn=S('<!> <span class="truncate rounded bg-bg-2 px-1.5 py-0.5 text-fg-0"> </span>',1),Cn=S('<button type="button" class="w-full px-3 py-2.5 text-left hover:bg-bg-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40"><div class="flex items-start gap-2.5"><span class="mt-1.5 size-2 rounded-full shrink-0"></span> <span class="min-w-0 flex-1"><span class="flex items-center gap-2"><span class="truncate text-[13px] font-medium text-fg-0"> </span> <span class="font-mono text-[10px] text-fg-3"> </span></span> <span class="mt-1 block font-mono text-[11px] text-fg-3"> </span></span> <!></div></button>'),kn=S('<div class="px-3 py-2 text-[11px] font-mono text-fg-3 border-b border-line-1"> </div> <div class="divide-y divide-line-1"></div>',1),Sn=S('<button type="button" class="w-full px-3 py-2.5 text-left hover:bg-bg-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40"><div class="flex items-start gap-2.5"><span class="mt-1 text-fg-3"><!></span> <span class="min-w-0 flex-1"><span class="block truncate text-[13px] font-medium text-fg-0"> </span> <span class="mt-1 block font-mono text-[11px] text-fg-3"> </span></span> <!></div></button>'),Ln=S('<div class="px-3 py-2 text-[11px] font-mono text-fg-3 border-b border-line-1"> </div> <div class="divide-y divide-line-1"></div>',1),zn=S('<div class="px-3 py-2.5"><div class="flex items-start gap-2.5"><span class="mt-1 text-fg-3"><!></span> <span class="min-w-0 flex-1"><span class="block truncate text-[13px] font-medium text-fg-0"> </span> <span class="mt-1 block truncate font-mono text-[11px] text-fg-3"> </span></span></div></div>'),In=S('<div class="px-3 py-2 text-[11px] font-mono text-fg-3 border-b border-line-1"> </div> <div class="divide-y divide-line-1"></div>',1),jn=S('<div class="flex-1 min-h-0 overflow-auto"><!></div>'),En=S('<div class="flex items-center justify-between gap-4 px-3 py-2 border-b border-line-1 bg-bg-1 shrink-0"><span class="flex items-center gap-2 min-w-0 text-fg-2 text-[13px]"><!> <span class="font-mono text-fg-1 truncate max-w-[38vw]"> </span> <span class="text-fg-3 whitespace-nowrap"> <!></span></span> <button type="button" class="flex items-center gap-1.5 px-3 py-1.5 rounded-md border border-line-1 text-fg-2 text-[12px] hover:border-fg-3 hover:text-fg-1"><!> Load another</button></div> <div class="flex-1 min-h-0 flex"><aside class="w-[min(320px,48vw)] shrink-0 border-r border-line-1 bg-bg-1/80 flex flex-col min-h-0"><div class="px-3 py-2 border-b border-line-1"><div class="flex items-center gap-2 text-fg-1"><!> <div class="min-w-0"><div class="type-label"><!></div> <div class="truncate text-[12px] font-medium text-fg-0"> </div></div></div> <nav class="mt-2 flex min-w-0 items-center gap-1 text-[11px] font-mono text-fg-3"><button type="button">overview</button> <!> <!></nav></div> <!></aside> <div class="flex-1 min-w-0"><!></div></div>',1),Gn=S('<p class="m-0 px-3 py-2 rounded-md text-primary-text text-[12px] leading-relaxed border border-accent/35 bg-accent/10"> </p>'),Nn=S('<div class="flex flex-col gap-3 w-[min(34rem,90vw)] text-left"><form class="flex gap-2"><div class="relative flex-1 flex items-center"><!> <input class="w-full pl-8 pr-2.5 py-2 bg-bg-2 border border-line-1 rounded-md text-fg-1 text-[13px] font-mono focus:outline-none focus:border-accent" type="text" placeholder="https://host/graph.json or /exports/memory.json" spellcheck="false" autocapitalize="off" autocorrect="off"/></div> <button class="px-4 py-2 bg-primary text-on-primary rounded-md text-[13px] font-medium whitespace-nowrap disabled:opacity-50" type="submit"> </button></form> <div class="flex items-center gap-2 text-fg-3 text-[11px] uppercase tracking-wide"><span class="flex-1 h-px bg-line-1"></span> or <span class="flex-1 h-px bg-line-1"></span></div> <button type="button" class="flex items-center justify-center gap-2 px-3 py-2 bg-bg-2 border border-line-1 rounded-md text-fg-1 text-[13px] hover:border-fg-3 disabled:opacity-50"><!> Choose a local graph.json</button> <input type="file" accept="application/json,.json" class="hidden"/> <!></div>'),An=S('<div class="flex items-center justify-center h-full w-full p-8"><!></div>'),Mn=S('<div class="flex h-screen w-full flex-col"><!></div>');function Hn(e,t){Et(t,!0);let o=H(null),r=H(!1),a=H(null),u=H(null),m=H(null),b=H(null),d=H(""),O=H(null);const w=re(()=>n(o)?xn(n(o).model):null),_=re(()=>{var c;return n(m)?(c=n(w))==null?void 0:c.layers.find(g=>g.id===n(m)):void 0}),C=re(()=>{var c;return n(b)?(c=n(_))==null?void 0:c.components.find(g=>g.id===n(b)):void 0}),P=re(()=>n(C)?n(C).nodeIds:n(_)?n(_).nodeIds:null),ae=re(()=>n(o)?_n(n(o).model,n(P)):null),rt=re(()=>`${n(u)??"graph"}:${n(m)??"overview"}:${n(b)??"all"}`);async function De(c){const g=c.trim();if(g){f(r,!0),f(a,null);try{f(o,await ln(g,{fetch}),!0),f(u,g,!0),ye()}catch(I){f(o,null),f(a,I instanceof Error?I.message:String(I),!0)}finally{f(r,!1)}}}async function at(c){f(r,!0),f(a,null);try{f(o,nt(await c.text()),!0),f(u,c.name,!0),ye()}catch(g){f(o,null),f(a,g instanceof Error?g.message:String(g),!0)}finally{f(r,!1)}}function st(c){c.preventDefault(),De(n(d))}function it(c){var I;const g=(I=c.target.files)==null?void 0:I[0];g&&at(g)}function lt(){f(o,null),f(a,null),f(u,null),f(d,""),ye(),n(O)&&(n(O).value="")}function ye(){f(m,null),f(b,null)}function ct(c){f(m,c.id,!0),f(b,null)}function dt(c){f(b,c.id,!0)}function pt(){if(n(b)){f(b,null);return}f(m,null)}function T(c,g){return`${c.toLocaleString()} ${g}${c===1?"":"s"}`}function Ie(c){const g=T(c.connectionCount,"connection");return c.externalConnectionCount===0?g:`${g} · ${c.externalConnectionCount.toLocaleString()} external`}jt(()=>{const c=Qt.url.searchParams.get("src");c&&(f(d,c,!0),De(c))});var je=Mn();Jt("315y67",c=>{Nt(()=>{At.title="Load graph · red-ui"})});var ut=i(je);{var vt=c=>{var g=En(),I=X(g),$e=i(I),we=i($e);He(we,{size:14});var K=v(we,2),te=i(K,!0);s(K);var ne=v(K,2),se=i(ne),ie=v(se);{var le=l=>{var p=ke();j(()=>y(p,`· ${n(o).model.communities.length??""} communities`)),h(l,p)};R(ie,l=>{n(o).model.communities.length&&l(le)})}s(ne),s($e);var ce=v($e,2),Q=i(ce);Dt(Q,{size:13}),Je(),s(ce),s(I);var Ce=v(I,2),Z=i(Ce),de=i(Z),pe=i(de),L=i(pe);{var ue=l=>{var p=hn(),k=i(p);Zt(k,{size:13}),s(p),V("click",p,pt),h(l,p)},Ee=l=>{var p=yn(),k=i(p);Ut(k,{size:13}),s(p),h(l,p)};R(L,l=>{n(_)?l(ue):l(Ee,-1)})}var Oe=v(L,2),Ge=i(Oe),mt=i(Ge);{var gt=l=>{var p=ke("nodes");h(l,p)},bt=l=>{var p=ke("components");h(l,p)},xt=l=>{var p=ke("overview");h(l,p)};R(mt,l=>{n(C)?l(gt):n(_)?l(bt,1):l(xt,-1)})}s(Ge);var Pe=v(Ge,2),_t=i(Pe,!0);s(Pe),s(Oe),s(pe);var Ue=v(pe,2),Ne=i(Ue),qe=v(Ne,2);{var ht=l=>{var p=$n(),k=X(p);Se(k,{size:12,class:"shrink-0"});var E=v(k,2),ve=i(E,!0);s(E),j(Ae=>{Ye(E,1,Ae),y(ve,n(_).label)},[()=>Ve(["truncate rounded px-1.5 py-0.5 hover:bg-bg-2 hover:text-fg-1",n(_)&&!n(C)?"text-fg-0 bg-bg-2":""].join(" "))]),V("click",E,()=>f(b,null)),h(l,p)};R(qe,l=>{n(_)&&l(ht)})}var yt=v(qe,2);{var $t=l=>{var p=wn(),k=X(p);Se(k,{size:12,class:"shrink-0"});var E=v(k,2),ve=i(E,!0);s(E),j(()=>y(ve,n(C).label)),h(l,p)};R(yt,l=>{n(C)&&l($t)})}s(Ue),s(de);var wt=v(de,2);{var Ct=l=>{var p=jn(),k=i(p);{var E=D=>{var U=kn(),G=X(U),fe=i(G);s(G);var q=v(G,2);Re(q,21,()=>n(w).layers,Te,(N,x)=>{var z=Cn(),B=i(z),M=i(B),W=v(M,2),F=i(W),A=i(F),me=i(A,!0);s(A);var J=v(A,2),ge=i(J,!0);s(J),s(F);var oe=v(F,2),Me=i(oe);s(oe),s(W);var Fe=v(W,2);Se(Fe,{size:14,class:"mt-1 shrink-0 text-fg-3"}),s(B),s(z),j((Lt,zt,It)=>{Yt(M,`background:${n(x).color};box-shadow:0 0 8px ${n(x).color}`),y(me,n(x).label),y(ge,Lt),y(Me,`${zt??""} · ${It??""}`)},[()=>T(n(x).componentCount,"component"),()=>T(n(x).nodeCount,"node"),()=>Ie(n(x))]),V("click",z,()=>ct(n(x))),h(N,z)}),s(q),j((N,x)=>y(fe,`${N??""} · ${x??""}`),[()=>T(n(w).layers.length,"group"),()=>T(n(o).model.nodes.length,"node")]),h(D,U)},ve=D=>{var U=Ln(),G=X(U),fe=i(G);s(G);var q=v(G,2);Re(q,21,()=>n(_).components,Te,(N,x)=>{var z=Sn(),B=i(z),M=i(B),W=i(M);Wt(W,{size:14}),s(M);var F=v(M,2),A=i(F),me=i(A,!0);s(A);var J=v(A,2),ge=i(J);s(J),s(F);var oe=v(F,2);Se(oe,{size:14,class:"mt-1 shrink-0 text-fg-3"}),s(B),s(z),j((Me,Fe)=>{y(me,n(x).label),y(ge,`${Me??""} · ${Fe??""}`)},[()=>T(n(x).nodeCount,"node"),()=>Ie(n(x))]),V("click",z,()=>dt(n(x))),h(N,z)}),s(q),j((N,x)=>y(fe,`${N??""} · ${x??""}`),[()=>T(n(_).components.length,"component"),()=>T(n(_).nodeCount,"node")]),h(D,U)},Ae=D=>{var U=In(),G=X(U),fe=i(G);s(G);var q=v(G,2);Re(q,21,()=>n(C).nodes,Te,(N,x)=>{var z=zn(),B=i(z),M=i(B),W=i(M);Xt(W,{size:13}),s(M);var F=v(M,2),A=i(F),me=i(A,!0);s(A);var J=v(A,2),ge=i(J);s(J),s(F),s(B),s(z),j(oe=>{y(me,n(x).label),y(ge,`${n(x).type??""} · degree ${oe??""} · ${n(x).id??""}`)},[()=>n(x).degree.toLocaleString()]),h(N,z)}),s(q),j((N,x)=>y(fe,`${N??""} · ${x??""}`),[()=>T(n(C).nodes.length,"node"),()=>Ie(n(C))]),h(D,U)};R(k,D=>{n(_)?n(C)?D(Ae,-1):D(ve,1):D(E)})}s(p),h(l,p)};R(wt,l=>{n(w)&&l(Ct)})}s(Z);var Be=v(Z,2),kt=i(Be);{var St=l=>{var p=Rt(),k=X(p);qt(k,()=>n(rt),E=>{Bt(E,{get result(){return n(ae)}})}),h(l,p)};R(kt,l=>{n(ae)&&l(St)})}s(Be),s(Ce),j(l=>{var p,k;y(te,n(u)),y(se,`${n(o).model.nodes.length??""} nodes · ${n(o).model.edges.length??""} edges`),y(_t,((p=n(C))==null?void 0:p.label)??((k=n(_))==null?void 0:k.label)??"Layers and communities"),Ye(Ne,1,l)},[()=>Ve(["truncate rounded px-1.5 py-0.5 hover:bg-bg-2 hover:text-fg-1",n(_)?"":"text-fg-0 bg-bg-2"].join(" "))]),V("click",ce,lt),V("click",Ne,ye),h(c,g)},ft=c=>{var g=An(),I=i(g);Ot(I,{title:"Load a graph",message:"Render any contract-conformant graph.json — memory exports, codebase graphs, or graphify output — from a URL, a path, or a local file. No connection required.",get icon(){return He},actions:we=>{var K=Nn(),te=i(K),ne=i(te),se=i(ne);Pt(se,{size:15,class:"absolute left-2.5 text-fg-3 pointer-events-none"});var ie=v(se,2);Ht(ie),s(ne);var le=v(ne,2),ce=i(le,!0);s(le),s(te);var Q=v(te,4),Ce=i(Q);en(Ce,{size:15}),Je(),s(Q);var Z=v(Q,2);Kt(Z,L=>f(O,L),()=>n(O));var de=v(Z,2);{var pe=L=>{var ue=Gn(),Ee=i(ue,!0);s(ue),j(()=>y(Ee,n(a))),h(L,ue)};R(de,L=>{n(a)&&L(pe)})}s(K),j(L=>{ie.disabled=n(r),le.disabled=L,y(ce,n(r)?"Loading…":"Load"),Q.disabled=n(r)},[()=>n(r)||!n(d).trim()]),Ft("submit",te,st),Vt(ie,()=>n(d),L=>f(d,L)),V("click",Q,()=>{var L;return(L=n(O))==null?void 0:L.click()}),V("change",Z,it),h(we,K)}}),s(g),h(c,g)};R(ut,c=>{n(o)?c(vt):c(ft,-1)})}s(je),h(e,je),Gt()}Mt(["click","change"]);export{Hn as component};
|
|
1
|
+
import"../chunks/Bzak7iHL.js";import{a as jt}from"../chunks/Btd6PFkC.js";import{b9 as Et,b6 as Gt,bm as f,al as Nt,$ as At,a6 as i,at as n,bg as s,bz as H,aq as X,bw as v,b2 as Je,bG as j,bN as re}from"../chunks/CGFL56WJ.js";import{h as Mt,a as h,k as S,v as y,i as V,j as Ft,x as ke,e as Rt}from"../chunks/nuKvOE41.js";import{i as R}from"../chunks/DCJ0QyYH.js";import{I as xe,j as Tt,F as He,f as Dt,E as Ot,c as Pt,L as Ut,u as qt,G as Bt,n as Re,t as Te}from"../chunks/xVmvYz1F.js";import{h as Jt}from"../chunks/BgOTHNR5.js";import{e as Ve,j as Ye,r as Ht,d as Vt,k as Yt}from"../chunks/BRBZjpE2.js";import{s as _e,r as he,b as Kt}from"../chunks/CN4cKZHK.js";import{p as Qt}from"../chunks/BdKYr7lO.js";const Ze={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]]};Ze.node;function Zt(e,t){let o=he(t,["$$slots","$$events","$$legacy"]);xe(e,_e(()=>o,{get icon(){return Ze}}))}const We={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}],["path",{d:"m3.3 7 8.7 5 8.7-5"}],["path",{d:"M12 22V12"}]]};We.node;function Wt(e,t){let o=he(t,["$$slots","$$events","$$legacy"]);xe(e,_e(()=>o,{get icon(){return We}}))}const Xe={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6"}]]};Xe.node;function Se(e,t){let o=he(t,["$$slots","$$events","$$legacy"]);xe(e,_e(()=>o,{get icon(){return Xe}}))}const et={name:"circle-dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"12",r:"10"}]]};et.node;function Xt(e,t){let o=he(t,["$$slots","$$events","$$legacy"]);xe(e,_e(()=>o,{get icon(){return et}}))}const tt={name:"upload",size:24,node:[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]]};tt.node;function en(e,t){let o=he(t,["$$slots","$$events","$$legacy"]);xe(e,_e(()=>o,{get icon(){return tt}}))}const Le=1;class $ extends Error{constructor(t){super(t),this.name="GraphContractError"}}function ee(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Y(e,t){for(const o of t){const r=e[o];if(r!=null&&r!=="")return r}}function tn(e){const t=Y(e,["version","schema_version","schemaVersion"]);if(typeof t!="string"||t.trim()==="")throw new $(`Graph export is missing a "version" string. This viewer supports the version ${Le}.x contract.`);const o=Number.parseInt(t.split(".")[0]??"",10);if(!Number.isFinite(o))throw new $(`Graph export declares an unparseable version "${t}". This viewer supports version ${Le}.x.`);if(o!==Le)throw new $(`Unsupported graph export version "${t}". This viewer supports version ${Le}.x.`);return t}function nn(e,t){if(!ee(e))throw new $(`Graph node at index ${t} is not an object.`);const o=Y(e,["id","rid","_id","uid"]);if(o===void 0)throw new $(`Graph node at index ${t} is missing the required "id" field.`);const r=String(o),a=Y(e,["label","name","title"]),u=Y(e,["type","node_type","kind"]),m=e.community;return{id:r,label:a!==void 0?String(a):r,type:u!==void 0?String(u):void 0,community:typeof m=="number"?m:void 0,data:e}}function on(e,t){if(!ee(e))throw new $(`Graph edge at index ${t} is not an object.`);const o=Y(e,["source","from","src","start","from_rid"]);if(o===void 0)throw new $(`Graph edge at index ${t} is missing the required "source" field.`);const r=Y(e,["target","to","dst","end","to_rid"]);if(r===void 0)throw new $(`Graph edge at index ${t} is missing the required "target" field.`);const a=Y(e,["kind","type","label","rel"]),u=String(o),m=String(r),b=Y(e,["id","rid"]);return{id:b!==void 0?String(b):`${u}->${m}:${a??""}#${t}`,source:u,target:m,type:a!==void 0?String(a):void 0,data:e}}function rn(e){if(e==null)return[];if(!Array.isArray(e))throw new $('Graph export "communities" must be an array when present.');return e.map((t,o)=>{if(!ee(t))throw new $(`Community at index ${o} is not an object.`);if(typeof t.id!="number")throw new $(`Community at index ${o} is missing a numeric "id".`);const r=t.id;return{id:r,label:typeof t.label=="string"?t.label:`Community ${r}`,color:typeof t.color=="string"?t.color:Tt(r),size:typeof t.size=="number"?t.size:0}})}function an(e,t){const o={};for(const a of e)o[a.id]={...a.data,id:a.id,label:a.label,...a.type!==void 0?{node_type:a.type}:{}};const r={};for(const a of t)r[a.id]={...a.data,source:a.source,target:a.target,...a.type!==void 0?{type:a.type}:{}};return{ok:!0,query:"",capability:"graph",record_count:e.length+t.length,result:{columns:["nodes","edges"],records:[{values:{},nodes:o,edges:r}]}}}function sn(e){if(!ee(e))throw new $('Graph export must be a JSON object with "version" and graph data.');const t=ee(e.contract)?e.contract:null,o=tn(t??e),r=t??(ee(e.graph)?e.graph:e),a=r.nodes,u=r.edges;if(!Array.isArray(a))throw new $('Graph export "nodes" must be an array.');if(!Array.isArray(u))throw new $('Graph export "edges" must be an array.');const m=a.map(nn),b=u.map(on),d=rn(e.communities??r.communities);return{version:o,model:{nodes:m,edges:b,communities:d},result:an(m,b),meta:ee(e.meta)?e.meta:{}}}function nt(e){let t;try{t=JSON.parse(e)}catch(o){const r=o instanceof Error?o.message:String(o);throw new $(`Graph export is not valid JSON: ${r}`)}return sn(t)}async function ln(e,t={}){const o=t.fetch??globalThis.fetch;if(typeof o!="function")throw new $("No fetch implementation available to load the graph.");let r;try{r=await o(e)}catch(u){const m=u instanceof Error?u.message:String(u);throw new $(`Failed to fetch graph from "${e}": ${m}`)}if(!r.ok)throw new $(`Failed to load graph from "${e}": HTTP ${r.status} ${r.statusText}`.trim());const a=await r.text();return nt(a)}const cn=["layer","layer_name","layerName","layer_id","layerId","domain","namespace"],dn=["community","community_name","communityName","community_id","communityId"],pn=["component","component_name","componentName","component_id","componentId","package","module","service","collection","file","path"],ot={id:"unassigned",label:"Unassigned",color:"#94a3b8"},un=/^(#[0-9a-f]{3,8}|rgba?\([\d\s.,%+-]+\)|hsla?\([\d\s.,%+-]+\)|oklch\([\d\s.%+-]+(?:\/\s*[\d.]+%?)?\))$/i;function vn(e){const t=e.trim();return un.test(t)?t:ot.color}function be(e,t){for(const o of t){const r=e[o];if(!(r==null||r==="")&&(typeof r=="string"||typeof r=="number"))return String(r)}return null}function ze(e,t){return`${e}:${t.toLowerCase().replace(/[^a-z0-9._:/-]+/g,"-")}`}function fn(e){return new Map(e.communities.map(t=>[t.id,{label:t.label,color:vn(t.color)}]))}function mn(e,t){const o=be(e.data,cn);if(o)return{id:ze("layer",o),label:o,color:"#94a3b8"};if(typeof e.community=="number"){const a=t.get(e.community);return{id:`community:${e.community}`,label:(a==null?void 0:a.label)??`Community ${e.community}`,color:(a==null?void 0:a.color)??"#94a3b8"}}const r=be(e.data,dn);return r?{id:ze("community",r),label:r,color:"#94a3b8"}:ot}function gn(e){const t=be(e.data,pn);if(t)return{id:ze("component",t),label:t};const o=e.type??be(e.data,["node_type","kind"]);return o?{id:ze("type",o),label:`${o} nodes`}:{id:"component:unassigned",label:"Unassigned"}}function Ke(e,t){let o=0,r=0,a=0;for(const u of t){const m=e.has(u.source),b=e.has(u.target);!m&&!b||(o+=1,m&&b?r+=1:a+=1)}return{connectionCount:o,internalConnectionCount:r,externalConnectionCount:a}}function bn(e,t){let o=0,r=0;for(const a of t)a.source===e.id&&(r+=1),a.target===e.id&&(o+=1);return{id:e.id,label:e.label,type:e.type??be(e.data,["node_type","kind"])??"node",degree:o+r,incoming:o,outgoing:r}}function Qe(e,t){const o=t.nodeCount-e.nodeCount;if(o!==0)return o;const r=t.connectionCount-e.connectionCount;if(r!==0)return r;const a=e.label.localeCompare(t.label);return a!==0?a:e.id.localeCompare(t.id)}function xn(e){const t=fn(e),o=new Map;for(const a of e.nodes){const u=mn(a,t),m=o.get(u.id);m?m.nodes.push(a):o.set(u.id,{...u,nodes:[a]})}return{layers:[...o.values()].map(a=>{const u=a.nodes.map(w=>w.id),m=new Set(u),b=Ke(m,e.edges),d=new Map;for(const w of a.nodes){const _=gn(w),C=d.get(_.id);C?C.nodes.push(w):d.set(_.id,{..._,nodes:[w]})}const O=[...d.values()].map(w=>{const _=w.nodes.map(P=>P.id),C=Ke(new Set(_),e.edges);return{id:w.id,label:w.label,nodeCount:w.nodes.length,nodeIds:_,nodes:w.nodes.map(P=>bn(P,e.edges)).sort((P,ae)=>ae.degree-P.degree||P.label.localeCompare(ae.label)),...C}}).sort(Qe);return{id:a.id,label:a.label,color:a.color,nodeCount:a.nodes.length,componentCount:O.length,nodeIds:u,components:O,...b}}).sort(Qe)}}function _n(e,t){const o=t===null?null:new Set(t),r=o?e.nodes.filter(d=>o.has(d.id)):e.nodes,a=new Set(r.map(d=>d.id)),u=e.edges.filter(d=>a.has(d.source)&&a.has(d.target)),m={};for(const d of r)m[d.id]={...d.data,id:d.id,label:d.label,...d.type!==void 0?{node_type:d.type}:{}};const b={};for(const d of u)b[d.id]={...d.data,source:d.source,target:d.target,...d.type!==void 0?{type:d.type}:{}};return{ok:!0,query:"",capability:"graph",record_count:r.length+u.length,result:{columns:["nodes","edges"],records:[{values:{},nodes:m,edges:b}]}}}var hn=S('<button type="button" aria-label="Back" class="inline-flex size-6 items-center justify-center rounded border border-line-1 text-fg-3 hover:border-line-2 hover:text-fg-1"><!></button>'),yn=S('<span class="inline-flex size-6 items-center justify-center rounded border border-line-1 text-fg-3"><!></span>'),$n=S('<!> <button type="button"> </button>',1),wn=S('<!> <span class="truncate rounded bg-bg-2 px-1.5 py-0.5 text-fg-0"> </span>',1),Cn=S('<button type="button" class="w-full px-3 py-2.5 text-left hover:bg-bg-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40"><div class="flex items-start gap-2.5"><span class="mt-1.5 size-2 rounded-full shrink-0"></span> <span class="min-w-0 flex-1"><span class="flex items-center gap-2"><span class="truncate text-[13px] font-medium text-fg-0"> </span> <span class="font-mono text-[10px] text-fg-3"> </span></span> <span class="mt-1 block font-mono text-[11px] text-fg-3"> </span></span> <!></div></button>'),kn=S('<div class="px-3 py-2 text-[11px] font-mono text-fg-3 border-b border-line-1"> </div> <div class="divide-y divide-line-1"></div>',1),Sn=S('<button type="button" class="w-full px-3 py-2.5 text-left hover:bg-bg-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40"><div class="flex items-start gap-2.5"><span class="mt-1 text-fg-3"><!></span> <span class="min-w-0 flex-1"><span class="block truncate text-[13px] font-medium text-fg-0"> </span> <span class="mt-1 block font-mono text-[11px] text-fg-3"> </span></span> <!></div></button>'),Ln=S('<div class="px-3 py-2 text-[11px] font-mono text-fg-3 border-b border-line-1"> </div> <div class="divide-y divide-line-1"></div>',1),zn=S('<div class="px-3 py-2.5"><div class="flex items-start gap-2.5"><span class="mt-1 text-fg-3"><!></span> <span class="min-w-0 flex-1"><span class="block truncate text-[13px] font-medium text-fg-0"> </span> <span class="mt-1 block truncate font-mono text-[11px] text-fg-3"> </span></span></div></div>'),In=S('<div class="px-3 py-2 text-[11px] font-mono text-fg-3 border-b border-line-1"> </div> <div class="divide-y divide-line-1"></div>',1),jn=S('<div class="flex-1 min-h-0 overflow-auto"><!></div>'),En=S('<div class="flex items-center justify-between gap-4 px-3 py-2 border-b border-line-1 bg-bg-1 shrink-0"><span class="flex items-center gap-2 min-w-0 text-fg-2 text-[13px]"><!> <span class="font-mono text-fg-1 truncate max-w-[38vw]"> </span> <span class="text-fg-3 whitespace-nowrap"> <!></span></span> <button type="button" class="flex items-center gap-1.5 px-3 py-1.5 rounded-md border border-line-1 text-fg-2 text-[12px] hover:border-fg-3 hover:text-fg-1"><!> Load another</button></div> <div class="flex-1 min-h-0 flex"><aside class="w-[min(320px,48vw)] shrink-0 border-r border-line-1 bg-bg-1/80 flex flex-col min-h-0"><div class="px-3 py-2 border-b border-line-1"><div class="flex items-center gap-2 text-fg-1"><!> <div class="min-w-0"><div class="type-label"><!></div> <div class="truncate text-[12px] font-medium text-fg-0"> </div></div></div> <nav class="mt-2 flex min-w-0 items-center gap-1 text-[11px] font-mono text-fg-3"><button type="button">overview</button> <!> <!></nav></div> <!></aside> <div class="flex-1 min-w-0"><!></div></div>',1),Gn=S('<p class="m-0 px-3 py-2 rounded-md text-primary-text text-[12px] leading-relaxed border border-accent/35 bg-accent/10"> </p>'),Nn=S('<div class="flex flex-col gap-3 w-[min(34rem,90vw)] text-left"><form class="flex gap-2"><div class="relative flex-1 flex items-center"><!> <input class="w-full pl-8 pr-2.5 py-2 bg-bg-2 border border-line-1 rounded-md text-fg-1 text-[13px] font-mono focus:outline-none focus:border-accent" type="text" placeholder="https://host/graph.json or /exports/memory.json" spellcheck="false" autocapitalize="off" autocorrect="off"/></div> <button class="px-4 py-2 bg-primary text-on-primary rounded-md text-[13px] font-medium whitespace-nowrap disabled:opacity-50" type="submit"> </button></form> <div class="flex items-center gap-2 text-fg-3 text-[11px] uppercase tracking-wide"><span class="flex-1 h-px bg-line-1"></span> or <span class="flex-1 h-px bg-line-1"></span></div> <button type="button" class="flex items-center justify-center gap-2 px-3 py-2 bg-bg-2 border border-line-1 rounded-md text-fg-1 text-[13px] hover:border-fg-3 disabled:opacity-50"><!> Choose a local graph.json</button> <input type="file" accept="application/json,.json" class="hidden"/> <!></div>'),An=S('<div class="flex items-center justify-center h-full w-full p-8"><!></div>'),Mn=S('<div class="flex h-screen w-full flex-col"><!></div>');function Hn(e,t){Et(t,!0);let o=H(null),r=H(!1),a=H(null),u=H(null),m=H(null),b=H(null),d=H(""),O=H(null);const w=re(()=>n(o)?xn(n(o).model):null),_=re(()=>{var c;return n(m)?(c=n(w))==null?void 0:c.layers.find(g=>g.id===n(m)):void 0}),C=re(()=>{var c;return n(b)?(c=n(_))==null?void 0:c.components.find(g=>g.id===n(b)):void 0}),P=re(()=>n(C)?n(C).nodeIds:n(_)?n(_).nodeIds:null),ae=re(()=>n(o)?_n(n(o).model,n(P)):null),rt=re(()=>`${n(u)??"graph"}:${n(m)??"overview"}:${n(b)??"all"}`);async function De(c){const g=c.trim();if(g){f(r,!0),f(a,null);try{f(o,await ln(g,{fetch}),!0),f(u,g,!0),ye()}catch(I){f(o,null),f(a,I instanceof Error?I.message:String(I),!0)}finally{f(r,!1)}}}async function at(c){f(r,!0),f(a,null);try{f(o,nt(await c.text()),!0),f(u,c.name,!0),ye()}catch(g){f(o,null),f(a,g instanceof Error?g.message:String(g),!0)}finally{f(r,!1)}}function st(c){c.preventDefault(),De(n(d))}function it(c){var I;const g=(I=c.target.files)==null?void 0:I[0];g&&at(g)}function lt(){f(o,null),f(a,null),f(u,null),f(d,""),ye(),n(O)&&(n(O).value="")}function ye(){f(m,null),f(b,null)}function ct(c){f(m,c.id,!0),f(b,null)}function dt(c){f(b,c.id,!0)}function pt(){if(n(b)){f(b,null);return}f(m,null)}function T(c,g){return`${c.toLocaleString()} ${g}${c===1?"":"s"}`}function Ie(c){const g=T(c.connectionCount,"connection");return c.externalConnectionCount===0?g:`${g} · ${c.externalConnectionCount.toLocaleString()} external`}jt(()=>{const c=Qt.url.searchParams.get("src");c&&(f(d,c,!0),De(c))});var je=Mn();Jt("315y67",c=>{Nt(()=>{At.title="Load graph · red-ui"})});var ut=i(je);{var vt=c=>{var g=En(),I=X(g),$e=i(I),we=i($e);He(we,{size:14});var K=v(we,2),te=i(K,!0);s(K);var ne=v(K,2),se=i(ne),ie=v(se);{var le=l=>{var p=ke();j(()=>y(p,`· ${n(o).model.communities.length??""} communities`)),h(l,p)};R(ie,l=>{n(o).model.communities.length&&l(le)})}s(ne),s($e);var ce=v($e,2),Q=i(ce);Dt(Q,{size:13}),Je(),s(ce),s(I);var Ce=v(I,2),Z=i(Ce),de=i(Z),pe=i(de),L=i(pe);{var ue=l=>{var p=hn(),k=i(p);Zt(k,{size:13}),s(p),V("click",p,pt),h(l,p)},Ee=l=>{var p=yn(),k=i(p);Ut(k,{size:13}),s(p),h(l,p)};R(L,l=>{n(_)?l(ue):l(Ee,-1)})}var Oe=v(L,2),Ge=i(Oe),mt=i(Ge);{var gt=l=>{var p=ke("nodes");h(l,p)},bt=l=>{var p=ke("components");h(l,p)},xt=l=>{var p=ke("overview");h(l,p)};R(mt,l=>{n(C)?l(gt):n(_)?l(bt,1):l(xt,-1)})}s(Ge);var Pe=v(Ge,2),_t=i(Pe,!0);s(Pe),s(Oe),s(pe);var Ue=v(pe,2),Ne=i(Ue),qe=v(Ne,2);{var ht=l=>{var p=$n(),k=X(p);Se(k,{size:12,class:"shrink-0"});var E=v(k,2),ve=i(E,!0);s(E),j(Ae=>{Ye(E,1,Ae),y(ve,n(_).label)},[()=>Ve(["truncate rounded px-1.5 py-0.5 hover:bg-bg-2 hover:text-fg-1",n(_)&&!n(C)?"text-fg-0 bg-bg-2":""].join(" "))]),V("click",E,()=>f(b,null)),h(l,p)};R(qe,l=>{n(_)&&l(ht)})}var yt=v(qe,2);{var $t=l=>{var p=wn(),k=X(p);Se(k,{size:12,class:"shrink-0"});var E=v(k,2),ve=i(E,!0);s(E),j(()=>y(ve,n(C).label)),h(l,p)};R(yt,l=>{n(C)&&l($t)})}s(Ue),s(de);var wt=v(de,2);{var Ct=l=>{var p=jn(),k=i(p);{var E=D=>{var U=kn(),G=X(U),fe=i(G);s(G);var q=v(G,2);Re(q,21,()=>n(w).layers,Te,(N,x)=>{var z=Cn(),B=i(z),M=i(B),W=v(M,2),F=i(W),A=i(F),me=i(A,!0);s(A);var J=v(A,2),ge=i(J,!0);s(J),s(F);var oe=v(F,2),Me=i(oe);s(oe),s(W);var Fe=v(W,2);Se(Fe,{size:14,class:"mt-1 shrink-0 text-fg-3"}),s(B),s(z),j((Lt,zt,It)=>{Yt(M,`background:${n(x).color};box-shadow:0 0 8px ${n(x).color}`),y(me,n(x).label),y(ge,Lt),y(Me,`${zt??""} · ${It??""}`)},[()=>T(n(x).componentCount,"component"),()=>T(n(x).nodeCount,"node"),()=>Ie(n(x))]),V("click",z,()=>ct(n(x))),h(N,z)}),s(q),j((N,x)=>y(fe,`${N??""} · ${x??""}`),[()=>T(n(w).layers.length,"group"),()=>T(n(o).model.nodes.length,"node")]),h(D,U)},ve=D=>{var U=Ln(),G=X(U),fe=i(G);s(G);var q=v(G,2);Re(q,21,()=>n(_).components,Te,(N,x)=>{var z=Sn(),B=i(z),M=i(B),W=i(M);Wt(W,{size:14}),s(M);var F=v(M,2),A=i(F),me=i(A,!0);s(A);var J=v(A,2),ge=i(J);s(J),s(F);var oe=v(F,2);Se(oe,{size:14,class:"mt-1 shrink-0 text-fg-3"}),s(B),s(z),j((Me,Fe)=>{y(me,n(x).label),y(ge,`${Me??""} · ${Fe??""}`)},[()=>T(n(x).nodeCount,"node"),()=>Ie(n(x))]),V("click",z,()=>dt(n(x))),h(N,z)}),s(q),j((N,x)=>y(fe,`${N??""} · ${x??""}`),[()=>T(n(_).components.length,"component"),()=>T(n(_).nodeCount,"node")]),h(D,U)},Ae=D=>{var U=In(),G=X(U),fe=i(G);s(G);var q=v(G,2);Re(q,21,()=>n(C).nodes,Te,(N,x)=>{var z=zn(),B=i(z),M=i(B),W=i(M);Xt(W,{size:13}),s(M);var F=v(M,2),A=i(F),me=i(A,!0);s(A);var J=v(A,2),ge=i(J);s(J),s(F),s(B),s(z),j(oe=>{y(me,n(x).label),y(ge,`${n(x).type??""} · degree ${oe??""} · ${n(x).id??""}`)},[()=>n(x).degree.toLocaleString()]),h(N,z)}),s(q),j((N,x)=>y(fe,`${N??""} · ${x??""}`),[()=>T(n(C).nodes.length,"node"),()=>Ie(n(C))]),h(D,U)};R(k,D=>{n(_)?n(C)?D(Ae,-1):D(ve,1):D(E)})}s(p),h(l,p)};R(wt,l=>{n(w)&&l(Ct)})}s(Z);var Be=v(Z,2),kt=i(Be);{var St=l=>{var p=Rt(),k=X(p);qt(k,()=>n(rt),E=>{Bt(E,{get result(){return n(ae)}})}),h(l,p)};R(kt,l=>{n(ae)&&l(St)})}s(Be),s(Ce),j(l=>{var p,k;y(te,n(u)),y(se,`${n(o).model.nodes.length??""} nodes · ${n(o).model.edges.length??""} edges`),y(_t,((p=n(C))==null?void 0:p.label)??((k=n(_))==null?void 0:k.label)??"Layers and communities"),Ye(Ne,1,l)},[()=>Ve(["truncate rounded px-1.5 py-0.5 hover:bg-bg-2 hover:text-fg-1",n(_)?"":"text-fg-0 bg-bg-2"].join(" "))]),V("click",ce,lt),V("click",Ne,ye),h(c,g)},ft=c=>{var g=An(),I=i(g);Ot(I,{title:"Load a graph",message:"Render any contract-conformant graph.json — memory exports, codebase graphs, or graphify output — from a URL, a path, or a local file. No connection required.",get icon(){return He},actions:we=>{var K=Nn(),te=i(K),ne=i(te),se=i(ne);Pt(se,{size:15,class:"absolute left-2.5 text-fg-3 pointer-events-none"});var ie=v(se,2);Ht(ie),s(ne);var le=v(ne,2),ce=i(le,!0);s(le),s(te);var Q=v(te,4),Ce=i(Q);en(Ce,{size:15}),Je(),s(Q);var Z=v(Q,2);Kt(Z,L=>f(O,L),()=>n(O));var de=v(Z,2);{var pe=L=>{var ue=Gn(),Ee=i(ue,!0);s(ue),j(()=>y(Ee,n(a))),h(L,ue)};R(de,L=>{n(a)&&L(pe)})}s(K),j(L=>{ie.disabled=n(r),le.disabled=L,y(ce,n(r)?"Loading…":"Load"),Q.disabled=n(r)},[()=>n(r)||!n(d).trim()]),Ft("submit",te,st),Vt(ie,()=>n(d),L=>f(d,L)),V("click",Q,()=>{var L;return(L=n(O))==null?void 0:L.click()}),V("change",Z,it),h(we,K)}}),s(g),h(c,g)};R(ut,c=>{n(o)?c(vt):c(ft,-1)})}s(je),h(e,je),Gt()}Mt(["click","change"]);export{Hn as component};
|