ose-app 0.3.0__py3-none-any.whl → 0.3.1__py3-none-any.whl

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.
@@ -1,2 +1,2 @@
1
- import{d as Fn,r as I,A as Hn,a2 as Xn,K as Un,l as J,w as zt,o as Wn,c as j,a as tt,e as y,h as B,t as Y,D as $t,L as Le,a3 as Yn,Z as De,F as Ie,g as Be,x as ne,f as Gn,a4 as Kn,j as Qn,$ as Jn}from"./chunks/filter-CiYqP1_r.js";import{a as Ot,c as jn}from"./chunks/constants-CzBHF1EN.js";import"./chunks/index-sLCKmIWG-umQeu_-w.js";class ye{_edges;_nodes;_successors;_predecessors;get nodes(){return Array.from(this._nodes.values())}get edges(){return this._edges}get roots(){return this.nodes.filter(e=>this.predecessors(e.id).length===0)}get leaves(){return this.nodes.filter(e=>this.successors(e.id).length===0)}constructor(e=[],n=[]){this._nodes=new Map,this._edges=[],this._successors=new Map,this._predecessors=new Map;for(const i of e)this.addNode(i);for(const i of n)this.addEdge(i)}outgoingEdges(e){return this._edges.filter(n=>n.source===e)}incomingEdges(e){return this._edges.filter(n=>n.target===e)}node(e){return this._nodes.get(e)}addNode(e){this._nodes.set(e.id,e)}removeNode(e){const n=typeof e=="string"?e:e.id;this._nodes.delete(n),this._edges=this._edges.filter(i=>i.source!==n&&i.target!==n),this._successors.delete(n),this._predecessors.delete(n);for(const[i,r]of this._successors)r.delete(n);for(const[i,r]of this._predecessors)r.delete(n)}removeEdge(e){this._edges=this._edges.filter(n=>!(n.source===e.source&&n.target===e.target&&(!e.type||n.type===e.type))),this._successors.get(e.source)?.delete(e.target),this._predecessors.get(e.target)?.delete(e.source)}addEdge(e){this._edges.push(e);const n=this._nodes.has(e.source)===!1,i=this._nodes.has(e.target)===!1;n&&console.warn(`Trying to add edge '[${e.label||e.type}] ${e.source} -> ${e.target}' with unknown source node id '${e.source}'`),i&&console.warn(`Trying to add edge '[${e.label||e.type}] ${e.source} -> ${e.target}' with unknown target node id '${e.target}'`),!(n||i)&&(this._successors.has(e.source)||this._successors.set(e.source,new Set),this._successors.get(e.source).add(e.target),this._predecessors.has(e.target)||this._predecessors.set(e.target,new Set),this._predecessors.get(e.target).add(e.source))}successors(e){const n=typeof e=="string"?e:e.id;return Array.from(this._successors.get(n)||[]).map(i=>this._nodes.get(i))}predecessors(e){const n=typeof e=="string"?e:e.id;return Array.from(this._predecessors.get(n)||[]).map(i=>{const r=this._nodes.get(i);return r||console.error(`Inconsistent graph: predecessor node of '${n}' not found with id ${i}`),r}).filter(i=>!!i)}reachable(e){const n=new Set,i=[e];for(;i.length>0;){const r=i.pop();if(!n.has(r)){n.add(r);const s=this.successors(r);for(const a of s)n.has(a.id)||i.push(a.id)}}return n}backwardReachable(e){const n=new Set,i=[e];for(;i.length>0;){const r=i.pop();if(!n.has(r)){n.add(r);const s=this.predecessors(r);for(const a of s)n.has(a.id)||i.push(a.id)}}return n}clone(){return new ye(this.nodes.map(e=>({...e})),this.edges.map(e=>({...e})))}}var ti={value:()=>{}};function cn(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new Lt(n)}function Lt(t){this._=t}function ei(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Lt.prototype=cn.prototype={constructor:Lt,on:function(t,e){var n=this._,i=ei(t+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(t=i[s]).type)&&(r=ni(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(r=(t=i[s]).type)n[r]=Re(n[r],t.name,e);else if(e==null)for(r in n)n[r]=Re(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Lt(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],i=0,r=s.length;i<r;++i)s[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,s=i.length;r<s;++r)i[r].value.apply(e,n)}};function ni(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function Re(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=ti,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var fe="http://www.w3.org/1999/xhtml";const Oe={svg:"http://www.w3.org/2000/svg",xhtml:fe,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Oe.hasOwnProperty(e)?{space:Oe[e],local:t}:t}function ii(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===fe&&e.documentElement.namespaceURI===fe?e.createElement(t):e.createElementNS(n,t)}}function ri(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function un(t){var e=Gt(t);return(e.local?ri:ii)(e)}function oi(){}function _e(t){return t==null?oi:function(){return this.querySelector(t)}}function si(t){typeof t!="function"&&(t=_e(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],a=s.length,c=i[r]=new Array(a),u,l,o=0;o<a;++o)(u=s[o])&&(l=t.call(u,u.__data__,o,s))&&("__data__"in u&&(l.__data__=u.__data__),c[o]=l);return new A(i,this._parents)}function hn(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function ai(){return[]}function fn(t){return t==null?ai:function(){return this.querySelectorAll(t)}}function li(t){return function(){return hn(t.apply(this,arguments))}}function ci(t){typeof t=="function"?t=li(t):t=fn(t);for(var e=this._groups,n=e.length,i=[],r=[],s=0;s<n;++s)for(var a=e[s],c=a.length,u,l=0;l<c;++l)(u=a[l])&&(i.push(t.call(u,u.__data__,l,a)),r.push(u));return new A(i,r)}function dn(t){return function(){return this.matches(t)}}function pn(t){return function(e){return e.matches(t)}}var ui=Array.prototype.find;function hi(t){return function(){return ui.call(this.children,t)}}function fi(){return this.firstElementChild}function di(t){return this.select(t==null?fi:hi(typeof t=="function"?t:pn(t)))}var pi=Array.prototype.filter;function gi(){return Array.from(this.children)}function mi(t){return function(){return pi.call(this.children,t)}}function vi(t){return this.selectAll(t==null?gi:mi(typeof t=="function"?t:pn(t)))}function wi(t){typeof t!="function"&&(t=dn(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],a=s.length,c=i[r]=[],u,l=0;l<a;++l)(u=s[l])&&t.call(u,u.__data__,l,s)&&c.push(u);return new A(i,this._parents)}function gn(t){return new Array(t.length)}function yi(){return new A(this._enter||this._groups.map(gn),this._parents)}function qt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}qt.prototype={constructor:qt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function _i(t){return function(){return t}}function xi(t,e,n,i,r,s){for(var a=0,c,u=e.length,l=s.length;a<l;++a)(c=e[a])?(c.__data__=s[a],i[a]=c):n[a]=new qt(t,s[a]);for(;a<u;++a)(c=e[a])&&(r[a]=c)}function bi(t,e,n,i,r,s,a){var c,u,l=new Map,o=e.length,h=s.length,f=new Array(o),p;for(c=0;c<o;++c)(u=e[c])&&(f[c]=p=a.call(u,u.__data__,c,e)+"",l.has(p)?r[c]=u:l.set(p,u));for(c=0;c<h;++c)p=a.call(t,s[c],c,s)+"",(u=l.get(p))?(i[c]=u,u.__data__=s[c],l.delete(p)):n[c]=new qt(t,s[c]);for(c=0;c<o;++c)(u=e[c])&&l.get(f[c])===u&&(r[c]=u)}function Si(t){return t.__data__}function Ci(t,e){if(!arguments.length)return Array.from(this,Si);var n=e?bi:xi,i=this._parents,r=this._groups;typeof t!="function"&&(t=_i(t));for(var s=r.length,a=new Array(s),c=new Array(s),u=new Array(s),l=0;l<s;++l){var o=i[l],h=r[l],f=h.length,p=Ei(t.call(o,o&&o.__data__,l,i)),m=p.length,g=c[l]=new Array(m),d=a[l]=new Array(m),v=u[l]=new Array(f);n(o,h,g,d,v,p,e);for(var _=0,x=0,S,P;_<m;++_)if(S=g[_]){for(_>=x&&(x=_+1);!(P=d[x])&&++x<m;);S._next=P||null}}return a=new A(a,i),a._enter=c,a._exit=u,a}function Ei(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Mi(){return new A(this._exit||this._groups.map(gn),this._parents)}function Ni(t,e,n){var i=this.enter(),r=this,s=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?s.remove():n(s),i&&r?i.merge(r).order():r}function Ai(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,s=i.length,a=Math.min(r,s),c=new Array(r),u=0;u<a;++u)for(var l=n[u],o=i[u],h=l.length,f=c[u]=new Array(h),p,m=0;m<h;++m)(p=l[m]||o[m])&&(f[m]=p);for(;u<r;++u)c[u]=n[u];return new A(c,this._parents)}function ki(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i=t[e],r=i.length-1,s=i[r],a;--r>=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function zi(t){t||(t=$i);function e(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var a=n[s],c=a.length,u=r[s]=new Array(c),l,o=0;o<c;++o)(l=a[o])&&(u[o]=l);u.sort(e)}return new A(r,this._parents).order()}function $i(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Pi(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Ti(){return Array.from(this)}function Zi(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length;r<s;++r){var a=i[r];if(a)return a}return null}function Li(){let t=0;for(const e of this)++t;return t}function Di(){return!this.node()}function Ii(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r=e[n],s=0,a=r.length,c;s<a;++s)(c=r[s])&&t.call(c,c.__data__,s,r);return this}function Bi(t){return function(){this.removeAttribute(t)}}function Ri(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Oi(t,e){return function(){this.setAttribute(t,e)}}function qi(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Vi(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Fi(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Hi(t,e){var n=Gt(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?Ri:Bi:typeof e=="function"?n.local?Fi:Vi:n.local?qi:Oi)(n,e))}function mn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Xi(t){return function(){this.style.removeProperty(t)}}function Ui(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Wi(t,e,n){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function Yi(t,e,n){return arguments.length>1?this.each((e==null?Xi:typeof e=="function"?Wi:Ui)(t,e,n??"")):ct(this.node(),t)}function ct(t,e){return t.style.getPropertyValue(e)||mn(t).getComputedStyle(t,null).getPropertyValue(e)}function Gi(t){return function(){delete this[t]}}function Ki(t,e){return function(){this[t]=e}}function Qi(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ji(t,e){return arguments.length>1?this.each((e==null?Gi:typeof e=="function"?Qi:Ki)(t,e)):this.node()[t]}function vn(t){return t.trim().split(/^|\s+/)}function xe(t){return t.classList||new wn(t)}function wn(t){this._node=t,this._names=vn(t.getAttribute("class")||"")}wn.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function yn(t,e){for(var n=xe(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function _n(t,e){for(var n=xe(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function ji(t){return function(){yn(this,t)}}function tr(t){return function(){_n(this,t)}}function er(t,e){return function(){(e.apply(this,arguments)?yn:_n)(this,t)}}function nr(t,e){var n=vn(t+"");if(arguments.length<2){for(var i=xe(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?er:e?ji:tr)(n,e))}function ir(){this.textContent=""}function rr(t){return function(){this.textContent=t}}function or(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function sr(t){return arguments.length?this.each(t==null?ir:(typeof t=="function"?or:rr)(t)):this.node().textContent}function ar(){this.innerHTML=""}function lr(t){return function(){this.innerHTML=t}}function cr(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function ur(t){return arguments.length?this.each(t==null?ar:(typeof t=="function"?cr:lr)(t)):this.node().innerHTML}function hr(){this.nextSibling&&this.parentNode.appendChild(this)}function fr(){return this.each(hr)}function dr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function pr(){return this.each(dr)}function gr(t){var e=typeof t=="function"?t:un(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function mr(){return null}function vr(t,e){var n=typeof t=="function"?t:un(t),i=e==null?mr:typeof e=="function"?e:_e(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function wr(){var t=this.parentNode;t&&t.removeChild(this)}function yr(){return this.each(wr)}function _r(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function xr(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function br(t){return this.select(t?xr:_r)}function Sr(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Cr(t){return function(e){t.call(this,e,this.__data__)}}function Er(t){return t.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function Mr(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,r=e.length,s;n<r;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++i]=s;++i?e.length=i:delete this.__on}}}function Nr(t,e,n){return function(){var i=this.__on,r,s=Cr(e);if(i){for(var a=0,c=i.length;a<c;++a)if((r=i[a]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=e;return}}this.addEventListener(t.type,s,n),r={type:t.type,name:t.name,value:e,listener:s,options:n},i?i.push(r):this.__on=[r]}}function Ar(t,e,n){var i=Er(t+""),r,s=i.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,l=c.length,o;u<l;++u)for(r=0,o=c[u];r<s;++r)if((a=i[r]).type===o.type&&a.name===o.name)return o.value}return}for(c=e?Nr:Mr,r=0;r<s;++r)this.each(c(i[r],e,n));return this}function xn(t,e,n){var i=mn(t),r=i.CustomEvent;typeof r=="function"?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function kr(t,e){return function(){return xn(this,t,e)}}function zr(t,e){return function(){return xn(this,t,e.apply(this,arguments))}}function $r(t,e){return this.each((typeof e=="function"?zr:kr)(t,e))}function*Pr(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length,a;r<s;++r)(a=i[r])&&(yield a)}var be=[null];function A(t,e){this._groups=t,this._parents=e}function Et(){return new A([[document.documentElement]],be)}function Tr(){return this}A.prototype=Et.prototype={constructor:A,select:si,selectAll:ci,selectChild:di,selectChildren:vi,filter:wi,data:Ci,enter:yi,exit:Mi,join:Ni,merge:Ai,selection:Tr,order:ki,sort:zi,call:Pi,nodes:Ti,node:Zi,size:Li,empty:Di,each:Ii,attr:Hi,style:Yi,property:Ji,classed:nr,text:sr,html:ur,raise:fr,lower:pr,append:gr,insert:vr,remove:yr,clone:br,datum:Sr,on:Ar,dispatch:$r,[Symbol.iterator]:Pr};function R(t){return typeof t=="string"?new A([[document.querySelector(t)]],[document.documentElement]):new A([[t]],be)}function Vt(t){return typeof t=="string"?new A([document.querySelectorAll(t)],[document.documentElement]):new A([hn(t)],be)}function Se(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function bn(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Mt(){}var _t=.7,Ft=1/_t,lt="\\s*([+-]?\\d+)\\s*",xt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",U="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zr=/^#([0-9a-f]{3,8})$/,Lr=new RegExp(`^rgb\\(${lt},${lt},${lt}\\)$`),Dr=new RegExp(`^rgb\\(${U},${U},${U}\\)$`),Ir=new RegExp(`^rgba\\(${lt},${lt},${lt},${xt}\\)$`),Br=new RegExp(`^rgba\\(${U},${U},${U},${xt}\\)$`),Rr=new RegExp(`^hsl\\(${xt},${U},${U}\\)$`),Or=new RegExp(`^hsla\\(${xt},${U},${U},${xt}\\)$`),qe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Se(Mt,bt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ve,formatHex:Ve,formatHex8:qr,formatHsl:Vr,formatRgb:Fe,toString:Fe});function Ve(){return this.rgb().formatHex()}function qr(){return this.rgb().formatHex8()}function Vr(){return Sn(this).formatHsl()}function Fe(){return this.rgb().formatRgb()}function bt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Zr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?He(e):n===3?new $(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Pt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Pt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Lr.exec(t))?new $(e[1],e[2],e[3],1):(e=Dr.exec(t))?new $(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ir.exec(t))?Pt(e[1],e[2],e[3],e[4]):(e=Br.exec(t))?Pt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Rr.exec(t))?We(e[1],e[2]/100,e[3]/100,1):(e=Or.exec(t))?We(e[1],e[2]/100,e[3]/100,e[4]):qe.hasOwnProperty(t)?He(qe[t]):t==="transparent"?new $(NaN,NaN,NaN,0):null}function He(t){return new $(t>>16&255,t>>8&255,t&255,1)}function Pt(t,e,n,i){return i<=0&&(t=e=n=NaN),new $(t,e,n,i)}function Fr(t){return t instanceof Mt||(t=bt(t)),t?(t=t.rgb(),new $(t.r,t.g,t.b,t.opacity)):new $}function de(t,e,n,i){return arguments.length===1?Fr(t):new $(t,e,n,i??1)}function $(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}Se($,de,bn(Mt,{brighter(t){return t=t==null?Ft:Math.pow(Ft,t),new $(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?_t:Math.pow(_t,t),new $(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new $(rt(this.r),rt(this.g),rt(this.b),Ht(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Xe,formatHex:Xe,formatHex8:Hr,formatRgb:Ue,toString:Ue}));function Xe(){return`#${it(this.r)}${it(this.g)}${it(this.b)}`}function Hr(){return`#${it(this.r)}${it(this.g)}${it(this.b)}${it((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ue(){const t=Ht(this.opacity);return`${t===1?"rgb(":"rgba("}${rt(this.r)}, ${rt(this.g)}, ${rt(this.b)}${t===1?")":`, ${t})`}`}function Ht(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function rt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function it(t){return t=rt(t),(t<16?"0":"")+t.toString(16)}function We(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new O(t,e,n,i)}function Sn(t){if(t instanceof O)return new O(t.h,t.s,t.l,t.opacity);if(t instanceof Mt||(t=bt(t)),!t)return new O;if(t instanceof O)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),a=NaN,c=s-r,u=(s+r)/2;return c?(e===s?a=(n-i)/c+(n<i)*6:n===s?a=(i-e)/c+2:a=(e-n)/c+4,c/=u<.5?s+r:2-s-r,a*=60):c=u>0&&u<1?0:a,new O(a,c,u,t.opacity)}function Xr(t,e,n,i){return arguments.length===1?Sn(t):new O(t,e,n,i??1)}function O(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}Se(O,Xr,bn(Mt,{brighter(t){return t=t==null?Ft:Math.pow(Ft,t),new O(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?_t:Math.pow(_t,t),new O(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new $(ie(t>=240?t-240:t+120,r,i),ie(t,r,i),ie(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new O(Ye(this.h),Tt(this.s),Tt(this.l),Ht(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ht(this.opacity);return`${t===1?"hsl(":"hsla("}${Ye(this.h)}, ${Tt(this.s)*100}%, ${Tt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ye(t){return t=(t||0)%360,t<0?t+360:t}function Tt(t){return Math.max(0,Math.min(1,t||0))}function ie(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Cn=t=>()=>t;function Ur(t,e){return function(n){return t+n*e}}function Wr(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function Yr(t){return(t=+t)==1?En:function(e,n){return n-e?Wr(e,n,t):Cn(isNaN(e)?n:e)}}function En(t,e){var n=e-t;return n?Ur(t,n):Cn(isNaN(t)?e:t)}const Ge=(function t(e){var n=Yr(e);function i(r,s){var a=n((r=de(r)).r,(s=de(s)).r),c=n(r.g,s.g),u=n(r.b,s.b),l=En(r.opacity,s.opacity);return function(o){return r.r=a(o),r.g=c(o),r.b=u(o),r.opacity=l(o),r+""}}return i.gamma=t,i})(1);function et(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var pe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,re=new RegExp(pe.source,"g");function Gr(t){return function(){return t}}function Kr(t){return function(e){return t(e)+""}}function Qr(t,e){var n=pe.lastIndex=re.lastIndex=0,i,r,s,a=-1,c=[],u=[];for(t=t+"",e=e+"";(i=pe.exec(t))&&(r=re.exec(e));)(s=r.index)>n&&(s=e.slice(n,s),c[a]?c[a]+=s:c[++a]=s),(i=i[0])===(r=r[0])?c[a]?c[a]+=r:c[++a]=r:(c[++a]=null,u.push({i:a,x:et(i,r)})),n=re.lastIndex;return n<e.length&&(s=e.slice(n),c[a]?c[a]+=s:c[++a]=s),c.length<2?u[0]?Kr(u[0].x):Gr(e):(e=u.length,function(l){for(var o=0,h;o<e;++o)c[(h=u[o]).i]=h.x(l);return c.join("")})}var Ke=180/Math.PI,ge={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Mn(t,e,n,i,r,s){var a,c,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*i)&&(n-=t*u,i-=e*u),(c=Math.sqrt(n*n+i*i))&&(n/=c,i/=c,u/=c),t*i<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(e,t)*Ke,skewX:Math.atan(u)*Ke,scaleX:a,scaleY:c}}var Zt;function Jr(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ge:Mn(e.a,e.b,e.c,e.d,e.e,e.f)}function jr(t){return t==null||(Zt||(Zt=document.createElementNS("http://www.w3.org/2000/svg","g")),Zt.setAttribute("transform",t),!(t=Zt.transform.baseVal.consolidate()))?ge:(t=t.matrix,Mn(t.a,t.b,t.c,t.d,t.e,t.f))}function Nn(t,e,n,i){function r(l){return l.length?l.pop()+" ":""}function s(l,o,h,f,p,m){if(l!==h||o!==f){var g=p.push("translate(",null,e,null,n);m.push({i:g-4,x:et(l,h)},{i:g-2,x:et(o,f)})}else(h||f)&&p.push("translate("+h+e+f+n)}function a(l,o,h,f){l!==o?(l-o>180?o+=360:o-l>180&&(l+=360),f.push({i:h.push(r(h)+"rotate(",null,i)-2,x:et(l,o)})):o&&h.push(r(h)+"rotate("+o+i)}function c(l,o,h,f){l!==o?f.push({i:h.push(r(h)+"skewX(",null,i)-2,x:et(l,o)}):o&&h.push(r(h)+"skewX("+o+i)}function u(l,o,h,f,p,m){if(l!==h||o!==f){var g=p.push(r(p)+"scale(",null,",",null,")");m.push({i:g-4,x:et(l,h)},{i:g-2,x:et(o,f)})}else(h!==1||f!==1)&&p.push(r(p)+"scale("+h+","+f+")")}return function(l,o){var h=[],f=[];return l=t(l),o=t(o),s(l.translateX,l.translateY,o.translateX,o.translateY,h,f),a(l.rotate,o.rotate,h,f),c(l.skewX,o.skewX,h,f),u(l.scaleX,l.scaleY,o.scaleX,o.scaleY,h,f),l=o=null,function(p){for(var m=-1,g=f.length,d;++m<g;)h[(d=f[m]).i]=d.x(p);return h.join("")}}}var to=Nn(Jr,"px, ","px)","deg)"),eo=Nn(jr,", ",")",")"),ut=0,vt=0,gt=0,An=1e3,Xt,wt,Ut=0,ot=0,Kt=0,St=typeof performance=="object"&&performance.now?performance:Date,kn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ce(){return ot||(kn(no),ot=St.now()+Kt)}function no(){ot=0}function Wt(){this._call=this._time=this._next=null}Wt.prototype=zn.prototype={constructor:Wt,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ce():+n)+(e==null?0:+e),!this._next&&wt!==this&&(wt?wt._next=this:Xt=this,wt=this),this._call=t,this._time=n,me()},stop:function(){this._call&&(this._call=null,this._time=1/0,me())}};function zn(t,e,n){var i=new Wt;return i.restart(t,e,n),i}function io(){Ce(),++ut;for(var t=Xt,e;t;)(e=ot-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ut}function Qe(){ot=(Ut=St.now())+Kt,ut=vt=0;try{io()}finally{ut=0,oo(),ot=0}}function ro(){var t=St.now(),e=t-Ut;e>An&&(Kt-=e,Ut=t)}function oo(){for(var t,e=Xt,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Xt=n);wt=t,me(i)}function me(t){if(!ut){vt&&(vt=clearTimeout(vt));var e=t-ot;e>24?(t<1/0&&(vt=setTimeout(Qe,t-St.now()-Kt)),gt&&(gt=clearInterval(gt))):(gt||(Ut=St.now(),gt=setInterval(ro,An)),ut=1,kn(Qe))}}function Je(t,e,n){var i=new Wt;return e=e==null?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,n),i}var so=cn("start","end","cancel","interrupt"),ao=[],$n=0,je=1,ve=2,Dt=3,tn=4,we=5,It=6;function Qt(t,e,n,i,r,s){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;lo(t,n,{name:e,index:i,group:r,on:so,tween:ao,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:$n})}function Ee(t,e){var n=q(t,e);if(n.state>$n)throw new Error("too late; already scheduled");return n}function W(t,e){var n=q(t,e);if(n.state>Dt)throw new Error("too late; already running");return n}function q(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function lo(t,e,n){var i=t.__transition,r;i[e]=n,n.timer=zn(s,0,n.time);function s(l){n.state=je,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var o,h,f,p;if(n.state!==je)return u();for(o in i)if(p=i[o],p.name===n.name){if(p.state===Dt)return Je(a);p.state===tn?(p.state=It,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete i[o]):+o<e&&(p.state=It,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete i[o])}if(Je(function(){n.state===Dt&&(n.state=tn,n.timer.restart(c,n.delay,n.time),c(l))}),n.state=ve,n.on.call("start",t,t.__data__,n.index,n.group),n.state===ve){for(n.state=Dt,r=new Array(f=n.tween.length),o=0,h=-1;o<f;++o)(p=n.tween[o].value.call(t,t.__data__,n.index,n.group))&&(r[++h]=p);r.length=h+1}}function c(l){for(var o=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=we,1),h=-1,f=r.length;++h<f;)r[h].call(t,o);n.state===we&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=It,n.timer.stop(),delete i[e];for(var l in i)return;delete t.__transition}}function co(t,e){var n=t.__transition,i,r,s=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((i=n[a]).name!==e){s=!1;continue}r=i.state>ve&&i.state<we,i.state=It,i.timer.stop(),i.on.call(r?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete n[a]}s&&delete t.__transition}}function uo(t){return this.each(function(){co(this,t)})}function ho(t,e){var n,i;return function(){var r=W(this,t),s=r.tween;if(s!==n){i=n=s;for(var a=0,c=i.length;a<c;++a)if(i[a].name===e){i=i.slice(),i.splice(a,1);break}}r.tween=i}}function fo(t,e,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=W(this,t),a=s.tween;if(a!==i){r=(i=a).slice();for(var c={name:e,value:n},u=0,l=r.length;u<l;++u)if(r[u].name===e){r[u]=c;break}u===l&&r.push(c)}s.tween=r}}function po(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i=q(this.node(),n).tween,r=0,s=i.length,a;r<s;++r)if((a=i[r]).name===t)return a.value;return null}return this.each((e==null?ho:fo)(n,t,e))}function Me(t,e,n){var i=t._id;return t.each(function(){var r=W(this,i);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return q(r,i).value[e]}}function Pn(t,e){var n;return(typeof e=="number"?et:e instanceof bt?Ge:(n=bt(e))?(e=n,Ge):Qr)(t,e)}function go(t){return function(){this.removeAttribute(t)}}function mo(t){return function(){this.removeAttributeNS(t.space,t.local)}}function vo(t,e,n){var i,r=n+"",s;return function(){var a=this.getAttribute(t);return a===r?null:a===i?s:s=e(i=a,n)}}function wo(t,e,n){var i,r=n+"",s;return function(){var a=this.getAttributeNS(t.space,t.local);return a===r?null:a===i?s:s=e(i=a,n)}}function yo(t,e,n){var i,r,s;return function(){var a,c=n(this),u;return c==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=c+"",a===u?null:a===i&&u===r?s:(r=u,s=e(i=a,c)))}}function _o(t,e,n){var i,r,s;return function(){var a,c=n(this),u;return c==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=c+"",a===u?null:a===i&&u===r?s:(r=u,s=e(i=a,c)))}}function xo(t,e){var n=Gt(t),i=n==="transform"?eo:Pn;return this.attrTween(t,typeof e=="function"?(n.local?_o:yo)(n,i,Me(this,"attr."+t,e)):e==null?(n.local?mo:go)(n):(n.local?wo:vo)(n,i,e))}function bo(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function So(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Co(t,e){var n,i;function r(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&So(t,s)),n}return r._value=e,r}function Eo(t,e){var n,i;function r(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&bo(t,s)),n}return r._value=e,r}function Mo(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var i=Gt(t);return this.tween(n,(i.local?Co:Eo)(i,e))}function No(t,e){return function(){Ee(this,t).delay=+e.apply(this,arguments)}}function Ao(t,e){return e=+e,function(){Ee(this,t).delay=e}}function ko(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?No:Ao)(e,t)):q(this.node(),e).delay}function zo(t,e){return function(){W(this,t).duration=+e.apply(this,arguments)}}function $o(t,e){return e=+e,function(){W(this,t).duration=e}}function Po(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?zo:$o)(e,t)):q(this.node(),e).duration}function To(t,e){if(typeof e!="function")throw new Error;return function(){W(this,t).ease=e}}function Zo(t){var e=this._id;return arguments.length?this.each(To(e,t)):q(this.node(),e).ease}function Lo(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;W(this,t).ease=n}}function Do(t){if(typeof t!="function")throw new Error;return this.each(Lo(this._id,t))}function Io(t){typeof t!="function"&&(t=dn(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],a=s.length,c=i[r]=[],u,l=0;l<a;++l)(u=s[l])&&t.call(u,u.__data__,l,s)&&c.push(u);return new K(i,this._parents,this._name,this._id)}function Bo(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,s=Math.min(i,r),a=new Array(i),c=0;c<s;++c)for(var u=e[c],l=n[c],o=u.length,h=a[c]=new Array(o),f,p=0;p<o;++p)(f=u[p]||l[p])&&(h[p]=f);for(;c<i;++c)a[c]=e[c];return new K(a,this._parents,this._name,this._id)}function Ro(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Oo(t,e,n){var i,r,s=Ro(e)?Ee:W;return function(){var a=s(this,t),c=a.on;c!==i&&(r=(i=c).copy()).on(e,n),a.on=r}}function qo(t,e){var n=this._id;return arguments.length<2?q(this.node(),n).on.on(t):this.each(Oo(n,t,e))}function Vo(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Fo(){return this.on("end.remove",Vo(this._id))}function Ho(t){var e=this._name,n=this._id;typeof t!="function"&&(t=_e(t));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a<r;++a)for(var c=i[a],u=c.length,l=s[a]=new Array(u),o,h,f=0;f<u;++f)(o=c[f])&&(h=t.call(o,o.__data__,f,c))&&("__data__"in o&&(h.__data__=o.__data__),l[f]=h,Qt(l[f],e,n,f,l,q(o,n)));return new K(s,this._parents,e,n)}function Xo(t){var e=this._name,n=this._id;typeof t!="function"&&(t=fn(t));for(var i=this._groups,r=i.length,s=[],a=[],c=0;c<r;++c)for(var u=i[c],l=u.length,o,h=0;h<l;++h)if(o=u[h]){for(var f=t.call(o,o.__data__,h,u),p,m=q(o,n),g=0,d=f.length;g<d;++g)(p=f[g])&&Qt(p,e,n,g,f,m);s.push(f),a.push(o)}return new K(s,a,e,n)}var Uo=Et.prototype.constructor;function Wo(){return new Uo(this._groups,this._parents)}function Yo(t,e){var n,i,r;return function(){var s=ct(this,t),a=(this.style.removeProperty(t),ct(this,t));return s===a?null:s===n&&a===i?r:r=e(n=s,i=a)}}function Tn(t){return function(){this.style.removeProperty(t)}}function Go(t,e,n){var i,r=n+"",s;return function(){var a=ct(this,t);return a===r?null:a===i?s:s=e(i=a,n)}}function Ko(t,e,n){var i,r,s;return function(){var a=ct(this,t),c=n(this),u=c+"";return c==null&&(u=c=(this.style.removeProperty(t),ct(this,t))),a===u?null:a===i&&u===r?s:(r=u,s=e(i=a,c))}}function Qo(t,e){var n,i,r,s="style."+e,a="end."+s,c;return function(){var u=W(this,t),l=u.on,o=u.value[s]==null?c||(c=Tn(e)):void 0;(l!==n||r!==o)&&(i=(n=l).copy()).on(a,r=o),u.on=i}}function Jo(t,e,n){var i=(t+="")=="transform"?to:Pn;return e==null?this.styleTween(t,Yo(t,i)).on("end.style."+t,Tn(t)):typeof e=="function"?this.styleTween(t,Ko(t,i,Me(this,"style."+t,e))).each(Qo(this._id,t)):this.styleTween(t,Go(t,i,e),n).on("end.style."+t,null)}function jo(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function ts(t,e,n){var i,r;function s(){var a=e.apply(this,arguments);return a!==r&&(i=(r=a)&&jo(t,a,n)),i}return s._value=e,s}function es(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;return this.tween(i,ts(t,e,n??""))}function ns(t){return function(){this.textContent=t}}function is(t){return function(){var e=t(this);this.textContent=e??""}}function rs(t){return this.tween("text",typeof t=="function"?is(Me(this,"text",t)):ns(t==null?"":t+""))}function os(t){return function(e){this.textContent=t.call(this,e)}}function ss(t){var e,n;function i(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&os(r)),e}return i._value=t,i}function as(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,ss(t))}function ls(){for(var t=this._name,e=this._id,n=Zn(),i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],c=a.length,u,l=0;l<c;++l)if(u=a[l]){var o=q(u,e);Qt(u,t,n,l,a,{time:o.time+o.delay+o.duration,delay:0,duration:o.duration,ease:o.ease})}return new K(i,this._parents,t,n)}function cs(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(s,a){var c={value:a},u={value:function(){--r===0&&s()}};n.each(function(){var l=W(this,i),o=l.on;o!==t&&(e=(t=o).copy(),e._.cancel.push(c),e._.interrupt.push(c),e._.end.push(u)),l.on=e}),r===0&&s()})}var us=0;function K(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Zn(){return++us}var G=Et.prototype;K.prototype={constructor:K,select:Ho,selectAll:Xo,selectChild:G.selectChild,selectChildren:G.selectChildren,filter:Io,merge:Bo,selection:Wo,transition:ls,call:G.call,nodes:G.nodes,node:G.node,size:G.size,empty:G.empty,each:G.each,on:qo,attr:xo,attrTween:Mo,style:Jo,styleTween:es,text:rs,textTween:as,remove:Fo,tween:po,delay:ko,duration:Po,ease:Zo,easeVarying:Do,end:cs,[Symbol.iterator]:G[Symbol.iterator]};function hs(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var fs={time:null,delay:0,duration:250,ease:hs};function ds(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function ps(t){var e,n;t instanceof K?(e=t._id,t=t._name):(e=Zn(),(n=fs).time=Ce(),t=t==null?null:t+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],c=a.length,u,l=0;l<c;++l)(u=a[l])&&Qt(u,t,e,l,a,n||ds(u,e));return new K(i,this._parents,t,e)}Et.prototype.interrupt=uo;Et.prototype.transition=ps;function gs(t){var e=0,n=t.children,i=n&&n.length;if(!i)e=1;else for(;--i>=0;)e+=n[i].value;t.value=e}function ms(){return this.eachAfter(gs)}function vs(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this}function ws(t,e){for(var n=this,i=[n],r,s,a=-1;n=i.pop();)if(t.call(e,n,++a,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function ys(t,e){for(var n=this,i=[n],r=[],s,a,c,u=-1;n=i.pop();)if(r.push(n),s=n.children)for(a=0,c=s.length;a<c;++a)i.push(s[a]);for(;n=r.pop();)t.call(e,n,++u,this);return this}function _s(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i}function xs(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})}function bs(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Ss(t){for(var e=this,n=Cs(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i}function Cs(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}function Es(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Ms(){return Array.from(this)}function Ns(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function As(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*ks(){var t=this,e,n=[t],i,r,s;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,i=t.children)for(r=0,s=i.length;r<s;++r)n.push(i[r]);while(n.length)}function Ne(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=Ps)):e===void 0&&(e=$s);for(var n=new Ct(t),i,r=[n],s,a,c,u;i=r.pop();)if((a=e(i.data))&&(u=(a=Array.from(a)).length))for(i.children=a,c=u-1;c>=0;--c)r.push(s=a[c]=new Ct(a[c])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(Zs)}function zs(){return Ne(this).eachBefore(Ts)}function $s(t){return t.children}function Ps(t){return Array.isArray(t)?t[1]:null}function Ts(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Zs(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Ct(t){this.data=t,this.depth=this.height=0,this.parent=null}Ct.prototype=Ne.prototype={constructor:Ct,count:ms,each:vs,eachAfter:ys,eachBefore:ws,find:_s,sum:xs,sort:bs,path:Ss,ancestors:Es,descendants:Ms,leaves:Ns,links:As,copy:zs,[Symbol.iterator]:ks};function Ls(t,e){return t.parent===e.parent?1:2}function oe(t){var e=t.children;return e?e[0]:t.t}function se(t){var e=t.children;return e?e[e.length-1]:t.t}function Ds(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function Is(t){for(var e=0,n=0,i=t.children,r=i.length,s;--r>=0;)s=i[r],s.z+=e,s.m+=e,e+=s.s+(n+=s.c)}function Bs(t,e,n){return t.a.parent===e.parent?t.a:n}function Bt(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}Bt.prototype=Object.create(Ct.prototype);function Rs(t){for(var e=new Bt(t,0),n,i=[e],r,s,a,c;n=i.pop();)if(s=n._.children)for(n.children=new Array(c=s.length),a=c-1;a>=0;--a)i.push(r=n.children[a]=new Bt(s[a],a)),r.parent=n;return(e.parent=new Bt(null,0)).children=[e],e}function Os(){var t=Ls,e=1,n=1,i=null;function r(l){var o=Rs(l);if(o.eachAfter(s),o.parent.m=-o.z,o.eachBefore(a),i)l.eachBefore(u);else{var h=l,f=l,p=l;l.eachBefore(function(_){_.x<h.x&&(h=_),_.x>f.x&&(f=_),_.depth>p.depth&&(p=_)});var m=h===f?1:t(h,f)/2,g=m-h.x,d=e/(f.x+m+g),v=n/(p.depth||1);l.eachBefore(function(_){_.x=(_.x+g)*d,_.y=_.depth*v})}return l}function s(l){var o=l.children,h=l.parent.children,f=l.i?h[l.i-1]:null;if(o){Is(l);var p=(o[0].z+o[o.length-1].z)/2;f?(l.z=f.z+t(l._,f._),l.m=l.z-p):l.z=p}else f&&(l.z=f.z+t(l._,f._));l.parent.A=c(l,f,l.parent.A||h[0])}function a(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function c(l,o,h){if(o){for(var f=l,p=l,m=o,g=f.parent.children[0],d=f.m,v=p.m,_=m.m,x=g.m,S;m=se(m),f=oe(f),m&&f;)g=oe(g),p=se(p),p.a=l,S=m.z+_-f.z-d+t(m._,f._),S>0&&(Ds(Bs(m,l,h),l,S),d+=S,v+=S),_+=m.m,d+=f.m,x+=g.m,v+=p.m;m&&!se(p)&&(p.t=m,p.m+=_-v),f&&!oe(g)&&(g.t=f,g.m+=d-x,h=l)}return h}function u(l){l.x*=e,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(t=l,r):t},r.size=function(l){return arguments.length?(i=!1,e=+l[0],n=+l[1],r):i?null:[e,n]},r.nodeSize=function(l){return arguments.length?(i=!0,e=+l[0],n=+l[1],r):i?[e,n]:null},r}function yt(t,e,n){this.k=t,this.x=e,this.y=n}yt.prototype={constructor:yt,scale:function(t){return t===1?this:new yt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new yt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};yt.prototype;function qs(t,e){const n=new Set;for(const c of t.nodes){const u=c.curationStatus,l=c.visualDepth,o=c.source==="current",h=l<0,f=l>0,p=l===0,m=e.curationFilter.includes(u),g=l<=(e.numChildLevels??1/0),d=o||p||h&&e.showParentsFromOtherSheets||f&&e.showChildrenFromOtherSheets;m&&g&&d&&n.add(c.id)}const i=t.nodes.filter(c=>n.has(c.id)),r=t.edges.filter(c=>n.has(c.source)&&n.has(c.target)),s=r.filter(c=>c.type==="subclass_of"),a=r.filter(c=>c.type!=="subclass_of");return{nodes:i,hierarchyEdges:s,relationEdges:a}}function Vs(t,e){const n=new Map,i=new Map;for(const u of e)n.has(u.source)||n.set(u.source,[]),n.get(u.source).push(u.target),i.set(u.target,u.source);const r=t.filter(u=>!i.has(u.id)),s=new Map;for(const u of t)s.set(u.id,u);function a(u){const l=s.get(u);if(!l)return null;const o=[],h=n.get(u)??[];for(const f of h){const p=a(f);p&&o.push(p)}return{id:l.id,label:l.label,ose_curation:l.curationStatus,ose_origin:l.origin,ose_source:l.source,ose_selected:l.isSelected,children:o}}const c=[];for(const u of r){const l=a(u.id);l&&c.push(l)}return c}function Fs(t,e){const n=t.trim().toLowerCase();if(Vt(".node").classed("search-match",!1).classed("search-current",!1),!n)return[];const i=[];return Vt(".node").each(function(){const r=R(this),s=r.attr("data-node-id"),a=e[s]||"",c=s?.replace("_",":")||"";(a.toLowerCase().includes(n)||c.toLowerCase().includes(n))&&(i.push(s),r.classed("search-match",!0))}),i}function Hs(t){Vt(".node").classed("search-current",!1),R(`.node[data-node-id="${t}"]`).classed("search-current",!0)}function Xs(){Vt(".node").classed("search-match",!1).classed("search-current",!1)}function Us(t,e,n){const i=document.querySelector(`.node[data-node-id="${t}"]`);if(!i)return console.warn("Node element not found:",t),!1;const r=e.querySelector("svg");if(!r)return!1;const s=r.querySelector(".graph-container");if(!s)return!1;const a=i.getBBox();let c=a.x+a.width/2,u=a.y+a.height/2,l=i;for(;l&&l!==s;){const m=l.getAttribute("transform");if(m){const g=m.match(/translate\(([^,]+),([^)]+)\)/);g&&(c+=parseFloat(g[1]),u+=parseFloat(g[2]))}if(l=l.parentElement,!l||l===r)break}const o=n.getSizes().realZoom,h=n.getSizes(),f=h.width/2-c*o,p=h.height/2-u*o;return n.pan({x:f,y:p}),!0}function Ws(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ae,en;function Ys(){return en||(en=1,ae=(function(){var t="",e,n,i,r=[],s={passive:!0},a={passive:!1};window.addEventListener?(e="addEventListener",n="removeEventListener"):(e="attachEvent",n="detachEvent",t="on"),i="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";function c(m,g){var d=function(v){!v&&(v=window.event);var _={originalEvent:v,target:v.target||v.srcElement,type:"wheel",deltaMode:v.type=="MozMousePixelScroll"?0:1,deltaX:0,delatZ:0,preventDefault:function(){v.preventDefault?v.preventDefault():v.returnValue=!1}};return i=="mousewheel"?(_.deltaY=-.025*v.wheelDelta,v.wheelDeltaX&&(_.deltaX=-.025*v.wheelDeltaX)):_.deltaY=v.detail,g(_)};return r.push({element:m,fn:d}),d}function u(m){for(var g=0;g<r.length;g++)if(r[g].element===m)return r[g].fn;return function(){}}function l(m){for(var g=0;g<r.length;g++)if(r[g].element===m)return r.splice(g,1)}function o(m,g,d,v){var _;i==="wheel"?_=d:_=c(m,d),m[e](t+g,_,v?s:a)}function h(m,g,d,v){var _;i==="wheel"?_=d:_=u(m),m[n](t+g,_,v?s:a),l(m)}function f(m,g,d){o(m,i,g,d),i=="DOMMouseScroll"&&o(m,"MozMousePixelScroll",g,d)}function p(m,g,d){h(m,i,g,d),i=="DOMMouseScroll"&&h(m,"MozMousePixelScroll",g,d)}return{on:f,off:p}})()),ae}var le,nn;function Ae(){if(nn)return le;nn=1,le={extend:function(e,n){e=e||{};for(var i in n)this.isObject(n[i])?e[i]=this.extend(e[i],n[i]):e[i]=n[i];return e},isElement:function(e){return e instanceof HTMLElement||e instanceof SVGElement||e instanceof SVGSVGElement||e&&typeof e=="object"&&e!==null&&e.nodeType===1&&typeof e.nodeName=="string"},isObject:function(e){return Object.prototype.toString.call(e)==="[object Object]"},isNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},getSvg:function(e){var n,i;if(this.isElement(e))n=e;else if(typeof e=="string"||e instanceof String){if(n=document.querySelector(e),!n)throw new Error("Provided selector did not find any elements. Selector: "+e)}else throw new Error("Provided selector is not an HTML object nor String");if(n.tagName.toLowerCase()==="svg")i=n;else if(n.tagName.toLowerCase()==="object")i=n.contentDocument.documentElement;else if(n.tagName.toLowerCase()==="embed")i=n.getSVGDocument().documentElement;else throw n.tagName.toLowerCase()==="img"?new Error('Cannot script an SVG in an "img" element. Please use an "object" element or an in-line SVG.'):new Error("Cannot get SVG.");return i},proxy:function(e,n){return function(){return e.apply(n,arguments)}},getType:function(e){return Object.prototype.toString.apply(e).replace(/^\[object\s/,"").replace(/\]$/,"")},mouseAndTouchNormalize:function(e,n){if(e.clientX===void 0||e.clientX===null)if(e.clientX=0,e.clientY=0,e.touches!==void 0&&e.touches.length){if(e.touches[0].clientX!==void 0)e.clientX=e.touches[0].clientX,e.clientY=e.touches[0].clientY;else if(e.touches[0].pageX!==void 0){var i=n.getBoundingClientRect();e.clientX=e.touches[0].pageX-i.left,e.clientY=e.touches[0].pageY-i.top}}else e.originalEvent!==void 0&&e.originalEvent.clientX!==void 0&&(e.clientX=e.originalEvent.clientX,e.clientY=e.originalEvent.clientY)},isDblClick:function(e,n){if(e.detail===2)return!0;if(n!=null){var i=e.timeStamp-n.timeStamp,r=Math.sqrt(Math.pow(e.clientX-n.clientX,2)+Math.pow(e.clientY-n.clientY,2));return i<250&&r<10}return!1},now:Date.now||function(){return new Date().getTime()},throttle:function(e,n,i){var r=this,s,a,c,u=null,l=0;i||(i={});var o=function(){l=i.leading===!1?0:r.now(),u=null,c=e.apply(s,a),u||(s=a=null)};return function(){var h=r.now();!l&&i.leading===!1&&(l=h);var f=n-(h-l);return s=this,a=arguments,f<=0||f>n?(clearTimeout(u),u=null,l=h,c=e.apply(s,a),u||(s=a=null)):!u&&i.trailing!==!1&&(u=setTimeout(o,f)),c}},createRequestAnimationFrame:function(e){var n=null;return e!=="auto"&&e<60&&e>1&&(n=Math.floor(1e3/e)),n===null?window.requestAnimationFrame||t(33):t(n)}};function t(e){return function(n){window.setTimeout(n,e)}}return le}var mt,rn;function ke(){if(rn)return mt;rn=1;var t=Ae(),e="unknown";return document.documentMode&&(e="ie"),mt={svgNS:"http://www.w3.org/2000/svg",xmlNS:"http://www.w3.org/XML/1998/namespace",xmlnsNS:"http://www.w3.org/2000/xmlns/",xlinkNS:"http://www.w3.org/1999/xlink",evNS:"http://www.w3.org/2001/xml-events",getBoundingClientRectNormalized:function(n){if(n.clientWidth&&n.clientHeight)return{width:n.clientWidth,height:n.clientHeight};if(n.getBoundingClientRect())return n.getBoundingClientRect();throw new Error("Cannot get BoundingClientRect for SVG.")},getOrCreateViewport:function(n,i){var r=null;if(t.isElement(i)?r=i:r=n.querySelector(i),!r){var s=Array.prototype.slice.call(n.childNodes||n.children).filter(function(o){return o.nodeName!=="defs"&&o.nodeName!=="#text"});s.length===1&&s[0].nodeName==="g"&&s[0].getAttribute("transform")===null&&(r=s[0])}if(!r){var a="viewport-"+new Date().toISOString().replace(/\D/g,"");r=document.createElementNS(this.svgNS,"g"),r.setAttribute("id",a);var c=n.childNodes||n.children;if(c&&c.length>0)for(var u=c.length;u>0;u--)c[c.length-u].nodeName!=="defs"&&r.appendChild(c[c.length-u]);n.appendChild(r)}var l=[];return r.getAttribute("class")&&(l=r.getAttribute("class").split(" ")),~l.indexOf("svg-pan-zoom_viewport")||(l.push("svg-pan-zoom_viewport"),r.setAttribute("class",l.join(" "))),r},setupSvgAttributes:function(n){if(n.setAttribute("xmlns",this.svgNS),n.setAttributeNS(this.xmlnsNS,"xmlns:xlink",this.xlinkNS),n.setAttributeNS(this.xmlnsNS,"xmlns:ev",this.evNS),n.parentNode!==null){var i=n.getAttribute("style")||"";i.toLowerCase().indexOf("overflow")===-1&&n.setAttribute("style","overflow: hidden; "+i)}},internetExplorerRedisplayInterval:300,refreshDefsGlobal:t.throttle(function(){for(var n=document.querySelectorAll("defs"),i=n.length,r=0;r<i;r++){var s=n[r];s.parentNode.insertBefore(s,s)}},mt?mt.internetExplorerRedisplayInterval:null),setCTM:function(n,i,r){var s=this,a="matrix("+i.a+","+i.b+","+i.c+","+i.d+","+i.e+","+i.f+")";n.setAttributeNS(null,"transform",a),"transform"in n.style?n.style.transform=a:"-ms-transform"in n.style?n.style["-ms-transform"]=a:"-webkit-transform"in n.style&&(n.style["-webkit-transform"]=a),e==="ie"&&r&&(r.parentNode.insertBefore(r,r),window.setTimeout(function(){s.refreshDefsGlobal()},s.internetExplorerRedisplayInterval))},getEventPoint:function(n,i){var r=i.createSVGPoint();return t.mouseAndTouchNormalize(n,i),r.x=n.clientX,r.y=n.clientY,r},getSvgCenterPoint:function(n,i,r){return this.createSVGPoint(n,i/2,r/2)},createSVGPoint:function(n,i,r){var s=n.createSVGPoint();return s.x=i,s.y=r,s}},mt}var ce,on;function Gs(){if(on)return ce;on=1;var t=ke();return ce={enable:function(e){var n=e.svg.querySelector("defs");n||(n=document.createElementNS(t.svgNS,"defs"),e.svg.appendChild(n));var i=n.querySelector("style#svg-pan-zoom-controls-styles");if(!i){var r=document.createElementNS(t.svgNS,"style");r.setAttribute("id","svg-pan-zoom-controls-styles"),r.setAttribute("type","text/css"),r.textContent=".svg-pan-zoom-control { cursor: pointer; fill: black; fill-opacity: 0.333; } .svg-pan-zoom-control:hover { fill-opacity: 0.8; } .svg-pan-zoom-control-background { fill: white; fill-opacity: 0.5; } .svg-pan-zoom-control-background { fill-opacity: 0.8; }",n.appendChild(r)}var s=document.createElementNS(t.svgNS,"g");s.setAttribute("id","svg-pan-zoom-controls"),s.setAttribute("transform","translate("+(e.width-70)+" "+(e.height-76)+") scale(0.75)"),s.setAttribute("class","svg-pan-zoom-control"),s.appendChild(this._createZoomIn(e)),s.appendChild(this._createZoomReset(e)),s.appendChild(this._createZoomOut(e)),e.svg.appendChild(s),e.controlIcons=s},_createZoomIn:function(e){var n=document.createElementNS(t.svgNS,"g");n.setAttribute("id","svg-pan-zoom-zoom-in"),n.setAttribute("transform","translate(30.5 5) scale(0.015)"),n.setAttribute("class","svg-pan-zoom-control"),n.addEventListener("click",function(){e.getPublicInstance().zoomIn()},!1),n.addEventListener("touchstart",function(){e.getPublicInstance().zoomIn()},!1);var i=document.createElementNS(t.svgNS,"rect");i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("width","1500"),i.setAttribute("height","1400"),i.setAttribute("class","svg-pan-zoom-control-background"),n.appendChild(i);var r=document.createElementNS(t.svgNS,"path");return r.setAttribute("d","M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z"),r.setAttribute("class","svg-pan-zoom-control-element"),n.appendChild(r),n},_createZoomReset:function(e){var n=document.createElementNS(t.svgNS,"g");n.setAttribute("id","svg-pan-zoom-reset-pan-zoom"),n.setAttribute("transform","translate(5 35) scale(0.4)"),n.setAttribute("class","svg-pan-zoom-control"),n.addEventListener("click",function(){e.getPublicInstance().reset()},!1),n.addEventListener("touchstart",function(){e.getPublicInstance().reset()},!1);var i=document.createElementNS(t.svgNS,"rect");i.setAttribute("x","2"),i.setAttribute("y","2"),i.setAttribute("width","182"),i.setAttribute("height","58"),i.setAttribute("class","svg-pan-zoom-control-background"),n.appendChild(i);var r=document.createElementNS(t.svgNS,"path");r.setAttribute("d","M33.051,20.632c-0.742-0.406-1.854-0.609-3.338-0.609h-7.969v9.281h7.769c1.543,0,2.701-0.188,3.473-0.562c1.365-0.656,2.048-1.953,2.048-3.891C35.032,22.757,34.372,21.351,33.051,20.632z"),r.setAttribute("class","svg-pan-zoom-control-element"),n.appendChild(r);var s=document.createElementNS(t.svgNS,"path");return s.setAttribute("d","M170.231,0.5H15.847C7.102,0.5,0.5,5.708,0.5,11.84v38.861C0.5,56.833,7.102,61.5,15.847,61.5h154.384c8.745,0,15.269-4.667,15.269-10.798V11.84C185.5,5.708,178.976,0.5,170.231,0.5z M42.837,48.569h-7.969c-0.219-0.766-0.375-1.383-0.469-1.852c-0.188-0.969-0.289-1.961-0.305-2.977l-0.047-3.211c-0.03-2.203-0.41-3.672-1.142-4.406c-0.732-0.734-2.103-1.102-4.113-1.102h-7.05v13.547h-7.055V14.022h16.524c2.361,0.047,4.178,0.344,5.45,0.891c1.272,0.547,2.351,1.352,3.234,2.414c0.731,0.875,1.31,1.844,1.737,2.906s0.64,2.273,0.64,3.633c0,1.641-0.414,3.254-1.242,4.84s-2.195,2.707-4.102,3.363c1.594,0.641,2.723,1.551,3.387,2.73s0.996,2.98,0.996,5.402v2.32c0,1.578,0.063,2.648,0.19,3.211c0.19,0.891,0.635,1.547,1.333,1.969V48.569z M75.579,48.569h-26.18V14.022h25.336v6.117H56.454v7.336h16.781v6H56.454v8.883h19.125V48.569z M104.497,46.331c-2.44,2.086-5.887,3.129-10.34,3.129c-4.548,0-8.125-1.027-10.731-3.082s-3.909-4.879-3.909-8.473h6.891c0.224,1.578,0.662,2.758,1.316,3.539c1.196,1.422,3.246,2.133,6.15,2.133c1.739,0,3.151-0.188,4.236-0.562c2.058-0.719,3.087-2.055,3.087-4.008c0-1.141-0.504-2.023-1.512-2.648c-1.008-0.609-2.607-1.148-4.796-1.617l-3.74-0.82c-3.676-0.812-6.201-1.695-7.576-2.648c-2.328-1.594-3.492-4.086-3.492-7.477c0-3.094,1.139-5.664,3.417-7.711s5.623-3.07,10.036-3.07c3.685,0,6.829,0.965,9.431,2.895c2.602,1.93,3.966,4.73,4.093,8.402h-6.938c-0.128-2.078-1.057-3.555-2.787-4.43c-1.154-0.578-2.587-0.867-4.301-0.867c-1.907,0-3.428,0.375-4.565,1.125c-1.138,0.75-1.706,1.797-1.706,3.141c0,1.234,0.561,2.156,1.682,2.766c0.721,0.406,2.25,0.883,4.589,1.43l6.063,1.43c2.657,0.625,4.648,1.461,5.975,2.508c2.059,1.625,3.089,3.977,3.089,7.055C108.157,41.624,106.937,44.245,104.497,46.331z M139.61,48.569h-26.18V14.022h25.336v6.117h-18.281v7.336h16.781v6h-16.781v8.883h19.125V48.569z M170.337,20.14h-10.336v28.43h-7.266V20.14h-10.383v-6.117h27.984V20.14z"),s.setAttribute("class","svg-pan-zoom-control-element"),n.appendChild(s),n},_createZoomOut:function(e){var n=document.createElementNS(t.svgNS,"g");n.setAttribute("id","svg-pan-zoom-zoom-out"),n.setAttribute("transform","translate(30.5 70) scale(0.015)"),n.setAttribute("class","svg-pan-zoom-control"),n.addEventListener("click",function(){e.getPublicInstance().zoomOut()},!1),n.addEventListener("touchstart",function(){e.getPublicInstance().zoomOut()},!1);var i=document.createElementNS(t.svgNS,"rect");i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("width","1500"),i.setAttribute("height","1400"),i.setAttribute("class","svg-pan-zoom-control-background"),n.appendChild(i);var r=document.createElementNS(t.svgNS,"path");return r.setAttribute("d","M1280 576v128q0 26 -19 45t-45 19h-896q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h896q26 0 45 19t19 45zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z"),r.setAttribute("class","svg-pan-zoom-control-element"),n.appendChild(r),n},disable:function(e){e.controlIcons&&(e.controlIcons.parentNode.removeChild(e.controlIcons),e.controlIcons=null)}},ce}var ue,sn;function Ks(){if(sn)return ue;sn=1;var t=ke(),e=Ae(),n=function(i,r){this.init(i,r)};return n.prototype.init=function(i,r){this.viewport=i,this.options=r,this.originalState={zoom:1,x:0,y:0},this.activeState={zoom:1,x:0,y:0},this.updateCTMCached=e.proxy(this.updateCTM,this),this.requestAnimationFrame=e.createRequestAnimationFrame(this.options.refreshRate),this.viewBox={x:0,y:0,width:0,height:0},this.cacheViewBox();var s=this.processCTM();this.setCTM(s),this.updateCTM()},n.prototype.cacheViewBox=function(){var i=this.options.svg.getAttribute("viewBox");if(i){var r=i.split(/[\s\,]/).filter(function(a){return a}).map(parseFloat);this.viewBox.x=r[0],this.viewBox.y=r[1],this.viewBox.width=r[2],this.viewBox.height=r[3];var s=Math.min(this.options.width/this.viewBox.width,this.options.height/this.viewBox.height);this.activeState.zoom=s,this.activeState.x=(this.options.width-this.viewBox.width*s)/2,this.activeState.y=(this.options.height-this.viewBox.height*s)/2,this.updateCTMOnNextFrame(),this.options.svg.removeAttribute("viewBox")}else this.simpleViewBoxCache()},n.prototype.simpleViewBoxCache=function(){var i=this.viewport.getBBox();this.viewBox.x=i.x,this.viewBox.y=i.y,this.viewBox.width=i.width,this.viewBox.height=i.height},n.prototype.getViewBox=function(){return e.extend({},this.viewBox)},n.prototype.processCTM=function(){var i=this.getCTM();if(this.options.fit||this.options.contain){var r;this.options.fit?r=Math.min(this.options.width/this.viewBox.width,this.options.height/this.viewBox.height):r=Math.max(this.options.width/this.viewBox.width,this.options.height/this.viewBox.height),i.a=r,i.d=r,i.e=-this.viewBox.x*r,i.f=-this.viewBox.y*r}if(this.options.center){var s=(this.options.width-(this.viewBox.width+this.viewBox.x*2)*i.a)*.5,a=(this.options.height-(this.viewBox.height+this.viewBox.y*2)*i.a)*.5;i.e=s,i.f=a}return this.originalState.zoom=i.a,this.originalState.x=i.e,this.originalState.y=i.f,i},n.prototype.getOriginalState=function(){return e.extend({},this.originalState)},n.prototype.getState=function(){return e.extend({},this.activeState)},n.prototype.getZoom=function(){return this.activeState.zoom},n.prototype.getRelativeZoom=function(){return this.activeState.zoom/this.originalState.zoom},n.prototype.computeRelativeZoom=function(i){return i/this.originalState.zoom},n.prototype.getPan=function(){return{x:this.activeState.x,y:this.activeState.y}},n.prototype.getCTM=function(){var i=this.options.svg.createSVGMatrix();return i.a=this.activeState.zoom,i.b=0,i.c=0,i.d=this.activeState.zoom,i.e=this.activeState.x,i.f=this.activeState.y,i},n.prototype.setCTM=function(i){var r=this.isZoomDifferent(i),s=this.isPanDifferent(i);if(r||s){if(r&&(this.options.beforeZoom(this.getRelativeZoom(),this.computeRelativeZoom(i.a))===!1?(i.a=i.d=this.activeState.zoom,r=!1):(this.updateCache(i),this.options.onZoom(this.getRelativeZoom()))),s){var a=this.options.beforePan(this.getPan(),{x:i.e,y:i.f}),c=!1,u=!1;a===!1?(i.e=this.getPan().x,i.f=this.getPan().y,c=u=!0):e.isObject(a)&&(a.x===!1?(i.e=this.getPan().x,c=!0):e.isNumber(a.x)&&(i.e=a.x),a.y===!1?(i.f=this.getPan().y,u=!0):e.isNumber(a.y)&&(i.f=a.y)),c&&u||!this.isPanDifferent(i)?s=!1:(this.updateCache(i),this.options.onPan(this.getPan()))}(r||s)&&this.updateCTMOnNextFrame()}},n.prototype.isZoomDifferent=function(i){return this.activeState.zoom!==i.a},n.prototype.isPanDifferent=function(i){return this.activeState.x!==i.e||this.activeState.y!==i.f},n.prototype.updateCache=function(i){this.activeState.zoom=i.a,this.activeState.x=i.e,this.activeState.y=i.f},n.prototype.pendingUpdate=!1,n.prototype.updateCTMOnNextFrame=function(){this.pendingUpdate||(this.pendingUpdate=!0,this.requestAnimationFrame.call(window,this.updateCTMCached))},n.prototype.updateCTM=function(){var i=this.getCTM();t.setCTM(this.viewport,i,this.defs),this.pendingUpdate=!1,this.options.onUpdatedCTM&&this.options.onUpdatedCTM(i)},ue=function(i,r){return new n(i,r)},ue}var he,an;function Qs(){if(an)return he;an=1;var t=Ys(),e=Gs(),n=Ae(),i=ke(),r=Ks(),s=function(o,h){this.init(o,h)},a={viewportSelector:".svg-pan-zoom_viewport",panEnabled:!0,controlIconsEnabled:!1,zoomEnabled:!0,dblClickZoomEnabled:!0,mouseWheelZoomEnabled:!0,preventMouseEventsDefault:!0,zoomScaleSensitivity:.1,minZoom:.5,maxZoom:10,fit:!0,contain:!1,center:!0,refreshRate:"auto",beforeZoom:null,onZoom:null,beforePan:null,onPan:null,customEventsHandler:null,eventsListenerElement:null,onUpdatedCTM:null},c={passive:!0};s.prototype.init=function(o,h){var f=this;this.svg=o,this.defs=o.querySelector("defs"),i.setupSvgAttributes(this.svg),this.options=n.extend(n.extend({},a),h),this.state="none";var p=i.getBoundingClientRectNormalized(o);this.width=p.width,this.height=p.height,this.viewport=r(i.getOrCreateViewport(this.svg,this.options.viewportSelector),{svg:this.svg,width:this.width,height:this.height,fit:this.options.fit,contain:this.options.contain,center:this.options.center,refreshRate:this.options.refreshRate,beforeZoom:function(g,d){if(f.viewport&&f.options.beforeZoom)return f.options.beforeZoom(g,d)},onZoom:function(g){if(f.viewport&&f.options.onZoom)return f.options.onZoom(g)},beforePan:function(g,d){if(f.viewport&&f.options.beforePan)return f.options.beforePan(g,d)},onPan:function(g){if(f.viewport&&f.options.onPan)return f.options.onPan(g)},onUpdatedCTM:function(g){if(f.viewport&&f.options.onUpdatedCTM)return f.options.onUpdatedCTM(g)}});var m=this.getPublicInstance();m.setBeforeZoom(this.options.beforeZoom),m.setOnZoom(this.options.onZoom),m.setBeforePan(this.options.beforePan),m.setOnPan(this.options.onPan),m.setOnUpdatedCTM(this.options.onUpdatedCTM),this.options.controlIconsEnabled&&e.enable(this),this.lastMouseWheelEventTime=Date.now(),this.setupHandlers()},s.prototype.setupHandlers=function(){var o=this,h=null;if(this.eventListeners={mousedown:function(g){var d=o.handleMouseDown(g,h);return h=g,d},touchstart:function(g){var d=o.handleMouseDown(g,h);return h=g,d},mouseup:function(g){return o.handleMouseUp(g)},touchend:function(g){return o.handleMouseUp(g)},mousemove:function(g){return o.handleMouseMove(g)},touchmove:function(g){return o.handleMouseMove(g)},mouseleave:function(g){return o.handleMouseUp(g)},touchleave:function(g){return o.handleMouseUp(g)},touchcancel:function(g){return o.handleMouseUp(g)}},this.options.customEventsHandler!=null){this.options.customEventsHandler.init({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()});var f=this.options.customEventsHandler.haltEventListeners;if(f&&f.length)for(var p=f.length-1;p>=0;p--)this.eventListeners.hasOwnProperty(f[p])&&delete this.eventListeners[f[p]]}for(var m in this.eventListeners)(this.options.eventsListenerElement||this.svg).addEventListener(m,this.eventListeners[m],this.options.preventMouseEventsDefault?!1:c);this.options.mouseWheelZoomEnabled&&(this.options.mouseWheelZoomEnabled=!1,this.enableMouseWheelZoom())},s.prototype.enableMouseWheelZoom=function(){if(!this.options.mouseWheelZoomEnabled){var o=this;this.wheelListener=function(f){return o.handleMouseWheel(f)};var h=!this.options.preventMouseEventsDefault;t.on(this.options.eventsListenerElement||this.svg,this.wheelListener,h),this.options.mouseWheelZoomEnabled=!0}},s.prototype.disableMouseWheelZoom=function(){if(this.options.mouseWheelZoomEnabled){var o=!this.options.preventMouseEventsDefault;t.off(this.options.eventsListenerElement||this.svg,this.wheelListener,o),this.options.mouseWheelZoomEnabled=!1}},s.prototype.handleMouseWheel=function(o){if(!(!this.options.zoomEnabled||this.state!=="none")){this.options.preventMouseEventsDefault&&(o.preventDefault?o.preventDefault():o.returnValue=!1);var h=o.deltaY||1,f=Date.now()-this.lastMouseWheelEventTime,p=3+Math.max(0,30-f);this.lastMouseWheelEventTime=Date.now(),"deltaMode"in o&&o.deltaMode===0&&o.wheelDelta&&(h=o.deltaY===0?0:Math.abs(o.wheelDelta)/o.deltaY),h=-.3<h&&h<.3?h:(h>0?1:-1)*Math.log(Math.abs(h)+10)/p;var m=this.svg.getScreenCTM().inverse(),g=i.getEventPoint(o,this.svg).matrixTransform(m),d=Math.pow(1+this.options.zoomScaleSensitivity,-1*h);this.zoomAtPoint(d,g)}},s.prototype.zoomAtPoint=function(o,h,f){var p=this.viewport.getOriginalState();f?(o=Math.max(this.options.minZoom*p.zoom,Math.min(this.options.maxZoom*p.zoom,o)),o=o/this.getZoom()):this.getZoom()*o<this.options.minZoom*p.zoom?o=this.options.minZoom*p.zoom/this.getZoom():this.getZoom()*o>this.options.maxZoom*p.zoom&&(o=this.options.maxZoom*p.zoom/this.getZoom());var m=this.viewport.getCTM(),g=h.matrixTransform(m.inverse()),d=this.svg.createSVGMatrix().translate(g.x,g.y).scale(o).translate(-g.x,-g.y),v=m.multiply(d);v.a!==m.a&&this.viewport.setCTM(v)},s.prototype.zoom=function(o,h){this.zoomAtPoint(o,i.getSvgCenterPoint(this.svg,this.width,this.height),h)},s.prototype.publicZoom=function(o,h){h&&(o=this.computeFromRelativeZoom(o)),this.zoom(o,h)},s.prototype.publicZoomAtPoint=function(o,h,f){if(f&&(o=this.computeFromRelativeZoom(o)),n.getType(h)!=="SVGPoint")if("x"in h&&"y"in h)h=i.createSVGPoint(this.svg,h.x,h.y);else throw new Error("Given point is invalid");this.zoomAtPoint(o,h,f)},s.prototype.getZoom=function(){return this.viewport.getZoom()},s.prototype.getRelativeZoom=function(){return this.viewport.getRelativeZoom()},s.prototype.computeFromRelativeZoom=function(o){return o*this.viewport.getOriginalState().zoom},s.prototype.resetZoom=function(){var o=this.viewport.getOriginalState();this.zoom(o.zoom,!0)},s.prototype.resetPan=function(){this.pan(this.viewport.getOriginalState())},s.prototype.reset=function(){this.resetZoom(),this.resetPan()},s.prototype.handleDblClick=function(o){if(this.options.preventMouseEventsDefault&&(o.preventDefault?o.preventDefault():o.returnValue=!1),this.options.controlIconsEnabled){var h=o.target.getAttribute("class")||"";if(h.indexOf("svg-pan-zoom-control")>-1)return!1}var f;o.shiftKey?f=1/((1+this.options.zoomScaleSensitivity)*2):f=(1+this.options.zoomScaleSensitivity)*2;var p=i.getEventPoint(o,this.svg).matrixTransform(this.svg.getScreenCTM().inverse());this.zoomAtPoint(f,p)},s.prototype.handleMouseDown=function(o,h){this.options.preventMouseEventsDefault&&(o.preventDefault?o.preventDefault():o.returnValue=!1),n.mouseAndTouchNormalize(o,this.svg),this.options.dblClickZoomEnabled&&n.isDblClick(o,h)?this.handleDblClick(o):(this.state="pan",this.firstEventCTM=this.viewport.getCTM(),this.stateOrigin=i.getEventPoint(o,this.svg).matrixTransform(this.firstEventCTM.inverse()))},s.prototype.handleMouseMove=function(o){if(this.options.preventMouseEventsDefault&&(o.preventDefault?o.preventDefault():o.returnValue=!1),this.state==="pan"&&this.options.panEnabled){var h=i.getEventPoint(o,this.svg).matrixTransform(this.firstEventCTM.inverse()),f=this.firstEventCTM.translate(h.x-this.stateOrigin.x,h.y-this.stateOrigin.y);this.viewport.setCTM(f)}},s.prototype.handleMouseUp=function(o){this.options.preventMouseEventsDefault&&(o.preventDefault?o.preventDefault():o.returnValue=!1),this.state==="pan"&&(this.state="none")},s.prototype.fit=function(){var o=this.viewport.getViewBox(),h=Math.min(this.width/o.width,this.height/o.height);this.zoom(h,!0)},s.prototype.contain=function(){var o=this.viewport.getViewBox(),h=Math.max(this.width/o.width,this.height/o.height);this.zoom(h,!0)},s.prototype.center=function(){var o=this.viewport.getViewBox(),h=(this.width-(o.width+o.x*2)*this.getZoom())*.5,f=(this.height-(o.height+o.y*2)*this.getZoom())*.5;this.getPublicInstance().pan({x:h,y:f})},s.prototype.updateBBox=function(){this.viewport.simpleViewBoxCache()},s.prototype.pan=function(o){var h=this.viewport.getCTM();h.e=o.x,h.f=o.y,this.viewport.setCTM(h)},s.prototype.panBy=function(o){var h=this.viewport.getCTM();h.e+=o.x,h.f+=o.y,this.viewport.setCTM(h)},s.prototype.getPan=function(){var o=this.viewport.getState();return{x:o.x,y:o.y}},s.prototype.resize=function(){var o=i.getBoundingClientRectNormalized(this.svg);this.width=o.width,this.height=o.height;var h=this.viewport;h.options.width=this.width,h.options.height=this.height,h.processCTM(),this.options.controlIconsEnabled&&(this.getPublicInstance().disableControlIcons(),this.getPublicInstance().enableControlIcons())},s.prototype.destroy=function(){var o=this;this.beforeZoom=null,this.onZoom=null,this.beforePan=null,this.onPan=null,this.onUpdatedCTM=null,this.options.customEventsHandler!=null&&this.options.customEventsHandler.destroy({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()});for(var h in this.eventListeners)(this.options.eventsListenerElement||this.svg).removeEventListener(h,this.eventListeners[h],this.options.preventMouseEventsDefault?!1:c);this.disableMouseWheelZoom(),this.getPublicInstance().disableControlIcons(),this.reset(),u=u.filter(function(f){return f.svg!==o.svg}),delete this.options,delete this.viewport,delete this.publicInstance,delete this.pi,this.getPublicInstance=function(){return null}},s.prototype.getPublicInstance=function(){var o=this;return this.publicInstance||(this.publicInstance=this.pi={enablePan:function(){return o.options.panEnabled=!0,o.pi},disablePan:function(){return o.options.panEnabled=!1,o.pi},isPanEnabled:function(){return!!o.options.panEnabled},pan:function(h){return o.pan(h),o.pi},panBy:function(h){return o.panBy(h),o.pi},getPan:function(){return o.getPan()},setBeforePan:function(h){return o.options.beforePan=h===null?null:n.proxy(h,o.publicInstance),o.pi},setOnPan:function(h){return o.options.onPan=h===null?null:n.proxy(h,o.publicInstance),o.pi},enableZoom:function(){return o.options.zoomEnabled=!0,o.pi},disableZoom:function(){return o.options.zoomEnabled=!1,o.pi},isZoomEnabled:function(){return!!o.options.zoomEnabled},enableControlIcons:function(){return o.options.controlIconsEnabled||(o.options.controlIconsEnabled=!0,e.enable(o)),o.pi},disableControlIcons:function(){return o.options.controlIconsEnabled&&(o.options.controlIconsEnabled=!1,e.disable(o)),o.pi},isControlIconsEnabled:function(){return!!o.options.controlIconsEnabled},enableDblClickZoom:function(){return o.options.dblClickZoomEnabled=!0,o.pi},disableDblClickZoom:function(){return o.options.dblClickZoomEnabled=!1,o.pi},isDblClickZoomEnabled:function(){return!!o.options.dblClickZoomEnabled},enableMouseWheelZoom:function(){return o.enableMouseWheelZoom(),o.pi},disableMouseWheelZoom:function(){return o.disableMouseWheelZoom(),o.pi},isMouseWheelZoomEnabled:function(){return!!o.options.mouseWheelZoomEnabled},setZoomScaleSensitivity:function(h){return o.options.zoomScaleSensitivity=h,o.pi},setMinZoom:function(h){return o.options.minZoom=h,o.pi},setMaxZoom:function(h){return o.options.maxZoom=h,o.pi},setBeforeZoom:function(h){return o.options.beforeZoom=h===null?null:n.proxy(h,o.publicInstance),o.pi},setOnZoom:function(h){return o.options.onZoom=h===null?null:n.proxy(h,o.publicInstance),o.pi},zoom:function(h){return o.publicZoom(h,!0),o.pi},zoomBy:function(h){return o.publicZoom(h,!1),o.pi},zoomAtPoint:function(h,f){return o.publicZoomAtPoint(h,f,!0),o.pi},zoomAtPointBy:function(h,f){return o.publicZoomAtPoint(h,f,!1),o.pi},zoomIn:function(){return this.zoomBy(1+o.options.zoomScaleSensitivity),o.pi},zoomOut:function(){return this.zoomBy(1/(1+o.options.zoomScaleSensitivity)),o.pi},getZoom:function(){return o.getRelativeZoom()},setOnUpdatedCTM:function(h){return o.options.onUpdatedCTM=h===null?null:n.proxy(h,o.publicInstance),o.pi},resetZoom:function(){return o.resetZoom(),o.pi},resetPan:function(){return o.resetPan(),o.pi},reset:function(){return o.reset(),o.pi},fit:function(){return o.fit(),o.pi},contain:function(){return o.contain(),o.pi},center:function(){return o.center(),o.pi},updateBBox:function(){return o.updateBBox(),o.pi},resize:function(){return o.resize(),o.pi},getSizes:function(){return{width:o.width,height:o.height,realZoom:o.getZoom(),viewBox:o.viewport.getViewBox()}},destroy:function(){return o.destroy(),o.pi}}),this.publicInstance};var u=[],l=function(o,h){var f=n.getSvg(o);if(f===null)return null;for(var p=u.length-1;p>=0;p--)if(u[p].svg===f)return u[p].instance.getPublicInstance();return u.push({svg:f,instance:new s(f,h)}),u[u.length-1].instance.getPublicInstance()};return he=l,he}var Js=Qs();const js=Ws(Js),Ln={"has part":"blue","part of":"blue",contains:"green","has role":"darkgreen","is about":"darkgrey","has participant":"darkblue"},Yt=11,Rt=14,ta=120,ln=12,ea=40,na=40;function ia(t,e,n){const i=e.split(/\s+/),r=[];let s="";const a=t.append("text").style("font-size",`${Yt}px`).style("visibility","hidden");for(const c of i){const u=s?`${s} ${c}`:c;a.text(u),a.node().getComputedTextLength()>n&&s?(r.push(s),s=c):s=u}return s&&r.push(s),a.remove(),r}function ra(t,e){const n=t.append("text").style("font-size",`${Yt}px`).style("visibility","hidden").text(e),i=n.node().getComputedTextLength();return n.remove(),i}function oa(t,e){const n=new Map;for(const i of e){const r=[i];for(;r.length>0;){const s=r.pop(),a=s.label||s.id,c=ia(t,a,ta),u=Math.max(...c.map(h=>ra(t,h))),l=Math.max(80,u+ln*2),o=Math.max(24,c.length*Rt+ln);n.set(s.id,{width:l,height:o,lines:c}),r.push(...s.children)}}return n}function sa(t,e){let n=0,i=0;e.forEach(c=>{n=Math.max(n,c.width),i=Math.max(i,c.height)});let r=20;const s=new Map,a=[];for(const c of t){const u=Ne(c);Os().nodeSize([n+ea,i+na]).separation((g,d)=>g.parent===d.parent?1:1.2)(u);let o=1/0,h=-1/0;u.each(g=>{o=Math.min(o,g.x),h=Math.max(h,g.x)});const f=h-o+n+20,p=r-o+n/2,m=50;a.push({root:u,offsetX:p,offsetY:m,treeWidth:f}),u.each(g=>{s.set(g.data.id,{x:g.x+p,y:g.y+m})}),r+=f+40}return{treeLayouts:a,nodePositions:s,maxNodeWidth:n,maxNodeHeight:i}}function aa(t,e){t.append("marker").attr("id","arrow-hierarchy").attr("viewBox","0 -5 10 10").attr("refX",0).attr("refY",0).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5").attr("fill","#999");const n=new Set;for(const i of e){const r=i.label??i.type??"",s=Ln[r]??i.color??"orange";n.add(s)}n.forEach(i=>{const r=i.replace(/[^a-zA-Z0-9]/g,"_");t.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 -5 10 10").attr("refX",8).attr("refY",0).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5").attr("fill",i)})}function la(t,e,n,i){for(const{root:r,offsetX:s,offsetY:a}of e)t.append("g").attr("class","tree-edges").attr("transform",`translate(${s}, ${a})`).selectAll(".link").data(r.links()).enter().append("path").attr("class","link").attr("data-source",u=>u.source.data.id).attr("data-target",u=>u.target.data.id).attr("d",u=>{const l=u.source,o=u.target,h=n.get(o.data.id),f=h?h.height/2:12,p=o.y-f-8,m=n.get(l.data.id),g=m?m.height/2:12,d=l.y+g;return`M${l.x},${d}C${l.x},${(d+p)/2} ${o.x},${(d+p)/2} ${o.x},${p}`}).attr("marker-end","url(#arrow-hierarchy)").on("mouseenter",function(u,l){i(l.source.data.id,l.target.data.id,this,"enter")}).on("mouseleave",function(u,l){i(l.source.data.id,l.target.data.id,this,"leave")}).on("click",function(u,l){i(l.source.data.id,l.target.data.id,this,"click")}).each(function(u){R(this).append("title").text("subclass of")})}function ca(t,e,n,i,r,s){for(const a of e){const c=n.get(a.source),u=n.get(a.target);if(!c||!u)continue;const l=a.label||a.type||"",o=Ln[l]||a.color||"orange",h=o.replace(/[^a-zA-Z0-9]/g,"_"),f=i.get(a.source),p=i.get(a.target),m=f?f.width/2:40,g=p?p.width/2:40,d=f?f.height/2:12,v=p?p.height/2:12,_=u.x-c.x,x=u.y-c.y,S=Math.sqrt(_*_+x*x);if(S===0)continue;const P=Math.atan2(x,_),M=Math.abs(Math.cos(P))>Math.abs(Math.sin(P));let L,T;M?(L=c.x+(_>0?m:-m),T=c.y+x/S*d*.5):(L=c.x+_/S*m*.5,T=c.y+(x>0?d:-d));let V,F;M?(V=u.x+(_>0?-g:g),F=u.y-x/S*v*.5):(V=u.x-_/S*g*.5,F=u.y+(x>0?-v:v));const Nt=(L+V)/2,st=(T+F)/2,ht=Math.min(30,S*.2),Q=S>0?-x/S*ht:0,At=S>0?_/S*ht:0,b=`M${L},${T} Q${Nt+Q},${st+At} ${V},${F}`,w=a.source,C=a.target;t.append("path").attr("class","relation-link").attr("data-source",w).attr("data-target",C).attr("d",b).style("fill","none").style("stroke",o).style("stroke-width","1.5px").style("stroke-dasharray","4,2").style("stroke-opacity",.8).attr("marker-end",`url(#arrow-${h})`).on("mouseenter",function(){s(w,C,this,"enter")}).on("mouseleave",function(){s(w,C,this,"leave")}).on("click",function(){s(w,C,this,"click")}).append("title").text(`'${r[a.source]}' ${l} '${r[a.target]}'`||"relation"),l&&t.append("text").attr("class","relation-edge-label").attr("data-source",w).attr("data-target",C).attr("x",Nt+Q).attr("y",st+At-4).attr("text-anchor","middle").style("font-size","9px").style("fill",o).style("font-style","italic").style("cursor","pointer").text(l).on("mouseenter",function(){s(w,C,this,"enter")}).on("mouseleave",function(){s(w,C,this,"leave")}).on("click",function(){s(w,C,this,"click")})}}function ua(t){const e=(t.data.ose_curation??Ot.EXTERNAL).toLowerCase().replace(/\s+/g,"_");return["node",`ose-source-${t.data.ose_source}`,`ose-curation-status-${e}`,...t.data.ose_selected?["ose-selected"]:[]]}function ha(t,e,n,i,r){for(const{root:s,offsetX:a,offsetY:c}of e){const l=t.append("g").attr("class","tree-nodes").attr("transform",`translate(${a}, ${c})`).selectAll(".node").data(s.descendants()).enter().append("g").attr("class",o=>ua(o).join(" ")).attr("data-node-id",o=>o.data.id).attr("transform",o=>`translate(${o.x},${o.y})`).on("mouseenter",function(o,h){i(h.data.id,this,"enter")}).on("mouseleave",function(o,h){i(h.data.id,this,"leave")}).on("dblclick",function(o,h){r(h.data)});l.append("rect").attr("x",o=>{const h=n.get(o.data.id);return h?-h.width/2:-40}).attr("y",o=>{const h=n.get(o.data.id);return h?-h.height/2:-12}).attr("width",o=>{const h=n.get(o.data.id);return h?h.width:80}).attr("height",o=>{const h=n.get(o.data.id);return h?h.height:24}).attr("rx",4).attr("ry",4).style("fill","#fff").style("stroke","#999").style("stroke-width","1px"),l.each(function(o){const h=n.get(o.data.id);if(!h)return;const f=R(this).append("text").attr("text-anchor","middle").style("font-size",`${Yt}px`).style("fill","#333"),p=h.lines,g=-(p.length*Rt)/2+Rt/2;p.forEach((d,v)=>{f.append("tspan").attr("x",0).attr("dy",v===0?`${g+Yt*.35}px`:`${Rt}px`).text(d)}),f.append("title").text(`${o.data.label}
2
- ${o.data.id}`)})}}function fa(t,e){const n=js(t,{zoomEnabled:!0,controlIconsEnabled:!0,dblClickZoomEnabled:!1,contain:!0,center:!0,zoomScaleSensitivity:.3,minZoom:.01,maxZoom:100});return e&&(n.zoom(e.zoom),n.pan(e.pan)),n}function da(t,e,n,i,r){const s=new ye,a=e.filter(d=>d.startsWith("REL "));console.debug("Relation columns found:",a);const c=t.map((d,v)=>{const _=d.ID.trim(),x=d.Label.trim(),S=Object.entries(d).find(([L,T])=>L.toLowerCase().includes("curation status"))?.[1].trim()||Ot.PRE_PROPOSED,P=[{label:d.Parent.trim(),id:void 0}],M=[];for(const L of a){const T=d[L];if(T&&typeof T=="string"){const V=T.split(";").map(F=>F.trim()).filter(Boolean);for(const F of V)M.push({relation:{label:L.replace(/REL '([^']+)'.*/,"$1")},target:{label:F}})}}return{id:_,label:x,curationStatus:S,origin:n,subClassOf:P,relations:M,index:v}}).filter(d=>d.id),u=new Map;for(const d of c)u.set(d.label,{...d,source:"current"});for(const d of i.dependencies)u.has(d.label)||u.set(d.label,{...d,source:"dependencies"});for(const d of i.derived)u.has(d.label)||u.set(d.label,{...d,source:"derived"});for(const d of c)for(const v of d.subClassOf){const _=u.get(v.label);_?v.id=_.id:v.id===void 0&&console.warn(`Parent term with label "${v.label}" not found for term "${d.label} [${d.id}]"`)}const l=new Map;for(const d of u.values()){const v=d.subClassOf.filter(_=>_.id===void 0);v.length>0&&console.warn(`Term "${d.label} [${d.id}]" has unresolved parents:`,v),d.subClassOf=d.subClassOf.filter(_=>_.id!==void 0),l.set(d.id,d)}for(const[d,v]of l){const _=d.replace(":","_"),x=v.origin||"<unknown>",S=v.curationStatus||"External",P={id:_,label:v.label,class:`ose-curation-status-${S.toLowerCase().replace(/\s+/g,"_")}`,curationStatus:S,origin:x,source:v.source,isSelected:r?.includes(v.index)===!0,visualDepth:-1/0};s.addNode(P)}for(const[d,v]of l){const _=d.replace(":","_");for(const x of v.subClassOf){const S=x.id.replace(":","_");l.has(x.id)||console.warn(`Parent term with label "${x.label}" not found for term "${v.label} [${v.id}]"`),s.addEdge({source:S,target:_,type:"subclass_of"})}}for(const[d,v]of l){const _=d.replace(":","_");for(const x of v.relations){const S=u.get(x.target.label);if(!S){console.warn(`Relation target term with label "${x.target.label}" not found for term "${v.label} [${v.id}]"`);continue}const P=S.id.replace(":","_"),M=pa(x.relation.label);s.addEdge({source:_,target:P,type:x.relation.label,label:x.relation.label,color:M})}}console.debug(`Built graph with ${s.nodes.length} nodes and ${s.edges.length} edges from ${c.length} current terms, ${i.dependencies.length} dependencies, and ${i.derived.length} derived terms.`,{edges:s.edges,nodes:s.nodes,allTerms:l});const o=new Set(Array.from(l.entries()).filter(([d,v])=>v.source==="current").map(([d,v])=>d.replace(":","_"))),h=new Set(Array.from(l.entries()).filter(([d,v])=>v.source==="derived").map(([d,v])=>d.replace(":","_"))),f=new Set(Array.from(l.entries()).filter(([d,v])=>v.source==="dependencies").map(([d,v])=>d.replace(":","_")));function p(d){if(o.has(d))return!0;const v=s.successors(d);for(const _ of v)if(p(_.id))return!0;return!1}function m(d){if(o.has(d))return!0;const v=s.predecessors(d);for(const _ of v)if(m(_.id))return!0;return!1}function g(d){return o.has(d)?!0:h.has(d)?m(d):f.has(d)?p(d):!1}for(const d of s.nodes)g(d.id)||s.removeNode(d.id);if(ga(s),console.log({graph:s.clone()}),r&&r.length>0){const d=new Set(s.nodes.filter(v=>v.isSelected).map(v=>v.id));ma(s,d);for(const v of s.nodes)d.has(v.id)||s.removeNode(v.id)}return s}function pa(t){return(t?{"has part":"blue","part of":"blue",contains:"green","has role":"darkgreen","is about":"darkgrey","has participant":"darkblue"}[t]:null)??"orange"}function ga(t){const e=new Map;function n(i){if(e.has(i.id))return e.get(i.id);if(!i)return console.error("Node not found for ID:",i),-1/0;const r=t.predecessors(i),s=t.successors(i),a=i.source!=="dependencies";let c;if(!a&&s.find(u=>u.source!=="dependencies"))c=0;else{const u=r.reduce((l,o)=>Math.max(l,n(o)),-1);a?c=u+1:c=u}return e.set(i.id,c),c}for(const i of t.nodes)i.visualDepth=n(i)}function ma(t,e){const n=(i,r)=>{if(e.has(i.id))return!0;const a=(r==="up"?t.predecessors.bind(t):t.successors.bind(t))(i.id).reduce((c,u)=>n(u,r)||c,!1);return a&&e.add(i.id),a};for(const i of t.leaves)n(i,"up");for(const i of t.roots)n(i,"down")}const va={class:"visualise-container"},wa={class:"header"},ya={class:"header-title-row"},_a={class:"title-with-help"},xa={class:"mb-0"},ba={class:"text-muted"},Sa={class:"search-bar"},Ca={class:"search-info text-muted"},Ea={class:"input-group input-group-sm"},Ma=["disabled"],Na=["disabled"],Aa=["disabled"],ka=["disabled"],za=["disabled"],$a={class:"filters-card"},Pa={class:"filter-section"},Ta={class:"filter-controls"},Za={class:"form-check form-switch"},La=["disabled"],Da={class:"form-check form-switch"},Ia=["disabled"],Ba={class:"filter-section"},Ra={class:"filter-controls"},Oa={class:"range-control"},qa={class:"range-header"},Va={for:"range_num_child_levels",class:"form-label"},Fa={class:"range-minmax"},Ha=["max","disabled"],Xa={class:"filter-section"},Ua={class:"filter-controls"},Wa={class:"dropdown"},Ya=["disabled"],Ga={class:"dropdown-menu dropdown-menu-end"},Ka=["onClick"],Qa={key:0,class:"loading-overlay"},Ja={key:1,class:"error-overlay"},ja={class:"error-message"},tl={key:2,class:"empty-state-overlay"},el={class:"modal fade",id:"legendModal",tabindex:"-1","aria-labelledby":"legendModalLabel","aria-hidden":"true"},nl={class:"modal-dialog modal-lg"},il={class:"modal-content"},rl={class:"modal-body"},ol={class:"legend-grid"},sl={class:"legend-item full-width"},al={class:"status-grid"},ll=Fn({__name:"Visualise",setup(t){const e=URLS.prefix,n=I(window.ose?.visualise??null);window.oseDataChanged=()=>{console.debug("Visualisation data updated in window.ose",window.ose?.visualise),n.value=window.ose?.visualise??null;const b=n.value?.sheetData;console.debug("Sheet data after update:",{hasSheetData:!!b,repo_name:b?.repo_name,folder:b?.folder,spreadsheet_name:b?.spreadsheet_name,rowCount:b?.rows?.length||0,header:b?.header})};const i=Hn("svgContainer"),r=J(()=>n.value?.sheetData??{rows:[],header:[],file_sha:"",repo_name:"",folder:"",spreadsheet_name:""}),s=J(()=>`${r.value.folder}/${r.value.spreadsheet_name}`),a=I(!1),c=I(null),u=J(()=>Object.values(Ot)),l=I(null),o=J(()=>l.value?.nodes.reduce((b,w)=>({[w.id]:w.label,...b}),{})??{}),h=I(Object.values(Ot)),f=I(!0),p=I(!0),m=I(null),g=J(()=>l.value?Math.max(...l.value.nodes.map(b=>b.visualDepth??0),1):1);let d=null;const v=I(""),_=I([]),x=I(-1),S=J(()=>_.value.length>0),P=J(()=>v.value.trim()?_.value.length===0?"No matches":`${x.value+1} / ${_.value.length}`:""),M=J(()=>!l.value||a.value);function L(){const b=Fs(v.value,o.value);_.value=b,b.length>0?(x.value=0,T(),setTimeout(()=>V(),50)):x.value=-1}function T(){if(x.value>=0&&x.value<_.value.length){const b=_.value[x.value];Hs(b)}}function V(){if(!d||x.value<0||!i.value)return;const b=_.value[x.value];Us(b,i.value,d)}function F(){_.value.length!==0&&(x.value=(x.value+1)%_.value.length,T(),setTimeout(()=>V(),0))}function Nt(){_.value.length!==0&&(x.value=(x.value-1+_.value.length)%_.value.length,T(),setTimeout(()=>V(),0))}function st(){v.value="",_.value=[],x.value=-1,Xs()}async function ht(){if(!r.value.repo_name||!r.value.folder||!r.value.spreadsheet_name){console.warn("Cannot fetch graph: missing repo, folder, or spreadsheet name",{repo:r.value.repo_name,folder:r.value.folder,spreadsheet:r.value.spreadsheet_name});return}if(r.value.rows.length===0){console.warn("Cannot fetch graph: no rows in spreadsheet");return}console.debug("Fetching graph dependencies...",{repo:r.value.repo_name,folder:r.value.folder,spreadsheet:r.value.spreadsheet_name,rowCount:r.value.rows.length}),a.value=!0,c.value=null;try{const b=await fetch(`${e}/api/visualise/dependencies/${r.value.repo_name}/${r.value.folder}/${r.value.spreadsheet_name}`);if(!b.ok)throw new Error(`Server error: ${b.status} ${b.statusText}`);const w=await b.json();if(!w.success)throw new Error(w.error||"Failed to load dependencies");console.debug("Dependencies loaded successfully",w.data),d?.destroy(),d=null,st();const C=w.data,ft=n.value?.selection&&n.value.selection.length>0?n.value.selection:void 0;l.value=da(r.value.rows,r.value.header,r.value.spreadsheet_name,C,ft),m.value=Math.min(3,g.value),console.debug("Graph built successfully",{nodes:l.value.nodes.length,edges:l.value.edges.length})}catch(b){c.value=b instanceof Error?b.message:"An unexpected error occurred",console.error("Failed to fetch dependencies:",b)}finally{a.value=!1}}function Q(){if(!l.value||!i.value){console.warn("Cannot render graph:",{hasGraph:!!l.value,hasContainer:!!i.value});return}console.debug("Rendering graph...",{nodes:l.value.nodes.length,edges:l.value.edges.length});const b=l.value.clone(),w={curationFilter:h.value,showChildrenFromOtherSheets:f.value,showParentsFromOtherSheets:p.value,numChildLevels:m.value,currentSheet:n?.value?.sheetData?.spreadsheet_name},{nodes:C,hierarchyEdges:ft,relationEdges:Jt}=qs(b,w);console.debug("After filtering:",{nodes:C.length,hierarchyEdges:ft.length,relationEdges:Jt.length});const jt=Vs(C,ft);console.debug("Built trees:",jt.length);let te=null;if(d)try{te={zoom:d.getZoom(),pan:d.getPan()},d.destroy(),d=null}catch{}i.value.querySelector("svg")?.remove();const at=i.value.getBoundingClientRect(),Dn=at.width||800,In=at.height||600,D=R(i.value).append("svg").attr("width","100%").attr("height","100%").attr("viewBox",`0 0 ${Dn} ${In}`),ee=D.append("g").attr("class","graph-container"),kt=oa(D,jt),{treeLayouts:$e,nodePositions:Bn}=sa(jt,kt),Pe=ee.append("g").attr("class","edges-layer"),Rn=ee.append("g").attr("class","nodes-layer"),On=D.append("defs");aa(On,Jt);let nt=null;function qn(E,k,H){H==="enter"?(R(k).classed("node-hovered",!0),D.selectAll(".link, .relation-link").each(function(){const N=R(this),z=N.attr("data-source"),Z=N.attr("data-target");(z===E||Z===E)&&(N.classed("connected",!0),z!==E&&D.select(`.node[data-node-id="${z}"]`).classed("node-connected",!0),Z!==E&&D.select(`.node[data-node-id="${Z}"]`).classed("node-connected",!0))})):H==="leave"&&(R(k).classed("node-hovered",!1),D.selectAll(".link, .relation-link").classed("connected",!1),D.selectAll(".node").classed("node-connected",!1))}function Te(E,k,H,N){function z(dt){D.selectAll(".node").each(function(){const pt=R(this),X=pt.attr("data-node-id");(X===E||X===k)&&pt.classed("edge-connected",dt)})}function Z(dt,pt){D.selectAll(".link, .relation-link").each(function(){const X=R(this);X.attr("data-source")===E&&X.attr("data-target")===k&&X.classed(pt,dt)}),D.selectAll(".relation-edge-label").each(function(){const X=R(this);X.attr("data-source")===E&&X.attr("data-target")===k&&X.classed(pt,dt)})}N==="click"?nt?.sourceId===E&&nt?.targetId===k?(z(!1),Z(!1,"focused"),nt=null):(nt&&(D.selectAll(".node").classed("edge-connected",!1),Z(!1,"focused")),nt={sourceId:E,targetId:k,element:H},z(!0),Z(!0,"focused")):N==="enter"&&!nt?(z(!0),Z(!0,"highlighted")):N==="leave"&&!nt&&(z(!1),Z(!1,"highlighted"))}function Vn(E){if(E.ose_curation?.toLowerCase()==="external")return;const k=window.opener,H=r.value.repo_name,N=E.ose_source==="current"?s.value:E.ose_origin,z=E.id;if(!k||!H||!N||!z){console.warn("Cannot navigate to term: missing data",{editorWindow:k,repo:H,originSheet:N,nodeId:z});return}const Z={type:"navigateToTerm",repo:H,sheet:N,termID:z};k.postMessage(Z,"*")}la(Pe,$e,kt,Te),ca(Pe,Jt,Bn,kt,o.value,Te),ha(Rn,$e,kt,qn,Vn);const Ze=i.value?.querySelector("svg");if(Ze){d=fa(Ze,te);const E=ee.node()?.getBBox();if(E&&d&&!te){const k=at.width/E.width,H=at.height/E.height,N=Math.min(k,H,1);d.zoom(N);const z=(at.width-E.width*N)/2-E.x*N,Z=(at.height-E.height*N)/2-E.y*N;d.pan({x:z,y:Z})}}}function At(b){const w=h.value.indexOf(b);w>=0?h.value.splice(w,1):h.value.push(b),Q()}return Xn(()=>{l.value&&i.value&&Q()}),Un(()=>{console.debug("watchEffect triggered:",{rowsLength:r.value.rows.length,repo_name:r.value.repo_name,folder:r.value.folder,spreadsheet_name:r.value.spreadsheet_name,allConditionsMet:r.value.rows.length>0&&!!r.value.repo_name&&!!r.value.folder&&!!r.value.spreadsheet_name}),r.value.rows.length>0&&r.value.repo_name&&r.value.folder&&r.value.spreadsheet_name&&ht()}),zt(m,(b,w)=>{b!==w&&b!==null&&w!==null&&Q()}),zt(f,(b,w)=>{b!==w&&Q()}),zt(p,(b,w)=>{b!==w&&Q()}),zt(a,(b,w)=>{b&&w===!1&&(i.value?.querySelector("svg")?.remove(),st())}),Wn(async()=>{i.value&&(i.value.style.minHeight=window.innerHeight-i.value.offsetTop-16+"px")}),(b,w)=>(tt(),j("div",va,[y("div",wa,[y("div",ya,[y("div",_a,[y("h5",xa,[w[4]||(w[4]=B(" Hierarchy Tree ",-1)),y("small",ba,Y(n.value?.sheetData?.spreadsheet_name),1)]),w[5]||(w[5]=y("button",{class:"btn btn-sm btn-link text-secondary p-0 ms-2",type:"button","data-bs-toggle":"modal","data-bs-target":"#legendModal",title:"Help & Legend"},[y("i",{class:"fa-solid fa-circle-question"})],-1))]),y("div",Sa,[y("small",Ca,Y(P.value),1),y("div",Ea,[$t(y("input",{type:"text",class:"form-control",placeholder:"Search classes...","onUpdate:modelValue":w[0]||(w[0]=C=>v.value=C),onKeyup:Yn(L,["enter"]),disabled:M.value},null,40,Ma),[[Le,v.value]]),y("button",{class:"btn btn-outline-secondary",type:"button",onClick:L,title:"Search",disabled:M.value},[...w[6]||(w[6]=[y("i",{class:"fa-solid fa-search"},null,-1)])],8,Na),y("button",{class:"btn btn-outline-secondary",type:"button",onClick:Nt,disabled:!S.value||M.value,title:"Previous match"},[...w[7]||(w[7]=[y("i",{class:"fa-solid fa-chevron-up"},null,-1)])],8,Aa),y("button",{class:"btn btn-outline-secondary",type:"button",onClick:F,disabled:!S.value||M.value,title:"Next match"},[...w[8]||(w[8]=[y("i",{class:"fa-solid fa-chevron-down"},null,-1)])],8,ka),y("button",{class:"btn btn-outline-secondary",type:"button",onClick:st,disabled:!v.value||M.value,title:"Clear search"},[...w[9]||(w[9]=[y("i",{class:"fa-solid fa-times"},null,-1)])],8,za)])])]),y("div",$a,[y("div",Pa,[w[12]||(w[12]=y("span",{class:"filter-section-title"},[y("i",{class:"fa-solid fa-filter"}),B(" From other sheets ")],-1)),y("div",Ta,[y("div",Za,[$t(y("input",{class:"form-check-input",type:"checkbox",role:"switch",id:"ckb_children_other_sheets","onUpdate:modelValue":w[1]||(w[1]=C=>f.value=C),disabled:M.value},null,8,La),[[De,f.value]]),w[10]||(w[10]=y("label",{class:"form-check-label",for:"ckb_children_other_sheets"},[y("i",{class:"fa-solid fa-arrow-down"}),B(" Children ")],-1))]),y("div",Da,[$t(y("input",{class:"form-check-input",type:"checkbox",role:"switch",id:"ckb_parents_other_sheets","onUpdate:modelValue":w[2]||(w[2]=C=>p.value=C),disabled:M.value},null,8,Ia),[[De,p.value]]),w[11]||(w[11]=y("label",{class:"form-check-label",for:"ckb_parents_other_sheets"},[y("i",{class:"fa-solid fa-arrow-up"}),B(" Parents ")],-1))])])]),y("div",Ba,[w[14]||(w[14]=y("span",{class:"filter-section-title"},[y("i",{class:"fa-solid fa-layer-group"}),B(" Child Levels ")],-1)),y("div",Ra,[y("div",Oa,[y("div",qa,[y("label",Va,[w[13]||(w[13]=B(" Depth: ",-1)),y("strong",null,Y(m.value||"All"),1)]),y("span",Fa,"1–"+Y(g.value),1)]),$t(y("input",{type:"range",class:"form-range","onUpdate:modelValue":w[3]||(w[3]=C=>m.value=C),min:"1",max:g.value,step:"1",id:"range_num_child_levels",disabled:M.value},null,8,Ha),[[Le,m.value]])])])]),y("div",Xa,[w[16]||(w[16]=y("span",{class:"filter-section-title"},[y("i",{class:"fa-solid fa-tags"}),B(" Curation Status ")],-1)),y("div",Ua,[y("div",Wa,[y("button",{class:"btn btn-sm btn-outline-primary dropdown-toggle",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false",disabled:M.value},[w[15]||(w[15]=y("i",{class:"fa-solid fa-filter"},null,-1)),B(" "+Y(h.value.length)+"/"+Y(u.value.length)+" selected ",1)],8,Ya),y("ul",Ga,[(tt(!0),j(Ie,null,Be(u.value,C=>(tt(),j("li",{key:C},[y("a",{class:ne(["dropdown-item","ose-curation-status-"+C.toLowerCase().replace(" ","_")]),href:"#",onClick:ft=>At(C)},[y("i",{class:ne(["fa-solid",h.value.indexOf(C)>=0?"fa-circle-check":"fa-circle"])},null,2),B(" "+Y(C),1)],10,Ka)]))),128))])])])])])]),y("div",{ref_key:"svgContainer",ref:i,class:"svg-container"},[a.value?(tt(),j("div",Qa,[...w[17]||(w[17]=[y("div",{class:"spinner"},null,-1),y("span",null,"Loading visualisation...",-1)])])):c.value?(tt(),j("div",Ja,[w[18]||(w[18]=y("i",{class:"fa-solid fa-circle-exclamation"},null,-1)),w[19]||(w[19]=y("span",{class:"error-title"},"Failed to load visualisation",-1)),y("span",ja,Y(c.value),1),y("button",{class:"btn btn-primary btn-sm",onClick:ht},"Try again")])):l.value?Gn("",!0):(tt(),j("div",tl,[...w[20]||(w[20]=[y("i",{class:"fa-solid fa-diagram-project"},null,-1),y("span",{class:"empty-state-title"},"No Visualisation Loaded",-1),y("span",{class:"empty-state-message"},'To see a visualisation, open a spreadsheet from the editor and click the "Visualise" button in the toolbar.',-1)])]))],512),y("div",el,[y("div",nl,[y("div",il,[w[23]||(w[23]=y("div",{class:"modal-header"},[y("h5",{class:"modal-title",id:"legendModalLabel"},[y("i",{class:"fa-solid fa-circle-info"}),B(" Help & Legend ")]),y("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),y("div",rl,[y("div",ol,[w[22]||(w[22]=Kn('<div class="legend-item"><h6><i class="fa-solid fa-circle-question"></i> How to Use</h6><ul><li><strong>Pan:</strong> Click and drag the background</li><li><strong>Zoom:</strong> Use mouse wheel or pinch gesture</li><li><strong>Search:</strong> Find specific classes using the search bar</li><li><strong>Children/Parents Switches:</strong> Toggle whether to include children or parents from other sheets</li><li><strong>Child Levels Slider:</strong> Adjust how many levels of child classes to display</li><li><strong>Curation Status Filter:</strong> Select which curation statuses to display</li><li><strong>Hover on nodes/edges:</strong> Highlight related nodes and edges</li><li><strong>Click on edges:</strong> Keep the edge highlighted</li></ul></div><div class="legend-item"><h6><i class="fa-solid fa-circle-nodes"></i> Node Types</h6><div class="node-examples"><div class="node-example"><div class="example-node node-current">Current Sheet</div><div class="example-node node-current node-selected">Selected Term</div><span class="example-desc">Terms from the current spreadsheet (regular border, selected bold)</span></div><div class="node-example"><div class="example-node node-dependencies">Dependencies</div><span class="example-desc">External terms or terms from other sheets referenced by current terms (dashed border)</span></div><div class="node-example"><div class="example-node node-derived">Derived</div><span class="example-desc">Child terms from other sheets (italic text)</span></div></div></div><div class="legend-item"><h6><i class="fa-solid fa-arrow-right"></i> Edge Types</h6><ul><li><strong>Subclass Of:</strong> Solid black arrows showing hierarchy (parent → child)</li><li><strong>Relations:</strong> Colored arrows showing other relationships (e.g., &quot;has part&quot;, &quot;part of&quot;)</li></ul></div>',3)),y("div",sl,[w[21]||(w[21]=y("h6",null,[y("i",{class:"fa-solid fa-palette"}),B(" Curation Status Colors")],-1)),y("div",al,[(tt(!0),j(Ie,null,Be(u.value,C=>(tt(),j("span",{key:C,class:ne(["status-badge","ose-curation-status-"+C.toLowerCase().replace(" ","_")])},Y(C),3))),128))])])])]),w[24]||(w[24]=y("div",{class:"modal-footer"},[y("button",{type:"button",class:"btn btn-secondary","data-bs-dismiss":"modal"},"Close")],-1))])])])]))}}),ze=Qn(ll);ze.config.globalProperties.$filters=Jn;ze.use(jn());ze.mount("#vue-app-visualise");
1
+ import{d as Vn,r as D,A as Fn,a2 as Hn,K as Xn,l as J,w as zt,o as Un,c as j,a as tt,e as y,h as B,t as Y,D as Pt,L as Ze,a3 as Wn,O as Ie,F as Le,g as De,x as ne,f as Yn,a4 as Gn,j as Kn,$ as Qn}from"./chunks/filter-Xg_JD3wD.js";import{a as Ot,G as Jn}from"./chunks/constants-DiFa8GuF.js";import"./chunks/index-sLCKmIWG-C-EM12MM.js";import{c as jn}from"./chunks/index-DSWncqUa.js";var ti={value:()=>{}};function ln(){for(var t=0,e=arguments.length,n={},i;t<e;++t){if(!(i=arguments[t]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new It(n)}function It(t){this._=t}function ei(t,e){return t.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}It.prototype=ln.prototype={constructor:It,on:function(t,e){var n=this._,i=ei(t+"",n),r,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((r=(t=i[s]).type)&&(r=ni(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(r=(t=i[s]).type)n[r]=Be(n[r],t.name,e);else if(e==null)for(r in n)n[r]=Be(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new It(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],i=0,r=s.length;i<r;++i)s[i].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],r=0,s=i.length;r<s;++r)i[r].value.apply(e,n)}};function ni(t,e){for(var n=0,i=t.length,r;n<i;++n)if((r=t[n]).name===e)return r.value}function Be(t,e,n){for(var i=0,r=t.length;i<r;++i)if(t[i].name===e){t[i]=ti,t=t.slice(0,i).concat(t.slice(i+1));break}return n!=null&&t.push({name:e,value:n}),t}var fe="http://www.w3.org/1999/xhtml";const Re={svg:"http://www.w3.org/2000/svg",xhtml:fe,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Re.hasOwnProperty(e)?{space:Re[e],local:t}:t}function ii(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===fe&&e.documentElement.namespaceURI===fe?e.createElement(t):e.createElementNS(n,t)}}function ri(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function cn(t){var e=Gt(t);return(e.local?ri:ii)(e)}function oi(){}function ye(t){return t==null?oi:function(){return this.querySelector(t)}}function si(t){typeof t!="function"&&(t=ye(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],a=s.length,c=i[r]=new Array(a),u,l,o=0;o<a;++o)(u=s[o])&&(l=t.call(u,u.__data__,o,s))&&("__data__"in u&&(l.__data__=u.__data__),c[o]=l);return new A(i,this._parents)}function un(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function ai(){return[]}function hn(t){return t==null?ai:function(){return this.querySelectorAll(t)}}function li(t){return function(){return un(t.apply(this,arguments))}}function ci(t){typeof t=="function"?t=li(t):t=hn(t);for(var e=this._groups,n=e.length,i=[],r=[],s=0;s<n;++s)for(var a=e[s],c=a.length,u,l=0;l<c;++l)(u=a[l])&&(i.push(t.call(u,u.__data__,l,a)),r.push(u));return new A(i,r)}function fn(t){return function(){return this.matches(t)}}function dn(t){return function(e){return e.matches(t)}}var ui=Array.prototype.find;function hi(t){return function(){return ui.call(this.children,t)}}function fi(){return this.firstElementChild}function di(t){return this.select(t==null?fi:hi(typeof t=="function"?t:dn(t)))}var pi=Array.prototype.filter;function gi(){return Array.from(this.children)}function mi(t){return function(){return pi.call(this.children,t)}}function vi(t){return this.selectAll(t==null?gi:mi(typeof t=="function"?t:dn(t)))}function wi(t){typeof t!="function"&&(t=fn(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],a=s.length,c=i[r]=[],u,l=0;l<a;++l)(u=s[l])&&t.call(u,u.__data__,l,s)&&c.push(u);return new A(i,this._parents)}function pn(t){return new Array(t.length)}function yi(){return new A(this._enter||this._groups.map(pn),this._parents)}function qt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}qt.prototype={constructor:qt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function xi(t){return function(){return t}}function _i(t,e,n,i,r,s){for(var a=0,c,u=e.length,l=s.length;a<l;++a)(c=e[a])?(c.__data__=s[a],i[a]=c):n[a]=new qt(t,s[a]);for(;a<u;++a)(c=e[a])&&(r[a]=c)}function bi(t,e,n,i,r,s,a){var c,u,l=new Map,o=e.length,h=s.length,f=new Array(o),p;for(c=0;c<o;++c)(u=e[c])&&(f[c]=p=a.call(u,u.__data__,c,e)+"",l.has(p)?r[c]=u:l.set(p,u));for(c=0;c<h;++c)p=a.call(t,s[c],c,s)+"",(u=l.get(p))?(i[c]=u,u.__data__=s[c],l.delete(p)):n[c]=new qt(t,s[c]);for(c=0;c<o;++c)(u=e[c])&&l.get(f[c])===u&&(r[c]=u)}function Si(t){return t.__data__}function Ci(t,e){if(!arguments.length)return Array.from(this,Si);var n=e?bi:_i,i=this._parents,r=this._groups;typeof t!="function"&&(t=xi(t));for(var s=r.length,a=new Array(s),c=new Array(s),u=new Array(s),l=0;l<s;++l){var o=i[l],h=r[l],f=h.length,p=Ei(t.call(o,o&&o.__data__,l,i)),m=p.length,g=c[l]=new Array(m),d=a[l]=new Array(m),v=u[l]=new Array(f);n(o,h,g,d,v,p,e);for(var x=0,_=0,S,$;x<m;++x)if(S=g[x]){for(x>=_&&(_=x+1);!($=d[_])&&++_<m;);S._next=$||null}}return a=new A(a,i),a._enter=c,a._exit=u,a}function Ei(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Mi(){return new A(this._exit||this._groups.map(pn),this._parents)}function Ni(t,e,n){var i=this.enter(),r=this,s=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?s.remove():n(s),i&&r?i.merge(r).order():r}function Ai(t){for(var e=t.selection?t.selection():t,n=this._groups,i=e._groups,r=n.length,s=i.length,a=Math.min(r,s),c=new Array(r),u=0;u<a;++u)for(var l=n[u],o=i[u],h=l.length,f=c[u]=new Array(h),p,m=0;m<h;++m)(p=l[m]||o[m])&&(f[m]=p);for(;u<r;++u)c[u]=n[u];return new A(c,this._parents)}function ki(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i=t[e],r=i.length-1,s=i[r],a;--r>=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function zi(t){t||(t=Pi);function e(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var a=n[s],c=a.length,u=r[s]=new Array(c),l,o=0;o<c;++o)(l=a[o])&&(u[o]=l);u.sort(e)}return new A(r,this._parents).order()}function Pi(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function $i(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Ti(){return Array.from(this)}function Zi(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length;r<s;++r){var a=i[r];if(a)return a}return null}function Ii(){let t=0;for(const e of this)++t;return t}function Li(){return!this.node()}function Di(t){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var r=e[n],s=0,a=r.length,c;s<a;++s)(c=r[s])&&t.call(c,c.__data__,s,r);return this}function Bi(t){return function(){this.removeAttribute(t)}}function Ri(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Oi(t,e){return function(){this.setAttribute(t,e)}}function qi(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Vi(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Fi(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function Hi(t,e){var n=Gt(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((e==null?n.local?Ri:Bi:typeof e=="function"?n.local?Fi:Vi:n.local?qi:Oi)(n,e))}function gn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Xi(t){return function(){this.style.removeProperty(t)}}function Ui(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Wi(t,e,n){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function Yi(t,e,n){return arguments.length>1?this.each((e==null?Xi:typeof e=="function"?Wi:Ui)(t,e,n??"")):ct(this.node(),t)}function ct(t,e){return t.style.getPropertyValue(e)||gn(t).getComputedStyle(t,null).getPropertyValue(e)}function Gi(t){return function(){delete this[t]}}function Ki(t,e){return function(){this[t]=e}}function Qi(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ji(t,e){return arguments.length>1?this.each((e==null?Gi:typeof e=="function"?Qi:Ki)(t,e)):this.node()[t]}function mn(t){return t.trim().split(/^|\s+/)}function xe(t){return t.classList||new vn(t)}function vn(t){this._node=t,this._names=mn(t.getAttribute("class")||"")}vn.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function wn(t,e){for(var n=xe(t),i=-1,r=e.length;++i<r;)n.add(e[i])}function yn(t,e){for(var n=xe(t),i=-1,r=e.length;++i<r;)n.remove(e[i])}function ji(t){return function(){wn(this,t)}}function tr(t){return function(){yn(this,t)}}function er(t,e){return function(){(e.apply(this,arguments)?wn:yn)(this,t)}}function nr(t,e){var n=mn(t+"");if(arguments.length<2){for(var i=xe(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?er:e?ji:tr)(n,e))}function ir(){this.textContent=""}function rr(t){return function(){this.textContent=t}}function or(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function sr(t){return arguments.length?this.each(t==null?ir:(typeof t=="function"?or:rr)(t)):this.node().textContent}function ar(){this.innerHTML=""}function lr(t){return function(){this.innerHTML=t}}function cr(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function ur(t){return arguments.length?this.each(t==null?ar:(typeof t=="function"?cr:lr)(t)):this.node().innerHTML}function hr(){this.nextSibling&&this.parentNode.appendChild(this)}function fr(){return this.each(hr)}function dr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function pr(){return this.each(dr)}function gr(t){var e=typeof t=="function"?t:cn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function mr(){return null}function vr(t,e){var n=typeof t=="function"?t:cn(t),i=e==null?mr:typeof e=="function"?e:ye(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})}function wr(){var t=this.parentNode;t&&t.removeChild(this)}function yr(){return this.each(wr)}function xr(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function _r(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function br(t){return this.select(t?_r:xr)}function Sr(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Cr(t){return function(e){t.call(this,e,this.__data__)}}function Er(t){return t.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function Mr(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,r=e.length,s;n<r;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++i]=s;++i?e.length=i:delete this.__on}}}function Nr(t,e,n){return function(){var i=this.__on,r,s=Cr(e);if(i){for(var a=0,c=i.length;a<c;++a)if((r=i[a]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),r.value=e;return}}this.addEventListener(t.type,s,n),r={type:t.type,name:t.name,value:e,listener:s,options:n},i?i.push(r):this.__on=[r]}}function Ar(t,e,n){var i=Er(t+""),r,s=i.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,l=c.length,o;u<l;++u)for(r=0,o=c[u];r<s;++r)if((a=i[r]).type===o.type&&a.name===o.name)return o.value}return}for(c=e?Nr:Mr,r=0;r<s;++r)this.each(c(i[r],e,n));return this}function xn(t,e,n){var i=gn(t),r=i.CustomEvent;typeof r=="function"?r=new r(e,n):(r=i.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function kr(t,e){return function(){return xn(this,t,e)}}function zr(t,e){return function(){return xn(this,t,e.apply(this,arguments))}}function Pr(t,e){return this.each((typeof e=="function"?zr:kr)(t,e))}function*$r(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var i=t[e],r=0,s=i.length,a;r<s;++r)(a=i[r])&&(yield a)}var _e=[null];function A(t,e){this._groups=t,this._parents=e}function Et(){return new A([[document.documentElement]],_e)}function Tr(){return this}A.prototype=Et.prototype={constructor:A,select:si,selectAll:ci,selectChild:di,selectChildren:vi,filter:wi,data:Ci,enter:yi,exit:Mi,join:Ni,merge:Ai,selection:Tr,order:ki,sort:zi,call:$i,nodes:Ti,node:Zi,size:Ii,empty:Li,each:Di,attr:Hi,style:Yi,property:Ji,classed:nr,text:sr,html:ur,raise:fr,lower:pr,append:gr,insert:vr,remove:yr,clone:br,datum:Sr,on:Ar,dispatch:Pr,[Symbol.iterator]:$r};function R(t){return typeof t=="string"?new A([[document.querySelector(t)]],[document.documentElement]):new A([[t]],_e)}function Vt(t){return typeof t=="string"?new A([document.querySelectorAll(t)],[document.documentElement]):new A([un(t)],_e)}function be(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function _n(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Mt(){}var xt=.7,Ft=1/xt,lt="\\s*([+-]?\\d+)\\s*",_t="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",U="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zr=/^#([0-9a-f]{3,8})$/,Ir=new RegExp(`^rgb\\(${lt},${lt},${lt}\\)$`),Lr=new RegExp(`^rgb\\(${U},${U},${U}\\)$`),Dr=new RegExp(`^rgba\\(${lt},${lt},${lt},${_t}\\)$`),Br=new RegExp(`^rgba\\(${U},${U},${U},${_t}\\)$`),Rr=new RegExp(`^hsl\\(${_t},${U},${U}\\)$`),Or=new RegExp(`^hsla\\(${_t},${U},${U},${_t}\\)$`),Oe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};be(Mt,bt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:qe,formatHex:qe,formatHex8:qr,formatHsl:Vr,formatRgb:Ve,toString:Ve});function qe(){return this.rgb().formatHex()}function qr(){return this.rgb().formatHex8()}function Vr(){return bn(this).formatHsl()}function Ve(){return this.rgb().formatRgb()}function bt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Zr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Fe(e):n===3?new P(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?$t(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?$t(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ir.exec(t))?new P(e[1],e[2],e[3],1):(e=Lr.exec(t))?new P(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Dr.exec(t))?$t(e[1],e[2],e[3],e[4]):(e=Br.exec(t))?$t(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Rr.exec(t))?Ue(e[1],e[2]/100,e[3]/100,1):(e=Or.exec(t))?Ue(e[1],e[2]/100,e[3]/100,e[4]):Oe.hasOwnProperty(t)?Fe(Oe[t]):t==="transparent"?new P(NaN,NaN,NaN,0):null}function Fe(t){return new P(t>>16&255,t>>8&255,t&255,1)}function $t(t,e,n,i){return i<=0&&(t=e=n=NaN),new P(t,e,n,i)}function Fr(t){return t instanceof Mt||(t=bt(t)),t?(t=t.rgb(),new P(t.r,t.g,t.b,t.opacity)):new P}function de(t,e,n,i){return arguments.length===1?Fr(t):new P(t,e,n,i??1)}function P(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}be(P,de,_n(Mt,{brighter(t){return t=t==null?Ft:Math.pow(Ft,t),new P(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?xt:Math.pow(xt,t),new P(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new P(rt(this.r),rt(this.g),rt(this.b),Ht(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:He,formatHex:He,formatHex8:Hr,formatRgb:Xe,toString:Xe}));function He(){return`#${it(this.r)}${it(this.g)}${it(this.b)}`}function Hr(){return`#${it(this.r)}${it(this.g)}${it(this.b)}${it((isNaN(this.opacity)?1:this.opacity)*255)}`}function Xe(){const t=Ht(this.opacity);return`${t===1?"rgb(":"rgba("}${rt(this.r)}, ${rt(this.g)}, ${rt(this.b)}${t===1?")":`, ${t})`}`}function Ht(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function rt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function it(t){return t=rt(t),(t<16?"0":"")+t.toString(16)}function Ue(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new O(t,e,n,i)}function bn(t){if(t instanceof O)return new O(t.h,t.s,t.l,t.opacity);if(t instanceof Mt||(t=bt(t)),!t)return new O;if(t instanceof O)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),s=Math.max(e,n,i),a=NaN,c=s-r,u=(s+r)/2;return c?(e===s?a=(n-i)/c+(n<i)*6:n===s?a=(i-e)/c+2:a=(e-n)/c+4,c/=u<.5?s+r:2-s-r,a*=60):c=u>0&&u<1?0:a,new O(a,c,u,t.opacity)}function Xr(t,e,n,i){return arguments.length===1?bn(t):new O(t,e,n,i??1)}function O(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}be(O,Xr,_n(Mt,{brighter(t){return t=t==null?Ft:Math.pow(Ft,t),new O(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?xt:Math.pow(xt,t),new O(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new P(ie(t>=240?t-240:t+120,r,i),ie(t,r,i),ie(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new O(We(this.h),Tt(this.s),Tt(this.l),Ht(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ht(this.opacity);return`${t===1?"hsl(":"hsla("}${We(this.h)}, ${Tt(this.s)*100}%, ${Tt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function We(t){return t=(t||0)%360,t<0?t+360:t}function Tt(t){return Math.max(0,Math.min(1,t||0))}function ie(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Sn=t=>()=>t;function Ur(t,e){return function(n){return t+n*e}}function Wr(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function Yr(t){return(t=+t)==1?Cn:function(e,n){return n-e?Wr(e,n,t):Sn(isNaN(e)?n:e)}}function Cn(t,e){var n=e-t;return n?Ur(t,n):Sn(isNaN(t)?e:t)}const Ye=(function t(e){var n=Yr(e);function i(r,s){var a=n((r=de(r)).r,(s=de(s)).r),c=n(r.g,s.g),u=n(r.b,s.b),l=Cn(r.opacity,s.opacity);return function(o){return r.r=a(o),r.g=c(o),r.b=u(o),r.opacity=l(o),r+""}}return i.gamma=t,i})(1);function et(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var pe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,re=new RegExp(pe.source,"g");function Gr(t){return function(){return t}}function Kr(t){return function(e){return t(e)+""}}function Qr(t,e){var n=pe.lastIndex=re.lastIndex=0,i,r,s,a=-1,c=[],u=[];for(t=t+"",e=e+"";(i=pe.exec(t))&&(r=re.exec(e));)(s=r.index)>n&&(s=e.slice(n,s),c[a]?c[a]+=s:c[++a]=s),(i=i[0])===(r=r[0])?c[a]?c[a]+=r:c[++a]=r:(c[++a]=null,u.push({i:a,x:et(i,r)})),n=re.lastIndex;return n<e.length&&(s=e.slice(n),c[a]?c[a]+=s:c[++a]=s),c.length<2?u[0]?Kr(u[0].x):Gr(e):(e=u.length,function(l){for(var o=0,h;o<e;++o)c[(h=u[o]).i]=h.x(l);return c.join("")})}var Ge=180/Math.PI,ge={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function En(t,e,n,i,r,s){var a,c,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*i)&&(n-=t*u,i-=e*u),(c=Math.sqrt(n*n+i*i))&&(n/=c,i/=c,u/=c),t*i<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(e,t)*Ge,skewX:Math.atan(u)*Ge,scaleX:a,scaleY:c}}var Zt;function Jr(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ge:En(e.a,e.b,e.c,e.d,e.e,e.f)}function jr(t){return t==null||(Zt||(Zt=document.createElementNS("http://www.w3.org/2000/svg","g")),Zt.setAttribute("transform",t),!(t=Zt.transform.baseVal.consolidate()))?ge:(t=t.matrix,En(t.a,t.b,t.c,t.d,t.e,t.f))}function Mn(t,e,n,i){function r(l){return l.length?l.pop()+" ":""}function s(l,o,h,f,p,m){if(l!==h||o!==f){var g=p.push("translate(",null,e,null,n);m.push({i:g-4,x:et(l,h)},{i:g-2,x:et(o,f)})}else(h||f)&&p.push("translate("+h+e+f+n)}function a(l,o,h,f){l!==o?(l-o>180?o+=360:o-l>180&&(l+=360),f.push({i:h.push(r(h)+"rotate(",null,i)-2,x:et(l,o)})):o&&h.push(r(h)+"rotate("+o+i)}function c(l,o,h,f){l!==o?f.push({i:h.push(r(h)+"skewX(",null,i)-2,x:et(l,o)}):o&&h.push(r(h)+"skewX("+o+i)}function u(l,o,h,f,p,m){if(l!==h||o!==f){var g=p.push(r(p)+"scale(",null,",",null,")");m.push({i:g-4,x:et(l,h)},{i:g-2,x:et(o,f)})}else(h!==1||f!==1)&&p.push(r(p)+"scale("+h+","+f+")")}return function(l,o){var h=[],f=[];return l=t(l),o=t(o),s(l.translateX,l.translateY,o.translateX,o.translateY,h,f),a(l.rotate,o.rotate,h,f),c(l.skewX,o.skewX,h,f),u(l.scaleX,l.scaleY,o.scaleX,o.scaleY,h,f),l=o=null,function(p){for(var m=-1,g=f.length,d;++m<g;)h[(d=f[m]).i]=d.x(p);return h.join("")}}}var to=Mn(Jr,"px, ","px)","deg)"),eo=Mn(jr,", ",")",")"),ut=0,vt=0,gt=0,Nn=1e3,Xt,wt,Ut=0,ot=0,Kt=0,St=typeof performance=="object"&&performance.now?performance:Date,An=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Se(){return ot||(An(no),ot=St.now()+Kt)}function no(){ot=0}function Wt(){this._call=this._time=this._next=null}Wt.prototype=kn.prototype={constructor:Wt,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Se():+n)+(e==null?0:+e),!this._next&&wt!==this&&(wt?wt._next=this:Xt=this,wt=this),this._call=t,this._time=n,me()},stop:function(){this._call&&(this._call=null,this._time=1/0,me())}};function kn(t,e,n){var i=new Wt;return i.restart(t,e,n),i}function io(){Se(),++ut;for(var t=Xt,e;t;)(e=ot-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ut}function Ke(){ot=(Ut=St.now())+Kt,ut=vt=0;try{io()}finally{ut=0,oo(),ot=0}}function ro(){var t=St.now(),e=t-Ut;e>Nn&&(Kt-=e,Ut=t)}function oo(){for(var t,e=Xt,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Xt=n);wt=t,me(i)}function me(t){if(!ut){vt&&(vt=clearTimeout(vt));var e=t-ot;e>24?(t<1/0&&(vt=setTimeout(Ke,t-St.now()-Kt)),gt&&(gt=clearInterval(gt))):(gt||(Ut=St.now(),gt=setInterval(ro,Nn)),ut=1,An(Ke))}}function Qe(t,e,n){var i=new Wt;return e=e==null?0:+e,i.restart(r=>{i.stop(),t(r+e)},e,n),i}var so=ln("start","end","cancel","interrupt"),ao=[],zn=0,Je=1,ve=2,Lt=3,je=4,we=5,Dt=6;function Qt(t,e,n,i,r,s){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;lo(t,n,{name:e,index:i,group:r,on:so,tween:ao,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:zn})}function Ce(t,e){var n=q(t,e);if(n.state>zn)throw new Error("too late; already scheduled");return n}function W(t,e){var n=q(t,e);if(n.state>Lt)throw new Error("too late; already running");return n}function q(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function lo(t,e,n){var i=t.__transition,r;i[e]=n,n.timer=kn(s,0,n.time);function s(l){n.state=Je,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var o,h,f,p;if(n.state!==Je)return u();for(o in i)if(p=i[o],p.name===n.name){if(p.state===Lt)return Qe(a);p.state===je?(p.state=Dt,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete i[o]):+o<e&&(p.state=Dt,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete i[o])}if(Qe(function(){n.state===Lt&&(n.state=je,n.timer.restart(c,n.delay,n.time),c(l))}),n.state=ve,n.on.call("start",t,t.__data__,n.index,n.group),n.state===ve){for(n.state=Lt,r=new Array(f=n.tween.length),o=0,h=-1;o<f;++o)(p=n.tween[o].value.call(t,t.__data__,n.index,n.group))&&(r[++h]=p);r.length=h+1}}function c(l){for(var o=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=we,1),h=-1,f=r.length;++h<f;)r[h].call(t,o);n.state===we&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=Dt,n.timer.stop(),delete i[e];for(var l in i)return;delete t.__transition}}function co(t,e){var n=t.__transition,i,r,s=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((i=n[a]).name!==e){s=!1;continue}r=i.state>ve&&i.state<we,i.state=Dt,i.timer.stop(),i.on.call(r?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete n[a]}s&&delete t.__transition}}function uo(t){return this.each(function(){co(this,t)})}function ho(t,e){var n,i;return function(){var r=W(this,t),s=r.tween;if(s!==n){i=n=s;for(var a=0,c=i.length;a<c;++a)if(i[a].name===e){i=i.slice(),i.splice(a,1);break}}r.tween=i}}function fo(t,e,n){var i,r;if(typeof n!="function")throw new Error;return function(){var s=W(this,t),a=s.tween;if(a!==i){r=(i=a).slice();for(var c={name:e,value:n},u=0,l=r.length;u<l;++u)if(r[u].name===e){r[u]=c;break}u===l&&r.push(c)}s.tween=r}}function po(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i=q(this.node(),n).tween,r=0,s=i.length,a;r<s;++r)if((a=i[r]).name===t)return a.value;return null}return this.each((e==null?ho:fo)(n,t,e))}function Ee(t,e,n){var i=t._id;return t.each(function(){var r=W(this,i);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return q(r,i).value[e]}}function Pn(t,e){var n;return(typeof e=="number"?et:e instanceof bt?Ye:(n=bt(e))?(e=n,Ye):Qr)(t,e)}function go(t){return function(){this.removeAttribute(t)}}function mo(t){return function(){this.removeAttributeNS(t.space,t.local)}}function vo(t,e,n){var i,r=n+"",s;return function(){var a=this.getAttribute(t);return a===r?null:a===i?s:s=e(i=a,n)}}function wo(t,e,n){var i,r=n+"",s;return function(){var a=this.getAttributeNS(t.space,t.local);return a===r?null:a===i?s:s=e(i=a,n)}}function yo(t,e,n){var i,r,s;return function(){var a,c=n(this),u;return c==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=c+"",a===u?null:a===i&&u===r?s:(r=u,s=e(i=a,c)))}}function xo(t,e,n){var i,r,s;return function(){var a,c=n(this),u;return c==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=c+"",a===u?null:a===i&&u===r?s:(r=u,s=e(i=a,c)))}}function _o(t,e){var n=Gt(t),i=n==="transform"?eo:Pn;return this.attrTween(t,typeof e=="function"?(n.local?xo:yo)(n,i,Ee(this,"attr."+t,e)):e==null?(n.local?mo:go)(n):(n.local?wo:vo)(n,i,e))}function bo(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function So(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Co(t,e){var n,i;function r(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&So(t,s)),n}return r._value=e,r}function Eo(t,e){var n,i;function r(){var s=e.apply(this,arguments);return s!==i&&(n=(i=s)&&bo(t,s)),n}return r._value=e,r}function Mo(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var i=Gt(t);return this.tween(n,(i.local?Co:Eo)(i,e))}function No(t,e){return function(){Ce(this,t).delay=+e.apply(this,arguments)}}function Ao(t,e){return e=+e,function(){Ce(this,t).delay=e}}function ko(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?No:Ao)(e,t)):q(this.node(),e).delay}function zo(t,e){return function(){W(this,t).duration=+e.apply(this,arguments)}}function Po(t,e){return e=+e,function(){W(this,t).duration=e}}function $o(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?zo:Po)(e,t)):q(this.node(),e).duration}function To(t,e){if(typeof e!="function")throw new Error;return function(){W(this,t).ease=e}}function Zo(t){var e=this._id;return arguments.length?this.each(To(e,t)):q(this.node(),e).ease}function Io(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;W(this,t).ease=n}}function Lo(t){if(typeof t!="function")throw new Error;return this.each(Io(this._id,t))}function Do(t){typeof t!="function"&&(t=fn(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r<n;++r)for(var s=e[r],a=s.length,c=i[r]=[],u,l=0;l<a;++l)(u=s[l])&&t.call(u,u.__data__,l,s)&&c.push(u);return new K(i,this._parents,this._name,this._id)}function Bo(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,i=e.length,r=n.length,s=Math.min(i,r),a=new Array(i),c=0;c<s;++c)for(var u=e[c],l=n[c],o=u.length,h=a[c]=new Array(o),f,p=0;p<o;++p)(f=u[p]||l[p])&&(h[p]=f);for(;c<i;++c)a[c]=e[c];return new K(a,this._parents,this._name,this._id)}function Ro(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Oo(t,e,n){var i,r,s=Ro(e)?Ce:W;return function(){var a=s(this,t),c=a.on;c!==i&&(r=(i=c).copy()).on(e,n),a.on=r}}function qo(t,e){var n=this._id;return arguments.length<2?q(this.node(),n).on.on(t):this.each(Oo(n,t,e))}function Vo(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Fo(){return this.on("end.remove",Vo(this._id))}function Ho(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ye(t));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a<r;++a)for(var c=i[a],u=c.length,l=s[a]=new Array(u),o,h,f=0;f<u;++f)(o=c[f])&&(h=t.call(o,o.__data__,f,c))&&("__data__"in o&&(h.__data__=o.__data__),l[f]=h,Qt(l[f],e,n,f,l,q(o,n)));return new K(s,this._parents,e,n)}function Xo(t){var e=this._name,n=this._id;typeof t!="function"&&(t=hn(t));for(var i=this._groups,r=i.length,s=[],a=[],c=0;c<r;++c)for(var u=i[c],l=u.length,o,h=0;h<l;++h)if(o=u[h]){for(var f=t.call(o,o.__data__,h,u),p,m=q(o,n),g=0,d=f.length;g<d;++g)(p=f[g])&&Qt(p,e,n,g,f,m);s.push(f),a.push(o)}return new K(s,a,e,n)}var Uo=Et.prototype.constructor;function Wo(){return new Uo(this._groups,this._parents)}function Yo(t,e){var n,i,r;return function(){var s=ct(this,t),a=(this.style.removeProperty(t),ct(this,t));return s===a?null:s===n&&a===i?r:r=e(n=s,i=a)}}function $n(t){return function(){this.style.removeProperty(t)}}function Go(t,e,n){var i,r=n+"",s;return function(){var a=ct(this,t);return a===r?null:a===i?s:s=e(i=a,n)}}function Ko(t,e,n){var i,r,s;return function(){var a=ct(this,t),c=n(this),u=c+"";return c==null&&(u=c=(this.style.removeProperty(t),ct(this,t))),a===u?null:a===i&&u===r?s:(r=u,s=e(i=a,c))}}function Qo(t,e){var n,i,r,s="style."+e,a="end."+s,c;return function(){var u=W(this,t),l=u.on,o=u.value[s]==null?c||(c=$n(e)):void 0;(l!==n||r!==o)&&(i=(n=l).copy()).on(a,r=o),u.on=i}}function Jo(t,e,n){var i=(t+="")=="transform"?to:Pn;return e==null?this.styleTween(t,Yo(t,i)).on("end.style."+t,$n(t)):typeof e=="function"?this.styleTween(t,Ko(t,i,Ee(this,"style."+t,e))).each(Qo(this._id,t)):this.styleTween(t,Go(t,i,e),n).on("end.style."+t,null)}function jo(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}function ts(t,e,n){var i,r;function s(){var a=e.apply(this,arguments);return a!==r&&(i=(r=a)&&jo(t,a,n)),i}return s._value=e,s}function es(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;return this.tween(i,ts(t,e,n??""))}function ns(t){return function(){this.textContent=t}}function is(t){return function(){var e=t(this);this.textContent=e??""}}function rs(t){return this.tween("text",typeof t=="function"?is(Ee(this,"text",t)):ns(t==null?"":t+""))}function os(t){return function(e){this.textContent=t.call(this,e)}}function ss(t){var e,n;function i(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&os(r)),e}return i._value=t,i}function as(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,ss(t))}function ls(){for(var t=this._name,e=this._id,n=Tn(),i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],c=a.length,u,l=0;l<c;++l)if(u=a[l]){var o=q(u,e);Qt(u,t,n,l,a,{time:o.time+o.delay+o.duration,delay:0,duration:o.duration,ease:o.ease})}return new K(i,this._parents,t,n)}function cs(){var t,e,n=this,i=n._id,r=n.size();return new Promise(function(s,a){var c={value:a},u={value:function(){--r===0&&s()}};n.each(function(){var l=W(this,i),o=l.on;o!==t&&(e=(t=o).copy(),e._.cancel.push(c),e._.interrupt.push(c),e._.end.push(u)),l.on=e}),r===0&&s()})}var us=0;function K(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function Tn(){return++us}var G=Et.prototype;K.prototype={constructor:K,select:Ho,selectAll:Xo,selectChild:G.selectChild,selectChildren:G.selectChildren,filter:Do,merge:Bo,selection:Wo,transition:ls,call:G.call,nodes:G.nodes,node:G.node,size:G.size,empty:G.empty,each:G.each,on:qo,attr:_o,attrTween:Mo,style:Jo,styleTween:es,text:rs,textTween:as,remove:Fo,tween:po,delay:ko,duration:$o,ease:Zo,easeVarying:Lo,end:cs,[Symbol.iterator]:G[Symbol.iterator]};function hs(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var fs={time:null,delay:0,duration:250,ease:hs};function ds(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function ps(t){var e,n;t instanceof K?(e=t._id,t=t._name):(e=Tn(),(n=fs).time=Se(),t=t==null?null:t+"");for(var i=this._groups,r=i.length,s=0;s<r;++s)for(var a=i[s],c=a.length,u,l=0;l<c;++l)(u=a[l])&&Qt(u,t,e,l,a,n||ds(u,e));return new K(i,this._parents,t,e)}Et.prototype.interrupt=uo;Et.prototype.transition=ps;function gs(t){var e=0,n=t.children,i=n&&n.length;if(!i)e=1;else for(;--i>=0;)e+=n[i].value;t.value=e}function ms(){return this.eachAfter(gs)}function vs(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this}function ws(t,e){for(var n=this,i=[n],r,s,a=-1;n=i.pop();)if(t.call(e,n,++a,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function ys(t,e){for(var n=this,i=[n],r=[],s,a,c,u=-1;n=i.pop();)if(r.push(n),s=n.children)for(a=0,c=s.length;a<c;++a)i.push(s[a]);for(;n=r.pop();)t.call(e,n,++u,this);return this}function xs(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i}function _s(t){return this.eachAfter(function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n})}function bs(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Ss(t){for(var e=this,n=Cs(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i}function Cs(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}function Es(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Ms(){return Array.from(this)}function Ns(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function As(){var t=this,e=[];return t.each(function(n){n!==t&&e.push({source:n.parent,target:n})}),e}function*ks(){var t=this,e,n=[t],i,r,s;do for(e=n.reverse(),n=[];t=e.pop();)if(yield t,i=t.children)for(r=0,s=i.length;r<s;++r)n.push(i[r]);while(n.length)}function Me(t,e){t instanceof Map?(t=[void 0,t],e===void 0&&(e=$s)):e===void 0&&(e=Ps);for(var n=new Ct(t),i,r=[n],s,a,c,u;i=r.pop();)if((a=e(i.data))&&(u=(a=Array.from(a)).length))for(i.children=a,c=u-1;c>=0;--c)r.push(s=a[c]=new Ct(a[c])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(Zs)}function zs(){return Me(this).eachBefore(Ts)}function Ps(t){return t.children}function $s(t){return Array.isArray(t)?t[1]:null}function Ts(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Zs(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function Ct(t){this.data=t,this.depth=this.height=0,this.parent=null}Ct.prototype=Me.prototype={constructor:Ct,count:ms,each:vs,eachAfter:ys,eachBefore:ws,find:xs,sum:_s,sort:bs,path:Ss,ancestors:Es,descendants:Ms,leaves:Ns,links:As,copy:zs,[Symbol.iterator]:ks};function Is(t,e){return t.parent===e.parent?1:2}function oe(t){var e=t.children;return e?e[0]:t.t}function se(t){var e=t.children;return e?e[e.length-1]:t.t}function Ls(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function Ds(t){for(var e=0,n=0,i=t.children,r=i.length,s;--r>=0;)s=i[r],s.z+=e,s.m+=e,e+=s.s+(n+=s.c)}function Bs(t,e,n){return t.a.parent===e.parent?t.a:n}function Bt(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}Bt.prototype=Object.create(Ct.prototype);function Rs(t){for(var e=new Bt(t,0),n,i=[e],r,s,a,c;n=i.pop();)if(s=n._.children)for(n.children=new Array(c=s.length),a=c-1;a>=0;--a)i.push(r=n.children[a]=new Bt(s[a],a)),r.parent=n;return(e.parent=new Bt(null,0)).children=[e],e}function Os(){var t=Is,e=1,n=1,i=null;function r(l){var o=Rs(l);if(o.eachAfter(s),o.parent.m=-o.z,o.eachBefore(a),i)l.eachBefore(u);else{var h=l,f=l,p=l;l.eachBefore(function(x){x.x<h.x&&(h=x),x.x>f.x&&(f=x),x.depth>p.depth&&(p=x)});var m=h===f?1:t(h,f)/2,g=m-h.x,d=e/(f.x+m+g),v=n/(p.depth||1);l.eachBefore(function(x){x.x=(x.x+g)*d,x.y=x.depth*v})}return l}function s(l){var o=l.children,h=l.parent.children,f=l.i?h[l.i-1]:null;if(o){Ds(l);var p=(o[0].z+o[o.length-1].z)/2;f?(l.z=f.z+t(l._,f._),l.m=l.z-p):l.z=p}else f&&(l.z=f.z+t(l._,f._));l.parent.A=c(l,f,l.parent.A||h[0])}function a(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function c(l,o,h){if(o){for(var f=l,p=l,m=o,g=f.parent.children[0],d=f.m,v=p.m,x=m.m,_=g.m,S;m=se(m),f=oe(f),m&&f;)g=oe(g),p=se(p),p.a=l,S=m.z+x-f.z-d+t(m._,f._),S>0&&(Ls(Bs(m,l,h),l,S),d+=S,v+=S),x+=m.m,d+=f.m,_+=g.m,v+=p.m;m&&!se(p)&&(p.t=m,p.m+=x-v),f&&!oe(g)&&(g.t=f,g.m+=d-_,h=l)}return h}function u(l){l.x*=e,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(t=l,r):t},r.size=function(l){return arguments.length?(i=!1,e=+l[0],n=+l[1],r):i?null:[e,n]},r.nodeSize=function(l){return arguments.length?(i=!0,e=+l[0],n=+l[1],r):i?[e,n]:null},r}function yt(t,e,n){this.k=t,this.x=e,this.y=n}yt.prototype={constructor:yt,scale:function(t){return t===1?this:new yt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new yt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};yt.prototype;function qs(t,e){const n=new Set;for(const c of t.nodes){const u=c.curationStatus,l=c.visualDepth,o=c.source==="current",h=l<0,f=l>0,p=l===0,m=e.curationFilter.includes(u),g=l<=(e.numChildLevels??1/0),d=o||p||h&&e.showParentsFromOtherSheets||f&&e.showChildrenFromOtherSheets;m&&g&&d&&n.add(c.id)}const i=t.nodes.filter(c=>n.has(c.id)),r=t.edges.filter(c=>n.has(c.source)&&n.has(c.target)),s=r.filter(c=>c.type==="subclass_of"),a=r.filter(c=>c.type!=="subclass_of");return{nodes:i,hierarchyEdges:s,relationEdges:a}}function Vs(t,e){const n=new Map,i=new Map;for(const u of e)n.has(u.source)||n.set(u.source,[]),n.get(u.source).push(u.target),i.set(u.target,u.source);const r=t.filter(u=>!i.has(u.id)),s=new Map;for(const u of t)s.set(u.id,u);function a(u){const l=s.get(u);if(!l)return null;const o=[],h=n.get(u)??[];for(const f of h){const p=a(f);p&&o.push(p)}return{id:l.id,label:l.label,ose_curation:l.curationStatus,ose_origin:l.origin,ose_source:l.source,ose_selected:l.isSelected,children:o}}const c=[];for(const u of r){const l=a(u.id);l&&c.push(l)}return c}function Fs(t,e){const n=t.trim().toLowerCase();if(Vt(".node").classed("search-match",!1).classed("search-current",!1),!n)return[];const i=[];return Vt(".node").each(function(){const r=R(this),s=r.attr("data-node-id"),a=e[s]||"",c=s?.replace("_",":")||"";(a.toLowerCase().includes(n)||c.toLowerCase().includes(n))&&(i.push(s),r.classed("search-match",!0))}),i}function Hs(t){Vt(".node").classed("search-current",!1),R(`.node[data-node-id="${t}"]`).classed("search-current",!0)}function Xs(){Vt(".node").classed("search-match",!1).classed("search-current",!1)}function Us(t,e,n){const i=document.querySelector(`.node[data-node-id="${t}"]`);if(!i)return console.warn("Node element not found:",t),!1;const r=e.querySelector("svg");if(!r)return!1;const s=r.querySelector(".graph-container");if(!s)return!1;const a=i.getBBox();let c=a.x+a.width/2,u=a.y+a.height/2,l=i;for(;l&&l!==s;){const m=l.getAttribute("transform");if(m){const g=m.match(/translate\(([^,]+),([^)]+)\)/);g&&(c+=parseFloat(g[1]),u+=parseFloat(g[2]))}if(l=l.parentElement,!l||l===r)break}const o=n.getSizes().realZoom,h=n.getSizes(),f=h.width/2-c*o,p=h.height/2-u*o;return n.pan({x:f,y:p}),!0}function Ws(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ae,tn;function Ys(){return tn||(tn=1,ae=(function(){var t="",e,n,i,r=[],s={passive:!0},a={passive:!1};window.addEventListener?(e="addEventListener",n="removeEventListener"):(e="attachEvent",n="detachEvent",t="on"),i="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";function c(m,g){var d=function(v){!v&&(v=window.event);var x={originalEvent:v,target:v.target||v.srcElement,type:"wheel",deltaMode:v.type=="MozMousePixelScroll"?0:1,deltaX:0,delatZ:0,preventDefault:function(){v.preventDefault?v.preventDefault():v.returnValue=!1}};return i=="mousewheel"?(x.deltaY=-.025*v.wheelDelta,v.wheelDeltaX&&(x.deltaX=-.025*v.wheelDeltaX)):x.deltaY=v.detail,g(x)};return r.push({element:m,fn:d}),d}function u(m){for(var g=0;g<r.length;g++)if(r[g].element===m)return r[g].fn;return function(){}}function l(m){for(var g=0;g<r.length;g++)if(r[g].element===m)return r.splice(g,1)}function o(m,g,d,v){var x;i==="wheel"?x=d:x=c(m,d),m[e](t+g,x,v?s:a)}function h(m,g,d,v){var x;i==="wheel"?x=d:x=u(m),m[n](t+g,x,v?s:a),l(m)}function f(m,g,d){o(m,i,g,d),i=="DOMMouseScroll"&&o(m,"MozMousePixelScroll",g,d)}function p(m,g,d){h(m,i,g,d),i=="DOMMouseScroll"&&h(m,"MozMousePixelScroll",g,d)}return{on:f,off:p}})()),ae}var le,en;function Ne(){if(en)return le;en=1,le={extend:function(e,n){e=e||{};for(var i in n)this.isObject(n[i])?e[i]=this.extend(e[i],n[i]):e[i]=n[i];return e},isElement:function(e){return e instanceof HTMLElement||e instanceof SVGElement||e instanceof SVGSVGElement||e&&typeof e=="object"&&e!==null&&e.nodeType===1&&typeof e.nodeName=="string"},isObject:function(e){return Object.prototype.toString.call(e)==="[object Object]"},isNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},getSvg:function(e){var n,i;if(this.isElement(e))n=e;else if(typeof e=="string"||e instanceof String){if(n=document.querySelector(e),!n)throw new Error("Provided selector did not find any elements. Selector: "+e)}else throw new Error("Provided selector is not an HTML object nor String");if(n.tagName.toLowerCase()==="svg")i=n;else if(n.tagName.toLowerCase()==="object")i=n.contentDocument.documentElement;else if(n.tagName.toLowerCase()==="embed")i=n.getSVGDocument().documentElement;else throw n.tagName.toLowerCase()==="img"?new Error('Cannot script an SVG in an "img" element. Please use an "object" element or an in-line SVG.'):new Error("Cannot get SVG.");return i},proxy:function(e,n){return function(){return e.apply(n,arguments)}},getType:function(e){return Object.prototype.toString.apply(e).replace(/^\[object\s/,"").replace(/\]$/,"")},mouseAndTouchNormalize:function(e,n){if(e.clientX===void 0||e.clientX===null)if(e.clientX=0,e.clientY=0,e.touches!==void 0&&e.touches.length){if(e.touches[0].clientX!==void 0)e.clientX=e.touches[0].clientX,e.clientY=e.touches[0].clientY;else if(e.touches[0].pageX!==void 0){var i=n.getBoundingClientRect();e.clientX=e.touches[0].pageX-i.left,e.clientY=e.touches[0].pageY-i.top}}else e.originalEvent!==void 0&&e.originalEvent.clientX!==void 0&&(e.clientX=e.originalEvent.clientX,e.clientY=e.originalEvent.clientY)},isDblClick:function(e,n){if(e.detail===2)return!0;if(n!=null){var i=e.timeStamp-n.timeStamp,r=Math.sqrt(Math.pow(e.clientX-n.clientX,2)+Math.pow(e.clientY-n.clientY,2));return i<250&&r<10}return!1},now:Date.now||function(){return new Date().getTime()},throttle:function(e,n,i){var r=this,s,a,c,u=null,l=0;i||(i={});var o=function(){l=i.leading===!1?0:r.now(),u=null,c=e.apply(s,a),u||(s=a=null)};return function(){var h=r.now();!l&&i.leading===!1&&(l=h);var f=n-(h-l);return s=this,a=arguments,f<=0||f>n?(clearTimeout(u),u=null,l=h,c=e.apply(s,a),u||(s=a=null)):!u&&i.trailing!==!1&&(u=setTimeout(o,f)),c}},createRequestAnimationFrame:function(e){var n=null;return e!=="auto"&&e<60&&e>1&&(n=Math.floor(1e3/e)),n===null?window.requestAnimationFrame||t(33):t(n)}};function t(e){return function(n){window.setTimeout(n,e)}}return le}var mt,nn;function Ae(){if(nn)return mt;nn=1;var t=Ne(),e="unknown";return document.documentMode&&(e="ie"),mt={svgNS:"http://www.w3.org/2000/svg",xmlNS:"http://www.w3.org/XML/1998/namespace",xmlnsNS:"http://www.w3.org/2000/xmlns/",xlinkNS:"http://www.w3.org/1999/xlink",evNS:"http://www.w3.org/2001/xml-events",getBoundingClientRectNormalized:function(n){if(n.clientWidth&&n.clientHeight)return{width:n.clientWidth,height:n.clientHeight};if(n.getBoundingClientRect())return n.getBoundingClientRect();throw new Error("Cannot get BoundingClientRect for SVG.")},getOrCreateViewport:function(n,i){var r=null;if(t.isElement(i)?r=i:r=n.querySelector(i),!r){var s=Array.prototype.slice.call(n.childNodes||n.children).filter(function(o){return o.nodeName!=="defs"&&o.nodeName!=="#text"});s.length===1&&s[0].nodeName==="g"&&s[0].getAttribute("transform")===null&&(r=s[0])}if(!r){var a="viewport-"+new Date().toISOString().replace(/\D/g,"");r=document.createElementNS(this.svgNS,"g"),r.setAttribute("id",a);var c=n.childNodes||n.children;if(c&&c.length>0)for(var u=c.length;u>0;u--)c[c.length-u].nodeName!=="defs"&&r.appendChild(c[c.length-u]);n.appendChild(r)}var l=[];return r.getAttribute("class")&&(l=r.getAttribute("class").split(" ")),~l.indexOf("svg-pan-zoom_viewport")||(l.push("svg-pan-zoom_viewport"),r.setAttribute("class",l.join(" "))),r},setupSvgAttributes:function(n){if(n.setAttribute("xmlns",this.svgNS),n.setAttributeNS(this.xmlnsNS,"xmlns:xlink",this.xlinkNS),n.setAttributeNS(this.xmlnsNS,"xmlns:ev",this.evNS),n.parentNode!==null){var i=n.getAttribute("style")||"";i.toLowerCase().indexOf("overflow")===-1&&n.setAttribute("style","overflow: hidden; "+i)}},internetExplorerRedisplayInterval:300,refreshDefsGlobal:t.throttle(function(){for(var n=document.querySelectorAll("defs"),i=n.length,r=0;r<i;r++){var s=n[r];s.parentNode.insertBefore(s,s)}},mt?mt.internetExplorerRedisplayInterval:null),setCTM:function(n,i,r){var s=this,a="matrix("+i.a+","+i.b+","+i.c+","+i.d+","+i.e+","+i.f+")";n.setAttributeNS(null,"transform",a),"transform"in n.style?n.style.transform=a:"-ms-transform"in n.style?n.style["-ms-transform"]=a:"-webkit-transform"in n.style&&(n.style["-webkit-transform"]=a),e==="ie"&&r&&(r.parentNode.insertBefore(r,r),window.setTimeout(function(){s.refreshDefsGlobal()},s.internetExplorerRedisplayInterval))},getEventPoint:function(n,i){var r=i.createSVGPoint();return t.mouseAndTouchNormalize(n,i),r.x=n.clientX,r.y=n.clientY,r},getSvgCenterPoint:function(n,i,r){return this.createSVGPoint(n,i/2,r/2)},createSVGPoint:function(n,i,r){var s=n.createSVGPoint();return s.x=i,s.y=r,s}},mt}var ce,rn;function Gs(){if(rn)return ce;rn=1;var t=Ae();return ce={enable:function(e){var n=e.svg.querySelector("defs");n||(n=document.createElementNS(t.svgNS,"defs"),e.svg.appendChild(n));var i=n.querySelector("style#svg-pan-zoom-controls-styles");if(!i){var r=document.createElementNS(t.svgNS,"style");r.setAttribute("id","svg-pan-zoom-controls-styles"),r.setAttribute("type","text/css"),r.textContent=".svg-pan-zoom-control { cursor: pointer; fill: black; fill-opacity: 0.333; } .svg-pan-zoom-control:hover { fill-opacity: 0.8; } .svg-pan-zoom-control-background { fill: white; fill-opacity: 0.5; } .svg-pan-zoom-control-background { fill-opacity: 0.8; }",n.appendChild(r)}var s=document.createElementNS(t.svgNS,"g");s.setAttribute("id","svg-pan-zoom-controls"),s.setAttribute("transform","translate("+(e.width-70)+" "+(e.height-76)+") scale(0.75)"),s.setAttribute("class","svg-pan-zoom-control"),s.appendChild(this._createZoomIn(e)),s.appendChild(this._createZoomReset(e)),s.appendChild(this._createZoomOut(e)),e.svg.appendChild(s),e.controlIcons=s},_createZoomIn:function(e){var n=document.createElementNS(t.svgNS,"g");n.setAttribute("id","svg-pan-zoom-zoom-in"),n.setAttribute("transform","translate(30.5 5) scale(0.015)"),n.setAttribute("class","svg-pan-zoom-control"),n.addEventListener("click",function(){e.getPublicInstance().zoomIn()},!1),n.addEventListener("touchstart",function(){e.getPublicInstance().zoomIn()},!1);var i=document.createElementNS(t.svgNS,"rect");i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("width","1500"),i.setAttribute("height","1400"),i.setAttribute("class","svg-pan-zoom-control-background"),n.appendChild(i);var r=document.createElementNS(t.svgNS,"path");return r.setAttribute("d","M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z"),r.setAttribute("class","svg-pan-zoom-control-element"),n.appendChild(r),n},_createZoomReset:function(e){var n=document.createElementNS(t.svgNS,"g");n.setAttribute("id","svg-pan-zoom-reset-pan-zoom"),n.setAttribute("transform","translate(5 35) scale(0.4)"),n.setAttribute("class","svg-pan-zoom-control"),n.addEventListener("click",function(){e.getPublicInstance().reset()},!1),n.addEventListener("touchstart",function(){e.getPublicInstance().reset()},!1);var i=document.createElementNS(t.svgNS,"rect");i.setAttribute("x","2"),i.setAttribute("y","2"),i.setAttribute("width","182"),i.setAttribute("height","58"),i.setAttribute("class","svg-pan-zoom-control-background"),n.appendChild(i);var r=document.createElementNS(t.svgNS,"path");r.setAttribute("d","M33.051,20.632c-0.742-0.406-1.854-0.609-3.338-0.609h-7.969v9.281h7.769c1.543,0,2.701-0.188,3.473-0.562c1.365-0.656,2.048-1.953,2.048-3.891C35.032,22.757,34.372,21.351,33.051,20.632z"),r.setAttribute("class","svg-pan-zoom-control-element"),n.appendChild(r);var s=document.createElementNS(t.svgNS,"path");return s.setAttribute("d","M170.231,0.5H15.847C7.102,0.5,0.5,5.708,0.5,11.84v38.861C0.5,56.833,7.102,61.5,15.847,61.5h154.384c8.745,0,15.269-4.667,15.269-10.798V11.84C185.5,5.708,178.976,0.5,170.231,0.5z M42.837,48.569h-7.969c-0.219-0.766-0.375-1.383-0.469-1.852c-0.188-0.969-0.289-1.961-0.305-2.977l-0.047-3.211c-0.03-2.203-0.41-3.672-1.142-4.406c-0.732-0.734-2.103-1.102-4.113-1.102h-7.05v13.547h-7.055V14.022h16.524c2.361,0.047,4.178,0.344,5.45,0.891c1.272,0.547,2.351,1.352,3.234,2.414c0.731,0.875,1.31,1.844,1.737,2.906s0.64,2.273,0.64,3.633c0,1.641-0.414,3.254-1.242,4.84s-2.195,2.707-4.102,3.363c1.594,0.641,2.723,1.551,3.387,2.73s0.996,2.98,0.996,5.402v2.32c0,1.578,0.063,2.648,0.19,3.211c0.19,0.891,0.635,1.547,1.333,1.969V48.569z M75.579,48.569h-26.18V14.022h25.336v6.117H56.454v7.336h16.781v6H56.454v8.883h19.125V48.569z M104.497,46.331c-2.44,2.086-5.887,3.129-10.34,3.129c-4.548,0-8.125-1.027-10.731-3.082s-3.909-4.879-3.909-8.473h6.891c0.224,1.578,0.662,2.758,1.316,3.539c1.196,1.422,3.246,2.133,6.15,2.133c1.739,0,3.151-0.188,4.236-0.562c2.058-0.719,3.087-2.055,3.087-4.008c0-1.141-0.504-2.023-1.512-2.648c-1.008-0.609-2.607-1.148-4.796-1.617l-3.74-0.82c-3.676-0.812-6.201-1.695-7.576-2.648c-2.328-1.594-3.492-4.086-3.492-7.477c0-3.094,1.139-5.664,3.417-7.711s5.623-3.07,10.036-3.07c3.685,0,6.829,0.965,9.431,2.895c2.602,1.93,3.966,4.73,4.093,8.402h-6.938c-0.128-2.078-1.057-3.555-2.787-4.43c-1.154-0.578-2.587-0.867-4.301-0.867c-1.907,0-3.428,0.375-4.565,1.125c-1.138,0.75-1.706,1.797-1.706,3.141c0,1.234,0.561,2.156,1.682,2.766c0.721,0.406,2.25,0.883,4.589,1.43l6.063,1.43c2.657,0.625,4.648,1.461,5.975,2.508c2.059,1.625,3.089,3.977,3.089,7.055C108.157,41.624,106.937,44.245,104.497,46.331z M139.61,48.569h-26.18V14.022h25.336v6.117h-18.281v7.336h16.781v6h-16.781v8.883h19.125V48.569z M170.337,20.14h-10.336v28.43h-7.266V20.14h-10.383v-6.117h27.984V20.14z"),s.setAttribute("class","svg-pan-zoom-control-element"),n.appendChild(s),n},_createZoomOut:function(e){var n=document.createElementNS(t.svgNS,"g");n.setAttribute("id","svg-pan-zoom-zoom-out"),n.setAttribute("transform","translate(30.5 70) scale(0.015)"),n.setAttribute("class","svg-pan-zoom-control"),n.addEventListener("click",function(){e.getPublicInstance().zoomOut()},!1),n.addEventListener("touchstart",function(){e.getPublicInstance().zoomOut()},!1);var i=document.createElementNS(t.svgNS,"rect");i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("width","1500"),i.setAttribute("height","1400"),i.setAttribute("class","svg-pan-zoom-control-background"),n.appendChild(i);var r=document.createElementNS(t.svgNS,"path");return r.setAttribute("d","M1280 576v128q0 26 -19 45t-45 19h-896q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h896q26 0 45 19t19 45zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z"),r.setAttribute("class","svg-pan-zoom-control-element"),n.appendChild(r),n},disable:function(e){e.controlIcons&&(e.controlIcons.parentNode.removeChild(e.controlIcons),e.controlIcons=null)}},ce}var ue,on;function Ks(){if(on)return ue;on=1;var t=Ae(),e=Ne(),n=function(i,r){this.init(i,r)};return n.prototype.init=function(i,r){this.viewport=i,this.options=r,this.originalState={zoom:1,x:0,y:0},this.activeState={zoom:1,x:0,y:0},this.updateCTMCached=e.proxy(this.updateCTM,this),this.requestAnimationFrame=e.createRequestAnimationFrame(this.options.refreshRate),this.viewBox={x:0,y:0,width:0,height:0},this.cacheViewBox();var s=this.processCTM();this.setCTM(s),this.updateCTM()},n.prototype.cacheViewBox=function(){var i=this.options.svg.getAttribute("viewBox");if(i){var r=i.split(/[\s\,]/).filter(function(a){return a}).map(parseFloat);this.viewBox.x=r[0],this.viewBox.y=r[1],this.viewBox.width=r[2],this.viewBox.height=r[3];var s=Math.min(this.options.width/this.viewBox.width,this.options.height/this.viewBox.height);this.activeState.zoom=s,this.activeState.x=(this.options.width-this.viewBox.width*s)/2,this.activeState.y=(this.options.height-this.viewBox.height*s)/2,this.updateCTMOnNextFrame(),this.options.svg.removeAttribute("viewBox")}else this.simpleViewBoxCache()},n.prototype.simpleViewBoxCache=function(){var i=this.viewport.getBBox();this.viewBox.x=i.x,this.viewBox.y=i.y,this.viewBox.width=i.width,this.viewBox.height=i.height},n.prototype.getViewBox=function(){return e.extend({},this.viewBox)},n.prototype.processCTM=function(){var i=this.getCTM();if(this.options.fit||this.options.contain){var r;this.options.fit?r=Math.min(this.options.width/this.viewBox.width,this.options.height/this.viewBox.height):r=Math.max(this.options.width/this.viewBox.width,this.options.height/this.viewBox.height),i.a=r,i.d=r,i.e=-this.viewBox.x*r,i.f=-this.viewBox.y*r}if(this.options.center){var s=(this.options.width-(this.viewBox.width+this.viewBox.x*2)*i.a)*.5,a=(this.options.height-(this.viewBox.height+this.viewBox.y*2)*i.a)*.5;i.e=s,i.f=a}return this.originalState.zoom=i.a,this.originalState.x=i.e,this.originalState.y=i.f,i},n.prototype.getOriginalState=function(){return e.extend({},this.originalState)},n.prototype.getState=function(){return e.extend({},this.activeState)},n.prototype.getZoom=function(){return this.activeState.zoom},n.prototype.getRelativeZoom=function(){return this.activeState.zoom/this.originalState.zoom},n.prototype.computeRelativeZoom=function(i){return i/this.originalState.zoom},n.prototype.getPan=function(){return{x:this.activeState.x,y:this.activeState.y}},n.prototype.getCTM=function(){var i=this.options.svg.createSVGMatrix();return i.a=this.activeState.zoom,i.b=0,i.c=0,i.d=this.activeState.zoom,i.e=this.activeState.x,i.f=this.activeState.y,i},n.prototype.setCTM=function(i){var r=this.isZoomDifferent(i),s=this.isPanDifferent(i);if(r||s){if(r&&(this.options.beforeZoom(this.getRelativeZoom(),this.computeRelativeZoom(i.a))===!1?(i.a=i.d=this.activeState.zoom,r=!1):(this.updateCache(i),this.options.onZoom(this.getRelativeZoom()))),s){var a=this.options.beforePan(this.getPan(),{x:i.e,y:i.f}),c=!1,u=!1;a===!1?(i.e=this.getPan().x,i.f=this.getPan().y,c=u=!0):e.isObject(a)&&(a.x===!1?(i.e=this.getPan().x,c=!0):e.isNumber(a.x)&&(i.e=a.x),a.y===!1?(i.f=this.getPan().y,u=!0):e.isNumber(a.y)&&(i.f=a.y)),c&&u||!this.isPanDifferent(i)?s=!1:(this.updateCache(i),this.options.onPan(this.getPan()))}(r||s)&&this.updateCTMOnNextFrame()}},n.prototype.isZoomDifferent=function(i){return this.activeState.zoom!==i.a},n.prototype.isPanDifferent=function(i){return this.activeState.x!==i.e||this.activeState.y!==i.f},n.prototype.updateCache=function(i){this.activeState.zoom=i.a,this.activeState.x=i.e,this.activeState.y=i.f},n.prototype.pendingUpdate=!1,n.prototype.updateCTMOnNextFrame=function(){this.pendingUpdate||(this.pendingUpdate=!0,this.requestAnimationFrame.call(window,this.updateCTMCached))},n.prototype.updateCTM=function(){var i=this.getCTM();t.setCTM(this.viewport,i,this.defs),this.pendingUpdate=!1,this.options.onUpdatedCTM&&this.options.onUpdatedCTM(i)},ue=function(i,r){return new n(i,r)},ue}var he,sn;function Qs(){if(sn)return he;sn=1;var t=Ys(),e=Gs(),n=Ne(),i=Ae(),r=Ks(),s=function(o,h){this.init(o,h)},a={viewportSelector:".svg-pan-zoom_viewport",panEnabled:!0,controlIconsEnabled:!1,zoomEnabled:!0,dblClickZoomEnabled:!0,mouseWheelZoomEnabled:!0,preventMouseEventsDefault:!0,zoomScaleSensitivity:.1,minZoom:.5,maxZoom:10,fit:!0,contain:!1,center:!0,refreshRate:"auto",beforeZoom:null,onZoom:null,beforePan:null,onPan:null,customEventsHandler:null,eventsListenerElement:null,onUpdatedCTM:null},c={passive:!0};s.prototype.init=function(o,h){var f=this;this.svg=o,this.defs=o.querySelector("defs"),i.setupSvgAttributes(this.svg),this.options=n.extend(n.extend({},a),h),this.state="none";var p=i.getBoundingClientRectNormalized(o);this.width=p.width,this.height=p.height,this.viewport=r(i.getOrCreateViewport(this.svg,this.options.viewportSelector),{svg:this.svg,width:this.width,height:this.height,fit:this.options.fit,contain:this.options.contain,center:this.options.center,refreshRate:this.options.refreshRate,beforeZoom:function(g,d){if(f.viewport&&f.options.beforeZoom)return f.options.beforeZoom(g,d)},onZoom:function(g){if(f.viewport&&f.options.onZoom)return f.options.onZoom(g)},beforePan:function(g,d){if(f.viewport&&f.options.beforePan)return f.options.beforePan(g,d)},onPan:function(g){if(f.viewport&&f.options.onPan)return f.options.onPan(g)},onUpdatedCTM:function(g){if(f.viewport&&f.options.onUpdatedCTM)return f.options.onUpdatedCTM(g)}});var m=this.getPublicInstance();m.setBeforeZoom(this.options.beforeZoom),m.setOnZoom(this.options.onZoom),m.setBeforePan(this.options.beforePan),m.setOnPan(this.options.onPan),m.setOnUpdatedCTM(this.options.onUpdatedCTM),this.options.controlIconsEnabled&&e.enable(this),this.lastMouseWheelEventTime=Date.now(),this.setupHandlers()},s.prototype.setupHandlers=function(){var o=this,h=null;if(this.eventListeners={mousedown:function(g){var d=o.handleMouseDown(g,h);return h=g,d},touchstart:function(g){var d=o.handleMouseDown(g,h);return h=g,d},mouseup:function(g){return o.handleMouseUp(g)},touchend:function(g){return o.handleMouseUp(g)},mousemove:function(g){return o.handleMouseMove(g)},touchmove:function(g){return o.handleMouseMove(g)},mouseleave:function(g){return o.handleMouseUp(g)},touchleave:function(g){return o.handleMouseUp(g)},touchcancel:function(g){return o.handleMouseUp(g)}},this.options.customEventsHandler!=null){this.options.customEventsHandler.init({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()});var f=this.options.customEventsHandler.haltEventListeners;if(f&&f.length)for(var p=f.length-1;p>=0;p--)this.eventListeners.hasOwnProperty(f[p])&&delete this.eventListeners[f[p]]}for(var m in this.eventListeners)(this.options.eventsListenerElement||this.svg).addEventListener(m,this.eventListeners[m],this.options.preventMouseEventsDefault?!1:c);this.options.mouseWheelZoomEnabled&&(this.options.mouseWheelZoomEnabled=!1,this.enableMouseWheelZoom())},s.prototype.enableMouseWheelZoom=function(){if(!this.options.mouseWheelZoomEnabled){var o=this;this.wheelListener=function(f){return o.handleMouseWheel(f)};var h=!this.options.preventMouseEventsDefault;t.on(this.options.eventsListenerElement||this.svg,this.wheelListener,h),this.options.mouseWheelZoomEnabled=!0}},s.prototype.disableMouseWheelZoom=function(){if(this.options.mouseWheelZoomEnabled){var o=!this.options.preventMouseEventsDefault;t.off(this.options.eventsListenerElement||this.svg,this.wheelListener,o),this.options.mouseWheelZoomEnabled=!1}},s.prototype.handleMouseWheel=function(o){if(!(!this.options.zoomEnabled||this.state!=="none")){this.options.preventMouseEventsDefault&&(o.preventDefault?o.preventDefault():o.returnValue=!1);var h=o.deltaY||1,f=Date.now()-this.lastMouseWheelEventTime,p=3+Math.max(0,30-f);this.lastMouseWheelEventTime=Date.now(),"deltaMode"in o&&o.deltaMode===0&&o.wheelDelta&&(h=o.deltaY===0?0:Math.abs(o.wheelDelta)/o.deltaY),h=-.3<h&&h<.3?h:(h>0?1:-1)*Math.log(Math.abs(h)+10)/p;var m=this.svg.getScreenCTM().inverse(),g=i.getEventPoint(o,this.svg).matrixTransform(m),d=Math.pow(1+this.options.zoomScaleSensitivity,-1*h);this.zoomAtPoint(d,g)}},s.prototype.zoomAtPoint=function(o,h,f){var p=this.viewport.getOriginalState();f?(o=Math.max(this.options.minZoom*p.zoom,Math.min(this.options.maxZoom*p.zoom,o)),o=o/this.getZoom()):this.getZoom()*o<this.options.minZoom*p.zoom?o=this.options.minZoom*p.zoom/this.getZoom():this.getZoom()*o>this.options.maxZoom*p.zoom&&(o=this.options.maxZoom*p.zoom/this.getZoom());var m=this.viewport.getCTM(),g=h.matrixTransform(m.inverse()),d=this.svg.createSVGMatrix().translate(g.x,g.y).scale(o).translate(-g.x,-g.y),v=m.multiply(d);v.a!==m.a&&this.viewport.setCTM(v)},s.prototype.zoom=function(o,h){this.zoomAtPoint(o,i.getSvgCenterPoint(this.svg,this.width,this.height),h)},s.prototype.publicZoom=function(o,h){h&&(o=this.computeFromRelativeZoom(o)),this.zoom(o,h)},s.prototype.publicZoomAtPoint=function(o,h,f){if(f&&(o=this.computeFromRelativeZoom(o)),n.getType(h)!=="SVGPoint")if("x"in h&&"y"in h)h=i.createSVGPoint(this.svg,h.x,h.y);else throw new Error("Given point is invalid");this.zoomAtPoint(o,h,f)},s.prototype.getZoom=function(){return this.viewport.getZoom()},s.prototype.getRelativeZoom=function(){return this.viewport.getRelativeZoom()},s.prototype.computeFromRelativeZoom=function(o){return o*this.viewport.getOriginalState().zoom},s.prototype.resetZoom=function(){var o=this.viewport.getOriginalState();this.zoom(o.zoom,!0)},s.prototype.resetPan=function(){this.pan(this.viewport.getOriginalState())},s.prototype.reset=function(){this.resetZoom(),this.resetPan()},s.prototype.handleDblClick=function(o){if(this.options.preventMouseEventsDefault&&(o.preventDefault?o.preventDefault():o.returnValue=!1),this.options.controlIconsEnabled){var h=o.target.getAttribute("class")||"";if(h.indexOf("svg-pan-zoom-control")>-1)return!1}var f;o.shiftKey?f=1/((1+this.options.zoomScaleSensitivity)*2):f=(1+this.options.zoomScaleSensitivity)*2;var p=i.getEventPoint(o,this.svg).matrixTransform(this.svg.getScreenCTM().inverse());this.zoomAtPoint(f,p)},s.prototype.handleMouseDown=function(o,h){this.options.preventMouseEventsDefault&&(o.preventDefault?o.preventDefault():o.returnValue=!1),n.mouseAndTouchNormalize(o,this.svg),this.options.dblClickZoomEnabled&&n.isDblClick(o,h)?this.handleDblClick(o):(this.state="pan",this.firstEventCTM=this.viewport.getCTM(),this.stateOrigin=i.getEventPoint(o,this.svg).matrixTransform(this.firstEventCTM.inverse()))},s.prototype.handleMouseMove=function(o){if(this.options.preventMouseEventsDefault&&(o.preventDefault?o.preventDefault():o.returnValue=!1),this.state==="pan"&&this.options.panEnabled){var h=i.getEventPoint(o,this.svg).matrixTransform(this.firstEventCTM.inverse()),f=this.firstEventCTM.translate(h.x-this.stateOrigin.x,h.y-this.stateOrigin.y);this.viewport.setCTM(f)}},s.prototype.handleMouseUp=function(o){this.options.preventMouseEventsDefault&&(o.preventDefault?o.preventDefault():o.returnValue=!1),this.state==="pan"&&(this.state="none")},s.prototype.fit=function(){var o=this.viewport.getViewBox(),h=Math.min(this.width/o.width,this.height/o.height);this.zoom(h,!0)},s.prototype.contain=function(){var o=this.viewport.getViewBox(),h=Math.max(this.width/o.width,this.height/o.height);this.zoom(h,!0)},s.prototype.center=function(){var o=this.viewport.getViewBox(),h=(this.width-(o.width+o.x*2)*this.getZoom())*.5,f=(this.height-(o.height+o.y*2)*this.getZoom())*.5;this.getPublicInstance().pan({x:h,y:f})},s.prototype.updateBBox=function(){this.viewport.simpleViewBoxCache()},s.prototype.pan=function(o){var h=this.viewport.getCTM();h.e=o.x,h.f=o.y,this.viewport.setCTM(h)},s.prototype.panBy=function(o){var h=this.viewport.getCTM();h.e+=o.x,h.f+=o.y,this.viewport.setCTM(h)},s.prototype.getPan=function(){var o=this.viewport.getState();return{x:o.x,y:o.y}},s.prototype.resize=function(){var o=i.getBoundingClientRectNormalized(this.svg);this.width=o.width,this.height=o.height;var h=this.viewport;h.options.width=this.width,h.options.height=this.height,h.processCTM(),this.options.controlIconsEnabled&&(this.getPublicInstance().disableControlIcons(),this.getPublicInstance().enableControlIcons())},s.prototype.destroy=function(){var o=this;this.beforeZoom=null,this.onZoom=null,this.beforePan=null,this.onPan=null,this.onUpdatedCTM=null,this.options.customEventsHandler!=null&&this.options.customEventsHandler.destroy({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()});for(var h in this.eventListeners)(this.options.eventsListenerElement||this.svg).removeEventListener(h,this.eventListeners[h],this.options.preventMouseEventsDefault?!1:c);this.disableMouseWheelZoom(),this.getPublicInstance().disableControlIcons(),this.reset(),u=u.filter(function(f){return f.svg!==o.svg}),delete this.options,delete this.viewport,delete this.publicInstance,delete this.pi,this.getPublicInstance=function(){return null}},s.prototype.getPublicInstance=function(){var o=this;return this.publicInstance||(this.publicInstance=this.pi={enablePan:function(){return o.options.panEnabled=!0,o.pi},disablePan:function(){return o.options.panEnabled=!1,o.pi},isPanEnabled:function(){return!!o.options.panEnabled},pan:function(h){return o.pan(h),o.pi},panBy:function(h){return o.panBy(h),o.pi},getPan:function(){return o.getPan()},setBeforePan:function(h){return o.options.beforePan=h===null?null:n.proxy(h,o.publicInstance),o.pi},setOnPan:function(h){return o.options.onPan=h===null?null:n.proxy(h,o.publicInstance),o.pi},enableZoom:function(){return o.options.zoomEnabled=!0,o.pi},disableZoom:function(){return o.options.zoomEnabled=!1,o.pi},isZoomEnabled:function(){return!!o.options.zoomEnabled},enableControlIcons:function(){return o.options.controlIconsEnabled||(o.options.controlIconsEnabled=!0,e.enable(o)),o.pi},disableControlIcons:function(){return o.options.controlIconsEnabled&&(o.options.controlIconsEnabled=!1,e.disable(o)),o.pi},isControlIconsEnabled:function(){return!!o.options.controlIconsEnabled},enableDblClickZoom:function(){return o.options.dblClickZoomEnabled=!0,o.pi},disableDblClickZoom:function(){return o.options.dblClickZoomEnabled=!1,o.pi},isDblClickZoomEnabled:function(){return!!o.options.dblClickZoomEnabled},enableMouseWheelZoom:function(){return o.enableMouseWheelZoom(),o.pi},disableMouseWheelZoom:function(){return o.disableMouseWheelZoom(),o.pi},isMouseWheelZoomEnabled:function(){return!!o.options.mouseWheelZoomEnabled},setZoomScaleSensitivity:function(h){return o.options.zoomScaleSensitivity=h,o.pi},setMinZoom:function(h){return o.options.minZoom=h,o.pi},setMaxZoom:function(h){return o.options.maxZoom=h,o.pi},setBeforeZoom:function(h){return o.options.beforeZoom=h===null?null:n.proxy(h,o.publicInstance),o.pi},setOnZoom:function(h){return o.options.onZoom=h===null?null:n.proxy(h,o.publicInstance),o.pi},zoom:function(h){return o.publicZoom(h,!0),o.pi},zoomBy:function(h){return o.publicZoom(h,!1),o.pi},zoomAtPoint:function(h,f){return o.publicZoomAtPoint(h,f,!0),o.pi},zoomAtPointBy:function(h,f){return o.publicZoomAtPoint(h,f,!1),o.pi},zoomIn:function(){return this.zoomBy(1+o.options.zoomScaleSensitivity),o.pi},zoomOut:function(){return this.zoomBy(1/(1+o.options.zoomScaleSensitivity)),o.pi},getZoom:function(){return o.getRelativeZoom()},setOnUpdatedCTM:function(h){return o.options.onUpdatedCTM=h===null?null:n.proxy(h,o.publicInstance),o.pi},resetZoom:function(){return o.resetZoom(),o.pi},resetPan:function(){return o.resetPan(),o.pi},reset:function(){return o.reset(),o.pi},fit:function(){return o.fit(),o.pi},contain:function(){return o.contain(),o.pi},center:function(){return o.center(),o.pi},updateBBox:function(){return o.updateBBox(),o.pi},resize:function(){return o.resize(),o.pi},getSizes:function(){return{width:o.width,height:o.height,realZoom:o.getZoom(),viewBox:o.viewport.getViewBox()}},destroy:function(){return o.destroy(),o.pi}}),this.publicInstance};var u=[],l=function(o,h){var f=n.getSvg(o);if(f===null)return null;for(var p=u.length-1;p>=0;p--)if(u[p].svg===f)return u[p].instance.getPublicInstance();return u.push({svg:f,instance:new s(f,h)}),u[u.length-1].instance.getPublicInstance()};return he=l,he}var Js=Qs();const js=Ws(Js),Zn={"has part":"blue","part of":"blue",contains:"green","has role":"darkgreen","is about":"darkgrey","has participant":"darkblue"},Yt=11,Rt=14,ta=120,an=12,ea=40,na=40;function ia(t,e,n){const i=e.split(/\s+/),r=[];let s="";const a=t.append("text").style("font-size",`${Yt}px`).style("visibility","hidden");for(const c of i){const u=s?`${s} ${c}`:c;a.text(u),a.node().getComputedTextLength()>n&&s?(r.push(s),s=c):s=u}return s&&r.push(s),a.remove(),r}function ra(t,e){const n=t.append("text").style("font-size",`${Yt}px`).style("visibility","hidden").text(e),i=n.node().getComputedTextLength();return n.remove(),i}function oa(t,e){const n=new Map;for(const i of e){const r=[i];for(;r.length>0;){const s=r.pop(),a=s.label||s.id,c=ia(t,a,ta),u=Math.max(...c.map(h=>ra(t,h))),l=Math.max(80,u+an*2),o=Math.max(24,c.length*Rt+an);n.set(s.id,{width:l,height:o,lines:c}),r.push(...s.children)}}return n}function sa(t,e){let n=0,i=0;e.forEach(c=>{n=Math.max(n,c.width),i=Math.max(i,c.height)});let r=20;const s=new Map,a=[];for(const c of t){const u=Me(c);Os().nodeSize([n+ea,i+na]).separation((g,d)=>g.parent===d.parent?1:1.2)(u);let o=1/0,h=-1/0;u.each(g=>{o=Math.min(o,g.x),h=Math.max(h,g.x)});const f=h-o+n+20,p=r-o+n/2,m=50;a.push({root:u,offsetX:p,offsetY:m,treeWidth:f}),u.each(g=>{s.set(g.data.id,{x:g.x+p,y:g.y+m})}),r+=f+40}return{treeLayouts:a,nodePositions:s,maxNodeWidth:n,maxNodeHeight:i}}function aa(t,e){t.append("marker").attr("id","arrow-hierarchy").attr("viewBox","0 -5 10 10").attr("refX",0).attr("refY",0).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5").attr("fill","#999");const n=new Set;for(const i of e){const r=i.label??i.type??"",s=Zn[r]??i.color??"orange";n.add(s)}n.forEach(i=>{const r=i.replace(/[^a-zA-Z0-9]/g,"_");t.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 -5 10 10").attr("refX",8).attr("refY",0).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5").attr("fill",i)})}function la(t,e,n,i){for(const{root:r,offsetX:s,offsetY:a}of e)t.append("g").attr("class","tree-edges").attr("transform",`translate(${s}, ${a})`).selectAll(".link").data(r.links()).enter().append("path").attr("class","link").attr("data-source",u=>u.source.data.id).attr("data-target",u=>u.target.data.id).attr("d",u=>{const l=u.source,o=u.target,h=n.get(o.data.id),f=h?h.height/2:12,p=o.y-f-8,m=n.get(l.data.id),g=m?m.height/2:12,d=l.y+g;return`M${l.x},${d}C${l.x},${(d+p)/2} ${o.x},${(d+p)/2} ${o.x},${p}`}).attr("marker-end","url(#arrow-hierarchy)").on("mouseenter",function(u,l){i(l.source.data.id,l.target.data.id,this,"enter")}).on("mouseleave",function(u,l){i(l.source.data.id,l.target.data.id,this,"leave")}).on("click",function(u,l){i(l.source.data.id,l.target.data.id,this,"click")}).each(function(u){R(this).append("title").text("subclass of")})}function ca(t,e,n,i,r,s){for(const a of e){const c=n.get(a.source),u=n.get(a.target);if(!c||!u)continue;const l=a.label||a.type||"",o=Zn[l]||a.color||"orange",h=o.replace(/[^a-zA-Z0-9]/g,"_"),f=i.get(a.source),p=i.get(a.target),m=f?f.width/2:40,g=p?p.width/2:40,d=f?f.height/2:12,v=p?p.height/2:12,x=u.x-c.x,_=u.y-c.y,S=Math.sqrt(x*x+_*_);if(S===0)continue;const $=Math.atan2(_,x),M=Math.abs(Math.cos($))>Math.abs(Math.sin($));let I,T;M?(I=c.x+(x>0?m:-m),T=c.y+_/S*d*.5):(I=c.x+x/S*m*.5,T=c.y+(_>0?d:-d));let V,F;M?(V=u.x+(x>0?-g:g),F=u.y-_/S*v*.5):(V=u.x-x/S*g*.5,F=u.y+(_>0?-v:v));const Nt=(I+V)/2,st=(T+F)/2,ht=Math.min(30,S*.2),Q=S>0?-_/S*ht:0,At=S>0?x/S*ht:0,b=`M${I},${T} Q${Nt+Q},${st+At} ${V},${F}`,w=a.source,C=a.target;t.append("path").attr("class","relation-link").attr("data-source",w).attr("data-target",C).attr("d",b).style("fill","none").style("stroke",o).style("stroke-width","1.5px").style("stroke-dasharray","4,2").style("stroke-opacity",.8).attr("marker-end",`url(#arrow-${h})`).on("mouseenter",function(){s(w,C,this,"enter")}).on("mouseleave",function(){s(w,C,this,"leave")}).on("click",function(){s(w,C,this,"click")}).append("title").text(`'${r[a.source]}' ${l} '${r[a.target]}'`||"relation"),l&&t.append("text").attr("class","relation-edge-label").attr("data-source",w).attr("data-target",C).attr("x",Nt+Q).attr("y",st+At-4).attr("text-anchor","middle").style("font-size","9px").style("fill",o).style("font-style","italic").style("cursor","pointer").text(l).on("mouseenter",function(){s(w,C,this,"enter")}).on("mouseleave",function(){s(w,C,this,"leave")}).on("click",function(){s(w,C,this,"click")})}}function ua(t){const e=(t.data.ose_curation??Ot.EXTERNAL).toLowerCase().replace(/\s+/g,"_");return["node",`ose-source-${t.data.ose_source}`,`ose-curation-status-${e}`,...t.data.ose_selected?["ose-selected"]:[]]}function ha(t,e,n,i,r){for(const{root:s,offsetX:a,offsetY:c}of e){const l=t.append("g").attr("class","tree-nodes").attr("transform",`translate(${a}, ${c})`).selectAll(".node").data(s.descendants()).enter().append("g").attr("class",o=>ua(o).join(" ")).attr("data-node-id",o=>o.data.id).attr("transform",o=>`translate(${o.x},${o.y})`).on("mouseenter",function(o,h){i(h.data.id,this,"enter")}).on("mouseleave",function(o,h){i(h.data.id,this,"leave")}).on("dblclick",function(o,h){r(h.data)});l.append("rect").attr("x",o=>{const h=n.get(o.data.id);return h?-h.width/2:-40}).attr("y",o=>{const h=n.get(o.data.id);return h?-h.height/2:-12}).attr("width",o=>{const h=n.get(o.data.id);return h?h.width:80}).attr("height",o=>{const h=n.get(o.data.id);return h?h.height:24}).attr("rx",4).attr("ry",4).style("fill","#fff").style("stroke","#999").style("stroke-width","1px"),l.each(function(o){const h=n.get(o.data.id);if(!h)return;const f=R(this).append("text").attr("text-anchor","middle").style("font-size",`${Yt}px`).style("fill","#333"),p=h.lines,g=-(p.length*Rt)/2+Rt/2;p.forEach((d,v)=>{f.append("tspan").attr("x",0).attr("dy",v===0?`${g+Yt*.35}px`:`${Rt}px`).text(d)}),f.append("title").text(`${o.data.label}
2
+ ${o.data.id}`)})}}function fa(t,e){const n=js(t,{zoomEnabled:!0,controlIconsEnabled:!0,dblClickZoomEnabled:!1,contain:!0,center:!0,zoomScaleSensitivity:.3,minZoom:.01,maxZoom:100});return e&&(n.zoom(e.zoom),n.pan(e.pan)),n}function da(t,e,n,i,r){const s=new Jn,a=e.filter(d=>d.startsWith("REL "));console.debug("Relation columns found:",a);const c=t.map((d,v)=>{const x=d.ID.trim(),_=d.Label.trim(),S=Object.entries(d).find(([I,T])=>I.toLowerCase().includes("curation status"))?.[1]?.trim()||Ot.PRE_PROPOSED,$=[{label:d.Parent.trim(),id:void 0}],M=[];for(const I of a){const T=d[I];if(T&&typeof T=="string"){const V=T.split(";").map(F=>F.trim()).filter(Boolean);for(const F of V)M.push({relation:{label:I.replace(/REL '([^']+)'.*/,"$1")},target:{label:F}})}}return{id:x,label:_,curationStatus:S,origin:n,subClassOf:$,relations:M,index:v}}).filter(d=>d.id),u=new Map;for(const d of c)u.set(d.label,{...d,source:"current"});for(const d of i.dependencies)u.has(d.label)||u.set(d.label,{...d,source:"dependencies"});for(const d of i.derived)u.has(d.label)||u.set(d.label,{...d,source:"derived"});for(const d of c)for(const v of d.subClassOf){const x=u.get(v.label);x?v.id=x.id:v.id===void 0&&console.warn(`Parent term with label "${v.label}" not found for term "${d.label} [${d.id}]"`)}const l=new Map;for(const d of u.values()){const v=d.subClassOf.filter(x=>x.id===void 0);v.length>0&&console.warn(`Term "${d.label} [${d.id}]" has unresolved parents:`,v),d.subClassOf=d.subClassOf.filter(x=>x.id!==void 0),l.set(d.id,d)}for(const[d,v]of l){const x=d.replace(":","_"),_=v.origin||"<unknown>",S=v.curationStatus||"External",$={id:x,label:v.label,class:`ose-curation-status-${S.toLowerCase().replace(/\s+/g,"_")}`,curationStatus:S,origin:_,source:v.source,isSelected:r?.includes(v.index)===!0,visualDepth:-1/0};s.addNode($)}for(const[d,v]of l){const x=d.replace(":","_");for(const _ of v.subClassOf){const S=_.id.replace(":","_");l.has(_.id)||console.warn(`Parent term with label "${_.label}" not found for term "${v.label} [${v.id}]"`),s.addEdge({source:S,target:x,type:"subclass_of"})}}for(const[d,v]of l){const x=d.replace(":","_");for(const _ of v.relations){const S=u.get(_.target.label);if(!S){console.warn(`Relation target term with label "${_.target.label}" not found for term "${v.label} [${v.id}]"`);continue}const $=S.id.replace(":","_"),M=pa(_.relation.label);s.addEdge({source:x,target:$,type:_.relation.label,label:_.relation.label,color:M})}}console.debug(`Built graph with ${s.nodes.length} nodes and ${s.edges.length} edges from ${c.length} current terms, ${i.dependencies.length} dependencies, and ${i.derived.length} derived terms.`,{edges:s.edges,nodes:s.nodes,allTerms:l});const o=new Set(Array.from(l.entries()).filter(([d,v])=>v.source==="current").map(([d,v])=>d.replace(":","_"))),h=new Set(Array.from(l.entries()).filter(([d,v])=>v.source==="derived").map(([d,v])=>d.replace(":","_"))),f=new Set(Array.from(l.entries()).filter(([d,v])=>v.source==="dependencies").map(([d,v])=>d.replace(":","_")));function p(d){if(o.has(d))return!0;const v=s.successors(d);for(const x of v)if(p(x.id))return!0;return!1}function m(d){if(o.has(d))return!0;const v=s.predecessors(d);for(const x of v)if(m(x.id))return!0;return!1}function g(d){return o.has(d)?!0:h.has(d)?m(d):f.has(d)?p(d):!1}for(const d of s.nodes)g(d.id)||s.removeNode(d.id);if(ga(s),console.log({graph:s.clone()}),r&&r.length>0){const d=new Set(s.nodes.filter(v=>v.isSelected).map(v=>v.id));ma(s,d);for(const v of s.nodes)d.has(v.id)||s.removeNode(v.id)}return s}function pa(t){return(t?{"has part":"blue","part of":"blue",contains:"green","has role":"darkgreen","is about":"darkgrey","has participant":"darkblue"}[t]:null)??"orange"}function ga(t){const e=new Map;function n(i){if(e.has(i.id))return e.get(i.id);if(!i)return console.error("Node not found for ID:",i),-1/0;const r=t.predecessors(i),s=t.successors(i),a=i.source!=="dependencies";let c;if(!a&&s.find(u=>u.source!=="dependencies"))c=0;else{const u=r.reduce((l,o)=>Math.max(l,n(o)),-1);a?c=u+1:c=u}return e.set(i.id,c),c}for(const i of t.nodes)i.visualDepth=n(i)}function ma(t,e){const n=(i,r)=>{if(e.has(i.id))return!0;const a=(r==="up"?t.predecessors.bind(t):t.successors.bind(t))(i.id).reduce((c,u)=>n(u,r)||c,!1);return a&&e.add(i.id),a};for(const i of t.leaves)n(i,"up");for(const i of t.roots)n(i,"down")}const va={class:"visualise-container"},wa={class:"header"},ya={class:"header-title-row"},xa={class:"title-with-help"},_a={class:"mb-0"},ba={class:"text-muted"},Sa={class:"search-bar"},Ca={class:"search-info text-muted"},Ea={class:"input-group input-group-sm"},Ma=["disabled"],Na=["disabled"],Aa=["disabled"],ka=["disabled"],za=["disabled"],Pa={class:"filters-card"},$a={class:"filter-section"},Ta={class:"filter-controls"},Za={class:"form-check form-switch"},Ia=["disabled"],La={class:"form-check form-switch"},Da=["disabled"],Ba={class:"filter-section"},Ra={class:"filter-controls"},Oa={class:"range-control"},qa={class:"range-header"},Va={for:"range_num_child_levels",class:"form-label"},Fa={class:"range-minmax"},Ha=["max","disabled"],Xa={class:"filter-section"},Ua={class:"filter-controls"},Wa={class:"dropdown"},Ya=["disabled"],Ga={class:"dropdown-menu dropdown-menu-end"},Ka=["onClick"],Qa={key:0,class:"loading-overlay"},Ja={key:1,class:"error-overlay"},ja={class:"error-message"},tl={key:2,class:"empty-state-overlay"},el={class:"modal fade",id:"legendModal",tabindex:"-1","aria-labelledby":"legendModalLabel","aria-hidden":"true"},nl={class:"modal-dialog modal-lg"},il={class:"modal-content"},rl={class:"modal-body"},ol={class:"legend-grid"},sl={class:"legend-item full-width"},al={class:"status-grid"},ll=Vn({__name:"Visualise",setup(t){const e=URLS.prefix,n=D(window.ose?.visualise??null);window.oseDataChanged=()=>{console.debug("Visualisation data updated in window.ose",window.ose?.visualise),n.value=window.ose?.visualise??null;const b=n.value?.sheetData;console.debug("Sheet data after update:",{hasSheetData:!!b,repo_name:b?.repo_name,folder:b?.folder,spreadsheet_name:b?.spreadsheet_name,rowCount:b?.rows?.length||0,header:b?.header})};const i=Fn("svgContainer"),r=J(()=>n.value?.sheetData??{rows:[],header:[],file_sha:"",repo_name:"",folder:"",spreadsheet_name:""}),s=J(()=>`${r.value.folder}/${r.value.spreadsheet_name}`),a=D(!1),c=D(null),u=J(()=>Object.values(Ot)),l=D(null),o=J(()=>l.value?.nodes.reduce((b,w)=>({[w.id]:w.label,...b}),{})??{}),h=D(Object.values(Ot)),f=D(!0),p=D(!0),m=D(null),g=J(()=>l.value?Math.max(...l.value.nodes.map(b=>b.visualDepth??0),1):1);let d=null;const v=D(""),x=D([]),_=D(-1),S=J(()=>x.value.length>0),$=J(()=>v.value.trim()?x.value.length===0?"No matches":`${_.value+1} / ${x.value.length}`:""),M=J(()=>!l.value||a.value);function I(){const b=Fs(v.value,o.value);x.value=b,b.length>0?(_.value=0,T(),setTimeout(()=>V(),50)):_.value=-1}function T(){if(_.value>=0&&_.value<x.value.length){const b=x.value[_.value];Hs(b)}}function V(){if(!d||_.value<0||!i.value)return;const b=x.value[_.value];Us(b,i.value,d)}function F(){x.value.length!==0&&(_.value=(_.value+1)%x.value.length,T(),setTimeout(()=>V(),0))}function Nt(){x.value.length!==0&&(_.value=(_.value-1+x.value.length)%x.value.length,T(),setTimeout(()=>V(),0))}function st(){v.value="",x.value=[],_.value=-1,Xs()}async function ht(){if(!r.value.repo_name||!r.value.spreadsheet_name){console.warn("Cannot fetch graph: missing repo, folder, or spreadsheet name",{repo:r.value.repo_name,folder:r.value.folder,spreadsheet:r.value.spreadsheet_name});return}if(r.value.rows.length===0){console.warn("Cannot fetch graph: no rows in spreadsheet");return}console.debug("Fetching graph dependencies...",{repo:r.value.repo_name,folder:r.value.folder,spreadsheet:r.value.spreadsheet_name,rowCount:r.value.rows.length}),a.value=!0,c.value=null;try{const b=await fetch(`${e}/api/visualise/dependencies/${r.value.repo_name}/${r.value.folder}/${r.value.spreadsheet_name}`);if(!b.ok)throw new Error(`Server error: ${b.status} ${b.statusText}`);const w=await b.json();if(!w.success)throw new Error(w.error||"Failed to load dependencies");console.debug("Dependencies loaded successfully",w.data),d?.destroy(),d=null,st();const C=w.data,ft=n.value?.selection&&n.value.selection.length>0?n.value.selection:void 0;l.value=da(r.value.rows,r.value.header,r.value.spreadsheet_name,C,ft),m.value=Math.min(3,g.value),console.debug("Graph built successfully",{nodes:l.value.nodes.length,edges:l.value.edges.length})}catch(b){c.value=b instanceof Error?b.message:"An unexpected error occurred",console.error("Failed to fetch dependencies:",b)}finally{a.value=!1}}function Q(){if(!l.value||!i.value){console.warn("Cannot render graph:",{hasGraph:!!l.value,hasContainer:!!i.value});return}console.debug("Rendering graph...",{nodes:l.value.nodes.length,edges:l.value.edges.length});const b=l.value.clone(),w={curationFilter:h.value,showChildrenFromOtherSheets:f.value,showParentsFromOtherSheets:p.value,numChildLevels:m.value,currentSheet:n?.value?.sheetData?.spreadsheet_name},{nodes:C,hierarchyEdges:ft,relationEdges:Jt}=qs(b,w);console.debug("After filtering:",{nodes:C.length,hierarchyEdges:ft.length,relationEdges:Jt.length});const jt=Vs(C,ft);console.debug("Built trees:",jt.length);let te=null;if(d)try{te={zoom:d.getZoom(),pan:d.getPan()},d.destroy(),d=null}catch{}i.value.querySelector("svg")?.remove();const at=i.value.getBoundingClientRect(),In=at.width||800,Ln=at.height||600,L=R(i.value).append("svg").attr("width","100%").attr("height","100%").attr("viewBox",`0 0 ${In} ${Ln}`),ee=L.append("g").attr("class","graph-container"),kt=oa(L,jt),{treeLayouts:ze,nodePositions:Dn}=sa(jt,kt),Pe=ee.append("g").attr("class","edges-layer"),Bn=ee.append("g").attr("class","nodes-layer"),Rn=L.append("defs");aa(Rn,Jt);let nt=null;function On(E,k,H){H==="enter"?(R(k).classed("node-hovered",!0),L.selectAll(".link, .relation-link").each(function(){const N=R(this),z=N.attr("data-source"),Z=N.attr("data-target");(z===E||Z===E)&&(N.classed("connected",!0),z!==E&&L.select(`.node[data-node-id="${z}"]`).classed("node-connected",!0),Z!==E&&L.select(`.node[data-node-id="${Z}"]`).classed("node-connected",!0))})):H==="leave"&&(R(k).classed("node-hovered",!1),L.selectAll(".link, .relation-link").classed("connected",!1),L.selectAll(".node").classed("node-connected",!1))}function $e(E,k,H,N){function z(dt){L.selectAll(".node").each(function(){const pt=R(this),X=pt.attr("data-node-id");(X===E||X===k)&&pt.classed("edge-connected",dt)})}function Z(dt,pt){L.selectAll(".link, .relation-link").each(function(){const X=R(this);X.attr("data-source")===E&&X.attr("data-target")===k&&X.classed(pt,dt)}),L.selectAll(".relation-edge-label").each(function(){const X=R(this);X.attr("data-source")===E&&X.attr("data-target")===k&&X.classed(pt,dt)})}N==="click"?nt?.sourceId===E&&nt?.targetId===k?(z(!1),Z(!1,"focused"),nt=null):(nt&&(L.selectAll(".node").classed("edge-connected",!1),Z(!1,"focused")),nt={sourceId:E,targetId:k,element:H},z(!0),Z(!0,"focused")):N==="enter"&&!nt?(z(!0),Z(!0,"highlighted")):N==="leave"&&!nt&&(z(!1),Z(!1,"highlighted"))}function qn(E){if(E.ose_curation?.toLowerCase()==="external")return;const k=window.opener,H=r.value.repo_name,N=E.ose_source==="current"?s.value:E.ose_origin,z=E.id;if(!k||!H||!N||!z){console.warn("Cannot navigate to term: missing data",{editorWindow:k,repo:H,originSheet:N,nodeId:z});return}const Z={type:"navigateToTerm",repo:H,sheet:N,termID:z};k.postMessage(Z,"*")}la(Pe,ze,kt,$e),ca(Pe,Jt,Dn,kt,o.value,$e),ha(Bn,ze,kt,On,qn);const Te=i.value?.querySelector("svg");if(Te){d=fa(Te,te);const E=ee.node()?.getBBox();if(E&&d&&!te){const k=at.width/E.width,H=at.height/E.height,N=Math.min(k,H,1);d.zoom(N);const z=(at.width-E.width*N)/2-E.x*N,Z=(at.height-E.height*N)/2-E.y*N;d.pan({x:z,y:Z})}}}function At(b){const w=h.value.indexOf(b);w>=0?h.value.splice(w,1):h.value.push(b),Q()}return Hn(()=>{l.value&&i.value&&Q()}),Xn(()=>{console.debug("watchEffect triggered:",{rowsLength:r.value.rows.length,repo_name:r.value.repo_name,folder:r.value.folder,spreadsheet_name:r.value.spreadsheet_name,allConditionsMet:r.value.rows.length>0&&!!r.value.repo_name&&!!r.value.spreadsheet_name}),r.value.rows.length>0&&r.value.repo_name&&r.value.spreadsheet_name&&ht()}),zt(m,(b,w)=>{b!==w&&b!==null&&w!==null&&Q()}),zt(f,(b,w)=>{b!==w&&Q()}),zt(p,(b,w)=>{b!==w&&Q()}),zt(a,(b,w)=>{b&&w===!1&&(i.value?.querySelector("svg")?.remove(),st())}),Un(async()=>{i.value&&(i.value.style.minHeight=window.innerHeight-i.value.offsetTop-16+"px")}),(b,w)=>(tt(),j("div",va,[y("div",wa,[y("div",ya,[y("div",xa,[y("h5",_a,[w[4]||(w[4]=B(" Hierarchy Tree ",-1)),y("small",ba,Y(n.value?.sheetData?.spreadsheet_name),1)]),w[5]||(w[5]=y("button",{class:"btn btn-sm btn-link text-secondary p-0 ms-2",type:"button","data-bs-toggle":"modal","data-bs-target":"#legendModal",title:"Help & Legend"},[y("i",{class:"fa-solid fa-circle-question"})],-1))]),y("div",Sa,[y("small",Ca,Y($.value),1),y("div",Ea,[Pt(y("input",{type:"text",class:"form-control",placeholder:"Search classes...","onUpdate:modelValue":w[0]||(w[0]=C=>v.value=C),onKeyup:Wn(I,["enter"]),disabled:M.value},null,40,Ma),[[Ze,v.value]]),y("button",{class:"btn btn-outline-secondary",type:"button",onClick:I,title:"Search",disabled:M.value},[...w[6]||(w[6]=[y("i",{class:"fa-solid fa-search"},null,-1)])],8,Na),y("button",{class:"btn btn-outline-secondary",type:"button",onClick:Nt,disabled:!S.value||M.value,title:"Previous match"},[...w[7]||(w[7]=[y("i",{class:"fa-solid fa-chevron-up"},null,-1)])],8,Aa),y("button",{class:"btn btn-outline-secondary",type:"button",onClick:F,disabled:!S.value||M.value,title:"Next match"},[...w[8]||(w[8]=[y("i",{class:"fa-solid fa-chevron-down"},null,-1)])],8,ka),y("button",{class:"btn btn-outline-secondary",type:"button",onClick:st,disabled:!v.value||M.value,title:"Clear search"},[...w[9]||(w[9]=[y("i",{class:"fa-solid fa-times"},null,-1)])],8,za)])])]),y("div",Pa,[y("div",$a,[w[12]||(w[12]=y("span",{class:"filter-section-title"},[y("i",{class:"fa-solid fa-filter"}),B(" From other sheets ")],-1)),y("div",Ta,[y("div",Za,[Pt(y("input",{class:"form-check-input",type:"checkbox",role:"switch",id:"ckb_children_other_sheets","onUpdate:modelValue":w[1]||(w[1]=C=>f.value=C),disabled:M.value},null,8,Ia),[[Ie,f.value]]),w[10]||(w[10]=y("label",{class:"form-check-label",for:"ckb_children_other_sheets"},[y("i",{class:"fa-solid fa-arrow-down"}),B(" Children ")],-1))]),y("div",La,[Pt(y("input",{class:"form-check-input",type:"checkbox",role:"switch",id:"ckb_parents_other_sheets","onUpdate:modelValue":w[2]||(w[2]=C=>p.value=C),disabled:M.value},null,8,Da),[[Ie,p.value]]),w[11]||(w[11]=y("label",{class:"form-check-label",for:"ckb_parents_other_sheets"},[y("i",{class:"fa-solid fa-arrow-up"}),B(" Parents ")],-1))])])]),y("div",Ba,[w[14]||(w[14]=y("span",{class:"filter-section-title"},[y("i",{class:"fa-solid fa-layer-group"}),B(" Child Levels ")],-1)),y("div",Ra,[y("div",Oa,[y("div",qa,[y("label",Va,[w[13]||(w[13]=B(" Depth: ",-1)),y("strong",null,Y(m.value||"All"),1)]),y("span",Fa,"1–"+Y(g.value),1)]),Pt(y("input",{type:"range",class:"form-range","onUpdate:modelValue":w[3]||(w[3]=C=>m.value=C),min:"1",max:g.value,step:"1",id:"range_num_child_levels",disabled:M.value},null,8,Ha),[[Ze,m.value]])])])]),y("div",Xa,[w[16]||(w[16]=y("span",{class:"filter-section-title"},[y("i",{class:"fa-solid fa-tags"}),B(" Curation Status ")],-1)),y("div",Ua,[y("div",Wa,[y("button",{class:"btn btn-sm btn-outline-primary dropdown-toggle",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false",disabled:M.value},[w[15]||(w[15]=y("i",{class:"fa-solid fa-filter"},null,-1)),B(" "+Y(h.value.length)+"/"+Y(u.value.length)+" selected ",1)],8,Ya),y("ul",Ga,[(tt(!0),j(Le,null,De(u.value,C=>(tt(),j("li",{key:C},[y("a",{class:ne(["dropdown-item","ose-curation-status-"+C.toLowerCase().replace(" ","_")]),href:"#",onClick:ft=>At(C)},[y("i",{class:ne(["fa-solid",h.value.indexOf(C)>=0?"fa-circle-check":"fa-circle"])},null,2),B(" "+Y(C),1)],10,Ka)]))),128))])])])])])]),y("div",{ref_key:"svgContainer",ref:i,class:"svg-container"},[a.value?(tt(),j("div",Qa,[...w[17]||(w[17]=[y("div",{class:"spinner"},null,-1),y("span",null,"Loading visualisation...",-1)])])):c.value?(tt(),j("div",Ja,[w[18]||(w[18]=y("i",{class:"fa-solid fa-circle-exclamation"},null,-1)),w[19]||(w[19]=y("span",{class:"error-title"},"Failed to load visualisation",-1)),y("span",ja,Y(c.value),1),y("button",{class:"btn btn-primary btn-sm",onClick:ht},"Try again")])):l.value?Yn("",!0):(tt(),j("div",tl,[...w[20]||(w[20]=[y("i",{class:"fa-solid fa-diagram-project"},null,-1),y("span",{class:"empty-state-title"},"No Visualisation Loaded",-1),y("span",{class:"empty-state-message"},'To see a visualisation, open a spreadsheet from the editor and click the "Visualise" button in the toolbar.',-1)])]))],512),y("div",el,[y("div",nl,[y("div",il,[w[23]||(w[23]=y("div",{class:"modal-header"},[y("h5",{class:"modal-title",id:"legendModalLabel"},[y("i",{class:"fa-solid fa-circle-info"}),B(" Help & Legend ")]),y("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),y("div",rl,[y("div",ol,[w[22]||(w[22]=Gn('<div class="legend-item"><h6><i class="fa-solid fa-circle-question"></i> How to Use</h6><ul><li><strong>Pan:</strong> Click and drag the background</li><li><strong>Zoom:</strong> Use mouse wheel or pinch gesture</li><li><strong>Search:</strong> Find specific classes using the search bar</li><li><strong>Children/Parents Switches:</strong> Toggle whether to include children or parents from other sheets</li><li><strong>Child Levels Slider:</strong> Adjust how many levels of child classes to display</li><li><strong>Curation Status Filter:</strong> Select which curation statuses to display</li><li><strong>Hover on nodes/edges:</strong> Highlight related nodes and edges</li><li><strong>Click on edges:</strong> Keep the edge highlighted</li></ul></div><div class="legend-item"><h6><i class="fa-solid fa-circle-nodes"></i> Node Types</h6><div class="node-examples"><div class="node-example"><div class="example-node node-current">Current Sheet</div><div class="example-node node-current node-selected">Selected Term</div><span class="example-desc">Terms from the current spreadsheet (regular border, selected bold)</span></div><div class="node-example"><div class="example-node node-dependencies">Dependencies</div><span class="example-desc">External terms or terms from other sheets referenced by current terms (dashed border)</span></div><div class="node-example"><div class="example-node node-derived">Derived</div><span class="example-desc">Child terms from other sheets (italic text)</span></div></div></div><div class="legend-item"><h6><i class="fa-solid fa-arrow-right"></i> Edge Types</h6><ul><li><strong>Subclass Of:</strong> Solid black arrows showing hierarchy (parent → child)</li><li><strong>Relations:</strong> Colored arrows showing other relationships (e.g., &quot;has part&quot;, &quot;part of&quot;)</li></ul></div>',3)),y("div",sl,[w[21]||(w[21]=y("h6",null,[y("i",{class:"fa-solid fa-palette"}),B(" Curation Status Colors")],-1)),y("div",al,[(tt(!0),j(Le,null,De(u.value,C=>(tt(),j("span",{key:C,class:ne(["status-badge","ose-curation-status-"+C.toLowerCase().replace(" ","_")])},Y(C),3))),128))])])])]),w[24]||(w[24]=y("div",{class:"modal-footer"},[y("button",{type:"button",class:"btn btn-secondary","data-bs-dismiss":"modal"},"Close")],-1))])])])]))}}),ke=Kn(ll);ke.config.globalProperties.$filters=Qn;ke.use(jn());ke.mount("#vue-app-visualise");
ose_app/static/main.css CHANGED
@@ -1 +1 @@
1
- :root{--bs-callout-link: 10, 88, 202;--bs-callout-code-color: #ab296a}.callout-success{--bd-callout-color: var(--bs-success-text-emphasis);--bd-callout-bg: var(--bs-success-bg-subtle);--bd-callout-border: var(--bs-success-border-subtle)}.callout-danger{--bd-callout-color: var(--bs-danger-text-emphasis);--bd-callout-bg: var(--bs-danger-bg-subtle);--bd-callout-border: var(--bs-danger-border-subtle)}.callout-warning{--bd-callout-color: var(--bs-warning-text-emphasis);--bd-callout-bg: var(--bs-warning-bg-subtle);--bd-callout-border: var(--bs-warning-border-subtle)}.callout-info{--bd-callout-color: var(--bs-info-text-emphasis);--bd-callout-bg: var(--bs-info-bg-subtle);--bd-callout-border: var(--bs-info-border-subtle)}.callout{--bs-link-color-rgb: var(--bs-callout-link);--bs-code-color: var(--bs-callout-code-color);padding:1.25rem;margin-top:1.25rem;margin-bottom:1.25rem;color:var(--bd-callout-color, inherit);background-color:var(--bd-callout-bg, var(--bs-gray-100));border-left:.25rem solid var(--bd-callout-border, var(--bs-gray-300))}.banner{text-align:center;background:#ff0;background:repeating-linear-gradient(-45deg, #666600, #666600, 20px, black 20px, black 40px);color:#fff}.modal-dialog .release-file-settings{display:grid;grid-template-columns:auto 1fr auto;grid-gap:8px 16px}.modal-dialog .release-file-settings h4{grid-column:1/3}.modal-dialog .release-file-settings label{grid-column:1}.modal-dialog .release-file-settings input,.modal-dialog .release-file-settings textarea{grid-column:2}.modal-dialog .release-file-settings span{grid-column:3}.breadcrumb-item.active{font-weight:bold}.loader{width:40px;aspect-ratio:1;position:relative}.loader:before,.loader:after{content:"";position:absolute;top:0;left:0;margin:-8px 0 0 -8px;width:16px;aspect-ratio:1;background:#3fb8af;animation:l2-1 2s infinite,l2-2 1s infinite}.loader:after{background:#ff3d7f;animation-delay:-1s,0s}@keyframes l2-1{0%{top:0;left:0}25%{top:100%;left:0}50%{top:100%;left:100%}75%{top:0;left:100%}100%{top:0;left:0}}@keyframes l2-2{40%,50%{transform:rotate(0.25turn) scale(0.5)}100%{transform:rotate(0.5turn) scale(1)}}:root{--ose-curation-status-discussed: moccasin;--ose-curation-status-proposed: #FFFFFF;--ose-curation-status-to_be_discussed: #eee8aa;--ose-curation-status-in_discussion: #fffacd;--ose-curation-status-published: #7fffd4;--ose-curation-status-obsolete: #2f4f4f;--ose-curation-status-external: #D3D3D3;--ose-curation-status-pre_proposed: #ebfad0}
1
+ :root{--bs-callout-link: 10, 88, 202;--bs-callout-code-color: #ab296a}.callout-success{--bd-callout-color: var(--bs-success-text-emphasis);--bd-callout-bg: var(--bs-success-bg-subtle);--bd-callout-border: var(--bs-success-border-subtle)}.callout-danger{--bd-callout-color: var(--bs-danger-text-emphasis);--bd-callout-bg: var(--bs-danger-bg-subtle);--bd-callout-border: var(--bs-danger-border-subtle)}.callout-warning{--bd-callout-color: var(--bs-warning-text-emphasis);--bd-callout-bg: var(--bs-warning-bg-subtle);--bd-callout-border: var(--bs-warning-border-subtle)}.callout-info{--bd-callout-color: var(--bs-info-text-emphasis);--bd-callout-bg: var(--bs-info-bg-subtle);--bd-callout-border: var(--bs-info-border-subtle)}.callout{--bs-link-color-rgb: var(--bs-callout-link);--bs-code-color: var(--bs-callout-code-color);padding:1.25rem;margin-top:1.25rem;margin-bottom:1.25rem;color:var(--bd-callout-color, inherit);background-color:var(--bd-callout-bg, var(--bs-gray-100));border-left:.25rem solid var(--bd-callout-border, var(--bs-gray-300))}.banner{text-align:center;background:#ff0;background:repeating-linear-gradient(-45deg, #666600, #666600, 20px, black 20px, black 40px);color:#fff}.modal-dialog .release-file-settings{display:grid;grid-template-columns:auto 1fr auto;grid-gap:8px 16px}.modal-dialog .release-file-settings h4{grid-column:1/3}.modal-dialog .release-file-settings label{grid-column:1}.modal-dialog .release-file-settings input,.modal-dialog .release-file-settings textarea{grid-column:2}.modal-dialog .release-file-settings span{grid-column:3}.breadcrumb-item.active{font-weight:bold}.loader{width:40px;aspect-ratio:1;position:relative}.loader:before,.loader:after{content:"";position:absolute;top:0;left:0;margin:-8px 0 0 -8px;width:16px;aspect-ratio:1;background:#3fb8af;animation:l2-1 2s infinite,l2-2 1s infinite}.loader:after{background:#ff3d7f;animation-delay:-1s,0s}@keyframes l2-1{0%{top:0;left:0}25%{top:100%;left:0}50%{top:100%;left:100%}75%{top:0;left:100%}100%{top:0;left:0}}@keyframes l2-2{40%,50%{transform:rotate(0.25turn) scale(0.5)}100%{transform:rotate(0.5turn) scale(1)}}:root{--ose-curation-status-discussed: moccasin;--ose-curation-status-proposed: #FFFFFF;--ose-curation-status-to_be_discussed: #eee8aa;--ose-curation-status-in_discussion: #fffacd;--ose-curation-status-published: #7fffd4;--ose-curation-status-obsolete: #2f4f4f;--ose-curation-status-external: #D3D3D3;--ose-curation-status-pre_proposed: #ebfad0}.version-info{position:fixed;bottom:4px;right:4px;color:var(--bs-gray-600);font-size:x-small}
ose_app/static/main.scss CHANGED
@@ -144,4 +144,12 @@
144
144
  --ose-curation-status-obsolete: #2f4f4f;
145
145
  --ose-curation-status-external: #D3D3D3;
146
146
  --ose-curation-status-pre_proposed: #ebfad0;
147
+ }
148
+
149
+ .version-info {
150
+ position: fixed;
151
+ bottom: 4px;
152
+ right: 4px;
153
+ color: var(--bs-gray-600);
154
+ font-size: x-small;
147
155
  }
@@ -133,6 +133,9 @@
133
133
  {# </p>#}
134
134
  {# {% endblock %}#}
135
135
  {# </div>#}
136
+ <div class="version-info">
137
+ <small>v{{ config['APP_VERSION'] }}</small>
138
+ </div>
136
139
  </div>
137
140
 
138
141
 
@@ -0,0 +1,15 @@
1
+ Metadata-Version: 2.4
2
+ Name: ose-app
3
+ Version: 0.3.1
4
+ Summary: Flask web application for OntoSpreadEd - Ontology spreadsheet editor
5
+ Requires-Python: >=3.12
6
+ Requires-Dist: ose-core==0.3.1
7
+ Requires-Dist: Flask==2.3.3
8
+ Requires-Dist: Flask-SQLAlchemy==3.1.1
9
+ Requires-Dist: Flask-Injector
10
+ Requires-Dist: GitHub-Flask
11
+ Requires-Dist: flask-cors==3.0.10
12
+ Requires-Dist: flask-executor
13
+ Requires-Dist: Flask-Migrate
14
+ Provides-Extra: cli
15
+ Requires-Dist: ose-cli; extra == "cli"