diff --git a/lightrag/api/__init__.py b/lightrag/api/__init__.py index 763b3662..4e3d1ab4 100644 --- a/lightrag/api/__init__.py +++ b/lightrag/api/__init__.py @@ -1 +1 @@ -__api_version__ = "0140" +__api_version__ = "0141" diff --git a/lightrag/api/webui/assets/index-1f7er6cN.js b/lightrag/api/webui/assets/index-DVJJypi_.js similarity index 95% rename from lightrag/api/webui/assets/index-1f7er6cN.js rename to lightrag/api/webui/assets/index-DVJJypi_.js index 99cd2c1a..777fc918 100644 --- a/lightrag/api/webui/assets/index-1f7er6cN.js +++ b/lightrag/api/webui/assets/index-DVJJypi_.js @@ -1113,7 +1113,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var xO;function Ure(){if(xO)return Jm;xO=1;var e=$f();function t(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function l(g,m){var b=m(),y=r({inst:{value:b,getSnapshot:m}}),v=y[0].inst,x=y[1];return o(function(){v.value=b,v.getSnapshot=m,u(v)&&x({inst:v})},[g,b,m]),a(function(){return u(v)&&x({inst:v}),g(function(){u(v)&&x({inst:v})})},[g]),s(b),b}function u(g){var m=g.getSnapshot;g=g.value;try{var b=m();return!n(g,b)}catch{return!0}}function d(g,m){return m()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Jm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Jm}var kO;function Gre(){return kO||(kO=1,Qm.exports=Ure()),Qm.exports}var Hre=Gre(),cc='[cmdk-group=""]',eb='[cmdk-group-items=""]',$re='[cmdk-group-heading=""]',FT='[cmdk-item=""]',TO=`${FT}:not([aria-disabled="true"])`,nk="cmdk-item-select",ui="data-value",qre=(e,t,n)=>jre(e,t,n),E5=w.createContext(void 0),au=()=>w.useContext(E5),w5=w.createContext(void 0),zT=()=>w.useContext(w5),x5=w.createContext(void 0),k5=w.forwardRef((e,t)=>{let n=Es(()=>{var j,P;return{search:"",value:(P=(j=e.value)!=null?j:e.defaultValue)!=null?P:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Es(()=>new Set),a=Es(()=>new Map),o=Es(()=>new Map),s=Es(()=>new Set),l=T5(e),{label:u,children:d,value:p,onValueChange:g,filter:m,shouldFilter:b,loop:y,disablePointerSelection:v=!1,vimBindings:x=!0,...A}=e,k=An(),R=An(),O=An(),N=w.useRef(null),C=nae();Si(()=>{if(p!==void 0){let j=p.trim();n.current.value=j,_.emit()}},[p]),Si(()=>{C(6,B)},[]);let _=w.useMemo(()=>({subscribe:j=>(s.current.add(j),()=>s.current.delete(j)),snapshot:()=>n.current,setState:(j,P,Z)=>{var Q,oe,ae;if(!Object.is(n.current[j],P)){if(n.current[j]=P,j==="search")H(),I(),C(1,U);else if(j==="value"&&(Z||C(5,B),((Q=l.current)==null?void 0:Q.value)!==void 0)){let ce=P??"";(ae=(oe=l.current).onValueChange)==null||ae.call(oe,ce);return}_.emit()}},emit:()=>{s.current.forEach(j=>j())}}),[]),M=w.useMemo(()=>({value:(j,P,Z)=>{var Q;P!==((Q=o.current.get(j))==null?void 0:Q.value)&&(o.current.set(j,{value:P,keywords:Z}),n.current.filtered.items.set(j,D(P,Z)),C(2,()=>{I(),_.emit()}))},item:(j,P)=>(r.current.add(j),P&&(a.current.has(P)?a.current.get(P).add(j):a.current.set(P,new Set([j]))),C(3,()=>{H(),I(),n.current.value||U(),_.emit()}),()=>{o.current.delete(j),r.current.delete(j),n.current.filtered.items.delete(j);let Z=W();C(4,()=>{H(),(Z==null?void 0:Z.getAttribute("id"))===j&&U(),_.emit()})}),group:j=>(a.current.has(j)||a.current.set(j,new Set),()=>{o.current.delete(j),a.current.delete(j)}),filter:()=>l.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:k,inputId:O,labelId:R,listInnerRef:N}),[]);function D(j,P){var Z,Q;let oe=(Q=(Z=l.current)==null?void 0:Z.filter)!=null?Q:qre;return j?oe(j,n.current.search,P):0}function I(){if(!n.current.search||l.current.shouldFilter===!1)return;let j=n.current.filtered.items,P=[];n.current.filtered.groups.forEach(Q=>{let oe=a.current.get(Q),ae=0;oe.forEach(ce=>{let Re=j.get(ce);ae=Math.max(Re,ae)}),P.push([Q,ae])});let Z=N.current;K().sort((Q,oe)=>{var ae,ce;let Re=Q.getAttribute("id"),ie=oe.getAttribute("id");return((ae=j.get(ie))!=null?ae:0)-((ce=j.get(Re))!=null?ce:0)}).forEach(Q=>{let oe=Q.closest(eb);oe?oe.appendChild(Q.parentElement===oe?Q:Q.closest(`${eb} > *`)):Z.appendChild(Q.parentElement===Z?Q:Q.closest(`${eb} > *`))}),P.sort((Q,oe)=>oe[1]-Q[1]).forEach(Q=>{var oe;let ae=(oe=N.current)==null?void 0:oe.querySelector(`${cc}[${ui}="${encodeURIComponent(Q[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function U(){let j=K().find(Z=>Z.getAttribute("aria-disabled")!=="true"),P=j==null?void 0:j.getAttribute(ui);_.setState("value",P||void 0)}function H(){var j,P,Z,Q;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let ae of r.current){let ce=(P=(j=o.current.get(ae))==null?void 0:j.value)!=null?P:"",Re=(Q=(Z=o.current.get(ae))==null?void 0:Z.keywords)!=null?Q:[],ie=D(ce,Re);n.current.filtered.items.set(ae,ie),ie>0&&oe++}for(let[ae,ce]of a.current)for(let Re of ce)if(n.current.filtered.items.get(Re)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=oe}function B(){var j,P,Z;let Q=W();Q&&(((j=Q.parentElement)==null?void 0:j.firstChild)===Q&&((Z=(P=Q.closest(cc))==null?void 0:P.querySelector($re))==null||Z.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function W(){var j;return(j=N.current)==null?void 0:j.querySelector(`${FT}[aria-selected="true"]`)}function K(){var j;return Array.from(((j=N.current)==null?void 0:j.querySelectorAll(TO))||[])}function G(j){let P=K()[j];P&&_.setState("value",P.getAttribute(ui))}function $(j){var P;let Z=W(),Q=K(),oe=Q.findIndex(ce=>ce===Z),ae=Q[oe+j];(P=l.current)!=null&&P.loop&&(ae=oe+j<0?Q[Q.length-1]:oe+j===Q.length?Q[0]:Q[oe+j]),ae&&_.setState("value",ae.getAttribute(ui))}function F(j){let P=W(),Z=P==null?void 0:P.closest(cc),Q;for(;Z&&!Q;)Z=j>0?eae(Z,cc):tae(Z,cc),Q=Z==null?void 0:Z.querySelector(TO);Q?_.setState("value",Q.getAttribute(ui)):$(j)}let Y=()=>G(K().length-1),L=j=>{j.preventDefault(),j.metaKey?Y():j.altKey?F(1):$(1)},V=j=>{j.preventDefault(),j.metaKey?G(0):j.altKey?F(-1):$(-1)};return w.createElement(Je.div,{ref:t,tabIndex:-1,...A,"cmdk-root":"",onKeyDown:j=>{var P;if((P=A.onKeyDown)==null||P.call(A,j),!j.defaultPrevented)switch(j.key){case"n":case"j":{x&&j.ctrlKey&&L(j);break}case"ArrowDown":{L(j);break}case"p":case"k":{x&&j.ctrlKey&&V(j);break}case"ArrowUp":{V(j);break}case"Home":{j.preventDefault(),G(0);break}case"End":{j.preventDefault(),Y();break}case"Enter":if(!j.nativeEvent.isComposing&&j.keyCode!==229){j.preventDefault();let Z=W();if(Z){let Q=new Event(nk);Z.dispatchEvent(Q)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:aae},u),Tp(e,j=>w.createElement(w5.Provider,{value:_},w.createElement(E5.Provider,{value:M},j))))}),Vre=w.forwardRef((e,t)=>{var n,r;let a=An(),o=w.useRef(null),s=w.useContext(x5),l=au(),u=T5(e),d=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Si(()=>{if(!d)return l.item(a,s==null?void 0:s.id)},[d]);let p=A5(a,o,[e.value,e.children,o],e.keywords),g=zT(),m=Ei(C=>C.value&&C.value===p.current),b=Ei(C=>d||l.filter()===!1?!0:C.search?C.filtered.items.get(a)>0:!0);w.useEffect(()=>{let C=o.current;if(!(!C||e.disabled))return C.addEventListener(nk,y),()=>C.removeEventListener(nk,y)},[b,e.onSelect,e.disabled]);function y(){var C,_;v(),(_=(C=u.current).onSelect)==null||_.call(C,p.current)}function v(){g.setState("value",p.current,!0)}if(!b)return null;let{disabled:x,value:A,onSelect:k,forceMount:R,keywords:O,...N}=e;return w.createElement(Je.div,{ref:Rc([o,t]),...N,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!m,"data-disabled":!!x,"data-selected":!!m,onPointerMove:x||l.getDisablePointerSelection()?void 0:v,onClick:x?void 0:y},e.children)}),Wre=w.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,s=An(),l=w.useRef(null),u=w.useRef(null),d=An(),p=au(),g=Ei(b=>a||p.filter()===!1?!0:b.search?b.filtered.groups.has(s):!0);Si(()=>p.group(s),[]),A5(s,l,[e.value,e.heading,u]);let m=w.useMemo(()=>({id:s,forceMount:a}),[a]);return w.createElement(Je.div,{ref:Rc([l,t]),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&w.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Tp(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},w.createElement(x5.Provider,{value:m},b))))}),Yre=w.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=w.useRef(null),o=Ei(s=>!s.search);return!n&&!o?null:w.createElement(Je.div,{ref:Rc([a,t]),...r,"cmdk-separator":"",role:"separator"})}),Kre=w.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=zT(),s=Ei(p=>p.search),l=Ei(p=>p.value),u=au(),d=w.useMemo(()=>{var p;let g=(p=u.listInnerRef.current)==null?void 0:p.querySelector(`${FT}[${ui}="${encodeURIComponent(l)}"]`);return g==null?void 0:g.getAttribute("id")},[]);return w.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),w.createElement(Je.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":d,id:u.inputId,type:"text",value:a?e.value:s,onChange:p=>{a||o.setState("search",p.target.value),n==null||n(p.target.value)}})}),Xre=w.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,o=w.useRef(null),s=w.useRef(null),l=au();return w.useEffect(()=>{if(s.current&&o.current){let u=s.current,d=o.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return g.observe(u),()=>{cancelAnimationFrame(p),g.unobserve(u)}}},[]),w.createElement(Je.div,{ref:Rc([o,t]),...a,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},Tp(e,u=>w.createElement("div",{ref:Rc([s,l.listInnerRef]),"cmdk-list-sizer":""},u)))}),Zre=w.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:s,...l}=e;return w.createElement(Kk,{open:n,onOpenChange:r},w.createElement(Xk,{container:s},w.createElement(ap,{"cmdk-overlay":"",className:a}),w.createElement(op,{"aria-label":e.label,"cmdk-dialog":"",className:o},w.createElement(k5,{ref:t,...l}))))}),Qre=w.forwardRef((e,t)=>Ei(n=>n.filtered.count===0)?w.createElement(Je.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Jre=w.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...o}=e;return w.createElement(Je.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Tp(e,s=>w.createElement("div",{"aria-hidden":!0},s)))}),Vn=Object.assign(k5,{List:Xre,Item:Vre,Input:Kre,Group:Wre,Separator:Yre,Dialog:Zre,Empty:Qre,Loading:Jre});function eae(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function tae(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function T5(e){let t=w.useRef(e);return Si(()=>{t.current=e}),t}var Si=typeof window>"u"?w.useEffect:w.useLayoutEffect;function Es(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function Rc(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ei(e){let t=zT(),n=()=>e(t.snapshot());return Hre.useSyncExternalStore(t.subscribe,n,n)}function A5(e,t,n,r=[]){let a=w.useRef(),o=au();return Si(()=>{var s;let l=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():a.current}})(),u=r.map(d=>d.trim());o.value(e,l,u),(s=t.current)==null||s.setAttribute(ui,l),a.current=l}),a}var nae=()=>{let[e,t]=w.useState(),n=Es(()=>new Map);return Si(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function rae(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Tp({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(rae(t),{ref:t.ref},n(t.props.children)):n(t)}var aae={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ap=w.forwardRef(({className:e,...t},n)=>E.jsx(Vn,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));Ap.displayName=Vn.displayName;const BT=w.forwardRef(({className:e,...t},n)=>E.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[E.jsx(KZ,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),E.jsx(Vn.Input,{ref:n,className:Me("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));BT.displayName=Vn.Input.displayName;const Rp=w.forwardRef(({className:e,...t},n)=>E.jsx(Vn.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));Rp.displayName=Vn.List.displayName;const jT=w.forwardRef((e,t)=>E.jsx(Vn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));jT.displayName=Vn.Empty.displayName;const el=w.forwardRef(({className:e,...t},n)=>E.jsx(Vn.Group,{ref:n,className:Me("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t}));el.displayName=Vn.Group.displayName;const oae=w.forwardRef(({className:e,...t},n)=>E.jsx(Vn.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));oae.displayName=Vn.Separator.displayName;const tl=w.forwardRef(({className:e,...t},n)=>E.jsx(Vn.Item,{ref:n,className:Me("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));tl.displayName=Vn.Item.displayName;const iae=({layout:e,autoRunFor:t,mainLayout:n})=>{const r=Ar(),[a,o]=w.useState(!1),s=w.useRef(null),{t:l}=Et(),u=w.useCallback(()=>{if(r)try{const p=r.getGraph();if(!p||p.order===0)return;const g=n.positions();q4(p,g,{duration:300})}catch(p){console.error("Error updating positions:",p),s.current&&(window.clearInterval(s.current),s.current=null,o(!1))}},[r,n]),d=w.useCallback(()=>{if(a){console.log("Stopping layout animation"),s.current&&(window.clearInterval(s.current),s.current=null);try{typeof e.kill=="function"?(e.kill(),console.log("Layout algorithm killed")):typeof e.stop=="function"&&(e.stop(),console.log("Layout algorithm stopped"))}catch(p){console.error("Error stopping layout algorithm:",p)}o(!1)}else console.log("Starting layout animation"),u(),s.current=window.setInterval(()=>{u()},200),o(!0),setTimeout(()=>{if(s.current){console.log("Auto-stopping layout animation after 3 seconds"),window.clearInterval(s.current),s.current=null,o(!1);try{typeof e.kill=="function"?e.kill():typeof e.stop=="function"&&e.stop()}catch(p){console.error("Error stopping layout algorithm:",p)}}},3e3)},[a,e,u]);return w.useEffect(()=>{if(!r){console.log("No sigma instance available");return}let p=null;return t!==void 0&&t>-1&&r.getGraph().order>0&&(console.log("Auto-starting layout animation"),u(),s.current=window.setInterval(()=>{u()},200),o(!0),t>0&&(p=window.setTimeout(()=>{console.log("Auto-stopping layout animation after timeout"),s.current&&(window.clearInterval(s.current),s.current=null),o(!1)},t))),()=>{s.current&&(window.clearInterval(s.current),s.current=null),p&&window.clearTimeout(p),o(!1)}},[t,r,u]),E.jsx(nt,{size:"icon",onClick:d,tooltip:l(a?"graphPanel.sideBar.layoutsControl.stopAnimation":"graphPanel.sideBar.layoutsControl.startAnimation"),variant:wr,children:a?E.jsx(zZ,{}):E.jsx(jZ,{})})},sae=()=>{const e=Ar(),{t}=Et(),[n,r]=w.useState("Circular"),[a,o]=w.useState(!1),s=De.use.graphLayoutMaxIterations(),l=ere(),u=Xne(),d=Ore(),p=Are({maxIterations:s,settings:{margin:5,expansion:1.1,gridSize:1,ratio:1,speed:3}}),g=sre({maxIterations:s,settings:{attraction:3e-4,repulsion:.02,gravity:.02,inertia:.4,maxMove:100}}),m=b5({iterations:s}),b=Rre(),y=lre(),v=bre(),x=w.useMemo(()=>({Circular:{layout:l},Circlepack:{layout:u},Random:{layout:d},Noverlaps:{layout:p,worker:b},"Force Directed":{layout:g,worker:y},"Force Atlas":{layout:m,worker:v}}),[u,l,g,m,p,d,y,b,v]),A=w.useCallback(k=>{console.debug("Running layout:",k);const{positions:R}=x[k].layout;try{const O=e.getGraph();if(!O){console.error("No graph available");return}const N=R();console.log("Positions calculated, animating nodes"),q4(O,N,{duration:400}),r(k)}catch(O){console.error("Error running layout:",O)}},[x,e]);return E.jsxs("div",{children:[E.jsx("div",{children:x[n]&&"worker"in x[n]&&E.jsx(iae,{layout:x[n].worker,mainLayout:x[n].layout})}),E.jsx("div",{children:E.jsxs(mp,{open:a,onOpenChange:o,children:[E.jsx(bp,{asChild:!0,children:E.jsx(nt,{size:"icon",variant:wr,onClick:()=>o(k=>!k),tooltip:t("graphPanel.sideBar.layoutsControl.layoutGraph"),children:E.jsx(TZ,{})})}),E.jsx(Zc,{side:"right",align:"start",sideOffset:8,collisionPadding:5,sticky:"always",className:"p-1 min-w-auto",children:E.jsx(Ap,{children:E.jsx(Rp,{children:E.jsx(el,{children:Object.keys(x).map(k=>E.jsx(tl,{onSelect:()=>{A(k)},className:"cursor-pointer text-xs",children:t(`graphPanel.sideBar.layoutsControl.layouts.${k}`)},k))})})})})]})})]})},R5=()=>{const e=w.useContext(nj);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Md=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),lae=({disableHoverEffect:e})=>{const t=Ar(),n=X4(),r=K4(),a=De.use.graphLayoutMaxIterations(),{assign:o}=b5({iterations:a}),{theme:s}=R5(),l=De.use.enableHideUnselectedEdges(),u=De.use.enableEdgeEvents(),d=De.use.showEdgeLabel(),p=De.use.showNodeLabel(),g=De.use.minEdgeSize(),m=De.use.maxEdgeSize(),b=Fe.use.selectedNode(),y=Fe.use.focusedNode(),v=Fe.use.selectedEdge(),x=Fe.use.focusedEdge(),A=Fe.use.sigmaGraph();return w.useEffect(()=>{if(A&&t){try{typeof t.setGraph=="function"?(t.setGraph(A),console.log("Binding graph to sigma instance")):(t.graph=A,console.warn("Simgma missing setGraph function, set graph property directly"))}catch(k){console.error("Error setting graph on sigma instance:",k)}o(),console.log("Initial layout applied to graph")}},[t,A,o,a]),w.useEffect(()=>{t&&(Fe.getState().sigmaInstance||(console.log("Setting sigma instance from GraphControl"),Fe.getState().setSigmaInstance(t)))},[t]),w.useEffect(()=>{const{setFocusedNode:k,setSelectedNode:R,setFocusedEdge:O,setSelectedEdge:N,clearSelection:C}=Fe.getState(),_={enterNode:M=>{Md(M.event.original)||k(M.node)},leaveNode:M=>{Md(M.event.original)||k(null)},clickNode:M=>{R(M.node),N(null)},clickStage:()=>C()};u&&(_.clickEdge=M=>{N(M.edge),R(null)},_.enterEdge=M=>{Md(M.event.original)||O(M.edge)},_.leaveEdge=M=>{Md(M.event.original)||O(null)}),n(_)},[n,u]),w.useEffect(()=>{if(t&&A){const k=t.getGraph();let R=Number.MAX_SAFE_INTEGER,O=0;k.forEachEdge(C=>{const _=k.getEdgeAttribute(C,"originalWeight")||1;typeof _=="number"&&(R=Math.min(R,_),O=Math.max(O,_))});const N=O-R;if(N>0){const C=m-g;k.forEachEdge(_=>{const M=k.getEdgeAttribute(_,"originalWeight")||1;if(typeof M=="number"){const D=g+C*Math.pow((M-R)/N,.5);k.setEdgeAttribute(_,"size",D)}})}else k.forEachEdge(C=>{k.setEdgeAttribute(C,"size",g)});t.refresh()}},[t,A,g,m]),w.useEffect(()=>{const k=s==="dark",R=k?cV:void 0,O=k?pV:void 0;r({enableEdgeEvents:u,renderEdgeLabels:d,renderLabels:p,nodeReducer:(N,C)=>{const _=t.getGraph(),M={...C,highlighted:C.highlighted||!1,labelColor:R};if(!e){M.highlighted=!1;const D=y||b,I=x||v;if(D&&_.hasNode(D))try{(N===D||_.neighbors(D).includes(N))&&(M.highlighted=!0,N===b&&(M.borderColor=fV))}catch(U){console.error("Error in nodeReducer:",U)}else if(I&&_.hasEdge(I))_.extremities(I).includes(N)&&(M.highlighted=!0,M.size=3);else return M;M.highlighted?k&&(M.labelColor=uV):M.color=dV}return M},edgeReducer:(N,C)=>{const _=t.getGraph(),M={...C,hidden:!1,labelColor:R,color:O};if(!e){const D=y||b;if(D&&_.hasNode(D))try{l?_.extremities(N).includes(D)||(M.hidden=!0):_.extremities(N).includes(D)&&(M.color=M_)}catch(I){console.error("Error in edgeReducer:",I)}else{const I=v&&_.hasEdge(v)?v:null,U=x&&_.hasEdge(x)?x:null;(I||U)&&(N===I?M.color=gV:N===U?M.color=M_:l&&(M.hidden=!0))}}return M}})},[b,y,v,x,r,t,e,s,l,u,d,p]),null},cae=()=>{const{zoomIn:e,zoomOut:t,reset:n}=Z4({duration:200,factor:1.5}),r=Ar(),{t:a}=Et(),o=w.useCallback(()=>e(),[e]),s=w.useCallback(()=>t(),[t]),l=w.useCallback(()=>{if(r)try{r.setCustomBBox(null),r.refresh();const p=r.getGraph();if(!(p!=null&&p.order)||p.nodes().length===0){n();return}r.getCamera().animate({x:.5,y:.5,ratio:1.1},{duration:1e3})}catch(p){console.error("Error resetting zoom:",p),n()}},[r,n]),u=w.useCallback(()=>{if(!r)return;const p=r.getCamera(),m=p.angle+Math.PI/8;p.animate({angle:m},{duration:200})},[r]),d=w.useCallback(()=>{if(!r)return;const p=r.getCamera(),m=p.angle-Math.PI/8;p.animate({angle:m},{duration:200})},[r]);return E.jsxs(E.Fragment,{children:[E.jsx(nt,{variant:wr,onClick:d,tooltip:a("graphPanel.sideBar.zoomControl.rotateCameraCounterClockwise"),size:"icon",children:E.jsx(HZ,{})}),E.jsx(nt,{variant:wr,onClick:u,tooltip:a("graphPanel.sideBar.zoomControl.rotateCamera"),size:"icon",children:E.jsx(qZ,{})}),E.jsx(nt,{variant:wr,onClick:l,tooltip:a("graphPanel.sideBar.zoomControl.resetZoom"),size:"icon",children:E.jsx(vZ,{})}),E.jsx(nt,{variant:wr,onClick:o,tooltip:a("graphPanel.sideBar.zoomControl.zoomIn"),size:"icon",children:E.jsx(sQ,{})}),E.jsx(nt,{variant:wr,onClick:s,tooltip:a("graphPanel.sideBar.zoomControl.zoomOut"),size:"icon",children:E.jsx(cQ,{})})]})},uae=()=>{const{isFullScreen:e,toggle:t}=Vte(),{t:n}=Et();return E.jsx(E.Fragment,{children:e?E.jsx(nt,{variant:wr,onClick:t,tooltip:n("graphPanel.sideBar.fullScreenControl.windowed"),size:"icon",children:E.jsx(LZ,{})}):E.jsx(nt,{variant:wr,onClick:t,tooltip:n("graphPanel.sideBar.fullScreenControl.fullScreen"),size:"icon",children:E.jsx(IZ,{})})})};var UT="Checkbox",[dae,y0e]=$r(UT),[fae,pae]=dae(UT),C5=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:s,disabled:l,value:u="on",onCheckedChange:d,form:p,...g}=e,[m,b]=w.useState(null),y=mt(t,O=>b(O)),v=w.useRef(!1),x=m?p||!!m.closest("form"):!0,[A=!1,k]=ja({prop:a,defaultProp:o,onChange:d}),R=w.useRef(A);return w.useEffect(()=>{const O=m==null?void 0:m.form;if(O){const N=()=>k(R.current);return O.addEventListener("reset",N),()=>O.removeEventListener("reset",N)}},[m,k]),E.jsxs(fae,{scope:n,state:A,disabled:l,children:[E.jsx(Je.button,{type:"button",role:"checkbox","aria-checked":Ro(A)?"mixed":A,"aria-required":s,"data-state":O5(A),"data-disabled":l?"":void 0,disabled:l,value:u,...g,ref:y,onKeyDown:Ke(e.onKeyDown,O=>{O.key==="Enter"&&O.preventDefault()}),onClick:Ke(e.onClick,O=>{k(N=>Ro(N)?!0:!N),x&&(v.current=O.isPropagationStopped(),v.current||O.stopPropagation())})}),x&&E.jsx(gae,{control:m,bubbles:!v.current,name:r,value:u,checked:A,required:s,disabled:l,form:p,style:{transform:"translateX(-100%)"},defaultChecked:Ro(o)?!1:o})]})});C5.displayName=UT;var _5="CheckboxIndicator",N5=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=pae(_5,n);return E.jsx(ir,{present:r||Ro(o.state)||o.state===!0,children:E.jsx(Je.span,{"data-state":O5(o.state),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});N5.displayName=_5;var gae=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:a,...o}=e,s=w.useRef(null),l=o3(n),u=pU(t);w.useEffect(()=>{const p=s.current,g=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(g,"checked").set;if(l!==n&&b){const y=new Event("click",{bubbles:r});p.indeterminate=Ro(n),b.call(p,Ro(n)?!1:n),p.dispatchEvent(y)}},[l,n,r]);const d=w.useRef(Ro(n)?!1:n);return E.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??d.current,...o,tabIndex:-1,ref:s,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ro(e){return e==="indeterminate"}function O5(e){return Ro(e)?"indeterminate":e?"checked":"unchecked"}var I5=C5,hae=N5;const Ns=w.forwardRef(({className:e,...t},n)=>E.jsx(I5,{ref:n,className:Me("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-muted data-[state=checked]:text-muted-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:E.jsx(hae,{className:Me("flex items-center justify-center text-current"),children:E.jsx(bT,{className:"h-4 w-4"})})}));Ns.displayName=I5.displayName;var mae="Separator",AO="horizontal",bae=["horizontal","vertical"],D5=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=AO,...a}=e,o=yae(r)?r:AO,l=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return E.jsx(Je.div,{"data-orientation":o,...l,...a,ref:t})});D5.displayName=mae;function yae(e){return bae.includes(e)}var L5=D5;const ws=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>E.jsx(L5,{ref:a,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ws.displayName=L5.displayName;const vo=({checked:e,onCheckedChange:t,label:n})=>{const r=`checkbox-${n.toLowerCase().replace(/\s+/g,"-")}`;return E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(Ns,{id:r,checked:e,onCheckedChange:t}),E.jsx("label",{htmlFor:r,className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]})},tb=({value:e,onEditFinished:t,label:n,min:r,max:a,defaultValue:o})=>{const{t:s}=Et(),[l,u]=w.useState(e),d=`input-${n.toLowerCase().replace(/\s+/g,"-")}`,p=w.useCallback(b=>{const y=b.target.value.trim();if(y.length===0){u(null);return}const v=Number.parseInt(y);if(!isNaN(v)&&v!==l){if(r!==void 0&&va)return;u(v)}},[l,r,a]),g=w.useCallback(()=>{l!==null&&e!==l&&t(l)},[e,l,t]),m=w.useCallback(()=>{o!==void 0&&e!==o&&(u(o),t(o))},[o,e,t]);return E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("label",{htmlFor:d,className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n}),E.jsxs("div",{className:"flex items-center gap-1",children:[E.jsx(Tr,{id:d,type:"number",value:l===null?"":l,onChange:p,className:"h-6 w-full min-w-0 pr-1",min:r,max:a,onBlur:g,onKeyDown:b=>{b.key==="Enter"&&g()}}),o!==void 0&&E.jsx(nt,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 hover:bg-muted text-muted-foreground hover:text-foreground",onClick:m,type:"button",title:s("graphPanel.sideBar.settings.resetToDefault"),children:E.jsx(GU,{className:"h-3.5 w-3.5"})})]})]})};function vae(){const[e,t]=w.useState(!1),n=De.use.showPropertyPanel(),r=De.use.showNodeSearchBar(),a=De.use.showNodeLabel(),o=De.use.enableEdgeEvents(),s=De.use.enableNodeDrag(),l=De.use.enableHideUnselectedEdges(),u=De.use.showEdgeLabel(),d=De.use.minEdgeSize(),p=De.use.maxEdgeSize(),g=De.use.graphQueryMaxDepth(),m=De.use.graphMaxNodes(),b=De.use.graphLayoutMaxIterations(),y=De.use.enableHealthCheck(),v=w.useCallback(()=>De.setState(H=>({enableNodeDrag:!H.enableNodeDrag})),[]),x=w.useCallback(()=>De.setState(H=>({enableEdgeEvents:!H.enableEdgeEvents})),[]),A=w.useCallback(()=>De.setState(H=>({enableHideUnselectedEdges:!H.enableHideUnselectedEdges})),[]),k=w.useCallback(()=>De.setState(H=>({showEdgeLabel:!H.showEdgeLabel})),[]),R=w.useCallback(()=>De.setState(H=>({showPropertyPanel:!H.showPropertyPanel})),[]),O=w.useCallback(()=>De.setState(H=>({showNodeSearchBar:!H.showNodeSearchBar})),[]),N=w.useCallback(()=>De.setState(H=>({showNodeLabel:!H.showNodeLabel})),[]),C=w.useCallback(()=>De.setState(H=>({enableHealthCheck:!H.enableHealthCheck})),[]),_=w.useCallback(H=>{if(H<1)return;De.setState({graphQueryMaxDepth:H});const B=De.getState().queryLabel;De.getState().setQueryLabel(""),setTimeout(()=>{De.getState().setQueryLabel(B)},300)},[]),M=w.useCallback(H=>{if(H<1||H>1e3)return;De.setState({graphMaxNodes:H});const B=De.getState().queryLabel;De.getState().setQueryLabel(""),setTimeout(()=>{De.getState().setQueryLabel(B)},300)},[]),D=w.useCallback(H=>{H<1||De.setState({graphLayoutMaxIterations:H})},[]),{t:I}=Et(),U=()=>t(!1);return E.jsx(E.Fragment,{children:E.jsxs(mp,{open:e,onOpenChange:t,children:[E.jsx(bp,{asChild:!0,children:E.jsx(nt,{variant:wr,tooltip:I("graphPanel.sideBar.settings.settings"),size:"icon",children:E.jsx(JZ,{})})}),E.jsx(Zc,{side:"right",align:"end",sideOffset:8,collisionPadding:5,className:"p-2 max-w-[200px]",onCloseAutoFocus:H=>H.preventDefault(),children:E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx(vo,{checked:y,onCheckedChange:C,label:I("graphPanel.sideBar.settings.healthCheck")}),E.jsx(ws,{}),E.jsx(vo,{checked:n,onCheckedChange:R,label:I("graphPanel.sideBar.settings.showPropertyPanel")}),E.jsx(vo,{checked:r,onCheckedChange:O,label:I("graphPanel.sideBar.settings.showSearchBar")}),E.jsx(ws,{}),E.jsx(vo,{checked:a,onCheckedChange:N,label:I("graphPanel.sideBar.settings.showNodeLabel")}),E.jsx(vo,{checked:s,onCheckedChange:v,label:I("graphPanel.sideBar.settings.nodeDraggable")}),E.jsx(ws,{}),E.jsx(vo,{checked:u,onCheckedChange:k,label:I("graphPanel.sideBar.settings.showEdgeLabel")}),E.jsx(vo,{checked:l,onCheckedChange:A,label:I("graphPanel.sideBar.settings.hideUnselectedEdges")}),E.jsx(vo,{checked:o,onCheckedChange:x,label:I("graphPanel.sideBar.settings.edgeEvents")}),E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("label",{htmlFor:"edge-size-min",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:I("graphPanel.sideBar.settings.edgeSizeRange")}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(Tr,{id:"edge-size-min",type:"number",value:d,onChange:H=>{const B=Number(H.target.value);!isNaN(B)&&B>=1&&B<=p&&De.setState({minEdgeSize:B})},className:"h-6 w-16 min-w-0 pr-1",min:1,max:Math.min(p,10)}),E.jsx("span",{children:"-"}),E.jsxs("div",{className:"flex items-center gap-1",children:[E.jsx(Tr,{id:"edge-size-max",type:"number",value:p,onChange:H=>{const B=Number(H.target.value);!isNaN(B)&&B>=d&&B>=1&&B<=10&&De.setState({maxEdgeSize:B})},className:"h-6 w-16 min-w-0 pr-1",min:d,max:10}),E.jsx(nt,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 hover:bg-muted text-muted-foreground hover:text-foreground",onClick:()=>De.setState({minEdgeSize:1,maxEdgeSize:5}),type:"button",title:I("graphPanel.sideBar.settings.resetToDefault"),children:E.jsx(GU,{className:"h-3.5 w-3.5"})})]})]})]}),E.jsx(ws,{}),E.jsx(tb,{label:I("graphPanel.sideBar.settings.maxQueryDepth"),min:1,value:g,defaultValue:3,onEditFinished:_}),E.jsx(tb,{label:I("graphPanel.sideBar.settings.maxNodes"),min:1,max:1e3,value:m,defaultValue:1e3,onEditFinished:M}),E.jsx(tb,{label:I("graphPanel.sideBar.settings.maxLayoutIterations"),min:1,max:30,value:b,defaultValue:15,onEditFinished:D}),E.jsx(ws,{}),E.jsx(nt,{onClick:U,variant:"outline",size:"sm",className:"ml-auto px-4",children:I("graphPanel.sideBar.settings.save")})]})})]})})}const Sae="ENTRIES",M5="KEYS",P5="VALUES",bn="";class nb{constructor(t,n){const r=t._tree,a=Array.from(r.keys());this.set=t,this._type=n,this._path=a.length>0?[{node:r,keys:a}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=hs(this._path);if(hs(n)===bn)return{done:!1,value:this.result()};const r=t.get(hs(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=hs(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>hs(t)).filter(t=>t!==bn).join("")}value(){return hs(this._path).node.get(bn)}result(){switch(this._type){case P5:return this.value();case M5:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const hs=e=>e[e.length-1],Eae=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const a=t.length+1,o=a+n,s=new Uint8Array(o*a).fill(n+1);for(let l=0;l{const u=o*s;e:for(const d of e.keys())if(d===bn){const p=a[u-1];p<=n&&r.set(l,[e.get(d),p])}else{let p=o;for(let g=0;gn)continue e}F5(e.get(d),t,n,r,a,p,s,l+d)}};class To{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Nf(this._tree,t.slice(this._prefix.length));if(n===void 0){const[a,o]=GT(r);for(const s of a.keys())if(s!==bn&&s.startsWith(o)){const l=new Map;return l.set(s.slice(o.length),a.get(s)),new To(l,t)}}return new To(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,wae(this._tree,t)}entries(){return new nb(this,Sae)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return Eae(this._tree,t,n)}get(t){const n=rk(this._tree,t);return n!==void 0?n.get(bn):void 0}has(t){const n=rk(this._tree,t);return n!==void 0&&n.has(bn)}keys(){return new nb(this,M5)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,rb(this._tree,t).set(bn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=rb(this._tree,t);return r.set(bn,n(r.get(bn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=rb(this._tree,t);let a=r.get(bn);return a===void 0&&r.set(bn,a=n()),a}values(){return new nb(this,P5)}[Symbol.iterator](){return this.entries()}static from(t){const n=new To;for(const[r,a]of t)n.set(r,a);return n}static fromObject(t){return To.from(Object.entries(t))}}const Nf=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==bn&&t.startsWith(r))return n.push([e,r]),Nf(e.get(r),t.slice(r.length),n);return n.push([e,t]),Nf(void 0,"",n)},rk=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==bn&&t.startsWith(n))return rk(e.get(n),t.slice(n.length))},rb=(e,t)=>{const n=t.length;e:for(let r=0;e&&r{const[n,r]=Nf(e,t);if(n!==void 0){if(n.delete(bn),n.size===0)z5(r);else if(n.size===1){const[a,o]=n.entries().next().value;B5(r,a,o)}}},z5=e=>{if(e.length===0)return;const[t,n]=GT(e);if(t.delete(n),t.size===0)z5(e.slice(0,-1));else if(t.size===1){const[r,a]=t.entries().next().value;r!==bn&&B5(e.slice(0,-1),r,a)}},B5=(e,t,n)=>{if(e.length===0)return;const[r,a]=GT(e);r.set(a+t,n),r.delete(a)},GT=e=>e[e.length-1],HT="or",j5="and",xae="and_not";class Co{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?ib:t.autoVacuum;this._options={...ob,...t,autoVacuum:n,searchOptions:{...RO,...t.searchOptions||{}},autoSuggestOptions:{...Cae,...t.autoSuggestOptions||{}}},this._index=new To,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=ok,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:a,fields:o,idField:s}=this._options,l=n(t,s);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);if(this._idToShortId.has(l))throw new Error(`MiniSearch: duplicate ID ${l}`);const u=this.addDocumentId(l);this.saveStoredFields(u,t);for(const d of o){const p=n(t,d);if(p==null)continue;const g=r(p.toString(),d),m=this._fieldIds[d],b=new Set(g).size;this.addFieldLength(u,m,this._documentCount-1,b);for(const y of g){const v=a(y,d);if(Array.isArray(v))for(const x of v)this.addTerm(m,u,x);else v&&this.addTerm(m,u,v)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,a={chunk:[],promise:Promise.resolve()},{chunk:o,promise:s}=t.reduce(({chunk:l,promise:u},d,p)=>(l.push(d),(p+1)%r===0?{chunk:[],promise:u.then(()=>new Promise(g=>setTimeout(g,0))).then(()=>this.addAll(l))}:{chunk:l,promise:u}),a);return s.then(()=>this.addAll(o))}remove(t){const{tokenize:n,processTerm:r,extractField:a,fields:o,idField:s}=this._options,l=a(t,s);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);const u=this._idToShortId.get(l);if(u==null)throw new Error(`MiniSearch: cannot remove document with ID ${l}: it is not in the index`);for(const d of o){const p=a(t,d);if(p==null)continue;const g=n(p.toString(),d),m=this._fieldIds[d],b=new Set(g).size;this.removeFieldLength(u,m,this._documentCount,b);for(const y of g){const v=r(y,d);if(Array.isArray(v))for(const x of v)this.removeTerm(m,u,x);else v&&this.removeTerm(m,u,v)}}this._storedFields.delete(u),this._documentIds.delete(u),this._idToShortId.delete(l),this._fieldLength.delete(u),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new To,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,a)=>{this.removeFieldLength(n,a,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:a}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:a},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,a=r(t,n);this.discard(a),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=ok,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const a=t.batchSize||ak.batchSize,o=t.batchWait||ak.batchWait;let s=1;for(const[l,u]of this._index){for(const[d,p]of u)for(const[g]of p)this._documentIds.has(g)||(p.size<=1?u.delete(d):p.delete(g));this._index.get(l).size===0&&this._index.delete(l),s%a===0&&await new Promise(d=>setTimeout(d,o)),s+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||ib.minDirtCount,r=r||ib.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,a={...r,...n},o=this.executeQuery(t,n),s=[];for(const[l,{score:u,terms:d,match:p}]of o){const g=d.length||1,m={id:this._documentIds.get(l),score:u*g,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(m,this._storedFields.get(l)),(a.filter==null||a.filter(m))&&s.push(m)}return t===Co.wildcard&&a.boostDocument==null||s.sort(_O),s}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:o,terms:s}of this.search(t,n)){const l=s.join(" "),u=r.get(l);u!=null?(u.score+=o,u.count+=1):r.set(l,{score:o,terms:s,count:1})}const a=[];for(const[o,{score:s,terms:l,count:u}]of r)a.push({suggestion:o,terms:l,score:s/u});return a.sort(_O),a}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)}static getDefault(t){if(ob.hasOwnProperty(t))return ab(ob,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:a,fieldLength:o,storedFields:s,serializationVersion:l}=t,u=this.instantiateMiniSearch(t,n);u._documentIds=Pd(a),u._fieldLength=Pd(o),u._storedFields=Pd(s);for(const[d,p]of u._documentIds)u._idToShortId.set(p,d);for(const[d,p]of r){const g=new Map;for(const m of Object.keys(p)){let b=p[m];l===1&&(b=b.ds),g.set(parseInt(m,10),Pd(b))}u._index.set(d,g)}return u}static async loadJSAsync(t,n){const{index:r,documentIds:a,fieldLength:o,storedFields:s,serializationVersion:l}=t,u=this.instantiateMiniSearch(t,n);u._documentIds=await Fd(a),u._fieldLength=await Fd(o),u._storedFields=await Fd(s);for(const[p,g]of u._documentIds)u._idToShortId.set(g,p);let d=0;for(const[p,g]of r){const m=new Map;for(const b of Object.keys(g)){let y=g[b];l===1&&(y=y.ds),m.set(parseInt(b,10),await Fd(y))}++d%1e3===0&&await U5(0),u._index.set(p,m)}return u}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:a,fieldIds:o,averageFieldLength:s,dirtCount:l,serializationVersion:u}=t;if(u!==1&&u!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new Co(n);return d._documentCount=r,d._nextId=a,d._idToShortId=new Map,d._fieldIds=o,d._avgFieldLength=s,d._dirtCount=l||0,d._index=new To,d}executeQuery(t,n={}){if(t===Co.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const m={...n,...t,queries:void 0},b=t.queries.map(y=>this.executeQuery(y,m));return this.combineResults(b,m.combineWith)}const{tokenize:r,processTerm:a,searchOptions:o}=this._options,s={tokenize:r,processTerm:a,...o,...n},{tokenize:l,processTerm:u}=s,g=l(t).flatMap(m=>u(m)).filter(m=>!!m).map(Rae(s)).map(m=>this.executeQuerySpec(m,s));return this.combineResults(g,s.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},a=(r.fields||this._options.fields).reduce((v,x)=>({...v,[x]:ab(r.boost,x)||1}),{}),{boostDocument:o,weights:s,maxFuzzy:l,bm25:u}=r,{fuzzy:d,prefix:p}={...RO.weights,...s},g=this._index.get(t.term),m=this.termResults(t.term,t.term,1,t.termBoost,g,a,o,u);let b,y;if(t.prefix&&(b=this._index.atPrefix(t.term)),t.fuzzy){const v=t.fuzzy===!0?.2:t.fuzzy,x=v<1?Math.min(l,Math.round(t.term.length*v)):v;x&&(y=this._index.fuzzyGet(t.term,x))}if(b)for(const[v,x]of b){const A=v.length-t.term.length;if(!A)continue;y==null||y.delete(v);const k=p*v.length/(v.length+.3*A);this.termResults(t.term,v,k,t.termBoost,x,a,o,u,m)}if(y)for(const v of y.keys()){const[x,A]=y.get(v);if(!A)continue;const k=d*v.length/(v.length+A);this.termResults(t.term,v,k,t.termBoost,x,a,o,u,m)}return m}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[a,o]of this._documentIds){const s=r.boostDocument?r.boostDocument(o,"",this._storedFields.get(a)):1;n.set(a,{score:s,terms:[],match:{}})}return n}combineResults(t,n=HT){if(t.length===0)return new Map;const r=n.toLowerCase(),a=kae[r];if(!a)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(a)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const a={};for(const[o,s]of r)a[o]=Object.fromEntries(s);t.push([n,a])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,a,o,s,l,u,d=new Map){if(o==null)return d;for(const p of Object.keys(s)){const g=s[p],m=this._fieldIds[p],b=o.get(m);if(b==null)continue;let y=b.size;const v=this._avgFieldLength[m];for(const x of b.keys()){if(!this._documentIds.has(x)){this.removeTerm(m,x,n),y-=1;continue}const A=l?l(this._documentIds.get(x),n,this._storedFields.get(x)):1;if(!A)continue;const k=b.get(x),R=this._fieldLength.get(x)[m],O=Aae(k,y,this._documentCount,R,v,u),N=r*a*g*A*O,C=d.get(x);if(C){C.score+=N,_ae(C.terms,t);const _=ab(C.match,n);_?_.push(p):C.match[n]=[p]}else d.set(x,{score:N,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const a=this._index.fetch(r,NO);let o=a.get(t);if(o==null)o=new Map,o.set(n,1),a.set(t,o);else{const s=o.get(n);o.set(n,(s||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const a=this._index.fetch(r,NO),o=a.get(t);o==null||o.get(n)==null?this.warnDocumentChanged(n,t,r):o.get(n)<=1?o.size<=1?a.delete(t):o.delete(n):o.set(n,o.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const a of Object.keys(this._fieldIds))if(this._fieldIds[a]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${a}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;nObject.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,kae={[HT]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:a,terms:o,match:s}=t.get(n);r.score=r.score+a,r.match=Object.assign(r.match,s),CO(r.terms,o)}}return e},[j5]:(e,t)=>{const n=new Map;for(const r of t.keys()){const a=e.get(r);if(a==null)continue;const{score:o,terms:s,match:l}=t.get(r);CO(a.terms,s),n.set(r,{score:a.score+o,terms:a.terms,match:Object.assign(a.match,l)})}return n},[xae]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},Tae={k:1.2,b:.7,d:.5},Aae=(e,t,n,r,a,o)=>{const{k:s,b:l,d:u}=o;return Math.log(1+(n-t+.5)/(t+.5))*(u+e*(s+1)/(e+s*(1-l+l*r/a)))},Rae=e=>(t,n,r)=>{const a=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,o=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,s=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:a,prefix:o,termBoost:s}},ob={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(Nae),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},RO={combineWith:HT,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Tae},Cae={combineWith:j5,prefix:(e,t,n)=>t===n.length-1},ak={batchSize:1e3,batchWait:10},ok={minDirtFactor:.1,minDirtCount:20},ib={...ak,...ok},_ae=(e,t)=>{e.includes(t)||e.push(t)},CO=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},_O=({score:e},{score:t})=>t-e,NO=()=>new Map,Pd=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Fd=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await U5(0);return t},U5=e=>new Promise(t=>setTimeout(t,e)),Nae=/[\n\r\p{Z}\p{P}]+/u,Oae={index:new Co({fields:[]})};w.createContext(Oae);const ik=({label:e,color:t,hidden:n,labels:r={}})=>we.createElement("div",{className:"node"},we.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),we.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),Iae=({id:e,labels:t})=>{const n=Ar(),r=w.useMemo(()=>{const a=n.getGraph().getNodeAttributes(e),o=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},a),o?o(e,a):{})},[n,e]);return we.createElement(ik,Object.assign({},r,{labels:t}))},Dae=({label:e,color:t,source:n,target:r,hidden:a,directed:o,labels:s={}})=>we.createElement("div",{className:"edge"},we.createElement(ik,Object.assign({},n,{labels:s})),we.createElement("div",{className:"body"},we.createElement("div",{className:"render"},we.createElement("span",{className:a?"dotted":"dash",style:{borderColor:t||"#000"}})," ",o&&we.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),we.createElement("span",{className:`label ${a?"text-muted":""} ${e?"":"fst-italic"}`},e||s.no_label||"No label")),we.createElement(ik,Object.assign({},r,{labels:s}))),Lae=({id:e,labels:t})=>{const n=Ar(),r=w.useMemo(()=>{const a=n.getGraph().getEdgeAttributes(e),o=n.getSetting("nodeReducer"),s=n.getSetting("edgeReducer"),l=n.getGraph().getNodeAttributes(n.getGraph().source(e)),u=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},a),s?s(e,a):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},l),o?o(e,l):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),o?o(e,u):{})})},[n,e]);return we.createElement(Dae,Object.assign({},r,{labels:t}))};function $T(e,t){const[n,r]=w.useState(e);return w.useEffect(()=>{const a=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(a)}},[e,t]),n}function Mae({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,notFound:o,loadingSkeleton:s,label:l,placeholder:u="Select...",value:d,onChange:p,onFocus:g,disabled:m=!1,className:b,noResultsMessage:y}){const[v,x]=w.useState(!1),[A,k]=w.useState(!1),[R,O]=w.useState([]),[N,C]=w.useState(!1),[_,M]=w.useState(null),[D,I]=w.useState(""),U=$T(D,t?0:150),H=w.useRef(null);w.useEffect(()=>{x(!0)},[]),w.useEffect(()=>{const $=F=>{H.current&&!H.current.contains(F.target)&&A&&k(!1)};return document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[A]);const B=w.useCallback(async $=>{try{C(!0),M(null);const F=await e($);O(F)}catch(F){M(F instanceof Error?F.message:"Failed to fetch options")}finally{C(!1)}},[e]);w.useEffect(()=>{v&&(t?U&&O($=>$.filter(F=>n?n(F,U):!0)):B(U))},[v,U,t,n,B]),w.useEffect(()=>{!v||!d||B(d)},[v,d,B]);const W=w.useCallback($=>{p($),requestAnimationFrame(()=>{const F=document.activeElement;F==null||F.blur(),k(!1)})},[p]),K=w.useCallback(()=>{k(!0),B(D)},[D,B]),G=w.useCallback($=>{$.target.closest(".cmd-item")&&$.preventDefault()},[]);return E.jsx("div",{ref:H,className:Me(m&&"cursor-not-allowed opacity-50",b),onMouseDown:G,children:E.jsxs(Ap,{shouldFilter:!1,className:"bg-transparent",children:[E.jsxs("div",{children:[E.jsx(BT,{placeholder:u,value:D,className:"max-h-8",onFocus:K,onValueChange:$=>{I($),A||k(!0)}}),N&&E.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:E.jsx(jU,{className:"h-4 w-4 animate-spin"})})]}),E.jsxs(Rp,{hidden:!A,children:[_&&E.jsx("div",{className:"text-destructive p-4 text-center",children:_}),N&&R.length===0&&(s||E.jsx(Pae,{})),!N&&!_&&R.length===0&&(o||E.jsx(jT,{children:y??`No ${l.toLowerCase()} found.`})),E.jsx(el,{children:R.map(($,F)=>E.jsxs(we.Fragment,{children:[E.jsx(tl,{value:a($),onSelect:W,onMouseMove:()=>g(a($)),className:"truncate cmd-item",children:r($)},a($)+`${F}`),F!==R.length-1&&E.jsx("div",{className:"bg-foreground/10 h-[1px]"},`divider-${F}`)]},a($)+`-fragment-${F}`))})]})]})})}function Pae(){return E.jsx(el,{children:E.jsx(tl,{disabled:!0,children:E.jsxs("div",{className:"flex w-full items-center gap-2",children:[E.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),E.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[E.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),E.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const sb="__message_item",Fae=({id:e})=>{const t=Fe.use.sigmaGraph();return t!=null&&t.hasNode(e)?E.jsx(Iae,{id:e}):null};function zae(e){return E.jsxs("div",{children:[e.type==="nodes"&&E.jsx(Fae,{id:e.id}),e.type==="edges"&&E.jsx(Lae,{id:e.id}),e.type==="message"&&E.jsx("div",{children:e.message})]})}const Bae=({onChange:e,onFocus:t,value:n})=>{const{t:r}=Et(),a=Fe.use.sigmaGraph(),o=Fe.use.searchEngine();w.useEffect(()=>{a&&Fe.getState().resetSearchEngine()},[a]),w.useEffect(()=>{if(!a||a.nodes().length===0||o)return;const l=new Co({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=a.nodes().map(d=>({id:d,label:a.getNodeAttribute(d,"label")}));l.addAll(u),Fe.getState().setSearchEngine(l)},[a,o]);const s=w.useCallback(async l=>{if(t&&t(null),!a||!o)return[];if(a.nodes().length===0)return[];if(!l)return a.nodes().filter(p=>a.hasNode(p)).slice(0,yd).map(p=>({id:p,type:"nodes"}));const u=o.search(l).filter(d=>a.hasNode(d.id)).map(d=>({id:d.id,type:"nodes"}));return u.length<=yd?u:[...u.slice(0,yd),{type:"message",id:sb,message:r("graphPanel.search.message",{count:u.length-yd})}]},[a,o,t,r]);return E.jsx(Mae,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:s,renderOption:zae,getOptionValue:l=>l.id,value:n&&n.type!=="message"?n.id:null,onChange:l=>{l!==sb&&e(l?{id:l,type:"nodes"}:null)},onFocus:l=>{l!==sb&&t&&t(l?{id:l,type:"nodes"}:null)},label:"item",placeholder:r("graphPanel.search.placeholder")})},jae=({...e})=>E.jsx(Bae,{...e});function Uae({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,getDisplayValue:o,notFound:s,loadingSkeleton:l,label:u,placeholder:d="Select...",value:p,onChange:g,disabled:m=!1,className:b,triggerClassName:y,searchInputClassName:v,noResultsMessage:x,triggerTooltip:A,clearable:k=!0}){const[R,O]=w.useState(!1),[N,C]=w.useState(!1),[_,M]=w.useState([]),[D,I]=w.useState(!1),[U,H]=w.useState(null),[B,W]=w.useState(p),[K,G]=w.useState(null),[$,F]=w.useState(""),Y=$T($,t?0:150),[L,V]=w.useState([]),[j,P]=w.useState(null);w.useEffect(()=>{O(!0),W(p)},[p]),w.useEffect(()=>{p&&(!_.length||!K)?P(E.jsx("div",{children:p})):K&&P(null)},[p,_.length,K]),w.useEffect(()=>{if(p&&_.length>0){const Q=_.find(oe=>a(oe)===p);Q&&G(Q)}},[p,_,a]),w.useEffect(()=>{R||(async()=>{try{I(!0),H(null);const oe=await e(p);V(oe),M(oe)}catch(oe){H(oe instanceof Error?oe.message:"Failed to fetch options")}finally{I(!1)}})()},[R,e,p]),w.useEffect(()=>{const Q=async()=>{try{I(!0),H(null);const oe=await e(Y);V(oe),M(oe)}catch(oe){H(oe instanceof Error?oe.message:"Failed to fetch options")}finally{I(!1)}};R&&t?t&&M(Y?L.filter(oe=>n?n(oe,Y):!0):L):Q()},[e,Y,R,t,n]);const Z=w.useCallback(Q=>{const oe=k&&Q===B?"":Q;W(oe),G(_.find(ae=>a(ae)===oe)||null),g(oe),C(!1)},[B,g,k,_,a]);return E.jsxs(mp,{open:N,onOpenChange:C,children:[E.jsx(bp,{asChild:!0,children:E.jsxs(nt,{variant:"outline",role:"combobox","aria-expanded":N,className:Me("justify-between",m&&"cursor-not-allowed opacity-50",y),disabled:m,tooltip:A,side:"bottom",children:[p==="*"?E.jsx("div",{children:"*"}):K?o(K):j||d,E.jsx(cZ,{className:"opacity-50",size:10})]})}),E.jsx(Zc,{className:Me("p-0",b),onCloseAutoFocus:Q=>Q.preventDefault(),align:"start",sideOffset:8,collisionPadding:5,children:E.jsxs(Ap,{shouldFilter:!1,children:[E.jsxs("div",{className:"relative w-full border-b",children:[E.jsx(BT,{placeholder:`Search ${u.toLowerCase()}...`,value:$,onValueChange:Q=>{F(Q)},className:v}),D&&_.length>0&&E.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:E.jsx(jU,{className:"h-4 w-4 animate-spin"})})]}),E.jsxs(Rp,{children:[U&&E.jsx("div",{className:"text-destructive p-4 text-center",children:U}),D&&_.length===0&&(l||E.jsx(Gae,{})),!D&&!U&&_.length===0&&(s||E.jsx(jT,{children:x??`No ${u.toLowerCase()} found.`})),E.jsx(el,{children:_.map(Q=>E.jsxs(tl,{value:a(Q),onSelect:Z,className:"truncate",children:[r(Q),E.jsx(bT,{className:Me("ml-auto h-3 w-3",B===a(Q)?"opacity-100":"opacity-0")})]},a(Q)))})]})]})})]})}function Gae(){return E.jsx(el,{children:E.jsx(tl,{disabled:!0,children:E.jsxs("div",{className:"flex w-full items-center gap-2",children:[E.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),E.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[E.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),E.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const Hae=()=>{const{t:e}=Et(),t=De.use.queryLabel(),n=Fe.use.allDatabaseLabels(),r=Fe.use.labelsFetchAttempted(),a=w.useCallback(()=>{const l=new Co({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=n.map((d,p)=>({id:p,value:d}));return l.addAll(u),{labels:n,searchEngine:l}},[n]),o=w.useCallback(async l=>{const{labels:u,searchEngine:d}=a();let p=u;return l&&(p=d.search(l).map(g=>u[g.id])),p.length<=P_?p:[...p.slice(0,P_),"..."]},[a]);w.useEffect(()=>{r&&(n.length>1?t&&t!=="*"&&!n.includes(t)?(console.log(`Label "${t}" not in available labels, setting to "*"`),De.getState().setQueryLabel("*")):console.log(`Label "${t}" is valid`):t&&n.length<=1&&t&&t!=="*"&&(console.log("Available labels list is empty, setting label to empty"),De.getState().setQueryLabel("")),Fe.getState().setLabelsFetchAttempted(!1))},[n,t,r]);const s=w.useCallback(()=>{Fe.getState().setLabelsFetchAttempted(!1),Fe.getState().setGraphDataFetchAttempted(!1),Fe.getState().setLastSuccessfulQueryLabel("");const l=De.getState().queryLabel;l?(De.getState().setQueryLabel(""),setTimeout(()=>{De.getState().setQueryLabel(l)},0)):De.getState().setQueryLabel("*")},[]);return E.jsxs("div",{className:"flex items-center",children:[E.jsx(nt,{size:"icon",variant:wr,onClick:s,tooltip:e("graphPanel.graphLabels.refreshTooltip"),className:"mr-2",children:E.jsx(UU,{className:"h-4 w-4"})}),E.jsx(Uae,{className:"min-w-[300px]",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:e("graphPanel.graphLabels.selectTooltip"),fetcher:o,renderOption:l=>E.jsx("div",{children:l}),getOptionValue:l=>l,getDisplayValue:l=>E.jsx("div",{children:l}),notFound:E.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:e("graphPanel.graphLabels.label"),placeholder:e("graphPanel.graphLabels.placeholder"),value:t!==null?t:"*",onChange:l=>{const u=De.getState().queryLabel;l==="..."&&(l="*"),l===u&&l!=="*"&&(l="*"),Fe.getState().setGraphDataFetchAttempted(!1),De.getState().setQueryLabel(l)},clearable:!1})]})},Jn=({text:e,className:t,tooltipClassName:n,tooltip:r,side:a,onClick:o})=>r?E.jsx(gT,{delayDuration:200,children:E.jsxs(hT,{children:[E.jsx(mT,{asChild:!0,children:E.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e})}),E.jsx(gp,{side:a,className:n,children:r})]})}):E.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e});var rf={exports:{}},$ae=rf.exports,OO;function qae(){return OO||(OO=1,function(e){(function(t,n,r){function a(u){var d=this,p=l();d.next=function(){var g=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=g-(d.c=g|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(u),d.s0<0&&(d.s0+=1),d.s1-=p(u),d.s1<0&&(d.s1+=1),d.s2-=p(u),d.s2<0&&(d.s2+=1),p=null}function o(u,d){return d.c=u.c,d.s0=u.s0,d.s1=u.s1,d.s2=u.s2,d}function s(u,d){var p=new a(u),g=d&&d.state,m=p.next;return m.int32=function(){return p.next()*4294967296|0},m.double=function(){return m()+(m()*2097152|0)*11102230246251565e-32},m.quick=m,g&&(typeof g=="object"&&o(g,p),m.state=function(){return o(p,{})}),m}function l(){var u=4022871197,d=function(p){p=String(p);for(var g=0;g>>0,m-=u,m*=u,u=m>>>0,m-=u,u+=m*4294967296}return(u>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=s:this.alea=s})($ae,e)}(rf)),rf.exports}var af={exports:{}},Vae=af.exports,IO;function Wae(){return IO||(IO=1,function(e){(function(t,n,r){function a(l){var u=this,d="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var g=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^g^g>>>8},l===(l|0)?u.x=l:d+=l;for(var p=0;p>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(typeof p=="object"&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xor128=s})(Vae,e)}(af)),af.exports}var of={exports:{}},Yae=of.exports,DO;function Kae(){return DO||(DO=1,function(e){(function(t,n,r){function a(l){var u=this,d="";u.next=function(){var g=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(g^g<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:d+=l;for(var p=0;p>>4),u.next()}function o(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function s(l,u){var d=new a(l),p=u&&u.state,g=function(){return(d.next()>>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(typeof p=="object"&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xorwow=s})(Yae,e)}(of)),of.exports}var sf={exports:{}},Xae=sf.exports,LO;function Zae(){return LO||(LO=1,function(e){(function(t,n,r){function a(l){var u=this;u.next=function(){var p=u.x,g=u.i,m,b;return m=p[g],m^=m>>>7,b=m^m<<24,m=p[g+1&7],b^=m^m>>>10,m=p[g+3&7],b^=m^m>>>3,m=p[g+4&7],b^=m^m<<7,m=p[g+7&7],m=m^m<<13,b^=m^m<<9,p[g]=b,u.i=g+1&7,b};function d(p,g){var m,b=[];if(g===(g|0))b[0]=g;else for(g=""+g,m=0;m0;--m)p.next()}d(u,l)}function o(l,u){return u.x=l.x.slice(),u.i=l.i,u}function s(l,u){l==null&&(l=+new Date);var d=new a(l),p=u&&u.state,g=function(){return(d.next()>>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(p.x&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xorshift7=s})(Xae,e)}(sf)),sf.exports}var lf={exports:{}},Qae=lf.exports,MO;function Jae(){return MO||(MO=1,function(e){(function(t,n,r){function a(l){var u=this;u.next=function(){var p=u.w,g=u.X,m=u.i,b,y;return u.w=p=p+1640531527|0,y=g[m+34&127],b=g[m=m+1&127],y^=y<<13,b^=b<<17,y^=y>>>15,b^=b>>>12,y=g[m]=y^b,u.i=m,y+(p^p>>>16)|0};function d(p,g){var m,b,y,v,x,A=[],k=128;for(g===(g|0)?(b=g,g=null):(g=g+"\0",b=0,k=Math.max(k,g.length)),y=0,v=-32;v>>15,b^=b<<4,b^=b>>>13,v>=0&&(x=x+1640531527|0,m=A[v&127]^=b+x,y=m==0?y+1:0);for(y>=128&&(A[(g&&g.length||0)&127]=-1),y=127,v=4*128;v>0;--v)b=A[y+34&127],m=A[y=y+1&127],b^=b<<13,m^=m<<17,b^=b>>>15,m^=m>>>12,A[y]=b^m;p.w=x,p.X=A,p.i=y}d(u,l)}function o(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function s(l,u){l==null&&(l=+new Date);var d=new a(l),p=u&&u.state,g=function(){return(d.next()>>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(p.X&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xor4096=s})(Qae,e)}(lf)),lf.exports}var cf={exports:{}},eoe=cf.exports,PO;function toe(){return PO||(PO=1,function(e){(function(t,n,r){function a(l){var u=this,d="";u.next=function(){var g=u.b,m=u.c,b=u.d,y=u.a;return g=g<<25^g>>>7^m,m=m-b|0,b=b<<24^b>>>8^y,y=y-g|0,u.b=g=g<<20^g>>>12^m,u.c=m=m-b|0,u.d=b<<16^m>>>16^y,u.a=y-g|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):d+=l;for(var p=0;p>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(typeof p=="object"&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.tychei=s})(eoe,e)}(cf)),cf.exports}var uf={exports:{}};const noe={},roe=Object.freeze(Object.defineProperty({__proto__:null,default:noe},Symbol.toStringTag,{value:"Module"})),aoe=uq(roe);var ooe=uf.exports,FO;function ioe(){return FO||(FO=1,function(e){(function(t,n,r){var a=256,o=6,s=52,l="random",u=r.pow(a,o),d=r.pow(2,s),p=d*2,g=a-1,m;function b(O,N,C){var _=[];N=N==!0?{entropy:!0}:N||{};var M=A(x(N.entropy?[O,R(n)]:O??k(),3),_),D=new y(_),I=function(){for(var U=D.g(o),H=u,B=0;U=p;)U/=2,H/=2,B>>>=1;return(U+B)/H};return I.int32=function(){return D.g(4)|0},I.quick=function(){return D.g(4)/4294967296},I.double=I,A(R(D.S),n),(N.pass||C||function(U,H,B,W){return W&&(W.S&&v(W,D),U.state=function(){return v(D,{})}),B?(r[l]=U,H):U})(I,M,"global"in N?N.global:this==r,N.state)}function y(O){var N,C=O.length,_=this,M=0,D=_.i=_.j=0,I=_.S=[];for(C||(O=[C++]);M{const t="#5D6D7E",n=e?e.toLowerCase():"unknown",r=Fe.getState().typeColorMap;if(r.has(n))return r.get(n)||t;const a=coe[n];if(a){const d=BO[a],p=new Map(r);return p.set(n,d),Fe.setState({typeColorMap:p}),d}const o=new Set(Array.from(r.entries()).filter(([,d])=>!Object.values(BO).includes(d)).map(([,d])=>d)),l=uoe.find(d=>!o.has(d))||t,u=new Map(r);return u.set(n,l),Fe.setState({typeColorMap:u}),l},doe=e=>{if(!e)return console.log("Graph validation failed: graph is null"),!1;if(!Array.isArray(e.nodes)||!Array.isArray(e.edges))return console.log("Graph validation failed: nodes or edges is not an array"),!1;if(e.nodes.length===0)return console.log("Graph validation failed: nodes array is empty"),!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return console.log("Graph validation failed: invalid node structure"),!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return console.log("Graph validation failed: invalid edge structure"),!1;for(const t of e.edges){const n=e.getNode(t.source),r=e.getNode(t.target);if(n==null||r==null)return console.log("Graph validation failed: edge references non-existent node"),!1}return console.log("Graph validation passed"),!0},foe=async(e,t,n)=>{let r=null;if(!Fe.getState().lastSuccessfulQueryLabel){console.log("Last successful queryLabel is empty");try{await Fe.getState().fetchAllDatabaseLabels()}catch(l){console.error("Failed to fetch all database labels:",l)}}Fe.getState().setLabelsFetchAttempted(!0);const o=e||"*";try{console.log(`Fetching graph label: ${o}, depth: ${t}, nodes: ${n}`),r=await QB(o,t,n)}catch(l){return rr.getState().setErrorMessage(Gn(l),"Query Graphs Error!"),null}let s=null;if(r){const l={},u={};for(let m=0;m0){const m=w0-ci;for(const b of r.nodes)b.size=Math.round(ci+m*Math.pow((b.degree-d)/g,.5))}s=new xV,s.nodes=r.nodes,s.edges=r.edges,s.nodeIdMap=l,s.edgeIdMap=u,doe(s)||(s=null,console.warn("Invalid graph data")),console.log("Graph data loaded")}return{rawGraph:s,is_truncated:r.is_truncated}},poe=e=>{var l,u;const t=De.getState().minEdgeSize,n=De.getState().maxEdgeSize;if(!e||!e.nodes.length)return console.log("No graph data available, skipping sigma graph creation"),null;const r=new Ac;for(const d of(e==null?void 0:e.nodes)??[]){sk(d.id+Date.now().toString(),{global:!0});const p=Math.random(),g=Math.random();r.addNode(d.id,{label:d.labels.join(", "),color:d.color,x:p,y:g,size:d.size,borderColor:E0,borderSize:.2})}for(const d of(e==null?void 0:e.edges)??[]){const p=((l=d.properties)==null?void 0:l.weight)!==void 0?Number(d.properties.weight):1;d.dynamicId=r.addEdge(d.source,d.target,{label:((u=d.properties)==null?void 0:u.keywords)||void 0,size:p,originalWeight:p,type:"curvedNoArrow"})}let a=Number.MAX_SAFE_INTEGER,o=0;r.forEachEdge(d=>{const p=r.getEdgeAttribute(d,"originalWeight")||1;a=Math.min(a,p),o=Math.max(o,p)});const s=o-a;if(s>0){const d=n-t;r.forEachEdge(p=>{const g=r.getEdgeAttribute(p,"originalWeight")||1,m=t+d*Math.pow((g-a)/s,.5);r.setEdgeAttribute(p,"size",m)})}else r.forEachEdge(d=>{r.setEdgeAttribute(d,"size",t)});return r},goe=()=>{const{t:e}=Et(),t=De.use.queryLabel(),n=Fe.use.rawGraph(),r=Fe.use.sigmaGraph(),a=De.use.graphQueryMaxDepth(),o=De.use.graphMaxNodes(),s=Fe.use.isFetching(),l=Fe.use.nodeToExpand(),u=Fe.use.nodeToPrune(),d=w.useRef(!1),p=w.useRef(!1),g=w.useRef(!1),m=w.useCallback(A=>(n==null?void 0:n.getNode(A))||null,[n]),b=w.useCallback((A,k=!0)=>(n==null?void 0:n.getEdge(A,k))||null,[n]),y=w.useRef(!1);w.useEffect(()=>{if(!t&&(n!==null||r!==null)){const A=Fe.getState();A.reset(),A.setGraphDataFetchAttempted(!1),A.setLabelsFetchAttempted(!1),d.current=!1,p.current=!1}},[t,n,r]),w.useEffect(()=>{if(!y.current&&!(!t&&g.current)&&!s&&!Fe.getState().graphDataFetchAttempted){y.current=!0,Fe.getState().setGraphDataFetchAttempted(!0);const A=Fe.getState();A.setIsFetching(!0),A.clearSelection(),A.sigmaGraph&&A.sigmaGraph.forEachNode(C=>{var _;(_=A.sigmaGraph)==null||_.setNodeAttribute(C,"highlighted",!1)}),console.log("Preparing graph data...");const k=t,R=a,O=o;let N;k?N=foe(k,R,O):(console.log("Query label is empty, show empty graph"),N=Promise.resolve({rawGraph:null,is_truncated:!1})),N.then(C=>{const _=Fe.getState(),M=C==null?void 0:C.rawGraph;if(M&&M.nodes&&M.nodes.forEach(D=>{var U;const I=(U=D.properties)==null?void 0:U.entity_type;D.color=jO(I)}),C!=null&&C.is_truncated&&Ft.info(e("graphPanel.dataIsTruncated","Graph data is truncated to Max Nodes")),_.reset(),!M||!M.nodes||M.nodes.length===0){const D=new Ac;D.addNode("empty-graph-node",{label:e("graphPanel.emptyGraph"),color:"#5D6D7E",x:.5,y:.5,size:15,borderColor:E0,borderSize:.2}),_.setSigmaGraph(D),_.setRawGraph(null),_.setGraphIsEmpty(!0);const I=rr.getState().message,U=I&&I.includes("Authentication required");!U&&k&&De.getState().setQueryLabel(""),U?console.log("Keep queryLabel for post-login reload"):_.setLastSuccessfulQueryLabel(""),console.log(`Graph data is empty, created graph with empty graph node. Auth error: ${U}`)}else{const D=poe(M);M.buildDynamicMap(),_.setSigmaGraph(D),_.setRawGraph(M),_.setGraphIsEmpty(!1),_.setLastSuccessfulQueryLabel(k),_.setMoveToSelectedNode(!0)}d.current=!0,p.current=!0,y.current=!1,_.setIsFetching(!1),(!M||!M.nodes||M.nodes.length===0)&&!k&&(g.current=!0)}).catch(C=>{console.error("Error fetching graph data:",C);const _=Fe.getState();_.setIsFetching(!1),d.current=!1,y.current=!1,_.setGraphDataFetchAttempted(!1),_.setLastSuccessfulQueryLabel("")})}},[t,a,o,s,e]),w.useEffect(()=>{l&&((async k=>{var R,O,N,C,_,M;if(!(!k||!r||!n))try{const D=n.getNode(k);if(!D){console.error("Node not found:",k);return}const I=D.labels[0];if(!I){console.error("Node has no label:",k);return}const U=await QB(I,2,1e3);if(!U||!U.nodes||!U.edges){console.error("Failed to fetch extended graph");return}const H=[];for(const ne of U.nodes){sk(ne.id,{global:!0});const xe=(R=ne.properties)==null?void 0:R.entity_type,Se=jO(xe);H.push({id:ne.id,labels:ne.labels,properties:ne.properties,size:10,x:Math.random(),y:Math.random(),color:Se,degree:0})}const B=[];for(const ne of U.edges)B.push({id:ne.id,source:ne.source,target:ne.target,type:ne.type,properties:ne.properties,dynamicId:""});const W={};r.forEachNode(ne=>{W[ne]={x:r.getNodeAttribute(ne,"x"),y:r.getNodeAttribute(ne,"y")}});const K=new Set(r.nodes()),G=new Set,$=new Set,F=1;let Y=0,L=Number.MAX_SAFE_INTEGER,V=0;r.forEachNode(ne=>{const xe=r.degree(ne);Y=Math.max(Y,xe)}),r.forEachEdge(ne=>{const xe=r.getEdgeAttribute(ne,"originalWeight")||1;L=Math.min(L,xe),V=Math.max(V,xe)});for(const ne of H){if(K.has(ne.id))continue;B.some(Se=>Se.source===k&&Se.target===ne.id||Se.target===k&&Se.source===ne.id)&&G.add(ne.id)}const j=new Map,P=new Map,Z=new Set;for(const ne of B){const xe=K.has(ne.source)||G.has(ne.source),Se=K.has(ne.target)||G.has(ne.target);xe&&Se?($.add(ne.id),G.has(ne.source)?j.set(ne.source,(j.get(ne.source)||0)+1):K.has(ne.source)&&P.set(ne.source,(P.get(ne.source)||0)+1),G.has(ne.target)?j.set(ne.target,(j.get(ne.target)||0)+1):K.has(ne.target)&&P.set(ne.target,(P.get(ne.target)||0)+1)):(r.hasNode(ne.source)?Z.add(ne.source):G.has(ne.source)&&(Z.add(ne.source),j.set(ne.source,(j.get(ne.source)||0)+1)),r.hasNode(ne.target)?Z.add(ne.target):G.has(ne.target)&&(Z.add(ne.target),j.set(ne.target,(j.get(ne.target)||0)+1)))}const Q=(ne,xe,Se,be)=>{const J=be-Se||1,pe=w0-ci;for(const ke of xe)if(ne.hasNode(ke)){let he=ne.degree(ke);he+=1;const Ee=Math.min(he,be+1),se=Math.round(ci+pe*Math.pow((Ee-Se)/J,.5)),Be=ne.getNodeAttribute(ke,"size");se>Be&&ne.setNodeAttribute(ke,"size",se)}},oe=(ne,xe,Se)=>{const be=De.getState().minEdgeSize,J=De.getState().maxEdgeSize,pe=Se-xe||1,ke=J-be;ne.forEachEdge(he=>{const Ee=ne.getEdgeAttribute(he,"originalWeight")||1,se=be+ke*Math.pow((Ee-xe)/pe,.5);ne.setEdgeAttribute(he,"size",se)})};if(G.size===0){Q(r,Z,F,Y),Ft.info(e("graphPanel.propertiesView.node.noNewNodes"));return}for(const[,ne]of j.entries())Y=Math.max(Y,ne);for(const[ne,xe]of P.entries()){const be=r.degree(ne)+xe;Y=Math.max(Y,be)}const ae=Y-F||1,ce=w0-ci,Re=((O=Fe.getState().sigmaInstance)==null?void 0:O.getCamera().ratio)||1,ie=Math.max(Math.sqrt(D.size)*4,Math.sqrt(G.size)*3)/Re;sk(Date.now().toString(),{global:!0});const Te=Math.random()*2*Math.PI;console.log("nodeSize:",D.size,"nodesToAdd:",G.size),console.log("cameraRatio:",Math.round(Re*100)/100,"spreadFactor:",Math.round(ie*100)/100);for(const ne of G){const xe=H.find(Ee=>Ee.id===ne),Se=j.get(ne)||0,be=Math.min(Se,Y+1),J=Math.round(ci+ce*Math.pow((be-F)/ae,.5)),pe=2*Math.PI*(Array.from(G).indexOf(ne)/G.size),ke=((N=W[ne])==null?void 0:N.x)||W[D.id].x+Math.cos(Te+pe)*ie,he=((C=W[ne])==null?void 0:C.y)||W[D.id].y+Math.sin(Te+pe)*ie;r.addNode(ne,{label:xe.labels.join(", "),color:xe.color,x:ke,y:he,size:J,borderColor:E0,borderSize:.2}),n.getNode(ne)||(xe.size=J,xe.x=ke,xe.y=he,xe.degree=Se,n.nodes.push(xe),n.nodeIdMap[ne]=n.nodes.length-1)}for(const ne of $){const xe=B.find(be=>be.id===ne);if(r.hasEdge(xe.source,xe.target))continue;const Se=((_=xe.properties)==null?void 0:_.weight)!==void 0?Number(xe.properties.weight):1;L=Math.min(L,Se),V=Math.max(V,Se),xe.dynamicId=r.addEdge(xe.source,xe.target,{label:((M=xe.properties)==null?void 0:M.keywords)||void 0,size:Se,originalWeight:Se,type:"curvedNoArrow"}),n.getEdge(xe.id,!1)?console.error("Edge already exists in rawGraph:",xe.id):(n.edges.push(xe),n.edgeIdMap[xe.id]=n.edges.length-1,n.edgeDynamicIdMap[xe.dynamicId]=n.edges.length-1)}if(n.buildDynamicMap(),Fe.getState().resetSearchEngine(),Q(r,Z,F,Y),oe(r,L,V),r.hasNode(k)){const ne=r.degree(k),xe=Math.min(ne,Y+1),Se=Math.round(ci+ce*Math.pow((xe-F)/ae,.5));r.setNodeAttribute(k,"size",Se),D.size=Se,D.degree=ne}}catch(D){console.error("Error expanding node:",D)}})(l),window.setTimeout(()=>{Fe.getState().triggerNodeExpand(null)},0))},[l,r,n,e]);const v=w.useCallback((A,k)=>{const R=new Set([A]);return k.forEachNode(O=>{if(O===A)return;const N=k.neighbors(O);N.length===1&&N[0]===A&&R.add(O)}),R},[]);return w.useEffect(()=>{u&&((k=>{if(!(!k||!r||!n))try{const R=Fe.getState();if(!r.hasNode(k)){console.error("Node not found:",k);return}const O=v(k,r);if(O.size===r.nodes().length){Ft.error(e("graphPanel.propertiesView.node.deleteAllNodesError"));return}R.clearSelection();for(const N of O){r.dropNode(N);const C=n.nodeIdMap[N];if(C!==void 0){const _=n.edges.filter(M=>M.source===N||M.target===N);for(const M of _){const D=n.edgeIdMap[M.id];if(D!==void 0){n.edges.splice(D,1);for(const[I,U]of Object.entries(n.edgeIdMap))U>D&&(n.edgeIdMap[I]=U-1);delete n.edgeIdMap[M.id],delete n.edgeDynamicIdMap[M.dynamicId]}}n.nodes.splice(C,1);for(const[M,D]of Object.entries(n.nodeIdMap))D>C&&(n.nodeIdMap[M]=D-1);delete n.nodeIdMap[N]}}n.buildDynamicMap(),Fe.getState().resetSearchEngine(),O.size>1&&Ft.info(e("graphPanel.propertiesView.node.nodesRemoved",{count:O.size}))}catch(R){console.error("Error pruning node:",R)}})(u),window.setTimeout(()=>{Fe.getState().triggerNodePrune(null)},0))},[u,r,n,v,e]),{lightrageGraph:w.useCallback(()=>{if(r)return r;console.log("Creating new Sigma graph instance");const A=new Ac;return Fe.getState().setSigmaGraph(A),A},[r]),getNode:m,getEdge:b}},hoe=()=>{const{getNode:e,getEdge:t}=goe(),n=Fe.use.selectedNode(),r=Fe.use.focusedNode(),a=Fe.use.selectedEdge(),o=Fe.use.focusedEdge(),[s,l]=w.useState(null),[u,d]=w.useState(null);return w.useEffect(()=>{let p=null,g=null;r?(p="node",g=e(r)):n?(p="node",g=e(n)):o?(p="edge",g=t(o,!0)):a&&(p="edge",g=t(a,!0)),g?(p=="node"?l(moe(g)):l(boe(g)),d(p)):(l(null),d(null))},[r,n,o,a,l,d,e,t]),s?E.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:u=="node"?E.jsx(yoe,{node:s}):E.jsx(voe,{edge:s})}):E.jsx(E.Fragment,{})},moe=e=>{const t=Fe.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)try{if(!t.sigmaGraph.hasNode(e.id))return{...e,relationships:[]};const r=t.sigmaGraph.edges(e.id);for(const a of r){if(!t.sigmaGraph.hasEdge(a))continue;const o=t.rawGraph.getEdge(a,!0);if(o){const l=e.id===o.source?o.target:o.source;if(!t.sigmaGraph.hasNode(l))continue;const u=t.rawGraph.getNode(l);u&&n.push({type:"Neighbour",id:l,label:u.properties.entity_id?u.properties.entity_id:u.labels.join(", ")})}}}catch(r){console.error("Error refining node properties:",r)}return{...e,relationships:n}},boe=e=>{const t=Fe.getState();let n,r;if(t.sigmaGraph&&t.rawGraph)try{if(!t.sigmaGraph.hasEdge(e.id))return{...e,sourceNode:void 0,targetNode:void 0};t.sigmaGraph.hasNode(e.source)&&(n=t.rawGraph.getNode(e.source)),t.sigmaGraph.hasNode(e.target)&&(r=t.rawGraph.getNode(e.target))}catch(a){console.error("Error refining edge properties:",a)}return{...e,sourceNode:n,targetNode:r}},ra=({name:e,value:t,onClick:n,tooltip:r})=>{const{t:a}=Et(),o=s=>{const l=`graphPanel.propertiesView.node.propertyNames.${s}`,u=a(l);return u===l?s:u};return E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-primary/60 tracking-wide whitespace-nowrap",children:o(e)}),":",E.jsx(Jn,{className:"hover:bg-primary/20 rounded p-1 overflow-hidden text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||(typeof t=="string"?t:JSON.stringify(t,null,2)),side:"left",onClick:n})]})},yoe=({node:e})=>{const{t}=Et(),n=()=>{Fe.getState().triggerNodeExpand(e.id)},r=()=>{Fe.getState().triggerNodePrune(e.id)};return E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsxs("div",{className:"flex justify-between items-center",children:[E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-blue-700",children:t("graphPanel.propertiesView.node.title")}),E.jsxs("div",{className:"flex gap-3",children:[E.jsx(nt,{size:"icon",variant:"ghost",className:"h-7 w-7 border border-gray-400 hover:bg-gray-200 dark:border-gray-600 dark:hover:bg-gray-700",onClick:n,tooltip:t("graphPanel.propertiesView.node.expandNode"),children:E.jsx(EZ,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),E.jsx(nt,{size:"icon",variant:"ghost",className:"h-7 w-7 border border-gray-400 hover:bg-gray-200 dark:border-gray-600 dark:hover:bg-gray-700",onClick:r,tooltip:t("graphPanel.propertiesView.node.pruneNode"),children:E.jsx(WZ,{className:"h-4 w-4 text-gray-900 dark:text-gray-300"})})]})]}),E.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[E.jsx(ra,{name:t("graphPanel.propertiesView.node.id"),value:e.id}),E.jsx(ra,{name:t("graphPanel.propertiesView.node.labels"),value:e.labels.join(", "),onClick:()=>{Fe.getState().setSelectedNode(e.id,!0)}}),E.jsx(ra,{name:t("graphPanel.propertiesView.node.degree"),value:e.degree})]}),E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-amber-700",children:t("graphPanel.propertiesView.node.properties")}),E.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(a=>E.jsx(ra,{name:a,value:e.properties[a]},a))}),e.relationships.length>0&&E.jsxs(E.Fragment,{children:[E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-emerald-700",children:t("graphPanel.propertiesView.node.relationships")}),E.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:a,id:o,label:s})=>E.jsx(ra,{name:a,value:s,onClick:()=>{Fe.getState().setSelectedNode(o,!0)}},o))})]})]})},voe=({edge:e})=>{const{t}=Et();return E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-violet-700",children:t("graphPanel.propertiesView.edge.title")}),E.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[E.jsx(ra,{name:t("graphPanel.propertiesView.edge.id"),value:e.id}),e.type&&E.jsx(ra,{name:t("graphPanel.propertiesView.edge.type"),value:e.type}),E.jsx(ra,{name:t("graphPanel.propertiesView.edge.source"),value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{Fe.getState().setSelectedNode(e.source,!0)}}),E.jsx(ra,{name:t("graphPanel.propertiesView.edge.target"),value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{Fe.getState().setSelectedNode(e.target,!0)}})]}),E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-amber-700",children:t("graphPanel.propertiesView.edge.properties")}),E.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(n=>E.jsx(ra,{name:n,value:e.properties[n]},n))})]})},Soe=()=>{const{t:e}=Et(),t=De.use.graphQueryMaxDepth(),n=De.use.graphMaxNodes();return E.jsxs("div",{className:"absolute bottom-4 left-[calc(1rem+2.5rem)] flex items-center gap-2 text-xs text-gray-400",children:[E.jsxs("div",{children:[e("graphPanel.sideBar.settings.depth"),": ",t]}),E.jsxs("div",{children:[e("graphPanel.sideBar.settings.max"),": ",n]})]})},wi=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));wi.displayName="Card";const Cc=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Cc.displayName="CardHeader";const _c=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));_c.displayName="CardTitle";const Cp=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Cp.displayName="CardDescription";const Nc=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Nc.displayName="CardContent";const Eoe=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));Eoe.displayName="CardFooter";function woe(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var qT="ScrollArea",[G5,v0e]=$r(qT),[xoe,Rr]=G5(qT),H5=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:o=600,...s}=e,[l,u]=w.useState(null),[d,p]=w.useState(null),[g,m]=w.useState(null),[b,y]=w.useState(null),[v,x]=w.useState(null),[A,k]=w.useState(0),[R,O]=w.useState(0),[N,C]=w.useState(!1),[_,M]=w.useState(!1),D=mt(t,U=>u(U)),I=yp(a);return E.jsx(xoe,{scope:n,type:r,dir:I,scrollHideDelay:o,scrollArea:l,viewport:d,onViewportChange:p,content:g,onContentChange:m,scrollbarX:b,onScrollbarXChange:y,scrollbarXEnabled:N,onScrollbarXEnabledChange:C,scrollbarY:v,onScrollbarYChange:x,scrollbarYEnabled:_,onScrollbarYEnabledChange:M,onCornerWidthChange:k,onCornerHeightChange:O,children:E.jsx(Je.div,{dir:I,...s,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":A+"px","--radix-scroll-area-corner-height":R+"px",...e.style}})})});H5.displayName=qT;var $5="ScrollAreaViewport",q5=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...o}=e,s=Rr($5,n),l=w.useRef(null),u=mt(t,l,s.onViewportChange);return E.jsxs(E.Fragment,{children:[E.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),E.jsx(Je.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:E.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});q5.displayName=$5;var da="ScrollAreaScrollbar",VT=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rr(da,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=a,l=e.orientation==="horizontal";return w.useEffect(()=>(l?o(!0):s(!0),()=>{l?o(!1):s(!1)}),[l,o,s]),a.type==="hover"?E.jsx(koe,{...r,ref:t,forceMount:n}):a.type==="scroll"?E.jsx(Toe,{...r,ref:t,forceMount:n}):a.type==="auto"?E.jsx(V5,{...r,ref:t,forceMount:n}):a.type==="always"?E.jsx(WT,{...r,ref:t}):null});VT.displayName=da;var koe=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rr(da,e.__scopeScrollArea),[o,s]=w.useState(!1);return w.useEffect(()=>{const l=a.scrollArea;let u=0;if(l){const d=()=>{window.clearTimeout(u),s(!0)},p=()=>{u=window.setTimeout(()=>s(!1),a.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",p),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",p)}}},[a.scrollArea,a.scrollHideDelay]),E.jsx(ir,{present:n||o,children:E.jsx(V5,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Toe=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rr(da,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Np(()=>u("SCROLL_END"),100),[l,u]=woe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>u("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,a.scrollHideDelay,u]),w.useEffect(()=>{const d=a.viewport,p=o?"scrollLeft":"scrollTop";if(d){let g=d[p];const m=()=>{const b=d[p];g!==b&&(u("SCROLL"),s()),g=b};return d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[a.viewport,o,u,s]),E.jsx(ir,{present:n||l!=="hidden",children:E.jsx(WT,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ke(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ke(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),V5=w.forwardRef((e,t)=>{const n=Rr(da,e.__scopeScrollArea),{forceMount:r,...a}=e,[o,s]=w.useState(!1),l=e.orientation==="horizontal",u=Np(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,a=Rr(da,e.__scopeScrollArea),o=w.useRef(null),s=w.useRef(0),[l,u]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Z5(l.viewport,l.content),p={...r,sizes:l,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function g(m,b){return Ooe(m,s.current,l,b)}return n==="horizontal"?E.jsx(Aoe,{...p,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const m=a.viewport.scrollLeft,b=UO(m,l,a.dir);o.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollLeft=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollLeft=g(m,a.dir))}}):n==="vertical"?E.jsx(Roe,{...p,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const m=a.viewport.scrollTop,b=UO(m,l);o.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollTop=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollTop=g(m))}}):null}),Aoe=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Rr(da,e.__scopeScrollArea),[s,l]=w.useState(),u=w.useRef(null),d=mt(t,u,o.onScrollbarXChange);return w.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),E.jsx(Y5,{"data-orientation":"horizontal",...a,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":_p(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,g)=>{if(o.viewport){const m=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(m),J5(m,g)&&p.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:If(s.paddingLeft),paddingEnd:If(s.paddingRight)}})}})}),Roe=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Rr(da,e.__scopeScrollArea),[s,l]=w.useState(),u=w.useRef(null),d=mt(t,u,o.onScrollbarYChange);return w.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),E.jsx(Y5,{"data-orientation":"vertical",...a,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":_p(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,g)=>{if(o.viewport){const m=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(m),J5(m,g)&&p.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:If(s.paddingTop),paddingEnd:If(s.paddingBottom)}})}})}),[Coe,W5]=G5(da),Y5=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:g,...m}=e,b=Rr(da,n),[y,v]=w.useState(null),x=mt(t,D=>v(D)),A=w.useRef(null),k=w.useRef(""),R=b.viewport,O=r.content-r.viewport,N=yn(p),C=yn(u),_=Np(g,10);function M(D){if(A.current){const I=D.clientX-A.current.left,U=D.clientY-A.current.top;d({x:I,y:U})}}return w.useEffect(()=>{const D=I=>{const U=I.target;(y==null?void 0:y.contains(U))&&N(I,O)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[R,y,O,N]),w.useEffect(C,[r,C]),zs(y,_),zs(b.content,_),E.jsx(Coe,{scope:n,scrollbar:y,hasThumb:a,onThumbChange:yn(o),onThumbPointerUp:yn(s),onThumbPositionChange:C,onThumbPointerDown:yn(l),children:E.jsx(Je.div,{...m,ref:x,style:{position:"absolute",...m.style},onPointerDown:Ke(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),A.current=y.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),M(D))}),onPointerMove:Ke(e.onPointerMove,M),onPointerUp:Ke(e.onPointerUp,D=>{const I=D.target;I.hasPointerCapture(D.pointerId)&&I.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=k.current,b.viewport&&(b.viewport.style.scrollBehavior=""),A.current=null})})})}),Of="ScrollAreaThumb",K5=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=W5(Of,e.__scopeScrollArea);return E.jsx(ir,{present:n||a.hasThumb,children:E.jsx(_oe,{ref:t,...r})})}),_oe=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,o=Rr(Of,n),s=W5(Of,n),{onThumbPositionChange:l}=s,u=mt(t,g=>s.onThumbChange(g)),d=w.useRef(void 0),p=Np(()=>{d.current&&(d.current(),d.current=void 0)},100);return w.useEffect(()=>{const g=o.viewport;if(g){const m=()=>{if(p(),!d.current){const b=Ioe(g,l);d.current=b,l()}};return l(),g.addEventListener("scroll",m),()=>g.removeEventListener("scroll",m)}},[o.viewport,p,l]),E.jsx(Je.div,{"data-state":s.hasThumb?"visible":"hidden",...a,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ke(e.onPointerDownCapture,g=>{const b=g.target.getBoundingClientRect(),y=g.clientX-b.left,v=g.clientY-b.top;s.onThumbPointerDown({x:y,y:v})}),onPointerUp:Ke(e.onPointerUp,s.onThumbPointerUp)})});K5.displayName=Of;var YT="ScrollAreaCorner",X5=w.forwardRef((e,t)=>{const n=Rr(YT,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?E.jsx(Noe,{...e,ref:t}):null});X5.displayName=YT;var Noe=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Rr(YT,n),[o,s]=w.useState(0),[l,u]=w.useState(0),d=!!(o&&l);return zs(a.scrollbarX,()=>{var g;const p=((g=a.scrollbarX)==null?void 0:g.offsetHeight)||0;a.onCornerHeightChange(p),u(p)}),zs(a.scrollbarY,()=>{var g;const p=((g=a.scrollbarY)==null?void 0:g.offsetWidth)||0;a.onCornerWidthChange(p),s(p)}),d?E.jsx(Je.div,{...r,ref:t,style:{width:o,height:l,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function If(e){return e?parseInt(e,10):0}function Z5(e,t){const n=e/t;return isNaN(n)?0:n}function _p(e){const t=Z5(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Ooe(e,t,n,r="ltr"){const a=_p(n),o=a/2,s=t||o,l=a-s,u=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,p=n.content-n.viewport,g=r==="ltr"?[0,p]:[p*-1,0];return Q5([u,d],g)(e)}function UO(e,t,n="ltr"){const r=_p(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,s=t.content-t.viewport,l=o-r,u=n==="ltr"?[0,s]:[s*-1,0],d=z0(e,u);return Q5([0,s],[0,l])(d)}function Q5(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function J5(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,l=n.top!==o.top;(s||l)&&t(),n=o,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function Np(e,t){const n=yn(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function zs(e,t){const n=yn(t);Rn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var eG=H5,Doe=q5,Loe=X5;const KT=w.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(eG,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[E.jsx(Doe,{className:"h-full w-full rounded-[inherit]",children:t}),E.jsx(tG,{}),E.jsx(Loe,{})]}));KT.displayName=eG.displayName;const tG=w.forwardRef(({className:e,orientation:t="vertical",...n},r)=>E.jsx(VT,{ref:r,orientation:t,className:Me("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:E.jsx(K5,{className:"bg-border relative flex-1 rounded-full"})}));tG.displayName=VT.displayName;const Moe=({className:e})=>{const{t}=Et(),n=Fe.use.typeColorMap();return!n||n.size===0?null:E.jsxs(wi,{className:`p-2 max-w-xs ${e}`,children:[E.jsx("h3",{className:"text-sm font-medium mb-2",children:t("graphPanel.legend")}),E.jsx(KT,{className:"max-h-80",children:E.jsx("div",{className:"flex flex-col gap-1",children:Array.from(n.entries()).map(([r,a])=>E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:a}}),E.jsx("span",{className:"text-xs truncate",title:r,children:t(`graphPanel.nodeTypes.${r.toLowerCase()}`,r)})]},r))})})]})},Poe=()=>{const{t:e}=Et(),t=De.use.showLegend(),n=De.use.setShowLegend(),r=w.useCallback(()=>{n(!t)},[t,n]);return E.jsx(nt,{variant:wr,onClick:r,tooltip:e("graphPanel.sideBar.legendControl.toggleLegend"),size:"icon",children:E.jsx(aZ,{})})},GO={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedNoArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:U4,curvedArrow:Hne,curvedNoArrow:Gne},nodeProgramClasses:{default:Tne,circel:eu,point:Jte},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},Foe=()=>{const e=X4(),t=Ar(),[n,r]=w.useState(null);return w.useEffect(()=>{e({downNode:a=>{r(a.node),t.getGraph().setNodeAttribute(a.node,"highlighted",!0)},mousemovebody:a=>{if(!n)return;const o=t.viewportToGraph(a);t.getGraph().setNodeAttribute(n,"x",o.x),t.getGraph().setNodeAttribute(n,"y",o.y),a.preventSigmaDefault(),a.original.preventDefault(),a.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:a=>{a.original.buttons!==0&&!t.getCustomBBox()&&t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},zoe=()=>{const[e,t]=w.useState(GO),n=w.useRef(null),r=Fe.use.selectedNode(),a=Fe.use.focusedNode(),o=Fe.use.moveToSelectedNode(),s=Fe.use.isFetching(),l=De.use.showPropertyPanel(),u=De.use.showNodeSearchBar(),d=De.use.enableNodeDrag(),p=De.use.showLegend();w.useEffect(()=>{t(GO),console.log("Initialized sigma settings")},[]),w.useEffect(()=>()=>{const v=Fe.getState().sigmaInstance;if(v)try{v.kill(),Fe.getState().setSigmaInstance(null),console.log("Cleared sigma instance on Graphviewer unmount")}catch(x){console.error("Error cleaning up sigma instance:",x)}},[]);const g=w.useCallback(v=>{v===null?Fe.getState().setFocusedNode(null):v.type==="nodes"&&Fe.getState().setFocusedNode(v.id)},[]),m=w.useCallback(v=>{v===null?Fe.getState().setSelectedNode(null):v.type==="nodes"&&Fe.getState().setSelectedNode(v.id,!0)},[]),b=w.useMemo(()=>a??r,[a,r]),y=w.useMemo(()=>r?{type:"nodes",id:r}:null,[r]);return E.jsxs("div",{className:"relative h-full w-full overflow-hidden",children:[E.jsxs(Wte,{settings:e,className:"!bg-background !size-full overflow-hidden",ref:n,children:[E.jsx(lae,{}),d&&E.jsx(Foe,{}),E.jsx($ne,{node:b,move:o}),E.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[E.jsx(Hae,{}),u&&E.jsx(jae,{value:y,onFocus:g,onChange:m})]}),E.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[E.jsx(sae,{}),E.jsx(cae,{}),E.jsx(uae,{}),E.jsx(Poe,{}),E.jsx(vae,{})]}),l&&E.jsx("div",{className:"absolute top-2 right-2",children:E.jsx(hoe,{})}),p&&E.jsx("div",{className:"absolute bottom-10 right-2",children:E.jsx(Moe,{className:"bg-background/60 backdrop-blur-lg"})}),E.jsx(Soe,{})]}),s&&E.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/80 z-10",children:E.jsxs("div",{className:"text-center",children:[E.jsx("div",{className:"mb-2 h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"}),E.jsx("p",{children:"Loading Graph Data..."})]})})]})},nG=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{className:"relative w-full overflow-auto",children:E.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));nG.displayName="Table";const rG=w.forwardRef(({className:e,...t},n)=>E.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));rG.displayName="TableHeader";const aG=w.forwardRef(({className:e,...t},n)=>E.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));aG.displayName="TableBody";const Boe=w.forwardRef(({className:e,...t},n)=>E.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));Boe.displayName="TableFooter";const lk=w.forwardRef(({className:e,...t},n)=>E.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));lk.displayName="TableRow";const wo=w.forwardRef(({className:e,...t},n)=>E.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));wo.displayName="TableHead";const xo=w.forwardRef(({className:e,...t},n)=>E.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xo.displayName="TableCell";const joe=w.forwardRef(({className:e,...t},n)=>E.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));joe.displayName="TableCaption";function Uoe({title:e,description:t,icon:n=hZ,action:r,className:a,...o}){return E.jsxs(wi,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",a),...o,children:[E.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:E.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),E.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[E.jsx(_c,{children:e}),t?E.jsx(Cp,{children:t}):null]}),r||null]})}var cb={exports:{}},ub,HO;function Goe(){if(HO)return ub;HO=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ub=e,ub}var db,$O;function Hoe(){if($O)return db;$O=1;var e=Goe();function t(){}function n(){}return n.resetWarningCache=t,db=function(){function r(s,l,u,d,p,g){if(g!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},db}var qO;function $oe(){return qO||(qO=1,cb.exports=Hoe()()),cb.exports}var qoe=$oe();const It=un(qoe),Voe=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Bs(e,t,n){const r=Woe(e),{webkitRelativePath:a}=e,o=typeof t=="string"?t:typeof a=="string"&&a.length>0?a:`./${e.name}`;return typeof r.path!="string"&&VO(r,"path",o),VO(r,"relativePath",o),r}function Woe(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),a=Voe.get(r);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}function VO(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const Yoe=[".DS_Store","Thumbs.db"];function Koe(e){return Ai(this,void 0,void 0,function*(){return Df(e)&&Xoe(e.dataTransfer)?eie(e.dataTransfer,e.type):Zoe(e)?Qoe(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Joe(e):[]})}function Xoe(e){return Df(e)}function Zoe(e){return Df(e)&&Df(e.target)}function Df(e){return typeof e=="object"&&e!==null}function Qoe(e){return ck(e.target.files).map(t=>Bs(t))}function Joe(e){return Ai(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Bs(n))})}function eie(e,t){return Ai(this,void 0,void 0,function*(){if(e.items){const n=ck(e.items).filter(a=>a.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(tie));return WO(oG(r))}return WO(ck(e.files).map(n=>Bs(n)))})}function WO(e){return e.filter(t=>Yoe.indexOf(t.name)===-1)}function ck(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?oG(n):[n]],[])}function YO(e,t){return Ai(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const s=yield o.getFile();return s.handle=o,Bs(s)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Bs(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function nie(e){return Ai(this,void 0,void 0,function*(){return e.isDirectory?iG(e):rie(e)})}function iG(e){const t=e.createReader();return new Promise((n,r)=>{const a=[];function o(){t.readEntries(s=>Ai(this,void 0,void 0,function*(){if(s.length){const l=Promise.all(s.map(nie));a.push(l),o()}else try{const l=yield Promise.all(a);n(l)}catch(l){r(l)}}),s=>{r(s)})}o()})}function rie(e){return Ai(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const a=Bs(r,e.fullPath);t(a)},r=>{n(r)})})})}var zd={},KO;function aie(){return KO||(KO=1,zd.__esModule=!0,zd.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",a=(e.type||"").toLowerCase(),o=a.replace(/\/.*$/,"");return n.some(function(s){var l=s.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?o===l.replace(/\/.*$/,""):a===l})}return!0}),zd}var oie=aie();const fb=un(oie);function XO(e){return lie(e)||sie(e)||lG(e)||iie()}function iie(){throw new TypeError(`Invalid attempt to spread non-iterable instance. + */var xO;function Ure(){if(xO)return Jm;xO=1;var e=$f();function t(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function l(g,m){var b=m(),y=r({inst:{value:b,getSnapshot:m}}),v=y[0].inst,x=y[1];return o(function(){v.value=b,v.getSnapshot=m,u(v)&&x({inst:v})},[g,b,m]),a(function(){return u(v)&&x({inst:v}),g(function(){u(v)&&x({inst:v})})},[g]),s(b),b}function u(g){var m=g.getSnapshot;g=g.value;try{var b=m();return!n(g,b)}catch{return!0}}function d(g,m){return m()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return Jm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Jm}var kO;function Gre(){return kO||(kO=1,Qm.exports=Ure()),Qm.exports}var Hre=Gre(),cc='[cmdk-group=""]',eb='[cmdk-group-items=""]',$re='[cmdk-group-heading=""]',FT='[cmdk-item=""]',TO=`${FT}:not([aria-disabled="true"])`,nk="cmdk-item-select",ui="data-value",qre=(e,t,n)=>jre(e,t,n),E5=w.createContext(void 0),au=()=>w.useContext(E5),w5=w.createContext(void 0),zT=()=>w.useContext(w5),x5=w.createContext(void 0),k5=w.forwardRef((e,t)=>{let n=Es(()=>{var j,P;return{search:"",value:(P=(j=e.value)!=null?j:e.defaultValue)!=null?P:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Es(()=>new Set),a=Es(()=>new Map),o=Es(()=>new Map),s=Es(()=>new Set),l=T5(e),{label:u,children:d,value:p,onValueChange:g,filter:m,shouldFilter:b,loop:y,disablePointerSelection:v=!1,vimBindings:x=!0,...A}=e,k=An(),R=An(),O=An(),N=w.useRef(null),C=nae();Si(()=>{if(p!==void 0){let j=p.trim();n.current.value=j,_.emit()}},[p]),Si(()=>{C(6,B)},[]);let _=w.useMemo(()=>({subscribe:j=>(s.current.add(j),()=>s.current.delete(j)),snapshot:()=>n.current,setState:(j,P,Z)=>{var Q,oe,ae;if(!Object.is(n.current[j],P)){if(n.current[j]=P,j==="search")H(),I(),C(1,U);else if(j==="value"&&(Z||C(5,B),((Q=l.current)==null?void 0:Q.value)!==void 0)){let ce=P??"";(ae=(oe=l.current).onValueChange)==null||ae.call(oe,ce);return}_.emit()}},emit:()=>{s.current.forEach(j=>j())}}),[]),M=w.useMemo(()=>({value:(j,P,Z)=>{var Q;P!==((Q=o.current.get(j))==null?void 0:Q.value)&&(o.current.set(j,{value:P,keywords:Z}),n.current.filtered.items.set(j,D(P,Z)),C(2,()=>{I(),_.emit()}))},item:(j,P)=>(r.current.add(j),P&&(a.current.has(P)?a.current.get(P).add(j):a.current.set(P,new Set([j]))),C(3,()=>{H(),I(),n.current.value||U(),_.emit()}),()=>{o.current.delete(j),r.current.delete(j),n.current.filtered.items.delete(j);let Z=W();C(4,()=>{H(),(Z==null?void 0:Z.getAttribute("id"))===j&&U(),_.emit()})}),group:j=>(a.current.has(j)||a.current.set(j,new Set),()=>{o.current.delete(j),a.current.delete(j)}),filter:()=>l.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:k,inputId:O,labelId:R,listInnerRef:N}),[]);function D(j,P){var Z,Q;let oe=(Q=(Z=l.current)==null?void 0:Z.filter)!=null?Q:qre;return j?oe(j,n.current.search,P):0}function I(){if(!n.current.search||l.current.shouldFilter===!1)return;let j=n.current.filtered.items,P=[];n.current.filtered.groups.forEach(Q=>{let oe=a.current.get(Q),ae=0;oe.forEach(ce=>{let Re=j.get(ce);ae=Math.max(Re,ae)}),P.push([Q,ae])});let Z=N.current;K().sort((Q,oe)=>{var ae,ce;let Re=Q.getAttribute("id"),ie=oe.getAttribute("id");return((ae=j.get(ie))!=null?ae:0)-((ce=j.get(Re))!=null?ce:0)}).forEach(Q=>{let oe=Q.closest(eb);oe?oe.appendChild(Q.parentElement===oe?Q:Q.closest(`${eb} > *`)):Z.appendChild(Q.parentElement===Z?Q:Q.closest(`${eb} > *`))}),P.sort((Q,oe)=>oe[1]-Q[1]).forEach(Q=>{var oe;let ae=(oe=N.current)==null?void 0:oe.querySelector(`${cc}[${ui}="${encodeURIComponent(Q[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function U(){let j=K().find(Z=>Z.getAttribute("aria-disabled")!=="true"),P=j==null?void 0:j.getAttribute(ui);_.setState("value",P||void 0)}function H(){var j,P,Z,Q;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let ae of r.current){let ce=(P=(j=o.current.get(ae))==null?void 0:j.value)!=null?P:"",Re=(Q=(Z=o.current.get(ae))==null?void 0:Z.keywords)!=null?Q:[],ie=D(ce,Re);n.current.filtered.items.set(ae,ie),ie>0&&oe++}for(let[ae,ce]of a.current)for(let Re of ce)if(n.current.filtered.items.get(Re)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=oe}function B(){var j,P,Z;let Q=W();Q&&(((j=Q.parentElement)==null?void 0:j.firstChild)===Q&&((Z=(P=Q.closest(cc))==null?void 0:P.querySelector($re))==null||Z.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function W(){var j;return(j=N.current)==null?void 0:j.querySelector(`${FT}[aria-selected="true"]`)}function K(){var j;return Array.from(((j=N.current)==null?void 0:j.querySelectorAll(TO))||[])}function G(j){let P=K()[j];P&&_.setState("value",P.getAttribute(ui))}function $(j){var P;let Z=W(),Q=K(),oe=Q.findIndex(ce=>ce===Z),ae=Q[oe+j];(P=l.current)!=null&&P.loop&&(ae=oe+j<0?Q[Q.length-1]:oe+j===Q.length?Q[0]:Q[oe+j]),ae&&_.setState("value",ae.getAttribute(ui))}function F(j){let P=W(),Z=P==null?void 0:P.closest(cc),Q;for(;Z&&!Q;)Z=j>0?eae(Z,cc):tae(Z,cc),Q=Z==null?void 0:Z.querySelector(TO);Q?_.setState("value",Q.getAttribute(ui)):$(j)}let Y=()=>G(K().length-1),L=j=>{j.preventDefault(),j.metaKey?Y():j.altKey?F(1):$(1)},V=j=>{j.preventDefault(),j.metaKey?G(0):j.altKey?F(-1):$(-1)};return w.createElement(Je.div,{ref:t,tabIndex:-1,...A,"cmdk-root":"",onKeyDown:j=>{var P;if((P=A.onKeyDown)==null||P.call(A,j),!j.defaultPrevented)switch(j.key){case"n":case"j":{x&&j.ctrlKey&&L(j);break}case"ArrowDown":{L(j);break}case"p":case"k":{x&&j.ctrlKey&&V(j);break}case"ArrowUp":{V(j);break}case"Home":{j.preventDefault(),G(0);break}case"End":{j.preventDefault(),Y();break}case"Enter":if(!j.nativeEvent.isComposing&&j.keyCode!==229){j.preventDefault();let Z=W();if(Z){let Q=new Event(nk);Z.dispatchEvent(Q)}}}}},w.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:aae},u),Tp(e,j=>w.createElement(w5.Provider,{value:_},w.createElement(E5.Provider,{value:M},j))))}),Vre=w.forwardRef((e,t)=>{var n,r;let a=An(),o=w.useRef(null),s=w.useContext(x5),l=au(),u=T5(e),d=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Si(()=>{if(!d)return l.item(a,s==null?void 0:s.id)},[d]);let p=A5(a,o,[e.value,e.children,o],e.keywords),g=zT(),m=Ei(C=>C.value&&C.value===p.current),b=Ei(C=>d||l.filter()===!1?!0:C.search?C.filtered.items.get(a)>0:!0);w.useEffect(()=>{let C=o.current;if(!(!C||e.disabled))return C.addEventListener(nk,y),()=>C.removeEventListener(nk,y)},[b,e.onSelect,e.disabled]);function y(){var C,_;v(),(_=(C=u.current).onSelect)==null||_.call(C,p.current)}function v(){g.setState("value",p.current,!0)}if(!b)return null;let{disabled:x,value:A,onSelect:k,forceMount:R,keywords:O,...N}=e;return w.createElement(Je.div,{ref:Rc([o,t]),...N,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!m,"data-disabled":!!x,"data-selected":!!m,onPointerMove:x||l.getDisablePointerSelection()?void 0:v,onClick:x?void 0:y},e.children)}),Wre=w.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,s=An(),l=w.useRef(null),u=w.useRef(null),d=An(),p=au(),g=Ei(b=>a||p.filter()===!1?!0:b.search?b.filtered.groups.has(s):!0);Si(()=>p.group(s),[]),A5(s,l,[e.value,e.heading,u]);let m=w.useMemo(()=>({id:s,forceMount:a}),[a]);return w.createElement(Je.div,{ref:Rc([l,t]),...o,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&w.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Tp(e,b=>w.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},w.createElement(x5.Provider,{value:m},b))))}),Yre=w.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=w.useRef(null),o=Ei(s=>!s.search);return!n&&!o?null:w.createElement(Je.div,{ref:Rc([a,t]),...r,"cmdk-separator":"",role:"separator"})}),Kre=w.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=zT(),s=Ei(p=>p.search),l=Ei(p=>p.value),u=au(),d=w.useMemo(()=>{var p;let g=(p=u.listInnerRef.current)==null?void 0:p.querySelector(`${FT}[${ui}="${encodeURIComponent(l)}"]`);return g==null?void 0:g.getAttribute("id")},[]);return w.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),w.createElement(Je.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":d,id:u.inputId,type:"text",value:a?e.value:s,onChange:p=>{a||o.setState("search",p.target.value),n==null||n(p.target.value)}})}),Xre=w.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,o=w.useRef(null),s=w.useRef(null),l=au();return w.useEffect(()=>{if(s.current&&o.current){let u=s.current,d=o.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return g.observe(u),()=>{cancelAnimationFrame(p),g.unobserve(u)}}},[]),w.createElement(Je.div,{ref:Rc([o,t]),...a,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},Tp(e,u=>w.createElement("div",{ref:Rc([s,l.listInnerRef]),"cmdk-list-sizer":""},u)))}),Zre=w.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:s,...l}=e;return w.createElement(Kk,{open:n,onOpenChange:r},w.createElement(Xk,{container:s},w.createElement(ap,{"cmdk-overlay":"",className:a}),w.createElement(op,{"aria-label":e.label,"cmdk-dialog":"",className:o},w.createElement(k5,{ref:t,...l}))))}),Qre=w.forwardRef((e,t)=>Ei(n=>n.filtered.count===0)?w.createElement(Je.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Jre=w.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...o}=e;return w.createElement(Je.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Tp(e,s=>w.createElement("div",{"aria-hidden":!0},s)))}),Vn=Object.assign(k5,{List:Xre,Item:Vre,Input:Kre,Group:Wre,Separator:Yre,Dialog:Zre,Empty:Qre,Loading:Jre});function eae(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function tae(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function T5(e){let t=w.useRef(e);return Si(()=>{t.current=e}),t}var Si=typeof window>"u"?w.useEffect:w.useLayoutEffect;function Es(e){let t=w.useRef();return t.current===void 0&&(t.current=e()),t}function Rc(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ei(e){let t=zT(),n=()=>e(t.snapshot());return Hre.useSyncExternalStore(t.subscribe,n,n)}function A5(e,t,n,r=[]){let a=w.useRef(),o=au();return Si(()=>{var s;let l=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():a.current}})(),u=r.map(d=>d.trim());o.value(e,l,u),(s=t.current)==null||s.setAttribute(ui,l),a.current=l}),a}var nae=()=>{let[e,t]=w.useState(),n=Es(()=>new Map);return Si(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function rae(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Tp({asChild:e,children:t},n){return e&&w.isValidElement(t)?w.cloneElement(rae(t),{ref:t.ref},n(t.props.children)):n(t)}var aae={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ap=w.forwardRef(({className:e,...t},n)=>E.jsx(Vn,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));Ap.displayName=Vn.displayName;const BT=w.forwardRef(({className:e,...t},n)=>E.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[E.jsx(KZ,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),E.jsx(Vn.Input,{ref:n,className:Me("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));BT.displayName=Vn.Input.displayName;const Rp=w.forwardRef(({className:e,...t},n)=>E.jsx(Vn.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));Rp.displayName=Vn.List.displayName;const jT=w.forwardRef((e,t)=>E.jsx(Vn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));jT.displayName=Vn.Empty.displayName;const el=w.forwardRef(({className:e,...t},n)=>E.jsx(Vn.Group,{ref:n,className:Me("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t}));el.displayName=Vn.Group.displayName;const oae=w.forwardRef(({className:e,...t},n)=>E.jsx(Vn.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));oae.displayName=Vn.Separator.displayName;const tl=w.forwardRef(({className:e,...t},n)=>E.jsx(Vn.Item,{ref:n,className:Me("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));tl.displayName=Vn.Item.displayName;const iae=({layout:e,autoRunFor:t,mainLayout:n})=>{const r=Ar(),[a,o]=w.useState(!1),s=w.useRef(null),{t:l}=Et(),u=w.useCallback(()=>{if(r)try{const p=r.getGraph();if(!p||p.order===0)return;const g=n.positions();q4(p,g,{duration:300})}catch(p){console.error("Error updating positions:",p),s.current&&(window.clearInterval(s.current),s.current=null,o(!1))}},[r,n]),d=w.useCallback(()=>{if(a){console.log("Stopping layout animation"),s.current&&(window.clearInterval(s.current),s.current=null);try{typeof e.kill=="function"?(e.kill(),console.log("Layout algorithm killed")):typeof e.stop=="function"&&(e.stop(),console.log("Layout algorithm stopped"))}catch(p){console.error("Error stopping layout algorithm:",p)}o(!1)}else console.log("Starting layout animation"),u(),s.current=window.setInterval(()=>{u()},200),o(!0),setTimeout(()=>{if(s.current){console.log("Auto-stopping layout animation after 3 seconds"),window.clearInterval(s.current),s.current=null,o(!1);try{typeof e.kill=="function"?e.kill():typeof e.stop=="function"&&e.stop()}catch(p){console.error("Error stopping layout algorithm:",p)}}},3e3)},[a,e,u]);return w.useEffect(()=>{if(!r){console.log("No sigma instance available");return}let p=null;return t!==void 0&&t>-1&&r.getGraph().order>0&&(console.log("Auto-starting layout animation"),u(),s.current=window.setInterval(()=>{u()},200),o(!0),t>0&&(p=window.setTimeout(()=>{console.log("Auto-stopping layout animation after timeout"),s.current&&(window.clearInterval(s.current),s.current=null),o(!1)},t))),()=>{s.current&&(window.clearInterval(s.current),s.current=null),p&&window.clearTimeout(p),o(!1)}},[t,r,u]),E.jsx(nt,{size:"icon",onClick:d,tooltip:l(a?"graphPanel.sideBar.layoutsControl.stopAnimation":"graphPanel.sideBar.layoutsControl.startAnimation"),variant:wr,children:a?E.jsx(zZ,{}):E.jsx(jZ,{})})},sae=()=>{const e=Ar(),{t}=Et(),[n,r]=w.useState("Circular"),[a,o]=w.useState(!1),s=De.use.graphLayoutMaxIterations(),l=ere(),u=Xne(),d=Ore(),p=Are({maxIterations:s,settings:{margin:5,expansion:1.1,gridSize:1,ratio:1,speed:3}}),g=sre({maxIterations:s,settings:{attraction:3e-4,repulsion:.02,gravity:.02,inertia:.4,maxMove:100}}),m=b5({iterations:s}),b=Rre(),y=lre(),v=bre(),x=w.useMemo(()=>({Circular:{layout:l},Circlepack:{layout:u},Random:{layout:d},Noverlaps:{layout:p,worker:b},"Force Directed":{layout:g,worker:y},"Force Atlas":{layout:m,worker:v}}),[u,l,g,m,p,d,y,b,v]),A=w.useCallback(k=>{console.debug("Running layout:",k);const{positions:R}=x[k].layout;try{const O=e.getGraph();if(!O){console.error("No graph available");return}const N=R();console.log("Positions calculated, animating nodes"),q4(O,N,{duration:400}),r(k)}catch(O){console.error("Error running layout:",O)}},[x,e]);return E.jsxs("div",{children:[E.jsx("div",{children:x[n]&&"worker"in x[n]&&E.jsx(iae,{layout:x[n].worker,mainLayout:x[n].layout})}),E.jsx("div",{children:E.jsxs(mp,{open:a,onOpenChange:o,children:[E.jsx(bp,{asChild:!0,children:E.jsx(nt,{size:"icon",variant:wr,onClick:()=>o(k=>!k),tooltip:t("graphPanel.sideBar.layoutsControl.layoutGraph"),children:E.jsx(TZ,{})})}),E.jsx(Zc,{side:"right",align:"start",sideOffset:8,collisionPadding:5,sticky:"always",className:"p-1 min-w-auto",children:E.jsx(Ap,{children:E.jsx(Rp,{children:E.jsx(el,{children:Object.keys(x).map(k=>E.jsx(tl,{onSelect:()=>{A(k)},className:"cursor-pointer text-xs",children:t(`graphPanel.sideBar.layoutsControl.layouts.${k}`)},k))})})})})]})})]})},R5=()=>{const e=w.useContext(nj);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Md=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),lae=({disableHoverEffect:e})=>{const t=Ar(),n=X4(),r=K4(),a=De.use.graphLayoutMaxIterations(),{assign:o}=b5({iterations:a}),{theme:s}=R5(),l=De.use.enableHideUnselectedEdges(),u=De.use.enableEdgeEvents(),d=De.use.showEdgeLabel(),p=De.use.showNodeLabel(),g=De.use.minEdgeSize(),m=De.use.maxEdgeSize(),b=Fe.use.selectedNode(),y=Fe.use.focusedNode(),v=Fe.use.selectedEdge(),x=Fe.use.focusedEdge(),A=Fe.use.sigmaGraph();return w.useEffect(()=>{if(A&&t){try{typeof t.setGraph=="function"?(t.setGraph(A),console.log("Binding graph to sigma instance")):(t.graph=A,console.warn("Simgma missing setGraph function, set graph property directly"))}catch(k){console.error("Error setting graph on sigma instance:",k)}o(),console.log("Initial layout applied to graph")}},[t,A,o,a]),w.useEffect(()=>{t&&(Fe.getState().sigmaInstance||(console.log("Setting sigma instance from GraphControl"),Fe.getState().setSigmaInstance(t)))},[t]),w.useEffect(()=>{const{setFocusedNode:k,setSelectedNode:R,setFocusedEdge:O,setSelectedEdge:N,clearSelection:C}=Fe.getState(),_={enterNode:M=>{Md(M.event.original)||k(M.node)},leaveNode:M=>{Md(M.event.original)||k(null)},clickNode:M=>{R(M.node),N(null)},clickStage:()=>C()};u&&(_.clickEdge=M=>{N(M.edge),R(null)},_.enterEdge=M=>{Md(M.event.original)||O(M.edge)},_.leaveEdge=M=>{Md(M.event.original)||O(null)}),n(_)},[n,u]),w.useEffect(()=>{if(t&&A){const k=t.getGraph();let R=Number.MAX_SAFE_INTEGER,O=0;k.forEachEdge(C=>{const _=k.getEdgeAttribute(C,"originalWeight")||1;typeof _=="number"&&(R=Math.min(R,_),O=Math.max(O,_))});const N=O-R;if(N>0){const C=m-g;k.forEachEdge(_=>{const M=k.getEdgeAttribute(_,"originalWeight")||1;if(typeof M=="number"){const D=g+C*Math.pow((M-R)/N,.5);k.setEdgeAttribute(_,"size",D)}})}else k.forEachEdge(C=>{k.setEdgeAttribute(C,"size",g)});t.refresh()}},[t,A,g,m]),w.useEffect(()=>{const k=s==="dark",R=k?cV:void 0,O=k?pV:void 0;r({enableEdgeEvents:u,renderEdgeLabels:d,renderLabels:p,nodeReducer:(N,C)=>{const _=t.getGraph(),M={...C,highlighted:C.highlighted||!1,labelColor:R};if(!e){M.highlighted=!1;const D=y||b,I=x||v;if(D&&_.hasNode(D))try{(N===D||_.neighbors(D).includes(N))&&(M.highlighted=!0,N===b&&(M.borderColor=fV))}catch(U){console.error("Error in nodeReducer:",U)}else if(I&&_.hasEdge(I))_.extremities(I).includes(N)&&(M.highlighted=!0,M.size=3);else return M;M.highlighted?k&&(M.labelColor=uV):M.color=dV}return M},edgeReducer:(N,C)=>{const _=t.getGraph(),M={...C,hidden:!1,labelColor:R,color:O};if(!e){const D=y||b;if(D&&_.hasNode(D))try{l?_.extremities(N).includes(D)||(M.hidden=!0):_.extremities(N).includes(D)&&(M.color=M_)}catch(I){console.error("Error in edgeReducer:",I)}else{const I=v&&_.hasEdge(v)?v:null,U=x&&_.hasEdge(x)?x:null;(I||U)&&(N===I?M.color=gV:N===U?M.color=M_:l&&(M.hidden=!0))}}return M}})},[b,y,v,x,r,t,e,s,l,u,d,p]),null},cae=()=>{const{zoomIn:e,zoomOut:t,reset:n}=Z4({duration:200,factor:1.5}),r=Ar(),{t:a}=Et(),o=w.useCallback(()=>e(),[e]),s=w.useCallback(()=>t(),[t]),l=w.useCallback(()=>{if(r)try{r.setCustomBBox(null),r.refresh();const p=r.getGraph();if(!(p!=null&&p.order)||p.nodes().length===0){n();return}r.getCamera().animate({x:.5,y:.5,ratio:1.1},{duration:1e3})}catch(p){console.error("Error resetting zoom:",p),n()}},[r,n]),u=w.useCallback(()=>{if(!r)return;const p=r.getCamera(),m=p.angle+Math.PI/8;p.animate({angle:m},{duration:200})},[r]),d=w.useCallback(()=>{if(!r)return;const p=r.getCamera(),m=p.angle-Math.PI/8;p.animate({angle:m},{duration:200})},[r]);return E.jsxs(E.Fragment,{children:[E.jsx(nt,{variant:wr,onClick:d,tooltip:a("graphPanel.sideBar.zoomControl.rotateCameraCounterClockwise"),size:"icon",children:E.jsx(HZ,{})}),E.jsx(nt,{variant:wr,onClick:u,tooltip:a("graphPanel.sideBar.zoomControl.rotateCamera"),size:"icon",children:E.jsx(qZ,{})}),E.jsx(nt,{variant:wr,onClick:l,tooltip:a("graphPanel.sideBar.zoomControl.resetZoom"),size:"icon",children:E.jsx(vZ,{})}),E.jsx(nt,{variant:wr,onClick:o,tooltip:a("graphPanel.sideBar.zoomControl.zoomIn"),size:"icon",children:E.jsx(sQ,{})}),E.jsx(nt,{variant:wr,onClick:s,tooltip:a("graphPanel.sideBar.zoomControl.zoomOut"),size:"icon",children:E.jsx(cQ,{})})]})},uae=()=>{const{isFullScreen:e,toggle:t}=Vte(),{t:n}=Et();return E.jsx(E.Fragment,{children:e?E.jsx(nt,{variant:wr,onClick:t,tooltip:n("graphPanel.sideBar.fullScreenControl.windowed"),size:"icon",children:E.jsx(LZ,{})}):E.jsx(nt,{variant:wr,onClick:t,tooltip:n("graphPanel.sideBar.fullScreenControl.fullScreen"),size:"icon",children:E.jsx(IZ,{})})})};var UT="Checkbox",[dae,y0e]=$r(UT),[fae,pae]=dae(UT),C5=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:s,disabled:l,value:u="on",onCheckedChange:d,form:p,...g}=e,[m,b]=w.useState(null),y=mt(t,O=>b(O)),v=w.useRef(!1),x=m?p||!!m.closest("form"):!0,[A=!1,k]=ja({prop:a,defaultProp:o,onChange:d}),R=w.useRef(A);return w.useEffect(()=>{const O=m==null?void 0:m.form;if(O){const N=()=>k(R.current);return O.addEventListener("reset",N),()=>O.removeEventListener("reset",N)}},[m,k]),E.jsxs(fae,{scope:n,state:A,disabled:l,children:[E.jsx(Je.button,{type:"button",role:"checkbox","aria-checked":Ro(A)?"mixed":A,"aria-required":s,"data-state":O5(A),"data-disabled":l?"":void 0,disabled:l,value:u,...g,ref:y,onKeyDown:Ke(e.onKeyDown,O=>{O.key==="Enter"&&O.preventDefault()}),onClick:Ke(e.onClick,O=>{k(N=>Ro(N)?!0:!N),x&&(v.current=O.isPropagationStopped(),v.current||O.stopPropagation())})}),x&&E.jsx(gae,{control:m,bubbles:!v.current,name:r,value:u,checked:A,required:s,disabled:l,form:p,style:{transform:"translateX(-100%)"},defaultChecked:Ro(o)?!1:o})]})});C5.displayName=UT;var _5="CheckboxIndicator",N5=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=pae(_5,n);return E.jsx(ir,{present:r||Ro(o.state)||o.state===!0,children:E.jsx(Je.span,{"data-state":O5(o.state),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});N5.displayName=_5;var gae=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:a,...o}=e,s=w.useRef(null),l=o3(n),u=pU(t);w.useEffect(()=>{const p=s.current,g=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(g,"checked").set;if(l!==n&&b){const y=new Event("click",{bubbles:r});p.indeterminate=Ro(n),b.call(p,Ro(n)?!1:n),p.dispatchEvent(y)}},[l,n,r]);const d=w.useRef(Ro(n)?!1:n);return E.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a??d.current,...o,tabIndex:-1,ref:s,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ro(e){return e==="indeterminate"}function O5(e){return Ro(e)?"indeterminate":e?"checked":"unchecked"}var I5=C5,hae=N5;const Ns=w.forwardRef(({className:e,...t},n)=>E.jsx(I5,{ref:n,className:Me("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-muted data-[state=checked]:text-muted-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:E.jsx(hae,{className:Me("flex items-center justify-center text-current"),children:E.jsx(bT,{className:"h-4 w-4"})})}));Ns.displayName=I5.displayName;var mae="Separator",AO="horizontal",bae=["horizontal","vertical"],D5=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=AO,...a}=e,o=yae(r)?r:AO,l=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return E.jsx(Je.div,{"data-orientation":o,...l,...a,ref:t})});D5.displayName=mae;function yae(e){return bae.includes(e)}var L5=D5;const ws=w.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>E.jsx(L5,{ref:a,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ws.displayName=L5.displayName;const vo=({checked:e,onCheckedChange:t,label:n})=>{const r=`checkbox-${n.toLowerCase().replace(/\s+/g,"-")}`;return E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(Ns,{id:r,checked:e,onCheckedChange:t}),E.jsx("label",{htmlFor:r,className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]})},tb=({value:e,onEditFinished:t,label:n,min:r,max:a,defaultValue:o})=>{const{t:s}=Et(),[l,u]=w.useState(e),d=`input-${n.toLowerCase().replace(/\s+/g,"-")}`,p=w.useCallback(b=>{const y=b.target.value.trim();if(y.length===0){u(null);return}const v=Number.parseInt(y);if(!isNaN(v)&&v!==l){if(r!==void 0&&va)return;u(v)}},[l,r,a]),g=w.useCallback(()=>{l!==null&&e!==l&&t(l)},[e,l,t]),m=w.useCallback(()=>{o!==void 0&&e!==o&&(u(o),t(o))},[o,e,t]);return E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("label",{htmlFor:d,className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n}),E.jsxs("div",{className:"flex items-center gap-1",children:[E.jsx(Tr,{id:d,type:"number",value:l===null?"":l,onChange:p,className:"h-6 w-full min-w-0 pr-1",min:r,max:a,onBlur:g,onKeyDown:b=>{b.key==="Enter"&&g()}}),o!==void 0&&E.jsx(nt,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 hover:bg-muted text-muted-foreground hover:text-foreground",onClick:m,type:"button",title:s("graphPanel.sideBar.settings.resetToDefault"),children:E.jsx(GU,{className:"h-3.5 w-3.5"})})]})]})};function vae(){const[e,t]=w.useState(!1),n=De.use.showPropertyPanel(),r=De.use.showNodeSearchBar(),a=De.use.showNodeLabel(),o=De.use.enableEdgeEvents(),s=De.use.enableNodeDrag(),l=De.use.enableHideUnselectedEdges(),u=De.use.showEdgeLabel(),d=De.use.minEdgeSize(),p=De.use.maxEdgeSize(),g=De.use.graphQueryMaxDepth(),m=De.use.graphMaxNodes(),b=De.use.graphLayoutMaxIterations(),y=De.use.enableHealthCheck(),v=w.useCallback(()=>De.setState(H=>({enableNodeDrag:!H.enableNodeDrag})),[]),x=w.useCallback(()=>De.setState(H=>({enableEdgeEvents:!H.enableEdgeEvents})),[]),A=w.useCallback(()=>De.setState(H=>({enableHideUnselectedEdges:!H.enableHideUnselectedEdges})),[]),k=w.useCallback(()=>De.setState(H=>({showEdgeLabel:!H.showEdgeLabel})),[]),R=w.useCallback(()=>De.setState(H=>({showPropertyPanel:!H.showPropertyPanel})),[]),O=w.useCallback(()=>De.setState(H=>({showNodeSearchBar:!H.showNodeSearchBar})),[]),N=w.useCallback(()=>De.setState(H=>({showNodeLabel:!H.showNodeLabel})),[]),C=w.useCallback(()=>De.setState(H=>({enableHealthCheck:!H.enableHealthCheck})),[]),_=w.useCallback(H=>{if(H<1)return;De.setState({graphQueryMaxDepth:H});const B=De.getState().queryLabel;De.getState().setQueryLabel(""),setTimeout(()=>{De.getState().setQueryLabel(B)},300)},[]),M=w.useCallback(H=>{if(H<1||H>1e3)return;De.setState({graphMaxNodes:H});const B=De.getState().queryLabel;De.getState().setQueryLabel(""),setTimeout(()=>{De.getState().setQueryLabel(B)},300)},[]),D=w.useCallback(H=>{H<1||De.setState({graphLayoutMaxIterations:H})},[]),{t:I}=Et(),U=()=>t(!1);return E.jsx(E.Fragment,{children:E.jsxs(mp,{open:e,onOpenChange:t,children:[E.jsx(bp,{asChild:!0,children:E.jsx(nt,{variant:wr,tooltip:I("graphPanel.sideBar.settings.settings"),size:"icon",children:E.jsx(JZ,{})})}),E.jsx(Zc,{side:"right",align:"end",sideOffset:8,collisionPadding:5,className:"p-2 max-w-[200px]",onCloseAutoFocus:H=>H.preventDefault(),children:E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx(vo,{checked:y,onCheckedChange:C,label:I("graphPanel.sideBar.settings.healthCheck")}),E.jsx(ws,{}),E.jsx(vo,{checked:n,onCheckedChange:R,label:I("graphPanel.sideBar.settings.showPropertyPanel")}),E.jsx(vo,{checked:r,onCheckedChange:O,label:I("graphPanel.sideBar.settings.showSearchBar")}),E.jsx(ws,{}),E.jsx(vo,{checked:a,onCheckedChange:N,label:I("graphPanel.sideBar.settings.showNodeLabel")}),E.jsx(vo,{checked:s,onCheckedChange:v,label:I("graphPanel.sideBar.settings.nodeDraggable")}),E.jsx(ws,{}),E.jsx(vo,{checked:u,onCheckedChange:k,label:I("graphPanel.sideBar.settings.showEdgeLabel")}),E.jsx(vo,{checked:l,onCheckedChange:A,label:I("graphPanel.sideBar.settings.hideUnselectedEdges")}),E.jsx(vo,{checked:o,onCheckedChange:x,label:I("graphPanel.sideBar.settings.edgeEvents")}),E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("label",{htmlFor:"edge-size-min",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:I("graphPanel.sideBar.settings.edgeSizeRange")}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(Tr,{id:"edge-size-min",type:"number",value:d,onChange:H=>{const B=Number(H.target.value);!isNaN(B)&&B>=1&&B<=p&&De.setState({minEdgeSize:B})},className:"h-6 w-16 min-w-0 pr-1",min:1,max:Math.min(p,10)}),E.jsx("span",{children:"-"}),E.jsxs("div",{className:"flex items-center gap-1",children:[E.jsx(Tr,{id:"edge-size-max",type:"number",value:p,onChange:H=>{const B=Number(H.target.value);!isNaN(B)&&B>=d&&B>=1&&B<=10&&De.setState({maxEdgeSize:B})},className:"h-6 w-16 min-w-0 pr-1",min:d,max:10}),E.jsx(nt,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0 hover:bg-muted text-muted-foreground hover:text-foreground",onClick:()=>De.setState({minEdgeSize:1,maxEdgeSize:5}),type:"button",title:I("graphPanel.sideBar.settings.resetToDefault"),children:E.jsx(GU,{className:"h-3.5 w-3.5"})})]})]})]}),E.jsx(ws,{}),E.jsx(tb,{label:I("graphPanel.sideBar.settings.maxQueryDepth"),min:1,value:g,defaultValue:3,onEditFinished:_}),E.jsx(tb,{label:I("graphPanel.sideBar.settings.maxNodes"),min:1,max:1e3,value:m,defaultValue:1e3,onEditFinished:M}),E.jsx(tb,{label:I("graphPanel.sideBar.settings.maxLayoutIterations"),min:1,max:30,value:b,defaultValue:15,onEditFinished:D}),E.jsx(ws,{}),E.jsx(nt,{onClick:U,variant:"outline",size:"sm",className:"ml-auto px-4",children:I("graphPanel.sideBar.settings.save")})]})})]})})}const Sae="ENTRIES",M5="KEYS",P5="VALUES",bn="";class nb{constructor(t,n){const r=t._tree,a=Array.from(r.keys());this.set=t,this._type=n,this._path=a.length>0?[{node:r,keys:a}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=hs(this._path);if(hs(n)===bn)return{done:!1,value:this.result()};const r=t.get(hs(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=hs(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>hs(t)).filter(t=>t!==bn).join("")}value(){return hs(this._path).node.get(bn)}result(){switch(this._type){case P5:return this.value();case M5:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const hs=e=>e[e.length-1],Eae=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const a=t.length+1,o=a+n,s=new Uint8Array(o*a).fill(n+1);for(let l=0;l{const u=o*s;e:for(const d of e.keys())if(d===bn){const p=a[u-1];p<=n&&r.set(l,[e.get(d),p])}else{let p=o;for(let g=0;gn)continue e}F5(e.get(d),t,n,r,a,p,s,l+d)}};class To{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Nf(this._tree,t.slice(this._prefix.length));if(n===void 0){const[a,o]=GT(r);for(const s of a.keys())if(s!==bn&&s.startsWith(o)){const l=new Map;return l.set(s.slice(o.length),a.get(s)),new To(l,t)}}return new To(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,wae(this._tree,t)}entries(){return new nb(this,Sae)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return Eae(this._tree,t,n)}get(t){const n=rk(this._tree,t);return n!==void 0?n.get(bn):void 0}has(t){const n=rk(this._tree,t);return n!==void 0&&n.has(bn)}keys(){return new nb(this,M5)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,rb(this._tree,t).set(bn,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=rb(this._tree,t);return r.set(bn,n(r.get(bn))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=rb(this._tree,t);let a=r.get(bn);return a===void 0&&r.set(bn,a=n()),a}values(){return new nb(this,P5)}[Symbol.iterator](){return this.entries()}static from(t){const n=new To;for(const[r,a]of t)n.set(r,a);return n}static fromObject(t){return To.from(Object.entries(t))}}const Nf=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==bn&&t.startsWith(r))return n.push([e,r]),Nf(e.get(r),t.slice(r.length),n);return n.push([e,t]),Nf(void 0,"",n)},rk=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==bn&&t.startsWith(n))return rk(e.get(n),t.slice(n.length))},rb=(e,t)=>{const n=t.length;e:for(let r=0;e&&r{const[n,r]=Nf(e,t);if(n!==void 0){if(n.delete(bn),n.size===0)z5(r);else if(n.size===1){const[a,o]=n.entries().next().value;B5(r,a,o)}}},z5=e=>{if(e.length===0)return;const[t,n]=GT(e);if(t.delete(n),t.size===0)z5(e.slice(0,-1));else if(t.size===1){const[r,a]=t.entries().next().value;r!==bn&&B5(e.slice(0,-1),r,a)}},B5=(e,t,n)=>{if(e.length===0)return;const[r,a]=GT(e);r.set(a+t,n),r.delete(a)},GT=e=>e[e.length-1],HT="or",j5="and",xae="and_not";class Co{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?ib:t.autoVacuum;this._options={...ob,...t,autoVacuum:n,searchOptions:{...RO,...t.searchOptions||{}},autoSuggestOptions:{...Cae,...t.autoSuggestOptions||{}}},this._index=new To,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=ok,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:a,fields:o,idField:s}=this._options,l=n(t,s);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);if(this._idToShortId.has(l))throw new Error(`MiniSearch: duplicate ID ${l}`);const u=this.addDocumentId(l);this.saveStoredFields(u,t);for(const d of o){const p=n(t,d);if(p==null)continue;const g=r(p.toString(),d),m=this._fieldIds[d],b=new Set(g).size;this.addFieldLength(u,m,this._documentCount-1,b);for(const y of g){const v=a(y,d);if(Array.isArray(v))for(const x of v)this.addTerm(m,u,x);else v&&this.addTerm(m,u,v)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,a={chunk:[],promise:Promise.resolve()},{chunk:o,promise:s}=t.reduce(({chunk:l,promise:u},d,p)=>(l.push(d),(p+1)%r===0?{chunk:[],promise:u.then(()=>new Promise(g=>setTimeout(g,0))).then(()=>this.addAll(l))}:{chunk:l,promise:u}),a);return s.then(()=>this.addAll(o))}remove(t){const{tokenize:n,processTerm:r,extractField:a,fields:o,idField:s}=this._options,l=a(t,s);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${s}"`);const u=this._idToShortId.get(l);if(u==null)throw new Error(`MiniSearch: cannot remove document with ID ${l}: it is not in the index`);for(const d of o){const p=a(t,d);if(p==null)continue;const g=n(p.toString(),d),m=this._fieldIds[d],b=new Set(g).size;this.removeFieldLength(u,m,this._documentCount,b);for(const y of g){const v=r(y,d);if(Array.isArray(v))for(const x of v)this.removeTerm(m,u,x);else v&&this.removeTerm(m,u,v)}}this._storedFields.delete(u),this._documentIds.delete(u),this._idToShortId.delete(l),this._fieldLength.delete(u),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new To,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,a)=>{this.removeFieldLength(n,a,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:a}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:a},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,a=r(t,n);this.discard(a),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=ok,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}async performVacuuming(t,n){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const a=t.batchSize||ak.batchSize,o=t.batchWait||ak.batchWait;let s=1;for(const[l,u]of this._index){for(const[d,p]of u)for(const[g]of p)this._documentIds.has(g)||(p.size<=1?u.delete(d):p.delete(g));this._index.get(l).size===0&&this._index.delete(l),s%a===0&&await new Promise(d=>setTimeout(d,o)),s+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||ib.minDirtCount,r=r||ib.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,a={...r,...n},o=this.executeQuery(t,n),s=[];for(const[l,{score:u,terms:d,match:p}]of o){const g=d.length||1,m={id:this._documentIds.get(l),score:u*g,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(m,this._storedFields.get(l)),(a.filter==null||a.filter(m))&&s.push(m)}return t===Co.wildcard&&a.boostDocument==null||s.sort(_O),s}autoSuggest(t,n={}){n={...this._options.autoSuggestOptions,...n};const r=new Map;for(const{score:o,terms:s}of this.search(t,n)){const l=s.join(" "),u=r.get(l);u!=null?(u.score+=o,u.count+=1):r.set(l,{score:o,terms:s,count:1})}const a=[];for(const[o,{score:s,terms:l,count:u}]of r)a.push({suggestion:o,terms:l,score:s/u});return a.sort(_O),a}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static async loadJSONAsync(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)}static getDefault(t){if(ob.hasOwnProperty(t))return ab(ob,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:a,fieldLength:o,storedFields:s,serializationVersion:l}=t,u=this.instantiateMiniSearch(t,n);u._documentIds=Pd(a),u._fieldLength=Pd(o),u._storedFields=Pd(s);for(const[d,p]of u._documentIds)u._idToShortId.set(p,d);for(const[d,p]of r){const g=new Map;for(const m of Object.keys(p)){let b=p[m];l===1&&(b=b.ds),g.set(parseInt(m,10),Pd(b))}u._index.set(d,g)}return u}static async loadJSAsync(t,n){const{index:r,documentIds:a,fieldLength:o,storedFields:s,serializationVersion:l}=t,u=this.instantiateMiniSearch(t,n);u._documentIds=await Fd(a),u._fieldLength=await Fd(o),u._storedFields=await Fd(s);for(const[p,g]of u._documentIds)u._idToShortId.set(g,p);let d=0;for(const[p,g]of r){const m=new Map;for(const b of Object.keys(g)){let y=g[b];l===1&&(y=y.ds),m.set(parseInt(b,10),await Fd(y))}++d%1e3===0&&await U5(0),u._index.set(p,m)}return u}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:a,fieldIds:o,averageFieldLength:s,dirtCount:l,serializationVersion:u}=t;if(u!==1&&u!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new Co(n);return d._documentCount=r,d._nextId=a,d._idToShortId=new Map,d._fieldIds=o,d._avgFieldLength=s,d._dirtCount=l||0,d._index=new To,d}executeQuery(t,n={}){if(t===Co.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const m={...n,...t,queries:void 0},b=t.queries.map(y=>this.executeQuery(y,m));return this.combineResults(b,m.combineWith)}const{tokenize:r,processTerm:a,searchOptions:o}=this._options,s={tokenize:r,processTerm:a,...o,...n},{tokenize:l,processTerm:u}=s,g=l(t).flatMap(m=>u(m)).filter(m=>!!m).map(Rae(s)).map(m=>this.executeQuerySpec(m,s));return this.combineResults(g,s.combineWith)}executeQuerySpec(t,n){const r={...this._options.searchOptions,...n},a=(r.fields||this._options.fields).reduce((v,x)=>({...v,[x]:ab(r.boost,x)||1}),{}),{boostDocument:o,weights:s,maxFuzzy:l,bm25:u}=r,{fuzzy:d,prefix:p}={...RO.weights,...s},g=this._index.get(t.term),m=this.termResults(t.term,t.term,1,t.termBoost,g,a,o,u);let b,y;if(t.prefix&&(b=this._index.atPrefix(t.term)),t.fuzzy){const v=t.fuzzy===!0?.2:t.fuzzy,x=v<1?Math.min(l,Math.round(t.term.length*v)):v;x&&(y=this._index.fuzzyGet(t.term,x))}if(b)for(const[v,x]of b){const A=v.length-t.term.length;if(!A)continue;y==null||y.delete(v);const k=p*v.length/(v.length+.3*A);this.termResults(t.term,v,k,t.termBoost,x,a,o,u,m)}if(y)for(const v of y.keys()){const[x,A]=y.get(v);if(!A)continue;const k=d*v.length/(v.length+A);this.termResults(t.term,v,k,t.termBoost,x,a,o,u,m)}return m}executeWildcardQuery(t){const n=new Map,r={...this._options.searchOptions,...t};for(const[a,o]of this._documentIds){const s=r.boostDocument?r.boostDocument(o,"",this._storedFields.get(a)):1;n.set(a,{score:s,terms:[],match:{}})}return n}combineResults(t,n=HT){if(t.length===0)return new Map;const r=n.toLowerCase(),a=kae[r];if(!a)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(a)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const a={};for(const[o,s]of r)a[o]=Object.fromEntries(s);t.push([n,a])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,a,o,s,l,u,d=new Map){if(o==null)return d;for(const p of Object.keys(s)){const g=s[p],m=this._fieldIds[p],b=o.get(m);if(b==null)continue;let y=b.size;const v=this._avgFieldLength[m];for(const x of b.keys()){if(!this._documentIds.has(x)){this.removeTerm(m,x,n),y-=1;continue}const A=l?l(this._documentIds.get(x),n,this._storedFields.get(x)):1;if(!A)continue;const k=b.get(x),R=this._fieldLength.get(x)[m],O=Aae(k,y,this._documentCount,R,v,u),N=r*a*g*A*O,C=d.get(x);if(C){C.score+=N,_ae(C.terms,t);const _=ab(C.match,n);_?_.push(p):C.match[n]=[p]}else d.set(x,{score:N,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const a=this._index.fetch(r,NO);let o=a.get(t);if(o==null)o=new Map,o.set(n,1),a.set(t,o);else{const s=o.get(n);o.set(n,(s||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const a=this._index.fetch(r,NO),o=a.get(t);o==null||o.get(n)==null?this.warnDocumentChanged(n,t,r):o.get(n)<=1?o.size<=1?a.delete(t):o.delete(n):o.set(n,o.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const a of Object.keys(this._fieldIds))if(this._fieldIds[a]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${a}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;nObject.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,kae={[HT]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:a,terms:o,match:s}=t.get(n);r.score=r.score+a,r.match=Object.assign(r.match,s),CO(r.terms,o)}}return e},[j5]:(e,t)=>{const n=new Map;for(const r of t.keys()){const a=e.get(r);if(a==null)continue;const{score:o,terms:s,match:l}=t.get(r);CO(a.terms,s),n.set(r,{score:a.score+o,terms:a.terms,match:Object.assign(a.match,l)})}return n},[xae]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},Tae={k:1.2,b:.7,d:.5},Aae=(e,t,n,r,a,o)=>{const{k:s,b:l,d:u}=o;return Math.log(1+(n-t+.5)/(t+.5))*(u+e*(s+1)/(e+s*(1-l+l*r/a)))},Rae=e=>(t,n,r)=>{const a=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,o=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,s=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:a,prefix:o,termBoost:s}},ob={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(Nae),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},RO={combineWith:HT,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Tae},Cae={combineWith:j5,prefix:(e,t,n)=>t===n.length-1},ak={batchSize:1e3,batchWait:10},ok={minDirtFactor:.1,minDirtCount:20},ib={...ak,...ok},_ae=(e,t)=>{e.includes(t)||e.push(t)},CO=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},_O=({score:e},{score:t})=>t-e,NO=()=>new Map,Pd=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Fd=async e=>{const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&await U5(0);return t},U5=e=>new Promise(t=>setTimeout(t,e)),Nae=/[\n\r\p{Z}\p{P}]+/u,Oae={index:new Co({fields:[]})};w.createContext(Oae);const ik=({label:e,color:t,hidden:n,labels:r={}})=>we.createElement("div",{className:"node"},we.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),we.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),Iae=({id:e,labels:t})=>{const n=Ar(),r=w.useMemo(()=>{const a=n.getGraph().getNodeAttributes(e),o=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},a),o?o(e,a):{})},[n,e]);return we.createElement(ik,Object.assign({},r,{labels:t}))},Dae=({label:e,color:t,source:n,target:r,hidden:a,directed:o,labels:s={}})=>we.createElement("div",{className:"edge"},we.createElement(ik,Object.assign({},n,{labels:s})),we.createElement("div",{className:"body"},we.createElement("div",{className:"render"},we.createElement("span",{className:a?"dotted":"dash",style:{borderColor:t||"#000"}})," ",o&&we.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),we.createElement("span",{className:`label ${a?"text-muted":""} ${e?"":"fst-italic"}`},e||s.no_label||"No label")),we.createElement(ik,Object.assign({},r,{labels:s}))),Lae=({id:e,labels:t})=>{const n=Ar(),r=w.useMemo(()=>{const a=n.getGraph().getEdgeAttributes(e),o=n.getSetting("nodeReducer"),s=n.getSetting("edgeReducer"),l=n.getGraph().getNodeAttributes(n.getGraph().source(e)),u=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},a),s?s(e,a):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},l),o?o(e,l):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),o?o(e,u):{})})},[n,e]);return we.createElement(Dae,Object.assign({},r,{labels:t}))};function $T(e,t){const[n,r]=w.useState(e);return w.useEffect(()=>{const a=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(a)}},[e,t]),n}function Mae({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,notFound:o,loadingSkeleton:s,label:l,placeholder:u="Select...",value:d,onChange:p,onFocus:g,disabled:m=!1,className:b,noResultsMessage:y}){const[v,x]=w.useState(!1),[A,k]=w.useState(!1),[R,O]=w.useState([]),[N,C]=w.useState(!1),[_,M]=w.useState(null),[D,I]=w.useState(""),U=$T(D,t?0:150),H=w.useRef(null);w.useEffect(()=>{x(!0)},[]),w.useEffect(()=>{const $=F=>{H.current&&!H.current.contains(F.target)&&A&&k(!1)};return document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[A]);const B=w.useCallback(async $=>{try{C(!0),M(null);const F=await e($);O(F)}catch(F){M(F instanceof Error?F.message:"Failed to fetch options")}finally{C(!1)}},[e]);w.useEffect(()=>{v&&(t?U&&O($=>$.filter(F=>n?n(F,U):!0)):B(U))},[v,U,t,n,B]),w.useEffect(()=>{!v||!d||B(d)},[v,d,B]);const W=w.useCallback($=>{p($),requestAnimationFrame(()=>{const F=document.activeElement;F==null||F.blur(),k(!1)})},[p]),K=w.useCallback(()=>{k(!0),B(D)},[D,B]),G=w.useCallback($=>{$.target.closest(".cmd-item")&&$.preventDefault()},[]);return E.jsx("div",{ref:H,className:Me(m&&"cursor-not-allowed opacity-50",b),onMouseDown:G,children:E.jsxs(Ap,{shouldFilter:!1,className:"bg-transparent",children:[E.jsxs("div",{children:[E.jsx(BT,{placeholder:u,value:D,className:"max-h-8",onFocus:K,onValueChange:$=>{I($),A||k(!0)}}),N&&E.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:E.jsx(jU,{className:"h-4 w-4 animate-spin"})})]}),E.jsxs(Rp,{hidden:!A,children:[_&&E.jsx("div",{className:"text-destructive p-4 text-center",children:_}),N&&R.length===0&&(s||E.jsx(Pae,{})),!N&&!_&&R.length===0&&(o||E.jsx(jT,{children:y??`No ${l.toLowerCase()} found.`})),E.jsx(el,{children:R.map(($,F)=>E.jsxs(we.Fragment,{children:[E.jsx(tl,{value:a($),onSelect:W,onMouseMove:()=>g(a($)),className:"truncate cmd-item",children:r($)},a($)+`${F}`),F!==R.length-1&&E.jsx("div",{className:"bg-foreground/10 h-[1px]"},`divider-${F}`)]},a($)+`-fragment-${F}`))})]})]})})}function Pae(){return E.jsx(el,{children:E.jsx(tl,{disabled:!0,children:E.jsxs("div",{className:"flex w-full items-center gap-2",children:[E.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),E.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[E.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),E.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const sb="__message_item",Fae=({id:e})=>{const t=Fe.use.sigmaGraph();return t!=null&&t.hasNode(e)?E.jsx(Iae,{id:e}):null};function zae(e){return E.jsxs("div",{children:[e.type==="nodes"&&E.jsx(Fae,{id:e.id}),e.type==="edges"&&E.jsx(Lae,{id:e.id}),e.type==="message"&&E.jsx("div",{children:e.message})]})}const Bae=({onChange:e,onFocus:t,value:n})=>{const{t:r}=Et(),a=Fe.use.sigmaGraph(),o=Fe.use.searchEngine();w.useEffect(()=>{a&&Fe.getState().resetSearchEngine()},[a]),w.useEffect(()=>{if(!a||a.nodes().length===0||o)return;const l=new Co({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=a.nodes().map(d=>({id:d,label:a.getNodeAttribute(d,"label")}));l.addAll(u),Fe.getState().setSearchEngine(l)},[a,o]);const s=w.useCallback(async l=>{if(t&&t(null),!a||!o)return[];if(a.nodes().length===0)return[];if(!l)return a.nodes().filter(p=>a.hasNode(p)).slice(0,yd).map(p=>({id:p,type:"nodes"}));let u=o.search(l).filter(d=>a.hasNode(d.id)).map(d=>({id:d.id,type:"nodes"}));if(u.length<5){const d=new Set(u.map(g=>g.id)),p=a.nodes().filter(g=>{if(d.has(g))return!1;const m=a.getNodeAttribute(g,"label");return m&&typeof m=="string"&&!m.toLowerCase().startsWith(l.toLowerCase())&&m.toLowerCase().includes(l.toLowerCase())}).map(g=>({id:g,type:"nodes"}));u=[...u,...p]}return u.length<=yd?u:[...u.slice(0,yd),{type:"message",id:sb,message:r("graphPanel.search.message",{count:u.length-yd})}]},[a,o,t,r]);return E.jsx(Mae,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:s,renderOption:zae,getOptionValue:l=>l.id,value:n&&n.type!=="message"?n.id:null,onChange:l=>{l!==sb&&e(l?{id:l,type:"nodes"}:null)},onFocus:l=>{l!==sb&&t&&t(l?{id:l,type:"nodes"}:null)},label:"item",placeholder:r("graphPanel.search.placeholder")})},jae=({...e})=>E.jsx(Bae,{...e});function Uae({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:a,getDisplayValue:o,notFound:s,loadingSkeleton:l,label:u,placeholder:d="Select...",value:p,onChange:g,disabled:m=!1,className:b,triggerClassName:y,searchInputClassName:v,noResultsMessage:x,triggerTooltip:A,clearable:k=!0}){const[R,O]=w.useState(!1),[N,C]=w.useState(!1),[_,M]=w.useState([]),[D,I]=w.useState(!1),[U,H]=w.useState(null),[B,W]=w.useState(p),[K,G]=w.useState(null),[$,F]=w.useState(""),Y=$T($,t?0:150),[L,V]=w.useState([]),[j,P]=w.useState(null);w.useEffect(()=>{O(!0),W(p)},[p]),w.useEffect(()=>{p&&(!_.length||!K)?P(E.jsx("div",{children:p})):K&&P(null)},[p,_.length,K]),w.useEffect(()=>{if(p&&_.length>0){const Q=_.find(oe=>a(oe)===p);Q&&G(Q)}},[p,_,a]),w.useEffect(()=>{R||(async()=>{try{I(!0),H(null);const oe=await e(p);V(oe),M(oe)}catch(oe){H(oe instanceof Error?oe.message:"Failed to fetch options")}finally{I(!1)}})()},[R,e,p]),w.useEffect(()=>{const Q=async()=>{try{I(!0),H(null);const oe=await e(Y);V(oe),M(oe)}catch(oe){H(oe instanceof Error?oe.message:"Failed to fetch options")}finally{I(!1)}};R&&t?t&&M(Y?L.filter(oe=>n?n(oe,Y):!0):L):Q()},[e,Y,R,t,n]);const Z=w.useCallback(Q=>{const oe=k&&Q===B?"":Q;W(oe),G(_.find(ae=>a(ae)===oe)||null),g(oe),C(!1)},[B,g,k,_,a]);return E.jsxs(mp,{open:N,onOpenChange:C,children:[E.jsx(bp,{asChild:!0,children:E.jsxs(nt,{variant:"outline",role:"combobox","aria-expanded":N,className:Me("justify-between",m&&"cursor-not-allowed opacity-50",y),disabled:m,tooltip:A,side:"bottom",children:[p==="*"?E.jsx("div",{children:"*"}):K?o(K):j||d,E.jsx(cZ,{className:"opacity-50",size:10})]})}),E.jsx(Zc,{className:Me("p-0",b),onCloseAutoFocus:Q=>Q.preventDefault(),align:"start",sideOffset:8,collisionPadding:5,children:E.jsxs(Ap,{shouldFilter:!1,children:[E.jsxs("div",{className:"relative w-full border-b",children:[E.jsx(BT,{placeholder:`Search ${u.toLowerCase()}...`,value:$,onValueChange:Q=>{F(Q)},className:v}),D&&_.length>0&&E.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:E.jsx(jU,{className:"h-4 w-4 animate-spin"})})]}),E.jsxs(Rp,{children:[U&&E.jsx("div",{className:"text-destructive p-4 text-center",children:U}),D&&_.length===0&&(l||E.jsx(Gae,{})),!D&&!U&&_.length===0&&(s||E.jsx(jT,{children:x??`No ${u.toLowerCase()} found.`})),E.jsx(el,{children:_.map(Q=>E.jsxs(tl,{value:a(Q),onSelect:Z,className:"truncate",children:[r(Q),E.jsx(bT,{className:Me("ml-auto h-3 w-3",B===a(Q)?"opacity-100":"opacity-0")})]},a(Q)))})]})]})})]})}function Gae(){return E.jsx(el,{children:E.jsx(tl,{disabled:!0,children:E.jsxs("div",{className:"flex w-full items-center gap-2",children:[E.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),E.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[E.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),E.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const Hae=()=>{const{t:e}=Et(),t=De.use.queryLabel(),n=Fe.use.allDatabaseLabels(),r=Fe.use.labelsFetchAttempted(),a=w.useCallback(()=>{const l=new Co({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=n.map((d,p)=>({id:p,value:d}));return l.addAll(u),{labels:n,searchEngine:l}},[n]),o=w.useCallback(async l=>{const{labels:u,searchEngine:d}=a();let p=u;if(l&&(p=d.search(l).map(g=>u[g.id]),p.length<5)){const g=new Set(p),m=u.filter(b=>g.has(b)?!1:b&&typeof b=="string"&&!b.toLowerCase().startsWith(l.toLowerCase())&&b.toLowerCase().includes(l.toLowerCase()));p=[...p,...m]}return p.length<=P_?p:[...p.slice(0,P_),"..."]},[a]);w.useEffect(()=>{r&&(n.length>1?t&&t!=="*"&&!n.includes(t)?(console.log(`Label "${t}" not in available labels, setting to "*"`),De.getState().setQueryLabel("*")):console.log(`Label "${t}" is valid`):t&&n.length<=1&&t&&t!=="*"&&(console.log("Available labels list is empty, setting label to empty"),De.getState().setQueryLabel("")),Fe.getState().setLabelsFetchAttempted(!1))},[n,t,r]);const s=w.useCallback(()=>{Fe.getState().setLabelsFetchAttempted(!1),Fe.getState().setGraphDataFetchAttempted(!1),Fe.getState().setLastSuccessfulQueryLabel("");const l=De.getState().queryLabel;l?(De.getState().setQueryLabel(""),setTimeout(()=>{De.getState().setQueryLabel(l)},0)):De.getState().setQueryLabel("*")},[]);return E.jsxs("div",{className:"flex items-center",children:[E.jsx(nt,{size:"icon",variant:wr,onClick:s,tooltip:e("graphPanel.graphLabels.refreshTooltip"),className:"mr-2",children:E.jsx(UU,{className:"h-4 w-4"})}),E.jsx(Uae,{className:"min-w-[300px]",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:e("graphPanel.graphLabels.selectTooltip"),fetcher:o,renderOption:l=>E.jsx("div",{children:l}),getOptionValue:l=>l,getDisplayValue:l=>E.jsx("div",{children:l}),notFound:E.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:e("graphPanel.graphLabels.label"),placeholder:e("graphPanel.graphLabels.placeholder"),value:t!==null?t:"*",onChange:l=>{const u=De.getState().queryLabel;l==="..."&&(l="*"),l===u&&l!=="*"&&(l="*"),Fe.getState().setGraphDataFetchAttempted(!1),De.getState().setQueryLabel(l)},clearable:!1})]})},Jn=({text:e,className:t,tooltipClassName:n,tooltip:r,side:a,onClick:o})=>r?E.jsx(gT,{delayDuration:200,children:E.jsxs(hT,{children:[E.jsx(mT,{asChild:!0,children:E.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e})}),E.jsx(gp,{side:a,className:n,children:r})]})}):E.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e});var rf={exports:{}},$ae=rf.exports,OO;function qae(){return OO||(OO=1,function(e){(function(t,n,r){function a(u){var d=this,p=l();d.next=function(){var g=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=g-(d.c=g|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(u),d.s0<0&&(d.s0+=1),d.s1-=p(u),d.s1<0&&(d.s1+=1),d.s2-=p(u),d.s2<0&&(d.s2+=1),p=null}function o(u,d){return d.c=u.c,d.s0=u.s0,d.s1=u.s1,d.s2=u.s2,d}function s(u,d){var p=new a(u),g=d&&d.state,m=p.next;return m.int32=function(){return p.next()*4294967296|0},m.double=function(){return m()+(m()*2097152|0)*11102230246251565e-32},m.quick=m,g&&(typeof g=="object"&&o(g,p),m.state=function(){return o(p,{})}),m}function l(){var u=4022871197,d=function(p){p=String(p);for(var g=0;g>>0,m-=u,m*=u,u=m>>>0,m-=u,u+=m*4294967296}return(u>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=s:this.alea=s})($ae,e)}(rf)),rf.exports}var af={exports:{}},Vae=af.exports,IO;function Wae(){return IO||(IO=1,function(e){(function(t,n,r){function a(l){var u=this,d="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var g=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^g^g>>>8},l===(l|0)?u.x=l:d+=l;for(var p=0;p>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(typeof p=="object"&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xor128=s})(Vae,e)}(af)),af.exports}var of={exports:{}},Yae=of.exports,DO;function Kae(){return DO||(DO=1,function(e){(function(t,n,r){function a(l){var u=this,d="";u.next=function(){var g=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(g^g<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:d+=l;for(var p=0;p>>4),u.next()}function o(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function s(l,u){var d=new a(l),p=u&&u.state,g=function(){return(d.next()>>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(typeof p=="object"&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xorwow=s})(Yae,e)}(of)),of.exports}var sf={exports:{}},Xae=sf.exports,LO;function Zae(){return LO||(LO=1,function(e){(function(t,n,r){function a(l){var u=this;u.next=function(){var p=u.x,g=u.i,m,b;return m=p[g],m^=m>>>7,b=m^m<<24,m=p[g+1&7],b^=m^m>>>10,m=p[g+3&7],b^=m^m>>>3,m=p[g+4&7],b^=m^m<<7,m=p[g+7&7],m=m^m<<13,b^=m^m<<9,p[g]=b,u.i=g+1&7,b};function d(p,g){var m,b=[];if(g===(g|0))b[0]=g;else for(g=""+g,m=0;m0;--m)p.next()}d(u,l)}function o(l,u){return u.x=l.x.slice(),u.i=l.i,u}function s(l,u){l==null&&(l=+new Date);var d=new a(l),p=u&&u.state,g=function(){return(d.next()>>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(p.x&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xorshift7=s})(Xae,e)}(sf)),sf.exports}var lf={exports:{}},Qae=lf.exports,MO;function Jae(){return MO||(MO=1,function(e){(function(t,n,r){function a(l){var u=this;u.next=function(){var p=u.w,g=u.X,m=u.i,b,y;return u.w=p=p+1640531527|0,y=g[m+34&127],b=g[m=m+1&127],y^=y<<13,b^=b<<17,y^=y>>>15,b^=b>>>12,y=g[m]=y^b,u.i=m,y+(p^p>>>16)|0};function d(p,g){var m,b,y,v,x,A=[],k=128;for(g===(g|0)?(b=g,g=null):(g=g+"\0",b=0,k=Math.max(k,g.length)),y=0,v=-32;v>>15,b^=b<<4,b^=b>>>13,v>=0&&(x=x+1640531527|0,m=A[v&127]^=b+x,y=m==0?y+1:0);for(y>=128&&(A[(g&&g.length||0)&127]=-1),y=127,v=4*128;v>0;--v)b=A[y+34&127],m=A[y=y+1&127],b^=b<<13,m^=m<<17,b^=b>>>15,m^=m>>>12,A[y]=b^m;p.w=x,p.X=A,p.i=y}d(u,l)}function o(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function s(l,u){l==null&&(l=+new Date);var d=new a(l),p=u&&u.state,g=function(){return(d.next()>>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(p.X&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.xor4096=s})(Qae,e)}(lf)),lf.exports}var cf={exports:{}},eoe=cf.exports,PO;function toe(){return PO||(PO=1,function(e){(function(t,n,r){function a(l){var u=this,d="";u.next=function(){var g=u.b,m=u.c,b=u.d,y=u.a;return g=g<<25^g>>>7^m,m=m-b|0,b=b<<24^b>>>8^y,y=y-g|0,u.b=g=g<<20^g>>>12^m,u.c=m=m-b|0,u.d=b<<16^m>>>16^y,u.a=y-g|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):d+=l;for(var p=0;p>>0)/4294967296};return g.double=function(){do var m=d.next()>>>11,b=(d.next()>>>0)/4294967296,y=(m+b)/(1<<21);while(y===0);return y},g.int32=d.next,g.quick=g,p&&(typeof p=="object"&&o(p,d),g.state=function(){return o(d,{})}),g}n&&n.exports?n.exports=s:this.tychei=s})(eoe,e)}(cf)),cf.exports}var uf={exports:{}};const noe={},roe=Object.freeze(Object.defineProperty({__proto__:null,default:noe},Symbol.toStringTag,{value:"Module"})),aoe=uq(roe);var ooe=uf.exports,FO;function ioe(){return FO||(FO=1,function(e){(function(t,n,r){var a=256,o=6,s=52,l="random",u=r.pow(a,o),d=r.pow(2,s),p=d*2,g=a-1,m;function b(O,N,C){var _=[];N=N==!0?{entropy:!0}:N||{};var M=A(x(N.entropy?[O,R(n)]:O??k(),3),_),D=new y(_),I=function(){for(var U=D.g(o),H=u,B=0;U=p;)U/=2,H/=2,B>>>=1;return(U+B)/H};return I.int32=function(){return D.g(4)|0},I.quick=function(){return D.g(4)/4294967296},I.double=I,A(R(D.S),n),(N.pass||C||function(U,H,B,W){return W&&(W.S&&v(W,D),U.state=function(){return v(D,{})}),B?(r[l]=U,H):U})(I,M,"global"in N?N.global:this==r,N.state)}function y(O){var N,C=O.length,_=this,M=0,D=_.i=_.j=0,I=_.S=[];for(C||(O=[C++]);M{const t="#5D6D7E",n=e?e.toLowerCase():"unknown",r=Fe.getState().typeColorMap;if(r.has(n))return r.get(n)||t;const a=coe[n];if(a){const d=BO[a],p=new Map(r);return p.set(n,d),Fe.setState({typeColorMap:p}),d}const o=new Set(Array.from(r.entries()).filter(([,d])=>!Object.values(BO).includes(d)).map(([,d])=>d)),l=uoe.find(d=>!o.has(d))||t,u=new Map(r);return u.set(n,l),Fe.setState({typeColorMap:u}),l},doe=e=>{if(!e)return console.log("Graph validation failed: graph is null"),!1;if(!Array.isArray(e.nodes)||!Array.isArray(e.edges))return console.log("Graph validation failed: nodes or edges is not an array"),!1;if(e.nodes.length===0)return console.log("Graph validation failed: nodes array is empty"),!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return console.log("Graph validation failed: invalid node structure"),!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return console.log("Graph validation failed: invalid edge structure"),!1;for(const t of e.edges){const n=e.getNode(t.source),r=e.getNode(t.target);if(n==null||r==null)return console.log("Graph validation failed: edge references non-existent node"),!1}return console.log("Graph validation passed"),!0},foe=async(e,t,n)=>{let r=null;if(!Fe.getState().lastSuccessfulQueryLabel){console.log("Last successful queryLabel is empty");try{await Fe.getState().fetchAllDatabaseLabels()}catch(l){console.error("Failed to fetch all database labels:",l)}}Fe.getState().setLabelsFetchAttempted(!0);const o=e||"*";try{console.log(`Fetching graph label: ${o}, depth: ${t}, nodes: ${n}`),r=await QB(o,t,n)}catch(l){return rr.getState().setErrorMessage(Gn(l),"Query Graphs Error!"),null}let s=null;if(r){const l={},u={};for(let m=0;m0){const m=w0-ci;for(const b of r.nodes)b.size=Math.round(ci+m*Math.pow((b.degree-d)/g,.5))}s=new xV,s.nodes=r.nodes,s.edges=r.edges,s.nodeIdMap=l,s.edgeIdMap=u,doe(s)||(s=null,console.warn("Invalid graph data")),console.log("Graph data loaded")}return{rawGraph:s,is_truncated:r.is_truncated}},poe=e=>{var l,u;const t=De.getState().minEdgeSize,n=De.getState().maxEdgeSize;if(!e||!e.nodes.length)return console.log("No graph data available, skipping sigma graph creation"),null;const r=new Ac;for(const d of(e==null?void 0:e.nodes)??[]){sk(d.id+Date.now().toString(),{global:!0});const p=Math.random(),g=Math.random();r.addNode(d.id,{label:d.labels.join(", "),color:d.color,x:p,y:g,size:d.size,borderColor:E0,borderSize:.2})}for(const d of(e==null?void 0:e.edges)??[]){const p=((l=d.properties)==null?void 0:l.weight)!==void 0?Number(d.properties.weight):1;d.dynamicId=r.addEdge(d.source,d.target,{label:((u=d.properties)==null?void 0:u.keywords)||void 0,size:p,originalWeight:p,type:"curvedNoArrow"})}let a=Number.MAX_SAFE_INTEGER,o=0;r.forEachEdge(d=>{const p=r.getEdgeAttribute(d,"originalWeight")||1;a=Math.min(a,p),o=Math.max(o,p)});const s=o-a;if(s>0){const d=n-t;r.forEachEdge(p=>{const g=r.getEdgeAttribute(p,"originalWeight")||1,m=t+d*Math.pow((g-a)/s,.5);r.setEdgeAttribute(p,"size",m)})}else r.forEachEdge(d=>{r.setEdgeAttribute(d,"size",t)});return r},goe=()=>{const{t:e}=Et(),t=De.use.queryLabel(),n=Fe.use.rawGraph(),r=Fe.use.sigmaGraph(),a=De.use.graphQueryMaxDepth(),o=De.use.graphMaxNodes(),s=Fe.use.isFetching(),l=Fe.use.nodeToExpand(),u=Fe.use.nodeToPrune(),d=w.useRef(!1),p=w.useRef(!1),g=w.useRef(!1),m=w.useCallback(A=>(n==null?void 0:n.getNode(A))||null,[n]),b=w.useCallback((A,k=!0)=>(n==null?void 0:n.getEdge(A,k))||null,[n]),y=w.useRef(!1);w.useEffect(()=>{if(!t&&(n!==null||r!==null)){const A=Fe.getState();A.reset(),A.setGraphDataFetchAttempted(!1),A.setLabelsFetchAttempted(!1),d.current=!1,p.current=!1}},[t,n,r]),w.useEffect(()=>{if(!y.current&&!(!t&&g.current)&&!s&&!Fe.getState().graphDataFetchAttempted){y.current=!0,Fe.getState().setGraphDataFetchAttempted(!0);const A=Fe.getState();A.setIsFetching(!0),A.clearSelection(),A.sigmaGraph&&A.sigmaGraph.forEachNode(C=>{var _;(_=A.sigmaGraph)==null||_.setNodeAttribute(C,"highlighted",!1)}),console.log("Preparing graph data...");const k=t,R=a,O=o;let N;k?N=foe(k,R,O):(console.log("Query label is empty, show empty graph"),N=Promise.resolve({rawGraph:null,is_truncated:!1})),N.then(C=>{const _=Fe.getState(),M=C==null?void 0:C.rawGraph;if(M&&M.nodes&&M.nodes.forEach(D=>{var U;const I=(U=D.properties)==null?void 0:U.entity_type;D.color=jO(I)}),C!=null&&C.is_truncated&&Ft.info(e("graphPanel.dataIsTruncated","Graph data is truncated to Max Nodes")),_.reset(),!M||!M.nodes||M.nodes.length===0){const D=new Ac;D.addNode("empty-graph-node",{label:e("graphPanel.emptyGraph"),color:"#5D6D7E",x:.5,y:.5,size:15,borderColor:E0,borderSize:.2}),_.setSigmaGraph(D),_.setRawGraph(null),_.setGraphIsEmpty(!0);const I=rr.getState().message,U=I&&I.includes("Authentication required");!U&&k&&De.getState().setQueryLabel(""),U?console.log("Keep queryLabel for post-login reload"):_.setLastSuccessfulQueryLabel(""),console.log(`Graph data is empty, created graph with empty graph node. Auth error: ${U}`)}else{const D=poe(M);M.buildDynamicMap(),_.setSigmaGraph(D),_.setRawGraph(M),_.setGraphIsEmpty(!1),_.setLastSuccessfulQueryLabel(k),_.setMoveToSelectedNode(!0)}d.current=!0,p.current=!0,y.current=!1,_.setIsFetching(!1),(!M||!M.nodes||M.nodes.length===0)&&!k&&(g.current=!0)}).catch(C=>{console.error("Error fetching graph data:",C);const _=Fe.getState();_.setIsFetching(!1),d.current=!1,y.current=!1,_.setGraphDataFetchAttempted(!1),_.setLastSuccessfulQueryLabel("")})}},[t,a,o,s,e]),w.useEffect(()=>{l&&((async k=>{var R,O,N,C,_,M;if(!(!k||!r||!n))try{const D=n.getNode(k);if(!D){console.error("Node not found:",k);return}const I=D.labels[0];if(!I){console.error("Node has no label:",k);return}const U=await QB(I,2,1e3);if(!U||!U.nodes||!U.edges){console.error("Failed to fetch extended graph");return}const H=[];for(const ne of U.nodes){sk(ne.id,{global:!0});const xe=(R=ne.properties)==null?void 0:R.entity_type,Se=jO(xe);H.push({id:ne.id,labels:ne.labels,properties:ne.properties,size:10,x:Math.random(),y:Math.random(),color:Se,degree:0})}const B=[];for(const ne of U.edges)B.push({id:ne.id,source:ne.source,target:ne.target,type:ne.type,properties:ne.properties,dynamicId:""});const W={};r.forEachNode(ne=>{W[ne]={x:r.getNodeAttribute(ne,"x"),y:r.getNodeAttribute(ne,"y")}});const K=new Set(r.nodes()),G=new Set,$=new Set,F=1;let Y=0,L=Number.MAX_SAFE_INTEGER,V=0;r.forEachNode(ne=>{const xe=r.degree(ne);Y=Math.max(Y,xe)}),r.forEachEdge(ne=>{const xe=r.getEdgeAttribute(ne,"originalWeight")||1;L=Math.min(L,xe),V=Math.max(V,xe)});for(const ne of H){if(K.has(ne.id))continue;B.some(Se=>Se.source===k&&Se.target===ne.id||Se.target===k&&Se.source===ne.id)&&G.add(ne.id)}const j=new Map,P=new Map,Z=new Set;for(const ne of B){const xe=K.has(ne.source)||G.has(ne.source),Se=K.has(ne.target)||G.has(ne.target);xe&&Se?($.add(ne.id),G.has(ne.source)?j.set(ne.source,(j.get(ne.source)||0)+1):K.has(ne.source)&&P.set(ne.source,(P.get(ne.source)||0)+1),G.has(ne.target)?j.set(ne.target,(j.get(ne.target)||0)+1):K.has(ne.target)&&P.set(ne.target,(P.get(ne.target)||0)+1)):(r.hasNode(ne.source)?Z.add(ne.source):G.has(ne.source)&&(Z.add(ne.source),j.set(ne.source,(j.get(ne.source)||0)+1)),r.hasNode(ne.target)?Z.add(ne.target):G.has(ne.target)&&(Z.add(ne.target),j.set(ne.target,(j.get(ne.target)||0)+1)))}const Q=(ne,xe,Se,be)=>{const J=be-Se||1,pe=w0-ci;for(const ke of xe)if(ne.hasNode(ke)){let he=ne.degree(ke);he+=1;const Ee=Math.min(he,be+1),se=Math.round(ci+pe*Math.pow((Ee-Se)/J,.5)),Be=ne.getNodeAttribute(ke,"size");se>Be&&ne.setNodeAttribute(ke,"size",se)}},oe=(ne,xe,Se)=>{const be=De.getState().minEdgeSize,J=De.getState().maxEdgeSize,pe=Se-xe||1,ke=J-be;ne.forEachEdge(he=>{const Ee=ne.getEdgeAttribute(he,"originalWeight")||1,se=be+ke*Math.pow((Ee-xe)/pe,.5);ne.setEdgeAttribute(he,"size",se)})};if(G.size===0){Q(r,Z,F,Y),Ft.info(e("graphPanel.propertiesView.node.noNewNodes"));return}for(const[,ne]of j.entries())Y=Math.max(Y,ne);for(const[ne,xe]of P.entries()){const be=r.degree(ne)+xe;Y=Math.max(Y,be)}const ae=Y-F||1,ce=w0-ci,Re=((O=Fe.getState().sigmaInstance)==null?void 0:O.getCamera().ratio)||1,ie=Math.max(Math.sqrt(D.size)*4,Math.sqrt(G.size)*3)/Re;sk(Date.now().toString(),{global:!0});const Te=Math.random()*2*Math.PI;console.log("nodeSize:",D.size,"nodesToAdd:",G.size),console.log("cameraRatio:",Math.round(Re*100)/100,"spreadFactor:",Math.round(ie*100)/100);for(const ne of G){const xe=H.find(Ee=>Ee.id===ne),Se=j.get(ne)||0,be=Math.min(Se,Y+1),J=Math.round(ci+ce*Math.pow((be-F)/ae,.5)),pe=2*Math.PI*(Array.from(G).indexOf(ne)/G.size),ke=((N=W[ne])==null?void 0:N.x)||W[D.id].x+Math.cos(Te+pe)*ie,he=((C=W[ne])==null?void 0:C.y)||W[D.id].y+Math.sin(Te+pe)*ie;r.addNode(ne,{label:xe.labels.join(", "),color:xe.color,x:ke,y:he,size:J,borderColor:E0,borderSize:.2}),n.getNode(ne)||(xe.size=J,xe.x=ke,xe.y=he,xe.degree=Se,n.nodes.push(xe),n.nodeIdMap[ne]=n.nodes.length-1)}for(const ne of $){const xe=B.find(be=>be.id===ne);if(r.hasEdge(xe.source,xe.target))continue;const Se=((_=xe.properties)==null?void 0:_.weight)!==void 0?Number(xe.properties.weight):1;L=Math.min(L,Se),V=Math.max(V,Se),xe.dynamicId=r.addEdge(xe.source,xe.target,{label:((M=xe.properties)==null?void 0:M.keywords)||void 0,size:Se,originalWeight:Se,type:"curvedNoArrow"}),n.getEdge(xe.id,!1)?console.error("Edge already exists in rawGraph:",xe.id):(n.edges.push(xe),n.edgeIdMap[xe.id]=n.edges.length-1,n.edgeDynamicIdMap[xe.dynamicId]=n.edges.length-1)}if(n.buildDynamicMap(),Fe.getState().resetSearchEngine(),Q(r,Z,F,Y),oe(r,L,V),r.hasNode(k)){const ne=r.degree(k),xe=Math.min(ne,Y+1),Se=Math.round(ci+ce*Math.pow((xe-F)/ae,.5));r.setNodeAttribute(k,"size",Se),D.size=Se,D.degree=ne}}catch(D){console.error("Error expanding node:",D)}})(l),window.setTimeout(()=>{Fe.getState().triggerNodeExpand(null)},0))},[l,r,n,e]);const v=w.useCallback((A,k)=>{const R=new Set([A]);return k.forEachNode(O=>{if(O===A)return;const N=k.neighbors(O);N.length===1&&N[0]===A&&R.add(O)}),R},[]);return w.useEffect(()=>{u&&((k=>{if(!(!k||!r||!n))try{const R=Fe.getState();if(!r.hasNode(k)){console.error("Node not found:",k);return}const O=v(k,r);if(O.size===r.nodes().length){Ft.error(e("graphPanel.propertiesView.node.deleteAllNodesError"));return}R.clearSelection();for(const N of O){r.dropNode(N);const C=n.nodeIdMap[N];if(C!==void 0){const _=n.edges.filter(M=>M.source===N||M.target===N);for(const M of _){const D=n.edgeIdMap[M.id];if(D!==void 0){n.edges.splice(D,1);for(const[I,U]of Object.entries(n.edgeIdMap))U>D&&(n.edgeIdMap[I]=U-1);delete n.edgeIdMap[M.id],delete n.edgeDynamicIdMap[M.dynamicId]}}n.nodes.splice(C,1);for(const[M,D]of Object.entries(n.nodeIdMap))D>C&&(n.nodeIdMap[M]=D-1);delete n.nodeIdMap[N]}}n.buildDynamicMap(),Fe.getState().resetSearchEngine(),O.size>1&&Ft.info(e("graphPanel.propertiesView.node.nodesRemoved",{count:O.size}))}catch(R){console.error("Error pruning node:",R)}})(u),window.setTimeout(()=>{Fe.getState().triggerNodePrune(null)},0))},[u,r,n,v,e]),{lightrageGraph:w.useCallback(()=>{if(r)return r;console.log("Creating new Sigma graph instance");const A=new Ac;return Fe.getState().setSigmaGraph(A),A},[r]),getNode:m,getEdge:b}},hoe=()=>{const{getNode:e,getEdge:t}=goe(),n=Fe.use.selectedNode(),r=Fe.use.focusedNode(),a=Fe.use.selectedEdge(),o=Fe.use.focusedEdge(),[s,l]=w.useState(null),[u,d]=w.useState(null);return w.useEffect(()=>{let p=null,g=null;r?(p="node",g=e(r)):n?(p="node",g=e(n)):o?(p="edge",g=t(o,!0)):a&&(p="edge",g=t(a,!0)),g?(p=="node"?l(moe(g)):l(boe(g)),d(p)):(l(null),d(null))},[r,n,o,a,l,d,e,t]),s?E.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:u=="node"?E.jsx(yoe,{node:s}):E.jsx(voe,{edge:s})}):E.jsx(E.Fragment,{})},moe=e=>{const t=Fe.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)try{if(!t.sigmaGraph.hasNode(e.id))return{...e,relationships:[]};const r=t.sigmaGraph.edges(e.id);for(const a of r){if(!t.sigmaGraph.hasEdge(a))continue;const o=t.rawGraph.getEdge(a,!0);if(o){const l=e.id===o.source?o.target:o.source;if(!t.sigmaGraph.hasNode(l))continue;const u=t.rawGraph.getNode(l);u&&n.push({type:"Neighbour",id:l,label:u.properties.entity_id?u.properties.entity_id:u.labels.join(", ")})}}}catch(r){console.error("Error refining node properties:",r)}return{...e,relationships:n}},boe=e=>{const t=Fe.getState();let n,r;if(t.sigmaGraph&&t.rawGraph)try{if(!t.sigmaGraph.hasEdge(e.id))return{...e,sourceNode:void 0,targetNode:void 0};t.sigmaGraph.hasNode(e.source)&&(n=t.rawGraph.getNode(e.source)),t.sigmaGraph.hasNode(e.target)&&(r=t.rawGraph.getNode(e.target))}catch(a){console.error("Error refining edge properties:",a)}return{...e,sourceNode:n,targetNode:r}},ra=({name:e,value:t,onClick:n,tooltip:r})=>{const{t:a}=Et(),o=s=>{const l=`graphPanel.propertiesView.node.propertyNames.${s}`,u=a(l);return u===l?s:u};return E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-primary/60 tracking-wide whitespace-nowrap",children:o(e)}),":",E.jsx(Jn,{className:"hover:bg-primary/20 rounded p-1 overflow-hidden text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||(typeof t=="string"?t:JSON.stringify(t,null,2)),side:"left",onClick:n})]})},yoe=({node:e})=>{const{t}=Et(),n=()=>{Fe.getState().triggerNodeExpand(e.id)},r=()=>{Fe.getState().triggerNodePrune(e.id)};return E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsxs("div",{className:"flex justify-between items-center",children:[E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-blue-700",children:t("graphPanel.propertiesView.node.title")}),E.jsxs("div",{className:"flex gap-3",children:[E.jsx(nt,{size:"icon",variant:"ghost",className:"h-7 w-7 border border-gray-400 hover:bg-gray-200 dark:border-gray-600 dark:hover:bg-gray-700",onClick:n,tooltip:t("graphPanel.propertiesView.node.expandNode"),children:E.jsx(EZ,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),E.jsx(nt,{size:"icon",variant:"ghost",className:"h-7 w-7 border border-gray-400 hover:bg-gray-200 dark:border-gray-600 dark:hover:bg-gray-700",onClick:r,tooltip:t("graphPanel.propertiesView.node.pruneNode"),children:E.jsx(WZ,{className:"h-4 w-4 text-gray-900 dark:text-gray-300"})})]})]}),E.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[E.jsx(ra,{name:t("graphPanel.propertiesView.node.id"),value:e.id}),E.jsx(ra,{name:t("graphPanel.propertiesView.node.labels"),value:e.labels.join(", "),onClick:()=>{Fe.getState().setSelectedNode(e.id,!0)}}),E.jsx(ra,{name:t("graphPanel.propertiesView.node.degree"),value:e.degree})]}),E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-amber-700",children:t("graphPanel.propertiesView.node.properties")}),E.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(a=>E.jsx(ra,{name:a,value:e.properties[a]},a))}),e.relationships.length>0&&E.jsxs(E.Fragment,{children:[E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-emerald-700",children:t("graphPanel.propertiesView.node.relationships")}),E.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:a,id:o,label:s})=>E.jsx(ra,{name:a,value:s,onClick:()=>{Fe.getState().setSelectedNode(o,!0)}},o))})]})]})},voe=({edge:e})=>{const{t}=Et();return E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-violet-700",children:t("graphPanel.propertiesView.edge.title")}),E.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[E.jsx(ra,{name:t("graphPanel.propertiesView.edge.id"),value:e.id}),e.type&&E.jsx(ra,{name:t("graphPanel.propertiesView.edge.type"),value:e.type}),E.jsx(ra,{name:t("graphPanel.propertiesView.edge.source"),value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{Fe.getState().setSelectedNode(e.source,!0)}}),E.jsx(ra,{name:t("graphPanel.propertiesView.edge.target"),value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{Fe.getState().setSelectedNode(e.target,!0)}})]}),E.jsx("h3",{className:"text-md pl-1 font-bold tracking-wide text-amber-700",children:t("graphPanel.propertiesView.edge.properties")}),E.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(n=>E.jsx(ra,{name:n,value:e.properties[n]},n))})]})},Soe=()=>{const{t:e}=Et(),t=De.use.graphQueryMaxDepth(),n=De.use.graphMaxNodes();return E.jsxs("div",{className:"absolute bottom-4 left-[calc(1rem+2.5rem)] flex items-center gap-2 text-xs text-gray-400",children:[E.jsxs("div",{children:[e("graphPanel.sideBar.settings.depth"),": ",t]}),E.jsxs("div",{children:[e("graphPanel.sideBar.settings.max"),": ",n]})]})},wi=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));wi.displayName="Card";const Cc=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Cc.displayName="CardHeader";const _c=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));_c.displayName="CardTitle";const Cp=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Cp.displayName="CardDescription";const Nc=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));Nc.displayName="CardContent";const Eoe=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));Eoe.displayName="CardFooter";function woe(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var qT="ScrollArea",[G5,v0e]=$r(qT),[xoe,Rr]=G5(qT),H5=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:o=600,...s}=e,[l,u]=w.useState(null),[d,p]=w.useState(null),[g,m]=w.useState(null),[b,y]=w.useState(null),[v,x]=w.useState(null),[A,k]=w.useState(0),[R,O]=w.useState(0),[N,C]=w.useState(!1),[_,M]=w.useState(!1),D=mt(t,U=>u(U)),I=yp(a);return E.jsx(xoe,{scope:n,type:r,dir:I,scrollHideDelay:o,scrollArea:l,viewport:d,onViewportChange:p,content:g,onContentChange:m,scrollbarX:b,onScrollbarXChange:y,scrollbarXEnabled:N,onScrollbarXEnabledChange:C,scrollbarY:v,onScrollbarYChange:x,scrollbarYEnabled:_,onScrollbarYEnabledChange:M,onCornerWidthChange:k,onCornerHeightChange:O,children:E.jsx(Je.div,{dir:I,...s,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":A+"px","--radix-scroll-area-corner-height":R+"px",...e.style}})})});H5.displayName=qT;var $5="ScrollAreaViewport",q5=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...o}=e,s=Rr($5,n),l=w.useRef(null),u=mt(t,l,s.onViewportChange);return E.jsxs(E.Fragment,{children:[E.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),E.jsx(Je.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:E.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});q5.displayName=$5;var da="ScrollAreaScrollbar",VT=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rr(da,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=a,l=e.orientation==="horizontal";return w.useEffect(()=>(l?o(!0):s(!0),()=>{l?o(!1):s(!1)}),[l,o,s]),a.type==="hover"?E.jsx(koe,{...r,ref:t,forceMount:n}):a.type==="scroll"?E.jsx(Toe,{...r,ref:t,forceMount:n}):a.type==="auto"?E.jsx(V5,{...r,ref:t,forceMount:n}):a.type==="always"?E.jsx(WT,{...r,ref:t}):null});VT.displayName=da;var koe=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rr(da,e.__scopeScrollArea),[o,s]=w.useState(!1);return w.useEffect(()=>{const l=a.scrollArea;let u=0;if(l){const d=()=>{window.clearTimeout(u),s(!0)},p=()=>{u=window.setTimeout(()=>s(!1),a.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",p),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",p)}}},[a.scrollArea,a.scrollHideDelay]),E.jsx(ir,{present:n||o,children:E.jsx(V5,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Toe=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rr(da,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Np(()=>u("SCROLL_END"),100),[l,u]=woe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>u("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,a.scrollHideDelay,u]),w.useEffect(()=>{const d=a.viewport,p=o?"scrollLeft":"scrollTop";if(d){let g=d[p];const m=()=>{const b=d[p];g!==b&&(u("SCROLL"),s()),g=b};return d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[a.viewport,o,u,s]),E.jsx(ir,{present:n||l!=="hidden",children:E.jsx(WT,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ke(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ke(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),V5=w.forwardRef((e,t)=>{const n=Rr(da,e.__scopeScrollArea),{forceMount:r,...a}=e,[o,s]=w.useState(!1),l=e.orientation==="horizontal",u=Np(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,a=Rr(da,e.__scopeScrollArea),o=w.useRef(null),s=w.useRef(0),[l,u]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Z5(l.viewport,l.content),p={...r,sizes:l,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function g(m,b){return Ooe(m,s.current,l,b)}return n==="horizontal"?E.jsx(Aoe,{...p,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const m=a.viewport.scrollLeft,b=UO(m,l,a.dir);o.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollLeft=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollLeft=g(m,a.dir))}}):n==="vertical"?E.jsx(Roe,{...p,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const m=a.viewport.scrollTop,b=UO(m,l);o.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollTop=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollTop=g(m))}}):null}),Aoe=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Rr(da,e.__scopeScrollArea),[s,l]=w.useState(),u=w.useRef(null),d=mt(t,u,o.onScrollbarXChange);return w.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),E.jsx(Y5,{"data-orientation":"horizontal",...a,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":_p(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,g)=>{if(o.viewport){const m=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(m),J5(m,g)&&p.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:If(s.paddingLeft),paddingEnd:If(s.paddingRight)}})}})}),Roe=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=Rr(da,e.__scopeScrollArea),[s,l]=w.useState(),u=w.useRef(null),d=mt(t,u,o.onScrollbarYChange);return w.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),E.jsx(Y5,{"data-orientation":"vertical",...a,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":_p(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,g)=>{if(o.viewport){const m=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(m),J5(m,g)&&p.preventDefault()}},onResize:()=>{u.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:If(s.paddingTop),paddingEnd:If(s.paddingBottom)}})}})}),[Coe,W5]=G5(da),Y5=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:g,...m}=e,b=Rr(da,n),[y,v]=w.useState(null),x=mt(t,D=>v(D)),A=w.useRef(null),k=w.useRef(""),R=b.viewport,O=r.content-r.viewport,N=yn(p),C=yn(u),_=Np(g,10);function M(D){if(A.current){const I=D.clientX-A.current.left,U=D.clientY-A.current.top;d({x:I,y:U})}}return w.useEffect(()=>{const D=I=>{const U=I.target;(y==null?void 0:y.contains(U))&&N(I,O)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[R,y,O,N]),w.useEffect(C,[r,C]),zs(y,_),zs(b.content,_),E.jsx(Coe,{scope:n,scrollbar:y,hasThumb:a,onThumbChange:yn(o),onThumbPointerUp:yn(s),onThumbPositionChange:C,onThumbPointerDown:yn(l),children:E.jsx(Je.div,{...m,ref:x,style:{position:"absolute",...m.style},onPointerDown:Ke(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),A.current=y.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",b.viewport&&(b.viewport.style.scrollBehavior="auto"),M(D))}),onPointerMove:Ke(e.onPointerMove,M),onPointerUp:Ke(e.onPointerUp,D=>{const I=D.target;I.hasPointerCapture(D.pointerId)&&I.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=k.current,b.viewport&&(b.viewport.style.scrollBehavior=""),A.current=null})})})}),Of="ScrollAreaThumb",K5=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=W5(Of,e.__scopeScrollArea);return E.jsx(ir,{present:n||a.hasThumb,children:E.jsx(_oe,{ref:t,...r})})}),_oe=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,o=Rr(Of,n),s=W5(Of,n),{onThumbPositionChange:l}=s,u=mt(t,g=>s.onThumbChange(g)),d=w.useRef(void 0),p=Np(()=>{d.current&&(d.current(),d.current=void 0)},100);return w.useEffect(()=>{const g=o.viewport;if(g){const m=()=>{if(p(),!d.current){const b=Ioe(g,l);d.current=b,l()}};return l(),g.addEventListener("scroll",m),()=>g.removeEventListener("scroll",m)}},[o.viewport,p,l]),E.jsx(Je.div,{"data-state":s.hasThumb?"visible":"hidden",...a,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ke(e.onPointerDownCapture,g=>{const b=g.target.getBoundingClientRect(),y=g.clientX-b.left,v=g.clientY-b.top;s.onThumbPointerDown({x:y,y:v})}),onPointerUp:Ke(e.onPointerUp,s.onThumbPointerUp)})});K5.displayName=Of;var YT="ScrollAreaCorner",X5=w.forwardRef((e,t)=>{const n=Rr(YT,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?E.jsx(Noe,{...e,ref:t}):null});X5.displayName=YT;var Noe=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Rr(YT,n),[o,s]=w.useState(0),[l,u]=w.useState(0),d=!!(o&&l);return zs(a.scrollbarX,()=>{var g;const p=((g=a.scrollbarX)==null?void 0:g.offsetHeight)||0;a.onCornerHeightChange(p),u(p)}),zs(a.scrollbarY,()=>{var g;const p=((g=a.scrollbarY)==null?void 0:g.offsetWidth)||0;a.onCornerWidthChange(p),s(p)}),d?E.jsx(Je.div,{...r,ref:t,style:{width:o,height:l,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function If(e){return e?parseInt(e,10):0}function Z5(e,t){const n=e/t;return isNaN(n)?0:n}function _p(e){const t=Z5(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Ooe(e,t,n,r="ltr"){const a=_p(n),o=a/2,s=t||o,l=a-s,u=n.scrollbar.paddingStart+s,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,p=n.content-n.viewport,g=r==="ltr"?[0,p]:[p*-1,0];return Q5([u,d],g)(e)}function UO(e,t,n="ltr"){const r=_p(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,s=t.content-t.viewport,l=o-r,u=n==="ltr"?[0,s]:[s*-1,0],d=z0(e,u);return Q5([0,s],[0,l])(d)}function Q5(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function J5(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},s=n.left!==o.left,l=n.top!==o.top;(s||l)&&t(),n=o,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function Np(e,t){const n=yn(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function zs(e,t){const n=yn(t);Rn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var eG=H5,Doe=q5,Loe=X5;const KT=w.forwardRef(({className:e,children:t,...n},r)=>E.jsxs(eG,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[E.jsx(Doe,{className:"h-full w-full rounded-[inherit]",children:t}),E.jsx(tG,{}),E.jsx(Loe,{})]}));KT.displayName=eG.displayName;const tG=w.forwardRef(({className:e,orientation:t="vertical",...n},r)=>E.jsx(VT,{ref:r,orientation:t,className:Me("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:E.jsx(K5,{className:"bg-border relative flex-1 rounded-full"})}));tG.displayName=VT.displayName;const Moe=({className:e})=>{const{t}=Et(),n=Fe.use.typeColorMap();return!n||n.size===0?null:E.jsxs(wi,{className:`p-2 max-w-xs ${e}`,children:[E.jsx("h3",{className:"text-sm font-medium mb-2",children:t("graphPanel.legend")}),E.jsx(KT,{className:"max-h-80",children:E.jsx("div",{className:"flex flex-col gap-1",children:Array.from(n.entries()).map(([r,a])=>E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:a}}),E.jsx("span",{className:"text-xs truncate",title:r,children:t(`graphPanel.nodeTypes.${r.toLowerCase()}`,r)})]},r))})})]})},Poe=()=>{const{t:e}=Et(),t=De.use.showLegend(),n=De.use.setShowLegend(),r=w.useCallback(()=>{n(!t)},[t,n]);return E.jsx(nt,{variant:wr,onClick:r,tooltip:e("graphPanel.sideBar.legendControl.toggleLegend"),size:"icon",children:E.jsx(aZ,{})})},GO={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedNoArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:U4,curvedArrow:Hne,curvedNoArrow:Gne},nodeProgramClasses:{default:Tne,circel:eu,point:Jte},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},Foe=()=>{const e=X4(),t=Ar(),[n,r]=w.useState(null);return w.useEffect(()=>{e({downNode:a=>{r(a.node),t.getGraph().setNodeAttribute(a.node,"highlighted",!0)},mousemovebody:a=>{if(!n)return;const o=t.viewportToGraph(a);t.getGraph().setNodeAttribute(n,"x",o.x),t.getGraph().setNodeAttribute(n,"y",o.y),a.preventSigmaDefault(),a.original.preventDefault(),a.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:a=>{a.original.buttons!==0&&!t.getCustomBBox()&&t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},zoe=()=>{const[e,t]=w.useState(GO),n=w.useRef(null),r=Fe.use.selectedNode(),a=Fe.use.focusedNode(),o=Fe.use.moveToSelectedNode(),s=Fe.use.isFetching(),l=De.use.showPropertyPanel(),u=De.use.showNodeSearchBar(),d=De.use.enableNodeDrag(),p=De.use.showLegend();w.useEffect(()=>{t(GO),console.log("Initialized sigma settings")},[]),w.useEffect(()=>()=>{const v=Fe.getState().sigmaInstance;if(v)try{v.kill(),Fe.getState().setSigmaInstance(null),console.log("Cleared sigma instance on Graphviewer unmount")}catch(x){console.error("Error cleaning up sigma instance:",x)}},[]);const g=w.useCallback(v=>{v===null?Fe.getState().setFocusedNode(null):v.type==="nodes"&&Fe.getState().setFocusedNode(v.id)},[]),m=w.useCallback(v=>{v===null?Fe.getState().setSelectedNode(null):v.type==="nodes"&&Fe.getState().setSelectedNode(v.id,!0)},[]),b=w.useMemo(()=>a??r,[a,r]),y=w.useMemo(()=>r?{type:"nodes",id:r}:null,[r]);return E.jsxs("div",{className:"relative h-full w-full overflow-hidden",children:[E.jsxs(Wte,{settings:e,className:"!bg-background !size-full overflow-hidden",ref:n,children:[E.jsx(lae,{}),d&&E.jsx(Foe,{}),E.jsx($ne,{node:b,move:o}),E.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[E.jsx(Hae,{}),u&&E.jsx(jae,{value:y,onFocus:g,onChange:m})]}),E.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[E.jsx(sae,{}),E.jsx(cae,{}),E.jsx(uae,{}),E.jsx(Poe,{}),E.jsx(vae,{})]}),l&&E.jsx("div",{className:"absolute top-2 right-2",children:E.jsx(hoe,{})}),p&&E.jsx("div",{className:"absolute bottom-10 right-2",children:E.jsx(Moe,{className:"bg-background/60 backdrop-blur-lg"})}),E.jsx(Soe,{})]}),s&&E.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/80 z-10",children:E.jsxs("div",{className:"text-center",children:[E.jsx("div",{className:"mb-2 h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"}),E.jsx("p",{children:"Loading Graph Data..."})]})})]})},nG=w.forwardRef(({className:e,...t},n)=>E.jsx("div",{className:"relative w-full overflow-auto",children:E.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));nG.displayName="Table";const rG=w.forwardRef(({className:e,...t},n)=>E.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));rG.displayName="TableHeader";const aG=w.forwardRef(({className:e,...t},n)=>E.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));aG.displayName="TableBody";const Boe=w.forwardRef(({className:e,...t},n)=>E.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));Boe.displayName="TableFooter";const lk=w.forwardRef(({className:e,...t},n)=>E.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));lk.displayName="TableRow";const wo=w.forwardRef(({className:e,...t},n)=>E.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));wo.displayName="TableHead";const xo=w.forwardRef(({className:e,...t},n)=>E.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xo.displayName="TableCell";const joe=w.forwardRef(({className:e,...t},n)=>E.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));joe.displayName="TableCaption";function Uoe({title:e,description:t,icon:n=hZ,action:r,className:a,...o}){return E.jsxs(wi,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",a),...o,children:[E.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:E.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),E.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[E.jsx(_c,{children:e}),t?E.jsx(Cp,{children:t}):null]}),r||null]})}var cb={exports:{}},ub,HO;function Goe(){if(HO)return ub;HO=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ub=e,ub}var db,$O;function Hoe(){if($O)return db;$O=1;var e=Goe();function t(){}function n(){}return n.resetWarningCache=t,db=function(){function r(s,l,u,d,p,g){if(g!==e){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},db}var qO;function $oe(){return qO||(qO=1,cb.exports=Hoe()()),cb.exports}var qoe=$oe();const It=un(qoe),Voe=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Bs(e,t,n){const r=Woe(e),{webkitRelativePath:a}=e,o=typeof t=="string"?t:typeof a=="string"&&a.length>0?a:`./${e.name}`;return typeof r.path!="string"&&VO(r,"path",o),VO(r,"relativePath",o),r}function Woe(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),a=Voe.get(r);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}function VO(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const Yoe=[".DS_Store","Thumbs.db"];function Koe(e){return Ai(this,void 0,void 0,function*(){return Df(e)&&Xoe(e.dataTransfer)?eie(e.dataTransfer,e.type):Zoe(e)?Qoe(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Joe(e):[]})}function Xoe(e){return Df(e)}function Zoe(e){return Df(e)&&Df(e.target)}function Df(e){return typeof e=="object"&&e!==null}function Qoe(e){return ck(e.target.files).map(t=>Bs(t))}function Joe(e){return Ai(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Bs(n))})}function eie(e,t){return Ai(this,void 0,void 0,function*(){if(e.items){const n=ck(e.items).filter(a=>a.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(tie));return WO(oG(r))}return WO(ck(e.files).map(n=>Bs(n)))})}function WO(e){return e.filter(t=>Yoe.indexOf(t.name)===-1)}function ck(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?oG(n):[n]],[])}function YO(e,t){return Ai(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const s=yield o.getFile();return s.handle=o,Bs(s)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Bs(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function nie(e){return Ai(this,void 0,void 0,function*(){return e.isDirectory?iG(e):rie(e)})}function iG(e){const t=e.createReader();return new Promise((n,r)=>{const a=[];function o(){t.readEntries(s=>Ai(this,void 0,void 0,function*(){if(s.length){const l=Promise.all(s.map(nie));a.push(l),o()}else try{const l=yield Promise.all(a);n(l)}catch(l){r(l)}}),s=>{r(s)})}o()})}function rie(e){return Ai(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const a=Bs(r,e.fullPath);t(a)},r=>{n(r)})})})}var zd={},KO;function aie(){return KO||(KO=1,zd.__esModule=!0,zd.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",a=(e.type||"").toLowerCase(),o=a.replace(/\/.*$/,"");return n.some(function(s){var l=s.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?o===l.replace(/\/.*$/,""):a===l})}return!0}),zd}var oie=aie();const fb=un(oie);function XO(e){return lie(e)||sie(e)||lG(e)||iie()}function iie(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lie(e){if(Array.isArray(e))return uk(e)}function ZO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function QO(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:pie,message:"File type must be ".concat(r)}},JO=function(t){return{code:gie,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},eI=function(t){return{code:hie,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},yie={code:mie,message:"Too many files"};function cG(e,t){var n=e.type==="application/x-moz-file"||fie(e,t);return[n,n?null:bie(t)]}function uG(e,t,n){if(di(e.size))if(di(t)&&di(n)){if(e.size>n)return[!1,JO(n)];if(e.sizen)return[!1,JO(n)]}return[!0,null]}function di(e){return e!=null}function vie(e){var t=e.files,n=e.accept,r=e.minSize,a=e.maxSize,o=e.multiple,s=e.maxFiles,l=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(u){var d=cG(u,n),p=Oc(d,1),g=p[0],m=uG(u,r,a),b=Oc(m,1),y=b[0],v=l?l(u):null;return g&&y&&!v})}function Lf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Bd(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function tI(e){e.preventDefault()}function Sie(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Eie(e){return e.indexOf("Edge/")!==-1}function wie(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Sie(e)||Eie(e)}function ea(){for(var e=arguments.length,t=new Array(e),n=0;n1?a-1:0),s=1;s