@origintrail-official/dkg-node-ui 10.0.0 → 10.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/otlp-log-worker.d.ts +127 -0
- package/dist/otlp-log-worker.d.ts.map +1 -0
- package/dist/otlp-log-worker.js +268 -0
- package/dist/otlp-log-worker.js.map +1 -0
- package/dist/telemetry-resource.d.ts +41 -0
- package/dist/telemetry-resource.d.ts.map +1 -0
- package/dist/telemetry-resource.js +31 -0
- package/dist/telemetry-resource.js.map +1 -0
- package/dist/telemetry.d.ts +75 -16
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +152 -29
- package/dist/telemetry.js.map +1 -1
- package/dist-ui/assets/{3d-force-graph-CJApDMaR.js → 3d-force-graph-CcVMtgO4.js} +1 -1
- package/dist-ui/assets/Admin-DNNaF7rz.js +45 -0
- package/dist-ui/assets/{AgentHub-B2hxc5jq.js → AgentHub-eWb_Tns6.js} +1 -1
- package/dist-ui/assets/AgentProfilePage-D2T_V6PG.js +1 -0
- package/dist-ui/assets/Network-C6MDsv2e.js +1 -0
- package/dist-ui/assets/OnChainProvenanceCard-BbrU7jzL.js +1 -0
- package/dist-ui/assets/{Operations-F276JTZb.js → Operations-CCMDENBd.js} +3 -3
- package/dist-ui/assets/Settings-WaFKYtwQ.js +1 -0
- package/dist-ui/assets/ccip-CDdHldzo.js +1 -0
- package/dist-ui/assets/formatTrac-BTy0WudH.js +1 -0
- package/dist-ui/assets/{index--rkHgZxC.js → index-2Gzrk1k3.js} +164 -173
- package/dist-ui/assets/{index-DOgQqEa_.js → index-BrxEjqsW.js} +3 -3
- package/dist-ui/assets/{index-BgRu6zNc.css → index-CmliV5st.css} +1 -1
- package/dist-ui/assets/{index-IQUCPHDs.js → index-W4n8cdTA.js} +11 -11
- package/dist-ui/assets/{jsonld-32FQRO67-C6LUWPog.js → jsonld-32FQRO67-CbN9NJJW.js} +2 -2
- package/dist-ui/assets/{jsonld-RkISz_bF.js → jsonld-DkQdPwg5.js} +1 -1
- package/dist-ui/assets/{renderer-3d-2EVDZII7-DwK8fIlO.js → renderer-3d-2EVDZII7-CTUExXUn.js} +2 -2
- package/dist-ui/index.html +2 -2
- package/package.json +13 -4
- package/dist-ui/assets/AgentProfilePage-CDWiC_8K.js +0 -1
- package/dist-ui/assets/Network-DqdABbM7.js +0 -1
- package/dist-ui/assets/OnChainProvenanceCard-DDG5hBdy.js +0 -1
- package/dist-ui/assets/Settings-CXLPuyz1.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderer-3d-2EVDZII7-
|
|
2
|
-
var qi=Object.defineProperty;var Vi=(e,n,r)=>n in e?qi(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var P=(e,n,r)=>Vi(e,typeof n!="symbol"?n+"":n,r);import{K,M as et,_ as qt}from"./index--rkHgZxC.js";import{e as Rt,c as $n,f as Ln,g as Gi,o as Xi,h as Un,m as Hn}from"./ordinal-DhEzRPdO.js";var on="http://www.w3.org/1999/xhtml";const Bn={svg:"http://www.w3.org/2000/svg",xhtml:on,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Le(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Bn.hasOwnProperty(n)?{space:Bn[n],local:e}:e}function Yi(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===on&&n.documentElement.namespaceURI===on?n.createElement(e):n.createElementNS(r,e)}}function Ki(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Br(e){var n=Le(e);return(n.local?Ki:Yi)(n)}function Zi(){}function xn(e){return e==null?Zi:function(){return this.querySelector(e)}}function Qi(e){typeof e!="function"&&(e=xn(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a=n[o],s=a.length,l=i[o]=new Array(s),u,c,h=0;h<s;++h)(u=a[h])&&(c=e.call(u,u.__data__,h,a))&&("__data__"in u&&(c.__data__=u.__data__),l[h]=c);return new it(i,this._parents)}function Ji(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function to(){return[]}function Wr(e){return e==null?to:function(){return this.querySelectorAll(e)}}function eo(e){return function(){return Ji(e.apply(this,arguments))}}function no(e){typeof e=="function"?e=eo(e):e=Wr(e);for(var n=this._groups,r=n.length,i=[],o=[],a=0;a<r;++a)for(var s=n[a],l=s.length,u,c=0;c<l;++c)(u=s[c])&&(i.push(e.call(u,u.__data__,c,s)),o.push(u));return new it(i,o)}function qr(e){return function(){return this.matches(e)}}function Vr(e){return function(n){return n.matches(e)}}var ro=Array.prototype.find;function io(e){return function(){return ro.call(this.children,e)}}function oo(){return this.firstElementChild}function ao(e){return this.select(e==null?oo:io(typeof e=="function"?e:Vr(e)))}var so=Array.prototype.filter;function lo(){return Array.from(this.children)}function uo(e){return function(){return so.call(this.children,e)}}function co(e){return this.selectAll(e==null?lo:uo(typeof e=="function"?e:Vr(e)))}function fo(e){typeof e!="function"&&(e=qr(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a=n[o],s=a.length,l=i[o]=[],u,c=0;c<s;++c)(u=a[c])&&e.call(u,u.__data__,c,a)&&l.push(u);return new it(i,this._parents)}function Gr(e){return new Array(e.length)}function ho(){return new it(this._enter||this._groups.map(Gr),this._parents)}function Ae(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Ae.prototype={constructor:Ae,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function po(e){return function(){return e}}function go(e,n,r,i,o,a){for(var s=0,l,u=n.length,c=a.length;s<c;++s)(l=n[s])?(l.__data__=a[s],i[s]=l):r[s]=new Ae(e,a[s]);for(;s<u;++s)(l=n[s])&&(o[s]=l)}function _o(e,n,r,i,o,a,s){var l,u,c=new Map,h=n.length,f=a.length,d=new Array(h),p;for(l=0;l<h;++l)(u=n[l])&&(d[l]=p=s.call(u,u.__data__,l,n)+"",c.has(p)?o[l]=u:c.set(p,u));for(l=0;l<f;++l)p=s.call(e,a[l],l,a)+"",(u=c.get(p))?(i[l]=u,u.__data__=a[l],c.delete(p)):r[l]=new Ae(e,a[l]);for(l=0;l<h;++l)(u=n[l])&&c.get(d[l])===u&&(o[l]=u)}function vo(e){return e.__data__}function yo(e,n){if(!arguments.length)return Array.from(this,vo);var r=n?_o:go,i=this._parents,o=this._groups;typeof e!="function"&&(e=po(e));for(var a=o.length,s=new Array(a),l=new Array(a),u=new Array(a),c=0;c<a;++c){var h=i[c],f=o[c],d=f.length,p=mo(e.call(h,h&&h.__data__,c,i)),_=p.length,b=l[c]=new Array(_),y=s[c]=new Array(_),g=u[c]=new Array(d);r(h,f,b,y,g,p,n);for(var w=0,x=0,m,v;w<_;++w)if(m=b[w]){for(w>=x&&(x=w+1);!(v=y[x])&&++x<_;);m._next=v||null}}return s=new it(s,i),s._enter=l,s._exit=u,s}function mo(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function bo(){return new it(this._exit||this._groups.map(Gr),this._parents)}function wo(e,n,r){var i=this.enter(),o=this,a=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),r==null?a.remove():r(a),i&&o?i.merge(o).order():o}function xo(e){for(var n=e.selection?e.selection():e,r=this._groups,i=n._groups,o=r.length,a=i.length,s=Math.min(o,a),l=new Array(o),u=0;u<s;++u)for(var c=r[u],h=i[u],f=c.length,d=l[u]=new Array(f),p,_=0;_<f;++_)(p=c[_]||h[_])&&(d[_]=p);for(;u<o;++u)l[u]=r[u];return new it(l,this._parents)}function ko(){for(var e=this._groups,n=-1,r=e.length;++n<r;)for(var i=e[n],o=i.length-1,a=i[o],s;--o>=0;)(s=i[o])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function So(e){e||(e=Co);function n(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a){for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,h=0;h<l;++h)(c=s[h])&&(u[h]=c);u.sort(n)}return new it(o,this._parents).order()}function Co(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function Mo(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ao(){return Array.from(this)}function Po(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length;o<a;++o){var s=i[o];if(s)return s}return null}function To(){let e=0;for(const n of this)++e;return e}function Eo(){return!this.node()}function No(e){for(var n=this._groups,r=0,i=n.length;r<i;++r)for(var o=n[r],a=0,s=o.length,l;a<s;++a)(l=o[a])&&e.call(l,l.__data__,a,o);return this}function zo(e){return function(){this.removeAttribute(e)}}function Io(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ro(e,n){return function(){this.setAttribute(e,n)}}function Oo(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function Do(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Fo(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function jo(e,n){var r=Le(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((n==null?r.local?Io:zo:typeof n=="function"?r.local?Fo:Do:r.local?Oo:Ro)(r,n))}function Xr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function $o(e){return function(){this.style.removeProperty(e)}}function Lo(e,n,r){return function(){this.style.setProperty(e,n,r)}}function Uo(e,n,r){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function Ho(e,n,r){return arguments.length>1?this.each((n==null?$o:typeof n=="function"?Uo:Lo)(e,n,r??"")):Ht(this.node(),e)}function Ht(e,n){return e.style.getPropertyValue(n)||Xr(e).getComputedStyle(e,null).getPropertyValue(n)}function Bo(e){return function(){delete this[e]}}function Wo(e,n){return function(){this[e]=n}}function qo(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Vo(e,n){return arguments.length>1?this.each((n==null?Bo:typeof n=="function"?qo:Wo)(e,n)):this.node()[e]}function Yr(e){return e.trim().split(/^|\s+/)}function kn(e){return e.classList||new Kr(e)}function Kr(e){this._node=e,this._names=Yr(e.getAttribute("class")||"")}Kr.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Zr(e,n){for(var r=kn(e),i=-1,o=n.length;++i<o;)r.add(n[i])}function Qr(e,n){for(var r=kn(e),i=-1,o=n.length;++i<o;)r.remove(n[i])}function Go(e){return function(){Zr(this,e)}}function Xo(e){return function(){Qr(this,e)}}function Yo(e,n){return function(){(n.apply(this,arguments)?Zr:Qr)(this,e)}}function Ko(e,n){var r=Yr(e+"");if(arguments.length<2){for(var i=kn(this.node()),o=-1,a=r.length;++o<a;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof n=="function"?Yo:n?Go:Xo)(r,n))}function Zo(){this.textContent=""}function Qo(e){return function(){this.textContent=e}}function Jo(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function ta(e){return arguments.length?this.each(e==null?Zo:(typeof e=="function"?Jo:Qo)(e)):this.node().textContent}function ea(){this.innerHTML=""}function na(e){return function(){this.innerHTML=e}}function ra(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function ia(e){return arguments.length?this.each(e==null?ea:(typeof e=="function"?ra:na)(e)):this.node().innerHTML}function oa(){this.nextSibling&&this.parentNode.appendChild(this)}function aa(){return this.each(oa)}function sa(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function la(){return this.each(sa)}function ua(e){var n=typeof e=="function"?e:Br(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function ca(){return null}function fa(e,n){var r=typeof e=="function"?e:Br(e),i=n==null?ca:typeof n=="function"?n:xn(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function ha(){var e=this.parentNode;e&&e.removeChild(this)}function da(){return this.each(ha)}function pa(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function ga(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function _a(e){return this.select(e?ga:pa)}function va(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ya(e){return function(n){e.call(this,n,this.__data__)}}function ma(e){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");return i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),{type:n,name:r}})}function ba(e){return function(){var n=this.__on;if(n){for(var r=0,i=-1,o=n.length,a;r<o;++r)a=n[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):n[++i]=a;++i?n.length=i:delete this.__on}}}function wa(e,n,r){return function(){var i=this.__on,o,a=ya(n);if(i){for(var s=0,l=i.length;s<l;++s)if((o=i[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=n;return}}this.addEventListener(e.type,a,r),o={type:e.type,name:e.name,value:n,listener:a,options:r},i?i.push(o):this.__on=[o]}}function xa(e,n,r){var i=ma(e+""),o,a=i.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,c=l.length,h;u<c;++u)for(o=0,h=l[u];o<a;++o)if((s=i[o]).type===h.type&&s.name===h.name)return h.value}return}for(l=n?wa:ba,o=0;o<a;++o)this.each(l(i[o],n,r));return this}function Jr(e,n,r){var i=Xr(e),o=i.CustomEvent;typeof o=="function"?o=new o(n,r):(o=i.document.createEvent("Event"),r?(o.initEvent(n,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function ka(e,n){return function(){return Jr(this,e,n)}}function Sa(e,n){return function(){return Jr(this,e,n.apply(this,arguments))}}function Ca(e,n){return this.each((typeof n=="function"?Sa:ka)(e,n))}function*Ma(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&(yield s)}var ti=[null];function it(e,n){this._groups=e,this._parents=n}function he(){return new it([[document.documentElement]],ti)}function Aa(){return this}it.prototype=he.prototype={constructor:it,select:Qi,selectAll:no,selectChild:ao,selectChildren:co,filter:fo,data:yo,enter:ho,exit:bo,join:wo,merge:xo,selection:Aa,order:ko,sort:So,call:Mo,nodes:Ao,node:Po,size:To,empty:Eo,each:No,attr:jo,style:Ho,property:Vo,classed:Ko,text:ta,html:ia,raise:aa,lower:la,append:ua,insert:fa,remove:da,clone:_a,datum:va,on:xa,dispatch:Ca,[Symbol.iterator]:Ma};function st(e){return typeof e=="string"?new it([[document.querySelector(e)]],[document.documentElement]):new it([[e]],ti)}function Pa(e){let n;for(;n=e.sourceEvent;)e=n;return e}function gt(e,n){if(e=Pa(e),n===void 0&&(n=e.currentTarget),n){var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}var Ta={value:()=>{}};function de(){for(var e=0,n=arguments.length,r={},i;e<n;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new we(r)}function we(e){this._=e}function Ea(e,n){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}we.prototype=de.prototype={constructor:we,on:function(e,n){var r=this._,i=Ea(e+"",r),o,a=-1,s=i.length;if(arguments.length<2){for(;++a<s;)if((o=(e=i[a]).type)&&(o=Na(r[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++a<s;)if(o=(e=i[a]).type)r[o]=Wn(r[o],e.name,n);else if(n==null)for(o in r)r[o]=Wn(r[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var r in n)e[r]=n[r].slice();return new we(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,a;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],i=0,o=a.length;i<o;++i)a[i].value.apply(n,r)},apply:function(e,n,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,a=i.length;o<a;++o)i[o].value.apply(n,r)}};function Na(e,n){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===n)return o.value}function Wn(e,n,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===n){e[i]=Ta,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:n,value:r}),e}const za={passive:!1},ue={capture:!0,passive:!1};function Ge(e){e.stopImmediatePropagation()}function Ut(e){e.preventDefault(),e.stopImmediatePropagation()}function ei(e){var n=e.document.documentElement,r=st(e).on("dragstart.drag",Ut,ue);"onselectstart"in n?r.on("selectstart.drag",Ut,ue):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function ni(e,n){var r=e.document.documentElement,i=st(e).on("dragstart.drag",null);n&&(i.on("click.drag",Ut,ue),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const ge=e=>()=>e;function an(e,{sourceEvent:n,subject:r,target:i,identifier:o,active:a,x:s,y:l,dx:u,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}an.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ia(e){return!e.ctrlKey&&!e.button}function Ra(){return this.parentNode}function Oa(e,n){return n??{x:e.x,y:e.y}}function Da(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fa(){var e=Ia,n=Ra,r=Oa,i=Da,o={},a=de("start","drag","end"),s=0,l,u,c,h,f=0;function d(m){m.on("mousedown.drag",p).filter(i).on("touchstart.drag",y).on("touchmove.drag",g,za).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(m,v){if(!(h||!e.call(this,m,v))){var S=x(this,n.call(this,m,v),m,v,"mouse");S&&(st(m.view).on("mousemove.drag",_,ue).on("mouseup.drag",b,ue),ei(m.view),Ge(m),c=!1,l=m.clientX,u=m.clientY,S("start",m))}}function _(m){if(Ut(m),!c){var v=m.clientX-l,S=m.clientY-u;c=v*v+S*S>f}o.mouse("drag",m)}function b(m){st(m.view).on("mousemove.drag mouseup.drag",null),ni(m.view,c),Ut(m),o.mouse("end",m)}function y(m,v){if(e.call(this,m,v)){var S=m.changedTouches,k=n.call(this,m,v),M=S.length,N,E;for(N=0;N<M;++N)(E=x(this,k,m,v,S[N].identifier,S[N]))&&(Ge(m),E("start",m,S[N]))}}function g(m){var v=m.changedTouches,S=v.length,k,M;for(k=0;k<S;++k)(M=o[v[k].identifier])&&(Ut(m),M("drag",m,v[k]))}function w(m){var v=m.changedTouches,S=v.length,k,M;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),k=0;k<S;++k)(M=o[v[k].identifier])&&(Ge(m),M("end",m,v[k]))}function x(m,v,S,k,M,N){var E=a.copy(),I=gt(N||S,v),R,j,C;if((C=r.call(m,new an("beforestart",{sourceEvent:S,target:d,identifier:M,active:s,x:I[0],y:I[1],dx:0,dy:0,dispatch:E}),k))!=null)return R=C.x-I[0]||0,j=C.y-I[1]||0,function z(A,O,F){var $=I,L;switch(A){case"start":o[M]=z,L=s++;break;case"end":delete o[M],--s;case"drag":I=gt(F||O,v),L=s;break}E.call(A,m,new an(A,{sourceEvent:O,subject:C,target:d,identifier:M,active:L,x:I[0]+R,y:I[1]+j,dx:I[0]-$[0],dy:I[1]-$[1],dispatch:E}),k)}}return d.filter=function(m){return arguments.length?(e=typeof m=="function"?m:ge(!!m),d):e},d.container=function(m){return arguments.length?(n=typeof m=="function"?m:ge(m),d):n},d.subject=function(m){return arguments.length?(r=typeof m=="function"?m:ge(m),d):r},d.touchable=function(m){return arguments.length?(i=typeof m=="function"?m:ge(!!m),d):i},d.on=function(){var m=a.on.apply(a,arguments);return m===a?d:m},d.clickDistance=function(m){return arguments.length?(f=(m=+m)*m,d):Math.sqrt(f)},d}var qn=180/Math.PI,sn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ri(e,n,r,i,o,a){var s,l,u;return(s=Math.sqrt(e*e+n*n))&&(e/=s,n/=s),(u=e*r+n*i)&&(r-=e*u,i-=n*u),(l=Math.sqrt(r*r+i*i))&&(r/=l,i/=l,u/=l),e*i<n*r&&(e=-e,n=-n,u=-u,s=-s),{translateX:o,translateY:a,rotate:Math.atan2(n,e)*qn,skewX:Math.atan(u)*qn,scaleX:s,scaleY:l}}var _e;function ja(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?sn:ri(n.a,n.b,n.c,n.d,n.e,n.f)}function $a(e){return e==null||(_e||(_e=document.createElementNS("http://www.w3.org/2000/svg","g")),_e.setAttribute("transform",e),!(e=_e.transform.baseVal.consolidate()))?sn:(e=e.matrix,ri(e.a,e.b,e.c,e.d,e.e,e.f))}function ii(e,n,r,i){function o(c){return c.length?c.pop()+" ":""}function a(c,h,f,d,p,_){if(c!==f||h!==d){var b=p.push("translate(",null,n,null,r);_.push({i:b-4,x:Rt(c,f)},{i:b-2,x:Rt(h,d)})}else(f||d)&&p.push("translate("+f+n+d+r)}function s(c,h,f,d){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),d.push({i:f.push(o(f)+"rotate(",null,i)-2,x:Rt(c,h)})):h&&f.push(o(f)+"rotate("+h+i)}function l(c,h,f,d){c!==h?d.push({i:f.push(o(f)+"skewX(",null,i)-2,x:Rt(c,h)}):h&&f.push(o(f)+"skewX("+h+i)}function u(c,h,f,d,p,_){if(c!==f||h!==d){var b=p.push(o(p)+"scale(",null,",",null,")");_.push({i:b-4,x:Rt(c,f)},{i:b-2,x:Rt(h,d)})}else(f!==1||d!==1)&&p.push(o(p)+"scale("+f+","+d+")")}return function(c,h){var f=[],d=[];return c=e(c),h=e(h),a(c.translateX,c.translateY,h.translateX,h.translateY,f,d),s(c.rotate,h.rotate,f,d),l(c.skewX,h.skewX,f,d),u(c.scaleX,c.scaleY,h.scaleX,h.scaleY,f,d),c=h=null,function(p){for(var _=-1,b=d.length,y;++_<b;)f[(y=d[_]).i]=y.x(p);return f.join("")}}}var La=ii(ja,"px, ","px)","deg)"),Ua=ii($a,", ",")",")"),Ha=1e-12;function Vn(e){return((e=Math.exp(e))+1/e)/2}function Ba(e){return((e=Math.exp(e))-1/e)/2}function Wa(e){return((e=Math.exp(2*e))-1)/(e+1)}const qa=(function e(n,r,i){function o(a,s){var l=a[0],u=a[1],c=a[2],h=s[0],f=s[1],d=s[2],p=h-l,_=f-u,b=p*p+_*_,y,g;if(b<Ha)g=Math.log(d/c)/n,y=function(k){return[l+k*p,u+k*_,c*Math.exp(n*k*g)]};else{var w=Math.sqrt(b),x=(d*d-c*c+i*b)/(2*c*r*w),m=(d*d-c*c-i*b)/(2*d*r*w),v=Math.log(Math.sqrt(x*x+1)-x),S=Math.log(Math.sqrt(m*m+1)-m);g=(S-v)/n,y=function(k){var M=k*g,N=Vn(v),E=c/(r*w)*(N*Wa(n*M+v)-Ba(v));return[l+E*p,u+E*_,c*N/Vn(n*M+v)]}}return y.duration=g*1e3*n/Math.SQRT2,y}return o.rho=function(a){var s=Math.max(.001,+a),l=s*s,u=l*l;return e(s,l,u)},o})(Math.SQRT2,2,4);var Bt=0,te=0,Vt=0,oi=1e3,Pe,ee,Te=0,Dt=0,Ue=0,ce=typeof performance=="object"&&performance.now?performance:Date,ai=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Sn(){return Dt||(ai(Va),Dt=ce.now()+Ue)}function Va(){Dt=0}function Ee(){this._call=this._time=this._next=null}Ee.prototype=Cn.prototype={constructor:Ee,restart:function(e,n,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Sn():+r)+(n==null?0:+n),!this._next&&ee!==this&&(ee?ee._next=this:Pe=this,ee=this),this._call=e,this._time=r,ln()},stop:function(){this._call&&(this._call=null,this._time=1/0,ln())}};function Cn(e,n,r){var i=new Ee;return i.restart(e,n,r),i}function Ga(){Sn(),++Bt;for(var e=Pe,n;e;)(n=Dt-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Bt}function Gn(){Dt=(Te=ce.now())+Ue,Bt=te=0;try{Ga()}finally{Bt=0,Ya(),Dt=0}}function Xa(){var e=ce.now(),n=e-Te;n>oi&&(Ue-=n,Te=e)}function Ya(){for(var e,n=Pe,r,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:Pe=r);ee=e,ln(i)}function ln(e){if(!Bt){te&&(te=clearTimeout(te));var n=e-Dt;n>24?(e<1/0&&(te=setTimeout(Gn,e-ce.now()-Ue)),Vt&&(Vt=clearInterval(Vt))):(Vt||(Te=ce.now(),Vt=setInterval(Xa,oi)),Bt=1,ai(Gn))}}function Xn(e,n,r){var i=new Ee;return n=n==null?0:+n,i.restart(o=>{i.stop(),e(o+n)},n,r),i}var Ka=de("start","end","cancel","interrupt"),Za=[],si=0,Yn=1,un=2,xe=3,Kn=4,cn=5,ke=6;function He(e,n,r,i,o,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;Qa(e,r,{name:n,index:i,group:o,on:Ka,tween:Za,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:si})}function Mn(e,n){var r=dt(e,n);if(r.state>si)throw new Error("too late; already scheduled");return r}function yt(e,n){var r=dt(e,n);if(r.state>xe)throw new Error("too late; already running");return r}function dt(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function Qa(e,n,r){var i=e.__transition,o;i[n]=r,r.timer=Cn(a,0,r.time);function a(c){r.state=Yn,r.timer.restart(s,r.delay,r.time),r.delay<=c&&s(c-r.delay)}function s(c){var h,f,d,p;if(r.state!==Yn)return u();for(h in i)if(p=i[h],p.name===r.name){if(p.state===xe)return Xn(s);p.state===Kn?(p.state=ke,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[h]):+h<n&&(p.state=ke,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete i[h])}if(Xn(function(){r.state===xe&&(r.state=Kn,r.timer.restart(l,r.delay,r.time),l(c))}),r.state=un,r.on.call("start",e,e.__data__,r.index,r.group),r.state===un){for(r.state=xe,o=new Array(d=r.tween.length),h=0,f=-1;h<d;++h)(p=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(o[++f]=p);o.length=f+1}}function l(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(u),r.state=cn,1),f=-1,d=o.length;++f<d;)o[f].call(e,h);r.state===cn&&(r.on.call("end",e,e.__data__,r.index,r.group),u())}function u(){r.state=ke,r.timer.stop(),delete i[n];for(var c in i)return;delete e.__transition}}function Se(e,n){var r=e.__transition,i,o,a=!0,s;if(r){n=n==null?null:n+"";for(s in r){if((i=r[s]).name!==n){a=!1;continue}o=i.state>un&&i.state<cn,i.state=ke,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[s]}a&&delete e.__transition}}function Ja(e){return this.each(function(){Se(this,e)})}function ts(e,n){var r,i;return function(){var o=yt(this,e),a=o.tween;if(a!==r){i=r=a;for(var s=0,l=i.length;s<l;++s)if(i[s].name===n){i=i.slice(),i.splice(s,1);break}}o.tween=i}}function es(e,n,r){var i,o;if(typeof r!="function")throw new Error;return function(){var a=yt(this,e),s=a.tween;if(s!==i){o=(i=s).slice();for(var l={name:n,value:r},u=0,c=o.length;u<c;++u)if(o[u].name===n){o[u]=l;break}u===c&&o.push(l)}a.tween=o}}function ns(e,n){var r=this._id;if(e+="",arguments.length<2){for(var i=dt(this.node(),r).tween,o=0,a=i.length,s;o<a;++o)if((s=i[o]).name===e)return s.value;return null}return this.each((n==null?ts:es)(r,e,n))}function An(e,n,r){var i=e._id;return e.each(function(){var o=yt(this,i);(o.value||(o.value={}))[n]=r.apply(this,arguments)}),function(o){return dt(o,i).value[n]}}function li(e,n){var r;return(typeof n=="number"?Rt:n instanceof $n?Ln:(r=$n(n))?(n=r,Ln):Gi)(e,n)}function rs(e){return function(){this.removeAttribute(e)}}function is(e){return function(){this.removeAttributeNS(e.space,e.local)}}function os(e,n,r){var i,o=r+"",a;return function(){var s=this.getAttribute(e);return s===o?null:s===i?a:a=n(i=s,r)}}function as(e,n,r){var i,o=r+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===i?a:a=n(i=s,r)}}function ss(e,n,r){var i,o,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=l+"",s===u?null:s===i&&u===o?a:(o=u,a=n(i=s,l)))}}function ls(e,n,r){var i,o,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=l+"",s===u?null:s===i&&u===o?a:(o=u,a=n(i=s,l)))}}function us(e,n){var r=Le(e),i=r==="transform"?Ua:li;return this.attrTween(e,typeof n=="function"?(r.local?ls:ss)(r,i,An(this,"attr."+e,n)):n==null?(r.local?is:rs)(r):(r.local?as:os)(r,i,n))}function cs(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function fs(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function hs(e,n){var r,i;function o(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&fs(e,a)),r}return o._value=n,o}function ds(e,n){var r,i;function o(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&cs(e,a)),r}return o._value=n,o}function ps(e,n){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;var i=Le(e);return this.tween(r,(i.local?hs:ds)(i,n))}function gs(e,n){return function(){Mn(this,e).delay=+n.apply(this,arguments)}}function _s(e,n){return n=+n,function(){Mn(this,e).delay=n}}function vs(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?gs:_s)(n,e)):dt(this.node(),n).delay}function ys(e,n){return function(){yt(this,e).duration=+n.apply(this,arguments)}}function ms(e,n){return n=+n,function(){yt(this,e).duration=n}}function bs(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?ys:ms)(n,e)):dt(this.node(),n).duration}function ws(e,n){if(typeof n!="function")throw new Error;return function(){yt(this,e).ease=n}}function xs(e){var n=this._id;return arguments.length?this.each(ws(n,e)):dt(this.node(),n).ease}function ks(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!="function")throw new Error;yt(this,e).ease=r}}function Ss(e){if(typeof e!="function")throw new Error;return this.each(ks(this._id,e))}function Cs(e){typeof e!="function"&&(e=qr(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a=n[o],s=a.length,l=i[o]=[],u,c=0;c<s;++c)(u=a[c])&&e.call(u,u.__data__,c,a)&&l.push(u);return new Tt(i,this._parents,this._name,this._id)}function Ms(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],h=u.length,f=s[l]=new Array(h),d,p=0;p<h;++p)(d=u[p]||c[p])&&(f[p]=d);for(;l<i;++l)s[l]=n[l];return new Tt(s,this._parents,this._name,this._id)}function As(e){return(e+"").trim().split(/^|\s+/).every(function(n){var r=n.indexOf(".");return r>=0&&(n=n.slice(0,r)),!n||n==="start"})}function Ps(e,n,r){var i,o,a=As(n)?Mn:yt;return function(){var s=a(this,e),l=s.on;l!==i&&(o=(i=l).copy()).on(n,r),s.on=o}}function Ts(e,n){var r=this._id;return arguments.length<2?dt(this.node(),r).on.on(e):this.each(Ps(r,e,n))}function Es(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function Ns(){return this.on("end.remove",Es(this._id))}function zs(e){var n=this._name,r=this._id;typeof e!="function"&&(e=xn(e));for(var i=this._groups,o=i.length,a=new Array(o),s=0;s<o;++s)for(var l=i[s],u=l.length,c=a[s]=new Array(u),h,f,d=0;d<u;++d)(h=l[d])&&(f=e.call(h,h.__data__,d,l))&&("__data__"in h&&(f.__data__=h.__data__),c[d]=f,He(c[d],n,r,d,c,dt(h,r)));return new Tt(a,this._parents,n,r)}function Is(e){var n=this._name,r=this._id;typeof e!="function"&&(e=Wr(e));for(var i=this._groups,o=i.length,a=[],s=[],l=0;l<o;++l)for(var u=i[l],c=u.length,h,f=0;f<c;++f)if(h=u[f]){for(var d=e.call(h,h.__data__,f,u),p,_=dt(h,r),b=0,y=d.length;b<y;++b)(p=d[b])&&He(p,n,r,b,d,_);a.push(d),s.push(h)}return new Tt(a,s,n,r)}var Rs=he.prototype.constructor;function Os(){return new Rs(this._groups,this._parents)}function Ds(e,n){var r,i,o;return function(){var a=Ht(this,e),s=(this.style.removeProperty(e),Ht(this,e));return a===s?null:a===r&&s===i?o:o=n(r=a,i=s)}}function ui(e){return function(){this.style.removeProperty(e)}}function Fs(e,n,r){var i,o=r+"",a;return function(){var s=Ht(this,e);return s===o?null:s===i?a:a=n(i=s,r)}}function js(e,n,r){var i,o,a;return function(){var s=Ht(this,e),l=r(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),Ht(this,e))),s===u?null:s===i&&u===o?a:(o=u,a=n(i=s,l))}}function $s(e,n){var r,i,o,a="style."+n,s="end."+a,l;return function(){var u=yt(this,e),c=u.on,h=u.value[a]==null?l||(l=ui(n)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(s,o=h),u.on=i}}function Ls(e,n,r){var i=(e+="")=="transform"?La:li;return n==null?this.styleTween(e,Ds(e,i)).on("end.style."+e,ui(e)):typeof n=="function"?this.styleTween(e,js(e,i,An(this,"style."+e,n))).each($s(this._id,e)):this.styleTween(e,Fs(e,i,n),r).on("end.style."+e,null)}function Us(e,n,r){return function(i){this.style.setProperty(e,n.call(this,i),r)}}function Hs(e,n,r){var i,o;function a(){var s=n.apply(this,arguments);return s!==o&&(i=(o=s)&&Us(e,s,r)),i}return a._value=n,a}function Bs(e,n,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,Hs(e,n,r??""))}function Ws(e){return function(){this.textContent=e}}function qs(e){return function(){var n=e(this);this.textContent=n??""}}function Vs(e){return this.tween("text",typeof e=="function"?qs(An(this,"text",e)):Ws(e==null?"":e+""))}function Gs(e){return function(n){this.textContent=e.call(this,n)}}function Xs(e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Gs(o)),n}return i._value=e,i}function Ys(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,Xs(e))}function Ks(){for(var e=this._name,n=this._id,r=ci(),i=this._groups,o=i.length,a=0;a<o;++a)for(var s=i[a],l=s.length,u,c=0;c<l;++c)if(u=s[c]){var h=dt(u,n);He(u,e,r,c,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Tt(i,this._parents,e,r)}function Zs(){var e,n,r=this,i=r._id,o=r.size();return new Promise(function(a,s){var l={value:s},u={value:function(){--o===0&&a()}};r.each(function(){var c=yt(this,i),h=c.on;h!==e&&(n=(e=h).copy(),n._.cancel.push(l),n._.interrupt.push(l),n._.end.push(u)),c.on=n}),o===0&&a()})}var Qs=0;function Tt(e,n,r,i){this._groups=e,this._parents=n,this._name=r,this._id=i}function ci(){return++Qs}var wt=he.prototype;Tt.prototype={constructor:Tt,select:zs,selectAll:Is,selectChild:wt.selectChild,selectChildren:wt.selectChildren,filter:Cs,merge:Ms,selection:Os,transition:Ks,call:wt.call,nodes:wt.nodes,node:wt.node,size:wt.size,empty:wt.empty,each:wt.each,on:Ts,attr:us,attrTween:ps,style:Ls,styleTween:Bs,text:Vs,textTween:Ys,remove:Ns,tween:ns,delay:vs,duration:bs,ease:xs,easeVarying:Ss,end:Zs,[Symbol.iterator]:wt[Symbol.iterator]};function Js(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var tl={time:null,delay:0,duration:250,ease:Js};function el(e,n){for(var r;!(r=e.__transition)||!(r=r[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return r}function nl(e){var n,r;e instanceof Tt?(n=e._id,e=e._name):(n=ci(),(r=tl).time=Sn(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,a=0;a<o;++a)for(var s=i[a],l=s.length,u,c=0;c<l;++c)(u=s[c])&&He(u,e,n,c,s,r||el(u,n));return new Tt(i,this._parents,e,n)}he.prototype.interrupt=Ja;he.prototype.transition=nl;const ve=e=>()=>e;function rl(e,{sourceEvent:n,target:r,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Mt(e,n,r){this.k=e,this.x=n,this.y=r}Mt.prototype={constructor:Mt,scale:function(e){return e===1?this:new Mt(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Mt(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Pn=new Mt(1,0,0);pt.prototype=Mt.prototype;function pt(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Pn;return e.__zoom}function Xe(e){e.stopImmediatePropagation()}function Gt(e){e.preventDefault(),e.stopImmediatePropagation()}function il(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ol(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Zn(){return this.__zoom||Pn}function al(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sl(){return navigator.maxTouchPoints||"ontouchstart"in this}function ll(e,n,r){var i=e.invertX(n[0][0])-r[0][0],o=e.invertX(n[1][0])-r[1][0],a=e.invertY(n[0][1])-r[0][1],s=e.invertY(n[1][1])-r[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function ul(){var e=il,n=ol,r=ll,i=al,o=sl,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,u=qa,c=de("start","zoom","end"),h,f,d,p=500,_=150,b=0,y=10;function g(C){C.property("__zoom",Zn).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",E).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(C,z,A,O){var F=C.selection?C.selection():C;F.property("__zoom",Zn),C!==F?v(C,z,A,O):F.interrupt().each(function(){S(this,arguments).event(O).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},g.scaleBy=function(C,z,A,O){g.scaleTo(C,function(){var F=this.__zoom.k,$=typeof z=="function"?z.apply(this,arguments):z;return F*$},A,O)},g.scaleTo=function(C,z,A,O){g.transform(C,function(){var F=n.apply(this,arguments),$=this.__zoom,L=A==null?m(F):typeof A=="function"?A.apply(this,arguments):A,U=$.invert(L),H=typeof z=="function"?z.apply(this,arguments):z;return r(x(w($,H),L,U),F,s)},A,O)},g.translateBy=function(C,z,A,O){g.transform(C,function(){return r(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof A=="function"?A.apply(this,arguments):A),n.apply(this,arguments),s)},null,O)},g.translateTo=function(C,z,A,O,F){g.transform(C,function(){var $=n.apply(this,arguments),L=this.__zoom,U=O==null?m($):typeof O=="function"?O.apply(this,arguments):O;return r(Pn.translate(U[0],U[1]).scale(L.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof A=="function"?-A.apply(this,arguments):-A),$,s)},O,F)};function w(C,z){return z=Math.max(a[0],Math.min(a[1],z)),z===C.k?C:new Mt(z,C.x,C.y)}function x(C,z,A){var O=z[0]-A[0]*C.k,F=z[1]-A[1]*C.k;return O===C.x&&F===C.y?C:new Mt(C.k,O,F)}function m(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function v(C,z,A,O){C.on("start.zoom",function(){S(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(O).end()}).tween("zoom",function(){var F=this,$=arguments,L=S(F,$).event(O),U=n.apply(F,$),H=A==null?m(U):typeof A=="function"?A.apply(F,$):A,Y=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),X=F.__zoom,ut=typeof z=="function"?z.apply(F,$):z,mt=u(X.invert(H).concat(Y/X.k),ut.invert(H).concat(Y/ut.k));return function(ct){if(ct===1)ct=ut;else{var bt=mt(ct),Ve=Y/bt[2];ct=new Mt(Ve,H[0]-bt[0]*Ve,H[1]-bt[1]*Ve)}L.zoom(null,ct)}})}function S(C,z,A){return!A&&C.__zooming||new k(C,z)}function k(C,z){this.that=C,this.args=z,this.active=0,this.sourceEvent=null,this.extent=n.apply(C,z),this.taps=0}k.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,z){return this.mouse&&C!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var z=st(this.that).datum();c.call(C,this.that,new rl(C,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),z)}};function M(C,...z){if(!e.apply(this,arguments))return;var A=S(this,z).event(C),O=this.__zoom,F=Math.max(a[0],Math.min(a[1],O.k*Math.pow(2,i.apply(this,arguments)))),$=gt(C);if(A.wheel)(A.mouse[0][0]!==$[0]||A.mouse[0][1]!==$[1])&&(A.mouse[1]=O.invert(A.mouse[0]=$)),clearTimeout(A.wheel);else{if(O.k===F)return;A.mouse=[$,O.invert($)],Se(this),A.start()}Gt(C),A.wheel=setTimeout(L,_),A.zoom("mouse",r(x(w(O,F),A.mouse[0],A.mouse[1]),A.extent,s));function L(){A.wheel=null,A.end()}}function N(C,...z){if(d||!e.apply(this,arguments))return;var A=C.currentTarget,O=S(this,z,!0).event(C),F=st(C.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",Y,!0),$=gt(C,A),L=C.clientX,U=C.clientY;ei(C.view),Xe(C),O.mouse=[$,this.__zoom.invert($)],Se(this),O.start();function H(X){if(Gt(X),!O.moved){var ut=X.clientX-L,mt=X.clientY-U;O.moved=ut*ut+mt*mt>b}O.event(X).zoom("mouse",r(x(O.that.__zoom,O.mouse[0]=gt(X,A),O.mouse[1]),O.extent,s))}function Y(X){F.on("mousemove.zoom mouseup.zoom",null),ni(X.view,O.moved),Gt(X),O.event(X).end()}}function E(C,...z){if(e.apply(this,arguments)){var A=this.__zoom,O=gt(C.changedTouches?C.changedTouches[0]:C,this),F=A.invert(O),$=A.k*(C.shiftKey?.5:2),L=r(x(w(A,$),O,F),n.apply(this,z),s);Gt(C),l>0?st(this).transition().duration(l).call(v,L,O,C):st(this).call(g.transform,L,O,C)}}function I(C,...z){if(e.apply(this,arguments)){var A=C.touches,O=A.length,F=S(this,z,C.changedTouches.length===O).event(C),$,L,U,H;for(Xe(C),L=0;L<O;++L)U=A[L],H=gt(U,this),H=[H,this.__zoom.invert(H),U.identifier],F.touch0?!F.touch1&&F.touch0[2]!==H[2]&&(F.touch1=H,F.taps=0):(F.touch0=H,$=!0,F.taps=1+!!h);h&&(h=clearTimeout(h)),$&&(F.taps<2&&(f=H[0],h=setTimeout(function(){h=null},p)),Se(this),F.start())}}function R(C,...z){if(this.__zooming){var A=S(this,z).event(C),O=C.changedTouches,F=O.length,$,L,U,H;for(Gt(C),$=0;$<F;++$)L=O[$],U=gt(L,this),A.touch0&&A.touch0[2]===L.identifier?A.touch0[0]=U:A.touch1&&A.touch1[2]===L.identifier&&(A.touch1[0]=U);if(L=A.that.__zoom,A.touch1){var Y=A.touch0[0],X=A.touch0[1],ut=A.touch1[0],mt=A.touch1[1],ct=(ct=ut[0]-Y[0])*ct+(ct=ut[1]-Y[1])*ct,bt=(bt=mt[0]-X[0])*bt+(bt=mt[1]-X[1])*bt;L=w(L,Math.sqrt(ct/bt)),U=[(Y[0]+ut[0])/2,(Y[1]+ut[1])/2],H=[(X[0]+mt[0])/2,(X[1]+mt[1])/2]}else if(A.touch0)U=A.touch0[0],H=A.touch0[1];else return;A.zoom("touch",r(x(L,U,H),A.extent,s))}}function j(C,...z){if(this.__zooming){var A=S(this,z).event(C),O=C.changedTouches,F=O.length,$,L;for(Xe(C),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),$=0;$<F;++$)L=O[$],A.touch0&&A.touch0[2]===L.identifier?delete A.touch0:A.touch1&&A.touch1[2]===L.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(L=gt(L,this),Math.hypot(f[0]-L[0],f[1]-L[1])<y)){var U=st(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return g.wheelDelta=function(C){return arguments.length?(i=typeof C=="function"?C:ve(+C),g):i},g.filter=function(C){return arguments.length?(e=typeof C=="function"?C:ve(!!C),g):e},g.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:ve(!!C),g):o},g.extent=function(C){return arguments.length?(n=typeof C=="function"?C:ve([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),g):n},g.scaleExtent=function(C){return arguments.length?(a[0]=+C[0],a[1]=+C[1],g):[a[0],a[1]]},g.translateExtent=function(C){return arguments.length?(s[0][0]=+C[0][0],s[1][0]=+C[1][0],s[0][1]=+C[0][1],s[1][1]=+C[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(C){return arguments.length?(r=C,g):r},g.duration=function(C){return arguments.length?(l=+C,g):l},g.interpolate=function(C){return arguments.length?(u=C,g):u},g.on=function(){var C=c.on.apply(c,arguments);return C===c?g:C},g.clickDistance=function(C){return arguments.length?(b=(C=+C)*C,g):Math.sqrt(b)},g.tapDistance=function(C){return arguments.length?(y=+C,g):y},g}function cl(e,n){let r=0;for(let i of e)(i=+i)&&(r+=i);return r}var fl=typeof global=="object"&&global&&global.Object===Object&&global,hl=typeof self=="object"&&self&&self.Object===Object&&self,fi=fl||hl||Function("return this")(),Ne=fi.Symbol,hi=Object.prototype,dl=hi.hasOwnProperty,pl=hi.toString,Xt=Ne?Ne.toStringTag:void 0;function gl(e){var n=dl.call(e,Xt),r=e[Xt];try{e[Xt]=void 0;var i=!0}catch{}var o=pl.call(e);return i&&(n?e[Xt]=r:delete e[Xt]),o}var _l=Object.prototype,vl=_l.toString;function yl(e){return vl.call(e)}var ml="[object Null]",bl="[object Undefined]",Qn=Ne?Ne.toStringTag:void 0;function wl(e){return e==null?e===void 0?bl:ml:Qn&&Qn in Object(e)?gl(e):yl(e)}function xl(e){return e!=null&&typeof e=="object"}var kl="[object Symbol]";function Sl(e){return typeof e=="symbol"||xl(e)&&wl(e)==kl}var Cl=/\s/;function Ml(e){for(var n=e.length;n--&&Cl.test(e.charAt(n)););return n}var Al=/^\s+/;function Pl(e){return e&&e.slice(0,Ml(e)+1).replace(Al,"")}function ze(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var Jn=NaN,Tl=/^[-+]0x[0-9a-f]+$/i,El=/^0b[01]+$/i,Nl=/^0o[0-7]+$/i,zl=parseInt;function tr(e){if(typeof e=="number")return e;if(Sl(e))return Jn;if(ze(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=ze(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Pl(e);var r=El.test(e);return r||Nl.test(e)?zl(e.slice(2),r?2:8):Tl.test(e)?Jn:+e}var Ye=function(){return fi.Date.now()},Il="Expected a function",Rl=Math.max,Ol=Math.min;function di(e,n,r){var i,o,a,s,l,u,c=0,h=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(Il);n=tr(n)||0,ze(r)&&(h=!!r.leading,f="maxWait"in r,a=f?Rl(tr(r.maxWait)||0,n):a,d="trailing"in r?!!r.trailing:d);function p(S){var k=i,M=o;return i=o=void 0,c=S,s=e.apply(M,k),s}function _(S){return c=S,l=setTimeout(g,n),h?p(S):s}function b(S){var k=S-u,M=S-c,N=n-k;return f?Ol(N,a-M):N}function y(S){var k=S-u,M=S-c;return u===void 0||k>=n||k<0||f&&M>=a}function g(){var S=Ye();if(y(S))return w(S);l=setTimeout(g,b(S))}function w(S){return l=void 0,d&&i?p(S):(i=o=void 0,s)}function x(){l!==void 0&&clearTimeout(l),c=0,i=u=o=l=void 0}function m(){return l===void 0?s:w(Ye())}function v(){var S=Ye(),k=y(S);if(i=arguments,o=this,u=S,k){if(l===void 0)return _(u);if(f)return clearTimeout(l),l=setTimeout(g,n),p(u)}return l===void 0&&(l=setTimeout(g,n)),s}return v.cancel=x,v.flush=m,v}var Dl="Expected a function";function Fl(e,n,r){var i=!0,o=!0;if(typeof e!="function")throw new TypeError(Dl);return ze(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),di(e,n,{leading:i,maxWait:n,trailing:o})}var Ot=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Ot.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Ot.Bounce.In(e*2)*.5:Ot.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),ne=function(){return performance.now()},pi=(function(){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,n)}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(r){return n._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];(n=s._group)===null||n===void 0||n.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];a._group=void 0,delete this._tweens[a.getId()],delete this._tweensAddedDuringUpdate[a.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(n){return!n.isPlaying()})},e.prototype.update=function(n,r){n===void 0&&(n=ne()),r===void 0&&(r=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var a=this._tweens[i[o]],s=!r;a&&a.update(n,s)===!1&&!r&&this.remove(a)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),fn={Linear:function(e,n){var r=e.length-1,i=r*n,o=Math.floor(i),a=fn.Utils.Linear;return n<0?a(e[0],e[1],i):n>1?a(e[r],e[r-1],r-i):a(e[o],e[o+1>r?r:o+1],i-o)},Utils:{Linear:function(e,n,r){return(n-e)*r+e}}},gi=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),hn=new pi,er=(function(){function e(n,r){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ot.Linear.None,this._interpolationFunction=fn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=gi.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=n,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=hn,hn.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(n,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,r){if(n===void 0&&(n=ne()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var a in this._valuesEnd)o[a]=this._valuesEnd[a];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,r,i,o,a){for(var s in i){var l=n[s],u=Array.isArray(l),c=u?"array":typeof l,h=!u&&Array.isArray(i[s]);if(!(c==="undefined"||c==="function")){if(h){var f=i[s];if(f.length===0)continue;for(var d=[l],p=0,_=f.length;p<_;p+=1){var b=this._handleRelativeValue(l,f[p]);if(isNaN(b)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}d.push(b)}h&&(i[s]=d)}if((c==="object"||u)&&l&&!h){r[s]=u?[]:{};var y=l;for(var g in y)r[s][g]=y[g];o[s]=u?[]:{};var f=i[s];if(!this._isDynamic){var w={};for(var g in f)w[g]=f[g];i[s]=f=w}this._setupProperties(y,r[s],f,o[s],a)}else(typeof r[s]>"u"||a)&&(r[s]=l),u||(r[s]*=1),h?o[s]=i[s].slice().reverse():o[s]=r[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(n){return n===void 0&&(n=ne()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this)},e.prototype.resume=function(n){return n===void 0&&(n=ne()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var n=0,r=this._chainedTweens.length;n<r;n++)this._chainedTweens[n].stop();return this},e.prototype.group=function(n){return n?(n.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var n;return(n=this._group)===null||n===void 0||n.remove(this),this},e.prototype.delay=function(n){return n===void 0&&(n=0),this._delayTime=n,this},e.prototype.repeat=function(n){return n===void 0&&(n=0),this._initialRepeat=n,this._repeat=n,this},e.prototype.repeatDelay=function(n){return this._repeatDelayTime=n,this},e.prototype.yoyo=function(n){return n===void 0&&(n=!1),this._yoyo=n,this},e.prototype.easing=function(n){return n===void 0&&(n=Ot.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=fn.Linear),this._interpolationFunction=n,this},e.prototype.chain=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return this._chainedTweens=n,this},e.prototype.onStart=function(n){return this._onStartCallback=n,this},e.prototype.onEveryStart=function(n){return this._onEveryStartCallback=n,this},e.prototype.onUpdate=function(n){return this._onUpdateCallback=n,this},e.prototype.onRepeat=function(n){return this._onRepeatCallback=n,this},e.prototype.onComplete=function(n){return this._onCompleteCallback=n,this},e.prototype.onStop=function(n){return this._onStopCallback=n,this},e.prototype.update=function(n,r){var i=this,o;if(n===void 0&&(n=ne()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var a;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(n,!0);else return!1;if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=n-this._startTime,l=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),u=this._duration+this._repeat*l,c=function(){if(i._duration===0||s>u)return 1;var b=Math.trunc(s/l),y=s-b*l,g=Math.min(y/i._duration,1);return g===0&&s===i._duration?1:g},h=c(),f=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||s>=this._duration)if(this._repeat>0){var d=Math.min(Math.trunc((s-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=d);for(a in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]=="string"&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*d,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var p=0,_=this._chainedTweens.length;p<_;p++)this._chainedTweens[p].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(n,r,i,o){for(var a in i)if(r[a]!==void 0){var s=r[a]||0,l=i[a],u=Array.isArray(n[a]),c=Array.isArray(l),h=!u&&c;h?n[a]=this._interpolationFunction(l,o):typeof l=="object"&&l?this._updateProperties(n[a],s,l,o):(l=this._handleRelativeValue(s,l),typeof l=="number"&&(n[a]=s+(l-s)*o))}},e.prototype._handleRelativeValue=function(n,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?n+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(n){var r=this._valuesStartRepeat[n],i=this._valuesEnd[n];typeof i=="string"?this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(i):this._valuesStartRepeat[n]=this._valuesEnd[n],this._valuesEnd[n]=r},e.autoStartOnUpdate=!1,e})();gi.nextId;var vt=hn;vt.getAll.bind(vt);vt.removeAll.bind(vt);vt.add.bind(vt);vt.remove.bind(vt);vt.update.bind(vt);function nr(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function jl(e){if(Array.isArray(e))return e}function $l(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Ll(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function Ul(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function Hl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderer-3d-2EVDZII7-CTUExXUn.js","assets/index-2Gzrk1k3.js","assets/index-CmliV5st.css","assets/ntriples-ZWBY2WET-DH7OofPp.js","assets/N3Parser-CI_4owEm.js","assets/turtle-JJPK7LJ5-BzTu0283.js","assets/jsonld-32FQRO67-CbN9NJJW.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var qi=Object.defineProperty;var Vi=(e,n,r)=>n in e?qi(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var P=(e,n,r)=>Vi(e,typeof n!="symbol"?n+"":n,r);import{X as K,Z as et,_ as qt}from"./index-2Gzrk1k3.js";import{e as Rt,c as $n,f as Ln,g as Gi,o as Xi,h as Un,m as Hn}from"./ordinal-DhEzRPdO.js";var on="http://www.w3.org/1999/xhtml";const Bn={svg:"http://www.w3.org/2000/svg",xhtml:on,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Le(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Bn.hasOwnProperty(n)?{space:Bn[n],local:e}:e}function Yi(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===on&&n.documentElement.namespaceURI===on?n.createElement(e):n.createElementNS(r,e)}}function Ki(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Br(e){var n=Le(e);return(n.local?Ki:Yi)(n)}function Zi(){}function xn(e){return e==null?Zi:function(){return this.querySelector(e)}}function Qi(e){typeof e!="function"&&(e=xn(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a=n[o],s=a.length,l=i[o]=new Array(s),u,c,h=0;h<s;++h)(u=a[h])&&(c=e.call(u,u.__data__,h,a))&&("__data__"in u&&(c.__data__=u.__data__),l[h]=c);return new it(i,this._parents)}function Ji(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function to(){return[]}function Wr(e){return e==null?to:function(){return this.querySelectorAll(e)}}function eo(e){return function(){return Ji(e.apply(this,arguments))}}function no(e){typeof e=="function"?e=eo(e):e=Wr(e);for(var n=this._groups,r=n.length,i=[],o=[],a=0;a<r;++a)for(var s=n[a],l=s.length,u,c=0;c<l;++c)(u=s[c])&&(i.push(e.call(u,u.__data__,c,s)),o.push(u));return new it(i,o)}function qr(e){return function(){return this.matches(e)}}function Vr(e){return function(n){return n.matches(e)}}var ro=Array.prototype.find;function io(e){return function(){return ro.call(this.children,e)}}function oo(){return this.firstElementChild}function ao(e){return this.select(e==null?oo:io(typeof e=="function"?e:Vr(e)))}var so=Array.prototype.filter;function lo(){return Array.from(this.children)}function uo(e){return function(){return so.call(this.children,e)}}function co(e){return this.selectAll(e==null?lo:uo(typeof e=="function"?e:Vr(e)))}function fo(e){typeof e!="function"&&(e=qr(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a=n[o],s=a.length,l=i[o]=[],u,c=0;c<s;++c)(u=a[c])&&e.call(u,u.__data__,c,a)&&l.push(u);return new it(i,this._parents)}function Gr(e){return new Array(e.length)}function ho(){return new it(this._enter||this._groups.map(Gr),this._parents)}function Ae(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Ae.prototype={constructor:Ae,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function po(e){return function(){return e}}function go(e,n,r,i,o,a){for(var s=0,l,u=n.length,c=a.length;s<c;++s)(l=n[s])?(l.__data__=a[s],i[s]=l):r[s]=new Ae(e,a[s]);for(;s<u;++s)(l=n[s])&&(o[s]=l)}function _o(e,n,r,i,o,a,s){var l,u,c=new Map,h=n.length,f=a.length,d=new Array(h),p;for(l=0;l<h;++l)(u=n[l])&&(d[l]=p=s.call(u,u.__data__,l,n)+"",c.has(p)?o[l]=u:c.set(p,u));for(l=0;l<f;++l)p=s.call(e,a[l],l,a)+"",(u=c.get(p))?(i[l]=u,u.__data__=a[l],c.delete(p)):r[l]=new Ae(e,a[l]);for(l=0;l<h;++l)(u=n[l])&&c.get(d[l])===u&&(o[l]=u)}function vo(e){return e.__data__}function yo(e,n){if(!arguments.length)return Array.from(this,vo);var r=n?_o:go,i=this._parents,o=this._groups;typeof e!="function"&&(e=po(e));for(var a=o.length,s=new Array(a),l=new Array(a),u=new Array(a),c=0;c<a;++c){var h=i[c],f=o[c],d=f.length,p=mo(e.call(h,h&&h.__data__,c,i)),_=p.length,b=l[c]=new Array(_),y=s[c]=new Array(_),g=u[c]=new Array(d);r(h,f,b,y,g,p,n);for(var w=0,x=0,m,v;w<_;++w)if(m=b[w]){for(w>=x&&(x=w+1);!(v=y[x])&&++x<_;);m._next=v||null}}return s=new it(s,i),s._enter=l,s._exit=u,s}function mo(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function bo(){return new it(this._exit||this._groups.map(Gr),this._parents)}function wo(e,n,r){var i=this.enter(),o=this,a=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),r==null?a.remove():r(a),i&&o?i.merge(o).order():o}function xo(e){for(var n=e.selection?e.selection():e,r=this._groups,i=n._groups,o=r.length,a=i.length,s=Math.min(o,a),l=new Array(o),u=0;u<s;++u)for(var c=r[u],h=i[u],f=c.length,d=l[u]=new Array(f),p,_=0;_<f;++_)(p=c[_]||h[_])&&(d[_]=p);for(;u<o;++u)l[u]=r[u];return new it(l,this._parents)}function ko(){for(var e=this._groups,n=-1,r=e.length;++n<r;)for(var i=e[n],o=i.length-1,a=i[o],s;--o>=0;)(s=i[o])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function So(e){e||(e=Co);function n(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a){for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,h=0;h<l;++h)(c=s[h])&&(u[h]=c);u.sort(n)}return new it(o,this._parents).order()}function Co(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function Mo(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ao(){return Array.from(this)}function Po(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length;o<a;++o){var s=i[o];if(s)return s}return null}function To(){let e=0;for(const n of this)++e;return e}function Eo(){return!this.node()}function No(e){for(var n=this._groups,r=0,i=n.length;r<i;++r)for(var o=n[r],a=0,s=o.length,l;a<s;++a)(l=o[a])&&e.call(l,l.__data__,a,o);return this}function zo(e){return function(){this.removeAttribute(e)}}function Io(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ro(e,n){return function(){this.setAttribute(e,n)}}function Oo(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function Do(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Fo(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function jo(e,n){var r=Le(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((n==null?r.local?Io:zo:typeof n=="function"?r.local?Fo:Do:r.local?Oo:Ro)(r,n))}function Xr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function $o(e){return function(){this.style.removeProperty(e)}}function Lo(e,n,r){return function(){this.style.setProperty(e,n,r)}}function Uo(e,n,r){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function Ho(e,n,r){return arguments.length>1?this.each((n==null?$o:typeof n=="function"?Uo:Lo)(e,n,r??"")):Ht(this.node(),e)}function Ht(e,n){return e.style.getPropertyValue(n)||Xr(e).getComputedStyle(e,null).getPropertyValue(n)}function Bo(e){return function(){delete this[e]}}function Wo(e,n){return function(){this[e]=n}}function qo(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Vo(e,n){return arguments.length>1?this.each((n==null?Bo:typeof n=="function"?qo:Wo)(e,n)):this.node()[e]}function Yr(e){return e.trim().split(/^|\s+/)}function kn(e){return e.classList||new Kr(e)}function Kr(e){this._node=e,this._names=Yr(e.getAttribute("class")||"")}Kr.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Zr(e,n){for(var r=kn(e),i=-1,o=n.length;++i<o;)r.add(n[i])}function Qr(e,n){for(var r=kn(e),i=-1,o=n.length;++i<o;)r.remove(n[i])}function Go(e){return function(){Zr(this,e)}}function Xo(e){return function(){Qr(this,e)}}function Yo(e,n){return function(){(n.apply(this,arguments)?Zr:Qr)(this,e)}}function Ko(e,n){var r=Yr(e+"");if(arguments.length<2){for(var i=kn(this.node()),o=-1,a=r.length;++o<a;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof n=="function"?Yo:n?Go:Xo)(r,n))}function Zo(){this.textContent=""}function Qo(e){return function(){this.textContent=e}}function Jo(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function ta(e){return arguments.length?this.each(e==null?Zo:(typeof e=="function"?Jo:Qo)(e)):this.node().textContent}function ea(){this.innerHTML=""}function na(e){return function(){this.innerHTML=e}}function ra(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function ia(e){return arguments.length?this.each(e==null?ea:(typeof e=="function"?ra:na)(e)):this.node().innerHTML}function oa(){this.nextSibling&&this.parentNode.appendChild(this)}function aa(){return this.each(oa)}function sa(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function la(){return this.each(sa)}function ua(e){var n=typeof e=="function"?e:Br(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function ca(){return null}function fa(e,n){var r=typeof e=="function"?e:Br(e),i=n==null?ca:typeof n=="function"?n:xn(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function ha(){var e=this.parentNode;e&&e.removeChild(this)}function da(){return this.each(ha)}function pa(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function ga(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function _a(e){return this.select(e?ga:pa)}function va(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ya(e){return function(n){e.call(this,n,this.__data__)}}function ma(e){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");return i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),{type:n,name:r}})}function ba(e){return function(){var n=this.__on;if(n){for(var r=0,i=-1,o=n.length,a;r<o;++r)a=n[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):n[++i]=a;++i?n.length=i:delete this.__on}}}function wa(e,n,r){return function(){var i=this.__on,o,a=ya(n);if(i){for(var s=0,l=i.length;s<l;++s)if((o=i[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=n;return}}this.addEventListener(e.type,a,r),o={type:e.type,name:e.name,value:n,listener:a,options:r},i?i.push(o):this.__on=[o]}}function xa(e,n,r){var i=ma(e+""),o,a=i.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,c=l.length,h;u<c;++u)for(o=0,h=l[u];o<a;++o)if((s=i[o]).type===h.type&&s.name===h.name)return h.value}return}for(l=n?wa:ba,o=0;o<a;++o)this.each(l(i[o],n,r));return this}function Jr(e,n,r){var i=Xr(e),o=i.CustomEvent;typeof o=="function"?o=new o(n,r):(o=i.document.createEvent("Event"),r?(o.initEvent(n,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function ka(e,n){return function(){return Jr(this,e,n)}}function Sa(e,n){return function(){return Jr(this,e,n.apply(this,arguments))}}function Ca(e,n){return this.each((typeof n=="function"?Sa:ka)(e,n))}function*Ma(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&(yield s)}var ti=[null];function it(e,n){this._groups=e,this._parents=n}function he(){return new it([[document.documentElement]],ti)}function Aa(){return this}it.prototype=he.prototype={constructor:it,select:Qi,selectAll:no,selectChild:ao,selectChildren:co,filter:fo,data:yo,enter:ho,exit:bo,join:wo,merge:xo,selection:Aa,order:ko,sort:So,call:Mo,nodes:Ao,node:Po,size:To,empty:Eo,each:No,attr:jo,style:Ho,property:Vo,classed:Ko,text:ta,html:ia,raise:aa,lower:la,append:ua,insert:fa,remove:da,clone:_a,datum:va,on:xa,dispatch:Ca,[Symbol.iterator]:Ma};function st(e){return typeof e=="string"?new it([[document.querySelector(e)]],[document.documentElement]):new it([[e]],ti)}function Pa(e){let n;for(;n=e.sourceEvent;)e=n;return e}function gt(e,n){if(e=Pa(e),n===void 0&&(n=e.currentTarget),n){var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}var Ta={value:()=>{}};function de(){for(var e=0,n=arguments.length,r={},i;e<n;++e){if(!(i=arguments[e]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new we(r)}function we(e){this._=e}function Ea(e,n){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}we.prototype=de.prototype={constructor:we,on:function(e,n){var r=this._,i=Ea(e+"",r),o,a=-1,s=i.length;if(arguments.length<2){for(;++a<s;)if((o=(e=i[a]).type)&&(o=Na(r[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++a<s;)if(o=(e=i[a]).type)r[o]=Wn(r[o],e.name,n);else if(n==null)for(o in r)r[o]=Wn(r[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var r in n)e[r]=n[r].slice();return new we(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,a;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],i=0,o=a.length;i<o;++i)a[i].value.apply(n,r)},apply:function(e,n,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,a=i.length;o<a;++o)i[o].value.apply(n,r)}};function Na(e,n){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===n)return o.value}function Wn(e,n,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===n){e[i]=Ta,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:n,value:r}),e}const za={passive:!1},ue={capture:!0,passive:!1};function Ge(e){e.stopImmediatePropagation()}function Ut(e){e.preventDefault(),e.stopImmediatePropagation()}function ei(e){var n=e.document.documentElement,r=st(e).on("dragstart.drag",Ut,ue);"onselectstart"in n?r.on("selectstart.drag",Ut,ue):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function ni(e,n){var r=e.document.documentElement,i=st(e).on("dragstart.drag",null);n&&(i.on("click.drag",Ut,ue),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const ge=e=>()=>e;function an(e,{sourceEvent:n,subject:r,target:i,identifier:o,active:a,x:s,y:l,dx:u,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}an.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ia(e){return!e.ctrlKey&&!e.button}function Ra(){return this.parentNode}function Oa(e,n){return n??{x:e.x,y:e.y}}function Da(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fa(){var e=Ia,n=Ra,r=Oa,i=Da,o={},a=de("start","drag","end"),s=0,l,u,c,h,f=0;function d(m){m.on("mousedown.drag",p).filter(i).on("touchstart.drag",y).on("touchmove.drag",g,za).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(m,v){if(!(h||!e.call(this,m,v))){var S=x(this,n.call(this,m,v),m,v,"mouse");S&&(st(m.view).on("mousemove.drag",_,ue).on("mouseup.drag",b,ue),ei(m.view),Ge(m),c=!1,l=m.clientX,u=m.clientY,S("start",m))}}function _(m){if(Ut(m),!c){var v=m.clientX-l,S=m.clientY-u;c=v*v+S*S>f}o.mouse("drag",m)}function b(m){st(m.view).on("mousemove.drag mouseup.drag",null),ni(m.view,c),Ut(m),o.mouse("end",m)}function y(m,v){if(e.call(this,m,v)){var S=m.changedTouches,k=n.call(this,m,v),M=S.length,N,E;for(N=0;N<M;++N)(E=x(this,k,m,v,S[N].identifier,S[N]))&&(Ge(m),E("start",m,S[N]))}}function g(m){var v=m.changedTouches,S=v.length,k,M;for(k=0;k<S;++k)(M=o[v[k].identifier])&&(Ut(m),M("drag",m,v[k]))}function w(m){var v=m.changedTouches,S=v.length,k,M;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),k=0;k<S;++k)(M=o[v[k].identifier])&&(Ge(m),M("end",m,v[k]))}function x(m,v,S,k,M,N){var E=a.copy(),I=gt(N||S,v),R,j,C;if((C=r.call(m,new an("beforestart",{sourceEvent:S,target:d,identifier:M,active:s,x:I[0],y:I[1],dx:0,dy:0,dispatch:E}),k))!=null)return R=C.x-I[0]||0,j=C.y-I[1]||0,function z(A,O,F){var $=I,L;switch(A){case"start":o[M]=z,L=s++;break;case"end":delete o[M],--s;case"drag":I=gt(F||O,v),L=s;break}E.call(A,m,new an(A,{sourceEvent:O,subject:C,target:d,identifier:M,active:L,x:I[0]+R,y:I[1]+j,dx:I[0]-$[0],dy:I[1]-$[1],dispatch:E}),k)}}return d.filter=function(m){return arguments.length?(e=typeof m=="function"?m:ge(!!m),d):e},d.container=function(m){return arguments.length?(n=typeof m=="function"?m:ge(m),d):n},d.subject=function(m){return arguments.length?(r=typeof m=="function"?m:ge(m),d):r},d.touchable=function(m){return arguments.length?(i=typeof m=="function"?m:ge(!!m),d):i},d.on=function(){var m=a.on.apply(a,arguments);return m===a?d:m},d.clickDistance=function(m){return arguments.length?(f=(m=+m)*m,d):Math.sqrt(f)},d}var qn=180/Math.PI,sn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ri(e,n,r,i,o,a){var s,l,u;return(s=Math.sqrt(e*e+n*n))&&(e/=s,n/=s),(u=e*r+n*i)&&(r-=e*u,i-=n*u),(l=Math.sqrt(r*r+i*i))&&(r/=l,i/=l,u/=l),e*i<n*r&&(e=-e,n=-n,u=-u,s=-s),{translateX:o,translateY:a,rotate:Math.atan2(n,e)*qn,skewX:Math.atan(u)*qn,scaleX:s,scaleY:l}}var _e;function ja(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?sn:ri(n.a,n.b,n.c,n.d,n.e,n.f)}function $a(e){return e==null||(_e||(_e=document.createElementNS("http://www.w3.org/2000/svg","g")),_e.setAttribute("transform",e),!(e=_e.transform.baseVal.consolidate()))?sn:(e=e.matrix,ri(e.a,e.b,e.c,e.d,e.e,e.f))}function ii(e,n,r,i){function o(c){return c.length?c.pop()+" ":""}function a(c,h,f,d,p,_){if(c!==f||h!==d){var b=p.push("translate(",null,n,null,r);_.push({i:b-4,x:Rt(c,f)},{i:b-2,x:Rt(h,d)})}else(f||d)&&p.push("translate("+f+n+d+r)}function s(c,h,f,d){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),d.push({i:f.push(o(f)+"rotate(",null,i)-2,x:Rt(c,h)})):h&&f.push(o(f)+"rotate("+h+i)}function l(c,h,f,d){c!==h?d.push({i:f.push(o(f)+"skewX(",null,i)-2,x:Rt(c,h)}):h&&f.push(o(f)+"skewX("+h+i)}function u(c,h,f,d,p,_){if(c!==f||h!==d){var b=p.push(o(p)+"scale(",null,",",null,")");_.push({i:b-4,x:Rt(c,f)},{i:b-2,x:Rt(h,d)})}else(f!==1||d!==1)&&p.push(o(p)+"scale("+f+","+d+")")}return function(c,h){var f=[],d=[];return c=e(c),h=e(h),a(c.translateX,c.translateY,h.translateX,h.translateY,f,d),s(c.rotate,h.rotate,f,d),l(c.skewX,h.skewX,f,d),u(c.scaleX,c.scaleY,h.scaleX,h.scaleY,f,d),c=h=null,function(p){for(var _=-1,b=d.length,y;++_<b;)f[(y=d[_]).i]=y.x(p);return f.join("")}}}var La=ii(ja,"px, ","px)","deg)"),Ua=ii($a,", ",")",")"),Ha=1e-12;function Vn(e){return((e=Math.exp(e))+1/e)/2}function Ba(e){return((e=Math.exp(e))-1/e)/2}function Wa(e){return((e=Math.exp(2*e))-1)/(e+1)}const qa=(function e(n,r,i){function o(a,s){var l=a[0],u=a[1],c=a[2],h=s[0],f=s[1],d=s[2],p=h-l,_=f-u,b=p*p+_*_,y,g;if(b<Ha)g=Math.log(d/c)/n,y=function(k){return[l+k*p,u+k*_,c*Math.exp(n*k*g)]};else{var w=Math.sqrt(b),x=(d*d-c*c+i*b)/(2*c*r*w),m=(d*d-c*c-i*b)/(2*d*r*w),v=Math.log(Math.sqrt(x*x+1)-x),S=Math.log(Math.sqrt(m*m+1)-m);g=(S-v)/n,y=function(k){var M=k*g,N=Vn(v),E=c/(r*w)*(N*Wa(n*M+v)-Ba(v));return[l+E*p,u+E*_,c*N/Vn(n*M+v)]}}return y.duration=g*1e3*n/Math.SQRT2,y}return o.rho=function(a){var s=Math.max(.001,+a),l=s*s,u=l*l;return e(s,l,u)},o})(Math.SQRT2,2,4);var Bt=0,te=0,Vt=0,oi=1e3,Pe,ee,Te=0,Dt=0,Ue=0,ce=typeof performance=="object"&&performance.now?performance:Date,ai=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Sn(){return Dt||(ai(Va),Dt=ce.now()+Ue)}function Va(){Dt=0}function Ee(){this._call=this._time=this._next=null}Ee.prototype=Cn.prototype={constructor:Ee,restart:function(e,n,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Sn():+r)+(n==null?0:+n),!this._next&&ee!==this&&(ee?ee._next=this:Pe=this,ee=this),this._call=e,this._time=r,ln()},stop:function(){this._call&&(this._call=null,this._time=1/0,ln())}};function Cn(e,n,r){var i=new Ee;return i.restart(e,n,r),i}function Ga(){Sn(),++Bt;for(var e=Pe,n;e;)(n=Dt-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Bt}function Gn(){Dt=(Te=ce.now())+Ue,Bt=te=0;try{Ga()}finally{Bt=0,Ya(),Dt=0}}function Xa(){var e=ce.now(),n=e-Te;n>oi&&(Ue-=n,Te=e)}function Ya(){for(var e,n=Pe,r,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:Pe=r);ee=e,ln(i)}function ln(e){if(!Bt){te&&(te=clearTimeout(te));var n=e-Dt;n>24?(e<1/0&&(te=setTimeout(Gn,e-ce.now()-Ue)),Vt&&(Vt=clearInterval(Vt))):(Vt||(Te=ce.now(),Vt=setInterval(Xa,oi)),Bt=1,ai(Gn))}}function Xn(e,n,r){var i=new Ee;return n=n==null?0:+n,i.restart(o=>{i.stop(),e(o+n)},n,r),i}var Ka=de("start","end","cancel","interrupt"),Za=[],si=0,Yn=1,un=2,xe=3,Kn=4,cn=5,ke=6;function He(e,n,r,i,o,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;Qa(e,r,{name:n,index:i,group:o,on:Ka,tween:Za,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:si})}function Mn(e,n){var r=dt(e,n);if(r.state>si)throw new Error("too late; already scheduled");return r}function yt(e,n){var r=dt(e,n);if(r.state>xe)throw new Error("too late; already running");return r}function dt(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function Qa(e,n,r){var i=e.__transition,o;i[n]=r,r.timer=Cn(a,0,r.time);function a(c){r.state=Yn,r.timer.restart(s,r.delay,r.time),r.delay<=c&&s(c-r.delay)}function s(c){var h,f,d,p;if(r.state!==Yn)return u();for(h in i)if(p=i[h],p.name===r.name){if(p.state===xe)return Xn(s);p.state===Kn?(p.state=ke,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[h]):+h<n&&(p.state=ke,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete i[h])}if(Xn(function(){r.state===xe&&(r.state=Kn,r.timer.restart(l,r.delay,r.time),l(c))}),r.state=un,r.on.call("start",e,e.__data__,r.index,r.group),r.state===un){for(r.state=xe,o=new Array(d=r.tween.length),h=0,f=-1;h<d;++h)(p=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(o[++f]=p);o.length=f+1}}function l(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(u),r.state=cn,1),f=-1,d=o.length;++f<d;)o[f].call(e,h);r.state===cn&&(r.on.call("end",e,e.__data__,r.index,r.group),u())}function u(){r.state=ke,r.timer.stop(),delete i[n];for(var c in i)return;delete e.__transition}}function Se(e,n){var r=e.__transition,i,o,a=!0,s;if(r){n=n==null?null:n+"";for(s in r){if((i=r[s]).name!==n){a=!1;continue}o=i.state>un&&i.state<cn,i.state=ke,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[s]}a&&delete e.__transition}}function Ja(e){return this.each(function(){Se(this,e)})}function ts(e,n){var r,i;return function(){var o=yt(this,e),a=o.tween;if(a!==r){i=r=a;for(var s=0,l=i.length;s<l;++s)if(i[s].name===n){i=i.slice(),i.splice(s,1);break}}o.tween=i}}function es(e,n,r){var i,o;if(typeof r!="function")throw new Error;return function(){var a=yt(this,e),s=a.tween;if(s!==i){o=(i=s).slice();for(var l={name:n,value:r},u=0,c=o.length;u<c;++u)if(o[u].name===n){o[u]=l;break}u===c&&o.push(l)}a.tween=o}}function ns(e,n){var r=this._id;if(e+="",arguments.length<2){for(var i=dt(this.node(),r).tween,o=0,a=i.length,s;o<a;++o)if((s=i[o]).name===e)return s.value;return null}return this.each((n==null?ts:es)(r,e,n))}function An(e,n,r){var i=e._id;return e.each(function(){var o=yt(this,i);(o.value||(o.value={}))[n]=r.apply(this,arguments)}),function(o){return dt(o,i).value[n]}}function li(e,n){var r;return(typeof n=="number"?Rt:n instanceof $n?Ln:(r=$n(n))?(n=r,Ln):Gi)(e,n)}function rs(e){return function(){this.removeAttribute(e)}}function is(e){return function(){this.removeAttributeNS(e.space,e.local)}}function os(e,n,r){var i,o=r+"",a;return function(){var s=this.getAttribute(e);return s===o?null:s===i?a:a=n(i=s,r)}}function as(e,n,r){var i,o=r+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===i?a:a=n(i=s,r)}}function ss(e,n,r){var i,o,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=l+"",s===u?null:s===i&&u===o?a:(o=u,a=n(i=s,l)))}}function ls(e,n,r){var i,o,a;return function(){var s,l=r(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=l+"",s===u?null:s===i&&u===o?a:(o=u,a=n(i=s,l)))}}function us(e,n){var r=Le(e),i=r==="transform"?Ua:li;return this.attrTween(e,typeof n=="function"?(r.local?ls:ss)(r,i,An(this,"attr."+e,n)):n==null?(r.local?is:rs)(r):(r.local?as:os)(r,i,n))}function cs(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function fs(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function hs(e,n){var r,i;function o(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&fs(e,a)),r}return o._value=n,o}function ds(e,n){var r,i;function o(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&cs(e,a)),r}return o._value=n,o}function ps(e,n){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;var i=Le(e);return this.tween(r,(i.local?hs:ds)(i,n))}function gs(e,n){return function(){Mn(this,e).delay=+n.apply(this,arguments)}}function _s(e,n){return n=+n,function(){Mn(this,e).delay=n}}function vs(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?gs:_s)(n,e)):dt(this.node(),n).delay}function ys(e,n){return function(){yt(this,e).duration=+n.apply(this,arguments)}}function ms(e,n){return n=+n,function(){yt(this,e).duration=n}}function bs(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?ys:ms)(n,e)):dt(this.node(),n).duration}function ws(e,n){if(typeof n!="function")throw new Error;return function(){yt(this,e).ease=n}}function xs(e){var n=this._id;return arguments.length?this.each(ws(n,e)):dt(this.node(),n).ease}function ks(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!="function")throw new Error;yt(this,e).ease=r}}function Ss(e){if(typeof e!="function")throw new Error;return this.each(ks(this._id,e))}function Cs(e){typeof e!="function"&&(e=qr(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o)for(var a=n[o],s=a.length,l=i[o]=[],u,c=0;c<s;++c)(u=a[c])&&e.call(u,u.__data__,c,a)&&l.push(u);return new Tt(i,this._parents,this._name,this._id)}function Ms(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],h=u.length,f=s[l]=new Array(h),d,p=0;p<h;++p)(d=u[p]||c[p])&&(f[p]=d);for(;l<i;++l)s[l]=n[l];return new Tt(s,this._parents,this._name,this._id)}function As(e){return(e+"").trim().split(/^|\s+/).every(function(n){var r=n.indexOf(".");return r>=0&&(n=n.slice(0,r)),!n||n==="start"})}function Ps(e,n,r){var i,o,a=As(n)?Mn:yt;return function(){var s=a(this,e),l=s.on;l!==i&&(o=(i=l).copy()).on(n,r),s.on=o}}function Ts(e,n){var r=this._id;return arguments.length<2?dt(this.node(),r).on.on(e):this.each(Ps(r,e,n))}function Es(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function Ns(){return this.on("end.remove",Es(this._id))}function zs(e){var n=this._name,r=this._id;typeof e!="function"&&(e=xn(e));for(var i=this._groups,o=i.length,a=new Array(o),s=0;s<o;++s)for(var l=i[s],u=l.length,c=a[s]=new Array(u),h,f,d=0;d<u;++d)(h=l[d])&&(f=e.call(h,h.__data__,d,l))&&("__data__"in h&&(f.__data__=h.__data__),c[d]=f,He(c[d],n,r,d,c,dt(h,r)));return new Tt(a,this._parents,n,r)}function Is(e){var n=this._name,r=this._id;typeof e!="function"&&(e=Wr(e));for(var i=this._groups,o=i.length,a=[],s=[],l=0;l<o;++l)for(var u=i[l],c=u.length,h,f=0;f<c;++f)if(h=u[f]){for(var d=e.call(h,h.__data__,f,u),p,_=dt(h,r),b=0,y=d.length;b<y;++b)(p=d[b])&&He(p,n,r,b,d,_);a.push(d),s.push(h)}return new Tt(a,s,n,r)}var Rs=he.prototype.constructor;function Os(){return new Rs(this._groups,this._parents)}function Ds(e,n){var r,i,o;return function(){var a=Ht(this,e),s=(this.style.removeProperty(e),Ht(this,e));return a===s?null:a===r&&s===i?o:o=n(r=a,i=s)}}function ui(e){return function(){this.style.removeProperty(e)}}function Fs(e,n,r){var i,o=r+"",a;return function(){var s=Ht(this,e);return s===o?null:s===i?a:a=n(i=s,r)}}function js(e,n,r){var i,o,a;return function(){var s=Ht(this,e),l=r(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),Ht(this,e))),s===u?null:s===i&&u===o?a:(o=u,a=n(i=s,l))}}function $s(e,n){var r,i,o,a="style."+n,s="end."+a,l;return function(){var u=yt(this,e),c=u.on,h=u.value[a]==null?l||(l=ui(n)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(s,o=h),u.on=i}}function Ls(e,n,r){var i=(e+="")=="transform"?La:li;return n==null?this.styleTween(e,Ds(e,i)).on("end.style."+e,ui(e)):typeof n=="function"?this.styleTween(e,js(e,i,An(this,"style."+e,n))).each($s(this._id,e)):this.styleTween(e,Fs(e,i,n),r).on("end.style."+e,null)}function Us(e,n,r){return function(i){this.style.setProperty(e,n.call(this,i),r)}}function Hs(e,n,r){var i,o;function a(){var s=n.apply(this,arguments);return s!==o&&(i=(o=s)&&Us(e,s,r)),i}return a._value=n,a}function Bs(e,n,r){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,Hs(e,n,r??""))}function Ws(e){return function(){this.textContent=e}}function qs(e){return function(){var n=e(this);this.textContent=n??""}}function Vs(e){return this.tween("text",typeof e=="function"?qs(An(this,"text",e)):Ws(e==null?"":e+""))}function Gs(e){return function(n){this.textContent=e.call(this,n)}}function Xs(e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Gs(o)),n}return i._value=e,i}function Ys(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,Xs(e))}function Ks(){for(var e=this._name,n=this._id,r=ci(),i=this._groups,o=i.length,a=0;a<o;++a)for(var s=i[a],l=s.length,u,c=0;c<l;++c)if(u=s[c]){var h=dt(u,n);He(u,e,r,c,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Tt(i,this._parents,e,r)}function Zs(){var e,n,r=this,i=r._id,o=r.size();return new Promise(function(a,s){var l={value:s},u={value:function(){--o===0&&a()}};r.each(function(){var c=yt(this,i),h=c.on;h!==e&&(n=(e=h).copy(),n._.cancel.push(l),n._.interrupt.push(l),n._.end.push(u)),c.on=n}),o===0&&a()})}var Qs=0;function Tt(e,n,r,i){this._groups=e,this._parents=n,this._name=r,this._id=i}function ci(){return++Qs}var wt=he.prototype;Tt.prototype={constructor:Tt,select:zs,selectAll:Is,selectChild:wt.selectChild,selectChildren:wt.selectChildren,filter:Cs,merge:Ms,selection:Os,transition:Ks,call:wt.call,nodes:wt.nodes,node:wt.node,size:wt.size,empty:wt.empty,each:wt.each,on:Ts,attr:us,attrTween:ps,style:Ls,styleTween:Bs,text:Vs,textTween:Ys,remove:Ns,tween:ns,delay:vs,duration:bs,ease:xs,easeVarying:Ss,end:Zs,[Symbol.iterator]:wt[Symbol.iterator]};function Js(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var tl={time:null,delay:0,duration:250,ease:Js};function el(e,n){for(var r;!(r=e.__transition)||!(r=r[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return r}function nl(e){var n,r;e instanceof Tt?(n=e._id,e=e._name):(n=ci(),(r=tl).time=Sn(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,a=0;a<o;++a)for(var s=i[a],l=s.length,u,c=0;c<l;++c)(u=s[c])&&He(u,e,n,c,s,r||el(u,n));return new Tt(i,this._parents,e,n)}he.prototype.interrupt=Ja;he.prototype.transition=nl;const ve=e=>()=>e;function rl(e,{sourceEvent:n,target:r,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Mt(e,n,r){this.k=e,this.x=n,this.y=r}Mt.prototype={constructor:Mt,scale:function(e){return e===1?this:new Mt(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Mt(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Pn=new Mt(1,0,0);pt.prototype=Mt.prototype;function pt(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Pn;return e.__zoom}function Xe(e){e.stopImmediatePropagation()}function Gt(e){e.preventDefault(),e.stopImmediatePropagation()}function il(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ol(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Zn(){return this.__zoom||Pn}function al(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function sl(){return navigator.maxTouchPoints||"ontouchstart"in this}function ll(e,n,r){var i=e.invertX(n[0][0])-r[0][0],o=e.invertX(n[1][0])-r[1][0],a=e.invertY(n[0][1])-r[0][1],s=e.invertY(n[1][1])-r[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function ul(){var e=il,n=ol,r=ll,i=al,o=sl,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,u=qa,c=de("start","zoom","end"),h,f,d,p=500,_=150,b=0,y=10;function g(C){C.property("__zoom",Zn).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",E).filter(o).on("touchstart.zoom",I).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(C,z,A,O){var F=C.selection?C.selection():C;F.property("__zoom",Zn),C!==F?v(C,z,A,O):F.interrupt().each(function(){S(this,arguments).event(O).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},g.scaleBy=function(C,z,A,O){g.scaleTo(C,function(){var F=this.__zoom.k,$=typeof z=="function"?z.apply(this,arguments):z;return F*$},A,O)},g.scaleTo=function(C,z,A,O){g.transform(C,function(){var F=n.apply(this,arguments),$=this.__zoom,L=A==null?m(F):typeof A=="function"?A.apply(this,arguments):A,U=$.invert(L),H=typeof z=="function"?z.apply(this,arguments):z;return r(x(w($,H),L,U),F,s)},A,O)},g.translateBy=function(C,z,A,O){g.transform(C,function(){return r(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof A=="function"?A.apply(this,arguments):A),n.apply(this,arguments),s)},null,O)},g.translateTo=function(C,z,A,O,F){g.transform(C,function(){var $=n.apply(this,arguments),L=this.__zoom,U=O==null?m($):typeof O=="function"?O.apply(this,arguments):O;return r(Pn.translate(U[0],U[1]).scale(L.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof A=="function"?-A.apply(this,arguments):-A),$,s)},O,F)};function w(C,z){return z=Math.max(a[0],Math.min(a[1],z)),z===C.k?C:new Mt(z,C.x,C.y)}function x(C,z,A){var O=z[0]-A[0]*C.k,F=z[1]-A[1]*C.k;return O===C.x&&F===C.y?C:new Mt(C.k,O,F)}function m(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function v(C,z,A,O){C.on("start.zoom",function(){S(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(O).end()}).tween("zoom",function(){var F=this,$=arguments,L=S(F,$).event(O),U=n.apply(F,$),H=A==null?m(U):typeof A=="function"?A.apply(F,$):A,Y=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),X=F.__zoom,ut=typeof z=="function"?z.apply(F,$):z,mt=u(X.invert(H).concat(Y/X.k),ut.invert(H).concat(Y/ut.k));return function(ct){if(ct===1)ct=ut;else{var bt=mt(ct),Ve=Y/bt[2];ct=new Mt(Ve,H[0]-bt[0]*Ve,H[1]-bt[1]*Ve)}L.zoom(null,ct)}})}function S(C,z,A){return!A&&C.__zooming||new k(C,z)}function k(C,z){this.that=C,this.args=z,this.active=0,this.sourceEvent=null,this.extent=n.apply(C,z),this.taps=0}k.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,z){return this.mouse&&C!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var z=st(this.that).datum();c.call(C,this.that,new rl(C,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),z)}};function M(C,...z){if(!e.apply(this,arguments))return;var A=S(this,z).event(C),O=this.__zoom,F=Math.max(a[0],Math.min(a[1],O.k*Math.pow(2,i.apply(this,arguments)))),$=gt(C);if(A.wheel)(A.mouse[0][0]!==$[0]||A.mouse[0][1]!==$[1])&&(A.mouse[1]=O.invert(A.mouse[0]=$)),clearTimeout(A.wheel);else{if(O.k===F)return;A.mouse=[$,O.invert($)],Se(this),A.start()}Gt(C),A.wheel=setTimeout(L,_),A.zoom("mouse",r(x(w(O,F),A.mouse[0],A.mouse[1]),A.extent,s));function L(){A.wheel=null,A.end()}}function N(C,...z){if(d||!e.apply(this,arguments))return;var A=C.currentTarget,O=S(this,z,!0).event(C),F=st(C.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",Y,!0),$=gt(C,A),L=C.clientX,U=C.clientY;ei(C.view),Xe(C),O.mouse=[$,this.__zoom.invert($)],Se(this),O.start();function H(X){if(Gt(X),!O.moved){var ut=X.clientX-L,mt=X.clientY-U;O.moved=ut*ut+mt*mt>b}O.event(X).zoom("mouse",r(x(O.that.__zoom,O.mouse[0]=gt(X,A),O.mouse[1]),O.extent,s))}function Y(X){F.on("mousemove.zoom mouseup.zoom",null),ni(X.view,O.moved),Gt(X),O.event(X).end()}}function E(C,...z){if(e.apply(this,arguments)){var A=this.__zoom,O=gt(C.changedTouches?C.changedTouches[0]:C,this),F=A.invert(O),$=A.k*(C.shiftKey?.5:2),L=r(x(w(A,$),O,F),n.apply(this,z),s);Gt(C),l>0?st(this).transition().duration(l).call(v,L,O,C):st(this).call(g.transform,L,O,C)}}function I(C,...z){if(e.apply(this,arguments)){var A=C.touches,O=A.length,F=S(this,z,C.changedTouches.length===O).event(C),$,L,U,H;for(Xe(C),L=0;L<O;++L)U=A[L],H=gt(U,this),H=[H,this.__zoom.invert(H),U.identifier],F.touch0?!F.touch1&&F.touch0[2]!==H[2]&&(F.touch1=H,F.taps=0):(F.touch0=H,$=!0,F.taps=1+!!h);h&&(h=clearTimeout(h)),$&&(F.taps<2&&(f=H[0],h=setTimeout(function(){h=null},p)),Se(this),F.start())}}function R(C,...z){if(this.__zooming){var A=S(this,z).event(C),O=C.changedTouches,F=O.length,$,L,U,H;for(Gt(C),$=0;$<F;++$)L=O[$],U=gt(L,this),A.touch0&&A.touch0[2]===L.identifier?A.touch0[0]=U:A.touch1&&A.touch1[2]===L.identifier&&(A.touch1[0]=U);if(L=A.that.__zoom,A.touch1){var Y=A.touch0[0],X=A.touch0[1],ut=A.touch1[0],mt=A.touch1[1],ct=(ct=ut[0]-Y[0])*ct+(ct=ut[1]-Y[1])*ct,bt=(bt=mt[0]-X[0])*bt+(bt=mt[1]-X[1])*bt;L=w(L,Math.sqrt(ct/bt)),U=[(Y[0]+ut[0])/2,(Y[1]+ut[1])/2],H=[(X[0]+mt[0])/2,(X[1]+mt[1])/2]}else if(A.touch0)U=A.touch0[0],H=A.touch0[1];else return;A.zoom("touch",r(x(L,U,H),A.extent,s))}}function j(C,...z){if(this.__zooming){var A=S(this,z).event(C),O=C.changedTouches,F=O.length,$,L;for(Xe(C),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),$=0;$<F;++$)L=O[$],A.touch0&&A.touch0[2]===L.identifier?delete A.touch0:A.touch1&&A.touch1[2]===L.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(L=gt(L,this),Math.hypot(f[0]-L[0],f[1]-L[1])<y)){var U=st(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return g.wheelDelta=function(C){return arguments.length?(i=typeof C=="function"?C:ve(+C),g):i},g.filter=function(C){return arguments.length?(e=typeof C=="function"?C:ve(!!C),g):e},g.touchable=function(C){return arguments.length?(o=typeof C=="function"?C:ve(!!C),g):o},g.extent=function(C){return arguments.length?(n=typeof C=="function"?C:ve([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),g):n},g.scaleExtent=function(C){return arguments.length?(a[0]=+C[0],a[1]=+C[1],g):[a[0],a[1]]},g.translateExtent=function(C){return arguments.length?(s[0][0]=+C[0][0],s[1][0]=+C[1][0],s[0][1]=+C[0][1],s[1][1]=+C[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(C){return arguments.length?(r=C,g):r},g.duration=function(C){return arguments.length?(l=+C,g):l},g.interpolate=function(C){return arguments.length?(u=C,g):u},g.on=function(){var C=c.on.apply(c,arguments);return C===c?g:C},g.clickDistance=function(C){return arguments.length?(b=(C=+C)*C,g):Math.sqrt(b)},g.tapDistance=function(C){return arguments.length?(y=+C,g):y},g}function cl(e,n){let r=0;for(let i of e)(i=+i)&&(r+=i);return r}var fl=typeof global=="object"&&global&&global.Object===Object&&global,hl=typeof self=="object"&&self&&self.Object===Object&&self,fi=fl||hl||Function("return this")(),Ne=fi.Symbol,hi=Object.prototype,dl=hi.hasOwnProperty,pl=hi.toString,Xt=Ne?Ne.toStringTag:void 0;function gl(e){var n=dl.call(e,Xt),r=e[Xt];try{e[Xt]=void 0;var i=!0}catch{}var o=pl.call(e);return i&&(n?e[Xt]=r:delete e[Xt]),o}var _l=Object.prototype,vl=_l.toString;function yl(e){return vl.call(e)}var ml="[object Null]",bl="[object Undefined]",Qn=Ne?Ne.toStringTag:void 0;function wl(e){return e==null?e===void 0?bl:ml:Qn&&Qn in Object(e)?gl(e):yl(e)}function xl(e){return e!=null&&typeof e=="object"}var kl="[object Symbol]";function Sl(e){return typeof e=="symbol"||xl(e)&&wl(e)==kl}var Cl=/\s/;function Ml(e){for(var n=e.length;n--&&Cl.test(e.charAt(n)););return n}var Al=/^\s+/;function Pl(e){return e&&e.slice(0,Ml(e)+1).replace(Al,"")}function ze(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var Jn=NaN,Tl=/^[-+]0x[0-9a-f]+$/i,El=/^0b[01]+$/i,Nl=/^0o[0-7]+$/i,zl=parseInt;function tr(e){if(typeof e=="number")return e;if(Sl(e))return Jn;if(ze(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=ze(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Pl(e);var r=El.test(e);return r||Nl.test(e)?zl(e.slice(2),r?2:8):Tl.test(e)?Jn:+e}var Ye=function(){return fi.Date.now()},Il="Expected a function",Rl=Math.max,Ol=Math.min;function di(e,n,r){var i,o,a,s,l,u,c=0,h=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(Il);n=tr(n)||0,ze(r)&&(h=!!r.leading,f="maxWait"in r,a=f?Rl(tr(r.maxWait)||0,n):a,d="trailing"in r?!!r.trailing:d);function p(S){var k=i,M=o;return i=o=void 0,c=S,s=e.apply(M,k),s}function _(S){return c=S,l=setTimeout(g,n),h?p(S):s}function b(S){var k=S-u,M=S-c,N=n-k;return f?Ol(N,a-M):N}function y(S){var k=S-u,M=S-c;return u===void 0||k>=n||k<0||f&&M>=a}function g(){var S=Ye();if(y(S))return w(S);l=setTimeout(g,b(S))}function w(S){return l=void 0,d&&i?p(S):(i=o=void 0,s)}function x(){l!==void 0&&clearTimeout(l),c=0,i=u=o=l=void 0}function m(){return l===void 0?s:w(Ye())}function v(){var S=Ye(),k=y(S);if(i=arguments,o=this,u=S,k){if(l===void 0)return _(u);if(f)return clearTimeout(l),l=setTimeout(g,n),p(u)}return l===void 0&&(l=setTimeout(g,n)),s}return v.cancel=x,v.flush=m,v}var Dl="Expected a function";function Fl(e,n,r){var i=!0,o=!0;if(typeof e!="function")throw new TypeError(Dl);return ze(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),di(e,n,{leading:i,maxWait:n,trailing:o})}var Ot=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Ot.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Ot.Bounce.In(e*2)*.5:Ot.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),ne=function(){return performance.now()},pi=(function(){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,n)}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(r){return n._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];(n=s._group)===null||n===void 0||n.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];a._group=void 0,delete this._tweens[a.getId()],delete this._tweensAddedDuringUpdate[a.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(n){return!n.isPlaying()})},e.prototype.update=function(n,r){n===void 0&&(n=ne()),r===void 0&&(r=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var a=this._tweens[i[o]],s=!r;a&&a.update(n,s)===!1&&!r&&this.remove(a)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),fn={Linear:function(e,n){var r=e.length-1,i=r*n,o=Math.floor(i),a=fn.Utils.Linear;return n<0?a(e[0],e[1],i):n>1?a(e[r],e[r-1],r-i):a(e[o],e[o+1>r?r:o+1],i-o)},Utils:{Linear:function(e,n,r){return(n-e)*r+e}}},gi=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),hn=new pi,er=(function(){function e(n,r){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ot.Linear.None,this._interpolationFunction=fn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=gi.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=n,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=hn,hn.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(n,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,r){if(n===void 0&&(n=ne()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var a in this._valuesEnd)o[a]=this._valuesEnd[a];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,r,i,o,a){for(var s in i){var l=n[s],u=Array.isArray(l),c=u?"array":typeof l,h=!u&&Array.isArray(i[s]);if(!(c==="undefined"||c==="function")){if(h){var f=i[s];if(f.length===0)continue;for(var d=[l],p=0,_=f.length;p<_;p+=1){var b=this._handleRelativeValue(l,f[p]);if(isNaN(b)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}d.push(b)}h&&(i[s]=d)}if((c==="object"||u)&&l&&!h){r[s]=u?[]:{};var y=l;for(var g in y)r[s][g]=y[g];o[s]=u?[]:{};var f=i[s];if(!this._isDynamic){var w={};for(var g in f)w[g]=f[g];i[s]=f=w}this._setupProperties(y,r[s],f,o[s],a)}else(typeof r[s]>"u"||a)&&(r[s]=l),u||(r[s]*=1),h?o[s]=i[s].slice().reverse():o[s]=r[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(n){return n===void 0&&(n=ne()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this)},e.prototype.resume=function(n){return n===void 0&&(n=ne()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var n=0,r=this._chainedTweens.length;n<r;n++)this._chainedTweens[n].stop();return this},e.prototype.group=function(n){return n?(n.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var n;return(n=this._group)===null||n===void 0||n.remove(this),this},e.prototype.delay=function(n){return n===void 0&&(n=0),this._delayTime=n,this},e.prototype.repeat=function(n){return n===void 0&&(n=0),this._initialRepeat=n,this._repeat=n,this},e.prototype.repeatDelay=function(n){return this._repeatDelayTime=n,this},e.prototype.yoyo=function(n){return n===void 0&&(n=!1),this._yoyo=n,this},e.prototype.easing=function(n){return n===void 0&&(n=Ot.Linear.None),this._easingFunction=n,this},e.prototype.interpolation=function(n){return n===void 0&&(n=fn.Linear),this._interpolationFunction=n,this},e.prototype.chain=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return this._chainedTweens=n,this},e.prototype.onStart=function(n){return this._onStartCallback=n,this},e.prototype.onEveryStart=function(n){return this._onEveryStartCallback=n,this},e.prototype.onUpdate=function(n){return this._onUpdateCallback=n,this},e.prototype.onRepeat=function(n){return this._onRepeatCallback=n,this},e.prototype.onComplete=function(n){return this._onCompleteCallback=n,this},e.prototype.onStop=function(n){return this._onStopCallback=n,this},e.prototype.update=function(n,r){var i=this,o;if(n===void 0&&(n=ne()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var a;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(n,!0);else return!1;if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=n-this._startTime,l=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),u=this._duration+this._repeat*l,c=function(){if(i._duration===0||s>u)return 1;var b=Math.trunc(s/l),y=s-b*l,g=Math.min(y/i._duration,1);return g===0&&s===i._duration?1:g},h=c(),f=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||s>=this._duration)if(this._repeat>0){var d=Math.min(Math.trunc((s-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=d);for(a in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]=="string"&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*d,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var p=0,_=this._chainedTweens.length;p<_;p++)this._chainedTweens[p].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(n,r,i,o){for(var a in i)if(r[a]!==void 0){var s=r[a]||0,l=i[a],u=Array.isArray(n[a]),c=Array.isArray(l),h=!u&&c;h?n[a]=this._interpolationFunction(l,o):typeof l=="object"&&l?this._updateProperties(n[a],s,l,o):(l=this._handleRelativeValue(s,l),typeof l=="number"&&(n[a]=s+(l-s)*o))}},e.prototype._handleRelativeValue=function(n,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?n+parseFloat(r):parseFloat(r)},e.prototype._swapEndStartRepeatValues=function(n){var r=this._valuesStartRepeat[n],i=this._valuesEnd[n];typeof i=="string"?this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(i):this._valuesStartRepeat[n]=this._valuesEnd[n],this._valuesEnd[n]=r},e.autoStartOnUpdate=!1,e})();gi.nextId;var vt=hn;vt.getAll.bind(vt);vt.removeAll.bind(vt);vt.add.bind(vt);vt.remove.bind(vt);vt.update.bind(vt);function nr(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function jl(e){if(Array.isArray(e))return e}function $l(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Ll(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function Ul(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function Hl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bl(e,n){return jl(e)||Ul(e,n)||Wl(e,n)||Hl()}function Wl(e,n){if(e){if(typeof e=="string")return nr(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nr(e,n):void 0}}var ql=Ll(function e(n,r){var i=r.default,o=i===void 0?null:i,a=r.triggerUpdate,s=a===void 0?!0:a,l=r.onChange,u=l===void 0?function(c,h){}:l;$l(this,e),this.name=n,this.defaultVal=o,this.triggerUpdate=s,this.onChange=u});function Tn(e){var n=e.stateInit,r=n===void 0?function(){return{}}:n,i=e.props,o=i===void 0?{}:i,a=e.methods,s=a===void 0?{}:a,l=e.aliases,u=l===void 0?{}:l,c=e.init,h=c===void 0?function(){}:c,f=e.update,d=f===void 0?function(){}:f,p=Object.keys(o).map(function(_){return new ql(_,o[_])});return function _(){for(var b=arguments.length,y=new Array(b),g=0;g<b;g++)y[g]=arguments[g];var w=!!(this instanceof _&&this.constructor),x=w?y.shift():void 0,m=y[0],v=m===void 0?{}:m,S=Object.assign({},r instanceof Function?r(v):r,{initialised:!1}),k={};function M(I){return N(I,v),E(),M}var N=function(R,j){h.call(M,R,S,j),S.initialised=!0},E=di(function(){S.initialised&&(d.call(M,S,k),k={})},1);return p.forEach(function(I){M[I.name]=R(I);function R(j){var C=j.name,z=j.triggerUpdate,A=z===void 0?!1:z,O=j.onChange,F=O===void 0?function(U,H){}:O,$=j.defaultVal,L=$===void 0?null:$;return function(U){var H=S[C];if(!arguments.length)return H;var Y=U===void 0?L:U;return S[C]=Y,F.call(M,Y,S,H),!k.hasOwnProperty(C)&&(k[C]=H),A&&E(),M}}}),Object.keys(s).forEach(function(I){M[I]=function(){for(var R,j=arguments.length,C=new Array(j),z=0;z<j;z++)C[z]=arguments[z];return(R=s[I]).call.apply(R,[M,S].concat(C))}}),Object.entries(u).forEach(function(I){var R=Bl(I,2),j=R[0],C=R[1];return M[j]=M[C]}),M.resetProps=function(){return p.forEach(function(I){M[I.name](I.defaultVal)}),M},M.resetProps(),S._rerender=E,w&&x&&M(x),M}}var B=(function(e){return typeof e=="function"?e:typeof e=="string"?function(n){return n[e]}:function(n){return e}});function Ie(e){"@babel/helpers - typeof";return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ie(e)}var Vl=/^\s+/,Gl=/\s+$/;function D(e,n){if(e=e||"",n=n||{},e instanceof D)return e;if(!(this instanceof D))return new D(e,n);var r=Xl(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}D.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var n=this.toRgb();return(n.r*299+n.g*587+n.b*114)/1e3},getLuminance:function(){var n=this.toRgb(),r,i,o,a,s,l;return r=n.r/255,i=n.g/255,o=n.b/255,r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),o<=.03928?l=o/12.92:l=Math.pow((o+.055)/1.055,2.4),.2126*a+.7152*s+.0722*l},setAlpha:function(n){return this._a=_i(n),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var n=ir(this._r,this._g,this._b);return{h:n.h*360,s:n.s,v:n.v,a:this._a}},toHsvString:function(){var n=ir(this._r,this._g,this._b),r=Math.round(n.h*360),i=Math.round(n.s*100),o=Math.round(n.v*100);return this._a==1?"hsv("+r+", "+i+"%, "+o+"%)":"hsva("+r+", "+i+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var n=rr(this._r,this._g,this._b);return{h:n.h*360,s:n.s,l:n.l,a:this._a}},toHslString:function(){var n=rr(this._r,this._g,this._b),r=Math.round(n.h*360),i=Math.round(n.s*100),o=Math.round(n.l*100);return this._a==1?"hsl("+r+", "+i+"%, "+o+"%)":"hsla("+r+", "+i+"%, "+o+"%, "+this._roundA+")"},toHex:function(n){return or(this._r,this._g,this._b,n)},toHexString:function(n){return"#"+this.toHex(n)},toHex8:function(n){return Ql(this._r,this._g,this._b,this._a,n)},toHex8String:function(n){return"#"+this.toHex8(n)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(V(this._r,255)*100)+"%",g:Math.round(V(this._g,255)*100)+"%",b:Math.round(V(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(V(this._r,255)*100)+"%, "+Math.round(V(this._g,255)*100)+"%, "+Math.round(V(this._b,255)*100)+"%)":"rgba("+Math.round(V(this._r,255)*100)+"%, "+Math.round(V(this._g,255)*100)+"%, "+Math.round(V(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:cu[or(this._r,this._g,this._b,!0)]||!1},toFilter:function(n){var r="#"+ar(this._r,this._g,this._b,this._a),i=r,o=this._gradientType?"GradientType = 1, ":"";if(n){var a=D(n);i="#"+ar(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+r+",endColorstr="+i+")"},toString:function(n){var r=!!n;n=n||this._format;var i=!1,o=this._a<1&&this._a>=0,a=!r&&o&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return a?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(i=this.toRgbString()),n==="prgb"&&(i=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(i=this.toHexString()),n==="hex3"&&(i=this.toHexString(!0)),n==="hex4"&&(i=this.toHex8String(!0)),n==="hex8"&&(i=this.toHex8String()),n==="name"&&(i=this.toName()),n==="hsl"&&(i=this.toHslString()),n==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return D(this.toString())},_applyModification:function(n,r){var i=n.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(nu,arguments)},brighten:function(){return this._applyModification(ru,arguments)},darken:function(){return this._applyModification(iu,arguments)},desaturate:function(){return this._applyModification(Jl,arguments)},saturate:function(){return this._applyModification(tu,arguments)},greyscale:function(){return this._applyModification(eu,arguments)},spin:function(){return this._applyModification(ou,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(lu,arguments)},complement:function(){return this._applyCombination(au,arguments)},monochromatic:function(){return this._applyCombination(uu,arguments)},splitcomplement:function(){return this._applyCombination(su,arguments)},triad:function(){return this._applyCombination(sr,[3])},tetrad:function(){return this._applyCombination(sr,[4])}};D.fromRatio=function(e,n){if(Ie(e)=="object"){var r={};for(var i in e)e.hasOwnProperty(i)&&(i==="a"?r[i]=e[i]:r[i]=re(e[i]));e=r}return D(e,n)};function Xl(e){var n={r:0,g:0,b:0},r=1,i=null,o=null,a=null,s=!1,l=!1;return typeof e=="string"&&(e=pu(e)),Ie(e)=="object"&&(xt(e.r)&&xt(e.g)&&xt(e.b)?(n=Yl(e.r,e.g,e.b),s=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):xt(e.h)&&xt(e.s)&&xt(e.v)?(i=re(e.s),o=re(e.v),n=Zl(e.h,i,o),s=!0,l="hsv"):xt(e.h)&&xt(e.s)&&xt(e.l)&&(i=re(e.s),a=re(e.l),n=Kl(e.h,i,a),s=!0,l="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=_i(r),{ok:s,format:e.format||l,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function Yl(e,n,r){return{r:V(e,255)*255,g:V(n,255)*255,b:V(r,255)*255}}function rr(e,n,r){e=V(e,255),n=V(n,255),r=V(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,l=(i+o)/2;if(i==o)a=s=0;else{var u=i-o;switch(s=l>.5?u/(2-i-o):u/(i+o),i){case e:a=(n-r)/u+(n<r?6:0);break;case n:a=(r-e)/u+2;break;case r:a=(e-n)/u+4;break}a/=6}return{h:a,s,l}}function Kl(e,n,r){var i,o,a;e=V(e,360),n=V(n,100),r=V(r,100);function s(c,h,f){return f<0&&(f+=1),f>1&&(f-=1),f<1/6?c+(h-c)*6*f:f<1/2?h:f<2/3?c+(h-c)*(2/3-f)*6:c}if(n===0)i=o=a=r;else{var l=r<.5?r*(1+n):r+n-r*n,u=2*r-l;i=s(u,l,e+1/3),o=s(u,l,e),a=s(u,l,e-1/3)}return{r:i*255,g:o*255,b:a*255}}function ir(e,n,r){e=V(e,255),n=V(n,255),r=V(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,l=i,u=i-o;if(s=i===0?0:u/i,i==o)a=0;else{switch(i){case e:a=(n-r)/u+(n<r?6:0);break;case n:a=(r-e)/u+2;break;case r:a=(e-n)/u+4;break}a/=6}return{h:a,s,v:l}}function Zl(e,n,r){e=V(e,360)*6,n=V(n,100),r=V(r,100);var i=Math.floor(e),o=e-i,a=r*(1-n),s=r*(1-o*n),l=r*(1-(1-o)*n),u=i%6,c=[r,s,a,a,l,r][u],h=[l,r,r,s,a,a][u],f=[a,a,l,r,r,s][u];return{r:c*255,g:h*255,b:f*255}}function or(e,n,r,i){var o=[ht(Math.round(e).toString(16)),ht(Math.round(n).toString(16)),ht(Math.round(r).toString(16))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function Ql(e,n,r,i,o){var a=[ht(Math.round(e).toString(16)),ht(Math.round(n).toString(16)),ht(Math.round(r).toString(16)),ht(vi(i))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function ar(e,n,r,i){var o=[ht(vi(i)),ht(Math.round(e).toString(16)),ht(Math.round(n).toString(16)),ht(Math.round(r).toString(16))];return o.join("")}D.equals=function(e,n){return!e||!n?!1:D(e).toRgbString()==D(n).toRgbString()};D.random=function(){return D.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Jl(e,n){n=n===0?0:n||10;var r=D(e).toHsl();return r.s-=n/100,r.s=Be(r.s),D(r)}function tu(e,n){n=n===0?0:n||10;var r=D(e).toHsl();return r.s+=n/100,r.s=Be(r.s),D(r)}function eu(e){return D(e).desaturate(100)}function nu(e,n){n=n===0?0:n||10;var r=D(e).toHsl();return r.l+=n/100,r.l=Be(r.l),D(r)}function ru(e,n){n=n===0?0:n||10;var r=D(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(n/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(n/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(n/100)))),D(r)}function iu(e,n){n=n===0?0:n||10;var r=D(e).toHsl();return r.l-=n/100,r.l=Be(r.l),D(r)}function ou(e,n){var r=D(e).toHsl(),i=(r.h+n)%360;return r.h=i<0?360+i:i,D(r)}function au(e){var n=D(e).toHsl();return n.h=(n.h+180)%360,D(n)}function sr(e,n){if(isNaN(n)||n<=0)throw new Error("Argument to polyad must be a positive number");for(var r=D(e).toHsl(),i=[D(e)],o=360/n,a=1;a<n;a++)i.push(D({h:(r.h+a*o)%360,s:r.s,l:r.l}));return i}function su(e){var n=D(e).toHsl(),r=n.h;return[D(e),D({h:(r+72)%360,s:n.s,l:n.l}),D({h:(r+216)%360,s:n.s,l:n.l})]}function lu(e,n,r){n=n||6,r=r||30;var i=D(e).toHsl(),o=360/r,a=[D(e)];for(i.h=(i.h-(o*n>>1)+720)%360;--n;)i.h=(i.h+o)%360,a.push(D(i));return a}function uu(e,n){n=n||6;for(var r=D(e).toHsv(),i=r.h,o=r.s,a=r.v,s=[],l=1/n;n--;)s.push(D({h:i,s:o,v:a})),a=(a+l)%1;return s}D.mix=function(e,n,r){r=r===0?0:r||50;var i=D(e).toRgb(),o=D(n).toRgb(),a=r/100,s={r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a};return D(s)};D.readability=function(e,n){var r=D(e),i=D(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};D.isReadable=function(e,n,r){var i=D.readability(e,n),o,a;switch(a=!1,o=gu(r),o.level+o.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7;break}return a};D.mostReadable=function(e,n,r){var i=null,o=0,a,s,l,u;r=r||{},s=r.includeFallbackColors,l=r.level,u=r.size;for(var c=0;c<n.length;c++)a=D.readability(e,n[c]),a>o&&(o=a,i=D(n[c]));return D.isReadable(e,i,{level:l,size:u})||!s?i:(r.includeFallbackColors=!1,D.mostReadable(e,["#fff","#000"],r))};var dn=D.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},cu=D.hexNames=fu(dn);function fu(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function _i(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function V(e,n){hu(e)&&(e="100%");var r=du(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function Be(e){return Math.min(1,Math.max(0,e))}function rt(e){return parseInt(e,16)}function hu(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function du(e){return typeof e=="string"&&e.indexOf("%")!=-1}function ht(e){return e.length==1?"0"+e:""+e}function re(e){return e<=1&&(e=e*100+"%"),e}function vi(e){return Math.round(parseFloat(e)*255).toString(16)}function lr(e){return rt(e)/255}var ft=(function(){var e="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",r="(?:"+n+")|(?:"+e+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function xt(e){return!!ft.CSS_UNIT.exec(e)}function pu(e){e=e.replace(Vl,"").replace(Gl,"").toLowerCase();var n=!1;if(dn[e])e=dn[e],n=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=ft.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=ft.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=ft.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=ft.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=ft.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=ft.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=ft.hex8.exec(e))?{r:rt(r[1]),g:rt(r[2]),b:rt(r[3]),a:lr(r[4]),format:n?"name":"hex8"}:(r=ft.hex6.exec(e))?{r:rt(r[1]),g:rt(r[2]),b:rt(r[3]),format:n?"name":"hex"}:(r=ft.hex4.exec(e))?{r:rt(r[1]+""+r[1]),g:rt(r[2]+""+r[2]),b:rt(r[3]+""+r[3]),a:lr(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=ft.hex3.exec(e))?{r:rt(r[1]+""+r[1]),g:rt(r[2]+""+r[2]),b:rt(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function gu(e){var n,r;return e=e||{level:"AA",size:"small"},n=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:n,size:r}}function pn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function _u(e){if(Array.isArray(e))return pn(e)}function yi(e,n,r){if(typeof e=="function"?e===n:e.has(n))return arguments.length<3?n:r;throw new TypeError("Private element is not present on this object")}function vu(e,n){if(n.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yu(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function ot(e,n){return e.get(yi(e,n))}function ur(e,n,r){vu(e,n),n.set(e,r)}function cr(e,n,r){return e.set(yi(e,n),r),r}function mu(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Cu(i.key),i)}}function bu(e,n,r){return n&&mu(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wu(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xu(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ku(e){return _u(e)||wu(e)||Mu(e)||xu()}function Su(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Cu(e){var n=Su(e,"string");return typeof n=="symbol"?n:n+""}function Mu(e,n){if(e){if(typeof e=="string")return pn(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pn(e,n):void 0}}var Au=123,Pu=function(n){return"#".concat(Math.min(n,Math.pow(2,24)).toString(16).padStart(6,"0"))},mi=function(n,r,i){return(n<<16)+(r<<8)+i},Tu=function(n){var r=D(n).toRgb(),i=r.r,o=r.g,a=r.b;return mi(i,o,a)},fr=function(n,r){return n*Au%Math.pow(2,r)},It=new WeakMap,kt=new WeakMap,Eu=(function(){function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6;yu(this,e),ur(this,It,void 0),ur(this,kt,void 0),cr(kt,this,n),this.reset()}return bu(e,[{key:"reset",value:function(){cr(It,this,["__reserved for background__"])}},{key:"register",value:function(r){if(ot(It,this).length>=Math.pow(2,24-ot(kt,this)))return null;var i=ot(It,this).length,o=fr(i,ot(kt,this)),a=Pu(i+(o<<24-ot(kt,this)));return ot(It,this).push(r),a}},{key:"lookup",value:function(r){if(!r)return null;var i=typeof r=="string"?Tu(r):mi.apply(void 0,ku(r));if(!i)return null;var o=i&Math.pow(2,24-ot(kt,this))-1,a=i>>24-ot(kt,this)&Math.pow(2,ot(kt,this))-1;return fr(o,ot(kt,this))!==a||o>=ot(It,this).length?null:ot(It,this)[o]}}])})(),pe,G,bi,wi,zt,hr,xi,ki,Ke,Ce,oe,Si,En,gn,_n,Re={},Oe=[],Nu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,We=Array.isArray;function _t(e,n){for(var r in n)e[r]=n[r];return e}function Nn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function zu(e,n,r){var i,o,a,s={};for(a in n)a=="key"?i=n[a]:a=="ref"?o=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?pe.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)s[a]===void 0&&(s[a]=e.defaultProps[a]);return ae(e,s,i,o,null)}function ae(e,n,r,i,o){var a={type:e,props:n,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++bi,__i:-1,__u:0};return o==null&&G.vnode!=null&&G.vnode(a),a}function qe(e){return e.children}function Me(e,n){this.props=e,this.context=n}function Wt(e,n){if(n==null)return e.__?Wt(e.__,e.__i+1):null;for(var r;n<e.__k.length;n++)if((r=e.__k[n])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Wt(e):null}function Iu(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],o=[],a=_t({},n);a.__v=n.__v+1,G.vnode&&G.vnode(a),zn(e.__P,a,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??Wt(n),!!(32&n.__u),o),a.__v=n.__v,a.__.__k[a.__i]=a,Pi(i,a,o),n.__e=n.__=null,a.__e!=r&&Ci(a)}}function Ci(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),Ci(e)}function dr(e){(!e.__d&&(e.__d=!0)&&zt.push(e)&&!De.__r++||hr!=G.debounceRendering)&&((hr=G.debounceRendering)||xi)(De)}function De(){try{for(var e,n=1;zt.length;)zt.length>n&&zt.sort(ki),e=zt.shift(),n=zt.length,Iu(e)}finally{zt.length=De.__r=0}}function Mi(e,n,r,i,o,a,s,l,u,c,h){var f,d,p,_,b,y,g,w=i&&i.__k||Oe,x=n.length;for(u=Ru(r,n,w,u,x),f=0;f<x;f++)(p=r.__k[f])!=null&&(d=p.__i!=-1&&w[p.__i]||Re,p.__i=f,y=zn(e,p,d,o,a,s,l,u,c,h),_=p.__e,p.ref&&d.ref!=p.ref&&(d.ref&&In(d.ref,null,p),h.push(p.ref,p.__c||_,p)),b==null&&_!=null&&(b=_),(g=!!(4&p.__u))||d.__k===p.__k?(u=Ai(p,u,e,g),g&&d.__e&&(d.__e=null)):typeof p.type=="function"&&y!==void 0?u=y:_&&(u=_.nextSibling),p.__u&=-7);return r.__e=b,u}function Ru(e,n,r,i,o){var a,s,l,u,c,h=r.length,f=h,d=0;for(e.__k=new Array(o),a=0;a<o;a++)(s=n[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[a]=ae(null,s,null,null,null):We(s)?s=e.__k[a]=ae(qe,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[a]=ae(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[a]=s,u=a+d,s.__=e,s.__b=e.__b+1,l=null,(c=s.__i=Ou(s,r,u,f))!=-1&&(f--,(l=r[c])&&(l.__u|=2)),l==null||l.__v==null?(c==-1&&(o>h?d--:o<h&&d++),typeof s.type!="function"&&(s.__u|=4)):c!=u&&(c==u-1?d--:c==u+1?d++:(c>u?d--:d++,s.__u|=4))):e.__k[a]=null;if(f)for(a=0;a<h;a++)(l=r[a])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=Wt(l)),Ei(l,l));return i}function Ai(e,n,r,i){var o,a;if(typeof e.type=="function"){for(o=e.__k,a=0;o&&a<o.length;a++)o[a]&&(o[a].__=e,n=Ai(o[a],n,r,i));return n}e.__e!=n&&(i&&(n&&e.type&&!n.parentNode&&(n=Wt(e)),r.insertBefore(e.__e,n||null)),n=e.__e);do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function Ou(e,n,r,i){var o,a,s,l=e.key,u=e.type,c=n[r],h=c!=null&&(2&c.__u)==0;if(c===null&&l==null||h&&l==c.key&&u==c.type)return r;if(i>(h?1:0)){for(o=r-1,a=r+1;o>=0||a<n.length;)if((c=n[s=o>=0?o--:a++])!=null&&(2&c.__u)==0&&l==c.key&&u==c.type)return s}return-1}function pr(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||Nu.test(n)?r:r+"px"}function ye(e,n,r,i,o){var a,s;t:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(n in i)r&&n in r||pr(e.style,n,"");if(r)for(n in r)i&&r[n]==i[n]||pr(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")a=n!=(n=n.replace(Si,"$1")),s=n.toLowerCase(),n=s in e||n=="onFocusOut"||n=="onFocusIn"?s.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+a]=r,r?i?r[oe]=i[oe]:(r[oe]=En,e.addEventListener(n,a?_n:gn,a)):e.removeEventListener(n,a?_n:gn,a);else{if(o=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break t}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function gr(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[Ce]==null)n[Ce]=En++;else if(n[Ce]<r[oe])return;return r(G.event?G.event(n):n)}}}function zn(e,n,r,i,o,a,s,l,u,c){var h,f,d,p,_,b,y,g,w,x,m,v,S,k,M,N=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),a=[l=n.__e=r.__e]),(h=G.__b)&&h(n);t:if(typeof N=="function")try{if(g=n.props,w=N.prototype&&N.prototype.render,x=(h=N.contextType)&&i[h.__c],m=h?x?x.props.value:h.__:i,r.__c?y=(f=n.__c=r.__c).__=f.__E:(w?n.__c=f=new N(g,m):(n.__c=f=new Me(g,m),f.constructor=N,f.render=Fu),x&&x.sub(f),f.state||(f.state={}),f.__n=i,d=f.__d=!0,f.__h=[],f._sb=[]),w&&f.__s==null&&(f.__s=f.state),w&&N.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=_t({},f.__s)),_t(f.__s,N.getDerivedStateFromProps(g,f.__s))),p=f.props,_=f.state,f.__v=n,d)w&&N.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),w&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(w&&N.getDerivedStateFromProps==null&&g!==p&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(g,m),n.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(g,f.__s,m)===!1){n.__v!=r.__v&&(f.props=g,f.state=f.__s,f.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(E){E&&(E.__=n)}),Oe.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break t}f.componentWillUpdate!=null&&f.componentWillUpdate(g,f.__s,m),w&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(p,_,b)})}if(f.context=m,f.props=g,f.__P=e,f.__e=!1,v=G.__r,S=0,w)f.state=f.__s,f.__d=!1,v&&v(n),h=f.render(f.props,f.state,f.context),Oe.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,v&&v(n),h=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++S<25);f.state=f.__s,f.getChildContext!=null&&(i=_t(_t({},i),f.getChildContext())),w&&!d&&f.getSnapshotBeforeUpdate!=null&&(b=f.getSnapshotBeforeUpdate(p,_)),k=h!=null&&h.type===qe&&h.key==null?Ti(h.props.children):h,l=Mi(e,We(k)?k:[k],n,r,i,o,a,s,l,u,c),f.base=n.__e,n.__u&=-161,f.__h.length&&s.push(f),y&&(f.__E=f.__=null)}catch(E){if(n.__v=null,u||a!=null)if(E.then){for(n.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,n.__e=l}else{for(M=a.length;M--;)Nn(a[M]);vn(n)}else n.__e=r.__e,n.__k=r.__k,E.then||vn(n);G.__e(E,n,r)}else a==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):l=n.__e=Du(r.__e,n,r,i,o,a,s,u,c);return(h=G.diffed)&&h(n),128&n.__u?void 0:l}function vn(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(vn))}function Pi(e,n,r){for(var i=0;i<r.length;i++)In(r[i],r[++i],r[++i]);G.__c&&G.__c(n,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){G.__e(a,o.__v)}})}function Ti(e){return typeof e!="object"||e==null||e.__b>0?e:We(e)?e.map(Ti):e.constructor!==void 0?null:_t({},e)}function Du(e,n,r,i,o,a,s,l,u){var c,h,f,d,p,_,b,y=r.props||Re,g=n.props,w=n.type;if(w=="svg"?o="http://www.w3.org/2000/svg":w=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(c=0;c<a.length;c++)if((p=a[c])&&"setAttribute"in p==!!w&&(w?p.localName==w:p.nodeType==3)){e=p,a[c]=null;break}}if(e==null){if(w==null)return document.createTextNode(g);e=document.createElementNS(o,w,g.is&&g),l&&(G.__m&&G.__m(n,a),l=!1),a=null}if(w==null)y===g||l&&e.data==g||(e.data=g);else{if(a=w=="textarea"&&g.defaultValue!=null?null:a&&pe.call(e.childNodes),!l&&a!=null)for(y={},c=0;c<e.attributes.length;c++)y[(p=e.attributes[c]).name]=p.value;for(c in y)p=y[c],c=="dangerouslySetInnerHTML"?f=p:c=="children"||c in g||c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g||ye(e,c,null,p,o);for(c in g)p=g[c],c=="children"?d=p:c=="dangerouslySetInnerHTML"?h=p:c=="value"?_=p:c=="checked"?b=p:l&&typeof p!="function"||y[c]===p||ye(e,c,p,y[c],o);if(h)l||f&&(h.__html==f.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),n.__k=[];else if(f&&(e.innerHTML=""),Mi(n.type=="template"?e.content:e,We(d)?d:[d],n,r,i,w=="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,s,a?a[0]:r.__k&&Wt(r,0),l,u),a!=null)for(c=a.length;c--;)Nn(a[c]);l&&w!="textarea"||(c="value",w=="progress"&&_==null?e.removeAttribute("value"):_!=null&&(_!==e[c]||w=="progress"&&!_||w=="option"&&_!=y[c])&&ye(e,c,_,y[c],o),c="checked",b!=null&&b!=e[c]&&ye(e,c,b,y[c],o))}return e}function In(e,n,r){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(o){G.__e(o,r)}}function Ei(e,n,r){var i,o;if(G.unmount&&G.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||In(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(a){G.__e(a,n)}i.base=i.__P=null}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&Ei(i[o],n,r||typeof e.type!="function");r||Nn(e.__e),e.__c=e.__=e.__e=void 0}function Fu(e,n,r){return this.constructor(e,r)}function ju(e,n,r){var i,o,a,s;n==document&&(n=document.documentElement),G.__&&G.__(e,n),o=(i=!1)?null:n.__k,a=[],s=[],zn(n,e=n.__k=zu(qe,null,[e]),o||Re,Re,n.namespaceURI,o?null:n.firstChild?pe.call(n.childNodes):null,a,o?o.__e:n.firstChild,i,s),Pi(a,e,s)}function Ni(e,n,r){var i,o,a,s,l=_t({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)a=="key"?i=n[a]:a=="ref"?o=n[a]:l[a]=n[a]===void 0&&s!=null?s[a]:n[a];return arguments.length>2&&(l.children=arguments.length>3?pe.call(arguments,2):r),ae(e.type,l,i||e.key,o||e.ref,null)}pe=Oe.slice,G={__e:function(e,n,r,i){for(var o,a,s;n=n.__;)if((o=n.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,i||{}),s=o.__d),s)return o.__E=o}catch(l){e=l}throw e}},bi=0,wi=function(e){return e!=null&&e.constructor===void 0},Me.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=_t({},this.state),typeof e=="function"&&(e=e(_t({},r),this.props)),e&&_t(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),dr(this))},Me.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),dr(this))},Me.prototype.render=qe,zt=[],xi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ki=function(e,n){return e.__v.__b-n.__v.__b},De.__r=0,Ke=Math.random().toString(8),Ce="__d"+Ke,oe="__a"+Ke,Si=/(PointerCapture)$|Capture$/i,En=0,gn=gr(!1),_n=gr(!0);function _r(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function $u(e){if(Array.isArray(e))return e}function Lu(e,n,r){return(n=Vu(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Uu(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,l=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(u=(i=a.call(r)).done)&&(l.push(i.value),l.length!==n);u=!0);}catch(h){c=!0,o=h}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}}function Hu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
5
5
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vr(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function Bu(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?vr(Object(r),!0).forEach(function(i){Lu(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Wu(e,n){return $u(e)||Uu(e,n)||Gu(e,n)||Hu()}function qu(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Vu(e){var n=qu(e,"string");return typeof n=="symbol"?n:n+""}function Fe(e){"@babel/helpers - typeof";return Fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Fe(e)}function Gu(e,n){if(e){if(typeof e=="string")return _r(e,n);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_r(e,n):void 0}}var yn=function(n){if(Fe(n)!=="object")return n;var r=Ni(n);if(r.props){var i;r.props=Bu({},r.props),r!=null&&(i=r.props)!==null&&i!==void 0&&i.children&&(r.props.children=Array.isArray(r.props.children)?r.props.children.map(yn):yn(r.props.children))}return r},Xu=function(n){return wi(Ni(n))},Yu=function(n,r){delete r.__k,ju(yn(n),r)};function Ku(e,n){n===void 0&&(n={});var r=n.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var Zu=`.float-tooltip-kap {
|
|
@@ -188,5 +188,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
188
188
|
flex-shrink: 0;
|
|
189
189
|
white-space: nowrap;
|
|
190
190
|
}
|
|
191
|
-
`,document.head.appendChild(e)}},Rr="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function Or(e){const n=e.trim();return!n||n.startsWith('"')?!1:n.startsWith("_:")||n.startsWith("<")&&n.endsWith(">")?!0:/\s/.test(n)?!1:/^[A-Za-z][A-Za-z0-9+.-]*:/.test(n)}function Lt(e){const n=e.trim();return n.startsWith("<")&&n.endsWith(">")?n.slice(1,-1):n}function Dr(e,n,r){return`${e}\0${n}\0${r}`}var ch=class{constructor(e){P(this,"nodes",new Map);P(this,"edges",new Map);P(this,"prefixes",{});P(this,"_triples",[]);P(this,"_metadataPredicates",new Set);P(this,"_outEdges",new Map);P(this,"_inEdges",new Map);P(this,"kaGroups",new Map);P(this,"_kaMembershipPredicate",null);if(e)for(const n of e)this._metadataPredicates.add(n)}get triples(){return this._triples}setKaMembershipPredicate(e){this._kaMembershipPredicate=e}ensureNode(e){let n=this.nodes.get(e);return n||(n={id:e,types:[],label:e,properties:new Map,imageUrl:null,metadata:new Map,degree:0,isBoundary:!1},this.nodes.set(e,n)),n}ensureAdjacency(e){this._outEdges.has(e)||this._outEdges.set(e,new Set),this._inEdges.has(e)||this._inEdges.set(e,new Set)}addTriple(e){const n=Lt(e.subject),r=Lt(e.predicate),i=Or(e.object),o=i?Lt(e.object):e.object;this._triples.push({...e,subject:n,predicate:r,object:o});const a=this.ensureNode(n);if(r===Rr){a.types.includes(o)||a.types.push(o);return}if(i){if(this._metadataPredicates.has(r)){const u={value:o,datatype:e.datatype,language:e.language},c=a.metadata.get(r);c?c.push(u):a.metadata.set(r,[u]);return}const s=this.ensureNode(o),l=Dr(n,r,o);if(this.edges.has(l)||(this.edges.set(l,{id:l,source:n,target:o,predicate:r,label:r}),a.degree++,s.degree++,this.ensureAdjacency(n),this.ensureAdjacency(o),this._outEdges.get(n).add(l),this._inEdges.get(o).add(l)),this._kaMembershipPredicate&&r===this._kaMembershipPredicate){let u=this.kaGroups.get(o);u||(u=new Set,this.kaGroups.set(o,u)),u.add(n)}}else{const s={value:e.object,datatype:e.datatype,language:e.language};if(this._metadataPredicates.has(r)){const l=a.metadata.get(r);l?l.push(s):a.metadata.set(r,[s])}else{const l=a.properties.get(r);l?l.push(s):a.properties.set(r,[s])}}}addTriples(e){const n=new Set(this.nodes.keys()),r=new Set(this.edges.keys());for(const s of e)this.addTriple(s);const i=[],o=[],a=new Set;for(const s of this.nodes.keys())n.has(s)?a.add(s):i.push(s);for(const s of this.edges.keys())r.has(s)||o.push(s);return{addedNodes:i,removedNodes:[],addedEdges:o,removedEdges:[],modifiedNodes:[...a]}}removeTriples(e){var o,a;const n=[],r=new Set;for(const s of e){const l=Lt(s.subject),u=Lt(s.predicate),c=Or(s.object),h=c?Lt(s.object):s.object,f=this._triples.findIndex(d=>d.subject===l&&d.predicate===u&&d.object===h);if(f!==-1&&this._triples.splice(f,1),u===Rr){const d=this.nodes.get(l);d&&(d.types=d.types.filter(p=>p!==h),r.add(l));continue}if(c&&!this._metadataPredicates.has(u)){const d=Dr(l,u,h);if(this.edges.has(d)){this.edges.delete(d),n.push(d),(o=this._outEdges.get(l))==null||o.delete(d),(a=this._inEdges.get(h))==null||a.delete(d);const p=this.nodes.get(l),_=this.nodes.get(h);p&&p.degree--,_&&_.degree--,r.add(l),r.add(h)}}else{const d=this.nodes.get(l);if(d){const p=this._metadataPredicates.has(u)?d.metadata:d.properties,_=p.get(u);if(_){const b=_.filter(y=>y.value!==h);b.length===0?p.delete(u):p.set(u,b),r.add(l)}}}}const i=[];for(const[s,l]of this.nodes)l.degree===0&&l.types.length===0&&l.properties.size===0&&l.metadata.size===0&&(this.nodes.delete(s),this._outEdges.delete(s),this._inEdges.delete(s),i.push(s));return{addedNodes:[],removedNodes:i,addedEdges:[],removedEdges:n,modifiedNodes:[...r]}}getNode(e){return this.nodes.get(e)}getEdgesFrom(e){const n=this._outEdges.get(e);if(!n)return[];const r=[];for(const i of n){const o=this.edges.get(i);o&&r.push(o)}return r}getEdgesTo(e){const n=this._inEdges.get(e);if(!n)return[];const r=[];for(const i of n){const o=this.edges.get(i);o&&r.push(o)}return r}getNeighborIds(e){const n=new Set,r=this._outEdges.get(e);if(r)for(const o of r){const a=this.edges.get(o);a&&n.add(a.target)}const i=this._inEdges.get(e);if(i)for(const o of i){const a=this.edges.get(o);a&&n.add(a.source)}return n}getHighestDegreeNode(){let e=null;for(const n of this.nodes.values())(!e||n.degree>e.degree)&&(e=n);return e}clear(){this.nodes.clear(),this.edges.clear(),this._triples=[],this._outEdges.clear(),this._inEdges.clear()}get tripleCount(){return this._triples.length}},fh={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",owl:"http://www.w3.org/2002/07/owl#",xsd:"http://www.w3.org/2001/XMLSchema#",schema:"https://schema.org/",foaf:"http://xmlns.com/foaf/0.1/",dcterms:"http://purl.org/dc/terms/",dc:"http://purl.org/dc/elements/1.1/",prov:"http://www.w3.org/ns/prov#",skos:"http://www.w3.org/2004/02/skos/core#"},ie=class{constructor(e){P(this,"_prefixes");P(this,"_reverse");this._prefixes=new Map,this._reverse=new Map;for(const[n,r]of Object.entries(fh))this._prefixes.set(n,r),this._reverse.set(r,n);if(e)for(const[n,r]of Object.entries(e))this._prefixes.set(n,r),this._reverse.set(r,n)}addPrefix(e,n){this._prefixes.set(e,n),this._reverse.set(n,e)}addPrefixes(e){for(const[n,r]of Object.entries(e))this.addPrefix(n,r)}getNamespace(e){return this._prefixes.get(e)}getPrefix(e){return this._reverse.get(e)}compact(e){for(const[n,r]of this._reverse)if(e.startsWith(n)){const i=e.slice(n.length);if(i.length>0)return`${r}:${i}`}return null}expand(e){const n=e.indexOf(":");if(n===-1||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("urn:"))return e;const r=e.slice(0,n),i=e.slice(n+1),o=this._prefixes.get(r);return o?o+i:e}static localName(e){const n=e.lastIndexOf("#");if(n!==-1)return e.slice(n+1);const r=e.lastIndexOf("/");if(r!==-1)return e.slice(r+1);if(e.includes("%2F")||e.includes("%2f"))try{const o=decodeURIComponent(e),a=o.lastIndexOf("/");if(a!==-1)return o.slice(a+1)}catch{}const i=e.lastIndexOf(":");return i!==-1&&i<e.length-1?e.slice(i+1):e}get prefixes(){const e={};for(const[n,r]of this._prefixes)e[n]=r;return e}},hh=["http://www.w3.org/2000/01/rdf-schema#label","https://schema.org/name","http://xmlns.com/foaf/0.1/name","http://purl.org/dc/terms/title","http://purl.org/dc/elements/1.1/title","https://schema.org/alternateName"],dh=class{constructor(e,n,r){P(this,"_mode");P(this,"_prefixManager");P(this,"_labelPredicates");this._mode=e,this._prefixManager=n,this._labelPredicates=(r==null?void 0:r.predicates)??hh}get mode(){return this._mode}set mode(e){this._mode=e}resolveNodeLabel(e){for(const n of this._labelPredicates){const r=e.properties.get(n);if(r&&r.length>0)return r[0].value}return this.resolveUri(e.id)}resolveEdgeLabel(e){return this.resolveUri(e.predicate)}resolveUri(e){return this._mode==="strict"?this._prefixManager.compact(e)??ie.localName(e):Fr(ie.localName(e))}resolveTypeLabel(e){return this._mode==="strict"?this._prefixManager.compact(e)??ie.localName(e):Fr(ie.localName(e))}resolvePredicateLabel(e){return this.resolveUri(e)}updateLabels(e,n){for(const r of e.values())r.label=this.resolveNodeLabel(r);for(const r of n.values())r.label=this.resolveEdgeLabel(r)}};function Fr(e){if(!e)return"";let n=e.replace(/_/g," ");return n=n.replace(/([a-z])([A-Z])/g,"$1 $2"),n=n.replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2"),n.length>4&&(n=n.toLowerCase()),n.trim()}var ph={"https://schema.org/":"#8b5cf6","http://www.w3.org/ns/prov#":"#3b82f6","http://xmlns.com/foaf/0.1/":"#10b981","http://purl.org/dc/terms/":"#f59e0b"},gh=class{constructor(e,n,r){P(this,"_config");P(this,"_prefixManager");P(this,"_palette");P(this,"_hasExplicitDefaultNodeColor");P(this,"_hasExplicitDefaultEdgeColor");this._prefixManager=n,this._palette=r??$e,this._hasExplicitDefaultNodeColor=(e==null?void 0:e.defaultNodeColor)!==void 0,this._hasExplicitDefaultEdgeColor=(e==null?void 0:e.defaultEdgeColor)!==void 0,this._config={nodeColors:(e==null?void 0:e.nodeColors)??{},classColors:(e==null?void 0:e.classColors)??{},namespaceColors:(e==null?void 0:e.namespaceColors)??{},predicateColors:(e==null?void 0:e.predicateColors)??{},gradient:(e==null?void 0:e.gradient)??!0,gradientIntensity:(e==null?void 0:e.gradientIntensity)??.3,defaultNodeColor:(e==null?void 0:e.defaultNodeColor)??this._palette.primary,defaultEdgeColor:(e==null?void 0:e.defaultEdgeColor)??this._palette.edgeColor,edgeWidth:(e==null?void 0:e.edgeWidth)??1.5,edgeArrowSize:(e==null?void 0:e.edgeArrowSize)??4,borderWidth:(e==null?void 0:e.borderWidth)??1.5,fontFamily:(e==null?void 0:e.fontFamily)??"system-ui, -apple-system, sans-serif",fontSize:(e==null?void 0:e.fontSize)??11}}get palette(){return this._palette}setPalette(e){this._palette=e,this._config={...this._config},this._hasExplicitDefaultNodeColor||(this._config.defaultNodeColor=e.primary),this._hasExplicitDefaultEdgeColor||(this._config.defaultEdgeColor=e.edgeColor)}get config(){return this._config}setNodeColors(e){this._config={...this._config,nodeColors:{...this._config.nodeColors,...e}}}getNodeColor(e){const n=this._config.nodeColors[e.id];if(n)return n;for(const r of e.types){const i=this._prefixManager.compact(r);if(i&&this._config.classColors[i])return this._config.classColors[i];if(this._config.classColors[r])return this._config.classColors[r]}for(const r of e.types){for(const[i,o]of Object.entries(this._config.namespaceColors)){const a=this._prefixManager.getNamespace(i)??i;if(r.startsWith(a))return o}for(const[i,o]of Object.entries(ph))if(r.startsWith(i))return o}return this._config.defaultNodeColor}getEdgeColor(e){const n=this._prefixManager.compact(e.predicate);return n&&this._config.predicateColors[n]?this._config.predicateColors[n]:this._config.predicateColors[e.predicate]?this._config.predicateColors[e.predicate]:this._config.defaultEdgeColor}getBorderColor(e){return jr(e,.3)}getGradientCenter(e){return jr(e,this._config.gradientIntensity)}};function jr(e,n){const r=_h(e);if(!r)return e;const i=Math.round(r.r+(255-r.r)*n),o=Math.round(r.g+(255-r.g)*n),a=Math.round(r.b+(255-r.b)*n);return`#${((1<<24)+(i<<16)+(o<<8)+a).toString(16).slice(1)}`}function _h(e){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}var vh={baseSize:36,minSize:24,maxSize:72,scaleWithDegree:!0,imagePredicates:["https://schema.org/image","http://xmlns.com/foaf/0.1/img","http://xmlns.com/foaf/0.1/depiction"],imageUrlPredicate:"https://schema.org/url",circleTypes:[]},be=new Map,yh=class{constructor(e,n,r){P(this,"_config");P(this,"_styleEngine");P(this,"_maxDegree",1);P(this,"_circleTypeSet");P(this,"_onImageLoad",null);P(this,"_trustStyle","none");P(this,"_showBadges",!0);this._config={...vh,...e},this._styleEngine=n,this._circleTypeSet=new Set;for(const i of this._config.circleTypes)this._circleTypeSet.add(i),r&&this._circleTypeSet.add(r.expand(i))}isCircleNode(e){return this._circleTypeSet.size===0?!1:e.types.some(n=>this._circleTypeSet.has(n))}setImageLoadCallback(e){this._onImageLoad=e}setMaxDegree(e){this._maxDegree=Math.max(1,e)}setTrustStyle(e){this._trustStyle=e}setShowBadges(e){this._showBadges=e}getRadius(e){if(this.isCircleNode(e)){if(!this._config.scaleWithDegree)return this._config.minSize*.7;const s=e.degree/this._maxDegree,l=this._config.maxSize*.6-this._config.minSize*.7;return this._config.minSize*.7+s*l}const n=e.sizeMultiplier??(e.isHighRisk?2:1),r=e.imageUrl?Math.max(this._config.maxSize*.6,8):0;if(!this._config.scaleWithDegree)return Math.max(this._config.baseSize,r)*n;const i=e.degree/this._maxDegree,o=this._config.maxSize-this._config.minSize,a=this._config.minSize+i*o;return Math.max(a,r)*n}paint(e,n,r,i,o,a=1){var _,b;if(this.isCircleNode(n))return this.paintCircle(e,n,r,i,o);const l=this.getRadius(n)*a,u=this._styleEngine.getNodeColor(n),c=this._styleEngine.palette,h=this._styleEngine.config;if(e.save(),a>1.03&&n.isHighRisk){const y=l*1.25,g=(a-1)*2.5;e.beginPath();for(let w=0;w<6;w++){const x=Math.PI/3*w,m=r+y*Math.cos(x),v=i+y*Math.sin(x);w===0?e.moveTo(m,v):e.lineTo(m,v)}e.closePath(),e.fillStyle=`rgba(220, 50, 50, ${Math.min(.4,g)})`,e.fill()}e.beginPath();for(let y=0;y<6;y++){const g=Math.PI/3*y,w=r+l*Math.cos(g),x=i+l*Math.sin(g);y===0?e.moveTo(w,x):e.lineTo(w,x)}if(e.closePath(),h.gradient){const y=e.createRadialGradient(r,i,0,r,i,l);y.addColorStop(0,this._styleEngine.getGradientCenter(u)),y.addColorStop(1,u),e.fillStyle=y}else e.fillStyle=u;e.fill();const f=((b=(_=n.provenance)==null?void 0:_.sources)==null?void 0:b.length)??0;if(f>=2&&this._trustStyle==="glow"&&(e.shadowColor=c.info,e.shadowBlur=Math.min(12,f*3)/o,e.fill(),e.shadowBlur=0,e.shadowColor="transparent"),n.riskScore&&n.riskScore>0){const y=Math.min(1,n.riskScore);e.strokeStyle=`rgba(220, 50, 50, ${.5+y*.5})`,e.lineWidth=(h.borderWidth+(n.isHighRisk?1.5:.5))/o}else f>=2&&this._trustStyle==="border"?(e.strokeStyle=c.info,e.lineWidth=(h.borderWidth+Math.min(3,f))/o):(e.strokeStyle=this._styleEngine.getBorderColor(u),e.lineWidth=h.borderWidth/o);n.isBoundary&&!(n.riskScore&&n.riskScore>0)&&(e.strokeStyle=bh(u,.5),e.lineWidth=(h.borderWidth+1)/o),e.stroke(),e.setLineDash([]),f<2&&this._trustStyle==="opacity"&&(e.globalAlpha=.7),n.imageUrl&&this.paintAvatar(e,n.imageUrl,r,i,l),e.globalAlpha=1,o>3&&this._paintBadges(e,n,r,i,l,o);const d=.3,p=.8;if(o>d){const y=Math.min(1,(o-d)/(p-d)),g=h.fontSize/o;e.font=`${g}px ${h.fontFamily}`,e.textAlign="center",e.textBaseline="top",e.globalAlpha=y,e.fillStyle=c.textPrimary,e.fillText(mh(n.label,24),r,i+l+2/o),e.globalAlpha=1}return e.restore(),l}_paintBadges(e,n,r,i,o,a){if(!this._showBadges)return;const s=n.provenance;if(!s)return;const l=this._styleEngine.palette,u=Math.max(4,8/a);if(s.sources.length>0){const c=r+o*.7,h=i+o*.6,f=s.sources.length;e.beginPath(),e.arc(c,h,u,0,2*Math.PI);const d=Math.min(1,f/3);e.fillStyle=f>=2?l.info:l.textMuted,e.globalAlpha=.4+d*.6,e.fill(),u>3&&(e.fillStyle="#fff",e.globalAlpha=1,e.font=`bold ${u*1.2}px system-ui`,e.textAlign="center",e.textBaseline="middle",e.fillText(String(f),c,h))}if(s.contentHash||s.blockchainAnchor){const c=r+o*.7,h=i-o*.6;e.beginPath(),e.arc(c,h,u,0,2*Math.PI),e.fillStyle=s.blockchainAnchor?l.safe:l.info,e.globalAlpha=.85,e.fill(),e.globalAlpha=1,e.strokeStyle="#fff",e.lineWidth=u*.3,e.lineCap="round",e.lineJoin="round",e.beginPath();const f=u*.5;e.moveTo(c-f*.5,h),e.lineTo(c-f*.1,h+f*.4),e.lineTo(c+f*.5,h-f*.3),e.stroke()}e.globalAlpha=1}paintCircle(e,n,r,i,o){const a=this.getRadius(n),s=this._styleEngine.getNodeColor(n);return e.beginPath(),e.arc(r,i,a,0,2*Math.PI),e.fillStyle=s,e.fill(),a}paintAvatar(e,n,r,i,o){let a=be.get(n);if(a===void 0){const d=new Image;n.startsWith("data:")||(d.crossOrigin="anonymous"),be.set(n,null),d.src=n,d.onload=()=>{var p;be.set(n,d),(p=this._onImageLoad)==null||p.call(this)},d.onerror=()=>{be.delete(n)};return}if(!a)return;e.save(),e.beginPath();for(let d=0;d<6;d++){const p=Math.PI/3*d,_=r+o*Math.cos(p),b=i+o*Math.sin(p);d===0?e.moveTo(_,b):e.lineTo(_,b)}e.closePath(),e.clip();const s=a.naturalWidth/a.naturalHeight,u=n.startsWith("data:")?.5:1;let c,h;const f=o*2*u;s>1?(h=f,c=f*s):(c=f,h=f/s),e.globalAlpha=.95,e.drawImage(a,r-c/2,i-h/2,c,h),e.globalAlpha=1,e.restore()}resolveImageUrl(e,n,r){for(const i of this._config.imagePredicates){const o=e.properties.get(i);if(o&&o.length>0){const a=o[0].value;if(a.startsWith("http://")||a.startsWith("https://"))return a}}if(r){const i=r(e.id);for(const o of this._config.imagePredicates)for(const a of i){if(a.predicate!==o)continue;const s=n(a.target);if(!s)continue;const l=s.properties.get(this._config.imageUrlPredicate);if(l&&l.length>0){const u=l[0].value;if(u.startsWith("http://")||u.startsWith("https://"))return u}for(const u of this._config.imagePredicates){const c=s.properties.get(u);if(c&&c.length>0){const h=c[0].value;if(h.startsWith("http://")||h.startsWith("https://"))return h}}}}return null}};function mh(e,n){if(e.length<=n)return e;if(e.includes("/")){const i=e.split("/"),o=i[0],a=i[i.length-1],s=`${o}/…/${a}`;if(i.length>=3&&s.length<=n)return s;if(a.length<=n-2)return`…/${a}`}const r=/^(#\d+)\s+(.+)$/.exec(e);if(r){const i=r[1],o=r[2],a=n-i.length-2;if(a>4)return`${i} ${o.slice(0,a)}…`}return e.slice(0,n-1)+"…"}function bh(e,n){const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!r)return e;const i=Math.round(parseInt(r[1],16)+(255-parseInt(r[1],16))*n),o=Math.round(parseInt(r[2],16)+(255-parseInt(r[2],16))*n),a=Math.round(parseInt(r[3],16)+(255-parseInt(r[3],16))*n);return`#${((1<<24)+(i<<16)+(o<<8)+a).toString(16).slice(1)}`}var wh={focalNode:null,hops:2,maxNodes:200,expandOnClick:!0},$r=class{constructor(e){P(this,"_config");P(this,"_visibleNodes",new Set);P(this,"_focalNode",null);P(this,"_enabled",!1);this._config={...wh,...e},this._focalNode=this._config.focalNode??null}get focalNode(){return this._focalNode}get enabled(){return this._enabled}get visibleNodeIds(){return this._visibleNodes}compute(e){if(e.nodes.size<=this._config.maxNodes){this._enabled=!1;for(const o of e.nodes.values())o.isBoundary=!1;return{nodes:e.nodes,edges:e.edges}}if(this._enabled=!0,!this._focalNode){const o=e.getHighestDegreeNode();this._focalNode=(o==null?void 0:o.id)??null}if(!this._focalNode)return{nodes:new Map,edges:new Map};this._visibleNodes.clear();const n=[{id:this._focalNode,depth:0}];for(this._visibleNodes.add(this._focalNode);n.length>0&&this._visibleNodes.size<this._config.maxNodes;){const o=n.shift();if(o.depth>=this._config.hops)continue;const a=e.getNeighborIds(o.id);for(const s of a){if(this._visibleNodes.size>=this._config.maxNodes)break;this._visibleNodes.has(s)||(this._visibleNodes.add(s),n.push({id:s,depth:o.depth+1}))}}const r=new Map,i=new Map;for(const o of this._visibleNodes){const a=e.getNode(o);if(a){const s=e.getNeighborIds(o);a.isBoundary=!1;for(const l of s)if(!this._visibleNodes.has(l)){a.isBoundary=!0;break}r.set(o,a)}}for(const o of e.edges.values())this._visibleNodes.has(o.source)&&this._visibleNodes.has(o.target)&&i.set(o.id,o);return{nodes:r,edges:i}}setFocus(e){this._focalNode=e}expandNode(e,n){const r=n.getNeighborIds(e);for(const i of r)this._visibleNodes.add(i)}disable(){this._enabled=!1,this._visibleNodes.clear()}enable(e){this._enabled=!0,e&&(this._focalNode=e)}},xh={statementType:"http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement",subjectPredicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#subject",predicatePredicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate",objectPredicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#object"},Lr={enabled:!1,patterns:[xh]},kh=class{constructor(e){P(this,"_config");this._config={enabled:(e==null?void 0:e.enabled)??Lr.enabled,patterns:(e==null?void 0:e.patterns)??Lr.patterns}}get enabled(){return this._config.enabled}collapse(e){if(!this._config.enabled)return new Set;const n=new Set,r=this.detectStatements(e);for(const i of r){if(!i.reifiedSubject)continue;const o=e.getNode(i.reifiedSubject);if(o){if(i.reifiedPredicate&&i.annotations.length>0){const a=i.annotations.map(u=>({predicate:u.predicate,value:u.value,datatype:u.datatype})),s=o.properties.get(i.reifiedPredicate);if(s){for(const u of s)if(i.reifiedObject&&u.value===i.reifiedObject){u.annotations=[...u.annotations??[],...a];break}s.length>0&&!s.some(u=>{var c;return(c=u.annotations)==null?void 0:c.length})&&(s[0].annotations=[...s[0].annotations??[],...a])}const l=o.metadata.get(i.reifiedPredicate);l&&l.length>0&&(l[0].annotations=[...l[0].annotations??[],...a])}n.add(i.statementNodeId)}}return n}detectStatements(e){const n=[];for(const r of this._config.patterns)for(const i of e.nodes.values()){if(!i.types.includes(r.statementType))continue;const o={statementNodeId:i.id,reifiedSubject:null,reifiedPredicate:null,reifiedObject:null,annotations:[]},a=e.getEdgesFrom(i.id);for(const l of a)l.predicate===r.subjectPredicate?o.reifiedSubject=l.target:l.predicate===r.predicatePredicate?o.reifiedPredicate=l.target:l.predicate===r.objectPredicate&&(o.reifiedObject=l.target);for(const[l,u]of i.properties)l===r.objectPredicate&&u.length>0&&(o.reifiedObject=u[0].value);for(const[l,u]of i.metadata)u.length!==0&&(!o.reifiedSubject&&l===r.subjectPredicate?o.reifiedSubject=u[0].value:!o.reifiedPredicate&&l===r.predicatePredicate?o.reifiedPredicate=u[0].value:!o.reifiedObject&&l===r.objectPredicate&&(o.reifiedObject=u[0].value));const s=new Set([r.subjectPredicate,r.predicatePredicate,r.objectPredicate]);for(const[l,u]of i.properties)if(!s.has(l))for(const c of u)o.annotations.push({predicate:l,value:c.value,datatype:c.datatype});for(const[l,u]of i.metadata)for(const c of u)o.annotations.push({predicate:l,value:c.value,datatype:c.datatype});n.push(o)}return n}},Sh=["http://www.w3.org/ns/prov#wasGeneratedBy","http://www.w3.org/ns/prov#wasAttributedTo","http://www.w3.org/ns/prov#wasDerivedFrom","http://www.w3.org/ns/prov#startedAtTime","http://www.w3.org/ns/prov#endedAtTime","http://www.w3.org/ns/prov#generatedAtTime","http://www.w3.org/ns/prov#wasStartedBy","http://www.w3.org/ns/prov#wasEndedBy","http://purl.org/dc/terms/created","http://purl.org/dc/terms/modified","http://purl.org/dc/terms/source","http://purl.org/dc/terms/creator","http://purl.org/dc/terms/publisher","http://www.w3.org/2002/07/owl#versionInfo"],Ch=class{constructor(e){P(this,"_predicates");this._predicates=new Set([...Sh,...(e==null?void 0:e.predicates)??[]])}get predicates(){return[...this._predicates]}isMetadata(e){return this._predicates.has(e)}addPredicates(e){for(const n of e)this._predicates.add(n)}},Mh=class{constructor(){P(this,"_handlers",new Map)}on(e,n){let r=this._handlers.get(e);return r||(r=new Set,this._handlers.set(e,r)),r.add(n),()=>{r.delete(n)}}off(e,n){const r=this._handlers.get(e);r&&r.delete(n)}emit(e,n){const r=this._handlers.get(e);if(r)for(const i of r)try{i(n)}catch(o){console.error(`[dkg-graph-viz] Error in ${e} handler:`,o)}}removeAll(e){e?this._handlers.delete(e):this._handlers.clear()}},Ur=class{constructor(e){P(this,"_container");P(this,"_graph",null);P(this,"_hexPainter");P(this,"_styleEngine");P(this,"_events");P(this,"_currentNodes",new Map);P(this,"_positionCache",new Map);P(this,"_currentLinks",[]);P(this,"_repaintPending",!1);P(this,"_riskPulseEnabled",!1);P(this,"_hoverTraceEnabled",!1);P(this,"_hoveredNodeId",null);P(this,"_fadeInEnabled",!1);P(this,"_loadTime",0);P(this,"_fadeInDuration",1500);P(this,"_animFrameId",null);P(this,"_initialFitDone",!1);P(this,"_autoFitDisabled",!1);P(this,"_lastTopologyKey","");P(this,"_continuousSimulation",!1);P(this,"_fitTimeoutId",null);P(this,"_kaGroups",new Map);P(this,"_kaEnabled",!1);P(this,"_kaBoundaryOpacity",.06);this._container=e.container,this._hexPainter=e.hexPainter,this._styleEngine=e.styleEngine,this._events=e.events}_setAlphaTarget(e){var r;const n=(r=this._graph)==null?void 0:r.d3AlphaTarget;typeof n=="function"&&n.call(this._graph,e)}init(){var s;if(this._graph)return;const e=this._styleEngine.config,n=this._container.clientWidth||this._container.offsetWidth||800,r=this._container.clientHeight||this._container.offsetHeight||600;this._hexPainter.setImageLoadCallback(()=>{this._scheduleRepaint()}),this._graph=Kf()(this._container).width(n).height(r).backgroundColor("transparent").nodeCanvasObjectMode(l=>{var c;const u=l;return(c=u._graphNode)!=null&&c.sizeMultiplier&&u._graphNode.sizeMultiplier>1?"after":"replace"}).nodeCanvasObject((l,u,c)=>{const h=l;if(!h._graphNode)return;const f=h.x??0,d=h.y??0;if(this._fadeInEnabled&&this._loadTime>0){const _=performance.now()-this._loadTime;if(_<this._fadeInDuration){const b=_/this._fadeInDuration,y=1-Math.pow(1-b,3);u.globalAlpha=y}}let p=1;if(this._riskPulseEnabled&&h._graphNode.isHighRisk){const _=performance.now()/1e3,b=nn(h._graphNode.id);p=1+.15*Math.sin(_*1.25+b)}this._hexPainter.paint(u,h._graphNode,f,d,c,p),u.globalAlpha=1}).nodePointerAreaPaint((l,u,c)=>{const h=l;if(!h._graphNode)return;const d=this._hexPainter.getRadius(h._graphNode)+6,p=h.x??0,_=h.y??0;c.beginPath(),c.arc(p,_,d,0,Math.PI*2),c.fillStyle=u,c.fill()}).linkColor(l=>{const u=l;return u._graphEdge?this._styleEngine.getEdgeColor(u._graphEdge):e.defaultEdgeColor}).linkWidth(e.edgeWidth).linkDirectionalArrowLength(e.edgeArrowSize).linkDirectionalArrowRelPos(1).linkCanvasObjectMode(()=>"after").linkCanvasObject((l,u,c)=>{if(c<.3)return;const h=l;if(!h._graphEdge)return;const f=h._graphEdge.label;if(!f)return;const d=.3,_=Math.min(1,(c-d)/(.8-d)),b=12/c,y=h.source,g=h.target;if(!y.x||!g.x)return;const w=(y.x+g.x)/2,x=(y.y+g.y)/2;u.save(),u.globalAlpha=_,u.font=`${b}px ${e.fontFamily}`,u.textAlign="center",u.textBaseline="middle";const m=u.measureText(f).width,v=2/c;u.fillStyle="rgba(15, 23, 42, 0.75)",u.beginPath(),u.roundRect(w-m/2-v,x-b/2-v,m+v*2,b+v*2,2/c),u.fill(),u.fillStyle="#94a3b8",u.fillText(f,w,x),u.restore()}).onRenderFramePre((l,u)=>{this._drawKaBoundaries(l)}).onNodeClick(l=>{const u=l;u._graphNode&&this._events.emit("node:click",u._graphNode)}).onNodeDrag(l=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeDragEnd(l=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeHover(l=>{const u=l;u!=null&&u._graphNode?(this._hoveredNodeId=u._graphNode.id,this._events.emit("node:hover",u._graphNode),this._container.style.cursor="pointer"):(this._hoveredNodeId=null,this._events.emit("node:unhover",null),this._container.style.cursor="default")}).onLinkClick(l=>{const u=l;u._graphEdge&&this._events.emit("edge:click",u._graphEdge)}).onBackgroundClick(l=>{this._events.emit("background:click",{x:0,y:0})}).cooldownTicks(200).d3AlphaDecay(.02).d3VelocityDecay(.3).warmupTicks(60).onEngineStop(()=>{!this._autoFitDisabled&&!this._initialFitDone&&this._graph&&(this._initialFitDone=!0,this._graph.zoomToFit(400,40))});const i=this._graph.d3Force("charge");i!=null&&i.strength&&(i.strength(-150),(s=i.distanceMax)==null||s.call(i,1e3));const o=this._graph.d3Force("link");o!=null&&o.distance&&o.distance(80).strength(.2);const a=this._graph.d3Force("center");a!=null&&a.strength&&a.strength(.03)}render(e,n,r){var y;this._graph||this.init();let i=0;const o=[...e.keys()].sort();for(const g of o)i=i*31+nn(g)|0;const a=[];for(const g of n.values())a.push(`${g.source}\0${g.target}`);a.sort();for(const g of a)i=i*31+nn(g)|0;const s=String(i);s!==this._lastTopologyKey&&(this._lastTopologyKey=s,this._initialFitDone=!1),this._loadTime===0&&(this._loadTime=performance.now());let l=1;for(const g of e.values())g.degree>l&&(l=g.degree);this._hexPainter.setMaxDegree(l);const u=["http://schema.org/dateCreated","https://schema.org/dateCreated"],c=new Map;for(const[g,w]of e)for(const x of u){const m=(y=w.properties)==null?void 0:y.get(x);if(m&&m.length>0){const v=new Date(m[0].value);if(!isNaN(v.getTime())){c.set(g,v.getTime());break}}}let h=null;if(c.size>=2){const g=[...c.values()],w=Math.min(...g),m=Math.max(...g)-w||1,v=Math.max(400,c.size*120);h=new Map;for(const[S,k]of c)h.set(S,((k-w)/m-.5)*v)}const f=new Map;for(const[g,w]of e){if(r!=null&&r.has(g))continue;const x=this._currentNodes.get(g),m=this._positionCache.get(g),v=h==null?void 0:h.get(g);f.set(g,{id:g,x:(x==null?void 0:x.x)??(m==null?void 0:m.x)??v??(Math.random()-.5)*800,y:(x==null?void 0:x.y)??(m==null?void 0:m.y)??(Math.random()-.5)*400,vx:(x==null?void 0:x.vx)??(m==null?void 0:m.vx),vy:(x==null?void 0:x.vy)??(m==null?void 0:m.vy),fx:typeof(x==null?void 0:x.fx)=="number"?x.fx:typeof(m==null?void 0:m.fx)=="number"?m.fx:void 0,fy:typeof(x==null?void 0:x.fy)=="number"?x.fy:typeof(m==null?void 0:m.fy)=="number"?m.fy:void 0,_graphNode:w})}const d=new Set(f.keys()),p=[];for(const g of n.values())r!=null&&r.has(g.source)||r!=null&&r.has(g.target)||!d.has(g.source)||!d.has(g.target)||p.push({source:g.source,target:g.target,_graphEdge:g});this._currentNodes=f,this._currentLinks=p;const _=new Map;for(const[g,w]of f)_.set(g,{x:w.x,y:w.y,vx:w.vx,vy:w.vy,fx:typeof w.fx=="number"?w.fx:void 0,fy:typeof w.fy=="number"?w.fy:void 0});this._positionCache=_;const b=[...f.values()].sort((g,w)=>{var v,S,k,M;const x=(v=g._graphNode)!=null&&v.sizeMultiplier&&g._graphNode.sizeMultiplier>1?100:(S=g._graphNode)!=null&&S.isHighRisk?10:0,m=(k=w._graphNode)!=null&&k.sizeMultiplier&&w._graphNode.sizeMultiplier>1?100:(M=w._graphNode)!=null&&M.isHighRisk?10:0;return x-m});this._graph.graphData({nodes:b,links:p}),!this._autoFitDisabled&&!this._initialFitDone&&(this._fitTimeoutId!==null&&clearTimeout(this._fitTimeoutId),this._fitTimeoutId=setTimeout(()=>{this._graph&&!this._autoFitDisabled&&!this._initialFitDone&&(this._initialFitDone=!0,this._graph.zoomToFit(400,40)),this._fitTimeoutId=null},300)),h&&h.size>=2?this._graph.d3Force("chronoX",g=>{for(const w of b){const x=h.get(w.id);x!==void 0&&w.fx==null&&(w.vx=(w.vx??0)+(x-(w.x??0))*.05*g)}}):this._graph.d3Force("chronoX",null)}centerOnNode(e,n=350,r){const i=this._currentNodes.get(e);i&&this._graph&&(this._graph.centerAt(i.x,i.y,n),r!=null&&this._graph.zoom(r,n))}zoomToFit(e=40,n=500){var r;(r=this._graph)==null||r.zoomToFit(n,e)}set autoFitDisabled(e){this._autoFitDisabled=e}getCanvas(){return this._graph?this._container.querySelector("canvas")??null:null}refresh(){if(!this._graph)return;const e=this._graph.refresh;if(typeof e=="function"){e.call(this._graph);return}this._scheduleRepaint()}_scheduleRepaint(){this._repaintPending||(this._repaintPending=!0,requestAnimationFrame(()=>{if(this._repaintPending=!1,!!this._graph)if(this._continuousSimulation||this._riskPulseEnabled)try{this._graph.d3ReheatSimulation()}catch{}else{this._graph.cooldownTicks(3);try{this._graph.d3ReheatSimulation()}catch{}this._setAlphaTarget(0),setTimeout(()=>{this._graph&&!this._continuousSimulation&&!this._riskPulseEnabled&&(this._graph.cooldownTicks(0),this._setAlphaTarget(0))},60)}}))}_stopAnimLoop(){this._animFrameId!==null&&(cancelAnimationFrame(this._animFrameId),this._animFrameId=null)}setKaGroups(e,n,r=.06){this._kaGroups=e,this._kaEnabled=n,this._kaBoundaryOpacity=r}_drawKaBoundaries(e){if(!this._kaEnabled||this._kaGroups.size===0)return;const n=this._styleEngine.palette;let r=0;for(const[i,o]of this._kaGroups){const a=[];for(const h of o){const f=this._currentNodes.get(h);f&&f.x!==void 0&&f.y!==void 0&&a.push([f.x,f.y])}if(a.length<3)continue;const s=Ah(a);if(s.length<3)continue;const l=n.nodeColors[r%n.nodeColors.length];r++,e.save(),e.beginPath();const u=s.reduce((h,f)=>h+f[0],0)/s.length,c=s.reduce((h,f)=>h+f[1],0)/s.length;for(let h=0;h<s.length;h++){const f=s[h][0]-u,d=s[h][1]-c,p=Math.sqrt(f*f+d*d),_=30,b=s[h][0]+(p>0?f/p*_:0),y=s[h][1]+(p>0?d/p*_:0);h===0?e.moveTo(b,y):e.lineTo(b,y)}e.closePath(),e.fillStyle=l,e.globalAlpha=this._kaBoundaryOpacity,e.fill(),e.strokeStyle=l,e.globalAlpha=this._kaBoundaryOpacity*2.5,e.lineWidth=1,e.stroke(),e.restore()}}resize(){this._graph&&(this._graph.width(this._container.clientWidth),this._graph.height(this._container.clientHeight))}destroy(){this._stopAnimLoop(),this._fitTimeoutId!==null&&(clearTimeout(this._fitTimeoutId),this._fitTimeoutId=null),this._graph&&(this._graph._destructor(),this._graph=null),this._currentNodes.clear(),this._positionCache.clear(),this._currentLinks=[]}applyAnimation(e){if(!this._graph)return;this._riskPulseEnabled=e.riskPulse??!1,this._fadeInEnabled=e.fadeIn??!1,this._hoverTraceEnabled=e.hoverTrace??!1;const n=e.linkParticleSpeed??.005,r=e.linkParticleColor??"rgba(100,150,255,0.6)",i=e.linkParticleWidth??1.5;if(e.linkParticles||e.hoverTrace){const a=e.linkParticleCount??1;this._hoverTraceEnabled?this._graph.linkDirectionalParticles(s=>{if(!this._hoveredNodeId)return e.linkParticles?a:0;const l=s,u=typeof l.source=="object"?l.source.id:l.source,c=typeof l.target=="object"?l.target.id:l.target;return u===this._hoveredNodeId||c===this._hoveredNodeId?4:e.linkParticles?a:0}).linkDirectionalParticleSpeed(s=>{if(!this._hoveredNodeId)return n;const l=s,u=typeof l.source=="object"?l.source.id:l.source,c=typeof l.target=="object"?l.target.id:l.target;return u===this._hoveredNodeId||c===this._hoveredNodeId?.02:n}).linkDirectionalParticleWidth(s=>{if(!this._hoveredNodeId)return i;const l=s,u=typeof l.source=="object"?l.source.id:l.source,c=typeof l.target=="object"?l.target.id:l.target;return u===this._hoveredNodeId||c===this._hoveredNodeId?3:i}).linkDirectionalParticleColor(s=>{if(!this._hoveredNodeId)return r;const l=s,u=typeof l.source=="object"?l.source.id:l.source,c=typeof l.target=="object"?l.target.id:l.target;return u===this._hoveredNodeId||c===this._hoveredNodeId?"#60a0ff":r}):this._graph.linkDirectionalParticles(a).linkDirectionalParticleSpeed(n).linkDirectionalParticleWidth(i).linkDirectionalParticleColor(()=>r)}else this._graph.linkDirectionalParticles(0);const o=e.drift||this._riskPulseEnabled;if(this._continuousSimulation=o,o?(this._graph.cooldownTicks(1/0),this._setAlphaTarget(e.driftAlpha??.008),!this._autoFitDisabled&&!this._initialFitDone&&(this._fitTimeoutId!==null&&clearTimeout(this._fitTimeoutId),this._fitTimeoutId=setTimeout(()=>{this._graph&&!this._autoFitDisabled&&!this._initialFitDone&&(this._initialFitDone=!0,this._graph.zoomToFit(400,40)),this._fitTimeoutId=null},300))):(this._graph.cooldownTicks(120),this._setAlphaTarget(0)),this._stopAnimLoop(),this._riskPulseEnabled&&!e.drift){const a=()=>{if(!this._riskPulseEnabled||!this._graph){this._animFrameId=null;return}try{this._graph.d3ReheatSimulation()}catch{}this._animFrameId=requestAnimationFrame(a)};this._animFrameId=requestAnimationFrame(a)}}applyPalette(e){this._graph&&this._graph.backgroundColor(e.background==="#0a0a0f"?"transparent":e.background)}};function nn(e){let n=0;for(let r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r)|0;return n}function Ah(e){if(e.length<3)return e;const n=[...e].sort((a,s)=>a[0]-s[0]||a[1]-s[1]),r=(a,s,l)=>(s[0]-a[0])*(l[1]-a[1])-(s[1]-a[1])*(l[0]-a[0]),i=[];for(const a of n){for(;i.length>=2&&r(i[i.length-2],i[i.length-1],a)<=0;)i.pop();i.push(a)}const o=[];for(let a=n.length-1;a>=0;a--){const s=n[a];for(;o.length>=2&&r(o[o.length-2],o[o.length-1],s)<=0;)o.pop();o.push(s)}return i.pop(),o.pop(),i.concat(o)}var Ph=class{constructor(e,n={}){P(this,"_model");P(this,"_prefixManager");P(this,"_labelResolver");P(this,"_styleEngine");P(this,"_hexPainter");P(this,"_focusFilter");P(this,"_reificationCollapser");P(this,"_metadataExtractor");P(this,"_events");P(this,"_renderer");P(this,"_config");P(this,"_collapsedNodeIds",new Set);P(this,"_rendererReady");P(this,"_container");P(this,"_temporalFilter");P(this,"_timelineOverlay",null);P(this,"_renderQueued",!1);P(this,"_autoFitDisabled",!1);P(this,"_highlightState",new Map);this._config=n,this._container=e,this._metadataExtractor=new Ch(n.metadata),this._model=new ch(this._metadataExtractor.predicates),this._prefixManager=new ie(n.prefixes),this._labelResolver=new dh(n.labelMode??"humanized",this._prefixManager,n.labels),this._styleEngine=new gh(n.style,this._prefixManager),this._hexPainter=new yh(n.hexagon,this._styleEngine,this._prefixManager),this._focusFilter=new $r(n.focus),this._reificationCollapser=new kh(n.reification),this._temporalFilter=new Ir,this._events=new Mh;const r={container:e,hexPainter:this._hexPainter,styleEngine:this._styleEngine,events:this._events};if(n.renderer==="3d"){let i;this._rendererReady=new Promise(o=>{i=o}),this._renderer=null,qt(async()=>{const{WebGL3DRenderer:o}=await import("./renderer-3d-2EVDZII7-DwK8fIlO.js");return{WebGL3DRenderer:o}},__vite__mapDeps([0,1,2])).then(({WebGL3DRenderer:o})=>{this._renderer=new o(r),i()}).catch(o=>{console.warn("[dkg-graph-viz] 3D renderer not available, falling back to 2D:",o.message),this._renderer=new Ur(r),i()})}else this._renderer=new Ur(r),this._rendererReady=Promise.resolve();n.autoFitDisabled&&(this._autoFitDisabled=!0,this._renderer?this._renderer.autoFitDisabled=!0:this._rendererReady.then(()=>{this._renderer&&(this._renderer.autoFitDisabled=!0)})),typeof ResizeObserver<"u"&&new ResizeObserver(()=>{var o;return(o=this._renderer)==null?void 0:o.resize()}).observe(e)}async loadNTriples(e){const{parseNTriples:n}=await qt(async()=>{const{parseNTriples:i}=await import("./ntriples-ZWBY2WET-DH7OofPp.js");return{parseNTriples:i}},__vite__mapDeps([3,4])),r=n(e);this._ingest(r)}async loadNQuads(e){const{parseNQuads:n}=await qt(async()=>{const{parseNQuads:i}=await import("./ntriples-ZWBY2WET-DH7OofPp.js");return{parseNQuads:i}},__vite__mapDeps([3,4])),r=n(e);this._ingest(r)}async loadTurtle(e){const{parseTurtle:n}=await qt(async()=>{const{parseTurtle:o}=await import("./turtle-JJPK7LJ5-BzTu0283.js");return{parseTurtle:o}},__vite__mapDeps([5,4])),{triples:r,prefixes:i}=n(e);this._prefixManager.addPrefixes(i),this._ingest(r)}async loadJsonLd(e){const{parseJsonLd:n}=await qt(async()=>{const{parseJsonLd:i}=await import("./jsonld-32FQRO67-C6LUWPog.js");return{parseJsonLd:i}},__vite__mapDeps([6,1,2])),r=await n(e);this._ingest(r)}loadTriples(e){const n=e.map(r=>{if(Array.isArray(r))return{subject:r[0],predicate:r[1],object:r[2]};if("s"in r&&"p"in r&&"o"in r){const i=r;return{subject:i.s,predicate:i.p,object:i.o}}return r});this._ingest(n)}async loadFromSource(e,n){const r=await e.construct(n);this._ingest(r.triples)}async querySource(e,n){return e.select(n)}addTriples(e){const n=this._model.addTriples(e);return this._postIngest(),this._events.emit("data:change",n),n}removeTriples(e){const n=this._model.removeTriples(e);return this._postIngest(),this._events.emit("data:change",n),n}focus(e,n){var r;this._focusFilter.setFocus(e),n!==void 0&&(this._focusFilter=new $r({...this._config.focus,focalNode:e,hops:n})),this._renderCurrent(),(r=this._renderer)==null||r.centerOnNode(e,500,2),this._events.emit("focus:change",{focalNode:e,visibleNodes:this._focusFilter.visibleNodeIds.size})}centerOnNode(e,n){var r;(r=this._renderer)==null||r.centerOnNode(e,n==null?void 0:n.durationMs,n==null?void 0:n.zoomLevel)}expandNode(e){this._focusFilter.expandNode(e,this._model),this._renderCurrent()}showAll(){this._focusFilter.disable(),this._renderCurrent()}get temporalFilter(){return this._temporalFilter}get timelineOverlay(){return this._timelineOverlay}setTimeCursor(e){this._temporalFilter.setCursor(e),this._renderCurrent(),this._events.emit("temporal:change",{cursor:e,visibleCount:this._lastVisibleCount(),totalDated:this._temporalFilter.datedNodeCount})}getDateRange(){return this._temporalFilter.dateRange}playTimeline(){var e;(e=this._timelineOverlay)==null||e.play()}pauseTimeline(){var e;(e=this._timelineOverlay)==null||e.pause()}_lastVisibleCount(){const{nodes:e}=this._focusFilter.compute(this._model),n=this._temporalFilter.getVisibleNodeIds(e.keys());return n?n.size:e.size}zoomToFit(e){var n;(n=this._renderer)==null||n.zoomToFit(e)}set autoFitDisabled(e){this._autoFitDisabled=e,this._renderer?this._renderer.autoFitDisabled=e:this._rendererReady.then(()=>{this._renderer&&(this._renderer.autoFitDisabled=e)})}get labelMode(){return this._labelResolver.mode}setLabelMode(e){this._labelResolver.mode=e,this._labelResolver.updateLabels(this._model.nodes,this._model.edges),this._renderCurrent()}on(e,n){return this._events.on(e,n)}off(e,n){this._events.off(e,n)}getNode(e){return this._model.getNode(e)}getEdgesFrom(e){return this._model.getEdgesFrom(e)}getEdgesTo(e){return this._model.getEdgesTo(e)}get model(){return this._model}get styleEngine(){return this._styleEngine}get prefixes(){return this._prefixManager}highlightNodes(e){var r;this.clearHighlight();const n=new Set(e);for(const[i,o]of this._model.nodes)n.has(i)&&(this._highlightState.set(i,{riskScore:o.riskScore,isHighRisk:o.isHighRisk,sizeMultiplier:o.sizeMultiplier}),o.isHighRisk=!0,(!o.sizeMultiplier||o.sizeMultiplier<2)&&(o.sizeMultiplier=2));(r=this._renderer)!=null&&r.refresh?this._renderer.refresh():this._renderCurrent()}clearHighlight(){var e;if(this._highlightState.size!==0){for(const[n,r]of this._highlightState){const i=this._model.nodes.get(n);i&&(i.riskScore=r.riskScore,i.isHighRisk=r.isHighRisk,i.sizeMultiplier=r.sizeMultiplier)}this._highlightState.clear(),(e=this._renderer)!=null&&e.refresh?this._renderer.refresh():this._renderCurrent()}}async exportImage(){const e=this._renderer.getCanvas();if(!e)throw new Error("Cannot export: renderer not initialized or no canvas available");return new Promise((n,r)=>{e.toBlob(i=>{i?n(i):r(new Error("Canvas toBlob returned null"))},"image/png")})}exportTriples(){const e=[];for(const n of this._model.triples){const r=rn(n.subject),i=rn(n.predicate);if(n.datatype||n.language||!Th(n.object)){let o=`"${Eh(n.object)}"`;n.language?o+=`@${n.language}`:n.datatype&&(o+=`^^<${n.datatype}>`),e.push(`${r} ${i} ${o} .`)}else e.push(`${r} ${i} ${rn(n.object)} .`)}return e.join(`
|
|
191
|
+
`,document.head.appendChild(e)}},Rr="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function Or(e){const n=e.trim();return!n||n.startsWith('"')?!1:n.startsWith("_:")||n.startsWith("<")&&n.endsWith(">")?!0:/\s/.test(n)?!1:/^[A-Za-z][A-Za-z0-9+.-]*:/.test(n)}function Lt(e){const n=e.trim();return n.startsWith("<")&&n.endsWith(">")?n.slice(1,-1):n}function Dr(e,n,r){return`${e}\0${n}\0${r}`}var ch=class{constructor(e){P(this,"nodes",new Map);P(this,"edges",new Map);P(this,"prefixes",{});P(this,"_triples",[]);P(this,"_metadataPredicates",new Set);P(this,"_outEdges",new Map);P(this,"_inEdges",new Map);P(this,"kaGroups",new Map);P(this,"_kaMembershipPredicate",null);if(e)for(const n of e)this._metadataPredicates.add(n)}get triples(){return this._triples}setKaMembershipPredicate(e){this._kaMembershipPredicate=e}ensureNode(e){let n=this.nodes.get(e);return n||(n={id:e,types:[],label:e,properties:new Map,imageUrl:null,metadata:new Map,degree:0,isBoundary:!1},this.nodes.set(e,n)),n}ensureAdjacency(e){this._outEdges.has(e)||this._outEdges.set(e,new Set),this._inEdges.has(e)||this._inEdges.set(e,new Set)}addTriple(e){const n=Lt(e.subject),r=Lt(e.predicate),i=Or(e.object),o=i?Lt(e.object):e.object;this._triples.push({...e,subject:n,predicate:r,object:o});const a=this.ensureNode(n);if(r===Rr){a.types.includes(o)||a.types.push(o);return}if(i){if(this._metadataPredicates.has(r)){const u={value:o,datatype:e.datatype,language:e.language},c=a.metadata.get(r);c?c.push(u):a.metadata.set(r,[u]);return}const s=this.ensureNode(o),l=Dr(n,r,o);if(this.edges.has(l)||(this.edges.set(l,{id:l,source:n,target:o,predicate:r,label:r}),a.degree++,s.degree++,this.ensureAdjacency(n),this.ensureAdjacency(o),this._outEdges.get(n).add(l),this._inEdges.get(o).add(l)),this._kaMembershipPredicate&&r===this._kaMembershipPredicate){let u=this.kaGroups.get(o);u||(u=new Set,this.kaGroups.set(o,u)),u.add(n)}}else{const s={value:e.object,datatype:e.datatype,language:e.language};if(this._metadataPredicates.has(r)){const l=a.metadata.get(r);l?l.push(s):a.metadata.set(r,[s])}else{const l=a.properties.get(r);l?l.push(s):a.properties.set(r,[s])}}}addTriples(e){const n=new Set(this.nodes.keys()),r=new Set(this.edges.keys());for(const s of e)this.addTriple(s);const i=[],o=[],a=new Set;for(const s of this.nodes.keys())n.has(s)?a.add(s):i.push(s);for(const s of this.edges.keys())r.has(s)||o.push(s);return{addedNodes:i,removedNodes:[],addedEdges:o,removedEdges:[],modifiedNodes:[...a]}}removeTriples(e){var o,a;const n=[],r=new Set;for(const s of e){const l=Lt(s.subject),u=Lt(s.predicate),c=Or(s.object),h=c?Lt(s.object):s.object,f=this._triples.findIndex(d=>d.subject===l&&d.predicate===u&&d.object===h);if(f!==-1&&this._triples.splice(f,1),u===Rr){const d=this.nodes.get(l);d&&(d.types=d.types.filter(p=>p!==h),r.add(l));continue}if(c&&!this._metadataPredicates.has(u)){const d=Dr(l,u,h);if(this.edges.has(d)){this.edges.delete(d),n.push(d),(o=this._outEdges.get(l))==null||o.delete(d),(a=this._inEdges.get(h))==null||a.delete(d);const p=this.nodes.get(l),_=this.nodes.get(h);p&&p.degree--,_&&_.degree--,r.add(l),r.add(h)}}else{const d=this.nodes.get(l);if(d){const p=this._metadataPredicates.has(u)?d.metadata:d.properties,_=p.get(u);if(_){const b=_.filter(y=>y.value!==h);b.length===0?p.delete(u):p.set(u,b),r.add(l)}}}}const i=[];for(const[s,l]of this.nodes)l.degree===0&&l.types.length===0&&l.properties.size===0&&l.metadata.size===0&&(this.nodes.delete(s),this._outEdges.delete(s),this._inEdges.delete(s),i.push(s));return{addedNodes:[],removedNodes:i,addedEdges:[],removedEdges:n,modifiedNodes:[...r]}}getNode(e){return this.nodes.get(e)}getEdgesFrom(e){const n=this._outEdges.get(e);if(!n)return[];const r=[];for(const i of n){const o=this.edges.get(i);o&&r.push(o)}return r}getEdgesTo(e){const n=this._inEdges.get(e);if(!n)return[];const r=[];for(const i of n){const o=this.edges.get(i);o&&r.push(o)}return r}getNeighborIds(e){const n=new Set,r=this._outEdges.get(e);if(r)for(const o of r){const a=this.edges.get(o);a&&n.add(a.target)}const i=this._inEdges.get(e);if(i)for(const o of i){const a=this.edges.get(o);a&&n.add(a.source)}return n}getHighestDegreeNode(){let e=null;for(const n of this.nodes.values())(!e||n.degree>e.degree)&&(e=n);return e}clear(){this.nodes.clear(),this.edges.clear(),this._triples=[],this._outEdges.clear(),this._inEdges.clear()}get tripleCount(){return this._triples.length}},fh={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",owl:"http://www.w3.org/2002/07/owl#",xsd:"http://www.w3.org/2001/XMLSchema#",schema:"https://schema.org/",foaf:"http://xmlns.com/foaf/0.1/",dcterms:"http://purl.org/dc/terms/",dc:"http://purl.org/dc/elements/1.1/",prov:"http://www.w3.org/ns/prov#",skos:"http://www.w3.org/2004/02/skos/core#"},ie=class{constructor(e){P(this,"_prefixes");P(this,"_reverse");this._prefixes=new Map,this._reverse=new Map;for(const[n,r]of Object.entries(fh))this._prefixes.set(n,r),this._reverse.set(r,n);if(e)for(const[n,r]of Object.entries(e))this._prefixes.set(n,r),this._reverse.set(r,n)}addPrefix(e,n){this._prefixes.set(e,n),this._reverse.set(n,e)}addPrefixes(e){for(const[n,r]of Object.entries(e))this.addPrefix(n,r)}getNamespace(e){return this._prefixes.get(e)}getPrefix(e){return this._reverse.get(e)}compact(e){for(const[n,r]of this._reverse)if(e.startsWith(n)){const i=e.slice(n.length);if(i.length>0)return`${r}:${i}`}return null}expand(e){const n=e.indexOf(":");if(n===-1||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("urn:"))return e;const r=e.slice(0,n),i=e.slice(n+1),o=this._prefixes.get(r);return o?o+i:e}static localName(e){const n=e.lastIndexOf("#");if(n!==-1)return e.slice(n+1);const r=e.lastIndexOf("/");if(r!==-1)return e.slice(r+1);if(e.includes("%2F")||e.includes("%2f"))try{const o=decodeURIComponent(e),a=o.lastIndexOf("/");if(a!==-1)return o.slice(a+1)}catch{}const i=e.lastIndexOf(":");return i!==-1&&i<e.length-1?e.slice(i+1):e}get prefixes(){const e={};for(const[n,r]of this._prefixes)e[n]=r;return e}},hh=["http://www.w3.org/2000/01/rdf-schema#label","https://schema.org/name","http://xmlns.com/foaf/0.1/name","http://purl.org/dc/terms/title","http://purl.org/dc/elements/1.1/title","https://schema.org/alternateName"],dh=class{constructor(e,n,r){P(this,"_mode");P(this,"_prefixManager");P(this,"_labelPredicates");this._mode=e,this._prefixManager=n,this._labelPredicates=(r==null?void 0:r.predicates)??hh}get mode(){return this._mode}set mode(e){this._mode=e}resolveNodeLabel(e){for(const n of this._labelPredicates){const r=e.properties.get(n);if(r&&r.length>0)return r[0].value}return this.resolveUri(e.id)}resolveEdgeLabel(e){return this.resolveUri(e.predicate)}resolveUri(e){return this._mode==="strict"?this._prefixManager.compact(e)??ie.localName(e):Fr(ie.localName(e))}resolveTypeLabel(e){return this._mode==="strict"?this._prefixManager.compact(e)??ie.localName(e):Fr(ie.localName(e))}resolvePredicateLabel(e){return this.resolveUri(e)}updateLabels(e,n){for(const r of e.values())r.label=this.resolveNodeLabel(r);for(const r of n.values())r.label=this.resolveEdgeLabel(r)}};function Fr(e){if(!e)return"";let n=e.replace(/_/g," ");return n=n.replace(/([a-z])([A-Z])/g,"$1 $2"),n=n.replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2"),n.length>4&&(n=n.toLowerCase()),n.trim()}var ph={"https://schema.org/":"#8b5cf6","http://www.w3.org/ns/prov#":"#3b82f6","http://xmlns.com/foaf/0.1/":"#10b981","http://purl.org/dc/terms/":"#f59e0b"},gh=class{constructor(e,n,r){P(this,"_config");P(this,"_prefixManager");P(this,"_palette");P(this,"_hasExplicitDefaultNodeColor");P(this,"_hasExplicitDefaultEdgeColor");this._prefixManager=n,this._palette=r??$e,this._hasExplicitDefaultNodeColor=(e==null?void 0:e.defaultNodeColor)!==void 0,this._hasExplicitDefaultEdgeColor=(e==null?void 0:e.defaultEdgeColor)!==void 0,this._config={nodeColors:(e==null?void 0:e.nodeColors)??{},classColors:(e==null?void 0:e.classColors)??{},namespaceColors:(e==null?void 0:e.namespaceColors)??{},predicateColors:(e==null?void 0:e.predicateColors)??{},gradient:(e==null?void 0:e.gradient)??!0,gradientIntensity:(e==null?void 0:e.gradientIntensity)??.3,defaultNodeColor:(e==null?void 0:e.defaultNodeColor)??this._palette.primary,defaultEdgeColor:(e==null?void 0:e.defaultEdgeColor)??this._palette.edgeColor,edgeWidth:(e==null?void 0:e.edgeWidth)??1.5,edgeArrowSize:(e==null?void 0:e.edgeArrowSize)??4,borderWidth:(e==null?void 0:e.borderWidth)??1.5,fontFamily:(e==null?void 0:e.fontFamily)??"system-ui, -apple-system, sans-serif",fontSize:(e==null?void 0:e.fontSize)??11}}get palette(){return this._palette}setPalette(e){this._palette=e,this._config={...this._config},this._hasExplicitDefaultNodeColor||(this._config.defaultNodeColor=e.primary),this._hasExplicitDefaultEdgeColor||(this._config.defaultEdgeColor=e.edgeColor)}get config(){return this._config}setNodeColors(e){this._config={...this._config,nodeColors:{...this._config.nodeColors,...e}}}getNodeColor(e){const n=this._config.nodeColors[e.id];if(n)return n;for(const r of e.types){const i=this._prefixManager.compact(r);if(i&&this._config.classColors[i])return this._config.classColors[i];if(this._config.classColors[r])return this._config.classColors[r]}for(const r of e.types){for(const[i,o]of Object.entries(this._config.namespaceColors)){const a=this._prefixManager.getNamespace(i)??i;if(r.startsWith(a))return o}for(const[i,o]of Object.entries(ph))if(r.startsWith(i))return o}return this._config.defaultNodeColor}getEdgeColor(e){const n=this._prefixManager.compact(e.predicate);return n&&this._config.predicateColors[n]?this._config.predicateColors[n]:this._config.predicateColors[e.predicate]?this._config.predicateColors[e.predicate]:this._config.defaultEdgeColor}getBorderColor(e){return jr(e,.3)}getGradientCenter(e){return jr(e,this._config.gradientIntensity)}};function jr(e,n){const r=_h(e);if(!r)return e;const i=Math.round(r.r+(255-r.r)*n),o=Math.round(r.g+(255-r.g)*n),a=Math.round(r.b+(255-r.b)*n);return`#${((1<<24)+(i<<16)+(o<<8)+a).toString(16).slice(1)}`}function _h(e){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?{r:parseInt(n[1],16),g:parseInt(n[2],16),b:parseInt(n[3],16)}:null}var vh={baseSize:36,minSize:24,maxSize:72,scaleWithDegree:!0,imagePredicates:["https://schema.org/image","http://xmlns.com/foaf/0.1/img","http://xmlns.com/foaf/0.1/depiction"],imageUrlPredicate:"https://schema.org/url",circleTypes:[]},be=new Map,yh=class{constructor(e,n,r){P(this,"_config");P(this,"_styleEngine");P(this,"_maxDegree",1);P(this,"_circleTypeSet");P(this,"_onImageLoad",null);P(this,"_trustStyle","none");P(this,"_showBadges",!0);this._config={...vh,...e},this._styleEngine=n,this._circleTypeSet=new Set;for(const i of this._config.circleTypes)this._circleTypeSet.add(i),r&&this._circleTypeSet.add(r.expand(i))}isCircleNode(e){return this._circleTypeSet.size===0?!1:e.types.some(n=>this._circleTypeSet.has(n))}setImageLoadCallback(e){this._onImageLoad=e}setMaxDegree(e){this._maxDegree=Math.max(1,e)}setTrustStyle(e){this._trustStyle=e}setShowBadges(e){this._showBadges=e}getRadius(e){if(this.isCircleNode(e)){if(!this._config.scaleWithDegree)return this._config.minSize*.7;const s=e.degree/this._maxDegree,l=this._config.maxSize*.6-this._config.minSize*.7;return this._config.minSize*.7+s*l}const n=e.sizeMultiplier??(e.isHighRisk?2:1),r=e.imageUrl?Math.max(this._config.maxSize*.6,8):0;if(!this._config.scaleWithDegree)return Math.max(this._config.baseSize,r)*n;const i=e.degree/this._maxDegree,o=this._config.maxSize-this._config.minSize,a=this._config.minSize+i*o;return Math.max(a,r)*n}paint(e,n,r,i,o,a=1){var _,b;if(this.isCircleNode(n))return this.paintCircle(e,n,r,i,o);const l=this.getRadius(n)*a,u=this._styleEngine.getNodeColor(n),c=this._styleEngine.palette,h=this._styleEngine.config;if(e.save(),a>1.03&&n.isHighRisk){const y=l*1.25,g=(a-1)*2.5;e.beginPath();for(let w=0;w<6;w++){const x=Math.PI/3*w,m=r+y*Math.cos(x),v=i+y*Math.sin(x);w===0?e.moveTo(m,v):e.lineTo(m,v)}e.closePath(),e.fillStyle=`rgba(220, 50, 50, ${Math.min(.4,g)})`,e.fill()}e.beginPath();for(let y=0;y<6;y++){const g=Math.PI/3*y,w=r+l*Math.cos(g),x=i+l*Math.sin(g);y===0?e.moveTo(w,x):e.lineTo(w,x)}if(e.closePath(),h.gradient){const y=e.createRadialGradient(r,i,0,r,i,l);y.addColorStop(0,this._styleEngine.getGradientCenter(u)),y.addColorStop(1,u),e.fillStyle=y}else e.fillStyle=u;e.fill();const f=((b=(_=n.provenance)==null?void 0:_.sources)==null?void 0:b.length)??0;if(f>=2&&this._trustStyle==="glow"&&(e.shadowColor=c.info,e.shadowBlur=Math.min(12,f*3)/o,e.fill(),e.shadowBlur=0,e.shadowColor="transparent"),n.riskScore&&n.riskScore>0){const y=Math.min(1,n.riskScore);e.strokeStyle=`rgba(220, 50, 50, ${.5+y*.5})`,e.lineWidth=(h.borderWidth+(n.isHighRisk?1.5:.5))/o}else f>=2&&this._trustStyle==="border"?(e.strokeStyle=c.info,e.lineWidth=(h.borderWidth+Math.min(3,f))/o):(e.strokeStyle=this._styleEngine.getBorderColor(u),e.lineWidth=h.borderWidth/o);n.isBoundary&&!(n.riskScore&&n.riskScore>0)&&(e.strokeStyle=bh(u,.5),e.lineWidth=(h.borderWidth+1)/o),e.stroke(),e.setLineDash([]),f<2&&this._trustStyle==="opacity"&&(e.globalAlpha=.7),n.imageUrl&&this.paintAvatar(e,n.imageUrl,r,i,l),e.globalAlpha=1,o>3&&this._paintBadges(e,n,r,i,l,o);const d=.3,p=.8;if(o>d){const y=Math.min(1,(o-d)/(p-d)),g=h.fontSize/o;e.font=`${g}px ${h.fontFamily}`,e.textAlign="center",e.textBaseline="top",e.globalAlpha=y,e.fillStyle=c.textPrimary,e.fillText(mh(n.label,24),r,i+l+2/o),e.globalAlpha=1}return e.restore(),l}_paintBadges(e,n,r,i,o,a){if(!this._showBadges)return;const s=n.provenance;if(!s)return;const l=this._styleEngine.palette,u=Math.max(4,8/a);if(s.sources.length>0){const c=r+o*.7,h=i+o*.6,f=s.sources.length;e.beginPath(),e.arc(c,h,u,0,2*Math.PI);const d=Math.min(1,f/3);e.fillStyle=f>=2?l.info:l.textMuted,e.globalAlpha=.4+d*.6,e.fill(),u>3&&(e.fillStyle="#fff",e.globalAlpha=1,e.font=`bold ${u*1.2}px system-ui`,e.textAlign="center",e.textBaseline="middle",e.fillText(String(f),c,h))}if(s.contentHash||s.blockchainAnchor){const c=r+o*.7,h=i-o*.6;e.beginPath(),e.arc(c,h,u,0,2*Math.PI),e.fillStyle=s.blockchainAnchor?l.safe:l.info,e.globalAlpha=.85,e.fill(),e.globalAlpha=1,e.strokeStyle="#fff",e.lineWidth=u*.3,e.lineCap="round",e.lineJoin="round",e.beginPath();const f=u*.5;e.moveTo(c-f*.5,h),e.lineTo(c-f*.1,h+f*.4),e.lineTo(c+f*.5,h-f*.3),e.stroke()}e.globalAlpha=1}paintCircle(e,n,r,i,o){const a=this.getRadius(n),s=this._styleEngine.getNodeColor(n);return e.beginPath(),e.arc(r,i,a,0,2*Math.PI),e.fillStyle=s,e.fill(),a}paintAvatar(e,n,r,i,o){let a=be.get(n);if(a===void 0){const d=new Image;n.startsWith("data:")||(d.crossOrigin="anonymous"),be.set(n,null),d.src=n,d.onload=()=>{var p;be.set(n,d),(p=this._onImageLoad)==null||p.call(this)},d.onerror=()=>{be.delete(n)};return}if(!a)return;e.save(),e.beginPath();for(let d=0;d<6;d++){const p=Math.PI/3*d,_=r+o*Math.cos(p),b=i+o*Math.sin(p);d===0?e.moveTo(_,b):e.lineTo(_,b)}e.closePath(),e.clip();const s=a.naturalWidth/a.naturalHeight,u=n.startsWith("data:")?.5:1;let c,h;const f=o*2*u;s>1?(h=f,c=f*s):(c=f,h=f/s),e.globalAlpha=.95,e.drawImage(a,r-c/2,i-h/2,c,h),e.globalAlpha=1,e.restore()}resolveImageUrl(e,n,r){for(const i of this._config.imagePredicates){const o=e.properties.get(i);if(o&&o.length>0){const a=o[0].value;if(a.startsWith("http://")||a.startsWith("https://"))return a}}if(r){const i=r(e.id);for(const o of this._config.imagePredicates)for(const a of i){if(a.predicate!==o)continue;const s=n(a.target);if(!s)continue;const l=s.properties.get(this._config.imageUrlPredicate);if(l&&l.length>0){const u=l[0].value;if(u.startsWith("http://")||u.startsWith("https://"))return u}for(const u of this._config.imagePredicates){const c=s.properties.get(u);if(c&&c.length>0){const h=c[0].value;if(h.startsWith("http://")||h.startsWith("https://"))return h}}}}return null}};function mh(e,n){if(e.length<=n)return e;if(e.includes("/")){const i=e.split("/"),o=i[0],a=i[i.length-1],s=`${o}/…/${a}`;if(i.length>=3&&s.length<=n)return s;if(a.length<=n-2)return`…/${a}`}const r=/^(#\d+)\s+(.+)$/.exec(e);if(r){const i=r[1],o=r[2],a=n-i.length-2;if(a>4)return`${i} ${o.slice(0,a)}…`}return e.slice(0,n-1)+"…"}function bh(e,n){const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!r)return e;const i=Math.round(parseInt(r[1],16)+(255-parseInt(r[1],16))*n),o=Math.round(parseInt(r[2],16)+(255-parseInt(r[2],16))*n),a=Math.round(parseInt(r[3],16)+(255-parseInt(r[3],16))*n);return`#${((1<<24)+(i<<16)+(o<<8)+a).toString(16).slice(1)}`}var wh={focalNode:null,hops:2,maxNodes:200,expandOnClick:!0},$r=class{constructor(e){P(this,"_config");P(this,"_visibleNodes",new Set);P(this,"_focalNode",null);P(this,"_enabled",!1);this._config={...wh,...e},this._focalNode=this._config.focalNode??null}get focalNode(){return this._focalNode}get enabled(){return this._enabled}get visibleNodeIds(){return this._visibleNodes}compute(e){if(e.nodes.size<=this._config.maxNodes){this._enabled=!1;for(const o of e.nodes.values())o.isBoundary=!1;return{nodes:e.nodes,edges:e.edges}}if(this._enabled=!0,!this._focalNode){const o=e.getHighestDegreeNode();this._focalNode=(o==null?void 0:o.id)??null}if(!this._focalNode)return{nodes:new Map,edges:new Map};this._visibleNodes.clear();const n=[{id:this._focalNode,depth:0}];for(this._visibleNodes.add(this._focalNode);n.length>0&&this._visibleNodes.size<this._config.maxNodes;){const o=n.shift();if(o.depth>=this._config.hops)continue;const a=e.getNeighborIds(o.id);for(const s of a){if(this._visibleNodes.size>=this._config.maxNodes)break;this._visibleNodes.has(s)||(this._visibleNodes.add(s),n.push({id:s,depth:o.depth+1}))}}const r=new Map,i=new Map;for(const o of this._visibleNodes){const a=e.getNode(o);if(a){const s=e.getNeighborIds(o);a.isBoundary=!1;for(const l of s)if(!this._visibleNodes.has(l)){a.isBoundary=!0;break}r.set(o,a)}}for(const o of e.edges.values())this._visibleNodes.has(o.source)&&this._visibleNodes.has(o.target)&&i.set(o.id,o);return{nodes:r,edges:i}}setFocus(e){this._focalNode=e}expandNode(e,n){const r=n.getNeighborIds(e);for(const i of r)this._visibleNodes.add(i)}disable(){this._enabled=!1,this._visibleNodes.clear()}enable(e){this._enabled=!0,e&&(this._focalNode=e)}},xh={statementType:"http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement",subjectPredicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#subject",predicatePredicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate",objectPredicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#object"},Lr={enabled:!1,patterns:[xh]},kh=class{constructor(e){P(this,"_config");this._config={enabled:(e==null?void 0:e.enabled)??Lr.enabled,patterns:(e==null?void 0:e.patterns)??Lr.patterns}}get enabled(){return this._config.enabled}collapse(e){if(!this._config.enabled)return new Set;const n=new Set,r=this.detectStatements(e);for(const i of r){if(!i.reifiedSubject)continue;const o=e.getNode(i.reifiedSubject);if(o){if(i.reifiedPredicate&&i.annotations.length>0){const a=i.annotations.map(u=>({predicate:u.predicate,value:u.value,datatype:u.datatype})),s=o.properties.get(i.reifiedPredicate);if(s){for(const u of s)if(i.reifiedObject&&u.value===i.reifiedObject){u.annotations=[...u.annotations??[],...a];break}s.length>0&&!s.some(u=>{var c;return(c=u.annotations)==null?void 0:c.length})&&(s[0].annotations=[...s[0].annotations??[],...a])}const l=o.metadata.get(i.reifiedPredicate);l&&l.length>0&&(l[0].annotations=[...l[0].annotations??[],...a])}n.add(i.statementNodeId)}}return n}detectStatements(e){const n=[];for(const r of this._config.patterns)for(const i of e.nodes.values()){if(!i.types.includes(r.statementType))continue;const o={statementNodeId:i.id,reifiedSubject:null,reifiedPredicate:null,reifiedObject:null,annotations:[]},a=e.getEdgesFrom(i.id);for(const l of a)l.predicate===r.subjectPredicate?o.reifiedSubject=l.target:l.predicate===r.predicatePredicate?o.reifiedPredicate=l.target:l.predicate===r.objectPredicate&&(o.reifiedObject=l.target);for(const[l,u]of i.properties)l===r.objectPredicate&&u.length>0&&(o.reifiedObject=u[0].value);for(const[l,u]of i.metadata)u.length!==0&&(!o.reifiedSubject&&l===r.subjectPredicate?o.reifiedSubject=u[0].value:!o.reifiedPredicate&&l===r.predicatePredicate?o.reifiedPredicate=u[0].value:!o.reifiedObject&&l===r.objectPredicate&&(o.reifiedObject=u[0].value));const s=new Set([r.subjectPredicate,r.predicatePredicate,r.objectPredicate]);for(const[l,u]of i.properties)if(!s.has(l))for(const c of u)o.annotations.push({predicate:l,value:c.value,datatype:c.datatype});for(const[l,u]of i.metadata)for(const c of u)o.annotations.push({predicate:l,value:c.value,datatype:c.datatype});n.push(o)}return n}},Sh=["http://www.w3.org/ns/prov#wasGeneratedBy","http://www.w3.org/ns/prov#wasAttributedTo","http://www.w3.org/ns/prov#wasDerivedFrom","http://www.w3.org/ns/prov#startedAtTime","http://www.w3.org/ns/prov#endedAtTime","http://www.w3.org/ns/prov#generatedAtTime","http://www.w3.org/ns/prov#wasStartedBy","http://www.w3.org/ns/prov#wasEndedBy","http://purl.org/dc/terms/created","http://purl.org/dc/terms/modified","http://purl.org/dc/terms/source","http://purl.org/dc/terms/creator","http://purl.org/dc/terms/publisher","http://www.w3.org/2002/07/owl#versionInfo"],Ch=class{constructor(e){P(this,"_predicates");this._predicates=new Set([...Sh,...(e==null?void 0:e.predicates)??[]])}get predicates(){return[...this._predicates]}isMetadata(e){return this._predicates.has(e)}addPredicates(e){for(const n of e)this._predicates.add(n)}},Mh=class{constructor(){P(this,"_handlers",new Map)}on(e,n){let r=this._handlers.get(e);return r||(r=new Set,this._handlers.set(e,r)),r.add(n),()=>{r.delete(n)}}off(e,n){const r=this._handlers.get(e);r&&r.delete(n)}emit(e,n){const r=this._handlers.get(e);if(r)for(const i of r)try{i(n)}catch(o){console.error(`[dkg-graph-viz] Error in ${e} handler:`,o)}}removeAll(e){e?this._handlers.delete(e):this._handlers.clear()}},Ur=class{constructor(e){P(this,"_container");P(this,"_graph",null);P(this,"_hexPainter");P(this,"_styleEngine");P(this,"_events");P(this,"_currentNodes",new Map);P(this,"_positionCache",new Map);P(this,"_currentLinks",[]);P(this,"_repaintPending",!1);P(this,"_riskPulseEnabled",!1);P(this,"_hoverTraceEnabled",!1);P(this,"_hoveredNodeId",null);P(this,"_fadeInEnabled",!1);P(this,"_loadTime",0);P(this,"_fadeInDuration",1500);P(this,"_animFrameId",null);P(this,"_initialFitDone",!1);P(this,"_autoFitDisabled",!1);P(this,"_lastTopologyKey","");P(this,"_continuousSimulation",!1);P(this,"_fitTimeoutId",null);P(this,"_kaGroups",new Map);P(this,"_kaEnabled",!1);P(this,"_kaBoundaryOpacity",.06);this._container=e.container,this._hexPainter=e.hexPainter,this._styleEngine=e.styleEngine,this._events=e.events}_setAlphaTarget(e){var r;const n=(r=this._graph)==null?void 0:r.d3AlphaTarget;typeof n=="function"&&n.call(this._graph,e)}init(){var s;if(this._graph)return;const e=this._styleEngine.config,n=this._container.clientWidth||this._container.offsetWidth||800,r=this._container.clientHeight||this._container.offsetHeight||600;this._hexPainter.setImageLoadCallback(()=>{this._scheduleRepaint()}),this._graph=Kf()(this._container).width(n).height(r).backgroundColor("transparent").nodeCanvasObjectMode(l=>{var c;const u=l;return(c=u._graphNode)!=null&&c.sizeMultiplier&&u._graphNode.sizeMultiplier>1?"after":"replace"}).nodeCanvasObject((l,u,c)=>{const h=l;if(!h._graphNode)return;const f=h.x??0,d=h.y??0;if(this._fadeInEnabled&&this._loadTime>0){const _=performance.now()-this._loadTime;if(_<this._fadeInDuration){const b=_/this._fadeInDuration,y=1-Math.pow(1-b,3);u.globalAlpha=y}}let p=1;if(this._riskPulseEnabled&&h._graphNode.isHighRisk){const _=performance.now()/1e3,b=nn(h._graphNode.id);p=1+.15*Math.sin(_*1.25+b)}this._hexPainter.paint(u,h._graphNode,f,d,c,p),u.globalAlpha=1}).nodePointerAreaPaint((l,u,c)=>{const h=l;if(!h._graphNode)return;const d=this._hexPainter.getRadius(h._graphNode)+6,p=h.x??0,_=h.y??0;c.beginPath(),c.arc(p,_,d,0,Math.PI*2),c.fillStyle=u,c.fill()}).linkColor(l=>{const u=l;return u._graphEdge?this._styleEngine.getEdgeColor(u._graphEdge):e.defaultEdgeColor}).linkWidth(e.edgeWidth).linkDirectionalArrowLength(e.edgeArrowSize).linkDirectionalArrowRelPos(1).linkCanvasObjectMode(()=>"after").linkCanvasObject((l,u,c)=>{if(c<.3)return;const h=l;if(!h._graphEdge)return;const f=h._graphEdge.label;if(!f)return;const d=.3,_=Math.min(1,(c-d)/(.8-d)),b=12/c,y=h.source,g=h.target;if(!y.x||!g.x)return;const w=(y.x+g.x)/2,x=(y.y+g.y)/2;u.save(),u.globalAlpha=_,u.font=`${b}px ${e.fontFamily}`,u.textAlign="center",u.textBaseline="middle";const m=u.measureText(f).width,v=2/c;u.fillStyle="rgba(15, 23, 42, 0.75)",u.beginPath(),u.roundRect(w-m/2-v,x-b/2-v,m+v*2,b+v*2,2/c),u.fill(),u.fillStyle="#94a3b8",u.fillText(f,w,x),u.restore()}).onRenderFramePre((l,u)=>{this._drawKaBoundaries(l)}).onNodeClick(l=>{const u=l;u._graphNode&&this._events.emit("node:click",u._graphNode)}).onNodeDrag(l=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeDragEnd(l=>{try{this._graph.d3ReheatSimulation()}catch{}}).onNodeHover(l=>{const u=l;u!=null&&u._graphNode?(this._hoveredNodeId=u._graphNode.id,this._events.emit("node:hover",u._graphNode),this._container.style.cursor="pointer"):(this._hoveredNodeId=null,this._events.emit("node:unhover",null),this._container.style.cursor="default")}).onLinkClick(l=>{const u=l;u._graphEdge&&this._events.emit("edge:click",u._graphEdge)}).onBackgroundClick(l=>{this._events.emit("background:click",{x:0,y:0})}).cooldownTicks(200).d3AlphaDecay(.02).d3VelocityDecay(.3).warmupTicks(60).onEngineStop(()=>{!this._autoFitDisabled&&!this._initialFitDone&&this._graph&&(this._initialFitDone=!0,this._graph.zoomToFit(400,40))});const i=this._graph.d3Force("charge");i!=null&&i.strength&&(i.strength(-150),(s=i.distanceMax)==null||s.call(i,1e3));const o=this._graph.d3Force("link");o!=null&&o.distance&&o.distance(80).strength(.2);const a=this._graph.d3Force("center");a!=null&&a.strength&&a.strength(.03)}render(e,n,r){var y;this._graph||this.init();let i=0;const o=[...e.keys()].sort();for(const g of o)i=i*31+nn(g)|0;const a=[];for(const g of n.values())a.push(`${g.source}\0${g.target}`);a.sort();for(const g of a)i=i*31+nn(g)|0;const s=String(i);s!==this._lastTopologyKey&&(this._lastTopologyKey=s,this._initialFitDone=!1),this._loadTime===0&&(this._loadTime=performance.now());let l=1;for(const g of e.values())g.degree>l&&(l=g.degree);this._hexPainter.setMaxDegree(l);const u=["http://schema.org/dateCreated","https://schema.org/dateCreated"],c=new Map;for(const[g,w]of e)for(const x of u){const m=(y=w.properties)==null?void 0:y.get(x);if(m&&m.length>0){const v=new Date(m[0].value);if(!isNaN(v.getTime())){c.set(g,v.getTime());break}}}let h=null;if(c.size>=2){const g=[...c.values()],w=Math.min(...g),m=Math.max(...g)-w||1,v=Math.max(400,c.size*120);h=new Map;for(const[S,k]of c)h.set(S,((k-w)/m-.5)*v)}const f=new Map;for(const[g,w]of e){if(r!=null&&r.has(g))continue;const x=this._currentNodes.get(g),m=this._positionCache.get(g),v=h==null?void 0:h.get(g);f.set(g,{id:g,x:(x==null?void 0:x.x)??(m==null?void 0:m.x)??v??(Math.random()-.5)*800,y:(x==null?void 0:x.y)??(m==null?void 0:m.y)??(Math.random()-.5)*400,vx:(x==null?void 0:x.vx)??(m==null?void 0:m.vx),vy:(x==null?void 0:x.vy)??(m==null?void 0:m.vy),fx:typeof(x==null?void 0:x.fx)=="number"?x.fx:typeof(m==null?void 0:m.fx)=="number"?m.fx:void 0,fy:typeof(x==null?void 0:x.fy)=="number"?x.fy:typeof(m==null?void 0:m.fy)=="number"?m.fy:void 0,_graphNode:w})}const d=new Set(f.keys()),p=[];for(const g of n.values())r!=null&&r.has(g.source)||r!=null&&r.has(g.target)||!d.has(g.source)||!d.has(g.target)||p.push({source:g.source,target:g.target,_graphEdge:g});this._currentNodes=f,this._currentLinks=p;const _=new Map;for(const[g,w]of f)_.set(g,{x:w.x,y:w.y,vx:w.vx,vy:w.vy,fx:typeof w.fx=="number"?w.fx:void 0,fy:typeof w.fy=="number"?w.fy:void 0});this._positionCache=_;const b=[...f.values()].sort((g,w)=>{var v,S,k,M;const x=(v=g._graphNode)!=null&&v.sizeMultiplier&&g._graphNode.sizeMultiplier>1?100:(S=g._graphNode)!=null&&S.isHighRisk?10:0,m=(k=w._graphNode)!=null&&k.sizeMultiplier&&w._graphNode.sizeMultiplier>1?100:(M=w._graphNode)!=null&&M.isHighRisk?10:0;return x-m});this._graph.graphData({nodes:b,links:p}),!this._autoFitDisabled&&!this._initialFitDone&&(this._fitTimeoutId!==null&&clearTimeout(this._fitTimeoutId),this._fitTimeoutId=setTimeout(()=>{this._graph&&!this._autoFitDisabled&&!this._initialFitDone&&(this._initialFitDone=!0,this._graph.zoomToFit(400,40)),this._fitTimeoutId=null},300)),h&&h.size>=2?this._graph.d3Force("chronoX",g=>{for(const w of b){const x=h.get(w.id);x!==void 0&&w.fx==null&&(w.vx=(w.vx??0)+(x-(w.x??0))*.05*g)}}):this._graph.d3Force("chronoX",null)}centerOnNode(e,n=350,r){const i=this._currentNodes.get(e);i&&this._graph&&(this._graph.centerAt(i.x,i.y,n),r!=null&&this._graph.zoom(r,n))}zoomToFit(e=40,n=500){var r;(r=this._graph)==null||r.zoomToFit(n,e)}set autoFitDisabled(e){this._autoFitDisabled=e}getCanvas(){return this._graph?this._container.querySelector("canvas")??null:null}refresh(){if(!this._graph)return;const e=this._graph.refresh;if(typeof e=="function"){e.call(this._graph);return}this._scheduleRepaint()}_scheduleRepaint(){this._repaintPending||(this._repaintPending=!0,requestAnimationFrame(()=>{if(this._repaintPending=!1,!!this._graph)if(this._continuousSimulation||this._riskPulseEnabled)try{this._graph.d3ReheatSimulation()}catch{}else{this._graph.cooldownTicks(3);try{this._graph.d3ReheatSimulation()}catch{}this._setAlphaTarget(0),setTimeout(()=>{this._graph&&!this._continuousSimulation&&!this._riskPulseEnabled&&(this._graph.cooldownTicks(0),this._setAlphaTarget(0))},60)}}))}_stopAnimLoop(){this._animFrameId!==null&&(cancelAnimationFrame(this._animFrameId),this._animFrameId=null)}setKaGroups(e,n,r=.06){this._kaGroups=e,this._kaEnabled=n,this._kaBoundaryOpacity=r}_drawKaBoundaries(e){if(!this._kaEnabled||this._kaGroups.size===0)return;const n=this._styleEngine.palette;let r=0;for(const[i,o]of this._kaGroups){const a=[];for(const h of o){const f=this._currentNodes.get(h);f&&f.x!==void 0&&f.y!==void 0&&a.push([f.x,f.y])}if(a.length<3)continue;const s=Ah(a);if(s.length<3)continue;const l=n.nodeColors[r%n.nodeColors.length];r++,e.save(),e.beginPath();const u=s.reduce((h,f)=>h+f[0],0)/s.length,c=s.reduce((h,f)=>h+f[1],0)/s.length;for(let h=0;h<s.length;h++){const f=s[h][0]-u,d=s[h][1]-c,p=Math.sqrt(f*f+d*d),_=30,b=s[h][0]+(p>0?f/p*_:0),y=s[h][1]+(p>0?d/p*_:0);h===0?e.moveTo(b,y):e.lineTo(b,y)}e.closePath(),e.fillStyle=l,e.globalAlpha=this._kaBoundaryOpacity,e.fill(),e.strokeStyle=l,e.globalAlpha=this._kaBoundaryOpacity*2.5,e.lineWidth=1,e.stroke(),e.restore()}}resize(){this._graph&&(this._graph.width(this._container.clientWidth),this._graph.height(this._container.clientHeight))}destroy(){this._stopAnimLoop(),this._fitTimeoutId!==null&&(clearTimeout(this._fitTimeoutId),this._fitTimeoutId=null),this._graph&&(this._graph._destructor(),this._graph=null),this._currentNodes.clear(),this._positionCache.clear(),this._currentLinks=[]}applyAnimation(e){if(!this._graph)return;this._riskPulseEnabled=e.riskPulse??!1,this._fadeInEnabled=e.fadeIn??!1,this._hoverTraceEnabled=e.hoverTrace??!1;const n=e.linkParticleSpeed??.005,r=e.linkParticleColor??"rgba(100,150,255,0.6)",i=e.linkParticleWidth??1.5;if(e.linkParticles||e.hoverTrace){const a=e.linkParticleCount??1;this._hoverTraceEnabled?this._graph.linkDirectionalParticles(s=>{if(!this._hoveredNodeId)return e.linkParticles?a:0;const l=s,u=typeof l.source=="object"?l.source.id:l.source,c=typeof l.target=="object"?l.target.id:l.target;return u===this._hoveredNodeId||c===this._hoveredNodeId?4:e.linkParticles?a:0}).linkDirectionalParticleSpeed(s=>{if(!this._hoveredNodeId)return n;const l=s,u=typeof l.source=="object"?l.source.id:l.source,c=typeof l.target=="object"?l.target.id:l.target;return u===this._hoveredNodeId||c===this._hoveredNodeId?.02:n}).linkDirectionalParticleWidth(s=>{if(!this._hoveredNodeId)return i;const l=s,u=typeof l.source=="object"?l.source.id:l.source,c=typeof l.target=="object"?l.target.id:l.target;return u===this._hoveredNodeId||c===this._hoveredNodeId?3:i}).linkDirectionalParticleColor(s=>{if(!this._hoveredNodeId)return r;const l=s,u=typeof l.source=="object"?l.source.id:l.source,c=typeof l.target=="object"?l.target.id:l.target;return u===this._hoveredNodeId||c===this._hoveredNodeId?"#60a0ff":r}):this._graph.linkDirectionalParticles(a).linkDirectionalParticleSpeed(n).linkDirectionalParticleWidth(i).linkDirectionalParticleColor(()=>r)}else this._graph.linkDirectionalParticles(0);const o=e.drift||this._riskPulseEnabled;if(this._continuousSimulation=o,o?(this._graph.cooldownTicks(1/0),this._setAlphaTarget(e.driftAlpha??.008),!this._autoFitDisabled&&!this._initialFitDone&&(this._fitTimeoutId!==null&&clearTimeout(this._fitTimeoutId),this._fitTimeoutId=setTimeout(()=>{this._graph&&!this._autoFitDisabled&&!this._initialFitDone&&(this._initialFitDone=!0,this._graph.zoomToFit(400,40)),this._fitTimeoutId=null},300))):(this._graph.cooldownTicks(120),this._setAlphaTarget(0)),this._stopAnimLoop(),this._riskPulseEnabled&&!e.drift){const a=()=>{if(!this._riskPulseEnabled||!this._graph){this._animFrameId=null;return}try{this._graph.d3ReheatSimulation()}catch{}this._animFrameId=requestAnimationFrame(a)};this._animFrameId=requestAnimationFrame(a)}}applyPalette(e){this._graph&&this._graph.backgroundColor(e.background==="#0a0a0f"?"transparent":e.background)}};function nn(e){let n=0;for(let r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r)|0;return n}function Ah(e){if(e.length<3)return e;const n=[...e].sort((a,s)=>a[0]-s[0]||a[1]-s[1]),r=(a,s,l)=>(s[0]-a[0])*(l[1]-a[1])-(s[1]-a[1])*(l[0]-a[0]),i=[];for(const a of n){for(;i.length>=2&&r(i[i.length-2],i[i.length-1],a)<=0;)i.pop();i.push(a)}const o=[];for(let a=n.length-1;a>=0;a--){const s=n[a];for(;o.length>=2&&r(o[o.length-2],o[o.length-1],s)<=0;)o.pop();o.push(s)}return i.pop(),o.pop(),i.concat(o)}var Ph=class{constructor(e,n={}){P(this,"_model");P(this,"_prefixManager");P(this,"_labelResolver");P(this,"_styleEngine");P(this,"_hexPainter");P(this,"_focusFilter");P(this,"_reificationCollapser");P(this,"_metadataExtractor");P(this,"_events");P(this,"_renderer");P(this,"_config");P(this,"_collapsedNodeIds",new Set);P(this,"_rendererReady");P(this,"_container");P(this,"_temporalFilter");P(this,"_timelineOverlay",null);P(this,"_renderQueued",!1);P(this,"_autoFitDisabled",!1);P(this,"_highlightState",new Map);this._config=n,this._container=e,this._metadataExtractor=new Ch(n.metadata),this._model=new ch(this._metadataExtractor.predicates),this._prefixManager=new ie(n.prefixes),this._labelResolver=new dh(n.labelMode??"humanized",this._prefixManager,n.labels),this._styleEngine=new gh(n.style,this._prefixManager),this._hexPainter=new yh(n.hexagon,this._styleEngine,this._prefixManager),this._focusFilter=new $r(n.focus),this._reificationCollapser=new kh(n.reification),this._temporalFilter=new Ir,this._events=new Mh;const r={container:e,hexPainter:this._hexPainter,styleEngine:this._styleEngine,events:this._events};if(n.renderer==="3d"){let i;this._rendererReady=new Promise(o=>{i=o}),this._renderer=null,qt(async()=>{const{WebGL3DRenderer:o}=await import("./renderer-3d-2EVDZII7-CTUExXUn.js");return{WebGL3DRenderer:o}},__vite__mapDeps([0,1,2])).then(({WebGL3DRenderer:o})=>{this._renderer=new o(r),i()}).catch(o=>{console.warn("[dkg-graph-viz] 3D renderer not available, falling back to 2D:",o.message),this._renderer=new Ur(r),i()})}else this._renderer=new Ur(r),this._rendererReady=Promise.resolve();n.autoFitDisabled&&(this._autoFitDisabled=!0,this._renderer?this._renderer.autoFitDisabled=!0:this._rendererReady.then(()=>{this._renderer&&(this._renderer.autoFitDisabled=!0)})),typeof ResizeObserver<"u"&&new ResizeObserver(()=>{var o;return(o=this._renderer)==null?void 0:o.resize()}).observe(e)}async loadNTriples(e){const{parseNTriples:n}=await qt(async()=>{const{parseNTriples:i}=await import("./ntriples-ZWBY2WET-DH7OofPp.js");return{parseNTriples:i}},__vite__mapDeps([3,4])),r=n(e);this._ingest(r)}async loadNQuads(e){const{parseNQuads:n}=await qt(async()=>{const{parseNQuads:i}=await import("./ntriples-ZWBY2WET-DH7OofPp.js");return{parseNQuads:i}},__vite__mapDeps([3,4])),r=n(e);this._ingest(r)}async loadTurtle(e){const{parseTurtle:n}=await qt(async()=>{const{parseTurtle:o}=await import("./turtle-JJPK7LJ5-BzTu0283.js");return{parseTurtle:o}},__vite__mapDeps([5,4])),{triples:r,prefixes:i}=n(e);this._prefixManager.addPrefixes(i),this._ingest(r)}async loadJsonLd(e){const{parseJsonLd:n}=await qt(async()=>{const{parseJsonLd:i}=await import("./jsonld-32FQRO67-CbN9NJJW.js");return{parseJsonLd:i}},__vite__mapDeps([6,1,2])),r=await n(e);this._ingest(r)}loadTriples(e){const n=e.map(r=>{if(Array.isArray(r))return{subject:r[0],predicate:r[1],object:r[2]};if("s"in r&&"p"in r&&"o"in r){const i=r;return{subject:i.s,predicate:i.p,object:i.o}}return r});this._ingest(n)}async loadFromSource(e,n){const r=await e.construct(n);this._ingest(r.triples)}async querySource(e,n){return e.select(n)}addTriples(e){const n=this._model.addTriples(e);return this._postIngest(),this._events.emit("data:change",n),n}removeTriples(e){const n=this._model.removeTriples(e);return this._postIngest(),this._events.emit("data:change",n),n}focus(e,n){var r;this._focusFilter.setFocus(e),n!==void 0&&(this._focusFilter=new $r({...this._config.focus,focalNode:e,hops:n})),this._renderCurrent(),(r=this._renderer)==null||r.centerOnNode(e,500,2),this._events.emit("focus:change",{focalNode:e,visibleNodes:this._focusFilter.visibleNodeIds.size})}centerOnNode(e,n){var r;(r=this._renderer)==null||r.centerOnNode(e,n==null?void 0:n.durationMs,n==null?void 0:n.zoomLevel)}expandNode(e){this._focusFilter.expandNode(e,this._model),this._renderCurrent()}showAll(){this._focusFilter.disable(),this._renderCurrent()}get temporalFilter(){return this._temporalFilter}get timelineOverlay(){return this._timelineOverlay}setTimeCursor(e){this._temporalFilter.setCursor(e),this._renderCurrent(),this._events.emit("temporal:change",{cursor:e,visibleCount:this._lastVisibleCount(),totalDated:this._temporalFilter.datedNodeCount})}getDateRange(){return this._temporalFilter.dateRange}playTimeline(){var e;(e=this._timelineOverlay)==null||e.play()}pauseTimeline(){var e;(e=this._timelineOverlay)==null||e.pause()}_lastVisibleCount(){const{nodes:e}=this._focusFilter.compute(this._model),n=this._temporalFilter.getVisibleNodeIds(e.keys());return n?n.size:e.size}zoomToFit(e){var n;(n=this._renderer)==null||n.zoomToFit(e)}set autoFitDisabled(e){this._autoFitDisabled=e,this._renderer?this._renderer.autoFitDisabled=e:this._rendererReady.then(()=>{this._renderer&&(this._renderer.autoFitDisabled=e)})}get labelMode(){return this._labelResolver.mode}setLabelMode(e){this._labelResolver.mode=e,this._labelResolver.updateLabels(this._model.nodes,this._model.edges),this._renderCurrent()}on(e,n){return this._events.on(e,n)}off(e,n){this._events.off(e,n)}getNode(e){return this._model.getNode(e)}getEdgesFrom(e){return this._model.getEdgesFrom(e)}getEdgesTo(e){return this._model.getEdgesTo(e)}get model(){return this._model}get styleEngine(){return this._styleEngine}get prefixes(){return this._prefixManager}highlightNodes(e){var r;this.clearHighlight();const n=new Set(e);for(const[i,o]of this._model.nodes)n.has(i)&&(this._highlightState.set(i,{riskScore:o.riskScore,isHighRisk:o.isHighRisk,sizeMultiplier:o.sizeMultiplier}),o.isHighRisk=!0,(!o.sizeMultiplier||o.sizeMultiplier<2)&&(o.sizeMultiplier=2));(r=this._renderer)!=null&&r.refresh?this._renderer.refresh():this._renderCurrent()}clearHighlight(){var e;if(this._highlightState.size!==0){for(const[n,r]of this._highlightState){const i=this._model.nodes.get(n);i&&(i.riskScore=r.riskScore,i.isHighRisk=r.isHighRisk,i.sizeMultiplier=r.sizeMultiplier)}this._highlightState.clear(),(e=this._renderer)!=null&&e.refresh?this._renderer.refresh():this._renderCurrent()}}async exportImage(){const e=this._renderer.getCanvas();if(!e)throw new Error("Cannot export: renderer not initialized or no canvas available");return new Promise((n,r)=>{e.toBlob(i=>{i?n(i):r(new Error("Canvas toBlob returned null"))},"image/png")})}exportTriples(){const e=[];for(const n of this._model.triples){const r=rn(n.subject),i=rn(n.predicate);if(n.datatype||n.language||!Th(n.object)){let o=`"${Eh(n.object)}"`;n.language?o+=`@${n.language}`:n.datatype&&(o+=`^^<${n.datatype}>`),e.push(`${r} ${i} ${o} .`)}else e.push(`${r} ${i} ${rn(n.object)} .`)}return e.join(`
|
|
192
192
|
`)}applyView(e){var i,o,a,s,l;const n=ih(e.palette,e.paletteOverrides);if(this._styleEngine.setPalette(n),oh(this._container,n),(i=e.trust)!=null&&i.enabled?(this._hexPainter.setTrustStyle(e.trust.style??"border"),this._hexPainter.setShowBadges(e.trust.showBadge!==!1)):this._hexPainter.setTrustStyle("none"),Qf(e,this._model),new sh().resolve(this._model),(o=e.temporal)!=null&&o.enabled?(this._temporalFilter=new Ir(e.temporal),this._temporalFilter.scan(this._model),this._temporalFilter.dateRange&&((a=this._timelineOverlay)==null||a.unmount(),this._timelineOverlay=new uh(this._container,this._temporalFilter,e.temporal),this._timelineOverlay.onChange(u=>{this._renderCurrent(),this._events.emit("temporal:change",{cursor:u,visibleCount:this._lastVisibleCount(),totalDated:this._temporalFilter.datedNodeCount})}),this._timelineOverlay.mount())):((s=this._timelineOverlay)==null||s.unmount(),this._timelineOverlay=null),this._renderCurrent(),(l=e.knowledgeAssets)!=null&&l.enabled){const u=e.knowledgeAssets.membershipPredicate??"dkg:partOfAsset";this._model.setKaMembershipPredicate(u)}this._rendererReady.then(()=>{var u,c,h,f;e.animation&&((u=this._renderer)!=null&&u.applyAnimation)&&this._renderer.applyAnimation(e.animation),(c=this._renderer)!=null&&c.applyPalette&&this._renderer.applyPalette(n),(h=e.knowledgeAssets)!=null&&h.enabled&&((f=this._renderer)!=null&&f.setKaGroups)&&this._renderer.setKaGroups(this._model.kaGroups,e.knowledgeAssets.showBoundaries!==!1,e.knowledgeAssets.boundaryOpacity??.06)})}refresh(){this._renderCurrent()}destroy(){var e,n;(e=this._timelineOverlay)==null||e.unmount(),this._timelineOverlay=null,(n=this._renderer)==null||n.destroy(),this._events.removeAll(),this._model.clear(),this._highlightState.clear()}_ingest(e){this._model.addTriples(e),this._postIngest()}_postIngest(){for(const e of this._model.nodes.values())e.imageUrl||(e.imageUrl=this._hexPainter.resolveImageUrl(e,n=>this._model.getNode(n),n=>this._model.getEdgesFrom(n)));this._labelResolver.updateLabels(this._model.nodes,this._model.edges),this._collapsedNodeIds=this._reificationCollapser.collapse(this._model),this._renderCurrent()}_renderCurrent(){var i;if(!this._renderer){this._renderQueued||(this._renderQueued=!0,this._rendererReady.then(()=>{this._renderQueued=!1,this._renderCurrent()}));return}let{nodes:e,edges:n}=this._focusFilter.compute(this._model);const r=this._temporalFilter.getVisibleNodeIds(e.keys());if(r){const o=new Map,a=new Map;for(const[s,l]of e)r.has(s)&&o.set(s,l);for(const[s,l]of n)o.has(l.source)&&o.has(l.target)&&a.set(s,l);e=o,n=a}this._renderer.render(e,n,this._collapsedNodeIds),(i=this._timelineOverlay)!=null&&i.mounted&&this._timelineOverlay.updateCount(e.size)}};function Th(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("urn:")||e.startsWith("_:")}function rn(e){return e.startsWith("_:")?e:`<${e}>`}function Eh(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}var Fn=et.createContext({viz:null,selectedNode:null,hoveredNode:null});function jn(){return et.useContext(Fn)}function Nh({data:e,format:n="ntriples",options:r={},viewConfig:i,initialFit:o,initialFocus:a,onNodeClick:s,onNodeHover:l,onNodeUnhover:u,className:c,style:h,children:f}){const d=et.useRef(null),p=et.useRef(null),_=et.useRef(!1),[b,y]=et.useState(null),[g,w]=et.useState(null);et.useEffect(()=>{if(!d.current)return;const v=new Ph(d.current,r);p.current=v;const S=[];return S.push(v.on("node:click",k=>{y(k),s==null||s(k)})),S.push(v.on("node:hover",k=>{w(k),l==null||l(k)})),S.push(v.on("node:unhover",k=>{w(null),u==null||u(k)})),S.push(v.on("background:click",()=>{y(null)})),()=>{S.forEach(k=>k()),v.destroy(),p.current=null}},[]),et.useEffect(()=>{const v=p.current;if(!v||!e)return;v.model.clear();const S=async()=>{var N;if(typeof e=="string")switch(n){case"ntriples":await v.loadNTriples(e);break;case"nquads":await v.loadNQuads(e);break;case"turtle":await v.loadTurtle(e);break;case"jsonld":await v.loadJsonLd(e);break;default:await v.loadNTriples(e)}else Array.isArray(e)&&v.loadTriples(e);(N=r.style)!=null&&N.nodeColors&&v.styleEngine.setNodeColors(r.style.nodeColors),i&&v.applyView(i)};let k=!1,M;return S().then(()=>{k||v&&o&&!_.current&&(M=setTimeout(()=>{k||(_.current=!0,v.zoomToFit())},300))}).catch(N=>{k||console.error("[RdfGraph] Error loading data:",N)}),()=>{k=!0,M&&clearTimeout(M)}},[e,n,i]);const x=et.useRef(i);et.useEffect(()=>{const v=p.current;!v||!i||i===x.current||(x.current=i,v.applyView(i),v.refresh())},[i]),et.useEffect(()=>{if(!a)return;const v=p.current;if(!v)return;const S=setTimeout(()=>{try{v.centerOnNode(a,{durationMs:600,zoomLevel:2})}catch{}},550);return()=>clearTimeout(S)},[a,e]);const m=et.useCallback(()=>({viz:p.current,selectedNode:b,hoveredNode:g}),[b,g]);return K.jsxs(Fn.Provider,{value:m(),children:[K.jsx("div",{ref:d,className:c,style:{width:"100%",height:"100%",...h}}),f]})}function zh({renderNode:e,className:n,style:r,showUri:i=!0,showTypes:o=!0,showProperties:a=!0,showMetadata:s=!1,maxValueLength:l=200}){const{selectedNode:u}=jn();return e?K.jsx(K.Fragment,{children:e(u)}):u?K.jsxs("div",{className:n,style:r,children:[K.jsx(Ih,{node:u,showUri:i,showTypes:o}),a&&u.properties.size>0&&K.jsx(Hr,{title:"Properties",entries:u.properties,maxValueLength:l}),s&&u.metadata.size>0&&K.jsx(Hr,{title:"Metadata",entries:u.metadata,maxValueLength:l})]}):null}function Ih({node:e,showUri:n,showTypes:r}){const i=et.useMemo(()=>e.types.map(o=>{var a;return((a=o.split("/").pop())==null?void 0:a.split("#").pop())??o}),[e.types]);return K.jsxs("div",{children:[K.jsx("h3",{style:{margin:"0 0 4px 0",wordBreak:"break-word"},children:e.label}),n&&K.jsx("div",{style:{fontSize:"0.8em",opacity:.6,wordBreak:"break-all",marginBottom:4},children:e.id}),r&&i.length>0&&K.jsx("div",{style:{fontSize:"0.85em",marginBottom:8},children:i.join(", ")}),K.jsxs("div",{style:{fontSize:"0.85em",opacity:.7},children:["Connections: ",e.degree]})]})}function Hr({title:e,entries:n,maxValueLength:r}){return K.jsxs("div",{style:{marginTop:12},children:[K.jsx("h4",{style:{margin:"0 0 4px 0",fontSize:"0.8em",textTransform:"uppercase",opacity:.5},children:e}),[...n].map(([i,o])=>{var s;const a=((s=i.split("/").pop())==null?void 0:s.split("#").pop())??i;return K.jsxs("div",{style:{fontSize:"0.85em",marginBottom:2,lineHeight:1.5},children:[K.jsxs("span",{style:{opacity:.6},children:[Rh(a),": "]}),K.jsx("span",{style:{wordBreak:"break-word"},children:o.map(l=>Oh(l.value,r)).join(", ")})]},i)})]})}function Rh(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/_/g," ").replace(/^\w/,n=>n.toUpperCase())}function Oh(e,n){return e.length>n?e.slice(0,n-1)+"…":e}function Dh(){const e=jn();return{viz:e.viz,selectedNode:e.selectedNode,hoveredNode:e.hoveredNode}}const Lh=Object.freeze(Object.defineProperty({__proto__:null,NodePanel:zh,RdfGraph:Nh,RdfGraphContext:Fn,useRdfGraph:Dh,useRdfGraphContext:jn},Symbol.toStringTag,{value:"Module"}));export{Ot as E,pi as G,er as T,Zc as a,sf as b,lf as c,af as d,Tn as e,Ju as f,Qu as g,Lh as h,B as i,Ef as s,D as t,Dh as u};
|