Files
agent-estate-wiki/public/static/scripts/script-4-2a102aaa.js
T
Tony0410 d129b70237 fix: serve quartz with clean URL support and regenerate site
- Add serve.py to resolve clean Quartz URLs to .html files
- Regenerate Quartz site with correct baseUrl http://100.118.5.51:9120
- 196 HTML files emitted; all internal links now resolve
2026-08-15 23:35:16 +08:00

2 lines
20 KiB
JavaScript

var Ct=Object.hasOwnProperty;var pe,y,Ce,tt,J,fe,ve,Ee,Mu,Bu,du,Ae,Iu,Ru,Ou,rt,ge={},bu=[],nt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Su=Array.isArray;function $(u,e){for(var t in e)u[t]=e[t];return u}function zu(u){u&&u.parentNode&&u.parentNode.removeChild(u)}function Uu(u,e,t,a,o){var n={type:u,props:e,key:t,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Ce,__i:-1,__u:0};return o==null&&y.vnode!=null&&y.vnode(n),n}function cu(u){return u.children}function yu(u,e){this.props=u,this.context=e}function su(u,e){if(e==null)return u.__?su(u.__,u.__i+1):null;for(var t;e<u.__k.length;e++)if((t=u.__k[e])!=null&&t.__e!=null)return t.__e;return typeof u.type=="function"?su(u):null}function ot(u){if(u.__P&&u.__d){var e=u.__v,t=e.__e,a=[],o=[],n=$({},e);n.__v=e.__v+1,y.vnode&&y.vnode(n),be(u.__P,n,e,u.__n,u.__P.namespaceURI,32&e.__u?[t]:null,a,t??su(e),!!(32&e.__u),o),n.__v=e.__v,n.__.__k[n.__i]=n,Dt(a,n,o),e.__e=e.__=null,n.__e!=t&&me(n)}}function me(u){if((u=u.__)!=null&&u.__c!=null)return u.__e=u.__c.base=null,u.__k.some(function(e){if(e!=null&&e.__e!=null)return u.__e=u.__c.base=e.__e}),me(u)}function _e(u){(!u.__d&&(u.__d=!0)&&J.push(u)&&!xu.__r++||fe!=y.debounceRendering)&&((fe=y.debounceRendering)||ve)(xu)}function xu(){try{for(var u,e=1;J.length;)J.length>e&&J.sort(Ee),u=J.shift(),e=J.length,ot(u)}finally{J.length=xu.__r=0}}function Be(u,e,t,a,o,n,s,c,h,D,_){var r,E,f,b,S,B,p,C=a&&a.__k||bu,M=e.length;for(h=at(t,e,C,h,M),r=0;r<M;r++)(f=t.__k[r])!=null&&(E=f.__i!=-1&&C[f.__i]||ge,f.__i=r,B=be(u,f,E,o,n,s,c,h,D,_),b=f.__e,f.ref&&E.ref!=f.ref&&(E.ref&&Hu(E.ref,null,f),_.push(f.ref,f.__c||b,f)),S==null&&b!=null&&(S=b),(p=!!(4&f.__u))||E.__k===f.__k?(h=ye(f,h,u,p),p&&E.__e&&(E.__e=null)):typeof f.type=="function"&&B!==void 0?h=B:b&&(h=b.nextSibling),f.__u&=-7);return t.__e=S,h}function at(u,e,t,a,o){var n,s,c,h,D,_=t.length,r=_,E=0;for(u.__k=new Array(o),n=0;n<o;n++)(s=e[n])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=u.__k[n]=Uu(null,s,null,null,null):Su(s)?s=u.__k[n]=Uu(cu,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=u.__k[n]=Uu(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):u.__k[n]=s,h=n+E,s.__=u,s.__b=u.__b+1,c=null,(D=s.__i=it(s,t,h,r))!=-1&&(r--,(c=t[D])&&(c.__u|=2)),c==null||c.__v==null?(D==-1&&(o>_?E--:o<_&&E++),typeof s.type!="function"&&(s.__u|=4)):D!=h&&(D==h-1?E--:D==h+1?E++:(D>h?E--:E++,s.__u|=4))):u.__k[n]=null;if(r)for(n=0;n<_;n++)(c=t[n])!=null&&(2&c.__u)==0&&(c.__e==a&&(a=su(c)),Se(c,c));return a}function ye(u,e,t,a){var o,n;if(typeof u.type=="function"){for(o=u.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=u,e=ye(o[n],e,t,a));return e}u.__e!=e&&(a&&(e&&u.type&&!e.parentNode&&(e=su(u)),t.insertBefore(u.__e,e||null)),e=u.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function it(u,e,t,a){var o,n,s,c=u.key,h=u.type,D=e[t],_=D!=null&&(2&D.__u)==0;if(D===null&&c==null||_&&c==D.key&&h==D.type)return t;if(a>(_?1:0)){for(o=t-1,n=t+1;o>=0||n<e.length;)if((D=e[s=o>=0?o--:n++])!=null&&(2&D.__u)==0&&c==D.key&&h==D.type)return s}return-1}function de(u,e,t){e[0]=="-"?u.setProperty(e,t??""):u[e]=t==null?"":typeof t!="number"||nt.test(e)?t:t+"px"}function mu(u,e,t,a,o){var n,s;u:if(e=="style")if(typeof t=="string")u.style.cssText=t;else{if(typeof a=="string"&&(u.style.cssText=a=""),a)for(e in a)t&&e in t||de(u.style,e,"");if(t)for(e in t)a&&t[e]==a[e]||de(u.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(Ae,"$1")),s=e.toLowerCase(),e=s in u||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),u.l||(u.l={}),u.l[e+n]=t,t?a?t[du]=a[du]:(t[du]=Iu,u.addEventListener(e,n?Ou:Ru,n)):u.removeEventListener(e,n?Ou:Ru,n);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in u)try{u[e]=t??"";break u}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?u.removeAttribute(e):u.setAttribute(e,e=="popover"&&t==1?"":t))}}function he(u){return function(e){if(this.l){var t=this.l[e.type+u];if(e[Bu]==null)e[Bu]=Iu++;else if(e[Bu]<t[du])return;return t(y.event?y.event(e):e)}}}function be(u,e,t,a,o,n,s,c,h,D){var _,r,E,f,b,S,B,p,C,M,G,I,Q,X,uu,T=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(h=!!(32&t.__u),n=[c=e.__e=t.__e]),(_=y.__b)&&_(e);u:if(typeof T=="function")try{if(p=e.props,C=T.prototype&&T.prototype.render,M=(_=T.contextType)&&a[_.__c],G=_?M?M.props.value:_.__:a,t.__c?B=(r=e.__c=t.__c).__=r.__E:(C?e.__c=r=new T(p,G):(e.__c=r=new yu(p,G),r.constructor=T,r.render=st),M&&M.sub(r),r.state||(r.state={}),r.__n=a,E=r.__d=!0,r.__h=[],r._sb=[]),C&&r.__s==null&&(r.__s=r.state),C&&T.getDerivedStateFromProps!=null&&(r.__s==r.state&&(r.__s=$({},r.__s)),$(r.__s,T.getDerivedStateFromProps(p,r.__s))),f=r.props,b=r.state,r.__v=e,E)C&&T.getDerivedStateFromProps==null&&r.componentWillMount!=null&&r.componentWillMount(),C&&r.componentDidMount!=null&&r.__h.push(r.componentDidMount);else{if(C&&T.getDerivedStateFromProps==null&&p!==f&&r.componentWillReceiveProps!=null&&r.componentWillReceiveProps(p,G),e.__v==t.__v||!r.__e&&r.shouldComponentUpdate!=null&&r.shouldComponentUpdate(p,r.__s,G)===!1){e.__v!=t.__v&&(r.props=p,r.state=r.__s,r.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(V){V&&(V.__=e)}),bu.push.apply(r.__h,r._sb),r._sb=[],r.__h.length&&s.push(r);break u}r.componentWillUpdate!=null&&r.componentWillUpdate(p,r.__s,G),C&&r.componentDidUpdate!=null&&r.__h.push(function(){r.componentDidUpdate(f,b,S)})}if(r.context=G,r.props=p,r.__P=u,r.__e=!1,I=y.__r,Q=0,C)r.state=r.__s,r.__d=!1,I&&I(e),_=r.render(r.props,r.state,r.context),bu.push.apply(r.__h,r._sb),r._sb=[];else do r.__d=!1,I&&I(e),_=r.render(r.props,r.state,r.context),r.state=r.__s;while(r.__d&&++Q<25);r.state=r.__s,r.getChildContext!=null&&(a=$($({},a),r.getChildContext())),C&&!E&&r.getSnapshotBeforeUpdate!=null&&(S=r.getSnapshotBeforeUpdate(f,b)),X=_!=null&&_.type===cu&&_.key==null?xe(_.props.children):_,c=Be(u,Su(X)?X:[X],e,t,a,o,n,s,c,h,D),r.base=e.__e,e.__u&=-161,r.__h.length&&s.push(r),B&&(r.__E=r.__=null)}catch(V){if(e.__v=null,h||n!=null)if(V.then){for(e.__u|=h?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;n[n.indexOf(c)]=null,e.__e=c}else{for(uu=n.length;uu--;)zu(n[uu]);Gu(e)}else e.__e=t.__e,e.__k=t.__k,V.then||Gu(e);y.__e(V,e,t)}else n==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):c=e.__e=lt(t.__e,e,t,a,o,n,s,h,D);return(_=y.diffed)&&_(e),128&e.__u?void 0:c}function Gu(u){u&&(u.__c&&(u.__c.__e=!0),u.__k&&u.__k.some(Gu))}function Dt(u,e,t){for(var a=0;a<t.length;a++)Hu(t[a],t[++a],t[++a]);y.__c&&y.__c(e,u),u.some(function(o){try{u=o.__h,o.__h=[],u.some(function(n){n.call(o)})}catch(n){y.__e(n,o.__v)}})}function xe(u){return typeof u!="object"||u==null||u.__b>0?u:Su(u)?u.map(xe):$({},u)}function lt(u,e,t,a,o,n,s,c,h){var D,_,r,E,f,b,S,B=t.props||ge,p=e.props,C=e.type;if(C=="svg"?o="http://www.w3.org/2000/svg":C=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),n!=null){for(D=0;D<n.length;D++)if((f=n[D])&&"setAttribute"in f==!!C&&(C?f.localName==C:f.nodeType==3)){u=f,n[D]=null;break}}if(u==null){if(C==null)return document.createTextNode(p);u=document.createElementNS(o,C,p.is&&p),c&&(y.__m&&y.__m(e,n),c=!1),n=null}if(C==null)B===p||c&&u.data==p||(u.data=p);else{if(n=n&&pe.call(u.childNodes),!c&&n!=null)for(B={},D=0;D<u.attributes.length;D++)B[(f=u.attributes[D]).name]=f.value;for(D in B)f=B[D],D=="dangerouslySetInnerHTML"?r=f:D=="children"||D in p||D=="value"&&"defaultValue"in p||D=="checked"&&"defaultChecked"in p||mu(u,D,null,f,o);for(D in p)f=p[D],D=="children"?E=f:D=="dangerouslySetInnerHTML"?_=f:D=="value"?b=f:D=="checked"?S=f:c&&typeof f!="function"||B[D]===f||mu(u,D,f,B[D],o);if(_)c||r&&(_.__html==r.__html||_.__html==u.innerHTML)||(u.innerHTML=_.__html),e.__k=[];else if(r&&(u.innerHTML=""),Be(e.type=="template"?u.content:u,Su(E)?E:[E],e,t,a,C=="foreignObject"?"http://www.w3.org/1999/xhtml":o,n,s,n?n[0]:t.__k&&su(t,0),c,h),n!=null)for(D=n.length;D--;)zu(n[D]);c||(D="value",C=="progress"&&b==null?u.removeAttribute("value"):b!=null&&(b!==u[D]||C=="progress"&&!b||C=="option"&&b!=B[D])&&mu(u,D,b,B[D],o),D="checked",S!=null&&S!=u[D]&&mu(u,D,S,B[D],o))}return u}function Hu(u,e,t){try{if(typeof u=="function"){var a=typeof u.__u=="function";a&&u.__u(),a&&e==null||(u.__u=u(e))}else u.current=e}catch(o){y.__e(o,t)}}function Se(u,e,t){var a,o;if(y.unmount&&y.unmount(u),(a=u.ref)&&(a.current&&a.current!=u.__e||Hu(a,null,e)),(a=u.__c)!=null){if(a.componentWillUnmount)try{a.componentWillUnmount()}catch(n){y.__e(n,e)}a.base=a.__P=null}if(a=u.__k)for(o=0;o<a.length;o++)a[o]&&Se(a[o],e,t||typeof u.type!="function");t||zu(u.__e),u.__c=u.__=u.__e=void 0}function st(u,e,t){return this.constructor(u,t)}pe=bu.slice,y={__e:function(u,e,t,a){for(var o,n,s;e=e.__;)if((o=e.__c)&&!o.__)try{if((n=o.constructor)&&n.getDerivedStateFromError!=null&&(o.setState(n.getDerivedStateFromError(u)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(u,a||{}),s=o.__d),s)return o.__E=o}catch(c){u=c}throw u}},Ce=0,tt=function(u){return u!=null&&u.constructor===void 0},yu.prototype.setState=function(u,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$({},this.state),typeof u=="function"&&(u=u($({},t),this.props)),u&&$(t,u),u!=null&&this.__v&&(e&&this._sb.push(e),_e(this))},yu.prototype.forceUpdate=function(u){this.__v&&(this.__e=!0,u&&this.__h.push(u),_e(this))},yu.prototype.render=cu,J=[],ve=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ee=function(u,e){return u.__v.__b-e.__v.__b},xu.__r=0,Mu=Math.random().toString(8),Bu="__d"+Mu,du="__a"+Mu,Ae=/(PointerCapture)$|Capture$/i,Iu=0,Ru=he(!1),Ou=he(!0),rt=0;function Fu(u){let e=_t(ft(u,"index"),!0);return e.length===0?"/":e}function we(){let u=window.location.pathname;return u.endsWith("/")&&(u=u.slice(0,-1)),u.startsWith("/")&&(u=u.slice(1)),u}function Nu(){return typeof document>"u"?"":document.body?.dataset?.basepath??""}function $u(u,e){let t=e??Nu(),a=u.startsWith("/")?u:"/"+u;return t+a}function Ft(u,e){return u===e||u.endsWith("/"+e)}function ft(u,e){return Ft(u,e)&&(u=u.slice(0,-e.length)),u}function _t(u,e){return u.startsWith("/")&&(u=u.substring(1)),!e&&u.endsWith("/")&&(u=u.slice(0,-1)),u}function ke(u){for(;u.firstChild;)u.removeChild(u.firstChild)}(function(){function u(){var a=we(),o=Nu();return o&&a.startsWith(o.replace(/^\//,""))&&(a=a.slice(o.replace(/^\//,"").length),a.startsWith("/")&&(a=a.slice(1))),a}function e(a){var o=document.querySelector('script[src="'+a+'"]');return o?Promise.resolve():new Promise(function(n,s){var c=document.createElement("script");c.src=a,c.crossOrigin="anonymous",c.onload=n,c.onerror=s,document.head.appendChild(c)})}Promise.all([e("https://cdn.jsdelivr.net/npm/d3@7/dist/d3.min.js"),e("https://cdn.jsdelivr.net/npm/pixi.js@8/dist/pixi.js")]).then(function(){t()}).catch(function(a){console.error("[Graph] Failed to load libraries:",a);for(var o=document.querySelectorAll(".graph-container"),n=0;n<o.length;n++)o[n].textContent="Graph could not load. Check your network connection.",o[n].style.display="flex",o[n].style.alignItems="center",o[n].style.justifyContent="center",o[n].style.color="var(--gray)",o[n].style.fontSize="0.9rem"});function t(){var a=window.d3,o=window.PIXI;if(!a||!o){console.error("[Graph] Libraries not loaded");return}var n="graph-visited";function s(){return new Set(JSON.parse(localStorage.getItem(n)||"[]"))}function c(d){var w=s();w.add(d),localStorage.setItem(n,JSON.stringify(Array.from(w)))}function h(d,w){if(!d)return w;var g=document.createElement("div");g.style.color=d,g.style.position="absolute",g.style.visibility="hidden",document.body.appendChild(g);var m=getComputedStyle(g).color;return g.remove(),m||w}async function D(d,w,g){var m=Fu(w);m===""&&(m="index");var q=s();if(ke(d),g!==void 0&&g!==E)return console.log("[Graph] Stale render, skipping"),function(){};var x=JSON.parse(d.dataset.cfg||"{}"),fu=x.drag,Le=x.zoom,Vu=x.depth,qu=x.scale||1,Pe=x.repelForce||.5,je=x.centerForce||.3,Te=x.linkDistance||30,We=x.fontSize||.6,Me=x.opacityScale||1,Ue=x.removeTags||[],Re=x.showTags,Oe=x.focusOnHover,Ge=x.enableRadial,eu;try{var Ku=await fetchData;eu=new Map;for(var Ju in Ku)eu.set(Fu(Ju),Ku[Ju])}catch(i){return console.error("[Graph] Error loading data:",i),function(){}}var R=d.offsetWidth,O=Math.max(d.offsetHeight,250),tu=[],hu=[],Xu=new Set(eu.keys());eu.forEach(function(i,l){for(var F=i.links||[],A=0;A<F.length;A++){var v=Fu(F[A]);Xu.has(v)&&tu.push({source:l,target:v})}if(Re)for(var j=i.tags||[],A=0;A<j.length;A++){var N=j[A];if(Ue.indexOf(N)===-1){var K=Fu("tags/"+N);hu.indexOf(K)===-1&&hu.push(K),tu.push({source:l,target:K})}}});var ru=new Set;if(Vu>=0)for(var pu=[m],Cu=new Set([m]),Yu=0;Yu<=Vu&&pu.length>0;Yu++){for(var wu=[],ku=0;ku<pu.length;ku++){var Lu=pu[ku];ru.add(Lu);for(var Pu=0;Pu<tu.length;Pu++){var W=tu[Pu];W.source===Lu&&!Cu.has(W.target)&&(Cu.add(W.target),wu.push(W.target)),W.target===Lu&&!Cu.has(W.source)&&(Cu.add(W.source),wu.push(W.source))}}pu=wu}else{Xu.forEach(function(i){ru.add(i)});for(var k=0;k<hu.length;k++)ru.add(hu[k])}var nu=[],ju=new Map;ru.forEach(function(i){var l=i.startsWith("tags/"),F=l?"#"+i.substring(5):eu.get(i)?.title||i,A=l?[]:eu.get(i)?.tags||[],v={id:i,text:F,tags:A,x:Math.random()*R-R/2,y:Math.random()*O-O/2,vx:0,vy:0};nu.push(v),ju.set(i,v)});for(var H=[],k=0;k<tu.length;k++){var W=tu[k];if(ru.has(W.source)&&ru.has(W.target)){var Zu=ju.get(W.source),Qu=ju.get(W.target);Zu&&Qu&&H.push({source:Zu,target:Qu})}}var Y=getComputedStyle(document.documentElement),Ie=h(Y.getPropertyValue("--secondary").trim(),"#c792ea"),ue=h(Y.getPropertyValue("--tertiary").trim(),"#82aaff"),ee=h(Y.getPropertyValue("--gray").trim(),"#6c6c6c"),te=h(Y.getPropertyValue("--lightgray").trim(),"#d4d4d4"),ze=h(Y.getPropertyValue("--dark").trim(),"#1a1a1a"),He=h(Y.getPropertyValue("--light").trim(),"#f5f5f5"),Ne=Y.getPropertyValue("--bodyFont").trim()||"inherit",Z=new o.Application;await Z.init({width:R,height:O,antialias:!0,backgroundAlpha:0,resolution:window.devicePixelRatio||1,autoDensity:!0,eventMode:"static"}),d.appendChild(Z.canvas);var ou=new o.Container;Z.stage.addChild(ou);var au=a.forceSimulation(nu).force("charge",a.forceManyBody().strength(-100*Pe)).force("center",a.forceCenter().strength(je)).force("link",a.forceLink(H).distance(Te)).force("collide",a.forceCollide().radius(function(i){for(var l=0,F=0;F<H.length;F++)(H[F].source.id===i.id||H[F].target.id===i.id)&&l++;return 2+Math.sqrt(l)}).iterations(3));if(Ge){var Tu=Math.min(R,O)/2*.8;au.force("radial",a.forceRadial(Tu).strength(.2))}var re=new o.Container,ne=new o.Container,vu=new o.Container;ou.addChild(re),ou.addChild(ne),ou.addChild(vu);var L=[],z=[],_u=null,iu=new Set,oe=0,Eu=!1,P=a.zoomIdentity;function ae(i){for(var l=0,F=0;F<H.length;F++)(H[F].source.id===i.id||H[F].target.id===i.id)&&l++;return 2+Math.sqrt(l)}function $e(i){var l=i.id===m;return l?Ie:q.has(i.id)||i.id.startsWith("tags/")?ue:ee}function Wu(i){if(_u=i,i===null){iu=new Set;for(var l=0;l<L.length;l++)L[l].active=!1;for(var l=0;l<z.length;l++)z[l].active=!1}else{iu=new Set;for(var l=0;l<z.length;l++){var F=z[l].simulationData;F.source.id===i||F.target.id===i?(iu.add(F.source.id),iu.add(F.target.id),z[l].active=!0):z[l].active=!1}iu.add(i);for(var l=0;l<L.length;l++)iu.has(L[l].simulationData.id)?L[l].active=!0:L[l].active=!1}}function Ve(){for(var i=0;i<z.length;i++){var l=z[i],F=1;_u!==null&&(F=l.active?1:.2),l.alpha=F,l.color=l.active?ee:te}}function qe(){for(var i=1/qu,l=i*1.1,F=0;F<L.length;F++){var A=L[F];_u===A.simulationData.id?(A.label.alpha=1,A.label.scale.set(l)):A.label.scale.set(i)}}function Ke(){for(var i=0;i<L.length;i++){var l=L[i],F=1;_u!==null&&Oe&&(F=l.active?1:.2),l.gfx.alpha=F}}function Au(){Ke(),Ve(),qe()}for(var k=0;k<nu.length;k++){var Du=nu[k],ie=Du.id,De=ie.startsWith("tags/"),Tu=ae(Du),le=$e(Du),lu=new o.Text({text:Du.text,style:{fontSize:We*15,fill:ze,fontFamily:Ne},resolution:window.devicePixelRatio*4});lu.anchor.set(.5,1.2),lu.alpha=0,lu.scale.set(1/qu),vu.addChild(lu);var U=new o.Graphics;U.circle(0,0,Tu),U.fill({color:De?He:le}),De&&U.stroke({width:2,color:ue}),U.eventMode="static",U.cursor="pointer",U.label=ie,(function(F,A,v){var j=0;A.on("pointerover",function(N){Wu(F.id),j=v.alpha,Eu||Au()}),A.on("pointerleave",function(){Wu(null),v.alpha=j,Eu||Au()})})(Du,U,lu),ne.addChild(U),L.push({simulationData:Du,gfx:U,label:lu,color:le,alpha:1,active:!1})}for(var k=0;k<H.length;k++){var W=H[k],U=new o.Graphics;U.eventMode="none",re.addChild(U),z.push({simulationData:W,gfx:U,color:te,alpha:1,active:!1})}if(fu){var Je=function(i){for(var l=(i.x-P.x)/P.k,F=(i.y-P.y)/P.k,A=0;A<nu.length;A++){var v=nu[A],j=l-v.x-R/2,N=F-v.y-O/2,K=Math.sqrt(j*j+N*N),gu=ae(v);if(K<gu+5)return v}return null},Xe=function(i){i.active||au.alphaTarget(1).restart(),i.subject.fx=i.subject.x,i.subject.fy=i.subject.y;var l=(i.x-P.x)/P.k-R/2,F=(i.y-P.y)/P.k-O/2;i.subject.__dragOffset={x:l-i.subject.x,y:F-i.subject.y},oe=Date.now(),Eu=!0,_u=i.subject.id},Ye=function(i){var l=(i.x-P.x)/P.k-R/2,F=(i.y-P.y)/P.k-O/2;i.subject.fx=l-i.subject.__dragOffset.x,i.subject.fy=F-i.subject.__dragOffset.y},Ze=function(i){if(i.active||au.alphaTarget(0),i.subject.fx=null,i.subject.fy=null,Eu=!1,Wu(null),Au(),Date.now()-oe<500){var l=$u(i.subject.id);window.location.href=l}},Qe=a.drag().container(Z.canvas).subject(Je).on("start",Xe).on("drag",Ye).on("end",Ze);a.select(Z.canvas).call(Qe)}else for(var k=0;k<L.length;k++)(function(l){l.gfx.on("click",function(){var F=$u(l.simulationData.id);window.location.href=F})})(L[k]);if(Le){var ut=function(i){P=i.transform,ou.scale.set(P.k,P.k),ou.position.set(P.x,P.y);for(var l=P.k*Me,F=Math.max((l-1)/3.75,0),A=[],v=0;v<L.length;v++)L[v].active&&A.push(L[v].label);for(var v=0;v<vu.children.length;v++){var j=vu.children[v];A.indexOf(j)===-1&&(j.alpha=F)}},et=a.zoom().extent([[0,0],[R,O]]).scaleExtent([.25,4]).on("zoom",ut);a.select(Z.canvas).call(et)}var se=!1;function ce(){if(!se){for(var i=0;i<L.length;i++){var l=L[i],F=l.simulationData.x,A=l.simulationData.y;F!=null&&A!=null&&(l.gfx.position.set(F+R/2,A+O/2),l.label&&l.label.position.set(F+R/2,A+O/2))}for(var i=0;i<z.length;i++){var v=z[i],j=v.simulationData,N=j.source.x,K=j.source.y,gu=j.target.x,Fe=j.target.y;N!=null&&K!=null&&gu!=null&&Fe!=null&&(v.gfx.clear(),v.gfx.moveTo(N+R/2,K+O/2),v.gfx.lineTo(gu+R/2,Fe+O/2),v.gfx.stroke({alpha:v.alpha,width:1,color:v.color}))}requestAnimationFrame(ce)}}return au.on("tick",function(){}),au.restart(),Au(),ce(),function(){se=!0,au.stop();try{Z.destroy(!0)}catch{}}}var _=[],r=[],E=0;function f(){for(var d=0;d<_.length;d++)_[d]();_=[]}function b(){for(var d=0;d<r.length;d++)r[d]();r=[]}var S=[],B=[],p=null,C=null,M=null;function G(){b();for(var d=0;d<S.length;d++){S[d].classList.remove("active");var w=S[d].closest(".sidebar");w&&(w.style.zIndex="")}}function I(){for(var d=0;d<S.length;d++)if(S[d].classList.contains("active"))return!0;return!1}function Q(){b();for(var d=u(),w=0;w<S.length;w++){var g=S[w];g.classList.add("active");var m=g.closest(".sidebar");m&&(m.style.zIndex="1");var q=g.querySelector(".global-graph-container");q&&(function(x){D(x,d,void 0).then(function(fu){r.push(fu)}).catch(function(fu){console.error("[Graph] Global render error:",fu)})})(q)}}function X(){I()?G():Q()}function uu(){f();var d=++E,w=u();c(w);for(var g=document.querySelectorAll(".graph-container"),m=0;m<g.length;m++)(function(q){D(q,w,d).then(function(x){d===E&&_.push(x)}).catch(function(x){console.error("[Graph] Local render error:",x)})})(g[m])}function T(d){var w=d.detail?d.detail.url:u();if(c(Fu(w)),uu(),S=Array.from(document.querySelectorAll(".global-graph-outer")),M)for(var g=0;g<B.length;g++)B[g].removeEventListener("click",M);B=Array.from(document.querySelectorAll(".global-graph-icon")),M=function(){X()};for(var g=0;g<B.length;g++)B[g].addEventListener("click",M);p&&document.removeEventListener("click",p),p=function(m){if(I()){var q=m.target.closest(".global-graph-container"),x=m.target.closest(".global-graph-icon");!q&&!x&&G()}},document.addEventListener("click",p),C&&document.removeEventListener("keydown",C),C=function(m){if(m.key==="Escape"){I()&&G();return}m.key==="g"&&(m.ctrlKey||m.metaKey)&&!m.shiftKey&&(m.preventDefault(),X())},document.addEventListener("keydown",C),I()&&Q()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){T({detail:{url:u()}})}):T({detail:{url:u()}}),document.addEventListener("prenav",function(){f(),b()}),document.addEventListener("nav",T),document.addEventListener("render",T);function V(){uu(),I()&&Q()}document.addEventListener("themechange",V)}})();