sysgraph 0.0.11__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.
@@ -0,0 +1,735 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function r(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(o){if(o.ep)return;o.ep=!0;const s=r(o);fetch(o.href,s)}})();class Mr{constructor(e=[],r=[]){this.nodesMap=new Map(e.map(i=>[i.id,i])),this.edgesMap=new Map(r.map(i=>[i.id,i])),this.adjacency=new Map;for(const i of this.nodesMap.keys())this.adjacency.set(i,[]);for(const i of this.edgesMap.values())this.adjacency.has(i.source_id)||this.adjacency.set(i.source_id,[]),this.adjacency.has(i.target_id)||this.adjacency.set(i.target_id,[]),this.adjacency.get(i.source_id).push(i),this.adjacency.get(i.target_id).push(i)}getNodes(){return[...this.nodesMap.values()]}getEdges(){return[...this.edgesMap.values()]}getAdjacentEdges(e){return this.adjacency.get(e)||[]}toData(){return{nodes:this.getNodes(),edges:this.getEdges()}}}function cu(n,e,r){const i=new Map;for(const s of n.getNodes())e(s)&&i.set(s.id,s);const o=new Array;for(const s of n.getEdges())!i.has(s.source_id)||!i.has(s.target_id)||r(s)&&o.push(s);return new Mr(Array.from(i.values()),o)}function mp(n){const e=new Map;for(const r of n.getNodes())e.set(r.id,0);for(const r of n.getEdges())e.set(r.source_id,e.get(r.source_id)+1),e.set(r.target_id,e.get(r.target_id)+1);return e}const T={graph:hu(),highlight:null,currentTool:"pointer",adjacencyFilter:null,selection:uu(),search:null};function uu(){return{selectedNodeIds:new Set,isSelecting:!1,selectionStart:null,selectionEnd:null,selectionStartCanvas:null,selectionEndCanvas:null}}function du(){T.graph=hu(),T.selection=uu(),T.adjacencyFilter=null,T.highlight=null,T.search=null}function hu(){return new Mr}function Zi(n){T.graph=n}function vn(){return T.graph}const nr={};function ce(n,e){nr[n]||(nr[n]=[]),nr[n].push(e)}function ut(n,e){console.log("emiting event",n,e),(nr[n]||[]).forEach(i=>i(e))}const Go={};function Ks(n,e){Go[n]&&console.warn(`overwriting handler for command "${n}"`),Go[n]=e}function Gs(n,e){console.log("handling command",n,e);const r=Go[n];if(!r)throw new Error(`no handler registered for command "${n}"`);return r(e)}function gp(n,e,r){const i=new Map,o=new Map,s=[{nodeId:e,distance:0}];for(i.set(e,0);s.length>0;){const{nodeId:a,distance:l}=s.shift();if(l>=r)continue;const c=n.adjacency.get(a)||[];for(const u of c){if(o.has(u.id))continue;o.set(u.id,l+1);const h=u.source_id===a?u.target_id:u.source_id;i.has(h)||(i.set(h,l+1),s.push({nodeId:h,distance:l+1}))}}return{nodeDistancesMap:i,edgeDistancesMap:o}}function pu(n){let e=2166136261;for(let r=0;r<n.length;r++)e^=n.charCodeAt(r),e=Math.imul(e,16777619);return e>>>0}const H={d3Charge:-400,d3LinkDistance:140,d3LinkStrength:.8,d3CollisionMultiplier:1,d3AlphaTarget:0,d3VelocityDecay:.8,d3ForceXYStrength:.1,d3CenterForce:!0,showIsolated:!0,showGrid:!0,curvatureStep:.005,nodeLabelMode:"default",nodeLabelExpression:'(properties.name || properties.label) || (type + " " + id)',nodeColors:{},edgeColors:{},edgeWidths:{},nodeFilters:{},edgeFilters:{}},en=.5,bp=1,Te=[1,1,.5,.1],Qa={process:{r:21,g:127,b:200,a:1},socket:{r:220,g:75,b:47,a:1},uds:{r:31,g:120,b:180,a:1},pipe:{r:169,g:57,b:249,a:1},external_ip:{r:255,g:103,b:0,a:1}},tl={uds:{r:31,g:120,b:180,a:en},uds_connection:{r:31,g:120,b:180,a:en},pipe:{r:207,g:110,b:255,a:en},socket_connection:{r:255,g:76,b:40,a:en},socket:{r:255,g:76,b:40,a:en},child_process:{r:40,g:40,b:40,a:en}},el={child_process:1,pipe:1,socket:1,socket_connection:1,uds:1,uds_connection:1},Ai=[{r:52,g:152,b:219},{r:41,g:128,b:185},{r:31,g:97,b:141},{r:93,g:173,b:226},{r:26,g:188,b:156},{r:22,g:160,b:133},{r:0,g:121,b:107},{r:0,g:150,b:136},{r:103,g:58,b:183},{r:142,g:68,b:173},{r:75,g:0,b:130},{r:39,g:174,b:96},{r:46,g:204,b:113},{r:0,g:200,b:83},{r:230,g:126,b:34},{r:211,g:84,b:0},{r:241,g:196,b:15},{r:183,g:149,b:11},{r:231,g:76,b:60},{r:192,g:57,b:43},{r:233,g:30,b:99},{r:192,g:57,b:120},{r:52,g:73,b:94},{r:127,g:140,b:141}];function fu(n){if(n in H.nodeColors)return H.nodeColors[n];if(n in Qa)return Qa[n];const e=pu(n);return{...Ai[e%Ai.length],a:1}}function vu(n){if(n in H.edgeColors)return H.edgeColors[n];if(n in tl)return tl[n];const e=pu(n);return{...Ai[e%Ai.length],a:en}}function mu(n){return n in H.edgeWidths?H.edgeWidths[n]:n in el?el[n]:bp}const ye=document.getElementById("contextMenu");function nl(n,e,r){ye.innerHTML="";for(const i of r){const o=document.createElement("div");o.className="context-menu-item",o.textContent=i.label,o.addEventListener("click",s=>{s.stopPropagation(),Ws(),i.action()}),ye.appendChild(o)}ye.style.left=`${n}px`,ye.style.top=`${e}px`,ye.style.display="block",requestAnimationFrame(()=>{const i=ye.getBoundingClientRect();i.right>window.innerWidth&&(ye.style.left=`${window.innerWidth-i.width-4}px`),i.bottom>window.innerHeight&&(ye.style.top=`${window.innerHeight-i.height-4}px`)})}function Ws(){ye.style.display="none"}window.addEventListener("click",()=>Ws());window.addEventListener("contextmenu",()=>Ws());function _p(n){const e=n.trim();if(e.startsWith("#")){let i=e.slice(1);return i.length===3&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]),{r:parseInt(i.slice(0,2),16),g:parseInt(i.slice(2,4),16),b:parseInt(i.slice(4,6),16)}}const r=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(r)return{r:+r[1],g:+r[2],b:+r[3]};throw new Error(`Cannot parse color: ${n}`)}function po(n,e,r){return n+(e-n)*r}class yp{constructor(e){if(e.length<2)throw new Error("ColorScale requires at least two stops");this.stops=e.slice().sort((r,i)=>r[1]-i[1]).map(([r,i])=>({color:_p(r),pos:i}))}getColor(e){const r=Math.max(0,Math.min(1,e));if(r<=this.stops[0].pos){const{r:a,g:l,b:c}=this.stops[0].color;return`rgb(${Math.round(a)}, ${Math.round(l)}, ${Math.round(c)})`}if(r>=this.stops[this.stops.length-1].pos){const{r:a,g:l,b:c}=this.stops[this.stops.length-1].color;return`rgb(${Math.round(a)}, ${Math.round(l)}, ${Math.round(c)})`}for(let a=0;a<this.stops.length-1;a++){const l=this.stops[a],c=this.stops[a+1];if(r>=l.pos&&r<=c.pos){const u=(r-l.pos)/(c.pos-l.pos),h=Math.round(po(l.color.r,c.color.r,u)),d=Math.round(po(l.color.g,c.color.g,u)),f=Math.round(po(l.color.b,c.color.b,u));return`rgb(${h}, ${d}, ${f})`}}const{r:i,g:o,b:s}=this.stops[0].color;return`rgb(${Math.round(i)}, ${Math.round(o)}, ${Math.round(s)})`}}var Wo="http://www.w3.org/1999/xhtml";const rl={svg:"http://www.w3.org/2000/svg",xhtml:Wo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ji(n){var e=n+="",r=e.indexOf(":");return r>=0&&(e=n.slice(0,r))!=="xmlns"&&(n=n.slice(r+1)),rl.hasOwnProperty(e)?{space:rl[e],local:n}:n}function xp(n){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Wo&&e.documentElement.namespaceURI===Wo?e.createElement(n):e.createElementNS(r,n)}}function wp(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function gu(n){var e=Ji(n);return(e.local?wp:xp)(e)}function Cp(){}function Ys(n){return n==null?Cp:function(){return this.querySelector(n)}}function Ep(n){typeof n!="function"&&(n=Ys(n));for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o)for(var s=e[o],a=s.length,l=i[o]=new Array(a),c,u,h=0;h<a;++h)(c=s[h])&&(u=n.call(c,c.__data__,h,s))&&("__data__"in c&&(u.__data__=c.__data__),l[h]=u);return new Dt(i,this._parents)}function bu(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function kp(){return[]}function _u(n){return n==null?kp:function(){return this.querySelectorAll(n)}}function Ap(n){return function(){var e=n.apply(this,arguments);return e==null?[]:bu(e)}}function Pp(n){typeof n=="function"?n=Ap(n):n=_u(n);for(var e=this._groups,r=e.length,i=[],o=[],s=0;s<r;++s)for(var a=e[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&(i.push(n.call(c,c.__data__,u,a)),o.push(c));return new Dt(i,o)}function yu(n){return function(){return this.matches(n)}}function xu(n){return function(e){return e.matches(n)}}var Sp=Array.prototype.find;function Mp(n){return function(){return Sp.call(this.children,n)}}function $p(){return this.firstElementChild}function Tp(n){return this.select(n==null?$p:Mp(typeof n=="function"?n:xu(n)))}var Ip=Array.prototype.filter;function Op(){return this.children}function Dp(n){return function(){return Ip.call(this.children,n)}}function Rp(n){return this.selectAll(n==null?Op:Dp(typeof n=="function"?n:xu(n)))}function jp(n){typeof n!="function"&&(n=yu(n));for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o)for(var s=e[o],a=s.length,l=i[o]=[],c,u=0;u<a;++u)(c=s[u])&&n.call(c,c.__data__,u,s)&&l.push(c);return new Dt(i,this._parents)}function wu(n){return new Array(n.length)}function Lp(){return new Dt(this._enter||this._groups.map(wu),this._parents)}function Pi(n,e){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=e}Pi.prototype={constructor:Pi,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,e){return this._parent.insertBefore(n,e)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function zp(n){return function(){return n}}function Np(n,e,r,i,o,s){for(var a=0,l,c=e.length,u=s.length;a<u;++a)(l=e[a])?(l.__data__=s[a],i[a]=l):r[a]=new Pi(n,s[a]);for(;a<c;++a)(l=e[a])&&(o[a]=l)}function Fp(n,e,r,i,o,s,a){var l,c,u=new Map,h=e.length,d=s.length,f=new Array(h),p;for(l=0;l<h;++l)(c=e[l])&&(f[l]=p=a.call(c,c.__data__,l,e)+"",u.has(p)?o[l]=c:u.set(p,c));for(l=0;l<d;++l)p=a.call(n,s[l],l,s)+"",(c=u.get(p))?(i[l]=c,c.__data__=s[l],u.delete(p)):r[l]=new Pi(n,s[l]);for(l=0;l<h;++l)(c=e[l])&&u.get(f[l])===c&&(o[l]=c)}function Vp(n){return n.__data__}function Bp(n,e){if(!arguments.length)return Array.from(this,Vp);var r=e?Fp:Np,i=this._parents,o=this._groups;typeof n!="function"&&(n=zp(n));for(var s=o.length,a=new Array(s),l=new Array(s),c=new Array(s),u=0;u<s;++u){var h=i[u],d=o[u],f=d.length,p=bu(n.call(h,h&&h.__data__,u,i)),m=p.length,b=l[u]=new Array(m),g=a[u]=new Array(m),v=c[u]=new Array(f);r(h,d,b,g,v,p,e);for(var x=0,w=0,_,y;x<m;++x)if(_=b[x]){for(x>=w&&(w=x+1);!(y=g[w])&&++w<m;);_._next=y||null}}return a=new Dt(a,i),a._enter=l,a._exit=c,a}function Up(){return new Dt(this._exit||this._groups.map(wu),this._parents)}function Hp(n,e,r){var i=this.enter(),o=this,s=this.exit();return i=typeof n=="function"?n(i):i.append(n+""),e!=null&&(o=e(o)),r==null?s.remove():r(s),i&&o?i.merge(o).order():o}function qp(n){if(!(n instanceof Dt))throw new Error("invalid merge");for(var e=this._groups,r=n._groups,i=e.length,o=r.length,s=Math.min(i,o),a=new Array(i),l=0;l<s;++l)for(var c=e[l],u=r[l],h=c.length,d=a[l]=new Array(h),f,p=0;p<h;++p)(f=c[p]||u[p])&&(d[p]=f);for(;l<i;++l)a[l]=e[l];return new Dt(a,this._parents)}function Kp(){for(var n=this._groups,e=-1,r=n.length;++e<r;)for(var i=n[e],o=i.length-1,s=i[o],a;--o>=0;)(a=i[o])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function Gp(n){n||(n=Wp);function e(d,f){return d&&f?n(d.__data__,f.__data__):!d-!f}for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s){for(var a=r[s],l=a.length,c=o[s]=new Array(l),u,h=0;h<l;++h)(u=a[h])&&(c[h]=u);c.sort(e)}return new Dt(o,this._parents).order()}function Wp(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function Yp(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function Xp(){return Array.from(this)}function Zp(){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i=n[e],o=0,s=i.length;o<s;++o){var a=i[o];if(a)return a}return null}function Jp(){let n=0;for(const e of this)++n;return n}function Qp(){return!this.node()}function tf(n){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var o=e[r],s=0,a=o.length,l;s<a;++s)(l=o[s])&&n.call(l,l.__data__,s,o);return this}function ef(n){return function(){this.removeAttribute(n)}}function nf(n){return function(){this.removeAttributeNS(n.space,n.local)}}function rf(n,e){return function(){this.setAttribute(n,e)}}function of(n,e){return function(){this.setAttributeNS(n.space,n.local,e)}}function sf(n,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(n):this.setAttribute(n,r)}}function af(n,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,r)}}function lf(n,e){var r=Ji(n);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((e==null?r.local?nf:ef:typeof e=="function"?r.local?af:sf:r.local?of:rf)(r,e))}function Cu(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function cf(n){return function(){this.style.removeProperty(n)}}function uf(n,e,r){return function(){this.style.setProperty(n,e,r)}}function df(n,e,r){return function(){var i=e.apply(this,arguments);i==null?this.style.removeProperty(n):this.style.setProperty(n,i,r)}}function hf(n,e,r){return arguments.length>1?this.each((e==null?cf:typeof e=="function"?df:uf)(n,e,r??"")):$n(this.node(),n)}function $n(n,e){return n.style.getPropertyValue(e)||Cu(n).getComputedStyle(n,null).getPropertyValue(e)}function pf(n){return function(){delete this[n]}}function ff(n,e){return function(){this[n]=e}}function vf(n,e){return function(){var r=e.apply(this,arguments);r==null?delete this[n]:this[n]=r}}function mf(n,e){return arguments.length>1?this.each((e==null?pf:typeof e=="function"?vf:ff)(n,e)):this.node()[n]}function Eu(n){return n.trim().split(/^|\s+/)}function Xs(n){return n.classList||new ku(n)}function ku(n){this._node=n,this._names=Eu(n.getAttribute("class")||"")}ku.prototype={add:function(n){var e=this._names.indexOf(n);e<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function Au(n,e){for(var r=Xs(n),i=-1,o=e.length;++i<o;)r.add(e[i])}function Pu(n,e){for(var r=Xs(n),i=-1,o=e.length;++i<o;)r.remove(e[i])}function gf(n){return function(){Au(this,n)}}function bf(n){return function(){Pu(this,n)}}function _f(n,e){return function(){(e.apply(this,arguments)?Au:Pu)(this,n)}}function yf(n,e){var r=Eu(n+"");if(arguments.length<2){for(var i=Xs(this.node()),o=-1,s=r.length;++o<s;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof e=="function"?_f:e?gf:bf)(r,e))}function xf(){this.textContent=""}function wf(n){return function(){this.textContent=n}}function Cf(n){return function(){var e=n.apply(this,arguments);this.textContent=e??""}}function Ef(n){return arguments.length?this.each(n==null?xf:(typeof n=="function"?Cf:wf)(n)):this.node().textContent}function kf(){this.innerHTML=""}function Af(n){return function(){this.innerHTML=n}}function Pf(n){return function(){var e=n.apply(this,arguments);this.innerHTML=e??""}}function Sf(n){return arguments.length?this.each(n==null?kf:(typeof n=="function"?Pf:Af)(n)):this.node().innerHTML}function Mf(){this.nextSibling&&this.parentNode.appendChild(this)}function $f(){return this.each(Mf)}function Tf(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function If(){return this.each(Tf)}function Of(n){var e=typeof n=="function"?n:gu(n);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Df(){return null}function Rf(n,e){var r=typeof n=="function"?n:gu(n),i=e==null?Df:typeof e=="function"?e:Ys(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function jf(){var n=this.parentNode;n&&n.removeChild(this)}function Lf(){return this.each(jf)}function zf(){var n=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function Nf(){var n=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(n,this.nextSibling):n}function Ff(n){return this.select(n?Nf:zf)}function Vf(n){return arguments.length?this.property("__data__",n):this.node().__data__}function Bf(n){return function(e){n.call(this,e,this.__data__)}}function Uf(n){return n.trim().split(/^|\s+/).map(function(e){var r="",i=e.indexOf(".");return i>=0&&(r=e.slice(i+1),e=e.slice(0,i)),{type:e,name:r}})}function Hf(n){return function(){var e=this.__on;if(e){for(var r=0,i=-1,o=e.length,s;r<o;++r)s=e[r],(!n.type||s.type===n.type)&&s.name===n.name?this.removeEventListener(s.type,s.listener,s.options):e[++i]=s;++i?e.length=i:delete this.__on}}}function qf(n,e,r){return function(){var i=this.__on,o,s=Bf(e);if(i){for(var a=0,l=i.length;a<l;++a)if((o=i[a]).type===n.type&&o.name===n.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=r),o.value=e;return}}this.addEventListener(n.type,s,r),o={type:n.type,name:n.name,value:e,listener:s,options:r},i?i.push(o):this.__on=[o]}}function Kf(n,e,r){var i=Uf(n+""),o,s=i.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,h;c<u;++c)for(o=0,h=l[c];o<s;++o)if((a=i[o]).type===h.type&&a.name===h.name)return h.value}return}for(l=e?qf:Hf,o=0;o<s;++o)this.each(l(i[o],e,r));return this}function Su(n,e,r){var i=Cu(n),o=i.CustomEvent;typeof o=="function"?o=new o(e,r):(o=i.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),n.dispatchEvent(o)}function Gf(n,e){return function(){return Su(this,n,e)}}function Wf(n,e){return function(){return Su(this,n,e.apply(this,arguments))}}function Yf(n,e){return this.each((typeof e=="function"?Wf:Gf)(n,e))}function*Xf(){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i=n[e],o=0,s=i.length,a;o<s;++o)(a=i[o])&&(yield a)}var Mu=[null];function Dt(n,e){this._groups=n,this._parents=e}function $r(){return new Dt([[document.documentElement]],Mu)}function Zf(){return this}Dt.prototype=$r.prototype={constructor:Dt,select:Ep,selectAll:Pp,selectChild:Tp,selectChildren:Rp,filter:jp,data:Bp,enter:Lp,exit:Up,join:Hp,merge:qp,selection:Zf,order:Kp,sort:Gp,call:Yp,nodes:Xp,node:Zp,size:Jp,empty:Qp,each:tf,attr:lf,style:hf,property:mf,classed:yf,text:Ef,html:Sf,raise:$f,lower:If,append:Of,insert:Rf,remove:Lf,clone:Ff,datum:Vf,on:Kf,dispatch:Yf,[Symbol.iterator]:Xf};function qt(n){return typeof n=="string"?new Dt([[document.querySelector(n)]],[document.documentElement]):new Dt([[n]],Mu)}function Jf(n){let e;for(;e=n.sourceEvent;)n=e;return n}function ee(n,e){if(n=Jf(n),e===void 0&&(e=n.currentTarget),e){var r=e.ownerSVGElement||e;if(r.createSVGPoint){var i=r.createSVGPoint();return i.x=n.clientX,i.y=n.clientY,i=i.matrixTransform(e.getScreenCTM().inverse()),[i.x,i.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[n.clientX-o.left-e.clientLeft,n.clientY-o.top-e.clientTop]}}return[n.pageX,n.pageY]}var Qf={value:()=>{}};function Tr(){for(var n=0,e=arguments.length,r={},i;n<e;++n){if(!(i=arguments[n]+"")||i in r||/[\s.]/.test(i))throw new Error("illegal type: "+i);r[i]=[]}return new pi(r)}function pi(n){this._=n}function tv(n,e){return n.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");if(o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}pi.prototype=Tr.prototype={constructor:pi,on:function(n,e){var r=this._,i=tv(n+"",r),o,s=-1,a=i.length;if(arguments.length<2){for(;++s<a;)if((o=(n=i[s]).type)&&(o=ev(r[o],n.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(o=(n=i[s]).type)r[o]=il(r[o],n.name,e);else if(e==null)for(o in r)r[o]=il(r[o],n.name,null);return this},copy:function(){var n={},e=this._;for(var r in e)n[r]=e[r].slice();return new pi(n)},call:function(n,e){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,s;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(s=this._[n],i=0,o=s.length;i<o;++i)s[i].value.apply(e,r)},apply:function(n,e,r){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var i=this._[n],o=0,s=i.length;o<s;++o)i[o].value.apply(e,r)}};function ev(n,e){for(var r=0,i=n.length,o;r<i;++r)if((o=n[r]).name===e)return o.value}function il(n,e,r){for(var i=0,o=n.length;i<o;++i)if(n[i].name===e){n[i]=Qf,n=n.slice(0,i).concat(n.slice(i+1));break}return r!=null&&n.push({name:e,value:r}),n}function fo(n){n.stopImmediatePropagation()}function An(n){n.preventDefault(),n.stopImmediatePropagation()}function $u(n){var e=n.document.documentElement,r=qt(n).on("dragstart.drag",An,!0);"onselectstart"in e?r.on("selectstart.drag",An,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Tu(n,e){var r=n.document.documentElement,i=qt(n).on("dragstart.drag",null);e&&(i.on("click.drag",An,!0),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in r?i.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Kr=n=>()=>n;function Yo(n,{sourceEvent:e,subject:r,target:i,identifier:o,active:s,x:a,y:l,dx:c,dy:u,dispatch:h}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:h}})}Yo.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function nv(n){return!n.ctrlKey&&!n.button}function rv(){return this.parentNode}function iv(n,e){return e??{x:n.x,y:n.y}}function ov(){return navigator.maxTouchPoints||"ontouchstart"in this}function sv(){var n=nv,e=rv,r=iv,i=ov,o={},s=Tr("start","drag","end"),a=0,l,c,u,h,d=0;function f(_){_.on("mousedown.drag",p).filter(i).on("touchstart.drag",g).on("touchmove.drag",v).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,y){if(!(h||!n.call(this,_,y))){var C=w(this,e.call(this,_,y),_,y,"mouse");C&&(qt(_.view).on("mousemove.drag",m,!0).on("mouseup.drag",b,!0),$u(_.view),fo(_),u=!1,l=_.clientX,c=_.clientY,C("start",_))}}function m(_){if(An(_),!u){var y=_.clientX-l,C=_.clientY-c;u=y*y+C*C>d}o.mouse("drag",_)}function b(_){qt(_.view).on("mousemove.drag mouseup.drag",null),Tu(_.view,u),An(_),o.mouse("end",_)}function g(_,y){if(n.call(this,_,y)){var C=_.changedTouches,E=e.call(this,_,y),k=C.length,M,P;for(M=0;M<k;++M)(P=w(this,E,_,y,C[M].identifier,C[M]))&&(fo(_),P("start",_,C[M]))}}function v(_){var y=_.changedTouches,C=y.length,E,k;for(E=0;E<C;++E)(k=o[y[E].identifier])&&(An(_),k("drag",_,y[E]))}function x(_){var y=_.changedTouches,C=y.length,E,k;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),E=0;E<C;++E)(k=o[y[E].identifier])&&(fo(_),k("end",_,y[E]))}function w(_,y,C,E,k,M){var P=s.copy(),D=ee(M||C,y),R,z,A;if((A=r.call(_,new Yo("beforestart",{sourceEvent:C,target:f,identifier:k,active:a,x:D[0],y:D[1],dx:0,dy:0,dispatch:P}),E))!=null)return R=A.x-D[0]||0,z=A.y-D[1]||0,function I(S,F,V){var U=D,q;switch(S){case"start":o[k]=I,q=a++;break;case"end":delete o[k],--a;case"drag":D=ee(V||F,y),q=a;break}P.call(S,_,new Yo(S,{sourceEvent:F,subject:A,target:f,identifier:k,active:q,x:D[0]+R,y:D[1]+z,dx:D[0]-U[0],dy:D[1]-U[1],dispatch:P}),E)}}return f.filter=function(_){return arguments.length?(n=typeof _=="function"?_:Kr(!!_),f):n},f.container=function(_){return arguments.length?(e=typeof _=="function"?_:Kr(_),f):e},f.subject=function(_){return arguments.length?(r=typeof _=="function"?_:Kr(_),f):r},f.touchable=function(_){return arguments.length?(i=typeof _=="function"?_:Kr(!!_),f):i},f.on=function(){var _=s.on.apply(s,arguments);return _===s?f:_},f.clickDistance=function(_){return arguments.length?(d=(_=+_)*_,f):Math.sqrt(d)},f}function Zs(n,e,r){n.prototype=e.prototype=r,r.constructor=n}function Iu(n,e){var r=Object.create(n.prototype);for(var i in e)r[i]=e[i];return r}function Ir(){}var vr=.7,Si=1/vr,Pn="\\s*([+-]?\\d+)\\s*",mr="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",oe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",av=/^#([0-9a-f]{3,8})$/,lv=new RegExp("^rgb\\("+[Pn,Pn,Pn]+"\\)$"),cv=new RegExp("^rgb\\("+[oe,oe,oe]+"\\)$"),uv=new RegExp("^rgba\\("+[Pn,Pn,Pn,mr]+"\\)$"),dv=new RegExp("^rgba\\("+[oe,oe,oe,mr]+"\\)$"),hv=new RegExp("^hsl\\("+[mr,oe,oe]+"\\)$"),pv=new RegExp("^hsla\\("+[mr,oe,oe,mr]+"\\)$"),ol={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};Zs(Ir,cn,{copy:function(n){return Object.assign(new this.constructor,this,n)},displayable:function(){return this.rgb().displayable()},hex:sl,formatHex:sl,formatHsl:fv,formatRgb:al,toString:al});function sl(){return this.rgb().formatHex()}function fv(){return Ou(this).formatHsl()}function al(){return this.rgb().formatRgb()}function cn(n){var e,r;return n=(n+"").trim().toLowerCase(),(e=av.exec(n))?(r=e[1].length,e=parseInt(e[1],16),r===6?ll(e):r===3?new zt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Gr(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Gr(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=lv.exec(n))?new zt(e[1],e[2],e[3],1):(e=cv.exec(n))?new zt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=uv.exec(n))?Gr(e[1],e[2],e[3],e[4]):(e=dv.exec(n))?Gr(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=hv.exec(n))?dl(e[1],e[2]/100,e[3]/100,1):(e=pv.exec(n))?dl(e[1],e[2]/100,e[3]/100,e[4]):ol.hasOwnProperty(n)?ll(ol[n]):n==="transparent"?new zt(NaN,NaN,NaN,0):null}function ll(n){return new zt(n>>16&255,n>>8&255,n&255,1)}function Gr(n,e,r,i){return i<=0&&(n=e=r=NaN),new zt(n,e,r,i)}function vv(n){return n instanceof Ir||(n=cn(n)),n?(n=n.rgb(),new zt(n.r,n.g,n.b,n.opacity)):new zt}function Xo(n,e,r,i){return arguments.length===1?vv(n):new zt(n,e,r,i??1)}function zt(n,e,r,i){this.r=+n,this.g=+e,this.b=+r,this.opacity=+i}Zs(zt,Xo,Iu(Ir,{brighter:function(n){return n=n==null?Si:Math.pow(Si,n),new zt(this.r*n,this.g*n,this.b*n,this.opacity)},darker:function(n){return n=n==null?vr:Math.pow(vr,n),new zt(this.r*n,this.g*n,this.b*n,this.opacity)},rgb:function(){return this},displayable:function(){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:cl,formatHex:cl,formatRgb:ul,toString:ul}));function cl(){return"#"+vo(this.r)+vo(this.g)+vo(this.b)}function ul(){var n=this.opacity;return n=isNaN(n)?1:Math.max(0,Math.min(1,n)),(n===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(n===1?")":", "+n+")")}function vo(n){return n=Math.max(0,Math.min(255,Math.round(n)||0)),(n<16?"0":"")+n.toString(16)}function dl(n,e,r,i){return i<=0?n=e=r=NaN:r<=0||r>=1?n=e=NaN:e<=0&&(n=NaN),new ne(n,e,r,i)}function Ou(n){if(n instanceof ne)return new ne(n.h,n.s,n.l,n.opacity);if(n instanceof Ir||(n=cn(n)),!n)return new ne;if(n instanceof ne)return n;n=n.rgb();var e=n.r/255,r=n.g/255,i=n.b/255,o=Math.min(e,r,i),s=Math.max(e,r,i),a=NaN,l=s-o,c=(s+o)/2;return l?(e===s?a=(r-i)/l+(r<i)*6:r===s?a=(i-e)/l+2:a=(e-r)/l+4,l/=c<.5?s+o:2-s-o,a*=60):l=c>0&&c<1?0:a,new ne(a,l,c,n.opacity)}function mv(n,e,r,i){return arguments.length===1?Ou(n):new ne(n,e,r,i??1)}function ne(n,e,r,i){this.h=+n,this.s=+e,this.l=+r,this.opacity=+i}Zs(ne,mv,Iu(Ir,{brighter:function(n){return n=n==null?Si:Math.pow(Si,n),new ne(this.h,this.s,this.l*n,this.opacity)},darker:function(n){return n=n==null?vr:Math.pow(vr,n),new ne(this.h,this.s,this.l*n,this.opacity)},rgb:function(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*e,o=2*r-i;return new zt(mo(n>=240?n-240:n+120,o,i),mo(n,o,i),mo(n<120?n+240:n-120,o,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var n=this.opacity;return n=isNaN(n)?1:Math.max(0,Math.min(1,n)),(n===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(n===1?")":", "+n+")")}}));function mo(n,e,r){return(n<60?e+(r-e)*n/60:n<180?r:n<240?e+(r-e)*(240-n)/60:e)*255}const Du=n=>()=>n;function gv(n,e){return function(r){return n+r*e}}function bv(n,e,r){return n=Math.pow(n,r),e=Math.pow(e,r)-n,r=1/r,function(i){return Math.pow(n+i*e,r)}}function _v(n){return(n=+n)==1?Ru:function(e,r){return r-e?bv(e,r,n):Du(isNaN(e)?r:e)}}function Ru(n,e){var r=e-n;return r?gv(n,r):Du(isNaN(n)?e:n)}const hl=(function n(e){var r=_v(e);function i(o,s){var a=r((o=Xo(o)).r,(s=Xo(s)).r),l=r(o.g,s.g),c=r(o.b,s.b),u=Ru(o.opacity,s.opacity);return function(h){return o.r=a(h),o.g=l(h),o.b=c(h),o.opacity=u(h),o+""}}return i.gamma=n,i})(1);function ze(n,e){return n=+n,e=+e,function(r){return n*(1-r)+e*r}}var Zo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,go=new RegExp(Zo.source,"g");function yv(n){return function(){return n}}function xv(n){return function(e){return n(e)+""}}function wv(n,e){var r=Zo.lastIndex=go.lastIndex=0,i,o,s,a=-1,l=[],c=[];for(n=n+"",e=e+"";(i=Zo.exec(n))&&(o=go.exec(e));)(s=o.index)>r&&(s=e.slice(r,s),l[a]?l[a]+=s:l[++a]=s),(i=i[0])===(o=o[0])?l[a]?l[a]+=o:l[++a]=o:(l[++a]=null,c.push({i:a,x:ze(i,o)})),r=go.lastIndex;return r<e.length&&(s=e.slice(r),l[a]?l[a]+=s:l[++a]=s),l.length<2?c[0]?xv(c[0].x):yv(e):(e=c.length,function(u){for(var h=0,d;h<e;++h)l[(d=c[h]).i]=d.x(u);return l.join("")})}var pl=180/Math.PI,Jo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ju(n,e,r,i,o,s){var a,l,c;return(a=Math.sqrt(n*n+e*e))&&(n/=a,e/=a),(c=n*r+e*i)&&(r-=n*c,i-=e*c),(l=Math.sqrt(r*r+i*i))&&(r/=l,i/=l,c/=l),n*i<e*r&&(n=-n,e=-e,c=-c,a=-a),{translateX:o,translateY:s,rotate:Math.atan2(e,n)*pl,skewX:Math.atan(c)*pl,scaleX:a,scaleY:l}}var Wr;function Cv(n){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return e.isIdentity?Jo:ju(e.a,e.b,e.c,e.d,e.e,e.f)}function Ev(n){return n==null||(Wr||(Wr=document.createElementNS("http://www.w3.org/2000/svg","g")),Wr.setAttribute("transform",n),!(n=Wr.transform.baseVal.consolidate()))?Jo:(n=n.matrix,ju(n.a,n.b,n.c,n.d,n.e,n.f))}function Lu(n,e,r,i){function o(u){return u.length?u.pop()+" ":""}function s(u,h,d,f,p,m){if(u!==d||h!==f){var b=p.push("translate(",null,e,null,r);m.push({i:b-4,x:ze(u,d)},{i:b-2,x:ze(h,f)})}else(d||f)&&p.push("translate("+d+e+f+r)}function a(u,h,d,f){u!==h?(u-h>180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(o(d)+"rotate(",null,i)-2,x:ze(u,h)})):h&&d.push(o(d)+"rotate("+h+i)}function l(u,h,d,f){u!==h?f.push({i:d.push(o(d)+"skewX(",null,i)-2,x:ze(u,h)}):h&&d.push(o(d)+"skewX("+h+i)}function c(u,h,d,f,p,m){if(u!==d||h!==f){var b=p.push(o(p)+"scale(",null,",",null,")");m.push({i:b-4,x:ze(u,d)},{i:b-2,x:ze(h,f)})}else(d!==1||f!==1)&&p.push(o(p)+"scale("+d+","+f+")")}return function(u,h){var d=[],f=[];return u=n(u),h=n(h),s(u.translateX,u.translateY,h.translateX,h.translateY,d,f),a(u.rotate,h.rotate,d,f),l(u.skewX,h.skewX,d,f),c(u.scaleX,u.scaleY,h.scaleX,h.scaleY,d,f),u=h=null,function(p){for(var m=-1,b=f.length,g;++m<b;)d[(g=f[m]).i]=g.x(p);return d.join("")}}}var kv=Lu(Cv,"px, ","px)","deg)"),Av=Lu(Ev,", ",")",")"),Pv=1e-12;function fl(n){return((n=Math.exp(n))+1/n)/2}function Sv(n){return((n=Math.exp(n))-1/n)/2}function Mv(n){return((n=Math.exp(2*n))-1)/(n+1)}const $v=(function n(e,r,i){function o(s,a){var l=s[0],c=s[1],u=s[2],h=a[0],d=a[1],f=a[2],p=h-l,m=d-c,b=p*p+m*m,g,v;if(b<Pv)v=Math.log(f/u)/e,g=function(E){return[l+E*p,c+E*m,u*Math.exp(e*E*v)]};else{var x=Math.sqrt(b),w=(f*f-u*u+i*b)/(2*u*r*x),_=(f*f-u*u-i*b)/(2*f*r*x),y=Math.log(Math.sqrt(w*w+1)-w),C=Math.log(Math.sqrt(_*_+1)-_);v=(C-y)/e,g=function(E){var k=E*v,M=fl(y),P=u/(r*x)*(M*Mv(e*k+y)-Sv(y));return[l+P*p,c+P*m,u*M/fl(e*k+y)]}}return g.duration=v*1e3*e/Math.SQRT2,g}return o.rho=function(s){var a=Math.max(.001,+s),l=a*a,c=l*l;return n(a,l,c)},o})(Math.SQRT2,2,4);var Tn=0,rr=0,Fn=0,zu=1e3,Mi,ir,$i=0,un=0,Qi=0,gr=typeof performance=="object"&&performance.now?performance:Date,Nu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function Js(){return un||(Nu(Tv),un=gr.now()+Qi)}function Tv(){un=0}function Ti(){this._call=this._time=this._next=null}Ti.prototype=Qs.prototype={constructor:Ti,restart:function(n,e,r){if(typeof n!="function")throw new TypeError("callback is not a function");r=(r==null?Js():+r)+(e==null?0:+e),!this._next&&ir!==this&&(ir?ir._next=this:Mi=this,ir=this),this._call=n,this._time=r,Qo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Qo())}};function Qs(n,e,r){var i=new Ti;return i.restart(n,e,r),i}function Iv(){Js(),++Tn;for(var n=Mi,e;n;)(e=un-n._time)>=0&&n._call.call(null,e),n=n._next;--Tn}function vl(){un=($i=gr.now())+Qi,Tn=rr=0;try{Iv()}finally{Tn=0,Dv(),un=0}}function Ov(){var n=gr.now(),e=n-$i;e>zu&&(Qi-=e,$i=n)}function Dv(){for(var n,e=Mi,r,i=1/0;e;)e._call?(i>e._time&&(i=e._time),n=e,e=e._next):(r=e._next,e._next=null,e=n?n._next=r:Mi=r);ir=n,Qo(i)}function Qo(n){if(!Tn){rr&&(rr=clearTimeout(rr));var e=n-un;e>24?(n<1/0&&(rr=setTimeout(vl,n-gr.now()-Qi)),Fn&&(Fn=clearInterval(Fn))):(Fn||($i=gr.now(),Fn=setInterval(Ov,zu)),Tn=1,Nu(vl))}}function ml(n,e,r){var i=new Ti;return e=e==null?0:+e,i.restart(o=>{i.stop(),n(o+e)},e,r),i}var Rv=Tr("start","end","cancel","interrupt"),jv=[],Fu=0,gl=1,ts=2,fi=3,bl=4,es=5,vi=6;function to(n,e,r,i,o,s){var a=n.__transition;if(!a)n.__transition={};else if(r in a)return;Lv(n,r,{name:e,index:i,group:o,on:Rv,tween:jv,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Fu})}function ta(n,e){var r=Qt(n,e);if(r.state>Fu)throw new Error("too late; already scheduled");return r}function ue(n,e){var r=Qt(n,e);if(r.state>fi)throw new Error("too late; already running");return r}function Qt(n,e){var r=n.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Lv(n,e,r){var i=n.__transition,o;i[e]=r,r.timer=Qs(s,0,r.time);function s(u){r.state=gl,r.timer.restart(a,r.delay,r.time),r.delay<=u&&a(u-r.delay)}function a(u){var h,d,f,p;if(r.state!==gl)return c();for(h in i)if(p=i[h],p.name===r.name){if(p.state===fi)return ml(a);p.state===bl?(p.state=vi,p.timer.stop(),p.on.call("interrupt",n,n.__data__,p.index,p.group),delete i[h]):+h<e&&(p.state=vi,p.timer.stop(),p.on.call("cancel",n,n.__data__,p.index,p.group),delete i[h])}if(ml(function(){r.state===fi&&(r.state=bl,r.timer.restart(l,r.delay,r.time),l(u))}),r.state=ts,r.on.call("start",n,n.__data__,r.index,r.group),r.state===ts){for(r.state=fi,o=new Array(f=r.tween.length),h=0,d=-1;h<f;++h)(p=r.tween[h].value.call(n,n.__data__,r.index,r.group))&&(o[++d]=p);o.length=d+1}}function l(u){for(var h=u<r.duration?r.ease.call(null,u/r.duration):(r.timer.restart(c),r.state=es,1),d=-1,f=o.length;++d<f;)o[d].call(n,h);r.state===es&&(r.on.call("end",n,n.__data__,r.index,r.group),c())}function c(){r.state=vi,r.timer.stop(),delete i[e];for(var u in i)return;delete n.__transition}}function mi(n,e){var r=n.__transition,i,o,s=!0,a;if(r){e=e==null?null:e+"";for(a in r){if((i=r[a]).name!==e){s=!1;continue}o=i.state>ts&&i.state<es,i.state=vi,i.timer.stop(),i.on.call(o?"interrupt":"cancel",n,n.__data__,i.index,i.group),delete r[a]}s&&delete n.__transition}}function zv(n){return this.each(function(){mi(this,n)})}function Nv(n,e){var r,i;return function(){var o=ue(this,n),s=o.tween;if(s!==r){i=r=s;for(var a=0,l=i.length;a<l;++a)if(i[a].name===e){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function Fv(n,e,r){var i,o;if(typeof r!="function")throw new Error;return function(){var s=ue(this,n),a=s.tween;if(a!==i){o=(i=a).slice();for(var l={name:e,value:r},c=0,u=o.length;c<u;++c)if(o[c].name===e){o[c]=l;break}c===u&&o.push(l)}s.tween=o}}function Vv(n,e){var r=this._id;if(n+="",arguments.length<2){for(var i=Qt(this.node(),r).tween,o=0,s=i.length,a;o<s;++o)if((a=i[o]).name===n)return a.value;return null}return this.each((e==null?Nv:Fv)(r,n,e))}function ea(n,e,r){var i=n._id;return n.each(function(){var o=ue(this,i);(o.value||(o.value={}))[e]=r.apply(this,arguments)}),function(o){return Qt(o,i).value[e]}}function Vu(n,e){var r;return(typeof e=="number"?ze:e instanceof cn?hl:(r=cn(e))?(e=r,hl):wv)(n,e)}function Bv(n){return function(){this.removeAttribute(n)}}function Uv(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Hv(n,e,r){var i,o=r+"",s;return function(){var a=this.getAttribute(n);return a===o?null:a===i?s:s=e(i=a,r)}}function qv(n,e,r){var i,o=r+"",s;return function(){var a=this.getAttributeNS(n.space,n.local);return a===o?null:a===i?s:s=e(i=a,r)}}function Kv(n,e,r){var i,o,s;return function(){var a,l=r(this),c;return l==null?void this.removeAttribute(n):(a=this.getAttribute(n),c=l+"",a===c?null:a===i&&c===o?s:(o=c,s=e(i=a,l)))}}function Gv(n,e,r){var i,o,s;return function(){var a,l=r(this),c;return l==null?void this.removeAttributeNS(n.space,n.local):(a=this.getAttributeNS(n.space,n.local),c=l+"",a===c?null:a===i&&c===o?s:(o=c,s=e(i=a,l)))}}function Wv(n,e){var r=Ji(n),i=r==="transform"?Av:Vu;return this.attrTween(n,typeof e=="function"?(r.local?Gv:Kv)(r,i,ea(this,"attr."+n,e)):e==null?(r.local?Uv:Bv)(r):(r.local?qv:Hv)(r,i,e))}function Yv(n,e){return function(r){this.setAttribute(n,e.call(this,r))}}function Xv(n,e){return function(r){this.setAttributeNS(n.space,n.local,e.call(this,r))}}function Zv(n,e){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&Xv(n,s)),r}return o._value=e,o}function Jv(n,e){var r,i;function o(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&Yv(n,s)),r}return o._value=e,o}function Qv(n,e){var r="attr."+n;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var i=Ji(n);return this.tween(r,(i.local?Zv:Jv)(i,e))}function tm(n,e){return function(){ta(this,n).delay=+e.apply(this,arguments)}}function em(n,e){return e=+e,function(){ta(this,n).delay=e}}function nm(n){var e=this._id;return arguments.length?this.each((typeof n=="function"?tm:em)(e,n)):Qt(this.node(),e).delay}function rm(n,e){return function(){ue(this,n).duration=+e.apply(this,arguments)}}function im(n,e){return e=+e,function(){ue(this,n).duration=e}}function om(n){var e=this._id;return arguments.length?this.each((typeof n=="function"?rm:im)(e,n)):Qt(this.node(),e).duration}function sm(n,e){if(typeof e!="function")throw new Error;return function(){ue(this,n).ease=e}}function am(n){var e=this._id;return arguments.length?this.each(sm(e,n)):Qt(this.node(),e).ease}function lm(n,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;ue(this,n).ease=r}}function cm(n){if(typeof n!="function")throw new Error;return this.each(lm(this._id,n))}function um(n){typeof n!="function"&&(n=yu(n));for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o)for(var s=e[o],a=s.length,l=i[o]=[],c,u=0;u<a;++u)(c=s[u])&&n.call(c,c.__data__,u,s)&&l.push(c);return new Pe(i,this._parents,this._name,this._id)}function dm(n){if(n._id!==this._id)throw new Error;for(var e=this._groups,r=n._groups,i=e.length,o=r.length,s=Math.min(i,o),a=new Array(i),l=0;l<s;++l)for(var c=e[l],u=r[l],h=c.length,d=a[l]=new Array(h),f,p=0;p<h;++p)(f=c[p]||u[p])&&(d[p]=f);for(;l<i;++l)a[l]=e[l];return new Pe(a,this._parents,this._name,this._id)}function hm(n){return(n+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function pm(n,e,r){var i,o,s=hm(e)?ta:ue;return function(){var a=s(this,n),l=a.on;l!==i&&(o=(i=l).copy()).on(e,r),a.on=o}}function fm(n,e){var r=this._id;return arguments.length<2?Qt(this.node(),r).on.on(n):this.each(pm(r,n,e))}function vm(n){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==n)return;e&&e.removeChild(this)}}function mm(){return this.on("end.remove",vm(this._id))}function gm(n){var e=this._name,r=this._id;typeof n!="function"&&(n=Ys(n));for(var i=this._groups,o=i.length,s=new Array(o),a=0;a<o;++a)for(var l=i[a],c=l.length,u=s[a]=new Array(c),h,d,f=0;f<c;++f)(h=l[f])&&(d=n.call(h,h.__data__,f,l))&&("__data__"in h&&(d.__data__=h.__data__),u[f]=d,to(u[f],e,r,f,u,Qt(h,r)));return new Pe(s,this._parents,e,r)}function bm(n){var e=this._name,r=this._id;typeof n!="function"&&(n=_u(n));for(var i=this._groups,o=i.length,s=[],a=[],l=0;l<o;++l)for(var c=i[l],u=c.length,h,d=0;d<u;++d)if(h=c[d]){for(var f=n.call(h,h.__data__,d,c),p,m=Qt(h,r),b=0,g=f.length;b<g;++b)(p=f[b])&&to(p,e,r,b,f,m);s.push(f),a.push(h)}return new Pe(s,a,e,r)}var _m=$r.prototype.constructor;function ym(){return new _m(this._groups,this._parents)}function xm(n,e){var r,i,o;return function(){var s=$n(this,n),a=(this.style.removeProperty(n),$n(this,n));return s===a?null:s===r&&a===i?o:o=e(r=s,i=a)}}function Bu(n){return function(){this.style.removeProperty(n)}}function wm(n,e,r){var i,o=r+"",s;return function(){var a=$n(this,n);return a===o?null:a===i?s:s=e(i=a,r)}}function Cm(n,e,r){var i,o,s;return function(){var a=$n(this,n),l=r(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(n),$n(this,n))),a===c?null:a===i&&c===o?s:(o=c,s=e(i=a,l))}}function Em(n,e){var r,i,o,s="style."+e,a="end."+s,l;return function(){var c=ue(this,n),u=c.on,h=c.value[s]==null?l||(l=Bu(e)):void 0;(u!==r||o!==h)&&(i=(r=u).copy()).on(a,o=h),c.on=i}}function km(n,e,r){var i=(n+="")=="transform"?kv:Vu;return e==null?this.styleTween(n,xm(n,i)).on("end.style."+n,Bu(n)):typeof e=="function"?this.styleTween(n,Cm(n,i,ea(this,"style."+n,e))).each(Em(this._id,n)):this.styleTween(n,wm(n,i,e),r).on("end.style."+n,null)}function Am(n,e,r){return function(i){this.style.setProperty(n,e.call(this,i),r)}}function Pm(n,e,r){var i,o;function s(){var a=e.apply(this,arguments);return a!==o&&(i=(o=a)&&Am(n,a,r)),i}return s._value=e,s}function Sm(n,e,r){var i="style."+(n+="");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,Pm(n,e,r??""))}function Mm(n){return function(){this.textContent=n}}function $m(n){return function(){var e=n(this);this.textContent=e??""}}function Tm(n){return this.tween("text",typeof n=="function"?$m(ea(this,"text",n)):Mm(n==null?"":n+""))}function Im(n){return function(e){this.textContent=n.call(this,e)}}function Om(n){var e,r;function i(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&Im(o)),e}return i._value=n,i}function Dm(n){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;return this.tween(e,Om(n))}function Rm(){for(var n=this._name,e=this._id,r=Uu(),i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],l=a.length,c,u=0;u<l;++u)if(c=a[u]){var h=Qt(c,e);to(c,n,r,u,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Pe(i,this._parents,n,r)}function jm(){var n,e,r=this,i=r._id,o=r.size();return new Promise(function(s,a){var l={value:a},c={value:function(){--o===0&&s()}};r.each(function(){var u=ue(this,i),h=u.on;h!==n&&(e=(n=h).copy(),e._.cancel.push(l),e._.interrupt.push(l),e._.end.push(c)),u.on=e}),o===0&&s()})}var Lm=0;function Pe(n,e,r,i){this._groups=n,this._parents=e,this._name=r,this._id=i}function Uu(){return++Lm}var Ze=$r.prototype;Pe.prototype={constructor:Pe,select:gm,selectAll:bm,filter:um,merge:dm,selection:ym,transition:Rm,call:Ze.call,nodes:Ze.nodes,node:Ze.node,size:Ze.size,empty:Ze.empty,each:Ze.each,on:fm,attr:Wv,attrTween:Qv,style:km,styleTween:Sm,text:Tm,textTween:Dm,remove:mm,tween:Vv,delay:nm,duration:om,ease:am,easeVarying:cm,end:jm,[Symbol.iterator]:Ze[Symbol.iterator]};function zm(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var Nm={time:null,delay:0,duration:250,ease:zm};function Fm(n,e){for(var r;!(r=n.__transition)||!(r=r[e]);)if(!(n=n.parentNode))throw new Error(`transition ${e} not found`);return r}function Vm(n){var e,r;n instanceof Pe?(e=n._id,n=n._name):(e=Uu(),(r=Nm).time=Js(),n=n==null?null:n+"");for(var i=this._groups,o=i.length,s=0;s<o;++s)for(var a=i[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&to(c,n,e,u,a,r||Fm(c,e));return new Pe(i,this._parents,n,e)}$r.prototype.interrupt=zv;$r.prototype.transition=Vm;const Yr=n=>()=>n;function Bm(n,{sourceEvent:e,target:r,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function we(n,e,r){this.k=n,this.x=e,this.y=r}we.prototype={constructor:we,scale:function(n){return n===1?this:new we(this.k*n,this.x,this.y)},translate:function(n,e){return n===0&e===0?this:new we(this.k,this.x+this.k*n,this.y+this.k*e)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var na=new we(1,0,0);te.prototype=we.prototype;function te(n){for(;!n.__zoom;)if(!(n=n.parentNode))return na;return n.__zoom}function bo(n){n.stopImmediatePropagation()}function Vn(n){n.preventDefault(),n.stopImmediatePropagation()}function Um(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function Hm(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function _l(){return this.__zoom||na}function qm(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function Km(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gm(n,e,r){var i=n.invertX(e[0][0])-r[0][0],o=n.invertX(e[1][0])-r[1][0],s=n.invertY(e[0][1])-r[0][1],a=n.invertY(e[1][1])-r[1][1];return n.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function Wm(){var n=Um,e=Hm,r=Gm,i=qm,o=Km,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=$v,u=Tr("start","zoom","end"),h,d,f,p=500,m=150,b=0,g=10;function v(A){A.property("__zoom",_l).on("wheel.zoom",k).on("mousedown.zoom",M).on("dblclick.zoom",P).filter(o).on("touchstart.zoom",D).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(A,I,S,F){var V=A.selection?A.selection():A;V.property("__zoom",_l),A!==V?y(A,I,S,F):V.interrupt().each(function(){C(this,arguments).event(F).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},v.scaleBy=function(A,I,S,F){v.scaleTo(A,function(){var V=this.__zoom.k,U=typeof I=="function"?I.apply(this,arguments):I;return V*U},S,F)},v.scaleTo=function(A,I,S,F){v.transform(A,function(){var V=e.apply(this,arguments),U=this.__zoom,q=S==null?_(V):typeof S=="function"?S.apply(this,arguments):S,W=U.invert(q),Z=typeof I=="function"?I.apply(this,arguments):I;return r(w(x(U,Z),q,W),V,a)},S,F)},v.translateBy=function(A,I,S,F){v.transform(A,function(){return r(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof S=="function"?S.apply(this,arguments):S),e.apply(this,arguments),a)},null,F)},v.translateTo=function(A,I,S,F,V){v.transform(A,function(){var U=e.apply(this,arguments),q=this.__zoom,W=F==null?_(U):typeof F=="function"?F.apply(this,arguments):F;return r(na.translate(W[0],W[1]).scale(q.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof S=="function"?-S.apply(this,arguments):-S),U,a)},F,V)};function x(A,I){return I=Math.max(s[0],Math.min(s[1],I)),I===A.k?A:new we(I,A.x,A.y)}function w(A,I,S){var F=I[0]-S[0]*A.k,V=I[1]-S[1]*A.k;return F===A.x&&V===A.y?A:new we(A.k,F,V)}function _(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function y(A,I,S,F){A.on("start.zoom",function(){C(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(F).end()}).tween("zoom",function(){var V=this,U=arguments,q=C(V,U).event(F),W=e.apply(V,U),Z=S==null?_(W):typeof S=="function"?S.apply(V,U):S,pt=Math.max(W[1][0]-W[0][0],W[1][1]-W[0][1]),ht=V.__zoom,Yt=typeof I=="function"?I.apply(V,U):I,pe=c(ht.invert(Z).concat(pt/ht.k),Yt.invert(Z).concat(pt/Yt.k));return function(Xt){if(Xt===1)Xt=Yt;else{var fe=pe(Xt),ho=pt/fe[2];Xt=new we(ho,Z[0]-fe[0]*ho,Z[1]-fe[1]*ho)}q.zoom(null,Xt)}})}function C(A,I,S){return!S&&A.__zooming||new E(A,I)}function E(A,I){this.that=A,this.args=I,this.active=0,this.sourceEvent=null,this.extent=e.apply(A,I),this.taps=0}E.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,I){return this.mouse&&A!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var I=qt(this.that).datum();u.call(A,this.that,new Bm(A,{sourceEvent:this.sourceEvent,target:v,transform:this.that.__zoom,dispatch:u}),I)}};function k(A,...I){if(!n.apply(this,arguments))return;var S=C(this,I).event(A),F=this.__zoom,V=Math.max(s[0],Math.min(s[1],F.k*Math.pow(2,i.apply(this,arguments)))),U=ee(A);if(S.wheel)(S.mouse[0][0]!==U[0]||S.mouse[0][1]!==U[1])&&(S.mouse[1]=F.invert(S.mouse[0]=U)),clearTimeout(S.wheel);else{if(F.k===V)return;S.mouse=[U,F.invert(U)],mi(this),S.start()}Vn(A),S.wheel=setTimeout(q,m),S.zoom("mouse",r(w(x(F,V),S.mouse[0],S.mouse[1]),S.extent,a));function q(){S.wheel=null,S.end()}}function M(A,...I){if(f||!n.apply(this,arguments))return;var S=C(this,I,!0).event(A),F=qt(A.view).on("mousemove.zoom",Z,!0).on("mouseup.zoom",pt,!0),V=ee(A,U),U=A.currentTarget,q=A.clientX,W=A.clientY;$u(A.view),bo(A),S.mouse=[V,this.__zoom.invert(V)],mi(this),S.start();function Z(ht){if(Vn(ht),!S.moved){var Yt=ht.clientX-q,pe=ht.clientY-W;S.moved=Yt*Yt+pe*pe>b}S.event(ht).zoom("mouse",r(w(S.that.__zoom,S.mouse[0]=ee(ht,U),S.mouse[1]),S.extent,a))}function pt(ht){F.on("mousemove.zoom mouseup.zoom",null),Tu(ht.view,S.moved),Vn(ht),S.event(ht).end()}}function P(A,...I){if(n.apply(this,arguments)){var S=this.__zoom,F=ee(A.changedTouches?A.changedTouches[0]:A,this),V=S.invert(F),U=S.k*(A.shiftKey?.5:2),q=r(w(x(S,U),F,V),e.apply(this,I),a);Vn(A),l>0?qt(this).transition().duration(l).call(y,q,F,A):qt(this).call(v.transform,q,F,A)}}function D(A,...I){if(n.apply(this,arguments)){var S=A.touches,F=S.length,V=C(this,I,A.changedTouches.length===F).event(A),U,q,W,Z;for(bo(A),q=0;q<F;++q)W=S[q],Z=ee(W,this),Z=[Z,this.__zoom.invert(Z),W.identifier],V.touch0?!V.touch1&&V.touch0[2]!==Z[2]&&(V.touch1=Z,V.taps=0):(V.touch0=Z,U=!0,V.taps=1+!!h);h&&(h=clearTimeout(h)),U&&(V.taps<2&&(d=Z[0],h=setTimeout(function(){h=null},p)),mi(this),V.start())}}function R(A,...I){if(this.__zooming){var S=C(this,I).event(A),F=A.changedTouches,V=F.length,U,q,W,Z;for(Vn(A),U=0;U<V;++U)q=F[U],W=ee(q,this),S.touch0&&S.touch0[2]===q.identifier?S.touch0[0]=W:S.touch1&&S.touch1[2]===q.identifier&&(S.touch1[0]=W);if(q=S.that.__zoom,S.touch1){var pt=S.touch0[0],ht=S.touch0[1],Yt=S.touch1[0],pe=S.touch1[1],Xt=(Xt=Yt[0]-pt[0])*Xt+(Xt=Yt[1]-pt[1])*Xt,fe=(fe=pe[0]-ht[0])*fe+(fe=pe[1]-ht[1])*fe;q=x(q,Math.sqrt(Xt/fe)),W=[(pt[0]+Yt[0])/2,(pt[1]+Yt[1])/2],Z=[(ht[0]+pe[0])/2,(ht[1]+pe[1])/2]}else if(S.touch0)W=S.touch0[0],Z=S.touch0[1];else return;S.zoom("touch",r(w(q,W,Z),S.extent,a))}}function z(A,...I){if(this.__zooming){var S=C(this,I).event(A),F=A.changedTouches,V=F.length,U,q;for(bo(A),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),U=0;U<V;++U)q=F[U],S.touch0&&S.touch0[2]===q.identifier?delete S.touch0:S.touch1&&S.touch1[2]===q.identifier&&delete S.touch1;if(S.touch1&&!S.touch0&&(S.touch0=S.touch1,delete S.touch1),S.touch0)S.touch0[1]=this.__zoom.invert(S.touch0[0]);else if(S.end(),S.taps===2&&(q=ee(q,this),Math.hypot(d[0]-q[0],d[1]-q[1])<g)){var W=qt(this).on("dblclick.zoom");W&&W.apply(this,arguments)}}}return v.wheelDelta=function(A){return arguments.length?(i=typeof A=="function"?A:Yr(+A),v):i},v.filter=function(A){return arguments.length?(n=typeof A=="function"?A:Yr(!!A),v):n},v.touchable=function(A){return arguments.length?(o=typeof A=="function"?A:Yr(!!A),v):o},v.extent=function(A){return arguments.length?(e=typeof A=="function"?A:Yr([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),v):e},v.scaleExtent=function(A){return arguments.length?(s[0]=+A[0],s[1]=+A[1],v):[s[0],s[1]]},v.translateExtent=function(A){return arguments.length?(a[0][0]=+A[0][0],a[1][0]=+A[1][0],a[0][1]=+A[0][1],a[1][1]=+A[1][1],v):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},v.constrain=function(A){return arguments.length?(r=A,v):r},v.duration=function(A){return arguments.length?(l=+A,v):l},v.interpolate=function(A){return arguments.length?(c=A,v):c},v.on=function(){var A=u.on.apply(u,arguments);return A===u?v:A},v.clickDistance=function(A){return arguments.length?(b=(A=+A)*A,v):Math.sqrt(b)},v.tapDistance=function(A){return arguments.length?(g=+A,v):g},v}function yl(n,e){let r;if(e===void 0)for(const i of n)i!=null&&(r<i||r===void 0&&i>=i)&&(r=i);else{let i=-1;for(let o of n)(o=e(o,++i,n))!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}return r}function xl(n,e){let r;if(e===void 0)for(const i of n)i!=null&&(r>i||r===void 0&&i>=i)&&(r=i);else{let i=-1;for(let o of n)(o=e(o,++i,n))!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}return r}function Ym(n,e){let r=0;for(let i of n)(i=+i)&&(r+=i);return r}var Xm=typeof global=="object"&&global&&global.Object===Object&&global,Zm=typeof self=="object"&&self&&self.Object===Object&&self,Hu=Xm||Zm||Function("return this")(),Ii=Hu.Symbol,qu=Object.prototype,Jm=qu.hasOwnProperty,Qm=qu.toString,Bn=Ii?Ii.toStringTag:void 0;function tg(n){var e=Jm.call(n,Bn),r=n[Bn];try{n[Bn]=void 0;var i=!0}catch{}var o=Qm.call(n);return i&&(e?n[Bn]=r:delete n[Bn]),o}var eg=Object.prototype,ng=eg.toString;function rg(n){return ng.call(n)}var ig="[object Null]",og="[object Undefined]",wl=Ii?Ii.toStringTag:void 0;function sg(n){return n==null?n===void 0?og:ig:wl&&wl in Object(n)?tg(n):rg(n)}function ag(n){return n!=null&&typeof n=="object"}var lg="[object Symbol]";function cg(n){return typeof n=="symbol"||ag(n)&&sg(n)==lg}var ug=/\s/;function dg(n){for(var e=n.length;e--&&ug.test(n.charAt(e)););return e}var hg=/^\s+/;function pg(n){return n&&n.slice(0,dg(n)+1).replace(hg,"")}function Oi(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Cl=NaN,fg=/^[-+]0x[0-9a-f]+$/i,vg=/^0b[01]+$/i,mg=/^0o[0-7]+$/i,gg=parseInt;function El(n){if(typeof n=="number")return n;if(cg(n))return Cl;if(Oi(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Oi(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=pg(n);var r=vg.test(n);return r||mg.test(n)?gg(n.slice(2),r?2:8):fg.test(n)?Cl:+n}var _o=function(){return Hu.Date.now()},bg="Expected a function",_g=Math.max,yg=Math.min;function Ku(n,e,r){var i,o,s,a,l,c,u=0,h=!1,d=!1,f=!0;if(typeof n!="function")throw new TypeError(bg);e=El(e)||0,Oi(r)&&(h=!!r.leading,d="maxWait"in r,s=d?_g(El(r.maxWait)||0,e):s,f="trailing"in r?!!r.trailing:f);function p(C){var E=i,k=o;return i=o=void 0,u=C,a=n.apply(k,E),a}function m(C){return u=C,l=setTimeout(v,e),h?p(C):a}function b(C){var E=C-c,k=C-u,M=e-E;return d?yg(M,s-k):M}function g(C){var E=C-c,k=C-u;return c===void 0||E>=e||E<0||d&&k>=s}function v(){var C=_o();if(g(C))return x(C);l=setTimeout(v,b(C))}function x(C){return l=void 0,f&&i?p(C):(i=o=void 0,a)}function w(){l!==void 0&&clearTimeout(l),u=0,i=c=o=l=void 0}function _(){return l===void 0?a:x(_o())}function y(){var C=_o(),E=g(C);if(i=arguments,o=this,c=C,E){if(l===void 0)return m(c);if(d)return clearTimeout(l),l=setTimeout(v,e),p(c)}return l===void 0&&(l=setTimeout(v,e)),a}return y.cancel=w,y.flush=_,y}var xg="Expected a function";function wg(n,e,r){var i=!0,o=!0;if(typeof n!="function")throw new TypeError(xg);return Oi(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Ku(n,e,{leading:i,maxWait:e,trailing:o})}var sn=Object.freeze({Linear:Object.freeze({None:function(n){return n},In:function(n){return n},Out:function(n){return n},InOut:function(n){return n}}),Quadratic:Object.freeze({In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}}),Cubic:Object.freeze({In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}}),Quartic:Object.freeze({In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}}),Quintic:Object.freeze({In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}}),Sinusoidal:Object.freeze({In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}}),Exponential:Object.freeze({In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}}),Circular:Object.freeze({In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}}),Elastic:Object.freeze({In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(n){var e=1.70158;return n===1?1:n*n*((e+1)*n-e)},Out:function(n){var e=1.70158;return n===0?0:--n*n*((e+1)*n+e)+1},InOut:function(n){var e=2.5949095;return(n*=2)<1?.5*(n*n*((e+1)*n-e)):.5*((n-=2)*n*((e+1)*n+e)+2)}}),Bounce:Object.freeze({In:function(n){return 1-sn.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?sn.Bounce.In(n*2)*.5:sn.Bounce.Out(n*2-1)*.5+.5}}),generatePow:function(n){return n===void 0&&(n=4),n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(e){return Math.pow(e,n)},Out:function(e){return 1-Math.pow(1-e,n)},InOut:function(e){return e<.5?Math.pow(e*2,n)/2:(1-Math.pow(2-e*2,n))/2+.5}}}}),or=function(){return performance.now()},Gu=(function(){function n(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return n.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(r){return e._tweens[r]})},n.prototype.removeAll=function(){this._tweens={}},n.prototype.add=function(){for(var e,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var o=0,s=r;o<s.length;o++){var a=s[o];(e=a._group)===null||e===void 0||e.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},n.prototype.remove=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];for(var i=0,o=e;i<o.length;i++){var s=o[i];s._group=void 0,delete this._tweens[s.getId()],delete this._tweensAddedDuringUpdate[s.getId()]}},n.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},n.prototype.update=function(e,r){e===void 0&&(e=or()),r===void 0&&(r=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var s=this._tweens[i[o]],a=!r;s&&s.update(e,a)===!1&&!r&&this.remove(s)}i=Object.keys(this._tweensAddedDuringUpdate)}},n})(),ns={Linear:function(n,e){var r=n.length-1,i=r*e,o=Math.floor(i),s=ns.Utils.Linear;return e<0?s(n[0],n[1],i):e>1?s(n[r],n[r-1],r-i):s(n[o],n[o+1>r?r:o+1],i-o)},Utils:{Linear:function(n,e,r){return(e-n)*r+n}}},Wu=(function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n})(),rs=new Gu,kl=(function(){function n(e,r){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=sn.Linear.None,this._interpolationFunction=ns.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Wu.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof r=="object"?(this._group=r,r.add(this)):r===!0&&(this._group=rs,rs.add(this))}return n.prototype.getId=function(){return this._id},n.prototype.isPlaying=function(){return this._isPlaying},n.prototype.isPaused=function(){return this._isPaused},n.prototype.getDuration=function(){return this._duration},n.prototype.to=function(e,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},n.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},n.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},n.prototype.start=function(e,r){if(e===void 0&&(e=or()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var s in this._valuesEnd)o[s]=this._valuesEnd[s];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},n.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},n.prototype._setupProperties=function(e,r,i,o,s){for(var a in i){var l=e[a],c=Array.isArray(l),u=c?"array":typeof l,h=!c&&Array.isArray(i[a]);if(!(u==="undefined"||u==="function")){if(h){var d=i[a];if(d.length===0)continue;for(var f=[l],p=0,m=d.length;p<m;p+=1){var b=this._handleRelativeValue(l,d[p]);if(isNaN(b)){h=!1,console.warn("Found invalid interpolation list. Skipping.");break}f.push(b)}h&&(i[a]=f)}if((u==="object"||c)&&l&&!h){r[a]=c?[]:{};var g=l;for(var v in g)r[a][v]=g[v];o[a]=c?[]:{};var d=i[a];if(!this._isDynamic){var x={};for(var v in d)x[v]=d[v];i[a]=d=x}this._setupProperties(g,r[a],d,o[a],s)}else(typeof r[a]>"u"||s)&&(r[a]=l),c||(r[a]*=1),h?o[a]=i[a].slice().reverse():o[a]=r[a]||0}}},n.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},n.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},n.prototype.pause=function(e){return e===void 0&&(e=or()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},n.prototype.resume=function(e){return e===void 0&&(e=or()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},n.prototype.stopChainedTweens=function(){for(var e=0,r=this._chainedTweens.length;e<r;e++)this._chainedTweens[e].stop();return this},n.prototype.group=function(e){return e?(e.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},n.prototype.remove=function(){var e;return(e=this._group)===null||e===void 0||e.remove(this),this},n.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},n.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},n.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},n.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},n.prototype.easing=function(e){return e===void 0&&(e=sn.Linear.None),this._easingFunction=e,this},n.prototype.interpolation=function(e){return e===void 0&&(e=ns.Linear),this._interpolationFunction=e,this},n.prototype.chain=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return this._chainedTweens=e,this},n.prototype.onStart=function(e){return this._onStartCallback=e,this},n.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},n.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},n.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},n.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},n.prototype.onStop=function(e){return this._onStopCallback=e,this},n.prototype.update=function(e,r){var i=this,o;if(e===void 0&&(e=or()),r===void 0&&(r=n.autoStartOnUpdate),this._isPaused)return!0;var s;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(e,!0);else return!1;if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=e-this._startTime,l=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*l,u=function(){if(i._duration===0||a>c)return 1;var b=Math.trunc(a/l),g=a-b*l,v=Math.min(g/i._duration,1);return v===0&&a===i._duration?1:v},h=u(),d=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||a>=this._duration)if(this._repeat>0){var f=Math.min(Math.trunc((a-this._duration)/l)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=f);for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=l*f,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var p=0,m=this._chainedTweens.length;p<m;p++)this._chainedTweens[p].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},n.prototype._updateProperties=function(e,r,i,o){for(var s in i)if(r[s]!==void 0){var a=r[s]||0,l=i[s],c=Array.isArray(e[s]),u=Array.isArray(l),h=!c&&u;h?e[s]=this._interpolationFunction(l,o):typeof l=="object"&&l?this._updateProperties(e[s],a,l,o):(l=this._handleRelativeValue(a,l),typeof l=="number"&&(e[s]=a+(l-a)*o))}},n.prototype._handleRelativeValue=function(e,r){return typeof r!="string"?r:r.charAt(0)==="+"||r.charAt(0)==="-"?e+parseFloat(r):parseFloat(r)},n.prototype._swapEndStartRepeatValues=function(e){var r=this._valuesStartRepeat[e],i=this._valuesEnd[e];typeof i=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(i):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=r},n.autoStartOnUpdate=!1,n})();Wu.nextId;var se=rs;se.getAll.bind(se);se.removeAll.bind(se);se.add.bind(se);se.remove.bind(se);se.update.bind(se);function Al(n,e){(e==null||e>n.length)&&(e=n.length);for(var r=0,i=Array(e);r<e;r++)i[r]=n[r];return i}function Cg(n){if(Array.isArray(n))return n}function Eg(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function kg(n,e,r){return Object.defineProperty(n,"prototype",{writable:!1}),n}function Ag(n,e){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var i,o,s,a,l=[],c=!0,u=!1;try{if(s=(r=r.call(n)).next,e!==0)for(;!(c=(i=s.call(r)).done)&&(l.push(i.value),l.length!==e);c=!0);}catch(h){u=!0,o=h}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}function Pg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sg(n,e){return Cg(n)||Ag(n,e)||Mg(n,e)||Pg()}function Mg(n,e){if(n){if(typeof n=="string")return Al(n,e);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Al(n,e):void 0}}var $g=kg(function n(e,r){var i=r.default,o=i===void 0?null:i,s=r.triggerUpdate,a=s===void 0?!0:s,l=r.onChange,c=l===void 0?function(u,h){}:l;Eg(this,n),this.name=e,this.defaultVal=o,this.triggerUpdate=a,this.onChange=c});function ra(n){var e=n.stateInit,r=e===void 0?function(){return{}}:e,i=n.props,o=i===void 0?{}:i,s=n.methods,a=s===void 0?{}:s,l=n.aliases,c=l===void 0?{}:l,u=n.init,h=u===void 0?function(){}:u,d=n.update,f=d===void 0?function(){}:d,p=Object.keys(o).map(function(m){return new $g(m,o[m])});return function m(){for(var b=arguments.length,g=new Array(b),v=0;v<b;v++)g[v]=arguments[v];var x=!!(this instanceof m&&this.constructor),w=x?g.shift():void 0,_=g[0],y=_===void 0?{}:_,C=Object.assign({},r instanceof Function?r(y):r,{initialised:!1}),E={};function k(D){return M(D,y),P(),k}var M=function(R,z){h.call(k,R,C,z),C.initialised=!0},P=Ku(function(){C.initialised&&(f.call(k,C,E),E={})},1);return p.forEach(function(D){k[D.name]=R(D);function R(z){var A=z.name,I=z.triggerUpdate,S=I===void 0?!1:I,F=z.onChange,V=F===void 0?function(W,Z){}:F,U=z.defaultVal,q=U===void 0?null:U;return function(W){var Z=C[A];if(!arguments.length)return Z;var pt=W===void 0?q:W;return C[A]=pt,V.call(k,pt,C,Z),!E.hasOwnProperty(A)&&(E[A]=Z),S&&P(),k}}}),Object.keys(a).forEach(function(D){k[D]=function(){for(var R,z=arguments.length,A=new Array(z),I=0;I<z;I++)A[I]=arguments[I];return(R=a[D]).call.apply(R,[k,C].concat(A))}}),Object.entries(c).forEach(function(D){var R=Sg(D,2),z=R[0],A=R[1];return k[z]=k[A]}),k.resetProps=function(){return p.forEach(function(D){k[D.name](D.defaultVal)}),k},k.resetProps(),C._rerender=P,x&&w&&k(w),k}}var Q=(function(n){return typeof n=="function"?n:typeof n=="string"?function(e){return e[n]}:function(e){return n}});function Di(n){"@babel/helpers - typeof";return Di=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Di(n)}var Tg=/^\s+/,Ig=/\s+$/;function N(n,e){if(n=n||"",e=e||{},n instanceof N)return n;if(!(this instanceof N))return new N(n,e);var r=Og(n);this._originalInput=n,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}N.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),r,i,o,s,a,l;return r=e.r/255,i=e.g/255,o=e.b/255,r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),i<=.03928?a=i/12.92:a=Math.pow((i+.055)/1.055,2.4),o<=.03928?l=o/12.92:l=Math.pow((o+.055)/1.055,2.4),.2126*s+.7152*a+.0722*l},setAlpha:function(e){return this._a=Yu(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=Sl(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=Sl(this._r,this._g,this._b),r=Math.round(e.h*360),i=Math.round(e.s*100),o=Math.round(e.v*100);return this._a==1?"hsv("+r+", "+i+"%, "+o+"%)":"hsva("+r+", "+i+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var e=Pl(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=Pl(this._r,this._g,this._b),r=Math.round(e.h*360),i=Math.round(e.s*100),o=Math.round(e.l*100);return this._a==1?"hsl("+r+", "+i+"%, "+o+"%)":"hsla("+r+", "+i+"%, "+o+"%, "+this._roundA+")"},toHex:function(e){return Ml(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return Lg(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(ot(this._r,255)*100)+"%",g:Math.round(ot(this._g,255)*100)+"%",b:Math.round(ot(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(ot(this._r,255)*100)+"%, "+Math.round(ot(this._g,255)*100)+"%, "+Math.round(ot(this._b,255)*100)+"%)":"rgba("+Math.round(ot(this._r,255)*100)+"%, "+Math.round(ot(this._g,255)*100)+"%, "+Math.round(ot(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Yg[Ml(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var r="#"+$l(this._r,this._g,this._b,this._a),i=r,o=this._gradientType?"GradientType = 1, ":"";if(e){var s=N(e);i="#"+$l(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+r+",endColorstr="+i+")"},toString:function(e){var r=!!e;e=e||this._format;var i=!1,o=this._a<1&&this._a>=0,s=!r&&o&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return s?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return N(this.toString())},_applyModification:function(e,r){var i=e.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(Vg,arguments)},brighten:function(){return this._applyModification(Bg,arguments)},darken:function(){return this._applyModification(Ug,arguments)},desaturate:function(){return this._applyModification(zg,arguments)},saturate:function(){return this._applyModification(Ng,arguments)},greyscale:function(){return this._applyModification(Fg,arguments)},spin:function(){return this._applyModification(Hg,arguments)},_applyCombination:function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(Gg,arguments)},complement:function(){return this._applyCombination(qg,arguments)},monochromatic:function(){return this._applyCombination(Wg,arguments)},splitcomplement:function(){return this._applyCombination(Kg,arguments)},triad:function(){return this._applyCombination(Tl,[3])},tetrad:function(){return this._applyCombination(Tl,[4])}};N.fromRatio=function(n,e){if(Di(n)=="object"){var r={};for(var i in n)n.hasOwnProperty(i)&&(i==="a"?r[i]=n[i]:r[i]=sr(n[i]));n=r}return N(n,e)};function Og(n){var e={r:0,g:0,b:0},r=1,i=null,o=null,s=null,a=!1,l=!1;return typeof n=="string"&&(n=Qg(n)),Di(n)=="object"&&(ve(n.r)&&ve(n.g)&&ve(n.b)?(e=Dg(n.r,n.g,n.b),a=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):ve(n.h)&&ve(n.s)&&ve(n.v)?(i=sr(n.s),o=sr(n.v),e=jg(n.h,i,o),a=!0,l="hsv"):ve(n.h)&&ve(n.s)&&ve(n.l)&&(i=sr(n.s),s=sr(n.l),e=Rg(n.h,i,s),a=!0,l="hsl"),n.hasOwnProperty("a")&&(r=n.a)),r=Yu(r),{ok:a,format:n.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}function Dg(n,e,r){return{r:ot(n,255)*255,g:ot(e,255)*255,b:ot(r,255)*255}}function Pl(n,e,r){n=ot(n,255),e=ot(e,255),r=ot(r,255);var i=Math.max(n,e,r),o=Math.min(n,e,r),s,a,l=(i+o)/2;if(i==o)s=a=0;else{var c=i-o;switch(a=l>.5?c/(2-i-o):c/(i+o),i){case n:s=(e-r)/c+(e<r?6:0);break;case e:s=(r-n)/c+2;break;case r:s=(n-e)/c+4;break}s/=6}return{h:s,s:a,l}}function Rg(n,e,r){var i,o,s;n=ot(n,360),e=ot(e,100),r=ot(r,100);function a(u,h,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?u+(h-u)*6*d:d<1/2?h:d<2/3?u+(h-u)*(2/3-d)*6:u}if(e===0)i=o=s=r;else{var l=r<.5?r*(1+e):r+e-r*e,c=2*r-l;i=a(c,l,n+1/3),o=a(c,l,n),s=a(c,l,n-1/3)}return{r:i*255,g:o*255,b:s*255}}function Sl(n,e,r){n=ot(n,255),e=ot(e,255),r=ot(r,255);var i=Math.max(n,e,r),o=Math.min(n,e,r),s,a,l=i,c=i-o;if(a=i===0?0:c/i,i==o)s=0;else{switch(i){case n:s=(e-r)/c+(e<r?6:0);break;case e:s=(r-n)/c+2;break;case r:s=(n-e)/c+4;break}s/=6}return{h:s,s:a,v:l}}function jg(n,e,r){n=ot(n,360)*6,e=ot(e,100),r=ot(r,100);var i=Math.floor(n),o=n-i,s=r*(1-e),a=r*(1-o*e),l=r*(1-(1-o)*e),c=i%6,u=[r,a,s,s,l,r][c],h=[l,r,r,a,s,s][c],d=[s,s,l,r,r,a][c];return{r:u*255,g:h*255,b:d*255}}function Ml(n,e,r,i){var o=[Jt(Math.round(n).toString(16)),Jt(Math.round(e).toString(16)),Jt(Math.round(r).toString(16))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function Lg(n,e,r,i,o){var s=[Jt(Math.round(n).toString(16)),Jt(Math.round(e).toString(16)),Jt(Math.round(r).toString(16)),Jt(Xu(i))];return o&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function $l(n,e,r,i){var o=[Jt(Xu(i)),Jt(Math.round(n).toString(16)),Jt(Math.round(e).toString(16)),Jt(Math.round(r).toString(16))];return o.join("")}N.equals=function(n,e){return!n||!e?!1:N(n).toRgbString()==N(e).toRgbString()};N.random=function(){return N.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function zg(n,e){e=e===0?0:e||10;var r=N(n).toHsl();return r.s-=e/100,r.s=eo(r.s),N(r)}function Ng(n,e){e=e===0?0:e||10;var r=N(n).toHsl();return r.s+=e/100,r.s=eo(r.s),N(r)}function Fg(n){return N(n).desaturate(100)}function Vg(n,e){e=e===0?0:e||10;var r=N(n).toHsl();return r.l+=e/100,r.l=eo(r.l),N(r)}function Bg(n,e){e=e===0?0:e||10;var r=N(n).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),N(r)}function Ug(n,e){e=e===0?0:e||10;var r=N(n).toHsl();return r.l-=e/100,r.l=eo(r.l),N(r)}function Hg(n,e){var r=N(n).toHsl(),i=(r.h+e)%360;return r.h=i<0?360+i:i,N(r)}function qg(n){var e=N(n).toHsl();return e.h=(e.h+180)%360,N(e)}function Tl(n,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=N(n).toHsl(),i=[N(n)],o=360/e,s=1;s<e;s++)i.push(N({h:(r.h+s*o)%360,s:r.s,l:r.l}));return i}function Kg(n){var e=N(n).toHsl(),r=e.h;return[N(n),N({h:(r+72)%360,s:e.s,l:e.l}),N({h:(r+216)%360,s:e.s,l:e.l})]}function Gg(n,e,r){e=e||6,r=r||30;var i=N(n).toHsl(),o=360/r,s=[N(n)];for(i.h=(i.h-(o*e>>1)+720)%360;--e;)i.h=(i.h+o)%360,s.push(N(i));return s}function Wg(n,e){e=e||6;for(var r=N(n).toHsv(),i=r.h,o=r.s,s=r.v,a=[],l=1/e;e--;)a.push(N({h:i,s:o,v:s})),s=(s+l)%1;return a}N.mix=function(n,e,r){r=r===0?0:r||50;var i=N(n).toRgb(),o=N(e).toRgb(),s=r/100,a={r:(o.r-i.r)*s+i.r,g:(o.g-i.g)*s+i.g,b:(o.b-i.b)*s+i.b,a:(o.a-i.a)*s+i.a};return N(a)};N.readability=function(n,e){var r=N(n),i=N(e);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};N.isReadable=function(n,e,r){var i=N.readability(n,e),o,s;switch(s=!1,o=tb(r),o.level+o.size){case"AAsmall":case"AAAlarge":s=i>=4.5;break;case"AAlarge":s=i>=3;break;case"AAAsmall":s=i>=7;break}return s};N.mostReadable=function(n,e,r){var i=null,o=0,s,a,l,c;r=r||{},a=r.includeFallbackColors,l=r.level,c=r.size;for(var u=0;u<e.length;u++)s=N.readability(n,e[u]),s>o&&(o=s,i=N(e[u]));return N.isReadable(n,i,{level:l,size:c})||!a?i:(r.includeFallbackColors=!1,N.mostReadable(n,["#fff","#000"],r))};var is=N.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Yg=N.hexNames=Xg(is);function Xg(n){var e={};for(var r in n)n.hasOwnProperty(r)&&(e[n[r]]=r);return e}function Yu(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function ot(n,e){Zg(n)&&(n="100%");var r=Jg(n);return n=Math.min(e,Math.max(0,parseFloat(n))),r&&(n=parseInt(n*e,10)/100),Math.abs(n-e)<1e-6?1:n%e/parseFloat(e)}function eo(n){return Math.min(1,Math.max(0,n))}function Lt(n){return parseInt(n,16)}function Zg(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function Jg(n){return typeof n=="string"&&n.indexOf("%")!=-1}function Jt(n){return n.length==1?"0"+n:""+n}function sr(n){return n<=1&&(n=n*100+"%"),n}function Xu(n){return Math.round(parseFloat(n)*255).toString(16)}function Il(n){return Lt(n)/255}var Zt=(function(){var n="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+n+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function ve(n){return!!Zt.CSS_UNIT.exec(n)}function Qg(n){n=n.replace(Tg,"").replace(Ig,"").toLowerCase();var e=!1;if(is[n])n=is[n],e=!0;else if(n=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Zt.rgb.exec(n))?{r:r[1],g:r[2],b:r[3]}:(r=Zt.rgba.exec(n))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Zt.hsl.exec(n))?{h:r[1],s:r[2],l:r[3]}:(r=Zt.hsla.exec(n))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Zt.hsv.exec(n))?{h:r[1],s:r[2],v:r[3]}:(r=Zt.hsva.exec(n))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Zt.hex8.exec(n))?{r:Lt(r[1]),g:Lt(r[2]),b:Lt(r[3]),a:Il(r[4]),format:e?"name":"hex8"}:(r=Zt.hex6.exec(n))?{r:Lt(r[1]),g:Lt(r[2]),b:Lt(r[3]),format:e?"name":"hex"}:(r=Zt.hex4.exec(n))?{r:Lt(r[1]+""+r[1]),g:Lt(r[2]+""+r[2]),b:Lt(r[3]+""+r[3]),a:Il(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=Zt.hex3.exec(n))?{r:Lt(r[1]+""+r[1]),g:Lt(r[2]+""+r[2]),b:Lt(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function tb(n){var e,r;return n=n||{level:"AA",size:"small"},e=(n.level||"AA").toUpperCase(),r=(n.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}function os(n,e){(e==null||e>n.length)&&(e=n.length);for(var r=0,i=Array(e);r<e;r++)i[r]=n[r];return i}function eb(n){if(Array.isArray(n))return os(n)}function Zu(n,e,r){if(typeof n=="function"?n===e:n.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}function nb(n,e){if(e.has(n))throw new TypeError("Cannot initialize the same private elements twice on an object")}function rb(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Bt(n,e){return n.get(Zu(n,e))}function Ol(n,e,r){nb(n,e),e.set(n,r)}function Dl(n,e,r){return n.set(Zu(n,e),r),r}function ib(n,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,ub(i.key),i)}}function ob(n,e,r){return e&&ib(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function sb(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function ab(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lb(n){return eb(n)||sb(n)||db(n)||ab()}function cb(n,e){if(typeof n!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var i=r.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function ub(n){var e=cb(n,"string");return typeof e=="symbol"?e:e+""}function db(n,e){if(n){if(typeof n=="string")return os(n,e);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?os(n,e):void 0}}var hb=123,pb=function(e){return"#".concat(Math.min(e,Math.pow(2,24)).toString(16).padStart(6,"0"))},Ju=function(e,r,i){return(e<<16)+(r<<8)+i},fb=function(e){var r=N(e).toRgb(),i=r.r,o=r.g,s=r.b;return Ju(i,o,s)},Rl=function(e,r){return e*hb%Math.pow(2,r)},Je=new WeakMap,me=new WeakMap,vb=(function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6;rb(this,n),Ol(this,Je,void 0),Ol(this,me,void 0),Dl(me,this,e),this.reset()}return ob(n,[{key:"reset",value:function(){Dl(Je,this,["__reserved for background__"])}},{key:"register",value:function(r){if(Bt(Je,this).length>=Math.pow(2,24-Bt(me,this)))return null;var i=Bt(Je,this).length,o=Rl(i,Bt(me,this)),s=pb(i+(o<<24-Bt(me,this)));return Bt(Je,this).push(r),s}},{key:"lookup",value:function(r){if(!r)return null;var i=typeof r=="string"?fb(r):Ju.apply(void 0,lb(r));if(!i)return null;var o=i&Math.pow(2,24-Bt(me,this))-1,s=i>>24-Bt(me,this)&Math.pow(2,Bt(me,this))-1;return Rl(o,Bt(me,this))!==s||o>=Bt(Je,this).length?null:Bt(Je,this)[o]}}])})(),Or,st,Qu,td,Ne,jl,ed,nd,yo,gi,cr,rd,ia,ss,as,Ri={},ji=[],mb=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,no=Array.isArray;function re(n,e){for(var r in e)n[r]=e[r];return n}function oa(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function gb(n,e,r){var i,o,s,a={};for(s in e)s=="key"?i=e[s]:s=="ref"?o=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?Or.call(arguments,2):r),typeof n=="function"&&n.defaultProps!=null)for(s in n.defaultProps)a[s]===void 0&&(a[s]=n.defaultProps[s]);return ur(n,a,i,o,null)}function ur(n,e,r,i,o){var s={type:n,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Qu,__i:-1,__u:0};return o==null&&st.vnode!=null&&st.vnode(s),s}function ro(n){return n.children}function bi(n,e){this.props=n,this.context=e}function In(n,e){if(e==null)return n.__?In(n.__,n.__i+1):null;for(var r;e<n.__k.length;e++)if((r=n.__k[e])!=null&&r.__e!=null)return r.__e;return typeof n.type=="function"?In(n):null}function bb(n){if(n.__P&&n.__d){var e=n.__v,r=e.__e,i=[],o=[],s=re({},e);s.__v=e.__v+1,st.vnode&&st.vnode(s),sa(n.__P,s,e,n.__n,n.__P.namespaceURI,32&e.__u?[r]:null,i,r??In(e),!!(32&e.__u),o),s.__v=e.__v,s.__.__k[s.__i]=s,ad(i,s,o),e.__e=e.__=null,s.__e!=r&&id(s)}}function id(n){if((n=n.__)!=null&&n.__c!=null)return n.__e=n.__c.base=null,n.__k.some(function(e){if(e!=null&&e.__e!=null)return n.__e=n.__c.base=e.__e}),id(n)}function Ll(n){(!n.__d&&(n.__d=!0)&&Ne.push(n)&&!Li.__r++||jl!=st.debounceRendering)&&((jl=st.debounceRendering)||ed)(Li)}function Li(){try{for(var n,e=1;Ne.length;)Ne.length>e&&Ne.sort(nd),n=Ne.shift(),e=Ne.length,bb(n)}finally{Ne.length=Li.__r=0}}function od(n,e,r,i,o,s,a,l,c,u,h){var d,f,p,m,b,g,v,x=i&&i.__k||ji,w=e.length;for(c=_b(r,e,x,c,w),d=0;d<w;d++)(p=r.__k[d])!=null&&(f=p.__i!=-1&&x[p.__i]||Ri,p.__i=d,g=sa(n,p,f,o,s,a,l,c,u,h),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&aa(f.ref,null,p),h.push(p.ref,p.__c||m,p)),b==null&&m!=null&&(b=m),(v=!!(4&p.__u))||f.__k===p.__k?(c=sd(p,c,n,v),v&&f.__e&&(f.__e=null)):typeof p.type=="function"&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return r.__e=b,c}function _b(n,e,r,i,o){var s,a,l,c,u,h=r.length,d=h,f=0;for(n.__k=new Array(o),s=0;s<o;s++)(a=e[s])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=n.__k[s]=ur(null,a,null,null,null):no(a)?a=n.__k[s]=ur(ro,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=n.__k[s]=ur(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):n.__k[s]=a,c=s+f,a.__=n,a.__b=n.__b+1,l=null,(u=a.__i=yb(a,r,c,d))!=-1&&(d--,(l=r[u])&&(l.__u|=2)),l==null||l.__v==null?(u==-1&&(o>h?f--:o<h&&f++),typeof a.type!="function"&&(a.__u|=4)):u!=c&&(u==c-1?f--:u==c+1?f++:(u>c?f--:f++,a.__u|=4))):n.__k[s]=null;if(d)for(s=0;s<h;s++)(l=r[s])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=In(l)),cd(l,l));return i}function sd(n,e,r,i){var o,s;if(typeof n.type=="function"){for(o=n.__k,s=0;o&&s<o.length;s++)o[s]&&(o[s].__=n,e=sd(o[s],e,r,i));return e}n.__e!=e&&(i&&(e&&n.type&&!e.parentNode&&(e=In(n)),r.insertBefore(n.__e,e||null)),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function yb(n,e,r,i){var o,s,a,l=n.key,c=n.type,u=e[r],h=u!=null&&(2&u.__u)==0;if(u===null&&l==null||h&&l==u.key&&c==u.type)return r;if(i>(h?1:0)){for(o=r-1,s=r+1;o>=0||s<e.length;)if((u=e[a=o>=0?o--:s++])!=null&&(2&u.__u)==0&&l==u.key&&c==u.type)return a}return-1}function zl(n,e,r){e[0]=="-"?n.setProperty(e,r??""):n[e]=r==null?"":typeof r!="number"||mb.test(e)?r:r+"px"}function Xr(n,e,r,i,o){var s,a;t:if(e=="style")if(typeof r=="string")n.style.cssText=r;else{if(typeof i=="string"&&(n.style.cssText=i=""),i)for(e in i)r&&e in r||zl(n.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||zl(n.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(rd,"$1")),a=e.toLowerCase(),e=a in n||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),n.l||(n.l={}),n.l[e+s]=r,r?i?r[cr]=i[cr]:(r[cr]=ia,n.addEventListener(e,s?as:ss,s)):n.removeEventListener(e,s?as:ss,s);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in n)try{n[e]=r??"";break t}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?n.removeAttribute(e):n.setAttribute(e,e=="popover"&&r==1?"":r))}}function Nl(n){return function(e){if(this.l){var r=this.l[e.type+n];if(e[gi]==null)e[gi]=ia++;else if(e[gi]<r[cr])return;return r(st.event?st.event(e):e)}}}function sa(n,e,r,i,o,s,a,l,c,u){var h,d,f,p,m,b,g,v,x,w,_,y,C,E,k,M=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),s=[l=e.__e=r.__e]),(h=st.__b)&&h(e);t:if(typeof M=="function")try{if(v=e.props,x=M.prototype&&M.prototype.render,w=(h=M.contextType)&&i[h.__c],_=h?w?w.props.value:h.__:i,r.__c?g=(d=e.__c=r.__c).__=d.__E:(x?e.__c=d=new M(v,_):(e.__c=d=new bi(v,_),d.constructor=M,d.render=wb),w&&w.sub(d),d.state||(d.state={}),d.__n=i,f=d.__d=!0,d.__h=[],d._sb=[]),x&&d.__s==null&&(d.__s=d.state),x&&M.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=re({},d.__s)),re(d.__s,M.getDerivedStateFromProps(v,d.__s))),p=d.props,m=d.state,d.__v=e,f)x&&M.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),x&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(x&&M.getDerivedStateFromProps==null&&v!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,_),e.__v==r.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,_)===!1){e.__v!=r.__v&&(d.props=v,d.state=d.__s,d.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(P){P&&(P.__=e)}),ji.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break t}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,_),x&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,m,b)})}if(d.context=_,d.props=v,d.__P=n,d.__e=!1,y=st.__r,C=0,x)d.state=d.__s,d.__d=!1,y&&y(e),h=d.render(d.props,d.state,d.context),ji.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,y&&y(e),h=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++C<25);d.state=d.__s,d.getChildContext!=null&&(i=re(re({},i),d.getChildContext())),x&&!f&&d.getSnapshotBeforeUpdate!=null&&(b=d.getSnapshotBeforeUpdate(p,m)),E=h!=null&&h.type===ro&&h.key==null?ld(h.props.children):h,l=od(n,no(E)?E:[E],e,r,i,o,s,a,l,c,u),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),g&&(d.__E=d.__=null)}catch(P){if(e.__v=null,c||s!=null)if(P.then){for(e.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,e.__e=l}else{for(k=s.length;k--;)oa(s[k]);ls(e)}else e.__e=r.__e,e.__k=r.__k,P.then||ls(e);st.__e(P,e,r)}else s==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):l=e.__e=xb(r.__e,e,r,i,o,s,a,c,u);return(h=st.diffed)&&h(e),128&e.__u?void 0:l}function ls(n){n&&(n.__c&&(n.__c.__e=!0),n.__k&&n.__k.some(ls))}function ad(n,e,r){for(var i=0;i<r.length;i++)aa(r[i],r[++i],r[++i]);st.__c&&st.__c(e,n),n.some(function(o){try{n=o.__h,o.__h=[],n.some(function(s){s.call(o)})}catch(s){st.__e(s,o.__v)}})}function ld(n){return typeof n!="object"||n==null||n.__b>0?n:no(n)?n.map(ld):re({},n)}function xb(n,e,r,i,o,s,a,l,c){var u,h,d,f,p,m,b,g=r.props||Ri,v=e.props,x=e.type;if(x=="svg"?o="http://www.w3.org/2000/svg":x=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),s!=null){for(u=0;u<s.length;u++)if((p=s[u])&&"setAttribute"in p==!!x&&(x?p.localName==x:p.nodeType==3)){n=p,s[u]=null;break}}if(n==null){if(x==null)return document.createTextNode(v);n=document.createElementNS(o,x,v.is&&v),l&&(st.__m&&st.__m(e,s),l=!1),s=null}if(x==null)g===v||l&&n.data==v||(n.data=v);else{if(s=s&&Or.call(n.childNodes),!l&&s!=null)for(g={},u=0;u<n.attributes.length;u++)g[(p=n.attributes[u]).name]=p.value;for(u in g)p=g[u],u=="dangerouslySetInnerHTML"?d=p:u=="children"||u in v||u=="value"&&"defaultValue"in v||u=="checked"&&"defaultChecked"in v||Xr(n,u,null,p,o);for(u in v)p=v[u],u=="children"?f=p:u=="dangerouslySetInnerHTML"?h=p:u=="value"?m=p:u=="checked"?b=p:l&&typeof p!="function"||g[u]===p||Xr(n,u,p,g[u],o);if(h)l||d&&(h.__html==d.__html||h.__html==n.innerHTML)||(n.innerHTML=h.__html),e.__k=[];else if(d&&(n.innerHTML=""),od(e.type=="template"?n.content:n,no(f)?f:[f],e,r,i,x=="foreignObject"?"http://www.w3.org/1999/xhtml":o,s,a,s?s[0]:r.__k&&In(r,0),l,c),s!=null)for(u=s.length;u--;)oa(s[u]);l||(u="value",x=="progress"&&m==null?n.removeAttribute("value"):m!=null&&(m!==n[u]||x=="progress"&&!m||x=="option"&&m!=g[u])&&Xr(n,u,m,g[u],o),u="checked",b!=null&&b!=n[u]&&Xr(n,u,b,g[u],o))}return n}function aa(n,e,r){try{if(typeof n=="function"){var i=typeof n.__u=="function";i&&n.__u(),i&&e==null||(n.__u=n(e))}else n.current=e}catch(o){st.__e(o,r)}}function cd(n,e,r){var i,o;if(st.unmount&&st.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||aa(i,null,e)),(i=n.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){st.__e(s,e)}i.base=i.__P=null}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&cd(i[o],e,r||typeof n.type!="function");r||oa(n.__e),n.__c=n.__=n.__e=void 0}function wb(n,e,r){return this.constructor(n,r)}function Cb(n,e,r){var i,o,s,a;e==document&&(e=document.documentElement),st.__&&st.__(n,e),o=(i=!1)?null:e.__k,s=[],a=[],sa(e,n=e.__k=gb(ro,null,[n]),o||Ri,Ri,e.namespaceURI,o?null:e.firstChild?Or.call(e.childNodes):null,s,o?o.__e:e.firstChild,i,a),ad(s,n,a)}function ud(n,e,r){var i,o,s,a,l=re({},n.props);for(s in n.type&&n.type.defaultProps&&(a=n.type.defaultProps),e)s=="key"?i=e[s]:s=="ref"?o=e[s]:l[s]=e[s]===void 0&&a!=null?a[s]:e[s];return arguments.length>2&&(l.children=arguments.length>3?Or.call(arguments,2):r),ur(n.type,l,i||n.key,o||n.ref,null)}Or=ji.slice,st={__e:function(n,e,r,i){for(var o,s,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((s=o.constructor)&&s.getDerivedStateFromError!=null&&(o.setState(s.getDerivedStateFromError(n)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(n,i||{}),a=o.__d),a)return o.__E=o}catch(l){n=l}throw n}},Qu=0,td=function(n){return n!=null&&n.constructor===void 0},bi.prototype.setState=function(n,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=re({},this.state),typeof n=="function"&&(n=n(re({},r),this.props)),n&&re(r,n),n!=null&&this.__v&&(e&&this._sb.push(e),Ll(this))},bi.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),Ll(this))},bi.prototype.render=ro,Ne=[],ed=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,nd=function(n,e){return n.__v.__b-e.__v.__b},Li.__r=0,yo=Math.random().toString(8),gi="__d"+yo,cr="__a"+yo,rd=/(PointerCapture)$|Capture$/i,ia=0,ss=Nl(!1),as=Nl(!0);function Fl(n,e){(e==null||e>n.length)&&(e=n.length);for(var r=0,i=Array(e);r<e;r++)i[r]=n[r];return i}function Eb(n){if(Array.isArray(n))return n}function kb(n,e,r){return(e=Tb(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function Ab(n,e){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var i,o,s,a,l=[],c=!0,u=!1;try{if(s=(r=r.call(n)).next,e!==0)for(;!(c=(i=s.call(r)).done)&&(l.push(i.value),l.length!==e);c=!0);}catch(h){u=!0,o=h}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}function Pb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vl(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),r.push.apply(r,i)}return r}function Sb(n){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Vl(Object(r),!0).forEach(function(i){kb(n,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Vl(Object(r)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(r,i))})}return n}function Mb(n,e){return Eb(n)||Ab(n,e)||Ib(n,e)||Pb()}function $b(n,e){if(typeof n!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var i=r.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Tb(n){var e=$b(n,"string");return typeof e=="symbol"?e:e+""}function zi(n){"@babel/helpers - typeof";return zi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zi(n)}function Ib(n,e){if(n){if(typeof n=="string")return Fl(n,e);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Fl(n,e):void 0}}var cs=function(e){if(zi(e)!=="object")return e;var r=ud(e);if(r.props){var i;r.props=Sb({},r.props),r!=null&&(i=r.props)!==null&&i!==void 0&&i.children&&(r.props.children=Array.isArray(r.props.children)?r.props.children.map(cs):cs(r.props.children))}return r},Ob=function(e){return td(ud(e))},Db=function(e,r){delete r.__k,Cb(cs(e),r)};function Rb(n,e){e===void 0&&(e={});var r=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}}var jb=`.float-tooltip-kap {
5
+ position: absolute;
6
+ width: max-content; /* prevent shrinking near right edge */
7
+ max-width: max(50%, 150px);
8
+ padding: 3px 5px;
9
+ border-radius: 3px;
10
+ font: 12px sans-serif;
11
+ color: #eee;
12
+ background: rgba(0,0,0,0.6);
13
+ pointer-events: none;
14
+ }
15
+ `;Rb(jb);var Lb=ra({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.style,s=o===void 0?{}:o,a=!!e&&zi(e)==="object"&&!!e.node&&typeof e.node=="function",l=qt(a?e.node():e);l.style("position")==="static"&&l.style("position","relative"),r.tooltipEl=l.append("div").attr("class","float-tooltip-kap"),Object.entries(s).forEach(function(u){var h=Mb(u,2),d=h[0],f=h[1];return r.tooltipEl.style(d,f)}),r.tooltipEl.style("left","-10000px").style("display","none");var c="tooltip-".concat(Math.round(Math.random()*1e12));r.mouseInside=!1,l.on("mousemove.".concat(c),function(u){r.mouseInside=!0;var h=ee(u),d=l.node(),f=d.offsetWidth,p=d.offsetHeight,m=[r.offsetX===null||r.offsetX===void 0?"-".concat(h[0]/f*100,"%"):typeof r.offsetX=="number"?"calc(-50% + ".concat(r.offsetX,"px)"):r.offsetX,r.offsetY===null||r.offsetY===void 0?p>130&&p-h[1]<100?"calc(-100% - 6px)":"21px":typeof r.offsetY=="number"?r.offsetY<0?"calc(-100% - ".concat(Math.abs(r.offsetY),"px)"):"".concat(r.offsetY,"px"):r.offsetY];r.tooltipEl.style("left",h[0]+"px").style("top",h[1]+"px").style("transform","translate(".concat(m.join(","),")")),r.content&&r.tooltipEl.style("display","inline")}),l.on("mouseover.".concat(c),function(){r.mouseInside=!0,r.content&&r.tooltipEl.style("display","inline")}),l.on("mouseout.".concat(c),function(){r.mouseInside=!1,r.tooltipEl.style("display","none")})},update:function(e){e.tooltipEl.style("display",e.content&&e.mouseInside?"inline":"none"),e.content?e.content instanceof HTMLElement?(e.tooltipEl.text(""),e.tooltipEl.append(function(){return e.content})):typeof e.content=="string"?e.tooltipEl.html(e.content):Ob(e.content)?(e.tooltipEl.text(""),Db(e.content,e.tooltipEl.node())):(e.tooltipEl.style("display","none"),console.warn("Tooltip content is invalid, skipping.",e.content,e.content.toString())):e.tooltipEl.text("")}});function zb(n,e,r){var i,o=1;n==null&&(n=0),e==null&&(e=0),r==null&&(r=0);function s(){var a,l=i.length,c,u=0,h=0,d=0;for(a=0;a<l;++a)c=i[a],u+=c.x||0,h+=c.y||0,d+=c.z||0;for(u=(u/l-n)*o,h=(h/l-e)*o,d=(d/l-r)*o,a=0;a<l;++a)c=i[a],u&&(c.x-=u),h&&(c.y-=h),d&&(c.z-=d)}return s.initialize=function(a){i=a},s.x=function(a){return arguments.length?(n=+a,s):n},s.y=function(a){return arguments.length?(e=+a,s):e},s.z=function(a){return arguments.length?(r=+a,s):r},s.strength=function(a){return arguments.length?(o=+a,s):o},s}function Nb(n){const e=+this._x.call(null,n);return dd(this.cover(e),e,n)}function dd(n,e,r){if(isNaN(e))return n;var i,o=n._root,s={data:r},a=n._x0,l=n._x1,c,u,h,d,f;if(!o)return n._root=s,n;for(;o.length;)if((h=e>=(c=(a+l)/2))?a=c:l=c,i=o,!(o=o[d=+h]))return i[d]=s,n;if(u=+n._x.call(null,o.data),e===u)return s.next=o,i?i[d]=s:n._root=s,n;do i=i?i[d]=new Array(2):n._root=new Array(2),(h=e>=(c=(a+l)/2))?a=c:l=c;while((d=+h)==(f=+(u>=c)));return i[f]=o,i[d]=s,n}function Fb(n){Array.isArray(n)||(n=Array.from(n));const e=n.length,r=new Float64Array(e);let i=1/0,o=-1/0;for(let s=0,a;s<e;++s)isNaN(a=+this._x.call(null,n[s]))||(r[s]=a,a<i&&(i=a),a>o&&(o=a));if(i>o)return this;this.cover(i).cover(o);for(let s=0;s<e;++s)dd(this,r[s],n[s]);return this}function Vb(n){if(isNaN(n=+n))return this;var e=this._x0,r=this._x1;if(isNaN(e))r=(e=Math.floor(n))+1;else{for(var i=r-e||1,o=this._root,s,a;e>n||n>=r;)switch(a=+(n<e),s=new Array(2),s[a]=o,o=s,i*=2,a){case 0:r=e+i;break;case 1:e=r-i;break}this._root&&this._root.length&&(this._root=o)}return this._x0=e,this._x1=r,this}function Bb(){var n=[];return this.visit(function(e){if(!e.length)do n.push(e.data);while(e=e.next)}),n}function Ub(n){return arguments.length?this.cover(+n[0][0]).cover(+n[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]}function ke(n,e,r){this.node=n,this.x0=e,this.x1=r}function Hb(n,e){var r,i=this._x0,o,s,a=this._x1,l=[],c=this._root,u,h;for(c&&l.push(new ke(c,i,a)),e==null?e=1/0:(i=n-e,a=n+e);u=l.pop();)if(!(!(c=u.node)||(o=u.x0)>a||(s=u.x1)<i))if(c.length){var d=(o+s)/2;l.push(new ke(c[1],d,s),new ke(c[0],o,d)),(h=+(n>=d))&&(u=l[l.length-1],l[l.length-1]=l[l.length-1-h],l[l.length-1-h]=u)}else{var f=Math.abs(n-+this._x.call(null,c.data));f<e&&(e=f,i=n-f,a=n+f,r=c.data)}return r}function qb(n){if(isNaN(c=+this._x.call(null,n)))return this;var e,r=this._root,i,o,s,a=this._x0,l=this._x1,c,u,h,d,f;if(!r)return this;if(r.length)for(;;){if((h=c>=(u=(a+l)/2))?a=u:l=u,e=r,!(r=r[d=+h]))return this;if(!r.length)break;e[d+1&1]&&(i=e,f=d)}for(;r.data!==n;)if(o=r,!(r=r.next))return this;return(s=r.next)&&delete r.next,o?(s?o.next=s:delete o.next,this):e?(s?e[d]=s:delete e[d],(r=e[0]||e[1])&&r===(e[1]||e[0])&&!r.length&&(i?i[f]=r:this._root=r),this):(this._root=s,this)}function Kb(n){for(var e=0,r=n.length;e<r;++e)this.remove(n[e]);return this}function Gb(){return this._root}function Wb(){var n=0;return this.visit(function(e){if(!e.length)do++n;while(e=e.next)}),n}function Yb(n){var e=[],r,i=this._root,o,s,a;for(i&&e.push(new ke(i,this._x0,this._x1));r=e.pop();)if(!n(i=r.node,s=r.x0,a=r.x1)&&i.length){var l=(s+a)/2;(o=i[1])&&e.push(new ke(o,l,a)),(o=i[0])&&e.push(new ke(o,s,l))}return this}function Xb(n){var e=[],r=[],i;for(this._root&&e.push(new ke(this._root,this._x0,this._x1));i=e.pop();){var o=i.node;if(o.length){var s,a=i.x0,l=i.x1,c=(a+l)/2;(s=o[0])&&e.push(new ke(s,a,c)),(s=o[1])&&e.push(new ke(s,c,l))}r.push(i)}for(;i=r.pop();)n(i.node,i.x0,i.x1);return this}function Zb(n){return n[0]}function Jb(n){return arguments.length?(this._x=n,this):this._x}function hd(n,e){var r=new la(e??Zb,NaN,NaN);return n==null?r:r.addAll(n)}function la(n,e,r){this._x=n,this._x0=e,this._x1=r,this._root=void 0}function Bl(n){for(var e={data:n.data},r=e;n=n.next;)r=r.next={data:n.data};return e}var jt=hd.prototype=la.prototype;jt.copy=function(){var n=new la(this._x,this._x0,this._x1),e=this._root,r,i;if(!e)return n;if(!e.length)return n._root=Bl(e),n;for(r=[{source:e,target:n._root=new Array(2)}];e=r.pop();)for(var o=0;o<2;++o)(i=e.source[o])&&(i.length?r.push({source:i,target:e.target[o]=new Array(2)}):e.target[o]=Bl(i));return n};jt.add=Nb;jt.addAll=Fb;jt.cover=Vb;jt.data=Bb;jt.extent=Ub;jt.find=Hb;jt.remove=qb;jt.removeAll=Kb;jt.root=Gb;jt.size=Wb;jt.visit=Yb;jt.visitAfter=Xb;jt.x=Jb;function Qb(n){const e=+this._x.call(null,n),r=+this._y.call(null,n);return pd(this.cover(e,r),e,r,n)}function pd(n,e,r,i){if(isNaN(e)||isNaN(r))return n;var o,s=n._root,a={data:i},l=n._x0,c=n._y0,u=n._x1,h=n._y1,d,f,p,m,b,g,v,x;if(!s)return n._root=a,n;for(;s.length;)if((b=e>=(d=(l+u)/2))?l=d:u=d,(g=r>=(f=(c+h)/2))?c=f:h=f,o=s,!(s=s[v=g<<1|b]))return o[v]=a,n;if(p=+n._x.call(null,s.data),m=+n._y.call(null,s.data),e===p&&r===m)return a.next=s,o?o[v]=a:n._root=a,n;do o=o?o[v]=new Array(4):n._root=new Array(4),(b=e>=(d=(l+u)/2))?l=d:u=d,(g=r>=(f=(c+h)/2))?c=f:h=f;while((v=g<<1|b)===(x=(m>=f)<<1|p>=d));return o[x]=s,o[v]=a,n}function t0(n){var e,r,i=n.length,o,s,a=new Array(i),l=new Array(i),c=1/0,u=1/0,h=-1/0,d=-1/0;for(r=0;r<i;++r)isNaN(o=+this._x.call(null,e=n[r]))||isNaN(s=+this._y.call(null,e))||(a[r]=o,l[r]=s,o<c&&(c=o),o>h&&(h=o),s<u&&(u=s),s>d&&(d=s));if(c>h||u>d)return this;for(this.cover(c,u).cover(h,d),r=0;r<i;++r)pd(this,a[r],l[r],n[r]);return this}function e0(n,e){if(isNaN(n=+n)||isNaN(e=+e))return this;var r=this._x0,i=this._y0,o=this._x1,s=this._y1;if(isNaN(r))o=(r=Math.floor(n))+1,s=(i=Math.floor(e))+1;else{for(var a=o-r||1,l=this._root,c,u;r>n||n>=o||i>e||e>=s;)switch(u=(e<i)<<1|n<r,c=new Array(4),c[u]=l,l=c,a*=2,u){case 0:o=r+a,s=i+a;break;case 1:r=o-a,s=i+a;break;case 2:o=r+a,i=s-a;break;case 3:r=o-a,i=s-a;break}this._root&&this._root.length&&(this._root=l)}return this._x0=r,this._y0=i,this._x1=o,this._y1=s,this}function n0(){var n=[];return this.visit(function(e){if(!e.length)do n.push(e.data);while(e=e.next)}),n}function r0(n){return arguments.length?this.cover(+n[0][0],+n[0][1]).cover(+n[1][0],+n[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Ct(n,e,r,i,o){this.node=n,this.x0=e,this.y0=r,this.x1=i,this.y1=o}function i0(n,e,r){var i,o=this._x0,s=this._y0,a,l,c,u,h=this._x1,d=this._y1,f=[],p=this._root,m,b;for(p&&f.push(new Ct(p,o,s,h,d)),r==null?r=1/0:(o=n-r,s=e-r,h=n+r,d=e+r,r*=r);m=f.pop();)if(!(!(p=m.node)||(a=m.x0)>h||(l=m.y0)>d||(c=m.x1)<o||(u=m.y1)<s))if(p.length){var g=(a+c)/2,v=(l+u)/2;f.push(new Ct(p[3],g,v,c,u),new Ct(p[2],a,v,g,u),new Ct(p[1],g,l,c,v),new Ct(p[0],a,l,g,v)),(b=(e>=v)<<1|n>=g)&&(m=f[f.length-1],f[f.length-1]=f[f.length-1-b],f[f.length-1-b]=m)}else{var x=n-+this._x.call(null,p.data),w=e-+this._y.call(null,p.data),_=x*x+w*w;if(_<r){var y=Math.sqrt(r=_);o=n-y,s=e-y,h=n+y,d=e+y,i=p.data}}return i}function o0(n){if(isNaN(h=+this._x.call(null,n))||isNaN(d=+this._y.call(null,n)))return this;var e,r=this._root,i,o,s,a=this._x0,l=this._y0,c=this._x1,u=this._y1,h,d,f,p,m,b,g,v;if(!r)return this;if(r.length)for(;;){if((m=h>=(f=(a+c)/2))?a=f:c=f,(b=d>=(p=(l+u)/2))?l=p:u=p,e=r,!(r=r[g=b<<1|m]))return this;if(!r.length)break;(e[g+1&3]||e[g+2&3]||e[g+3&3])&&(i=e,v=g)}for(;r.data!==n;)if(o=r,!(r=r.next))return this;return(s=r.next)&&delete r.next,o?(s?o.next=s:delete o.next,this):e?(s?e[g]=s:delete e[g],(r=e[0]||e[1]||e[2]||e[3])&&r===(e[3]||e[2]||e[1]||e[0])&&!r.length&&(i?i[v]=r:this._root=r),this):(this._root=s,this)}function s0(n){for(var e=0,r=n.length;e<r;++e)this.remove(n[e]);return this}function a0(){return this._root}function l0(){var n=0;return this.visit(function(e){if(!e.length)do++n;while(e=e.next)}),n}function c0(n){var e=[],r,i=this._root,o,s,a,l,c;for(i&&e.push(new Ct(i,this._x0,this._y0,this._x1,this._y1));r=e.pop();)if(!n(i=r.node,s=r.x0,a=r.y0,l=r.x1,c=r.y1)&&i.length){var u=(s+l)/2,h=(a+c)/2;(o=i[3])&&e.push(new Ct(o,u,h,l,c)),(o=i[2])&&e.push(new Ct(o,s,h,u,c)),(o=i[1])&&e.push(new Ct(o,u,a,l,h)),(o=i[0])&&e.push(new Ct(o,s,a,u,h))}return this}function u0(n){var e=[],r=[],i;for(this._root&&e.push(new Ct(this._root,this._x0,this._y0,this._x1,this._y1));i=e.pop();){var o=i.node;if(o.length){var s,a=i.x0,l=i.y0,c=i.x1,u=i.y1,h=(a+c)/2,d=(l+u)/2;(s=o[0])&&e.push(new Ct(s,a,l,h,d)),(s=o[1])&&e.push(new Ct(s,h,l,c,d)),(s=o[2])&&e.push(new Ct(s,a,d,h,u)),(s=o[3])&&e.push(new Ct(s,h,d,c,u))}r.push(i)}for(;i=r.pop();)n(i.node,i.x0,i.y0,i.x1,i.y1);return this}function d0(n){return n[0]}function h0(n){return arguments.length?(this._x=n,this):this._x}function p0(n){return n[1]}function f0(n){return arguments.length?(this._y=n,this):this._y}function io(n,e,r){var i=new ca(e??d0,r??p0,NaN,NaN,NaN,NaN);return n==null?i:i.addAll(n)}function ca(n,e,r,i,o,s){this._x=n,this._y=e,this._x0=r,this._y0=i,this._x1=o,this._y1=s,this._root=void 0}function Ul(n){for(var e={data:n.data},r=e;n=n.next;)r=r.next={data:n.data};return e}var Pt=io.prototype=ca.prototype;Pt.copy=function(){var n=new ca(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,r,i;if(!e)return n;if(!e.length)return n._root=Ul(e),n;for(r=[{source:e,target:n._root=new Array(4)}];e=r.pop();)for(var o=0;o<4;++o)(i=e.source[o])&&(i.length?r.push({source:i,target:e.target[o]=new Array(4)}):e.target[o]=Ul(i));return n};Pt.add=Qb;Pt.addAll=t0;Pt.cover=e0;Pt.data=n0;Pt.extent=r0;Pt.find=i0;Pt.remove=o0;Pt.removeAll=s0;Pt.root=a0;Pt.size=l0;Pt.visit=c0;Pt.visitAfter=u0;Pt.x=h0;Pt.y=f0;function v0(n){const e=+this._x.call(null,n),r=+this._y.call(null,n),i=+this._z.call(null,n);return fd(this.cover(e,r,i),e,r,i,n)}function fd(n,e,r,i,o){if(isNaN(e)||isNaN(r)||isNaN(i))return n;var s,a=n._root,l={data:o},c=n._x0,u=n._y0,h=n._z0,d=n._x1,f=n._y1,p=n._z1,m,b,g,v,x,w,_,y,C,E,k;if(!a)return n._root=l,n;for(;a.length;)if((_=e>=(m=(c+d)/2))?c=m:d=m,(y=r>=(b=(u+f)/2))?u=b:f=b,(C=i>=(g=(h+p)/2))?h=g:p=g,s=a,!(a=a[E=C<<2|y<<1|_]))return s[E]=l,n;if(v=+n._x.call(null,a.data),x=+n._y.call(null,a.data),w=+n._z.call(null,a.data),e===v&&r===x&&i===w)return l.next=a,s?s[E]=l:n._root=l,n;do s=s?s[E]=new Array(8):n._root=new Array(8),(_=e>=(m=(c+d)/2))?c=m:d=m,(y=r>=(b=(u+f)/2))?u=b:f=b,(C=i>=(g=(h+p)/2))?h=g:p=g;while((E=C<<2|y<<1|_)===(k=(w>=g)<<2|(x>=b)<<1|v>=m));return s[k]=a,s[E]=l,n}function m0(n){Array.isArray(n)||(n=Array.from(n));const e=n.length,r=new Float64Array(e),i=new Float64Array(e),o=new Float64Array(e);let s=1/0,a=1/0,l=1/0,c=-1/0,u=-1/0,h=-1/0;for(let d=0,f,p,m,b;d<e;++d)isNaN(p=+this._x.call(null,f=n[d]))||isNaN(m=+this._y.call(null,f))||isNaN(b=+this._z.call(null,f))||(r[d]=p,i[d]=m,o[d]=b,p<s&&(s=p),p>c&&(c=p),m<a&&(a=m),m>u&&(u=m),b<l&&(l=b),b>h&&(h=b));if(s>c||a>u||l>h)return this;this.cover(s,a,l).cover(c,u,h);for(let d=0;d<e;++d)fd(this,r[d],i[d],o[d],n[d]);return this}function g0(n,e,r){if(isNaN(n=+n)||isNaN(e=+e)||isNaN(r=+r))return this;var i=this._x0,o=this._y0,s=this._z0,a=this._x1,l=this._y1,c=this._z1;if(isNaN(i))a=(i=Math.floor(n))+1,l=(o=Math.floor(e))+1,c=(s=Math.floor(r))+1;else{for(var u=a-i||1,h=this._root,d,f;i>n||n>=a||o>e||e>=l||s>r||r>=c;)switch(f=(r<s)<<2|(e<o)<<1|n<i,d=new Array(8),d[f]=h,h=d,u*=2,f){case 0:a=i+u,l=o+u,c=s+u;break;case 1:i=a-u,l=o+u,c=s+u;break;case 2:a=i+u,o=l-u,c=s+u;break;case 3:i=a-u,o=l-u,c=s+u;break;case 4:a=i+u,l=o+u,s=c-u;break;case 5:i=a-u,l=o+u,s=c-u;break;case 6:a=i+u,o=l-u,s=c-u;break;case 7:i=a-u,o=l-u,s=c-u;break}this._root&&this._root.length&&(this._root=h)}return this._x0=i,this._y0=o,this._z0=s,this._x1=a,this._y1=l,this._z1=c,this}function b0(){var n=[];return this.visit(function(e){if(!e.length)do n.push(e.data);while(e=e.next)}),n}function _0(n){return arguments.length?this.cover(+n[0][0],+n[0][1],+n[0][2]).cover(+n[1][0],+n[1][1],+n[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}function nt(n,e,r,i,o,s,a){this.node=n,this.x0=e,this.y0=r,this.z0=i,this.x1=o,this.y1=s,this.z1=a}function y0(n,e,r,i){var o,s=this._x0,a=this._y0,l=this._z0,c,u,h,d,f,p,m=this._x1,b=this._y1,g=this._z1,v=[],x=this._root,w,_;for(x&&v.push(new nt(x,s,a,l,m,b,g)),i==null?i=1/0:(s=n-i,a=e-i,l=r-i,m=n+i,b=e+i,g=r+i,i*=i);w=v.pop();)if(!(!(x=w.node)||(c=w.x0)>m||(u=w.y0)>b||(h=w.z0)>g||(d=w.x1)<s||(f=w.y1)<a||(p=w.z1)<l))if(x.length){var y=(c+d)/2,C=(u+f)/2,E=(h+p)/2;v.push(new nt(x[7],y,C,E,d,f,p),new nt(x[6],c,C,E,y,f,p),new nt(x[5],y,u,E,d,C,p),new nt(x[4],c,u,E,y,C,p),new nt(x[3],y,C,h,d,f,E),new nt(x[2],c,C,h,y,f,E),new nt(x[1],y,u,h,d,C,E),new nt(x[0],c,u,h,y,C,E)),(_=(r>=E)<<2|(e>=C)<<1|n>=y)&&(w=v[v.length-1],v[v.length-1]=v[v.length-1-_],v[v.length-1-_]=w)}else{var k=n-+this._x.call(null,x.data),M=e-+this._y.call(null,x.data),P=r-+this._z.call(null,x.data),D=k*k+M*M+P*P;if(D<i){var R=Math.sqrt(i=D);s=n-R,a=e-R,l=r-R,m=n+R,b=e+R,g=r+R,o=x.data}}return o}const x0=(n,e,r,i,o,s)=>Math.sqrt((n-i)**2+(e-o)**2+(r-s)**2);function w0(n,e,r,i){const o=[],s=n-i,a=e-i,l=r-i,c=n+i,u=e+i,h=r+i;return this.visit((d,f,p,m,b,g,v)=>{if(!d.length)do{const x=d.data;x0(n,e,r,this._x(x),this._y(x),this._z(x))<=i&&o.push(x)}while(d=d.next);return f>c||p>u||m>h||b<s||g<a||v<l}),o}function C0(n){if(isNaN(f=+this._x.call(null,n))||isNaN(p=+this._y.call(null,n))||isNaN(m=+this._z.call(null,n)))return this;var e,r=this._root,i,o,s,a=this._x0,l=this._y0,c=this._z0,u=this._x1,h=this._y1,d=this._z1,f,p,m,b,g,v,x,w,_,y,C;if(!r)return this;if(r.length)for(;;){if((x=f>=(b=(a+u)/2))?a=b:u=b,(w=p>=(g=(l+h)/2))?l=g:h=g,(_=m>=(v=(c+d)/2))?c=v:d=v,e=r,!(r=r[y=_<<2|w<<1|x]))return this;if(!r.length)break;(e[y+1&7]||e[y+2&7]||e[y+3&7]||e[y+4&7]||e[y+5&7]||e[y+6&7]||e[y+7&7])&&(i=e,C=y)}for(;r.data!==n;)if(o=r,!(r=r.next))return this;return(s=r.next)&&delete r.next,o?(s?o.next=s:delete o.next,this):e?(s?e[y]=s:delete e[y],(r=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&r===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!r.length&&(i?i[C]=r:this._root=r),this):(this._root=s,this)}function E0(n){for(var e=0,r=n.length;e<r;++e)this.remove(n[e]);return this}function k0(){return this._root}function A0(){var n=0;return this.visit(function(e){if(!e.length)do++n;while(e=e.next)}),n}function P0(n){var e=[],r,i=this._root,o,s,a,l,c,u,h;for(i&&e.push(new nt(i,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));r=e.pop();)if(!n(i=r.node,s=r.x0,a=r.y0,l=r.z0,c=r.x1,u=r.y1,h=r.z1)&&i.length){var d=(s+c)/2,f=(a+u)/2,p=(l+h)/2;(o=i[7])&&e.push(new nt(o,d,f,p,c,u,h)),(o=i[6])&&e.push(new nt(o,s,f,p,d,u,h)),(o=i[5])&&e.push(new nt(o,d,a,p,c,f,h)),(o=i[4])&&e.push(new nt(o,s,a,p,d,f,h)),(o=i[3])&&e.push(new nt(o,d,f,l,c,u,p)),(o=i[2])&&e.push(new nt(o,s,f,l,d,u,p)),(o=i[1])&&e.push(new nt(o,d,a,l,c,f,p)),(o=i[0])&&e.push(new nt(o,s,a,l,d,f,p))}return this}function S0(n){var e=[],r=[],i;for(this._root&&e.push(new nt(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));i=e.pop();){var o=i.node;if(o.length){var s,a=i.x0,l=i.y0,c=i.z0,u=i.x1,h=i.y1,d=i.z1,f=(a+u)/2,p=(l+h)/2,m=(c+d)/2;(s=o[0])&&e.push(new nt(s,a,l,c,f,p,m)),(s=o[1])&&e.push(new nt(s,f,l,c,u,p,m)),(s=o[2])&&e.push(new nt(s,a,p,c,f,h,m)),(s=o[3])&&e.push(new nt(s,f,p,c,u,h,m)),(s=o[4])&&e.push(new nt(s,a,l,m,f,p,d)),(s=o[5])&&e.push(new nt(s,f,l,m,u,p,d)),(s=o[6])&&e.push(new nt(s,a,p,m,f,h,d)),(s=o[7])&&e.push(new nt(s,f,p,m,u,h,d))}r.push(i)}for(;i=r.pop();)n(i.node,i.x0,i.y0,i.z0,i.x1,i.y1,i.z1);return this}function M0(n){return n[0]}function $0(n){return arguments.length?(this._x=n,this):this._x}function T0(n){return n[1]}function I0(n){return arguments.length?(this._y=n,this):this._y}function O0(n){return n[2]}function D0(n){return arguments.length?(this._z=n,this):this._z}function vd(n,e,r,i){var o=new ua(e??M0,r??T0,i??O0,NaN,NaN,NaN,NaN,NaN,NaN);return n==null?o:o.addAll(n)}function ua(n,e,r,i,o,s,a,l,c){this._x=n,this._y=e,this._z=r,this._x0=i,this._y0=o,this._z0=s,this._x1=a,this._y1=l,this._z1=c,this._root=void 0}function Hl(n){for(var e={data:n.data},r=e;n=n.next;)r=r.next={data:n.data};return e}var gt=vd.prototype=ua.prototype;gt.copy=function(){var n=new ua(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),e=this._root,r,i;if(!e)return n;if(!e.length)return n._root=Hl(e),n;for(r=[{source:e,target:n._root=new Array(8)}];e=r.pop();)for(var o=0;o<8;++o)(i=e.source[o])&&(i.length?r.push({source:i,target:e.target[o]=new Array(8)}):e.target[o]=Hl(i));return n};gt.add=v0;gt.addAll=m0;gt.cover=g0;gt.data=b0;gt.extent=_0;gt.find=y0;gt.findAllWithinRadius=w0;gt.remove=C0;gt.removeAll=E0;gt.root=k0;gt.size=A0;gt.visit=P0;gt.visitAfter=S0;gt.x=$0;gt.y=I0;gt.z=D0;function Ce(n){return function(){return n}}function xe(n){return(n()-.5)*1e-6}function R0(n){return n.index}function ql(n,e){var r=n.get(e);if(!r)throw new Error("node not found: "+e);return r}function j0(n){var e=R0,r=f,i,o=Ce(30),s,a,l,c,u,h,d=1;n==null&&(n=[]);function f(v){return 1/Math.min(c[v.source.index],c[v.target.index])}function p(v){for(var x=0,w=n.length;x<d;++x)for(var _=0,y,C,E,k=0,M=0,P=0,D,R;_<w;++_)y=n[_],C=y.source,E=y.target,k=E.x+E.vx-C.x-C.vx||xe(h),l>1&&(M=E.y+E.vy-C.y-C.vy||xe(h)),l>2&&(P=E.z+E.vz-C.z-C.vz||xe(h)),D=Math.sqrt(k*k+M*M+P*P),D=(D-s[_])/D*v*i[_],k*=D,M*=D,P*=D,E.vx-=k*(R=u[_]),l>1&&(E.vy-=M*R),l>2&&(E.vz-=P*R),C.vx+=k*(R=1-R),l>1&&(C.vy+=M*R),l>2&&(C.vz+=P*R)}function m(){if(a){var v,x=a.length,w=n.length,_=new Map(a.map((C,E)=>[e(C,E,a),C])),y;for(v=0,c=new Array(x);v<w;++v)y=n[v],y.index=v,typeof y.source!="object"&&(y.source=ql(_,y.source)),typeof y.target!="object"&&(y.target=ql(_,y.target)),c[y.source.index]=(c[y.source.index]||0)+1,c[y.target.index]=(c[y.target.index]||0)+1;for(v=0,u=new Array(w);v<w;++v)y=n[v],u[v]=c[y.source.index]/(c[y.source.index]+c[y.target.index]);i=new Array(w),b(),s=new Array(w),g()}}function b(){if(a)for(var v=0,x=n.length;v<x;++v)i[v]=+r(n[v],v,n)}function g(){if(a)for(var v=0,x=n.length;v<x;++v)s[v]=+o(n[v],v,n)}return p.initialize=function(v,...x){a=v,h=x.find(w=>typeof w=="function")||Math.random,l=x.find(w=>[1,2,3].includes(w))||2,m()},p.links=function(v){return arguments.length?(n=v,m(),p):n},p.id=function(v){return arguments.length?(e=v,p):e},p.iterations=function(v){return arguments.length?(d=+v,p):d},p.strength=function(v){return arguments.length?(r=typeof v=="function"?v:Ce(+v),b(),p):r},p.distance=function(v){return arguments.length?(o=typeof v=="function"?v:Ce(+v),g(),p):o},p}const L0=1664525,z0=1013904223,Kl=4294967296;function N0(){let n=1;return()=>(n=(L0*n+z0)%Kl)/Kl}var Gl=3;function xo(n){return n.x}function Wl(n){return n.y}function F0(n){return n.z}var V0=10,B0=Math.PI*(3-Math.sqrt(5)),U0=Math.PI*20/(9+Math.sqrt(221));function H0(n,e){e=e||2;var r=Math.min(Gl,Math.max(1,Math.round(e))),i,o=1,s=.001,a=1-Math.pow(s,1/300),l=0,c=.6,u=new Map,h=Qs(p),d=Tr("tick","end"),f=N0();n==null&&(n=[]);function p(){m(),d.call("tick",i),o<s&&(h.stop(),d.call("end",i))}function m(v){var x,w=n.length,_;v===void 0&&(v=1);for(var y=0;y<v;++y)for(o+=(l-o)*a,u.forEach(function(C){C(o)}),x=0;x<w;++x)_=n[x],_.fx==null?_.x+=_.vx*=c:(_.x=_.fx,_.vx=0),r>1&&(_.fy==null?_.y+=_.vy*=c:(_.y=_.fy,_.vy=0)),r>2&&(_.fz==null?_.z+=_.vz*=c:(_.z=_.fz,_.vz=0));return i}function b(){for(var v=0,x=n.length,w;v<x;++v){if(w=n[v],w.index=v,w.fx!=null&&(w.x=w.fx),w.fy!=null&&(w.y=w.fy),w.fz!=null&&(w.z=w.fz),isNaN(w.x)||r>1&&isNaN(w.y)||r>2&&isNaN(w.z)){var _=V0*(r>2?Math.cbrt(.5+v):r>1?Math.sqrt(.5+v):v),y=v*B0,C=v*U0;r===1?w.x=_:r===2?(w.x=_*Math.cos(y),w.y=_*Math.sin(y)):(w.x=_*Math.sin(y)*Math.cos(C),w.y=_*Math.cos(y),w.z=_*Math.sin(y)*Math.sin(C))}(isNaN(w.vx)||r>1&&isNaN(w.vy)||r>2&&isNaN(w.vz))&&(w.vx=0,r>1&&(w.vy=0),r>2&&(w.vz=0))}}function g(v){return v.initialize&&v.initialize(n,f,r),v}return b(),i={tick:m,restart:function(){return h.restart(p),i},stop:function(){return h.stop(),i},numDimensions:function(v){return arguments.length?(r=Math.min(Gl,Math.max(1,Math.round(v))),u.forEach(g),i):r},nodes:function(v){return arguments.length?(n=v,b(),u.forEach(g),i):n},alpha:function(v){return arguments.length?(o=+v,i):o},alphaMin:function(v){return arguments.length?(s=+v,i):s},alphaDecay:function(v){return arguments.length?(a=+v,i):+a},alphaTarget:function(v){return arguments.length?(l=+v,i):l},velocityDecay:function(v){return arguments.length?(c=1-v,i):1-c},randomSource:function(v){return arguments.length?(f=v,u.forEach(g),i):f},force:function(v,x){return arguments.length>1?(x==null?u.delete(v):u.set(v,g(x)),i):u.get(v)},find:function(){var v=Array.prototype.slice.call(arguments),x=v.shift()||0,w=(r>1?v.shift():null)||0,_=(r>2?v.shift():null)||0,y=v.shift()||1/0,C=0,E=n.length,k,M,P,D,R,z;for(y*=y,C=0;C<E;++C)R=n[C],k=x-R.x,M=w-(R.y||0),P=_-(R.z||0),D=k*k+M*M+P*P,D<y&&(z=R,y=D);return z},on:function(v,x){return arguments.length>1?(d.on(v,x),i):d.on(v)}}}function q0(){var n,e,r,i,o,s=Ce(-30),a,l=1,c=1/0,u=.81;function h(m){var b,g=n.length,v=(e===1?hd(n,xo):e===2?io(n,xo,Wl):e===3?vd(n,xo,Wl,F0):null).visitAfter(f);for(o=m,b=0;b<g;++b)r=n[b],v.visit(p)}function d(){if(n){var m,b=n.length,g;for(a=new Array(b),m=0;m<b;++m)g=n[m],a[g.index]=+s(g,m,n)}}function f(m){var b=0,g,v,x=0,w,_,y,C,E=m.length;if(E){for(w=_=y=C=0;C<E;++C)(g=m[C])&&(v=Math.abs(g.value))&&(b+=g.value,x+=v,w+=v*(g.x||0),_+=v*(g.y||0),y+=v*(g.z||0));b*=Math.sqrt(4/E),m.x=w/x,e>1&&(m.y=_/x),e>2&&(m.z=y/x)}else{g=m,g.x=g.data.x,e>1&&(g.y=g.data.y),e>2&&(g.z=g.data.z);do b+=a[g.data.index];while(g=g.next)}m.value=b}function p(m,b,g,v,x){if(!m.value)return!0;var w=[g,v,x][e-1],_=m.x-r.x,y=e>1?m.y-r.y:0,C=e>2?m.z-r.z:0,E=w-b,k=_*_+y*y+C*C;if(E*E/u<k)return k<c&&(_===0&&(_=xe(i),k+=_*_),e>1&&y===0&&(y=xe(i),k+=y*y),e>2&&C===0&&(C=xe(i),k+=C*C),k<l&&(k=Math.sqrt(l*k)),r.vx+=_*m.value*o/k,e>1&&(r.vy+=y*m.value*o/k),e>2&&(r.vz+=C*m.value*o/k)),!0;if(m.length||k>=c)return;(m.data!==r||m.next)&&(_===0&&(_=xe(i),k+=_*_),e>1&&y===0&&(y=xe(i),k+=y*y),e>2&&C===0&&(C=xe(i),k+=C*C),k<l&&(k=Math.sqrt(l*k)));do m.data!==r&&(E=a[m.data.index]*o/k,r.vx+=_*E,e>1&&(r.vy+=y*E),e>2&&(r.vz+=C*E));while(m=m.next)}return h.initialize=function(m,...b){n=m,i=b.find(g=>typeof g=="function")||Math.random,e=b.find(g=>[1,2,3].includes(g))||2,d()},h.strength=function(m){return arguments.length?(s=typeof m=="function"?m:Ce(+m),d(),h):s},h.distanceMin=function(m){return arguments.length?(l=m*m,h):Math.sqrt(l)},h.distanceMax=function(m){return arguments.length?(c=m*m,h):Math.sqrt(c)},h.theta=function(m){return arguments.length?(u=m*m,h):Math.sqrt(u)},h}function K0(n,e,r,i){var o,s,a=Ce(.1),l,c;typeof n!="function"&&(n=Ce(+n)),e==null&&(e=0),r==null&&(r=0),i==null&&(i=0);function u(d){for(var f=0,p=o.length;f<p;++f){var m=o[f],b=m.x-e||1e-6,g=(m.y||0)-r||1e-6,v=(m.z||0)-i||1e-6,x=Math.sqrt(b*b+g*g+v*v),w=(c[f]-x)*l[f]*d/x;m.vx+=b*w,s>1&&(m.vy+=g*w),s>2&&(m.vz+=v*w)}}function h(){if(o){var d,f=o.length;for(l=new Array(f),c=new Array(f),d=0;d<f;++d)c[d]=+n(o[d],d,o),l[d]=isNaN(c[d])?0:+a(o[d],d,o)}}return u.initialize=function(d,...f){o=d,s=f.find(p=>[1,2,3].includes(p))||2,h()},u.strength=function(d){return arguments.length?(a=typeof d=="function"?d:Ce(+d),h(),u):a},u.radius=function(d){return arguments.length?(n=typeof d=="function"?d:Ce(+d),h(),u):n},u.x=function(d){return arguments.length?(e=+d,u):e},u.y=function(d){return arguments.length?(r=+d,u):r},u.z=function(d){return arguments.length?(i=+d,u):i},u}const{abs:Un,cos:ge,sin:_n,acos:G0,atan2:Hn,sqrt:Ie,pow:Ht}=Math;function qn(n){return n<0?-Ht(-n,1/3):Ht(n,1/3)}const md=Math.PI,Zr=2*md,Oe=md/2,W0=1e-6,wo=Number.MAX_SAFE_INTEGER||9007199254740991,Co=Number.MIN_SAFE_INTEGER||-9007199254740991,Y0={x:0,y:0,z:0},O={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(n,e){const r=e(n);let i=r.x*r.x+r.y*r.y;return typeof r.z<"u"&&(i+=r.z*r.z),Ie(i)},compute:function(n,e,r){if(n===0)return e[0].t=0,e[0];const i=e.length-1;if(n===1)return e[i].t=1,e[i];const o=1-n;let s=e;if(i===0)return e[0].t=n,e[0];if(i===1){const l={x:o*s[0].x+n*s[1].x,y:o*s[0].y+n*s[1].y,t:n};return r&&(l.z=o*s[0].z+n*s[1].z),l}if(i<4){let l=o*o,c=n*n,u,h,d,f=0;i===2?(s=[s[0],s[1],s[2],Y0],u=l,h=o*n*2,d=c):i===3&&(u=l*o,h=l*n*3,d=o*c*3,f=n*c);const p={x:u*s[0].x+h*s[1].x+d*s[2].x+f*s[3].x,y:u*s[0].y+h*s[1].y+d*s[2].y+f*s[3].y,t:n};return r&&(p.z=u*s[0].z+h*s[1].z+d*s[2].z+f*s[3].z),p}const a=JSON.parse(JSON.stringify(e));for(;a.length>1;){for(let l=0;l<a.length-1;l++)a[l]={x:a[l].x+(a[l+1].x-a[l].x)*n,y:a[l].y+(a[l+1].y-a[l].y)*n},typeof a[l].z<"u"&&(a[l].z=a[l].z+(a[l+1].z-a[l].z)*n);a.splice(a.length-1,1)}return a[0].t=n,a[0]},computeWithRatios:function(n,e,r,i){const o=1-n,s=r,a=e;let l=s[0],c=s[1],u=s[2],h=s[3],d;if(l*=o,c*=n,a.length===2)return d=l+c,{x:(l*a[0].x+c*a[1].x)/d,y:(l*a[0].y+c*a[1].y)/d,z:i?(l*a[0].z+c*a[1].z)/d:!1,t:n};if(l*=o,c*=2*o,u*=n*n,a.length===3)return d=l+c+u,{x:(l*a[0].x+c*a[1].x+u*a[2].x)/d,y:(l*a[0].y+c*a[1].y+u*a[2].y)/d,z:i?(l*a[0].z+c*a[1].z+u*a[2].z)/d:!1,t:n};if(l*=o,c*=1.5*o,u*=3*o,h*=n*n*n,a.length===4)return d=l+c+u+h,{x:(l*a[0].x+c*a[1].x+u*a[2].x+h*a[3].x)/d,y:(l*a[0].y+c*a[1].y+u*a[2].y+h*a[3].y)/d,z:i?(l*a[0].z+c*a[1].z+u*a[2].z+h*a[3].z)/d:!1,t:n}},derive:function(n,e){const r=[];for(let i=n,o=i.length,s=o-1;o>1;o--,s--){const a=[];for(let l=0,c;l<s;l++)c={x:s*(i[l+1].x-i[l].x),y:s*(i[l+1].y-i[l].y)},e&&(c.z=s*(i[l+1].z-i[l].z)),a.push(c);r.push(a),i=a}return r},between:function(n,e,r){return e<=n&&n<=r||O.approximately(n,e)||O.approximately(n,r)},approximately:function(n,e,r){return Un(n-e)<=(r||W0)},length:function(n){const r=O.Tvalues.length;let i=0;for(let o=0,s;o<r;o++)s=.5*O.Tvalues[o]+.5,i+=O.Cvalues[o]*O.arcfn(s,n);return .5*i},map:function(n,e,r,i,o){const s=r-e,a=o-i,l=n-e,c=l/s;return i+a*c},lerp:function(n,e,r){const i={x:e.x+n*(r.x-e.x),y:e.y+n*(r.y-e.y)};return e.z!==void 0&&r.z!==void 0&&(i.z=e.z+n*(r.z-e.z)),i},pointToString:function(n){let e=n.x+"/"+n.y;return typeof n.z<"u"&&(e+="/"+n.z),e},pointsToString:function(n){return"["+n.map(O.pointToString).join(", ")+"]"},copy:function(n){return JSON.parse(JSON.stringify(n))},angle:function(n,e,r){const i=e.x-n.x,o=e.y-n.y,s=r.x-n.x,a=r.y-n.y,l=i*a-o*s,c=i*s+o*a;return Hn(l,c)},round:function(n,e){const r=""+n,i=r.indexOf(".");return parseFloat(r.substring(0,i+1+e))},dist:function(n,e){const r=n.x-e.x,i=n.y-e.y;return Ie(r*r+i*i)},closest:function(n,e){let r=Ht(2,63),i,o;return n.forEach(function(s,a){o=O.dist(e,s),o<r&&(r=o,i=a)}),{mdist:r,mpos:i}},abcratio:function(n,e){if(e!==2&&e!==3)return!1;if(typeof n>"u")n=.5;else if(n===0||n===1)return n;const r=Ht(n,e)+Ht(1-n,e),i=r-1;return Un(i/r)},projectionratio:function(n,e){if(e!==2&&e!==3)return!1;if(typeof n>"u")n=.5;else if(n===0||n===1)return n;const r=Ht(1-n,e),i=Ht(n,e)+r;return r/i},lli8:function(n,e,r,i,o,s,a,l){const c=(n*i-e*r)*(o-a)-(n-r)*(o*l-s*a),u=(n*i-e*r)*(s-l)-(e-i)*(o*l-s*a),h=(n-r)*(s-l)-(e-i)*(o-a);return h==0?!1:{x:c/h,y:u/h}},lli4:function(n,e,r,i){const o=n.x,s=n.y,a=e.x,l=e.y,c=r.x,u=r.y,h=i.x,d=i.y;return O.lli8(o,s,a,l,c,u,h,d)},lli:function(n,e){return O.lli4(n,n.c,e,e.c)},makeline:function(n,e){return new it(n.x,n.y,(n.x+e.x)/2,(n.y+e.y)/2,e.x,e.y)},findbbox:function(n){let e=wo,r=wo,i=Co,o=Co;return n.forEach(function(s){const a=s.bbox();e>a.x.min&&(e=a.x.min),r>a.y.min&&(r=a.y.min),i<a.x.max&&(i=a.x.max),o<a.y.max&&(o=a.y.max)}),{x:{min:e,mid:(e+i)/2,max:i,size:i-e},y:{min:r,mid:(r+o)/2,max:o,size:o-r}}},shapeintersections:function(n,e,r,i,o){if(!O.bboxoverlap(e,i))return[];const s=[],a=[n.startcap,n.forward,n.back,n.endcap],l=[r.startcap,r.forward,r.back,r.endcap];return a.forEach(function(c){c.virtual||l.forEach(function(u){if(u.virtual)return;const h=c.intersects(u,o);h.length>0&&(h.c1=c,h.c2=u,h.s1=n,h.s2=r,s.push(h))})}),s},makeshape:function(n,e,r){const i=e.points.length,o=n.points.length,s=O.makeline(e.points[i-1],n.points[0]),a=O.makeline(n.points[o-1],e.points[0]),l={startcap:s,forward:n,back:e,endcap:a,bbox:O.findbbox([s,n,e,a])};return l.intersections=function(c){return O.shapeintersections(l,l.bbox,c,c.bbox,r)},l},getminmax:function(n,e,r){if(!r)return{min:0,max:0};let i=wo,o=Co,s,a;r.indexOf(0)===-1&&(r=[0].concat(r)),r.indexOf(1)===-1&&r.push(1);for(let l=0,c=r.length;l<c;l++)s=r[l],a=n.get(s),a[e]<i&&(i=a[e]),a[e]>o&&(o=a[e]);return{min:i,mid:(i+o)/2,max:o,size:o-i}},align:function(n,e){const r=e.p1.x,i=e.p1.y,o=-Hn(e.p2.y-i,e.p2.x-r),s=function(a){return{x:(a.x-r)*ge(o)-(a.y-i)*_n(o),y:(a.x-r)*_n(o)+(a.y-i)*ge(o)}};return n.map(s)},roots:function(n,e){e=e||{p1:{x:0,y:0},p2:{x:1,y:0}};const r=n.length-1,i=O.align(n,e),o=function(E){return 0<=E&&E<=1};if(r===2){const E=i[0].y,k=i[1].y,M=i[2].y,P=E-2*k+M;if(P!==0){const D=-Ie(k*k-E*M),R=-E+k,z=-(D+R)/P,A=-(-D+R)/P;return[z,A].filter(o)}else if(k!==M&&P===0)return[(2*k-M)/(2*k-2*M)].filter(o);return[]}const s=i[0].y,a=i[1].y,l=i[2].y,c=i[3].y;let u=-s+3*a-3*l+c,h=3*s-6*a+3*l,d=-3*s+3*a,f=s;if(O.approximately(u,0)){if(O.approximately(h,0))return O.approximately(d,0)?[]:[-f/d].filter(o);const E=Ie(d*d-4*h*f),k=2*h;return[(E-d)/k,(-d-E)/k].filter(o)}h/=u,d/=u,f/=u;const p=(3*d-h*h)/3,m=p/3,b=(2*h*h*h-9*h*d+27*f)/27,g=b/2,v=g*g+m*m*m;let x,w,_,y,C;if(v<0){const E=-p/3,k=E*E*E,M=Ie(k),P=-b/(2*M),D=P<-1?-1:P>1?1:P,R=G0(D),z=qn(M),A=2*z;return _=A*ge(R/3)-h/3,y=A*ge((R+Zr)/3)-h/3,C=A*ge((R+2*Zr)/3)-h/3,[_,y,C].filter(o)}else{if(v===0)return x=g<0?qn(-g):-qn(g),_=2*x-h/3,y=-x-h/3,[_,y].filter(o);{const E=Ie(v);return x=qn(-g+E),w=qn(g+E),[x-w-h/3].filter(o)}}},droots:function(n){if(n.length===3){const e=n[0],r=n[1],i=n[2],o=e-2*r+i;if(o!==0){const s=-Ie(r*r-e*i),a=-e+r,l=-(s+a)/o,c=-(-s+a)/o;return[l,c]}else if(r!==i&&o===0)return[(2*r-i)/(2*(r-i))];return[]}if(n.length===2){const e=n[0],r=n[1];return e!==r?[e/(e-r)]:[]}return[]},curvature:function(n,e,r,i,o){let s,a,l,c,u=0,h=0;const d=O.compute(n,e),f=O.compute(n,r),p=d.x*d.x+d.y*d.y;if(i?(s=Ie(Ht(d.y*f.z-f.y*d.z,2)+Ht(d.z*f.x-f.z*d.x,2)+Ht(d.x*f.y-f.x*d.y,2)),a=Ht(p+d.z*d.z,3/2)):(s=d.x*f.y-d.y*f.x,a=Ht(p,3/2)),s===0||a===0)return{k:0,r:0};if(u=s/a,h=a/s,!o){const m=O.curvature(n-.001,e,r,i,!0).k,b=O.curvature(n+.001,e,r,i,!0).k;c=(b-u+(u-m))/2,l=(Un(b-u)+Un(u-m))/2}return{k:u,r:h,dk:c,adk:l}},inflections:function(n){if(n.length<4)return[];const e=O.align(n,{p1:n[0],p2:n.slice(-1)[0]}),r=e[2].x*e[1].y,i=e[3].x*e[1].y,o=e[1].x*e[2].y,s=e[3].x*e[2].y,a=18*(-3*r+2*i+3*o-s),l=18*(3*r-i-3*o),c=18*(o-r);if(O.approximately(a,0)){if(!O.approximately(l,0)){let f=-c/l;if(0<=f&&f<=1)return[f]}return[]}const u=2*a;if(O.approximately(u,0))return[];const h=l*l-4*a*c;if(h<0)return[];const d=Math.sqrt(h);return[(d-l)/u,-(l+d)/u].filter(function(f){return 0<=f&&f<=1})},bboxoverlap:function(n,e){const r=["x","y"],i=r.length;for(let o=0,s,a,l,c;o<i;o++)if(s=r[o],a=n[s].mid,l=e[s].mid,c=(n[s].size+e[s].size)/2,Un(a-l)>=c)return!1;return!0},expandbox:function(n,e){e.x.min<n.x.min&&(n.x.min=e.x.min),e.y.min<n.y.min&&(n.y.min=e.y.min),e.z&&e.z.min<n.z.min&&(n.z.min=e.z.min),e.x.max>n.x.max&&(n.x.max=e.x.max),e.y.max>n.y.max&&(n.y.max=e.y.max),e.z&&e.z.max>n.z.max&&(n.z.max=e.z.max),n.x.mid=(n.x.min+n.x.max)/2,n.y.mid=(n.y.min+n.y.max)/2,n.z&&(n.z.mid=(n.z.min+n.z.max)/2),n.x.size=n.x.max-n.x.min,n.y.size=n.y.max-n.y.min,n.z&&(n.z.size=n.z.max-n.z.min)},pairiteration:function(n,e,r){const i=n.bbox(),o=e.bbox(),s=1e5,a=r||.5;if(i.x.size+i.y.size<a&&o.x.size+o.y.size<a)return[(s*(n._t1+n._t2)/2|0)/s+"/"+(s*(e._t1+e._t2)/2|0)/s];let l=n.split(.5),c=e.split(.5),u=[{left:l.left,right:c.left},{left:l.left,right:c.right},{left:l.right,right:c.right},{left:l.right,right:c.left}];u=u.filter(function(d){return O.bboxoverlap(d.left.bbox(),d.right.bbox())});let h=[];return u.length===0||(u.forEach(function(d){h=h.concat(O.pairiteration(d.left,d.right,a))}),h=h.filter(function(d,f){return h.indexOf(d)===f})),h},getccenter:function(n,e,r){const i=e.x-n.x,o=e.y-n.y,s=r.x-e.x,a=r.y-e.y,l=i*ge(Oe)-o*_n(Oe),c=i*_n(Oe)+o*ge(Oe),u=s*ge(Oe)-a*_n(Oe),h=s*_n(Oe)+a*ge(Oe),d=(n.x+e.x)/2,f=(n.y+e.y)/2,p=(e.x+r.x)/2,m=(e.y+r.y)/2,b=d+l,g=f+c,v=p+u,x=m+h,w=O.lli8(d,f,b,g,p,m,v,x),_=O.dist(w,n);let y=Hn(n.y-w.y,n.x-w.x),C=Hn(e.y-w.y,e.x-w.x),E=Hn(r.y-w.y,r.x-w.x),k;return y<E?((y>C||C>E)&&(y+=Zr),y>E&&(k=E,E=y,y=k)):E<C&&C<y?(k=E,E=y,y=k):E+=Zr,w.s=y,w.e=E,w.r=_,w},numberSort:function(n,e){return n-e}};class dr{constructor(e){this.curves=[],this._3d=!1,e&&(this.curves=e,this._3d=this.curves[0]._3d)}valueOf(){return this.toString()}toString(){return"["+this.curves.map(function(e){return O.pointsToString(e.points)}).join(", ")+"]"}addCurve(e){this.curves.push(e),this._3d=this._3d||e._3d}length(){return this.curves.map(function(e){return e.length()}).reduce(function(e,r){return e+r})}curve(e){return this.curves[e]}bbox(){const e=this.curves;for(var r=e[0].bbox(),i=1;i<e.length;i++)O.expandbox(r,e[i].bbox());return r}offset(e){const r=[];return this.curves.forEach(function(i){r.push(...i.offset(e))}),new dr(r)}}const{abs:Kn,min:Yl,max:Xl,cos:X0,sin:Z0,acos:J0,sqrt:Gn}=Math,Q0=Math.PI;class it{constructor(e){let r=e&&e.forEach?e:Array.from(arguments).slice(),i=!1;if(typeof r[0]=="object"){i=r.length;const p=[];r.forEach(function(m){["x","y","z"].forEach(function(b){typeof m[b]<"u"&&p.push(m[b])})}),r=p}let o=!1;const s=r.length;if(i){if(i>4){if(arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");o=!0}}else if(s!==6&&s!==8&&s!==9&&s!==12&&arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");const a=this._3d=!o&&(s===9||s===12)||e&&e[0]&&typeof e[0].z<"u",l=this.points=[];for(let p=0,m=a?3:2;p<s;p+=m){var c={x:r[p],y:r[p+1]};a&&(c.z=r[p+2]),l.push(c)}const u=this.order=l.length-1,h=this.dims=["x","y"];a&&h.push("z"),this.dimlen=h.length;const d=O.align(l,{p1:l[0],p2:l[u]}),f=O.dist(l[0],l[u]);this._linear=d.reduce((p,m)=>p+Kn(m.y),0)<f/50,this._lut=[],this._t1=0,this._t2=1,this.update()}static quadraticFromPoints(e,r,i,o){if(typeof o>"u"&&(o=.5),o===0)return new it(r,r,i);if(o===1)return new it(e,r,r);const s=it.getABC(2,e,r,i,o);return new it(e,s.A,i)}static cubicFromPoints(e,r,i,o,s){typeof o>"u"&&(o=.5);const a=it.getABC(3,e,r,i,o);typeof s>"u"&&(s=O.dist(r,a.C));const l=s*(1-o)/o,c=O.dist(e,i),u=(i.x-e.x)/c,h=(i.y-e.y)/c,d=s*u,f=s*h,p=l*u,m=l*h,b={x:r.x-d,y:r.y-f},g={x:r.x+p,y:r.y+m},v=a.A,x={x:v.x+(b.x-v.x)/(1-o),y:v.y+(b.y-v.y)/(1-o)},w={x:v.x+(g.x-v.x)/o,y:v.y+(g.y-v.y)/o},_={x:e.x+(x.x-e.x)/o,y:e.y+(x.y-e.y)/o},y={x:i.x+(w.x-i.x)/(1-o),y:i.y+(w.y-i.y)/(1-o)};return new it(e,_,y,i)}static getUtils(){return O}getUtils(){return it.getUtils()}static get PolyBezier(){return dr}valueOf(){return this.toString()}toString(){return O.pointsToString(this.points)}toSVG(){if(this._3d)return!1;const e=this.points,r=e[0].x,i=e[0].y,o=["M",r,i,this.order===2?"Q":"C"];for(let s=1,a=e.length;s<a;s++)o.push(e[s].x),o.push(e[s].y);return o.join(" ")}setRatios(e){if(e.length!==this.points.length)throw new Error("incorrect number of ratio values");this.ratios=e,this._lut=[]}verify(){const e=this.coordDigest();e!==this._print&&(this._print=e,this.update())}coordDigest(){return this.points.map(function(e,r){return""+r+e.x+e.y+(e.z?e.z:0)}).join("")}update(){this._lut=[],this.dpoints=O.derive(this.points,this._3d),this.computedirection()}computedirection(){const e=this.points,r=O.angle(e[0],e[this.order],e[1]);this.clockwise=r>0}length(){return O.length(this.derivative.bind(this))}static getABC(e=2,r,i,o,s=.5){const a=O.projectionratio(s,e),l=1-a,c={x:a*r.x+l*o.x,y:a*r.y+l*o.y},u=O.abcratio(s,e);return{A:{x:i.x+(i.x-c.x)/u,y:i.y+(i.y-c.y)/u},B:i,C:c,S:r,E:o}}getABC(e,r){r=r||this.get(e);let i=this.points[0],o=this.points[this.order];return it.getABC(this.order,i,r,o,e)}getLUT(e){if(this.verify(),e=e||100,this._lut.length===e+1)return this._lut;this._lut=[],e++,this._lut=[];for(let r=0,i,o;r<e;r++)o=r/(e-1),i=this.compute(o),i.t=o,this._lut.push(i);return this._lut}on(e,r){r=r||5;const i=this.getLUT(),o=[];for(let s=0,a,l=0;s<i.length;s++)a=i[s],O.dist(a,e)<r&&(o.push(a),l+=s/i.length);return o.length?t/=o.length:!1}project(e){const r=this.getLUT(),i=r.length-1,o=O.closest(r,e),s=o.mpos,a=(s-1)/i,l=(s+1)/i,c=.1/i;let u=o.mdist,h=a,d=h,f;u+=1;for(let p;h<l+c;h+=c)f=this.compute(h),p=O.dist(e,f),p<u&&(u=p,d=h);return d=d<0?0:d>1?1:d,f=this.compute(d),f.t=d,f.d=u,f}get(e){return this.compute(e)}point(e){return this.points[e]}compute(e){return this.ratios?O.computeWithRatios(e,this.points,this.ratios,this._3d):O.compute(e,this.points,this._3d,this.ratios)}raise(){const e=this.points,r=[e[0]],i=e.length;for(let o=1,s,a;o<i;o++)s=e[o],a=e[o-1],r[o]={x:(i-o)/i*s.x+o/i*a.x,y:(i-o)/i*s.y+o/i*a.y};return r[i]=e[i-1],new it(r)}derivative(e){return O.compute(e,this.dpoints[0],this._3d)}dderivative(e){return O.compute(e,this.dpoints[1],this._3d)}align(){let e=this.points;return new it(O.align(e,{p1:e[0],p2:e[e.length-1]}))}curvature(e){return O.curvature(e,this.dpoints[0],this.dpoints[1],this._3d)}inflections(){return O.inflections(this.points)}normal(e){return this._3d?this.__normal3(e):this.__normal2(e)}__normal2(e){const r=this.derivative(e),i=Gn(r.x*r.x+r.y*r.y);return{t:e,x:-r.y/i,y:r.x/i}}__normal3(e){const r=this.derivative(e),i=this.derivative(e+.01),o=Gn(r.x*r.x+r.y*r.y+r.z*r.z),s=Gn(i.x*i.x+i.y*i.y+i.z*i.z);r.x/=o,r.y/=o,r.z/=o,i.x/=s,i.y/=s,i.z/=s;const a={x:i.y*r.z-i.z*r.y,y:i.z*r.x-i.x*r.z,z:i.x*r.y-i.y*r.x},l=Gn(a.x*a.x+a.y*a.y+a.z*a.z);a.x/=l,a.y/=l,a.z/=l;const c=[a.x*a.x,a.x*a.y-a.z,a.x*a.z+a.y,a.x*a.y+a.z,a.y*a.y,a.y*a.z-a.x,a.x*a.z-a.y,a.y*a.z+a.x,a.z*a.z];return{t:e,x:c[0]*r.x+c[1]*r.y+c[2]*r.z,y:c[3]*r.x+c[4]*r.y+c[5]*r.z,z:c[6]*r.x+c[7]*r.y+c[8]*r.z}}hull(e){let r=this.points,i=[],o=[],s=0;for(o[s++]=r[0],o[s++]=r[1],o[s++]=r[2],this.order===3&&(o[s++]=r[3]);r.length>1;){i=[];for(let a=0,l,c=r.length-1;a<c;a++)l=O.lerp(e,r[a],r[a+1]),o[s++]=l,i.push(l);r=i}return o}split(e,r){if(e===0&&r)return this.split(r).left;if(r===1)return this.split(e).right;const i=this.hull(e),o={left:this.order===2?new it([i[0],i[3],i[5]]):new it([i[0],i[4],i[7],i[9]]),right:this.order===2?new it([i[5],i[4],i[2]]):new it([i[9],i[8],i[6],i[3]]),span:i};return o.left._t1=O.map(0,0,1,this._t1,this._t2),o.left._t2=O.map(e,0,1,this._t1,this._t2),o.right._t1=O.map(e,0,1,this._t1,this._t2),o.right._t2=O.map(1,0,1,this._t1,this._t2),r?(r=O.map(r,e,1,0,1),o.right.split(r).left):o}extrema(){const e={};let r=[];return this.dims.forEach((function(i){let o=function(a){return a[i]},s=this.dpoints[0].map(o);e[i]=O.droots(s),this.order===3&&(s=this.dpoints[1].map(o),e[i]=e[i].concat(O.droots(s))),e[i]=e[i].filter(function(a){return a>=0&&a<=1}),r=r.concat(e[i].sort(O.numberSort))}).bind(this)),e.values=r.sort(O.numberSort).filter(function(i,o){return r.indexOf(i)===o}),e}bbox(){const e=this.extrema(),r={};return this.dims.forEach((function(i){r[i]=O.getminmax(this,i,e[i])}).bind(this)),r}overlaps(e){const r=this.bbox(),i=e.bbox();return O.bboxoverlap(r,i)}offset(e,r){if(typeof r<"u"){const i=this.get(e),o=this.normal(e),s={c:i,n:o,x:i.x+o.x*r,y:i.y+o.y*r};return this._3d&&(s.z=i.z+o.z*r),s}if(this._linear){const i=this.normal(0),o=this.points.map(function(s){const a={x:s.x+e*i.x,y:s.y+e*i.y};return s.z&&i.z&&(a.z=s.z+e*i.z),a});return[new it(o)]}return this.reduce().map(function(i){return i._linear?i.offset(e)[0]:i.scale(e)})}simple(){if(this.order===3){const o=O.angle(this.points[0],this.points[3],this.points[1]),s=O.angle(this.points[0],this.points[3],this.points[2]);if(o>0&&s<0||o<0&&s>0)return!1}const e=this.normal(0),r=this.normal(1);let i=e.x*r.x+e.y*r.y;return this._3d&&(i+=e.z*r.z),Kn(J0(i))<Q0/3}reduce(){let e,r=0,i=0,o=.01,s,a=[],l=[],c=this.extrema().values;for(c.indexOf(0)===-1&&(c=[0].concat(c)),c.indexOf(1)===-1&&c.push(1),r=c[0],e=1;e<c.length;e++)i=c[e],s=this.split(r,i),s._t1=r,s._t2=i,a.push(s),r=i;return a.forEach(function(u){for(r=0,i=0;i<=1;)for(i=r+o;i<=1+o;i+=o)if(s=u.split(r,i),!s.simple()){if(i-=o,Kn(r-i)<o)return[];s=u.split(r,i),s._t1=O.map(r,0,1,u._t1,u._t2),s._t2=O.map(i,0,1,u._t1,u._t2),l.push(s),r=i;break}r<1&&(s=u.split(r,1),s._t1=O.map(r,0,1,u._t1,u._t2),s._t2=u._t2,l.push(s))}),l}translate(e,r,i){i=typeof i=="number"?i:r;const o=this.order;let s=this.points.map((a,l)=>(1-l/o)*r+l/o*i);return new it(this.points.map((a,l)=>({x:a.x+e.x*s[l],y:a.y+e.y*s[l]})))}scale(e){const r=this.order;let i=!1;if(typeof e=="function"&&(i=e),i&&r===2)return this.raise().scale(i);const o=this.clockwise,s=this.points;if(this._linear)return this.translate(this.normal(0),i?i(0):e,i?i(1):e);const a=i?i(0):e,l=i?i(1):e,c=[this.offset(0,10),this.offset(1,10)],u=[],h=O.lli4(c[0],c[0].c,c[1],c[1].c);if(!h)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach(function(d){const f=u[d*r]=O.copy(s[d*r]);f.x+=(d?l:a)*c[d].n.x,f.y+=(d?l:a)*c[d].n.y}),i?([0,1].forEach(function(d){if(!(r===2&&d)){var f=s[d+1],p={x:f.x-h.x,y:f.y-h.y},m=i?i((d+1)/r):e;i&&!o&&(m=-m);var b=Gn(p.x*p.x+p.y*p.y);p.x/=b,p.y/=b,u[d+1]={x:f.x+m*p.x,y:f.y+m*p.y}}}),new it(u)):([0,1].forEach(d=>{if(r===2&&d)return;const f=u[d*r],p=this.derivative(d),m={x:f.x+p.x,y:f.y+p.y};u[d+1]=O.lli4(f,m,h,s[d+1])}),new it(u))}outline(e,r,i,o){if(r=r===void 0?e:r,this._linear){const y=this.normal(0),C=this.points[0],E=this.points[this.points.length-1];let k,M,P;i===void 0&&(i=e,o=r),k={x:C.x+y.x*e,y:C.y+y.y*e},P={x:E.x+y.x*i,y:E.y+y.y*i},M={x:(k.x+P.x)/2,y:(k.y+P.y)/2};const D=[k,M,P];k={x:C.x-y.x*r,y:C.y-y.y*r},P={x:E.x-y.x*o,y:E.y-y.y*o},M={x:(k.x+P.x)/2,y:(k.y+P.y)/2};const R=[P,M,k],z=O.makeline(R[2],D[0]),A=O.makeline(D[2],R[0]),I=[z,new it(D),A,new it(R)];return new dr(I)}const s=this.reduce(),a=s.length,l=[];let c=[],u,h=0,d=this.length();const f=typeof i<"u"&&typeof o<"u";function p(y,C,E,k,M){return function(P){const D=k/E,R=(k+M)/E,z=C-y;return O.map(P,0,1,y+D*z,y+R*z)}}s.forEach(function(y){const C=y.length();f?(l.push(y.scale(p(e,i,d,h,C))),c.push(y.scale(p(-r,-o,d,h,C)))):(l.push(y.scale(e)),c.push(y.scale(-r))),h+=C}),c=c.map(function(y){return u=y.points,u[3]?y.points=[u[3],u[2],u[1],u[0]]:y.points=[u[2],u[1],u[0]],y}).reverse();const m=l[0].points[0],b=l[a-1].points[l[a-1].points.length-1],g=c[a-1].points[c[a-1].points.length-1],v=c[0].points[0],x=O.makeline(g,m),w=O.makeline(b,v),_=[x].concat(l).concat([w]).concat(c);return new dr(_)}outlineshapes(e,r,i){r=r||e;const o=this.outline(e,r).curves,s=[];for(let a=1,l=o.length;a<l/2;a++){const c=O.makeshape(o[a],o[l-a],i);c.startcap.virtual=a>1,c.endcap.virtual=a<l/2-1,s.push(c)}return s}intersects(e,r){return e?e.p1&&e.p2?this.lineIntersects(e):(e instanceof it&&(e=e.reduce()),this.curveintersects(this.reduce(),e,r)):this.selfintersects(r)}lineIntersects(e){const r=Yl(e.p1.x,e.p2.x),i=Yl(e.p1.y,e.p2.y),o=Xl(e.p1.x,e.p2.x),s=Xl(e.p1.y,e.p2.y);return O.roots(this.points,e).filter(a=>{var l=this.get(a);return O.between(l.x,r,o)&&O.between(l.y,i,s)})}selfintersects(e){const r=this.reduce(),i=r.length-2,o=[];for(let s=0,a,l,c;s<i;s++)l=r.slice(s,s+1),c=r.slice(s+2),a=this.curveintersects(l,c,e),o.push(...a);return o}curveintersects(e,r,i){const o=[];e.forEach(function(a){r.forEach(function(l){a.overlaps(l)&&o.push({left:a,right:l})})});let s=[];return o.forEach(function(a){const l=O.pairiteration(a.left,a.right,i);l.length>0&&(s=s.concat(l))}),s}arcs(e){return e=e||.5,this._iterate(e,[])}_error(e,r,i,o){const s=(o-i)/4,a=this.get(i+s),l=this.get(o-s),c=O.dist(e,r),u=O.dist(e,a),h=O.dist(e,l);return Kn(u-c)+Kn(h-c)}_iterate(e,r){let i=0,o=1,s;do{s=0,o=1;let a=this.get(i),l,c,u,h,d=!1,f=!1,p,m=o,b=1;do if(f=d,h=u,m=(i+o)/2,l=this.get(m),c=this.get(o),u=O.getccenter(a,l,c),u.interval={start:i,end:o},d=this._error(u,a,i,o)<=e,p=f&&!d,p||(b=o),d){if(o>=1){if(u.interval.end=b=1,h=u,o>1){let v={x:u.x+u.r*X0(u.e),y:u.y+u.r*Z0(u.e)};u.e+=O.angle({x:u.x,y:u.y},v,this.get(1))}break}o=o+(o-i)/2}else o=m;while(!p&&s++<100);if(s>=100)break;h=h||u,r.push(h),i=b}while(o<1);return r}}function us(n,e){(e==null||e>n.length)&&(e=n.length);for(var r=0,i=Array(e);r<e;r++)i[r]=n[r];return i}function t_(n){if(Array.isArray(n))return n}function e_(n){if(Array.isArray(n))return us(n)}function n_(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function r_(n,e){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var i,o,s,a,l=[],c=!0,u=!1;try{if(s=(r=r.call(n)).next,e!==0)for(;!(c=(i=s.call(r)).done)&&(l.push(i.value),l.length!==e);c=!0);}catch(h){u=!0,o=h}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}function i_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o_(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s_(n,e){if(n==null)return{};var r,i,o=a_(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i<s.length;i++)r=s[i],e.includes(r)||{}.propertyIsEnumerable.call(n,r)&&(o[r]=n[r])}return o}function a_(n,e){if(n==null)return{};var r={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.includes(i))continue;r[i]=n[i]}return r}function l_(n,e){return t_(n)||r_(n,e)||gd(n,e)||i_()}function c_(n){return e_(n)||n_(n)||gd(n)||o_()}function u_(n,e){if(typeof n!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var i=r.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function d_(n){var e=u_(n,"string");return typeof e=="symbol"?e:e+""}function gd(n,e){if(n){if(typeof n=="string")return us(n,e);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?us(n,e):void 0}}var h_=(function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=(e instanceof Array?e.length?e:[void 0]:[e]).map(function(l){return{keyAccessor:l,isProp:!(l instanceof Function)}}),s=n.reduce(function(l,c){var u=l,h=c;return o.forEach(function(d,f){var p=d.keyAccessor,m=d.isProp,b;if(m){var g=h,v=g[p],x=s_(g,[p].map(d_));b=v,h=x}else b=p(h,f);f+1<o.length?(u.hasOwnProperty(b)||(u[b]={}),u=u[b]):r?(u.hasOwnProperty(b)||(u[b]=[]),u[b].push(h)):u[b]=h}),l},{});r instanceof Function&&(function l(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;u===o.length?Object.keys(c).forEach(function(h){return c[h]=r(c[h])}):Object.values(c).forEach(function(h){return l(h,u+1)})})(s);var a=s;return i&&(a=[],(function l(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];u.length===o.length?a.push({keys:u,vals:c}):Object.entries(c).forEach(function(h){var d=l_(h,2),f=d[0],p=d[1];return l(p,[].concat(c_(u),[f]))})})(s),e instanceof Array&&e.length===0&&a.length===1&&(a[0].keys=[])),a});function p_(n,e){switch(arguments.length){case 0:break;case 1:this.range(n);break;default:this.range(e).domain(n);break}return this}const Zl=Symbol("implicit");function bd(){var n=new Map,e=[],r=[],i=Zl;function o(s){var a=s+"",l=n.get(a);if(!l){if(i!==Zl)return i;n.set(a,l=e.push(s))}return r[(l-1)%r.length]}return o.domain=function(s){if(!arguments.length)return e.slice();e=[],n=new Map;for(const a of s){const l=a+"";n.has(l)||n.set(l,e.push(a))}return o},o.range=function(s){return arguments.length?(r=Array.from(s),o):r.slice()},o.unknown=function(s){return arguments.length?(i=s,o):i},o.copy=function(){return bd(e,r).unknown(i)},p_.apply(o,arguments),o}function f_(n){for(var e=n.length/6|0,r=new Array(e),i=0;i<e;)r[i]="#"+n.slice(i*6,++i*6);return r}const v_=f_("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");function m_(n,e){e===void 0&&(e={});var r=e.insertAt;if(!(typeof document>"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}}var g_=`.force-graph-container canvas {
18
+ display: block;
19
+ user-select: none;
20
+ outline: none;
21
+ -webkit-tap-highlight-color: transparent;
22
+ }
23
+
24
+ .force-graph-container .clickable {
25
+ cursor: pointer;
26
+ }
27
+
28
+ .force-graph-container .grabbable {
29
+ cursor: move;
30
+ cursor: grab;
31
+ cursor: -moz-grab;
32
+ cursor: -webkit-grab;
33
+ }
34
+
35
+ .force-graph-container .grabbable:active {
36
+ cursor: grabbing;
37
+ cursor: -moz-grabbing;
38
+ cursor: -webkit-grabbing;
39
+ }
40
+ `;m_(g_);function ds(n,e){(e==null||e>n.length)&&(e=n.length);for(var r=0,i=Array(e);r<e;r++)i[r]=n[r];return i}function b_(n){if(Array.isArray(n))return n}function __(n){if(Array.isArray(n))return ds(n)}function Jl(n,e,r){if(_d())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var o=new(n.bind.apply(n,i));return o}function br(n,e,r){return(e=k_(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function _d(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_d=function(){return!!n})()}function y_(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function x_(n,e){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var i,o,s,a,l=[],c=!0,u=!1;try{if(s=(r=r.call(n)).next,e!==0)for(;!(c=(i=s.call(r)).done)&&(l.push(i.value),l.length!==e);c=!0);}catch(h){u=!0,o=h}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}function w_(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
41
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C_(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
42
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ql(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),r.push.apply(r,i)}return r}function yn(n){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ql(Object(r),!0).forEach(function(i){br(n,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Ql(Object(r)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(r,i))})}return n}function hr(n,e){return b_(n)||x_(n,e)||yd(n,e)||w_()}function Kt(n){return __(n)||y_(n)||yd(n)||C_()}function E_(n,e){if(typeof n!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var i=r.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function k_(n){var e=E_(n,"string");return typeof e=="symbol"?e:e+""}function hs(n){"@babel/helpers - typeof";return hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hs(n)}function yd(n,e){if(n){if(typeof n=="string")return ds(n,e);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ds(n,e):void 0}}var A_=bd(v_);function tc(n,e,r){!e||typeof r!="string"||n.filter(function(i){return!i[r]}).forEach(function(i){i[r]=A_(e(i))})}function P_(n,e){var r=n.nodes,i=n.links,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=o.nodeFilter,a=s===void 0?function(){return!0}:s,l=o.onLoopError,c=l===void 0?function(p){throw"Invalid DAG structure! Found cycle in node path: ".concat(p.join(" -> "),".")}:l,u={};r.forEach(function(p){return u[e(p)]={data:p,out:[],depth:-1,skip:!a(p)}}),i.forEach(function(p){var m=p.source,b=p.target,g=_(m),v=_(b);if(!u.hasOwnProperty(g))throw"Missing source node with id: ".concat(g);if(!u.hasOwnProperty(v))throw"Missing target node with id: ".concat(v);var x=u[g],w=u[v];x.out.push(w);function _(y){return hs(y)==="object"?e(y):y}});var h=[];f(Object.values(u));var d=Object.assign.apply(Object,[{}].concat(Kt(Object.entries(u).filter(function(p){var m=hr(p,2),b=m[1];return!b.skip}).map(function(p){var m=hr(p,2),b=m[0],g=m[1];return br({},b,g.depth)}))));return d;function f(p){for(var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,g=function(){var _=p[v];if(m.indexOf(_)!==-1){var y=[].concat(Kt(m.slice(m.indexOf(_))),[_]).map(function(C){return e(C.data)});return h.some(function(C){return C.length===y.length&&C.every(function(E,k){return E===y[k]})})||(h.push(y),c(y)),1}b>_.depth&&(_.depth=b,f(_.out,[].concat(Kt(m),[_]),b+(_.skip?0:1)))},v=0,x=p.length;v<x;v++)g()}}var S_=2,_t=function(e,r){return r.onNeedsRedraw&&r.onNeedsRedraw()},ec=function(e,r){if(!r.isShadow){var i=Q(r.linkDirectionalParticles);r.graphData.links.forEach(function(o){var s=Math.round(Math.abs(i(o)));s?o.__photons=Kt(Array(s)).map(function(){return{}}):delete o.__photons})}},Ni=ra({props:{graphData:{default:{nodes:[],links:[]},onChange:function(e,r){r.engineRunning=!1,ec(e,r)}},dagMode:{onChange:function(e,r){!e&&(r.graphData.nodes||[]).forEach(function(i){return i.fx=i.fy=void 0})}},dagLevelDistance:{},dagNodeFilter:{default:function(e){return!0}},onDagError:{triggerUpdate:!1},nodeRelSize:{default:4,triggerUpdate:!1,onChange:_t},nodeId:{default:"id"},nodeVal:{default:"val",triggerUpdate:!1,onChange:_t},nodeColor:{default:"color",triggerUpdate:!1,onChange:_t},nodeAutoColorBy:{},nodeCanvasObject:{triggerUpdate:!1,onChange:_t},nodeCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:_t},nodeVisibility:{default:!0,triggerUpdate:!1,onChange:_t},linkSource:{default:"source"},linkTarget:{default:"target"},linkVisibility:{default:!0,triggerUpdate:!1,onChange:_t},linkColor:{default:"color",triggerUpdate:!1,onChange:_t},linkAutoColorBy:{},linkLineDash:{triggerUpdate:!1,onChange:_t},linkWidth:{default:1,triggerUpdate:!1,onChange:_t},linkCurvature:{default:0,triggerUpdate:!1,onChange:_t},linkCanvasObject:{triggerUpdate:!1,onChange:_t},linkCanvasObjectMode:{default:function(){return"replace"},triggerUpdate:!1,onChange:_t},linkDirectionalArrowLength:{default:0,triggerUpdate:!1,onChange:_t},linkDirectionalArrowColor:{triggerUpdate:!1,onChange:_t},linkDirectionalArrowRelPos:{default:.5,triggerUpdate:!1,onChange:_t},linkDirectionalParticles:{default:0,triggerUpdate:!1,onChange:ec},linkDirectionalParticleSpeed:{default:.01,triggerUpdate:!1},linkDirectionalParticleOffset:{default:0,triggerUpdate:!1},linkDirectionalParticleWidth:{default:4,triggerUpdate:!1},linkDirectionalParticleColor:{triggerUpdate:!1},linkDirectionalParticleCanvasObject:{triggerUpdate:!1},globalScale:{default:1,triggerUpdate:!1},d3AlphaMin:{default:0,triggerUpdate:!1},d3AlphaDecay:{default:.0228,triggerUpdate:!1,onChange:function(e,r){r.forceLayout.alphaDecay(e)}},d3AlphaTarget:{default:0,triggerUpdate:!1,onChange:function(e,r){r.forceLayout.alphaTarget(e)}},d3VelocityDecay:{default:.4,triggerUpdate:!1,onChange:function(e,r){r.forceLayout.velocityDecay(e)}},warmupTicks:{default:0,triggerUpdate:!1},cooldownTicks:{default:1/0,triggerUpdate:!1},cooldownTime:{default:15e3,triggerUpdate:!1},onUpdate:{default:function(){},triggerUpdate:!1},onFinishUpdate:{default:function(){},triggerUpdate:!1},onEngineTick:{default:function(){},triggerUpdate:!1},onEngineStop:{default:function(){},triggerUpdate:!1},onNeedsRedraw:{triggerUpdate:!1},isShadow:{default:!1,triggerUpdate:!1}},methods:{d3Force:function(e,r,i){return i===void 0?e.forceLayout.force(r):(e.forceLayout.force(r,i),this)},d3ReheatSimulation:function(e){return e.forceLayout.alpha(1),this.resetCountdown(),this},resetCountdown:function(e){return e.cntTicks=0,e.startTickTime=new Date,e.engineRunning=!0,this},isEngineRunning:function(e){return!!e.engineRunning},tickFrame:function(e){return!e.isShadow&&r(),o(),!e.isShadow&&s(),!e.isShadow&&a(),i(),this;function r(){e.engineRunning&&(++e.cntTicks>e.cooldownTicks||new Date-e.startTickTime>e.cooldownTime||e.d3AlphaMin>0&&e.forceLayout.alpha()<e.d3AlphaMin?(e.engineRunning=!1,e.onEngineStop()):(e.forceLayout.tick(),e.onEngineTick()))}function i(){var l=Q(e.nodeVisibility),c=Q(e.nodeVal),u=Q(e.nodeColor),h=Q(e.nodeCanvasObjectMode),d=e.ctx,f=e.isShadow/e.globalScale,p=e.graphData.nodes.filter(l);d.save(),p.forEach(function(m){var b=h(m);if(e.nodeCanvasObject&&(b==="before"||b==="replace")&&(e.nodeCanvasObject(m,d,e.globalScale),b==="replace")){d.restore();return}var g=Math.sqrt(Math.max(0,c(m)||1))*e.nodeRelSize+f;d.beginPath(),d.arc(m.x,m.y,g,0,2*Math.PI,!1),d.fillStyle=u(m)||"rgba(31, 120, 180, 0.92)",d.fill(),e.nodeCanvasObject&&b==="after"&&e.nodeCanvasObject(m,e.ctx,e.globalScale)}),d.restore()}function o(){var l=Q(e.linkVisibility),c=Q(e.linkColor),u=Q(e.linkWidth),h=Q(e.linkLineDash),d=Q(e.linkCurvature),f=Q(e.linkCanvasObjectMode),p=e.ctx,m=e.isShadow*2,b=e.graphData.links.filter(l);b.forEach(C);var g=[],v=[],x=b;if(e.linkCanvasObject){var w=[],_=[];b.forEach(function(E){return({before:g,after:v,replace:w}[f(E)]||_).push(E)}),x=[].concat(Kt(g),v,_),g=g.concat(w)}p.save(),g.forEach(function(E){return e.linkCanvasObject(E,p,e.globalScale)}),p.restore();var y=h_(x,[c,u,h]);p.save(),Object.entries(y).forEach(function(E){var k=hr(E,2),M=k[0],P=k[1],D=!M||M==="undefined"?"rgba(0,0,0,0.15)":M;Object.entries(P).forEach(function(R){var z=hr(R,2),A=z[0],I=z[1],S=(A||1)/e.globalScale+m;Object.entries(I).forEach(function(F){var V=hr(F,2);V[0];var U=V[1],q=h(U[0]);p.beginPath(),U.forEach(function(W){var Z=W.source,pt=W.target;if(!(!Z||!pt||!Z.hasOwnProperty("x")||!pt.hasOwnProperty("x"))){p.moveTo(Z.x,Z.y);var ht=W.__controlPoints;ht?p[ht.length===2?"quadraticCurveTo":"bezierCurveTo"].apply(p,Kt(ht).concat([pt.x,pt.y])):p.lineTo(pt.x,pt.y)}}),p.strokeStyle=D,p.lineWidth=S,p.setLineDash(q||[]),p.stroke()})})}),p.restore(),p.save(),v.forEach(function(E){return e.linkCanvasObject(E,p,e.globalScale)}),p.restore();function C(E){var k=d(E);if(!k){E.__controlPoints=null;return}var M=E.source,P=E.target;if(!(!M||!P||!M.hasOwnProperty("x")||!P.hasOwnProperty("x"))){var D=Math.sqrt(Math.pow(P.x-M.x,2)+Math.pow(P.y-M.y,2));if(D>0){var R=Math.atan2(P.y-M.y,P.x-M.x),z=D*k,A={x:(M.x+P.x)/2+z*Math.cos(R-Math.PI/2),y:(M.y+P.y)/2+z*Math.sin(R-Math.PI/2)};E.__controlPoints=[A.x,A.y]}else{var I=k*70;E.__controlPoints=[P.x,P.y-I,P.x+I,P.y]}}}}function s(){var l=1.6,c=.2,u=Q(e.linkDirectionalArrowLength),h=Q(e.linkDirectionalArrowRelPos),d=Q(e.linkVisibility),f=Q(e.linkDirectionalArrowColor||e.linkColor),p=Q(e.nodeVal),m=e.ctx;m.save(),e.graphData.links.filter(d).forEach(function(b){var g=u(b);if(!(!g||g<0)){var v=b.source,x=b.target;if(!(!v||!x||!v.hasOwnProperty("x")||!x.hasOwnProperty("x"))){var w=Math.sqrt(Math.max(0,p(v)||1))*e.nodeRelSize,_=Math.sqrt(Math.max(0,p(x)||1))*e.nodeRelSize,y=Math.min(1,Math.max(0,h(b))),C=f(b)||"rgba(0,0,0,0.28)",E=g/l/2,k=b.__controlPoints&&Jl(it,[v.x,v.y].concat(Kt(b.__controlPoints),[x.x,x.y])),M=k?function(S){return k.get(S)}:function(S){return{x:v.x+(x.x-v.x)*S||0,y:v.y+(x.y-v.y)*S||0}},P=k?k.length():Math.sqrt(Math.pow(x.x-v.x,2)+Math.pow(x.y-v.y,2)),D=w+g+(P-w-_-g)*y,R=M(D/P),z=M((D-g)/P),A=M((D-g*(1-c))/P),I=Math.atan2(R.y-z.y,R.x-z.x)-Math.PI/2;m.beginPath(),m.moveTo(R.x,R.y),m.lineTo(z.x+E*Math.cos(I),z.y+E*Math.sin(I)),m.lineTo(A.x,A.y),m.lineTo(z.x-E*Math.cos(I),z.y-E*Math.sin(I)),m.fillStyle=C,m.fill()}}}),m.restore()}function a(){var l=Q(e.linkDirectionalParticles),c=Q(e.linkDirectionalParticleSpeed),u=Q(e.linkDirectionalParticleOffset),h=Q(e.linkDirectionalParticleWidth),d=Q(e.linkVisibility),f=Q(e.linkDirectionalParticleColor||e.linkColor),p=e.ctx;p.save(),e.graphData.links.filter(d).forEach(function(m){var b=l(m);if(!(!m.hasOwnProperty("__photons")||!m.__photons.length)){var g=m.source,v=m.target;if(!(!g||!v||!g.hasOwnProperty("x")||!v.hasOwnProperty("x"))){var x=c(m),w=Math.abs(u(m)),_=m.__photons||[],y=Math.max(0,h(m)/2)/Math.sqrt(e.globalScale),C=f(m)||"rgba(0,0,0,0.28)";p.fillStyle=C;var E=m.__controlPoints?Jl(it,[g.x,g.y].concat(Kt(m.__controlPoints),[v.x,v.y])):null,k=0,M=!1;_.forEach(function(P){var D=!!P.__singleHop;if(P.hasOwnProperty("__progressRatio")||(P.__progressRatio=D?0:(k+w)/b),!D&&k++,P.__progressRatio+=x,P.__progressRatio>=1)if(!D)P.__progressRatio=P.__progressRatio%1;else{M=!0;return}var R=P.__progressRatio,z=E?E.get(R):{x:g.x+(v.x-g.x)*R||0,y:g.y+(v.y-g.y)*R||0};e.linkDirectionalParticleCanvasObject?e.linkDirectionalParticleCanvasObject(z.x,z.y,m,p,e.globalScale):(p.beginPath(),p.arc(z.x,z.y,y,0,2*Math.PI,!1),p.fill())}),M&&(m.__photons=m.__photons.filter(function(P){return!P.__singleHop||P.__progressRatio<=1}))}}}),p.restore()}},emitParticle:function(e,r){return r&&(!r.__photons&&(r.__photons=[]),r.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:H0().force("link",j0()).force("charge",q0()).force("center",zb()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(e,r){r.ctx=e},update:function(e,r){e.engineRunning=!1,e.onUpdate(),e.nodeAutoColorBy!==null&&tc(e.graphData.nodes,Q(e.nodeAutoColorBy),e.nodeColor),e.linkAutoColorBy!==null&&tc(e.graphData.links,Q(e.linkAutoColorBy),e.linkColor),e.graphData.links.forEach(function(f){f.source=f[e.linkSource],f.target=f[e.linkTarget]}),e.forceLayout.stop().alpha(1).nodes(e.graphData.nodes);var i=e.forceLayout.force("link");i&&i.id(function(f){return f[e.nodeId]}).links(e.graphData.links);var o=e.dagMode&&P_(e.graphData,function(f){return f[e.nodeId]},{nodeFilter:e.dagNodeFilter,onLoopError:e.onDagError||void 0}),s=Math.max.apply(Math,Kt(Object.values(o||[]))),a=e.dagLevelDistance||e.graphData.nodes.length/(s||1)*S_*(["radialin","radialout"].indexOf(e.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(r.dagMode)){var l=["lr","rl"].includes(r.dagMode)?"fx":"fy";e.graphData.nodes.filter(e.dagNodeFilter).forEach(function(f){return delete f[l]})}if(["lr","rl","td","bu"].includes(e.dagMode)){var c=["rl","bu"].includes(e.dagMode),u=function(p){return(o[p[e.nodeId]]-s/2)*a*(c?-1:1)},h=["lr","rl"].includes(e.dagMode)?"fx":"fy";e.graphData.nodes.filter(e.dagNodeFilter).forEach(function(f){return f[h]=u(f)})}e.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(e.dagMode)!==-1?K0(function(f){var p=o[f[e.nodeId]]||-1;return(e.dagMode==="radialin"?s-p:p)*a}).strength(function(f){return e.dagNodeFilter(f)?1:0}):null);for(var d=0;d<e.warmupTicks&&!(e.d3AlphaMin>0&&e.forceLayout.alpha()<e.d3AlphaMin);d++)e.forceLayout.tick();this.resetCountdown(),e.onFinishUpdate()}});function xd(n,e){var r=n instanceof Array?n:[n],i=new e;return i._destructor&&i._destructor(),{linkProp:function(s){return{default:i[s](),onChange:function(l,c){r.forEach(function(u){return c[u][s](l)})},triggerUpdate:!1}},linkMethod:function(s){return function(a){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];var h=[];return r.forEach(function(d){var f=a[d],p=f[s].apply(f,c);p!==f&&h.push(p)}),h.length?h[0]:this}}}}var M_=800,$_=4,T_=5,wd=xd("forceGraph",Ni),I_=xd(["forceGraph","shadowGraph"],Ni),O_=Object.assign.apply(Object,Kt(["nodeColor","nodeAutoColorBy","nodeCanvasObject","nodeCanvasObjectMode","linkColor","linkAutoColorBy","linkLineDash","linkWidth","linkCanvasObject","linkCanvasObjectMode","linkDirectionalArrowLength","linkDirectionalArrowColor","linkDirectionalArrowRelPos","linkDirectionalParticles","linkDirectionalParticleSpeed","linkDirectionalParticleOffset","linkDirectionalParticleWidth","linkDirectionalParticleColor","linkDirectionalParticleCanvasObject","dagMode","dagLevelDistance","dagNodeFilter","onDagError","d3AlphaMin","d3AlphaDecay","d3VelocityDecay","warmupTicks","cooldownTicks","cooldownTime","onEngineTick","onEngineStop"].map(function(n){return br({},n,wd.linkProp(n))})).concat(Kt(["nodeRelSize","nodeId","nodeVal","nodeVisibility","linkSource","linkTarget","linkVisibility","linkCurvature"].map(function(n){return br({},n,I_.linkProp(n))})))),D_=Object.assign.apply(Object,Kt(["d3Force","d3ReheatSimulation","emitParticle"].map(function(n){return br({},n,wd.linkMethod(n))})));function Eo(n){if(n.canvas){var e=n.canvas.width,r=n.canvas.height;e===300&&r===150&&(e=r=0);var i=window.devicePixelRatio;e/=i,r/=i,[n.canvas,n.shadowCanvas].forEach(function(s){s.style.width="".concat(n.width,"px"),s.style.height="".concat(n.height,"px"),s.width=n.width*i,s.height=n.height*i,!e&&!r&&s.getContext("2d").scale(i,i)});var o=te(n.canvas).k;n.zoom.translateBy(n.zoom.__baseElem,(n.width-e)/2/o,(n.height-r)/2/o),n.needsRedraw=!0}}function Cd(n){var e=window.devicePixelRatio;n.setTransform(e,0,0,e,0,0)}function nc(n,e,r){n.save(),Cd(n),n.clearRect(0,0,e,r),n.restore()}var R_=ra({props:yn({width:{default:window.innerWidth,onChange:function(e,r){return Eo(r)},triggerUpdate:!1},height:{default:window.innerHeight,onChange:function(e,r){return Eo(r)},triggerUpdate:!1},graphData:{default:{nodes:[],links:[]},onChange:function(e,r){[e.nodes,e.links].every(function(o){return(o||[]).every(function(s){return!s.hasOwnProperty("__indexColor")})})&&r.colorTracker.reset(),[{type:"Node",objs:e.nodes},{type:"Link",objs:e.links}].forEach(i),r.forceGraph.graphData(e),r.shadowGraph.graphData(e);function i(o){var s=o.type,a=o.objs;a.filter(function(l){if(!l.hasOwnProperty("__indexColor"))return!0;var c=r.colorTracker.lookup(l.__indexColor);return!c||!c.hasOwnProperty("d")||c.d!==l}).forEach(function(l){l.__indexColor=r.colorTracker.register({type:s,d:l})})}},triggerUpdate:!1},backgroundColor:{onChange:function(e,r){r.canvas&&e&&(r.canvas.style.background=e)},triggerUpdate:!1},nodeLabel:{default:"name",triggerUpdate:!1},nodePointerAreaPaint:{onChange:function(e,r){r.shadowGraph.nodeCanvasObject(e?function(i,o,s){return e(i,i.__indexColor,o,s)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkPointerAreaPaint:{onChange:function(e,r){r.shadowGraph.linkCanvasObject(e?function(i,o,s){return e(i,i.__indexColor,o,s)}:null),r.flushShadowCanvas&&r.flushShadowCanvas()},triggerUpdate:!1},linkLabel:{default:"name",triggerUpdate:!1},linkHoverPrecision:{default:4,triggerUpdate:!1},minZoom:{default:.01,onChange:function(e,r){r.zoom.scaleExtent([e,r.zoom.scaleExtent()[1]])},triggerUpdate:!1},maxZoom:{default:1e3,onChange:function(e,r){r.zoom.scaleExtent([r.zoom.scaleExtent()[0],e])},triggerUpdate:!1},enableNodeDrag:{default:!0,triggerUpdate:!1},enableZoomInteraction:{default:!0,triggerUpdate:!1},enablePanInteraction:{default:!0,triggerUpdate:!1},enableZoomPanInteraction:{default:!0,triggerUpdate:!1},enablePointerInteraction:{default:!0,onChange:function(e,r){r.hoverObj=null},triggerUpdate:!1},autoPauseRedraw:{default:!0,triggerUpdate:!1},onNodeDrag:{default:function(){},triggerUpdate:!1},onNodeDragEnd:{default:function(){},triggerUpdate:!1},onNodeClick:{triggerUpdate:!1},onNodeRightClick:{triggerUpdate:!1},onNodeHover:{triggerUpdate:!1},onLinkClick:{triggerUpdate:!1},onLinkRightClick:{triggerUpdate:!1},onLinkHover:{triggerUpdate:!1},onBackgroundClick:{triggerUpdate:!1},onBackgroundRightClick:{triggerUpdate:!1},showPointerCursor:{default:!0,triggerUpdate:!1},onZoom:{triggerUpdate:!1},onZoomEnd:{triggerUpdate:!1},onRenderFramePre:{triggerUpdate:!1},onRenderFramePost:{triggerUpdate:!1}},O_),aliases:{stopAnimation:"pauseAnimation"},methods:yn({graph2ScreenCoords:function(e,r,i){var o=te(e.canvas);return{x:r*o.k+o.x,y:i*o.k+o.y}},screen2GraphCoords:function(e,r,i){var o=te(e.canvas);return{x:(r-o.x)/o.k,y:(i-o.y)/o.k}},centerAt:function(e,r,i,o){if(!e.canvas)return null;if(r!==void 0||i!==void 0){var s=Object.assign({},r!==void 0?{x:r}:{},i!==void 0?{y:i}:{});return o?e.tweenGroup.add(new kl(a()).to(s,o).easing(sn.Quadratic.Out).onUpdate(l).onComplete(function(){e.tweenGroup.remove(this)}).start()):l(s),this}return a();function a(){var c=te(e.canvas);return{x:(e.width/2-c.x)/c.k,y:(e.height/2-c.y)/c.k}}function l(c){var u=c.x,h=c.y;e.zoom.translateTo(e.zoom.__baseElem,u===void 0?a().x:u,h===void 0?a().y:h),e.needsRedraw=!0}},zoom:function(e,r,i){if(!e.canvas)return null;if(r!==void 0)return i?e.tweenGroup.add(new kl({k:o()}).to({k:r},i).easing(sn.Quadratic.Out).onUpdate(function(a){var l=a.k;return s(l)}).onComplete(function(){e.tweenGroup.remove(this)}).start()):s(r),this;return o();function o(){return te(e.canvas).k}function s(a){e.zoom.scaleTo(e.zoom.__baseElem,a),e.needsRedraw=!0}},zoomToFit:function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,o=arguments.length,s=new Array(o>3?o-3:0),a=3;a<o;a++)s[a-3]=arguments[a];var l=this.getGraphBbox.apply(this,s);if(l){var c={x:(l.x[0]+l.x[1])/2,y:(l.y[0]+l.y[1])/2},u=Math.max(1e-12,Math.min(1e12,(e.width-i*2)/(l.x[1]-l.x[0]),(e.height-i*2)/(l.y[1]-l.y[0])));this.centerAt(c.x,c.y,r),this.zoom(u,r)}return this},getGraphBbox:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0},i=Q(e.nodeVal),o=function(l){return Math.sqrt(Math.max(0,i(l)||1))*e.nodeRelSize},s=e.graphData.nodes.filter(r).map(function(a){return{x:a.x,y:a.y,r:o(a)}});return s.length?{x:[xl(s,function(a){return a.x-a.r}),yl(s,function(a){return a.x+a.r})],y:[xl(s,function(a){return a.y-a.r}),yl(s,function(a){return a.y+a.r})]}:null},pauseAnimation:function(e){return e.animationFrameRequestId&&(cancelAnimationFrame(e.animationFrameRequestId),e.animationFrameRequestId=null),this},resumeAnimation:function(e){return e.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},D_),stateInit:function(){return{lastSetZoom:1,zoom:Wm(),forceGraph:new Ni,shadowGraph:new Ni().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new vb,tweenGroup:new Gu}},init:function(e,r){var i=this;e.innerHTML="";var o=document.createElement("div");o.classList.add("force-graph-container"),o.style.position="relative",e.appendChild(o),r.canvas=document.createElement("canvas"),r.backgroundColor&&(r.canvas.style.background=r.backgroundColor),o.appendChild(r.canvas),r.shadowCanvas=document.createElement("canvas");var s=r.canvas.getContext("2d"),a=r.shadowCanvas.getContext("2d",{willReadFrequently:!0}),l={x:-1e12,y:-1e12},c=function(){var d=null,f=window.devicePixelRatio,p=l.x>0&&l.y>0?a.getImageData(l.x*f,l.y*f,1,1):null;return p&&(d=r.colorTracker.lookup(p.data)),d};qt(r.canvas).call(sv().subject(function(){if(!r.enableNodeDrag)return null;var h=c();return h&&h.type==="Node"?h.d:null}).on("start",function(h){var d=h.subject;d.__initialDragPos={x:d.x,y:d.y,fx:d.fx,fy:d.fy},h.active||(d.fx=d.x,d.fy=d.y),r.canvas.classList.add("grabbable")}).on("drag",function(h){var d=h.subject,f=d.__initialDragPos,p=h,m=te(r.canvas).k,b={x:f.x+(p.x-f.x)/m-d.x,y:f.y+(p.y-f.y)/m-d.y};["x","y"].forEach(function(g){return d["f".concat(g)]=d[g]=f[g]+(p[g]-f[g])/m}),!(!d.__dragged&&T_>=Math.sqrt(Ym(["x","y"].map(function(g){return Math.pow(h[g]-f[g],2)}))))&&(r.forceGraph.d3AlphaTarget(.3).resetCountdown(),r.isPointerDragging=!0,d.__dragged=!0,r.onNodeDrag(d,b))}).on("end",function(h){var d=h.subject,f=d.__initialDragPos,p={x:d.x-f.x,y:d.y-f.y};f.fx===void 0&&(d.fx=void 0),f.fy===void 0&&(d.fy=void 0),delete d.__initialDragPos,r.forceGraph.d3AlphaTarget()&&r.forceGraph.d3AlphaTarget(0).resetCountdown(),r.canvas.classList.remove("grabbable"),r.isPointerDragging=!1,d.__dragged&&(delete d.__dragged,r.onNodeDragEnd(d,p))})),r.zoom(r.zoom.__baseElem=qt(r.canvas)),r.zoom.__baseElem.on("dblclick.zoom",null),r.zoom.filter(function(h){return!h.button&&r.enableZoomPanInteraction&&(h.type!=="wheel"||Q(r.enableZoomInteraction)(h))&&(h.type==="wheel"||Q(r.enablePanInteraction)(h))}).on("zoom",function(h){var d=h.transform;[s,a].forEach(function(f){Cd(f),f.translate(d.x,d.y),f.scale(d.k,d.k)}),r.isPointerDragging=!0,r.onZoom&&r.onZoom(yn(yn({},d),i.centerAt())),r.needsRedraw=!0}).on("end",function(h){r.isPointerDragging=!1,r.onZoomEnd&&r.onZoomEnd(yn(yn({},h.transform),i.centerAt()))}),Eo(r),r.forceGraph.onNeedsRedraw(function(){return r.needsRedraw=!0}).onFinishUpdate(function(){te(r.canvas).k===r.lastSetZoom&&r.graphData.nodes.length&&(r.zoom.scaleTo(r.zoom.__baseElem,r.lastSetZoom=$_/Math.cbrt(r.graphData.nodes.length)),r.needsRedraw=!0)}),r.tooltip=new Lb(o),["pointermove","pointerdown"].forEach(function(h){return o.addEventListener(h,function(d){h==="pointerdown"&&(r.isPointerPressed=!0,r.pointerDownEvent=d),!r.isPointerDragging&&d.type==="pointermove"&&r.onBackgroundClick&&(d.pressure>0||r.isPointerPressed)&&(d.pointerType==="mouse"||d.movementX===void 0||[d.movementX,d.movementY].some(function(m){return Math.abs(m)>1}))&&(r.isPointerDragging=!0);var f=p(o);l.x=d.pageX-f.left,l.y=d.pageY-f.top;function p(m){var b=m.getBoundingClientRect(),g=window.pageXOffset||document.documentElement.scrollLeft,v=window.pageYOffset||document.documentElement.scrollTop;return{top:b.top+v,left:b.left+g}}},{passive:!0})}),o.addEventListener("pointerup",function(h){if(r.isPointerPressed){if(r.isPointerPressed=!1,r.isPointerDragging){r.isPointerDragging=!1;return}var d=[h,r.pointerDownEvent];requestAnimationFrame(function(){if(h.button===0)if(r.hoverObj){var f=r["on".concat(r.hoverObj.type,"Click")];f&&f.apply(void 0,[r.hoverObj.d].concat(d))}else r.onBackgroundClick&&r.onBackgroundClick.apply(r,d);if(h.button===2)if(r.hoverObj){var p=r["on".concat(r.hoverObj.type,"RightClick")];p&&p.apply(void 0,[r.hoverObj.d].concat(d))}else r.onBackgroundRightClick&&r.onBackgroundRightClick.apply(r,d)})}},{passive:!0}),o.addEventListener("contextmenu",function(h){return!r.onBackgroundRightClick&&!r.onNodeRightClick&&!r.onLinkRightClick?!0:(h.preventDefault(),!1)}),r.forceGraph(s),r.shadowGraph(a);var u=wg(function(){nc(a,r.width,r.height),r.shadowGraph.linkWidth(function(d){return Q(r.linkWidth)(d)+r.linkHoverPrecision});var h=te(r.canvas);r.shadowGraph.globalScale(h.k).tickFrame()},M_);r.flushShadowCanvas=u.flush,(this._animationCycle=function h(){var d=!r.autoPauseRedraw||!!r.needsRedraw||r.forceGraph.isEngineRunning()||r.graphData.links.some(function(w){return w.__photons&&w.__photons.length});if(r.needsRedraw=!1,r.enablePointerInteraction){var f=r.isPointerDragging?null:c();if(f!==r.hoverObj){var p=r.hoverObj,m=p?p.type:null,b=f?f.type:null;if(m&&m!==b){var g=r["on".concat(m,"Hover")];g&&g(null,p.d)}if(b){var v=r["on".concat(b,"Hover")];v&&v(f.d,m===b?p.d:null)}r.tooltip.content(f&&Q(r["".concat(f.type.toLowerCase(),"Label")])(f.d)||null),r.canvas.classList[(f&&r["on".concat(b,"Click")]||!f&&r.onBackgroundClick)&&Q(r.showPointerCursor)(f==null?void 0:f.d)?"add":"remove"]("clickable"),r.hoverObj=f}d&&u()}if(d){nc(s,r.width,r.height);var x=te(r.canvas).k;r.onRenderFramePre&&r.onRenderFramePre(s,x),r.forceGraph.globalScale(x).tickFrame(),r.onRenderFramePost&&r.onRenderFramePost(s,x)}r.tweenGroup.update(),r.animationFrameRequestId=requestAnimationFrame(h)})()},update:function(e){}});function j_(n,e){var r,i=1;n==null&&(n=0),e==null&&(e=0);function o(){var s,a=r.length,l,c=0,u=0;for(s=0;s<a;++s)l=r[s],c+=l.x,u+=l.y;for(c=(c/a-n)*i,u=(u/a-e)*i,s=0;s<a;++s)l=r[s],l.x-=c,l.y-=u}return o.initialize=function(s){r=s},o.x=function(s){return arguments.length?(n=+s,o):n},o.y=function(s){return arguments.length?(e=+s,o):e},o.strength=function(s){return arguments.length?(i=+s,o):i},o}function kt(n){return function(){return n}}function Be(n){return(n()-.5)*1e-6}function L_(n){return n.x+n.vx}function z_(n){return n.y+n.vy}function N_(n){var e,r,i,o=1,s=1;typeof n!="function"&&(n=kt(n==null?1:+n));function a(){for(var u,h=e.length,d,f,p,m,b,g,v=0;v<s;++v)for(d=io(e,L_,z_).visitAfter(l),u=0;u<h;++u)f=e[u],b=r[f.index],g=b*b,p=f.x+f.vx,m=f.y+f.vy,d.visit(x);function x(w,_,y,C,E){var k=w.data,M=w.r,P=b+M;if(k){if(k.index>f.index){var D=p-k.x-k.vx,R=m-k.y-k.vy,z=D*D+R*R;z<P*P&&(D===0&&(D=Be(i),z+=D*D),R===0&&(R=Be(i),z+=R*R),z=(P-(z=Math.sqrt(z)))/z*o,f.vx+=(D*=z)*(P=(M*=M)/(g+M)),f.vy+=(R*=z)*P,k.vx-=D*(P=1-P),k.vy-=R*P)}return}return _>p+P||C<p-P||y>m+P||E<m-P}}function l(u){if(u.data)return u.r=r[u.data.index];for(var h=u.r=0;h<4;++h)u[h]&&u[h].r>u.r&&(u.r=u[h].r)}function c(){if(e){var u,h=e.length,d;for(r=new Array(h),u=0;u<h;++u)d=e[u],r[d.index]=+n(d,u,e)}}return a.initialize=function(u,h){e=u,i=h,c()},a.iterations=function(u){return arguments.length?(s=+u,a):s},a.strength=function(u){return arguments.length?(o=+u,a):o},a.radius=function(u){return arguments.length?(n=typeof u=="function"?u:kt(+u),c(),a):n},a}function F_(n){return n.index}function rc(n,e){var r=n.get(e);if(!r)throw new Error("node not found: "+e);return r}function V_(n){var e=F_,r=d,i,o=kt(30),s,a,l,c,u,h=1;n==null&&(n=[]);function d(g){return 1/Math.min(l[g.source.index],l[g.target.index])}function f(g){for(var v=0,x=n.length;v<h;++v)for(var w=0,_,y,C,E,k,M,P;w<x;++w)_=n[w],y=_.source,C=_.target,E=C.x+C.vx-y.x-y.vx||Be(u),k=C.y+C.vy-y.y-y.vy||Be(u),M=Math.sqrt(E*E+k*k),M=(M-s[w])/M*g*i[w],E*=M,k*=M,C.vx-=E*(P=c[w]),C.vy-=k*P,y.vx+=E*(P=1-P),y.vy+=k*P}function p(){if(a){var g,v=a.length,x=n.length,w=new Map(a.map((y,C)=>[e(y,C,a),y])),_;for(g=0,l=new Array(v);g<x;++g)_=n[g],_.index=g,typeof _.source!="object"&&(_.source=rc(w,_.source)),typeof _.target!="object"&&(_.target=rc(w,_.target)),l[_.source.index]=(l[_.source.index]||0)+1,l[_.target.index]=(l[_.target.index]||0)+1;for(g=0,c=new Array(x);g<x;++g)_=n[g],c[g]=l[_.source.index]/(l[_.source.index]+l[_.target.index]);i=new Array(x),m(),s=new Array(x),b()}}function m(){if(a)for(var g=0,v=n.length;g<v;++g)i[g]=+r(n[g],g,n)}function b(){if(a)for(var g=0,v=n.length;g<v;++g)s[g]=+o(n[g],g,n)}return f.initialize=function(g,v){a=g,u=v,p()},f.links=function(g){return arguments.length?(n=g,p(),f):n},f.id=function(g){return arguments.length?(e=g,f):e},f.iterations=function(g){return arguments.length?(h=+g,f):h},f.strength=function(g){return arguments.length?(r=typeof g=="function"?g:kt(+g),m(),f):r},f.distance=function(g){return arguments.length?(o=typeof g=="function"?g:kt(+g),b(),f):o},f}function B_(n){return n.x}function U_(n){return n.y}function H_(){var n,e,r,i,o=kt(-30),s,a=1,l=1/0,c=.81;function u(p){var m,b=n.length,g=io(n,B_,U_).visitAfter(d);for(i=p,m=0;m<b;++m)e=n[m],g.visit(f)}function h(){if(n){var p,m=n.length,b;for(s=new Array(m),p=0;p<m;++p)b=n[p],s[b.index]=+o(b,p,n)}}function d(p){var m=0,b,g,v=0,x,w,_;if(p.length){for(x=w=_=0;_<4;++_)(b=p[_])&&(g=Math.abs(b.value))&&(m+=b.value,v+=g,x+=g*b.x,w+=g*b.y);p.x=x/v,p.y=w/v}else{b=p,b.x=b.data.x,b.y=b.data.y;do m+=s[b.data.index];while(b=b.next)}p.value=m}function f(p,m,b,g){if(!p.value)return!0;var v=p.x-e.x,x=p.y-e.y,w=g-m,_=v*v+x*x;if(w*w/c<_)return _<l&&(v===0&&(v=Be(r),_+=v*v),x===0&&(x=Be(r),_+=x*x),_<a&&(_=Math.sqrt(a*_)),e.vx+=v*p.value*i/_,e.vy+=x*p.value*i/_),!0;if(p.length||_>=l)return;(p.data!==e||p.next)&&(v===0&&(v=Be(r),_+=v*v),x===0&&(x=Be(r),_+=x*x),_<a&&(_=Math.sqrt(a*_)));do p.data!==e&&(w=s[p.data.index]*i/_,e.vx+=v*w,e.vy+=x*w);while(p=p.next)}return u.initialize=function(p,m){n=p,r=m,h()},u.strength=function(p){return arguments.length?(o=typeof p=="function"?p:kt(+p),h(),u):o},u.distanceMin=function(p){return arguments.length?(a=p*p,u):Math.sqrt(a)},u.distanceMax=function(p){return arguments.length?(l=p*p,u):Math.sqrt(l)},u.theta=function(p){return arguments.length?(c=p*p,u):Math.sqrt(c)},u}function q_(n){var e=kt(.1),r,i,o;typeof n!="function"&&(n=kt(n==null?0:+n));function s(l){for(var c=0,u=r.length,h;c<u;++c)h=r[c],h.vx+=(o[c]-h.x)*i[c]*l}function a(){if(r){var l,c=r.length;for(i=new Array(c),o=new Array(c),l=0;l<c;++l)i[l]=isNaN(o[l]=+n(r[l],l,r))?0:+e(r[l],l,r)}}return s.initialize=function(l){r=l,a()},s.strength=function(l){return arguments.length?(e=typeof l=="function"?l:kt(+l),a(),s):e},s.x=function(l){return arguments.length?(n=typeof l=="function"?l:kt(+l),a(),s):n},s}function K_(n){var e=kt(.1),r,i,o;typeof n!="function"&&(n=kt(n==null?0:+n));function s(l){for(var c=0,u=r.length,h;c<u;++c)h=r[c],h.vy+=(o[c]-h.y)*i[c]*l}function a(){if(r){var l,c=r.length;for(i=new Array(c),o=new Array(c),l=0;l<c;++l)i[l]=isNaN(o[l]=+n(r[l],l,r))?0:+e(r[l],l,r)}}return s.initialize=function(l){r=l,a()},s.strength=function(l){return arguments.length?(e=typeof l=="function"?l:kt(+l),a(),s):e},s.y=function(l){return arguments.length?(n=typeof l=="function"?l:kt(+l),a(),s):n},s}function ic(n){switch(H.nodeLabelMode){case"type":return n.type||n.id;case"id":return String(n.id);case"expression":try{return new Function("node",`with(node){return String(${H.nodeLabelExpression})}`)(n)}catch{return"<expr error>"}default:{const e=n.properties&&(n.properties.name||n.properties.label);return e||(n.type?`${n.type} ${n.id}`:n.id)}}}const Ed="Ubuntu",oc=.5,G_=new yp([["rgb(255, 0, 0)",0],["rgb(255, 140, 0)",.5],["rgb(195, 179, 41)",1]]);function W_(n){const e=new Map;if(!n||n.size===0)return e;const r=1e-12,i=[];for(const[a,l]of n)i.push({nodeId:a,logScore:-Math.log10(l.score+r)});let o=1/0,s=-1/0;for(const{logScore:a}of i)a<o&&(o=a),a>s&&(s=a);for(const{nodeId:a,logScore:l}of i){const c=s===o?0:(s-l)/(s-o);e.set(a,G_.getColor(c))}return e}function kd({r:n,g:e,b:r,a:i}){return`rgba(${Math.round(n)}, ${Math.round(e)}, ${Math.round(r)}, ${i})`}function Y_(n){return kd(fu(n.type))}function sc(n){return kd(vu(n.type))}function ac(n){return mu(n.type)}function Wn(n){return typeof n.source=="object"?n.source.id:n.source}function ko(n){return typeof n.target=="object"?n.target.id:n.target}function De(n,e){const r=cn(n);return r.opacity*=e,r.toString()}function X_(n){return cn(n).darker()}function Ao(n,e,r,i,o,s){n.save(),n.lineWidth=o,n.strokeStyle=s,n.beginPath(),n.arc(e,r,i,0,2*Math.PI,!1),n.stroke(),n.restore()}function Z_(n,e,r,i,o,s,a,l=0){n.save(),n.lineWidth=o,n.strokeStyle=s,n.setLineDash(a),n.translate(e,r),n.rotate(l),n.beginPath(),n.arc(0,0,i,0,2*Math.PI,!1),n.stroke(),n.restore()}function J_(n,e,r,i,o,s,a="middle",l="left"){n.save(),n.font=`${o}px ${Ed}, sans-serif`,n.textAlign=l,n.textBaseline=a,n.fillStyle=s;const c=e.split(`
43
+ `);for(let u=0;u<c.length;u++)n.fillText(c[u],r,i+u*o*1.2);n.restore()}function Q_(n,e,r,i,o,s,a,l,c="middle",u="center"){n.save(),n.font=`${o}px ${Ed}, sans-serif`,n.textAlign=u,n.textBaseline=c,n.lineWidth=l,n.strokeStyle=a,n.strokeText(e,r,i),n.fillStyle=s,n.fillText(e,r,i),n.restore()}const J=R_()(document.getElementById("graph")).nodeId("id").graphData({nodes:[],links:[]}).nodeLabel(n=>ic(n)+(n.type?`
44
+ (${n.type})`:"")).linkCurvature(n=>n.curvature||0).linkWidth(n=>ac(n)).linkColor(n=>{let e=sc(n),r=1;if(!T.highlight&&T.search&&(r=oc),T.highlight){r=Te[Te.length-1];const i=T.highlight.edgeDistancesMap.get(n.id);i<Te.length-1&&(r=Te[i]),e=De(e,r)}return e}).linkLabel(n=>n.properties.label||n.type).linkDirectionalParticleColor(n=>sc(n)).linkDirectionalParticles(0).linkDirectionalArrowLength(n=>n.properties&&n.properties.directional===!1?0:6*ac(n)).linkDirectionalArrowRelPos(.55).linkLineDash(n=>n.properties&&n.properties.dashed===!0?[4,4]:null).nodeRelSize(6).nodeCanvasObject((n,e,r)=>{const o=Math.max(4,(n.val||1)*3),s=Math.min(3,Math.max(1,1/r));let a=1;if(!T.highlight&&T.search&&!T.search.matchesMap.has(n.id)&&(a=oc),T.highlight){a=Te[Te.length-1];const h=T.highlight.nodeDistancesMap.get(n.id);h<Te.length-1&&(a=Te[h])}let l=De(Y_(n),a);if(e.beginPath(),e.fillStyle=l,e.arc(n.x,n.y,o,0,2*Math.PI,!1),e.fill(),e.beginPath(),e.strokeWidth=1,e.strokeStyle=X_(l),e.arc(n.x,n.y,o,0,2*Math.PI,!1),e.stroke(),T.adjacencyFilter&&T.adjacencyFilter.hiddenCounts.get(n.id,0)){const h=T.adjacencyFilter.hiddenCounts.get(n.id,0);Q_(e,`+${h}`,n.x+o,n.y-o,9,De("rgba(17, 214, 27, 0.9)",a),De("rgba(8, 168, 8, 0.91)",a),.3,"baseline","left")}if((n.fx!==void 0||n.fy!==void 0)&&(Ao(e,n.x,n.y,o+1,2,De("rgba(0,0,0,0.95)",a)),Ao(e,n.x,n.y,o,1,De("rgba(255,255,255,0.8)",a))),T.selection.selectedNodeIds.has(n.id)){const h=Date.now()/1e3%(2*Math.PI);Z_(e,n.x,n.y,o+2*s,2*s,De("rgba(255,0,0,1.0)",a),[3*s,2*s],h)}if(T.search&&T.search.matchesMap.has(n.id)){const h=T.search.matchColorsMap.get(n.id)||"rgb(255, 0, 0)",d=2*Math.sin(Date.now()/1e3*2*Math.PI*2);Ao(e,n.x,n.y,o+(5+d)*s,3*s,h)}const u=ic(n);J_(e,u,n.x+o+4,n.y,12,De("rgba(0,0,0,0.75)",a))}).nodePointerAreaPaint((n,e,r)=>{const i=Math.max(8,(n.val||1)*3);r.fillStyle=e,r.beginPath(),r.arc(n.x,n.y,i,0,2*Math.PI,!1),r.fill()}).onNodeClick((n,e)=>{T.currentTool==="pointer"&&e&&e.altKey&&(n.fx=void 0,n.fy=void 0),ut("node-clicked",{data:n,shiftKey:(e==null?void 0:e.shiftKey)??!1})}).onLinkClick((n,e)=>{ut("link-clicked",{data:n,shiftKey:(e==null?void 0:e.shiftKey)??!1})}).onNodeDrag(n=>{n.fx=n.x,n.fy=n.y}).onNodeDragEnd(n=>{n.fx=n.x,n.fy=n.y}).onNodeHover((n,e)=>{if(n!=null){const r=vn(),{nodeDistancesMap:i,edgeDistancesMap:o}=gp(r,n.id,2);T.highlight={nodeDistancesMap:i,edgeDistancesMap:o}}else T.highlight=null}).onNodeRightClick((n,e)=>{e.preventDefault();const r=[];r.push({label:"Show adjacent only",action:()=>{Po(n.id,!1),rn()}}),T.adjacencyFilter&&(r.push({label:"Show adjacent (extend)",action:()=>{Po(n.id,!0),rn()}}),r.push({label:"Reset adjacency filter",action:()=>{Po(null),rn()}})),nl(e.clientX,e.clientY,r)}).onBackgroundRightClick(n=>{n.preventDefault(),T.adjacencyFilter&&nl(n.clientX,n.clientY,[{label:"Reset adjacency filter",action:()=>{T.adjacencyFilter=null,rn()}}])}).onBackgroundClick(()=>{T.currentTool==="pointer"?ut("background-click",null):T.currentTool==="rect-select"&&T.selection.selectedNodeIds.clear()}).autoPauseRedraw(!1).onRenderFramePre((n,e)=>{if(!H.showGrid)return;const r=J.screen2GraphCoords(0,0),i=J.screen2GraphCoords(n.canvas.width,n.canvas.height),o=100,s=5,a=10,l=1/e,c=Math.floor(r.x/o)*o,u=Math.ceil(i.x/o)*o,h=Math.floor(r.y/o)*o,d=Math.ceil(i.y/o)*o,f=100,p=(u-c)/o,m=(d-h)/o,b=p<=f&&m<=f;if(n.save(),n.lineWidth=l,b){T.highlight?n.strokeStyle="rgba(0, 0, 0, 0.1)":n.strokeStyle="rgba(0, 0, 0, 0.2)",n.beginPath();for(let g=c;g<=u;g+=o)for(let v=h;v<=d;v+=o)g===0&&v===0||(n.moveTo(g-s,v),n.lineTo(g+s,v),n.moveTo(g,v-s),n.lineTo(g,v+s));n.stroke()}T.highlight?n.strokeStyle="rgba(255, 0, 0, 0.2)":n.strokeStyle="rgba(255, 0, 0, 0.4)",n.lineWidth=l*1.5,n.beginPath(),n.moveTo(-a,0),n.lineTo(a,0),n.moveTo(0,-a),n.lineTo(0,a),n.stroke(),n.restore()}).d3Force("charge",H_().strength(-450)).d3Force("link",V_().distance(140).strength(.8)).d3Force("collision",N_().radius(n=>18+(n.val||1)*6).strength(1).iterations(4)).d3Force("forceX",q_()).d3Force("forceY",K_());function Po(n,e=!1){const r=vn();if(n!==null){const i=new Set([n]),o=r.getAdjacentEdges(n);for(const a of o){const l=a.source_id===n?a.target_id:a.source_id;i.add(l)}if(!e)T.adjacencyFilter={visibleNodeIds:i,hiddenCounts:new Map};else for(const a of i)T.adjacencyFilter.visibleNodeIds.add(a);const s=new Map;for(const a of T.adjacencyFilter.visibleNodeIds){const l=new Set;for(const c of r.getAdjacentEdges(a)){const u=c.source_id===a?c.target_id:c.source_id;T.adjacencyFilter.visibleNodeIds.has(u)||l.add(u)}s.set(a,l.size)}T.adjacencyFilter.hiddenCounts=s}else T.adjacencyFilter=null}async function rn(){const n=cu(vn(),o=>H.nodeFilters[o.type]!==!1,o=>H.edgeFilters[o.type]!==!1);let e=n.getNodes().map(o=>({...o})),r=n.getEdges().map(o=>({...o}));if(T.adjacencyFilter){const o=T.adjacencyFilter.visibleNodeIds;e=e.filter(s=>o.has(s.id)),r=r.filter(s=>o.has(s.source_id)&&o.has(s.target_id))}if(!H.showIsolated){const o=new Set;r.forEach(s=>{o.add(s.source_id),o.add(s.target_id)}),e=e.filter(s=>o.has(s.id))}const i=mp(n);e.forEach(o=>{const s=i.get(o.id)||0;o.val=Math.sqrt(Math.max(1,s))}),ty(e,r)}function ty(n,e){console.log("updating graph data:",n.length,"nodes,",e.length,"links");const r=J.graphData()||{nodes:[],links:[]},i=new Map((r.nodes||[]).map(l=>[l.id,l])),o=new Map((r.links||[]).map(l=>[l.id,l])),s=[],a=[];n.forEach(l=>{l.kind="node";const c=i.get(l.id);c?(Object.assign(c,l),s.push(c)):s.push(l)}),e.forEach(l=>{l.kind="edge",l.source=l.source_id,l.target=l.target_id;const c=l.id,u=o.get(c);u?(u.properties=l.properties,a.push(u)):a.push(l)}),J.graphData({nodes:s,links:a}),Ad()}function Ad(){let n=new Map,e=new Set;J.graphData().links.forEach(i=>{if(e.has(i.id))return;e.add(i.id);let o=Wn(i)<ko(i)?`${Wn(i)}::${ko(i)}`:`${ko(i)}::${Wn(i)}`;n.has(o)||n.set(o,[]),n.get(o).push(i)});for(const i of n.values()){if(i.length<=1){i.forEach(c=>c.curvature=0);continue}const o=i.length,s=Math.min(1,H.curvatureStep*o),l=s*2/(o-1);for(let c=0;c<o;c++)i[c].curvature=-s+c*l,Wn(i[c])!=Wn(i[0])&&(i[c].curvature*=-1)}}function ey(){const n=J.d3Force("charge");n&&typeof n.strength=="function"&&n.strength(H.d3Charge);const e=J.d3Force("link");e&&(typeof e.distance=="function"&&e.distance(H.d3LinkDistance),typeof e.strength=="function"&&e.strength(H.d3LinkStrength));const r=J.d3Force("forceX"),i=J.d3Force("forceY");if(r.strength(H.d3ForceXYStrength),i.strength(H.d3ForceXYStrength),H.d3CenterForce){const s=j_();J.d3Force("center",s)}else J.d3Force("center",null);const o=J.d3Force("collision");o&&typeof o.radius=="function"&&o.radius(s=>(18+(s.val||1)*6)*H.d3CollisionMultiplier),typeof J.d3VelocityDecay=="function"&&J.d3VelocityDecay(H.d3VelocityDecay),typeof J.d3AlphaTarget=="function"&&J.d3AlphaTarget(H.d3AlphaTarget),typeof J.d3Alpha=="function"&&(J.d3Alpha(.25),setTimeout(()=>{typeof J.d3AlphaTarget=="function"&&J.d3AlphaTarget(0)},600))}function Ge(n){return Array.isArray?Array.isArray(n):Sd(n)==="[object Array]"}function ny(n){if(typeof n=="string")return n;if(typeof n=="bigint")return n.toString();const e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function ps(n){return n==null?"":ny(n)}function Et(n){return typeof n=="string"}function _i(n){return typeof n=="number"}function ry(n){return n===!0||n===!1||iy(n)&&Sd(n)=="[object Boolean]"}function Pd(n){return typeof n=="object"}function iy(n){return Pd(n)&&n!==null}function Tt(n){return n!=null}function Jr(n){return!n.trim().length}function Sd(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const oy="Incorrect 'index' type",sy=n=>`Invalid value for key ${n}`,ay=n=>`Pattern length exceeds max of ${n}.`,ly=n=>`Missing ${n} property in key`,cy=n=>`Property 'weight' in key '${n}' must be a positive integer`,lc=Object.prototype.hasOwnProperty;class uy{constructor(e){this._keys=[],this._keyMap={};let r=0;e.forEach(i=>{const o=Md(i);this._keys.push(o),this._keyMap[o.id]=o,r+=o.weight}),this._keys.forEach(i=>{i.weight/=r})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Md(n){let e=null,r=null,i=null,o=1,s=null;if(Et(n)||Ge(n))i=n,e=cc(n),r=fs(n);else{if(!lc.call(n,"name"))throw new Error(ly("name"));const a=n.name;if(i=a,lc.call(n,"weight")&&(o=n.weight,o<=0))throw new Error(cy(a));e=cc(a),r=fs(a),s=n.getFn}return{path:e,id:r,weight:o,src:i,getFn:s}}function cc(n){return Ge(n)?n:n.split(".")}function fs(n){return Ge(n)?n.join("."):n}function dy(n,e){const r=[];let i=!1;const o=(s,a,l,c)=>{if(Tt(s))if(!a[l])r.push(c!==void 0?{v:s,i:c}:s);else{const u=a[l],h=s[u];if(!Tt(h))return;if(l===a.length-1&&(Et(h)||_i(h)||ry(h)||typeof h=="bigint"))r.push(c!==void 0?{v:ps(h),i:c}:ps(h));else if(Ge(h)){i=!0;for(let d=0,f=h.length;d<f;d+=1)o(h[d],a,l+1,d)}else a.length&&o(h,a,l+1,c)}};return o(n,Et(e)?e.split("."):e,0),i?r:r[0]}const hy={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},py={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(n,e)=>n.score===e.score?n.idx<e.idx?-1:1:n.score<e.score?-1:1},fy={location:0,threshold:.6,distance:100},vy={useExtendedSearch:!1,useTokenSearch:!1,getFn:dy,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},B=Object.freeze({...py,...hy,...fy,...vy}),my=/[^ ]+/g;function gy(n=1,e=3){const r=new Map,i=Math.pow(10,e);return{get(o){const s=o.match(my).length;if(r.has(s))return r.get(s);const a=1/Math.pow(s,.5*n),l=parseFloat(Math.round(a*i)/i);return r.set(s,l),l},clear(){r.clear()}}}class da{constructor({getFn:e=B.getFn,fieldNormWeight:r=B.fieldNormWeight}={}){this.norm=gy(r,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((r,i)=>{this._keysMap[r.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Et(this.docs[0])?this.docs.forEach((e,r)=>{this._addString(e,r)}):this.docs.forEach((e,r)=>{this._addObject(e,r)}),this.norm.clear())}add(e){const r=this.size();Et(e)?this._addString(e,r):this._addObject(e,r)}removeAt(e){this.records.splice(e,1);for(let r=e,i=this.size();r<i;r+=1)this.records[r].i-=1}removeAll(e){for(let r=e.length-1;r>=0;r-=1)this.records.splice(e[r],1);for(let r=0,i=this.records.length;r<i;r+=1)this.records[r].i=r}getValueForItemAtKeyId(e,r){return e[this._keysMap[r]]}size(){return this.records.length}_addString(e,r){if(!Tt(e)||Jr(e))return;const i={v:e,i:r,n:this.norm.get(e)};this.records.push(i)}_addObject(e,r){const i={i:r,$:{}};this.keys.forEach((o,s)=>{const a=o.getFn?o.getFn(e):this.getFn(e,o.path);if(Tt(a)){if(Ge(a)){const l=[];for(let c=0,u=a.length;c<u;c+=1){const h=a[c];if(Tt(h)){if(Et(h)){if(!Jr(h)){const d={v:h,i:c,n:this.norm.get(h)};l.push(d)}}else if(Tt(h.v)){const d=Et(h.v)?h.v:ps(h.v);if(!Jr(d)){const f={v:d,i:h.i,n:this.norm.get(d)};l.push(f)}}}}i.$[s]=l}else if(Et(a)&&!Jr(a)){const l={v:a,n:this.norm.get(a)};i.$[s]=l}}}),this.records.push(i)}toJSON(){return{keys:this.keys.map(({getFn:e,...r})=>r),records:this.records}}}function $d(n,e,{getFn:r=B.getFn,fieldNormWeight:i=B.fieldNormWeight}={}){const o=new da({getFn:r,fieldNormWeight:i});return o.setKeys(n.map(Md)),o.setSources(e),o.create(),o}function by(n,{getFn:e=B.getFn,fieldNormWeight:r=B.fieldNormWeight}={}){const{keys:i,records:o}=n,s=new da({getFn:e,fieldNormWeight:r});return s.setKeys(i),s.setIndexRecords(o),s}function _y(n=[],e=B.minMatchCharLength){const r=[];let i=-1,o=-1,s=0;for(let a=n.length;s<a;s+=1){const l=n[s];l&&i===-1?i=s:!l&&i!==-1&&(o=s-1,o-i+1>=e&&r.push([i,o]),i=-1)}return n[s-1]&&s-i>=e&&r.push([i,s-1]),r}const nn=32;function yy(n,e,r,{location:i=B.location,distance:o=B.distance,threshold:s=B.threshold,findAllMatches:a=B.findAllMatches,minMatchCharLength:l=B.minMatchCharLength,includeMatches:c=B.includeMatches,ignoreLocation:u=B.ignoreLocation}={}){if(e.length>nn)throw new Error(ay(nn));const h=e.length,d=n.length,f=Math.max(0,Math.min(i,d));let p=s,m=f;const b=(k,M)=>{const P=k/h;if(u)return P;const D=Math.abs(f-M);return o?P+D/o:D?1:P},g=l>1||c,v=g?Array(d):[];let x;for(;(x=n.indexOf(e,m))>-1;){const k=b(0,x);if(p=Math.min(k,p),m=x+h,g){let M=0;for(;M<h;)v[x+M]=1,M+=1}}m=-1;let w=[],_=1,y=h+d;const C=1<<h-1;for(let k=0;k<h;k+=1){let M=0,P=y;for(;M<P;)b(k,f+P)<=p?M=P:y=P,P=Math.floor((y-M)/2+M);y=P;let D=Math.max(1,f-P+1);const R=a?d:Math.min(f+P,d)+h,z=Array(R+2);z[R+1]=(1<<k)-1;for(let I=R;I>=D;I-=1){const S=I-1,F=r[n[S]];if(g&&(v[S]=+!!F),z[I]=(z[I+1]<<1|1)&F,k&&(z[I]|=(w[I+1]|w[I])<<1|1|w[I+1]),z[I]&C&&(_=b(k,S),_<=p)){if(p=_,m=S,m<=f)break;D=Math.max(1,2*f-m)}}if(b(k+1,f)>p)break;w=z}const E={isMatch:m>=0,score:Math.max(.001,_)};if(g){const k=_y(v,l);k.length?c&&(E.indices=k):E.isMatch=!1}return E}function xy(n){const e={};for(let r=0,i=n.length;r<i;r+=1){const o=n.charAt(r);e[o]=(e[o]||0)|1<<i-r-1}return e}function ha(n){if(n.length<=1)return n;n.sort((r,i)=>r[0]-i[0]||r[1]-i[1]);const e=[n[0]];for(let r=1,i=n.length;r<i;r+=1){const o=e[e.length-1],s=n[r];s[0]<=o[1]+1?o[1]=Math.max(o[1],s[1]):e.push(s)}return e}const Td={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},wy=new RegExp("["+Object.keys(Td).join("")+"]","g"),_r=String.prototype.normalize?n=>n.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(wy,e=>Td[e]):n=>n;class pa{constructor(e,{location:r=B.location,threshold:i=B.threshold,distance:o=B.distance,includeMatches:s=B.includeMatches,findAllMatches:a=B.findAllMatches,minMatchCharLength:l=B.minMatchCharLength,isCaseSensitive:c=B.isCaseSensitive,ignoreDiacritics:u=B.ignoreDiacritics,ignoreLocation:h=B.ignoreLocation}={}){if(this.options={location:r,threshold:i,distance:o,includeMatches:s,findAllMatches:a,minMatchCharLength:l,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:h},e=c?e:e.toLowerCase(),e=u?_r(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(p,m)=>{this.chunks.push({pattern:p,alphabet:xy(p),startIndex:m})},f=this.pattern.length;if(f>nn){let p=0;const m=f%nn,b=f-m;for(;p<b;)d(this.pattern.substr(p,nn),p),p+=nn;if(m){const g=f-nn;d(this.pattern.substr(g),g)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:r,ignoreDiacritics:i,includeMatches:o}=this.options;if(e=r?e:e.toLowerCase(),e=i?_r(e):e,this.pattern===e){const b={isMatch:!0,score:0};return o&&(b.indices=[[0,e.length-1]]),b}const{location:s,distance:a,threshold:l,findAllMatches:c,minMatchCharLength:u,ignoreLocation:h}=this.options,d=[];let f=0,p=!1;this.chunks.forEach(({pattern:b,alphabet:g,startIndex:v})=>{const{isMatch:x,score:w,indices:_}=yy(e,b,g,{location:s+v,distance:a,threshold:l,findAllMatches:c,minMatchCharLength:u,includeMatches:o,ignoreLocation:h});x&&(p=!0),f+=w,x&&_&&d.push(..._)});const m={isMatch:p,score:p?f/this.chunks.length:1};return p&&o&&(m.indices=ha(d)),m}}class We{constructor(e){this.pattern=e}static isMultiMatch(e){return uc(e,this.multiRegex)}static isSingleMatch(e){return uc(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function uc(n,e){const r=n.match(e);return r?r[1]:null}class Cy extends We{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const r=e===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class Ey extends We{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}}class ky extends We{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const r=e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class Ay extends We{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const r=!e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class Py extends We{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const r=e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class Sy extends We{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const r=!e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class Id extends We{constructor(e,{location:r=B.location,threshold:i=B.threshold,distance:o=B.distance,includeMatches:s=B.includeMatches,findAllMatches:a=B.findAllMatches,minMatchCharLength:l=B.minMatchCharLength,isCaseSensitive:c=B.isCaseSensitive,ignoreDiacritics:u=B.ignoreDiacritics,ignoreLocation:h=B.ignoreLocation}={}){super(e),this._bitapSearch=new pa(e,{location:r,threshold:i,distance:o,includeMatches:s,findAllMatches:a,minMatchCharLength:l,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Od extends We{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let r=0,i;const o=[],s=this.pattern.length;for(;(i=e.indexOf(this.pattern,r))>-1;)r=i+s,o.push([i,r-1]);const a=!!o.length;return{isMatch:a,score:a?0:1,indices:o}}}const vs=[Cy,Od,ky,Ay,Sy,Py,Ey,Id],dc=vs.length,My="\0",$y="|";function Ty(n){const e=[],r=n.length;let i=0;for(;i<r;){for(;i<r&&n[i]===" ";)i++;if(i>=r)break;let o=i;for(;o<r&&n[o]!==" "&&n[o]!=='"';)o++;if(o<r&&n[o]==='"'){for(o++;o<r;){if(n[o]==='"'){const s=o+1;if(s>=r||n[s]===" "){o++;break}if(n[s]==="$"&&(s+1>=r||n[s+1]===" ")){o+=2;break}}o++}e.push(n.substring(i,o)),i=o}else{for(;o<r&&n[o]!==" ";)o++;e.push(n.substring(i,o)),i=o}}return e}function Iy(n,e={}){return n.replace(/\\\|/g,My).split($y).map(i=>{const o=i.replace(/\u0000/g,"|"),s=Ty(o.trim()).filter(l=>l&&!!l.trim()),a=[];for(let l=0,c=s.length;l<c;l+=1){const u=s[l];let h=!1,d=-1;for(;!h&&++d<dc;){const f=vs[d],p=f.isMultiMatch(u);p&&(a.push(new f(p,e)),h=!0)}if(!h)for(d=-1;++d<dc;){const f=vs[d],p=f.isSingleMatch(u);if(p){a.push(new f(p,e));break}}}return a})}const Oy=new Set([Id.type,Od.type]);class Dy{constructor(e,{isCaseSensitive:r=B.isCaseSensitive,ignoreDiacritics:i=B.ignoreDiacritics,includeMatches:o=B.includeMatches,minMatchCharLength:s=B.minMatchCharLength,ignoreLocation:a=B.ignoreLocation,findAllMatches:l=B.findAllMatches,location:c=B.location,threshold:u=B.threshold,distance:h=B.distance}={}){this.query=null,this.options={isCaseSensitive:r,ignoreDiacritics:i,includeMatches:o,minMatchCharLength:s,findAllMatches:l,ignoreLocation:a,location:c,threshold:u,distance:h},e=r?e:e.toLowerCase(),e=i?_r(e):e,this.pattern=e,this.query=Iy(this.pattern,this.options)}static condition(e,r){return r.useExtendedSearch}searchIn(e){const r=this.query;if(!r)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:o,ignoreDiacritics:s}=this.options;e=o?e:e.toLowerCase(),e=s?_r(e):e;let a=0;const l=[];let c=0,u=!1;for(let h=0,d=r.length;h<d;h+=1){const f=r[h];l.length=0,a=0,u=!1;for(let p=0,m=f.length;p<m;p+=1){const b=f[p],{isMatch:g,indices:v,score:x}=b.search(e);if(g){a+=1,c+=x;const w=b.constructor.type;w.startsWith("inverse")&&(u=!0),i&&(Oy.has(w)?l.push(...v):l.push(v))}else{c=0,a=0,l.length=0,u=!1;break}}if(a){const p={isMatch:!0,score:c/a};return u&&(p.hasInverse=!0),i&&(p.indices=ha(l)),p}}return{isMatch:!1,score:1}}}const ms=[];function fa(...n){ms.push(...n)}function Fi(n,e){for(let r=0,i=ms.length;r<i;r+=1){const o=ms[r];if(o.condition(n,e))return new o(n,e)}return new pa(n,e)}const Vi={AND:"$and",OR:"$or"},gs={PATH:"$path",PATTERN:"$val"},bs=n=>!!(n[Vi.AND]||n[Vi.OR]),Ry=n=>!!n[gs.PATH],jy=n=>!Ge(n)&&Pd(n)&&!bs(n),hc=n=>({[Vi.AND]:Object.keys(n).map(e=>({[e]:n[e]}))});function Dd(n,e,{auto:r=!0}={}){const i=o=>{if(Et(o)){const c={keyId:null,pattern:o};return r&&(c.searcher=Fi(o,e)),c}const s=Object.keys(o),a=Ry(o);if(!a&&s.length>1&&!bs(o))return i(hc(o));if(jy(o)){const c=a?o[gs.PATH]:s[0],u=a?o[gs.PATTERN]:o[c];if(!Et(u))throw new Error(sy(c));const h={keyId:fs(c),pattern:u};return r&&(h.searcher=Fi(u,e)),h}const l={children:[],operator:s[0]};return s.forEach(c=>{const u=o[c];Ge(u)&&u.forEach(h=>{l.children.push(i(h))})}),l};return bs(n)||(n=hc(n)),i(n)}function _s(n,{ignoreFieldNorm:e=B.ignoreFieldNorm}){let r=1;return n.forEach(({key:i,norm:o,score:s})=>{const a=i?i.weight:null;r*=Math.pow(s===0&&a?Number.EPSILON:s,(a||1)*(e?1:o))}),r}function Ly(n,{ignoreFieldNorm:e=B.ignoreFieldNorm}){n.forEach(r=>{r.score=_s(r.matches,{ignoreFieldNorm:e})})}class zy{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const r=this.heap;for(;e>0;){const i=e-1>>1;if(r[e].score<=r[i].score)break;const o=r[e];r[e]=r[i],r[i]=o,e=i}}_sinkDown(e){const r=this.heap,i=r.length;let o=e;do{e=o;const s=2*e+1,a=2*e+2;if(s<i&&r[s].score>r[o].score&&(o=s),a<i&&r[a].score>r[o].score&&(o=a),o!==e){const l=r[e];r[e]=r[o],r[o]=l}}while(o!==e)}}function Ny(n,e){const r=n.matches;e.matches=[],Tt(r)&&r.forEach(i=>{if(!Tt(i.indices)||!i.indices.length)return;const{indices:o,value:s}=i,a={indices:o,value:s};i.key&&(a.key=i.key.src),i.idx>-1&&(a.refIndex=i.idx),e.matches.push(a)})}function Fy(n,e){e.score=n.score}function Vy(n,e,{includeMatches:r=B.includeMatches,includeScore:i=B.includeScore}={}){const o=[];return r&&o.push(Ny),i&&o.push(Fy),n.map(s=>{const{idx:a}=s,l={item:e[a],refIndex:a};return o.length&&o.forEach(c=>{c(s,l)}),l})}const By=/\b\w+\b/g;function ys({isCaseSensitive:n=!1,ignoreDiacritics:e=!1}={}){return{tokenize(r){return n||(r=r.toLowerCase()),e&&(r=_r(r)),r.match(By)||[]}}}function Uy(n,e,r){const i=new Map,o=new Map;let s=0;function a(l,c,u,h){const d=r.tokenize(l);if(!d.length)return;s++;const f=new Map;for(const p of d)f.set(p,(f.get(p)||0)+1);for(const[p,m]of f){const b={docIdx:c,keyIdx:u,subIdx:h,tf:m};let g=i.get(p);g||(g=[],i.set(p,g)),g.push(b),o.set(p,(o.get(p)||0)+1)}}for(const l of n){const{i:c,v:u,$:h}=l;if(u!==void 0){a(u,c,-1,-1);continue}if(h)for(let d=0;d<e;d++){const f=h[d];if(f)if(Array.isArray(f))for(const p of f)a(p.v,c,d,p.i??-1);else a(f.v,c,d,-1)}}return{terms:i,fieldCount:s,df:o}}function Hy(n,e,r,i){const{i:o,v:s,$:a}=e;function l(c,u,h){const d=i.tokenize(c);if(!d.length)return;n.fieldCount++;const f=new Map;for(const p of d)f.set(p,(f.get(p)||0)+1);for(const[p,m]of f){const b={docIdx:o,keyIdx:u,subIdx:h,tf:m};let g=n.terms.get(p);g||(g=[],n.terms.set(p,g)),g.push(b),n.df.set(p,(n.df.get(p)||0)+1)}}if(s!==void 0){l(s,-1,-1);return}if(a)for(let c=0;c<r;c++){const u=a[c];if(u)if(Array.isArray(u))for(const h of u)l(h.v,c,h.i??-1);else l(u.v,c,-1)}}function pc(n,e){for(const[r,i]of n.terms){const o=i.filter(a=>a.docIdx!==e),s=i.length-o.length;s>0&&(n.fieldCount-=s,n.df.set(r,(n.df.get(r)||0)-s),o.length===0?(n.terms.delete(r),n.df.delete(r)):n.terms.set(r,o))}}class Ye{constructor(e,r,i){this.options={...B,...r},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new uy(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,i),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const r=this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options,i=Fi(e,r);return this._lastQuery=e,this._lastSearcher=i,i}setCollection(e,r){if(this._docs=e,r&&!(r instanceof da))throw new Error(oy);if(this._myIndex=r||$d(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const i=ys({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=Uy(this._myIndex.records,this._myIndex.keys.length,i)}}add(e){if(Tt(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){const r=this._myIndex.records[this._myIndex.records.length-1],i=ys({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});Hy(this._invertedIndex,r,this._myIndex.keys.length,i)}}remove(e=()=>!1){const r=[],i=[];for(let o=0,s=this._docs.length;o<s;o+=1)e(this._docs[o],o)&&(r.push(this._docs[o]),i.push(o));if(i.length){if(this._invertedIndex)for(const o of i)pc(this._invertedIndex,o);for(let o=i.length-1;o>=0;o-=1)this._docs.splice(i[o],1);this._myIndex.removeAll(i)}return r}removeAt(e){this._invertedIndex&&pc(this._invertedIndex,e);const r=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),r}getIndex(){return this._myIndex}search(e,r){const{limit:i=-1}=r||{},{includeMatches:o,includeScore:s,shouldSort:a,sortFn:l,ignoreFieldNorm:c}=this.options;if(Et(e)&&!e.trim()){let d=this._docs.map((f,p)=>({item:f,refIndex:p}));return _i(i)&&i>-1&&(d=d.slice(0,i)),d}const u=_i(i)&&i>0&&Et(e);let h;if(u){const d=new zy(i);Et(this._docs[0])?this._searchStringList(e,{heap:d,ignoreFieldNorm:c}):this._searchObjectList(e,{heap:d,ignoreFieldNorm:c}),h=d.extractSorted(l)}else h=Et(e)?Et(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Ly(h,{ignoreFieldNorm:c}),a&&h.sort(l),_i(i)&&i>-1&&(h=h.slice(0,i));return Vy(h,this._docs,{includeMatches:o,includeScore:s})}_searchStringList(e,{heap:r,ignoreFieldNorm:i}={}){const o=this._getSearcher(e),{records:s}=this._myIndex,a=r?null:[];return s.forEach(({v:l,i:c,n:u})=>{if(!Tt(l))return;const{isMatch:h,score:d,indices:f}=o.searchIn(l);if(h){const p={item:l,idx:c,matches:[{score:d,value:l,norm:u,indices:f}]};r?(p.score=_s(p.matches,{ignoreFieldNorm:i}),r.shouldInsert(p.score)&&r.insert(p)):a.push(p)}}),a}_searchLogical(e){const r=Dd(e,this.options),i=(l,c,u)=>{if(!("children"in l)){const{keyId:p,searcher:m}=l;let b;return p===null?(b=[],this._myIndex.keys.forEach((g,v)=>{b.push(...this._findMatches({key:g,value:c[v],searcher:m}))})):b=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(c,p),searcher:m}),b&&b.length?[{idx:u,item:c,matches:b}]:[]}const{children:h,operator:d}=l,f=[];for(let p=0,m=h.length;p<m;p+=1){const b=h[p],g=i(b,c,u);if(g.length)f.push(...g);else if(d===Vi.AND)return[]}return f},o=this._myIndex.records,s=new Map,a=[];return o.forEach(({$:l,i:c})=>{if(Tt(l)){const u=i(r,l,c);u.length&&(s.has(c)||(s.set(c,{idx:c,item:l,matches:[]}),a.push(s.get(c))),u.forEach(({matches:h})=>{s.get(c).matches.push(...h)}))}}),a}_searchObjectList(e,{heap:r,ignoreFieldNorm:i}={}){const o=this._getSearcher(e),{keys:s,records:a}=this._myIndex,l=r?null:[];return a.forEach(({$:c,i:u})=>{if(!Tt(c))return;const h=[];let d=!1,f=!1;if(s.forEach((p,m)=>{const b=this._findMatches({key:p,value:c[m],searcher:o});b.length?(h.push(...b),b[0].hasInverse&&(f=!0)):d=!0}),!(f&&d)&&h.length){const p={idx:u,item:c,matches:h};r?(p.score=_s(p.matches,{ignoreFieldNorm:i}),r.shouldInsert(p.score)&&r.insert(p)):l.push(p)}}),l}_findMatches({key:e,value:r,searcher:i}){if(!Tt(r))return[];const o=[];if(Ge(r))r.forEach(({v:s,i:a,n:l})=>{if(!Tt(s))return;const{isMatch:c,score:u,indices:h,hasInverse:d}=i.searchIn(s);c&&o.push({score:u,key:e,value:s,idx:a,norm:l,indices:h,hasInverse:d})});else{const{v:s,n:a}=r,{isMatch:l,score:c,indices:u,hasInverse:h}=i.searchIn(s);l&&o.push({score:c,key:e,value:s,norm:a,indices:u,hasInverse:h})}return o}}class qy{static condition(e,r){return r.useTokenSearch}constructor(e,r){this.options=r,this.analyzer=ys({isCaseSensitive:r.isCaseSensitive,ignoreDiacritics:r.ignoreDiacritics});const i=this.analyzer.tokenize(e),o=r._invertedIndex,{df:s,fieldCount:a}=o;this.termSearchers=[],this.idfWeights=[];for(const l of i){this.termSearchers.push(new pa(l,{location:r.location,threshold:r.threshold,distance:r.distance,includeMatches:r.includeMatches,findAllMatches:r.findAllMatches,minMatchCharLength:r.minMatchCharLength,isCaseSensitive:r.isCaseSensitive,ignoreDiacritics:r.ignoreDiacritics,ignoreLocation:!0}));const c=s.get(l)||0,u=Math.log(1+(a-c+.5)/(c+.5));this.idfWeights.push(u)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const r=[];let i=0,o=0,s=0;for(let c=0;c<this.termSearchers.length;c++){const u=this.termSearchers[c].searchIn(e),h=this.idfWeights[c];o+=h,u.isMatch&&(s++,i+=h*(1-u.score),u.indices&&r.push(...u.indices))}if(s===0)return{isMatch:!1,score:1};const a=o>0?1-i/o:0,l={isMatch:!0,score:Math.max(.001,a)};return this.options.includeMatches&&r.length&&(l.indices=ha(r)),l}}Ye.version="7.3.0";Ye.createIndex=$d;Ye.parseIndex=by;Ye.config=B;Ye.match=function(n,e,r){return Fi(n,{...B,...r}).searchIn(e)};Ye.parseQuery=Dd;fa(Dy);fa(qy);Ye.use=function(...n){n.forEach(e=>fa(e))};function Rd(n,e=1){const r=new Set;if(e<=0)return r;for(const i in n){const o=n[i];if(o&&typeof o=="object")for(const s of Rd(o,e-1))r.add(`${i}.${s}`);else r.add(i)}return r}class Ky{constructor(e,r){this.nodeId=e,this.score=r}}function Gy(n,e){const r=new Set;for(const a of n.getNodes()){const l=Rd(a,2);for(const c of l)r.add(c)}console.log("all keys discovered: ",r);const i={includeScore:!0,includeMatches:!0,findAllMatches:!0,threshold:0,useExtendedSearch:!0,ignoreLocation:!0,keys:[...r]},o=new Ye(n.getNodes(),i);let s=null;for(const a of e.split(" ").map(l=>l.trim())){if(!a)continue;const l=o.search(a);console.log(`search results for term ${a}:`,l);const c=new Map;for(const u of l){const h=u.item.id;c.set(h,new Ky(h,u.score))}if(s===null)s=c;else for(const u of s.keys()){const h=c.get(u);if(!h){s.delete(u);continue}const d=s.get(u);d.score+=h.score}}return console.log("search matches",s),[...s.values()]}async function jd(){const n=await fetch("/api/graph");if(!n.ok)throw new Error("Failed to fetch /api/graph: "+n.status);const e=await n.json(),r=(e.nodes||[]).map(o=>({id:o.id,type:o.type,properties:o.properties||{}})),i=(e.edges||[]).map(o=>({id:o.id,source_id:o.source_id,target_id:o.target_id,type:o.type,properties:o.properties||{}}));return{nodes:r,edges:i}}function Wy(n){return JSON.stringify(n.toData(),null,2)}const Yy=new Set(["id","type","properties"]),Xy=new Set(["id","type","source_id","target_id","properties"]);function Ld(n,e){const r=n.properties||{},i={};for(const o of Object.keys(n))e.has(o)||(i[o]=n[o]);return{...r,...i}}function Zy(n){return(Array.isArray(n)?n:Object.entries(n).map(([r,i])=>({...i,id:r}))).map(r=>({id:r.id,type:r.type??null,properties:Ld(r,Yy)}))}function Jy(n){return(Array.isArray(n)?n:Object.entries(n).map(([r,i])=>({...i,id:r}))).map(r=>({id:r.id??"auto:"+crypto.randomUUID(),source_id:r.source_id,target_id:r.target_id,type:r.type??null,properties:Ld(r,Xy)}))}function Qy(n){const e=JSON.parse(n);return{nodes:Zy(e.nodes||[]),edges:Jy(e.edges||e.relationships||e.links||[])}}/*! Tweakpane 4.0.5 (c) 2016 cocopon, licensed under the MIT license. */function rt(n){return n==null}function va(n){return n!==null&&typeof n=="object"}function xs(n){return n!==null&&typeof n=="object"}function tx(n,e){if(n.length!==e.length)return!1;for(let r=0;r<n.length;r++)if(n[r]!==e[r])return!1;return!0}function dn(n,e){return Array.from(new Set([...Object.keys(n),...Object.keys(e)])).reduce((i,o)=>{const s=n[o],a=e[o];return xs(s)&&xs(a)?Object.assign(Object.assign({},i),{[o]:dn(s,a)}):Object.assign(Object.assign({},i),{[o]:o in e?a:s})},{})}function ma(n){return va(n)?"target"in n:!1}const ex={alreadydisposed:()=>"View has been already disposed",invalidparams:n=>`Invalid parameters for '${n.name}'`,nomatchingcontroller:n=>`No matching controller for '${n.key}'`,nomatchingview:n=>`No matching view for '${JSON.stringify(n.params)}'`,notbindable:()=>"Value is not bindable",notcompatible:n=>`Not compatible with plugin '${n.id}'`,propertynotfound:n=>`Property '${n.name}' not found`,shouldneverhappen:()=>"This error should never happen"};class ct{static alreadyDisposed(){return new ct({type:"alreadydisposed"})}static notBindable(){return new ct({type:"notbindable"})}static notCompatible(e,r){return new ct({type:"notcompatible",context:{id:`${e}.${r}`}})}static propertyNotFound(e){return new ct({type:"propertynotfound",context:{name:e}})}static shouldNeverHappen(){return new ct({type:"shouldneverhappen"})}constructor(e){var r;this.message=(r=ex[e.type](e.context))!==null&&r!==void 0?r:"Unexpected error",this.name=this.constructor.name,this.stack=new Error(this.message).stack,this.type=e.type}toString(){return this.message}}class Bi{constructor(e,r){this.obj_=e,this.key=r}static isBindable(e){return!(e===null||typeof e!="object"&&typeof e!="function")}read(){return this.obj_[this.key]}write(e){this.obj_[this.key]=e}writeProperty(e,r){const i=this.read();if(!Bi.isBindable(i))throw ct.notBindable();if(!(e in i))throw ct.propertyNotFound(e);i[e]=r}}class ft{constructor(){this.observers_={}}on(e,r,i){var o;let s=this.observers_[e];return s||(s=this.observers_[e]=[]),s.push({handler:r,key:(o=i==null?void 0:i.key)!==null&&o!==void 0?o:r}),this}off(e,r){const i=this.observers_[e];return i&&(this.observers_[e]=i.filter(o=>o.key!==r)),this}emit(e,r){const i=this.observers_[e];i&&i.forEach(o=>{o.handler(r)})}}class nx{constructor(e,r){var i;this.constraint_=r==null?void 0:r.constraint,this.equals_=(i=r==null?void 0:r.equals)!==null&&i!==void 0?i:((o,s)=>o===s),this.emitter=new ft,this.rawValue_=e}get constraint(){return this.constraint_}get rawValue(){return this.rawValue_}set rawValue(e){this.setRawValue(e,{forceEmit:!1,last:!0})}setRawValue(e,r){const i=r??{forceEmit:!1,last:!0},o=this.constraint_?this.constraint_.constrain(e):e,s=this.rawValue_;this.equals_(s,o)&&!i.forceEmit||(this.emitter.emit("beforechange",{sender:this}),this.rawValue_=o,this.emitter.emit("change",{options:i,previousRawValue:s,rawValue:o,sender:this}))}}class rx{constructor(e){this.emitter=new ft,this.value_=e}get rawValue(){return this.value_}set rawValue(e){this.setRawValue(e,{forceEmit:!1,last:!0})}setRawValue(e,r){const i=r??{forceEmit:!1,last:!0},o=this.value_;o===e&&!i.forceEmit||(this.emitter.emit("beforechange",{sender:this}),this.value_=e,this.emitter.emit("change",{options:i,previousRawValue:o,rawValue:this.value_,sender:this}))}}class ix{constructor(e){this.emitter=new ft,this.onValueBeforeChange_=this.onValueBeforeChange_.bind(this),this.onValueChange_=this.onValueChange_.bind(this),this.value_=e,this.value_.emitter.on("beforechange",this.onValueBeforeChange_),this.value_.emitter.on("change",this.onValueChange_)}get rawValue(){return this.value_.rawValue}onValueBeforeChange_(e){this.emitter.emit("beforechange",Object.assign(Object.assign({},e),{sender:this}))}onValueChange_(e){this.emitter.emit("change",Object.assign(Object.assign({},e),{sender:this}))}}function at(n,e){const r=e==null?void 0:e.constraint,i=e==null?void 0:e.equals;return!r&&!i?new rx(n):new nx(n,e)}function ox(n){return[new ix(n),(e,r)=>{n.setRawValue(e,r)}]}class K{constructor(e){this.emitter=new ft,this.valMap_=e;for(const r in this.valMap_)this.valMap_[r].emitter.on("change",()=>{this.emitter.emit("change",{key:r,sender:this})})}static createCore(e){return Object.keys(e).reduce((i,o)=>Object.assign(i,{[o]:at(e[o])}),{})}static fromObject(e){const r=this.createCore(e);return new K(r)}get(e){return this.valMap_[e].rawValue}set(e,r){this.valMap_[e].rawValue=r}value(e){return this.valMap_[e]}}class Dr{constructor(e){this.values=K.fromObject({max:e.max,min:e.min})}constrain(e){const r=this.values.get("max"),i=this.values.get("min");return Math.min(Math.max(e,i),r)}}class sx{constructor(e){this.values=K.fromObject({max:e.max,min:e.min})}constrain(e){const r=this.values.get("max"),i=this.values.get("min");let o=e;return rt(i)||(o=Math.max(o,i)),rt(r)||(o=Math.min(o,r)),o}}class ax{constructor(e,r=0){this.step=e,this.origin=r}constrain(e){const r=this.origin%this.step,i=Math.round((e-r)/this.step);return r+i*this.step}}class lx{constructor(e){this.text=e}evaluate(){return Number(this.text)}toString(){return this.text}}const cx={"**":(n,e)=>Math.pow(n,e),"*":(n,e)=>n*e,"/":(n,e)=>n/e,"%":(n,e)=>n%e,"+":(n,e)=>n+e,"-":(n,e)=>n-e,"<<":(n,e)=>n<<e,">>":(n,e)=>n>>e,">>>":(n,e)=>n>>>e,"&":(n,e)=>n&e,"^":(n,e)=>n^e,"|":(n,e)=>n|e};class ux{constructor(e,r,i){this.left=r,this.operator=e,this.right=i}evaluate(){const e=cx[this.operator];if(!e)throw new Error(`unexpected binary operator: '${this.operator}`);return e(this.left.evaluate(),this.right.evaluate())}toString(){return["b(",this.left.toString(),this.operator,this.right.toString(),")"].join(" ")}}const dx={"+":n=>n,"-":n=>-n,"~":n=>~n};class hx{constructor(e,r){this.operator=e,this.expression=r}evaluate(){const e=dx[this.operator];if(!e)throw new Error(`unexpected unary operator: '${this.operator}`);return e(this.expression.evaluate())}toString(){return["u(",this.operator,this.expression.toString(),")"].join(" ")}}function ga(n){return(e,r)=>{for(let i=0;i<n.length;i++){const o=n[i](e,r);if(o!=="")return o}return""}}function yr(n,e){var r;const i=n.substr(e).match(/^\s+/);return(r=i&&i[0])!==null&&r!==void 0?r:""}function px(n,e){const r=n.substr(e,1);return r.match(/^[1-9]$/)?r:""}function xr(n,e){var r;const i=n.substr(e).match(/^[0-9]+/);return(r=i&&i[0])!==null&&r!==void 0?r:""}function fx(n,e){const r=xr(n,e);if(r!=="")return r;const i=n.substr(e,1);if(e+=1,i!=="-"&&i!=="+")return"";const o=xr(n,e);return o===""?"":i+o}function ba(n,e){const r=n.substr(e,1);if(e+=1,r.toLowerCase()!=="e")return"";const i=fx(n,e);return i===""?"":r+i}function zd(n,e){const r=n.substr(e,1);if(r==="0")return r;const i=px(n,e);return e+=i.length,i===""?"":i+xr(n,e)}function vx(n,e){const r=zd(n,e);if(e+=r.length,r==="")return"";const i=n.substr(e,1);if(e+=i.length,i!==".")return"";const o=xr(n,e);return e+=o.length,r+i+o+ba(n,e)}function mx(n,e){const r=n.substr(e,1);if(e+=r.length,r!==".")return"";const i=xr(n,e);return e+=i.length,i===""?"":r+i+ba(n,e)}function gx(n,e){const r=zd(n,e);return e+=r.length,r===""?"":r+ba(n,e)}const bx=ga([vx,mx,gx]);function _x(n,e){var r;const i=n.substr(e).match(/^[01]+/);return(r=i&&i[0])!==null&&r!==void 0?r:""}function yx(n,e){const r=n.substr(e,2);if(e+=r.length,r.toLowerCase()!=="0b")return"";const i=_x(n,e);return i===""?"":r+i}function xx(n,e){var r;const i=n.substr(e).match(/^[0-7]+/);return(r=i&&i[0])!==null&&r!==void 0?r:""}function wx(n,e){const r=n.substr(e,2);if(e+=r.length,r.toLowerCase()!=="0o")return"";const i=xx(n,e);return i===""?"":r+i}function Cx(n,e){var r;const i=n.substr(e).match(/^[0-9a-f]+/i);return(r=i&&i[0])!==null&&r!==void 0?r:""}function Ex(n,e){const r=n.substr(e,2);if(e+=r.length,r.toLowerCase()!=="0x")return"";const i=Cx(n,e);return i===""?"":r+i}const kx=ga([yx,wx,Ex]),Ax=ga([kx,bx]);function Px(n,e){const r=Ax(n,e);return e+=r.length,r===""?null:{evaluable:new lx(r),cursor:e}}function Sx(n,e){const r=n.substr(e,1);if(e+=r.length,r!=="(")return null;const i=Fd(n,e);if(!i)return null;e=i.cursor,e+=yr(n,e).length;const o=n.substr(e,1);return e+=o.length,o!==")"?null:{evaluable:i.evaluable,cursor:e}}function Mx(n,e){var r;return(r=Px(n,e))!==null&&r!==void 0?r:Sx(n,e)}function Nd(n,e){const r=Mx(n,e);if(r)return r;const i=n.substr(e,1);if(e+=i.length,i!=="+"&&i!=="-"&&i!=="~")return null;const o=Nd(n,e);return o?(e=o.cursor,{cursor:e,evaluable:new hx(i,o.evaluable)}):null}function $x(n,e,r){r+=yr(e,r).length;const i=n.filter(o=>e.startsWith(o,r))[0];return i?(r+=i.length,r+=yr(e,r).length,{cursor:r,operator:i}):null}function Tx(n,e){return(r,i)=>{const o=n(r,i);if(!o)return null;i=o.cursor;let s=o.evaluable;for(;;){const a=$x(e,r,i);if(!a)break;i=a.cursor;const l=n(r,i);if(!l)return null;i=l.cursor,s=new ux(a.operator,s,l.evaluable)}return s?{cursor:i,evaluable:s}:null}}const Ix=[["**"],["*","/","%"],["+","-"],["<<",">>>",">>"],["&"],["^"],["|"]].reduce((n,e)=>Tx(n,e),Nd);function Fd(n,e){return e+=yr(n,e).length,Ix(n,e)}function Ox(n){const e=Fd(n,0);return!e||e.cursor+yr(n,e.cursor).length!==n.length?null:e.evaluable}function Se(n){var e;const r=Ox(n);return(e=r==null?void 0:r.evaluate())!==null&&e!==void 0?e:null}function Vd(n){if(typeof n=="number")return n;if(typeof n=="string"){const e=Se(n);if(!rt(e))return e}return 0}function Dx(n){return String(n)}function Rt(n){return e=>e.toFixed(Math.max(Math.min(n,20),0))}function et(n,e,r,i,o){const s=(n-e)/(r-e);return i+s*(o-i)}function fc(n){return String(n.toFixed(10)).split(".")[1].replace(/0+$/,"").length}function vt(n,e,r){return Math.min(Math.max(n,e),r)}function Bd(n,e){return(n%e+e)%e}function Rx(n,e){return rt(n.step)?Math.max(fc(e),2):fc(n.step)}function Ud(n){var e;return(e=n.step)!==null&&e!==void 0?e:1}function Hd(n,e){var r;const i=Math.abs((r=n.step)!==null&&r!==void 0?r:e);return i===0?.1:Math.pow(10,Math.floor(Math.log10(i))-1)}function qd(n,e){return rt(n.step)?null:new ax(n.step,e)}function Kd(n){return!rt(n.max)&&!rt(n.min)?new Dr({max:n.max,min:n.min}):!rt(n.max)||!rt(n.min)?new sx({max:n.max,min:n.min}):null}function Gd(n,e){var r,i,o;return{formatter:(r=n.format)!==null&&r!==void 0?r:Rt(Rx(n,e)),keyScale:(i=n.keyScale)!==null&&i!==void 0?i:Ud(n),pointerScale:(o=n.pointerScale)!==null&&o!==void 0?o:Hd(n,e)}}function Wd(n){return{format:n.optional.function,keyScale:n.optional.number,max:n.optional.number,min:n.optional.number,pointerScale:n.optional.number,step:n.optional.number}}function _a(n){return{constraint:n.constraint,textProps:K.fromObject(Gd(n.params,n.initialValue))}}class mn{constructor(e){this.controller=e}get element(){return this.controller.view.element}get disabled(){return this.controller.viewProps.get("disabled")}set disabled(e){this.controller.viewProps.set("disabled",e)}get hidden(){return this.controller.viewProps.get("hidden")}set hidden(e){this.controller.viewProps.set("hidden",e)}dispose(){this.controller.viewProps.set("disposed",!0)}importState(e){return this.controller.importState(e)}exportState(){return this.controller.exportState()}}class oo{constructor(e){this.target=e}}class Rr extends oo{constructor(e,r,i){super(e),this.value=r,this.last=i??!0}}class jx extends oo{constructor(e,r){super(e),this.expanded=r}}class Lx extends oo{constructor(e,r){super(e),this.index=r}}class zx extends oo{constructor(e,r){super(e),this.native=r}}class wr extends mn{constructor(e){super(e),this.onValueChange_=this.onValueChange_.bind(this),this.emitter_=new ft,this.controller.value.emitter.on("change",this.onValueChange_)}get label(){return this.controller.labelController.props.get("label")}set label(e){this.controller.labelController.props.set("label",e)}get key(){return this.controller.value.binding.target.key}get tag(){return this.controller.tag}set tag(e){this.controller.tag=e}on(e,r){const i=r.bind(this);return this.emitter_.on(e,o=>{i(o)},{key:r}),this}off(e,r){return this.emitter_.off(e,r),this}refresh(){this.controller.value.fetch()}onValueChange_(e){const r=this.controller.value;this.emitter_.emit("change",new Rr(this,r.binding.target.read(),e.options.last))}}class Nx{constructor(e,r){this.onValueBeforeChange_=this.onValueBeforeChange_.bind(this),this.onValueChange_=this.onValueChange_.bind(this),this.binding=r,this.value_=e,this.value_.emitter.on("beforechange",this.onValueBeforeChange_),this.value_.emitter.on("change",this.onValueChange_),this.emitter=new ft}get rawValue(){return this.value_.rawValue}set rawValue(e){this.value_.rawValue=e}setRawValue(e,r){this.value_.setRawValue(e,r)}fetch(){this.value_.rawValue=this.binding.read()}push(){this.binding.write(this.value_.rawValue)}onValueBeforeChange_(e){this.emitter.emit("beforechange",Object.assign(Object.assign({},e),{sender:this}))}onValueChange_(e){this.push(),this.emitter.emit("change",Object.assign(Object.assign({},e),{sender:this}))}}function Fx(n){if(!("binding"in n))return!1;const e=n.binding;return ma(e)&&"read"in e&&"write"in e}function Vx(n,e){const i=Object.keys(e).reduce((o,s)=>{if(o===void 0)return;const a=e[s],l=a(n[s]);return l.succeeded?Object.assign(Object.assign({},o),{[s]:l.value}):void 0},{});return i}function Bx(n,e){return n.reduce((r,i)=>{if(r===void 0)return;const o=e(i);if(!(!o.succeeded||o.value===void 0))return[...r,o.value]},[])}function Ux(n){return n===null?!1:typeof n=="object"}function be(n){return e=>r=>{if(!e&&r===void 0)return{succeeded:!1,value:void 0};if(e&&r===void 0)return{succeeded:!0,value:void 0};const i=n(r);return i!==void 0?{succeeded:!0,value:i}:{succeeded:!1,value:void 0}}}function vc(n){return{custom:e=>be(e)(n),boolean:be(e=>typeof e=="boolean"?e:void 0)(n),number:be(e=>typeof e=="number"?e:void 0)(n),string:be(e=>typeof e=="string"?e:void 0)(n),function:be(e=>typeof e=="function"?e:void 0)(n),constant:e=>be(r=>r===e?e:void 0)(n),raw:be(e=>e)(n),object:e=>be(r=>{if(Ux(r))return Vx(r,e)})(n),array:e=>be(r=>{if(Array.isArray(r))return Bx(r,e)})(n)}}const ws={optional:vc(!0),required:vc(!1)};function lt(n,e){const r=e(ws),i=ws.required.object(r)(n);return i.succeeded?i.value:void 0}function Ft(n,e,r,i){if(e&&!e(n))return!1;const o=lt(n,r);return o?i(o):!1}function Vt(n,e){var r;return dn((r=n==null?void 0:n())!==null&&r!==void 0?r:{},e)}function an(n){return"value"in n}function Yd(n){if(!va(n)||!("binding"in n))return!1;const e=n.binding;return ma(e)}const ie="http://www.w3.org/2000/svg";function Ui(n){n.offsetHeight}function Hx(n,e){const r=n.style.transition;n.style.transition="none",e(),n.style.transition=r}function ya(n){return n.ontouchstart!==void 0}function qx(){return globalThis}function Kx(){return qx().document}function Gx(n){const e=n.ownerDocument.defaultView;return e&&"document"in e?n.getContext("2d",{willReadFrequently:!0}):null}const Wx={check:'<path d="M2 8l4 4l8 -8"/>',dropdown:'<path d="M5 7h6l-3 3 z"/>',p2dpad:'<path d="M8 4v8"/><path d="M4 8h8"/><circle cx="12" cy="12" r="1.2"/>'};function so(n,e){const r=n.createElementNS(ie,"svg");return r.innerHTML=Wx[e],r}function Xd(n,e,r){n.insertBefore(e,n.children[r])}function xa(n){n.parentElement&&n.parentElement.removeChild(n)}function Zd(n){for(;n.children.length>0;)n.removeChild(n.children[0])}function Yx(n){for(;n.childNodes.length>0;)n.removeChild(n.childNodes[0])}function Jd(n){return n.relatedTarget?n.relatedTarget:"explicitOriginalTarget"in n?n.explicitOriginalTarget:null}function Ae(n,e){n.emitter.on("change",r=>{e(r.rawValue)}),e(n.rawValue)}function ae(n,e,r){Ae(n.value(e),r)}const Xx="tp";function Y(n){return(r,i)=>[Xx,"-",n,"v",r?`_${r}`:"",i?`-${i}`:""].join("")}const Yn=Y("lbl");function Zx(n,e){const r=n.createDocumentFragment();return e.split(`
45
+ `).map(o=>n.createTextNode(o)).forEach((o,s)=>{s>0&&r.appendChild(n.createElement("br")),r.appendChild(o)}),r}class Qd{constructor(e,r){this.element=e.createElement("div"),this.element.classList.add(Yn()),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("div");i.classList.add(Yn("l")),ae(r.props,"label",s=>{rt(s)?this.element.classList.add(Yn(void 0,"nol")):(this.element.classList.remove(Yn(void 0,"nol")),Yx(i),i.appendChild(Zx(e,s)))}),this.element.appendChild(i),this.labelElement=i;const o=e.createElement("div");o.classList.add(Yn("v")),this.element.appendChild(o),this.valueElement=o}}class th{constructor(e,r){this.props=r.props,this.valueController=r.valueController,this.viewProps=r.valueController.viewProps,this.view=new Qd(e,{props:r.props,viewProps:this.viewProps}),this.view.valueElement.appendChild(this.valueController.view.element)}importProps(e){return Ft(e,null,r=>({label:r.optional.string}),r=>(this.props.set("label",r.label),!0))}exportProps(){return Vt(null,{label:this.props.get("label")})}}function Jx(){return["veryfirst","first","last","verylast"]}const mc=Y(""),gc={veryfirst:"vfst",first:"fst",last:"lst",verylast:"vlst"};class ao{constructor(e){this.parent_=null,this.blade=e.blade,this.view=e.view,this.viewProps=e.viewProps;const r=this.view.element;this.blade.value("positions").emitter.on("change",()=>{Jx().forEach(i=>{r.classList.remove(mc(void 0,gc[i]))}),this.blade.get("positions").forEach(i=>{r.classList.add(mc(void 0,gc[i]))})}),this.viewProps.handleDispose(()=>{xa(r)})}get parent(){return this.parent_}set parent(e){this.parent_=e,this.viewProps.set("parent",this.parent_?this.parent_.viewProps:null)}importState(e){return Ft(e,null,r=>({disabled:r.required.boolean,hidden:r.required.boolean}),r=>(this.viewProps.importState(r),!0))}exportState(){return Vt(null,Object.assign({},this.viewProps.exportState()))}}class hn extends ao{constructor(e,r){if(r.value!==r.valueController.value)throw ct.shouldNeverHappen();const i=r.valueController.viewProps,o=new th(e,{blade:r.blade,props:r.props,valueController:r.valueController});super(Object.assign(Object.assign({},r),{view:new Qd(e,{props:r.props,viewProps:i}),viewProps:i})),this.labelController=o,this.value=r.value,this.valueController=r.valueController,this.view.valueElement.appendChild(this.valueController.view.element)}importState(e){return Ft(e,r=>{var i,o,s;return super.importState(r)&&this.labelController.importProps(r)&&((s=(o=(i=this.valueController).importProps)===null||o===void 0?void 0:o.call(i,e))!==null&&s!==void 0?s:!0)},r=>({value:r.optional.raw}),r=>(r.value&&(this.value.rawValue=r.value),!0))}exportState(){var e,r,i;return Vt(()=>super.exportState(),Object.assign(Object.assign({value:this.value.rawValue},this.labelController.exportProps()),(i=(r=(e=this.valueController).exportProps)===null||r===void 0?void 0:r.call(e))!==null&&i!==void 0?i:{}))}}function bc(n){const e=Object.assign({},n);return delete e.value,e}class eh extends hn{constructor(e,r){super(e,r),this.tag=r.tag}importState(e){return Ft(e,r=>super.importState(bc(e)),r=>({tag:r.optional.string}),r=>(this.tag=r.tag,!0))}exportState(){return Vt(()=>bc(super.exportState()),{binding:{key:this.value.binding.target.key,value:this.value.binding.target.read()},tag:this.tag})}}function Qx(n){return an(n)&&Yd(n.value)}class tw extends eh{importState(e){return Ft(e,r=>super.importState(r),r=>({binding:r.required.object({value:r.required.raw})}),r=>(this.value.binding.inject(r.binding.value),this.value.fetch(),!0))}}function ew(n){return an(n)&&Fx(n.value)}function nh(n,e){for(;n.length<e;)n.push(void 0)}function nw(n){const e=[];return nh(e,n),e}function rw(n){const e=n.indexOf(void 0);return e<0?n:n.slice(0,e)}function iw(n,e){const r=[...rw(n),e];return r.length>n.length?r.splice(0,r.length-n.length):nh(r,n.length),r}class ow{constructor(e){this.emitter=new ft,this.onTick_=this.onTick_.bind(this),this.onValueBeforeChange_=this.onValueBeforeChange_.bind(this),this.onValueChange_=this.onValueChange_.bind(this),this.binding=e.binding,this.value_=at(nw(e.bufferSize)),this.value_.emitter.on("beforechange",this.onValueBeforeChange_),this.value_.emitter.on("change",this.onValueChange_),this.ticker=e.ticker,this.ticker.emitter.on("tick",this.onTick_),this.fetch()}get rawValue(){return this.value_.rawValue}set rawValue(e){this.value_.rawValue=e}setRawValue(e,r){this.value_.setRawValue(e,r)}fetch(){this.value_.rawValue=iw(this.value_.rawValue,this.binding.read())}onTick_(){this.fetch()}onValueBeforeChange_(e){this.emitter.emit("beforechange",Object.assign(Object.assign({},e),{sender:this}))}onValueChange_(e){this.emitter.emit("change",Object.assign(Object.assign({},e),{sender:this}))}}function sw(n){if(!("binding"in n))return!1;const e=n.binding;return ma(e)&&"read"in e&&!("write"in e)}class aw extends eh{exportState(){return Vt(()=>super.exportState(),{binding:{readonly:!0}})}}function lw(n){return an(n)&&sw(n.value)}class cw extends mn{get label(){return this.controller.labelController.props.get("label")}set label(e){this.controller.labelController.props.set("label",e)}get title(){var e;return(e=this.controller.buttonController.props.get("title"))!==null&&e!==void 0?e:""}set title(e){this.controller.buttonController.props.set("title",e)}on(e,r){const i=r.bind(this);return this.controller.buttonController.emitter.on(e,s=>{i(new zx(this,s.nativeEvent))}),this}off(e,r){return this.controller.buttonController.emitter.off(e,r),this}}function uw(n,e,r){r?n.classList.add(e):n.classList.remove(e)}function jn(n,e){return r=>{uw(n,e,r)}}function wa(n,e){Ae(n,r=>{e.textContent=r??""})}const So=Y("btn");class dw{constructor(e,r){this.element=e.createElement("div"),this.element.classList.add(So()),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("button");i.classList.add(So("b")),r.viewProps.bindDisabled(i),this.element.appendChild(i),this.buttonElement=i;const o=e.createElement("div");o.classList.add(So("t")),wa(r.props.value("title"),o),this.buttonElement.appendChild(o)}}class hw{constructor(e,r){this.emitter=new ft,this.onClick_=this.onClick_.bind(this),this.props=r.props,this.viewProps=r.viewProps,this.view=new dw(e,{props:this.props,viewProps:this.viewProps}),this.view.buttonElement.addEventListener("click",this.onClick_)}importProps(e){return Ft(e,null,r=>({title:r.optional.string}),r=>(this.props.set("title",r.title),!0))}exportProps(){return Vt(null,{title:this.props.get("title")})}onClick_(e){this.emitter.emit("click",{nativeEvent:e,sender:this})}}class _c extends ao{constructor(e,r){const i=new hw(e,{props:r.buttonProps,viewProps:r.viewProps}),o=new th(e,{blade:r.blade,props:r.labelProps,valueController:i});super({blade:r.blade,view:o.view,viewProps:r.viewProps}),this.buttonController=i,this.labelController=o}importState(e){return Ft(e,r=>super.importState(r)&&this.buttonController.importProps(r)&&this.labelController.importProps(r),()=>({}),()=>!0)}exportState(){return Vt(()=>super.exportState(),Object.assign(Object.assign({},this.buttonController.exportProps()),this.labelController.exportProps()))}}class rh{constructor(e){const[r,i]=e.split("-"),o=r.split(".");this.major=parseInt(o[0],10),this.minor=parseInt(o[1],10),this.patch=parseInt(o[2],10),this.prerelease=i??null}toString(){const e=[this.major,this.minor,this.patch].join(".");return this.prerelease!==null?[e,this.prerelease].join("-"):e}}const Ln=new rh("2.0.5");function St(n){return Object.assign({core:Ln},n)}const pw=St({id:"button",type:"blade",accept(n){const e=lt(n,r=>({title:r.required.string,view:r.required.constant("button"),label:r.optional.string}));return e?{params:e}:null},controller(n){return new _c(n.document,{blade:n.blade,buttonProps:K.fromObject({title:n.params.title}),labelProps:K.fromObject({label:n.params.label}),viewProps:n.viewProps})},api(n){return n.controller instanceof _c?new cw(n.controller):null}});function fw(n,e){return n.addBlade(Object.assign(Object.assign({},e),{view:"button"}))}function vw(n,e){return n.addBlade(Object.assign(Object.assign({},e),{view:"folder"}))}function mw(n,e){return n.addBlade(Object.assign(Object.assign({},e),{view:"tab"}))}function gw(n){return va(n)?"refresh"in n&&typeof n.refresh=="function":!1}function bw(n,e){if(!Bi.isBindable(n))throw ct.notBindable();return new Bi(n,e)}class _w{constructor(e,r){this.onRackValueChange_=this.onRackValueChange_.bind(this),this.controller_=e,this.emitter_=new ft,this.pool_=r,this.controller_.rack.emitter.on("valuechange",this.onRackValueChange_)}get children(){return this.controller_.rack.children.map(e=>this.pool_.createApi(e))}addBinding(e,r,i){const o=i??{},s=this.controller_.element.ownerDocument,a=this.pool_.createBinding(s,bw(e,r),o),l=this.pool_.createBindingApi(a);return this.add(l,o.index)}addFolder(e){return vw(this,e)}addButton(e){return fw(this,e)}addTab(e){return mw(this,e)}add(e,r){const i=e.controller;return this.controller_.rack.add(i,r),e}remove(e){this.controller_.rack.remove(e.controller)}addBlade(e){const r=this.controller_.element.ownerDocument,i=this.pool_.createBlade(r,e),o=this.pool_.createApi(i);return this.add(o,e.index)}on(e,r){const i=r.bind(this);return this.emitter_.on(e,o=>{i(o)},{key:r}),this}off(e,r){return this.emitter_.off(e,r),this}refresh(){this.children.forEach(e=>{gw(e)&&e.refresh()})}onRackValueChange_(e){const r=e.bladeController,i=this.pool_.createApi(r),o=Yd(r.value)?r.value.binding:null;this.emitter_.emit("change",new Rr(i,o?o.target.read():r.value.rawValue,e.options.last))}}class Ca extends mn{constructor(e,r){super(e),this.rackApi_=new _w(e.rackController,r)}refresh(){this.rackApi_.refresh()}}class Ea extends ao{constructor(e){super({blade:e.blade,view:e.view,viewProps:e.rackController.viewProps}),this.rackController=e.rackController}importState(e){return Ft(e,r=>super.importState(r),r=>({children:r.required.array(r.required.raw)}),r=>this.rackController.rack.children.every((i,o)=>i.importState(r.children[o])))}exportState(){return Vt(()=>super.exportState(),{children:this.rackController.rack.children.map(e=>e.exportState())})}}function Cs(n){return"rackController"in n}class yw{constructor(e){this.emitter=new ft,this.items_=[],this.cache_=new Set,this.onSubListAdd_=this.onSubListAdd_.bind(this),this.onSubListRemove_=this.onSubListRemove_.bind(this),this.extract_=e}get items(){return this.items_}allItems(){return Array.from(this.cache_)}find(e){for(const r of this.allItems())if(e(r))return r;return null}includes(e){return this.cache_.has(e)}add(e,r){if(this.includes(e))throw ct.shouldNeverHappen();const i=r!==void 0?r:this.items_.length;this.items_.splice(i,0,e),this.cache_.add(e);const o=this.extract_(e);o&&(o.emitter.on("add",this.onSubListAdd_),o.emitter.on("remove",this.onSubListRemove_),o.allItems().forEach(s=>{this.cache_.add(s)})),this.emitter.emit("add",{index:i,item:e,root:this,target:this})}remove(e){const r=this.items_.indexOf(e);if(r<0)return;this.items_.splice(r,1),this.cache_.delete(e);const i=this.extract_(e);i&&(i.allItems().forEach(o=>{this.cache_.delete(o)}),i.emitter.off("add",this.onSubListAdd_),i.emitter.off("remove",this.onSubListRemove_)),this.emitter.emit("remove",{index:r,item:e,root:this,target:this})}onSubListAdd_(e){this.cache_.add(e.item),this.emitter.emit("add",{index:e.index,item:e.item,root:this,target:e.target})}onSubListRemove_(e){this.cache_.delete(e.item),this.emitter.emit("remove",{index:e.index,item:e.item,root:this,target:e.target})}}function xw(n,e){for(let r=0;r<n.length;r++){const i=n[r];if(an(i)&&i.value===e)return i}return null}function ww(n){return Cs(n)?n.rackController.rack.bcSet_:null}class Cw{constructor(e){var r,i;this.emitter=new ft,this.onBladePositionsChange_=this.onBladePositionsChange_.bind(this),this.onSetAdd_=this.onSetAdd_.bind(this),this.onSetRemove_=this.onSetRemove_.bind(this),this.onChildDispose_=this.onChildDispose_.bind(this),this.onChildPositionsChange_=this.onChildPositionsChange_.bind(this),this.onChildValueChange_=this.onChildValueChange_.bind(this),this.onChildViewPropsChange_=this.onChildViewPropsChange_.bind(this),this.onRackLayout_=this.onRackLayout_.bind(this),this.onRackValueChange_=this.onRackValueChange_.bind(this),this.blade_=(r=e.blade)!==null&&r!==void 0?r:null,(i=this.blade_)===null||i===void 0||i.value("positions").emitter.on("change",this.onBladePositionsChange_),this.viewProps=e.viewProps,this.bcSet_=new yw(ww),this.bcSet_.emitter.on("add",this.onSetAdd_),this.bcSet_.emitter.on("remove",this.onSetRemove_)}get children(){return this.bcSet_.items}add(e,r){var i;(i=e.parent)===null||i===void 0||i.remove(e),e.parent=this,this.bcSet_.add(e,r)}remove(e){e.parent=null,this.bcSet_.remove(e)}find(e){return this.bcSet_.allItems().filter(e)}onSetAdd_(e){this.updatePositions_();const r=e.target===e.root;if(this.emitter.emit("add",{bladeController:e.item,index:e.index,root:r,sender:this}),!r)return;const i=e.item;if(i.viewProps.emitter.on("change",this.onChildViewPropsChange_),i.blade.value("positions").emitter.on("change",this.onChildPositionsChange_),i.viewProps.handleDispose(this.onChildDispose_),an(i))i.value.emitter.on("change",this.onChildValueChange_);else if(Cs(i)){const o=i.rackController.rack;if(o){const s=o.emitter;s.on("layout",this.onRackLayout_),s.on("valuechange",this.onRackValueChange_)}}}onSetRemove_(e){this.updatePositions_();const r=e.target===e.root;if(this.emitter.emit("remove",{bladeController:e.item,root:r,sender:this}),!r)return;const i=e.item;if(an(i))i.value.emitter.off("change",this.onChildValueChange_);else if(Cs(i)){const o=i.rackController.rack;if(o){const s=o.emitter;s.off("layout",this.onRackLayout_),s.off("valuechange",this.onRackValueChange_)}}}updatePositions_(){const e=this.bcSet_.items.filter(o=>!o.viewProps.get("hidden")),r=e[0],i=e[e.length-1];this.bcSet_.items.forEach(o=>{const s=[];o===r&&(s.push("first"),(!this.blade_||this.blade_.get("positions").includes("veryfirst"))&&s.push("veryfirst")),o===i&&(s.push("last"),(!this.blade_||this.blade_.get("positions").includes("verylast"))&&s.push("verylast")),o.blade.set("positions",s)})}onChildPositionsChange_(){this.updatePositions_(),this.emitter.emit("layout",{sender:this})}onChildViewPropsChange_(e){this.updatePositions_(),this.emitter.emit("layout",{sender:this})}onChildDispose_(){this.bcSet_.items.filter(r=>r.viewProps.get("disposed")).forEach(r=>{this.bcSet_.remove(r)})}onChildValueChange_(e){const r=xw(this.find(an),e.sender);if(!r)throw ct.alreadyDisposed();this.emitter.emit("valuechange",{bladeController:r,options:e.options,sender:this})}onRackLayout_(e){this.updatePositions_(),this.emitter.emit("layout",{sender:this})}onRackValueChange_(e){this.emitter.emit("valuechange",{bladeController:e.bladeController,options:e.options,sender:this})}onBladePositionsChange_(){this.updatePositions_()}}class ka{constructor(e){this.onRackAdd_=this.onRackAdd_.bind(this),this.onRackRemove_=this.onRackRemove_.bind(this),this.element=e.element,this.viewProps=e.viewProps;const r=new Cw({blade:e.root?void 0:e.blade,viewProps:e.viewProps});r.emitter.on("add",this.onRackAdd_),r.emitter.on("remove",this.onRackRemove_),this.rack=r,this.viewProps.handleDispose(()=>{for(let i=this.rack.children.length-1;i>=0;i--)this.rack.children[i].viewProps.set("disposed",!0)})}onRackAdd_(e){e.root&&Xd(this.element,e.bladeController.view.element,e.index)}onRackRemove_(e){e.root&&xa(e.bladeController.view.element)}}function zn(){return new K({positions:at([],{equals:tx})})}class jr extends K{constructor(e){super(e)}static create(e){const r={completed:!0,expanded:e,expandedHeight:null,shouldFixHeight:!1,temporaryExpanded:null},i=K.createCore(r);return new jr(i)}get styleExpanded(){var e;return(e=this.get("temporaryExpanded"))!==null&&e!==void 0?e:this.get("expanded")}get styleHeight(){if(!this.styleExpanded)return"0";const e=this.get("expandedHeight");return this.get("shouldFixHeight")&&!rt(e)?`${e}px`:"auto"}bindExpandedClass(e,r){const i=()=>{this.styleExpanded?e.classList.add(r):e.classList.remove(r)};ae(this,"expanded",i),ae(this,"temporaryExpanded",i)}cleanUpTransition(){this.set("shouldFixHeight",!1),this.set("expandedHeight",null),this.set("completed",!0)}}function Ew(n,e){let r=0;return Hx(e,()=>{n.set("expandedHeight",null),n.set("temporaryExpanded",!0),Ui(e),r=e.clientHeight,n.set("temporaryExpanded",null),Ui(e)}),r}function yc(n,e){e.style.height=n.styleHeight}function Aa(n,e){n.value("expanded").emitter.on("beforechange",()=>{if(n.set("completed",!1),rt(n.get("expandedHeight"))){const r=Ew(n,e);r>0&&n.set("expandedHeight",r)}n.set("shouldFixHeight",!0),Ui(e)}),n.emitter.on("change",()=>{yc(n,e)}),yc(n,e),e.addEventListener("transitionend",r=>{r.propertyName==="height"&&n.cleanUpTransition()})}class ih extends Ca{constructor(e,r){super(e,r),this.emitter_=new ft,this.controller.foldable.value("expanded").emitter.on("change",i=>{this.emitter_.emit("fold",new jx(this,i.sender.rawValue))}),this.rackApi_.on("change",i=>{this.emitter_.emit("change",i)})}get expanded(){return this.controller.foldable.get("expanded")}set expanded(e){this.controller.foldable.set("expanded",e)}get title(){return this.controller.props.get("title")}set title(e){this.controller.props.set("title",e)}get children(){return this.rackApi_.children}addBinding(e,r,i){return this.rackApi_.addBinding(e,r,i)}addFolder(e){return this.rackApi_.addFolder(e)}addButton(e){return this.rackApi_.addButton(e)}addTab(e){return this.rackApi_.addTab(e)}add(e,r){return this.rackApi_.add(e,r)}remove(e){this.rackApi_.remove(e)}addBlade(e){return this.rackApi_.addBlade(e)}on(e,r){const i=r.bind(this);return this.emitter_.on(e,o=>{i(o)},{key:r}),this}off(e,r){return this.emitter_.off(e,r),this}}const oh=Y("cnt");class kw{constructor(e,r){var i;this.className_=Y((i=r.viewName)!==null&&i!==void 0?i:"fld"),this.element=e.createElement("div"),this.element.classList.add(this.className_(),oh()),r.viewProps.bindClassModifiers(this.element),this.foldable_=r.foldable,this.foldable_.bindExpandedClass(this.element,this.className_(void 0,"expanded")),ae(this.foldable_,"completed",jn(this.element,this.className_(void 0,"cpl")));const o=e.createElement("button");o.classList.add(this.className_("b")),ae(r.props,"title",u=>{rt(u)?this.element.classList.add(this.className_(void 0,"not")):this.element.classList.remove(this.className_(void 0,"not"))}),r.viewProps.bindDisabled(o),this.element.appendChild(o),this.buttonElement=o;const s=e.createElement("div");s.classList.add(this.className_("i")),this.element.appendChild(s);const a=e.createElement("div");a.classList.add(this.className_("t")),wa(r.props.value("title"),a),this.buttonElement.appendChild(a),this.titleElement=a;const l=e.createElement("div");l.classList.add(this.className_("m")),this.buttonElement.appendChild(l);const c=e.createElement("div");c.classList.add(this.className_("c")),this.element.appendChild(c),this.containerElement=c}}class Es extends Ea{constructor(e,r){var i;const o=jr.create((i=r.expanded)!==null&&i!==void 0?i:!0),s=new kw(e,{foldable:o,props:r.props,viewName:r.root?"rot":void 0,viewProps:r.viewProps});super(Object.assign(Object.assign({},r),{rackController:new ka({blade:r.blade,element:s.containerElement,root:r.root,viewProps:r.viewProps}),view:s})),this.onTitleClick_=this.onTitleClick_.bind(this),this.props=r.props,this.foldable=o,Aa(this.foldable,this.view.containerElement),this.rackController.rack.emitter.on("add",()=>{this.foldable.cleanUpTransition()}),this.rackController.rack.emitter.on("remove",()=>{this.foldable.cleanUpTransition()}),this.view.buttonElement.addEventListener("click",this.onTitleClick_)}get document(){return this.view.element.ownerDocument}importState(e){return Ft(e,r=>super.importState(r),r=>({expanded:r.required.boolean,title:r.optional.string}),r=>(this.foldable.set("expanded",r.expanded),this.props.set("title",r.title),!0))}exportState(){return Vt(()=>super.exportState(),{expanded:this.foldable.get("expanded"),title:this.props.get("title")})}onTitleClick_(){this.foldable.set("expanded",!this.foldable.get("expanded"))}}const Aw=St({id:"folder",type:"blade",accept(n){const e=lt(n,r=>({title:r.required.string,view:r.required.constant("folder"),expanded:r.optional.boolean}));return e?{params:e}:null},controller(n){return new Es(n.document,{blade:n.blade,expanded:n.params.expanded,props:K.fromObject({title:n.params.title}),viewProps:n.viewProps})},api(n){return n.controller instanceof Es?new ih(n.controller,n.pool):null}}),Pw=Y("");function xc(n,e){return jn(n,Pw(void 0,e))}class $e extends K{constructor(e){var r;super(e),this.onDisabledChange_=this.onDisabledChange_.bind(this),this.onParentChange_=this.onParentChange_.bind(this),this.onParentGlobalDisabledChange_=this.onParentGlobalDisabledChange_.bind(this),[this.globalDisabled_,this.setGlobalDisabled_]=ox(at(this.getGlobalDisabled_())),this.value("disabled").emitter.on("change",this.onDisabledChange_),this.value("parent").emitter.on("change",this.onParentChange_),(r=this.get("parent"))===null||r===void 0||r.globalDisabled.emitter.on("change",this.onParentGlobalDisabledChange_)}static create(e){var r,i,o;const s=e??{};return new $e(K.createCore({disabled:(r=s.disabled)!==null&&r!==void 0?r:!1,disposed:!1,hidden:(i=s.hidden)!==null&&i!==void 0?i:!1,parent:(o=s.parent)!==null&&o!==void 0?o:null}))}get globalDisabled(){return this.globalDisabled_}bindClassModifiers(e){Ae(this.globalDisabled_,xc(e,"disabled")),ae(this,"hidden",xc(e,"hidden"))}bindDisabled(e){Ae(this.globalDisabled_,r=>{e.disabled=r})}bindTabIndex(e){Ae(this.globalDisabled_,r=>{e.tabIndex=r?-1:0})}handleDispose(e){this.value("disposed").emitter.on("change",r=>{r&&e()})}importState(e){this.set("disabled",e.disabled),this.set("hidden",e.hidden)}exportState(){return{disabled:this.get("disabled"),hidden:this.get("hidden")}}getGlobalDisabled_(){const e=this.get("parent");return(e?e.globalDisabled.rawValue:!1)||this.get("disabled")}updateGlobalDisabled_(){this.setGlobalDisabled_(this.getGlobalDisabled_())}onDisabledChange_(){this.updateGlobalDisabled_()}onParentGlobalDisabledChange_(){this.updateGlobalDisabled_()}onParentChange_(e){var r;const i=e.previousRawValue;i==null||i.globalDisabled.emitter.off("change",this.onParentGlobalDisabledChange_),(r=this.get("parent"))===null||r===void 0||r.globalDisabled.emitter.on("change",this.onParentGlobalDisabledChange_),this.updateGlobalDisabled_()}}const wc=Y("tbp");class Sw{constructor(e,r){this.element=e.createElement("div"),this.element.classList.add(wc()),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("div");i.classList.add(wc("c")),this.element.appendChild(i),this.containerElement=i}}const Xn=Y("tbi");class Mw{constructor(e,r){this.element=e.createElement("div"),this.element.classList.add(Xn()),r.viewProps.bindClassModifiers(this.element),ae(r.props,"selected",s=>{s?this.element.classList.add(Xn(void 0,"sel")):this.element.classList.remove(Xn(void 0,"sel"))});const i=e.createElement("button");i.classList.add(Xn("b")),r.viewProps.bindDisabled(i),this.element.appendChild(i),this.buttonElement=i;const o=e.createElement("div");o.classList.add(Xn("t")),wa(r.props.value("title"),o),this.buttonElement.appendChild(o),this.titleElement=o}}class $w{constructor(e,r){this.emitter=new ft,this.onClick_=this.onClick_.bind(this),this.props=r.props,this.viewProps=r.viewProps,this.view=new Mw(e,{props:r.props,viewProps:r.viewProps}),this.view.buttonElement.addEventListener("click",this.onClick_)}onClick_(){this.emitter.emit("click",{sender:this})}}class ks extends Ea{constructor(e,r){const i=new Sw(e,{viewProps:r.viewProps});super(Object.assign(Object.assign({},r),{rackController:new ka({blade:r.blade,element:i.containerElement,viewProps:r.viewProps}),view:i})),this.onItemClick_=this.onItemClick_.bind(this),this.ic_=new $w(e,{props:r.itemProps,viewProps:$e.create()}),this.ic_.emitter.on("click",this.onItemClick_),this.props=r.props,ae(this.props,"selected",o=>{this.itemController.props.set("selected",o),this.viewProps.set("hidden",!o)})}get itemController(){return this.ic_}importState(e){return Ft(e,r=>super.importState(r),r=>({selected:r.required.boolean,title:r.required.string}),r=>(this.ic_.props.set("selected",r.selected),this.ic_.props.set("title",r.title),!0))}exportState(){return Vt(()=>super.exportState(),{selected:this.ic_.props.get("selected"),title:this.ic_.props.get("title")})}onItemClick_(){this.props.set("selected",!0)}}class Tw extends Ca{constructor(e,r){super(e,r),this.emitter_=new ft,this.onSelect_=this.onSelect_.bind(this),this.pool_=r,this.rackApi_.on("change",i=>{this.emitter_.emit("change",i)}),this.controller.tab.selectedIndex.emitter.on("change",this.onSelect_)}get pages(){return this.rackApi_.children}addPage(e){const r=this.controller.view.element.ownerDocument,i=new ks(r,{blade:zn(),itemProps:K.fromObject({selected:!1,title:e.title}),props:K.fromObject({selected:!1}),viewProps:$e.create()}),o=this.pool_.createApi(i);return this.rackApi_.add(o,e.index)}removePage(e){this.rackApi_.remove(this.rackApi_.children[e])}on(e,r){const i=r.bind(this);return this.emitter_.on(e,o=>{i(o)},{key:r}),this}off(e,r){return this.emitter_.off(e,r),this}onSelect_(e){this.emitter_.emit("select",new Lx(this,e.rawValue))}}class Iw extends Ca{get title(){var e;return(e=this.controller.itemController.props.get("title"))!==null&&e!==void 0?e:""}set title(e){this.controller.itemController.props.set("title",e)}get selected(){return this.controller.props.get("selected")}set selected(e){this.controller.props.set("selected",e)}get children(){return this.rackApi_.children}addButton(e){return this.rackApi_.addButton(e)}addFolder(e){return this.rackApi_.addFolder(e)}addTab(e){return this.rackApi_.addTab(e)}add(e,r){this.rackApi_.add(e,r)}remove(e){this.rackApi_.remove(e)}addBinding(e,r,i){return this.rackApi_.addBinding(e,r,i)}addBlade(e){return this.rackApi_.addBlade(e)}}const Cc=-1;class Ow{constructor(){this.onItemSelectedChange_=this.onItemSelectedChange_.bind(this),this.empty=at(!0),this.selectedIndex=at(Cc),this.items_=[]}add(e,r){const i=r??this.items_.length;this.items_.splice(i,0,e),e.emitter.on("change",this.onItemSelectedChange_),this.keepSelection_()}remove(e){const r=this.items_.indexOf(e);r<0||(this.items_.splice(r,1),e.emitter.off("change",this.onItemSelectedChange_),this.keepSelection_())}keepSelection_(){if(this.items_.length===0){this.selectedIndex.rawValue=Cc,this.empty.rawValue=!0;return}const e=this.items_.findIndex(r=>r.rawValue);e<0?(this.items_.forEach((r,i)=>{r.rawValue=i===0}),this.selectedIndex.rawValue=0):(this.items_.forEach((r,i)=>{r.rawValue=i===e}),this.selectedIndex.rawValue=e),this.empty.rawValue=!1}onItemSelectedChange_(e){if(e.rawValue){const r=this.items_.findIndex(i=>i===e.sender);this.items_.forEach((i,o)=>{i.rawValue=o===r}),this.selectedIndex.rawValue=r}else this.keepSelection_()}}const Zn=Y("tab");class Dw{constructor(e,r){this.element=e.createElement("div"),this.element.classList.add(Zn(),oh()),r.viewProps.bindClassModifiers(this.element),Ae(r.empty,jn(this.element,Zn(void 0,"nop")));const i=e.createElement("div");i.classList.add(Zn("t")),this.element.appendChild(i),this.itemsElement=i;const o=e.createElement("div");o.classList.add(Zn("i")),this.element.appendChild(o);const s=e.createElement("div");s.classList.add(Zn("c")),this.element.appendChild(s),this.contentsElement=s}}class Ec extends Ea{constructor(e,r){const i=new Ow,o=new Dw(e,{empty:i.empty,viewProps:r.viewProps});super({blade:r.blade,rackController:new ka({blade:r.blade,element:o.contentsElement,viewProps:r.viewProps}),view:o}),this.onRackAdd_=this.onRackAdd_.bind(this),this.onRackRemove_=this.onRackRemove_.bind(this);const s=this.rackController.rack;s.emitter.on("add",this.onRackAdd_),s.emitter.on("remove",this.onRackRemove_),this.tab=i}add(e,r){this.rackController.rack.add(e,r)}remove(e){this.rackController.rack.remove(this.rackController.rack.children[e])}onRackAdd_(e){if(!e.root)return;const r=e.bladeController;Xd(this.view.itemsElement,r.itemController.view.element,e.index),r.itemController.viewProps.set("parent",this.viewProps),this.tab.add(r.props.value("selected"))}onRackRemove_(e){if(!e.root)return;const r=e.bladeController;xa(r.itemController.view.element),r.itemController.viewProps.set("parent",null),this.tab.remove(r.props.value("selected"))}}const sh=St({id:"tab",type:"blade",accept(n){const e=lt(n,r=>({pages:r.required.array(r.required.object({title:r.required.string})),view:r.required.constant("tab")}));return!e||e.pages.length===0?null:{params:e}},controller(n){const e=new Ec(n.document,{blade:n.blade,viewProps:n.viewProps});return n.params.pages.forEach(r=>{const i=new ks(n.document,{blade:zn(),itemProps:K.fromObject({selected:!1,title:r.title}),props:K.fromObject({selected:!1}),viewProps:$e.create()});e.add(i)}),e},api(n){return n.controller instanceof Ec?new Tw(n.controller,n.pool):n.controller instanceof ks?new Iw(n.controller,n.pool):null}});function Rw(n,e){const r=n.accept(e.params);if(!r)return null;const i=lt(e.params,o=>({disabled:o.optional.boolean,hidden:o.optional.boolean}));return n.controller({blade:zn(),document:e.document,params:Object.assign(Object.assign({},r.params),{disabled:i==null?void 0:i.disabled,hidden:i==null?void 0:i.hidden}),viewProps:$e.create({disabled:i==null?void 0:i.disabled,hidden:i==null?void 0:i.hidden})})}class Pa extends wr{get options(){return this.controller.valueController.props.get("options")}set options(e){this.controller.valueController.props.set("options",e)}}class jw{constructor(){this.disabled=!1,this.emitter=new ft}dispose(){}tick(){this.disabled||this.emitter.emit("tick",{sender:this})}}class Lw{constructor(e,r){this.disabled_=!1,this.timerId_=null,this.onTick_=this.onTick_.bind(this),this.doc_=e,this.emitter=new ft,this.interval_=r,this.setTimer_()}get disabled(){return this.disabled_}set disabled(e){this.disabled_=e,this.disabled_?this.clearTimer_():this.setTimer_()}dispose(){this.clearTimer_()}clearTimer_(){if(this.timerId_===null)return;const e=this.doc_.defaultView;e&&e.clearInterval(this.timerId_),this.timerId_=null}setTimer_(){if(this.clearTimer_(),this.interval_<=0)return;const e=this.doc_.defaultView;e&&(this.timerId_=e.setInterval(this.onTick_,this.interval_))}onTick_(){this.disabled_||this.emitter.emit("tick",{sender:this})}}class Lr{constructor(e){this.constraints=e}constrain(e){return this.constraints.reduce((r,i)=>i.constrain(r),e)}}function Hi(n,e){if(n instanceof e)return n;if(n instanceof Lr){const r=n.constraints.reduce((i,o)=>i||(o instanceof e?o:null),null);if(r)return r}return null}class zr{constructor(e){this.values=K.fromObject({options:e})}constrain(e){const r=this.values.get("options");return r.length===0||r.filter(o=>o.value===e).length>0?e:r[0].value}}function Nr(n){var e;const r=ws;if(Array.isArray(n))return(e=lt({items:n},i=>({items:i.required.array(i.required.object({text:i.required.string,value:i.required.raw}))})))===null||e===void 0?void 0:e.items;if(typeof n=="object")return r.required.raw(n).value}function Sa(n){if(Array.isArray(n))return n;const e=[];return Object.keys(n).forEach(r=>{e.push({text:r,value:n[r]})}),e}function Ma(n){return rt(n)?null:new zr(Sa(n))}const Mo=Y("lst");class zw{constructor(e,r){this.onValueChange_=this.onValueChange_.bind(this),this.props_=r.props,this.element=e.createElement("div"),this.element.classList.add(Mo()),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("select");i.classList.add(Mo("s")),r.viewProps.bindDisabled(i),this.element.appendChild(i),this.selectElement=i;const o=e.createElement("div");o.classList.add(Mo("m")),o.appendChild(so(e,"dropdown")),this.element.appendChild(o),r.value.emitter.on("change",this.onValueChange_),this.value_=r.value,ae(this.props_,"options",s=>{Zd(this.selectElement),s.forEach(a=>{const l=e.createElement("option");l.textContent=a.text,this.selectElement.appendChild(l)}),this.update_()})}update_(){const e=this.props_.get("options").map(r=>r.value);this.selectElement.selectedIndex=e.indexOf(this.value_.rawValue)}onValueChange_(){this.update_()}}class Ke{constructor(e,r){this.onSelectChange_=this.onSelectChange_.bind(this),this.props=r.props,this.value=r.value,this.viewProps=r.viewProps,this.view=new zw(e,{props:this.props,value:this.value,viewProps:this.viewProps}),this.view.selectElement.addEventListener("change",this.onSelectChange_)}onSelectChange_(e){const r=e.currentTarget;this.value.rawValue=this.props.get("options")[r.selectedIndex].value}importProps(e){return Ft(e,null,r=>({options:r.required.custom(Nr)}),r=>(this.props.set("options",Sa(r.options)),!0))}exportProps(){return Vt(null,{options:this.props.get("options")})}}const kc=Y("pop");class Nw{constructor(e,r){this.element=e.createElement("div"),this.element.classList.add(kc()),r.viewProps.bindClassModifiers(this.element),Ae(r.shows,jn(this.element,kc(void 0,"v")))}}class ah{constructor(e,r){this.shows=at(!1),this.viewProps=r.viewProps,this.view=new Nw(e,{shows:this.shows,viewProps:this.viewProps})}}const Ac=Y("txt");class Fw{constructor(e,r){this.onChange_=this.onChange_.bind(this),this.element=e.createElement("div"),this.element.classList.add(Ac()),r.viewProps.bindClassModifiers(this.element),this.props_=r.props,this.props_.emitter.on("change",this.onChange_);const i=e.createElement("input");i.classList.add(Ac("i")),i.type="text",r.viewProps.bindDisabled(i),this.element.appendChild(i),this.inputElement=i,r.value.emitter.on("change",this.onChange_),this.value_=r.value,this.refresh()}refresh(){const e=this.props_.get("formatter");this.inputElement.value=e(this.value_.rawValue)}onChange_(){this.refresh()}}class Cr{constructor(e,r){this.onInputChange_=this.onInputChange_.bind(this),this.parser_=r.parser,this.props=r.props,this.value=r.value,this.viewProps=r.viewProps,this.view=new Fw(e,{props:r.props,value:this.value,viewProps:this.viewProps}),this.view.inputElement.addEventListener("change",this.onInputChange_)}onInputChange_(e){const i=e.currentTarget.value,o=this.parser_(i);rt(o)||(this.value.rawValue=o),this.view.refresh()}}function Vw(n){return String(n)}function lh(n){return n==="false"?!1:!!n}function Pc(n){return Vw(n)}function Bw(n){return e=>n.reduce((r,i)=>r!==null?r:i(e),null)}const Uw=Rt(0);function qi(n){return Uw(n)+"%"}function ch(n){return String(n)}function As(n){return n}function Nn({primary:n,secondary:e,forward:r,backward:i}){let o=!1;function s(a){o||(o=!0,a(),o=!1)}n.emitter.on("change",a=>{s(()=>{e.setRawValue(r(n.rawValue,e.rawValue),a.options)})}),e.emitter.on("change",a=>{s(()=>{n.setRawValue(i(n.rawValue,e.rawValue),a.options)}),s(()=>{e.setRawValue(r(n.rawValue,e.rawValue),a.options)})}),s(()=>{e.setRawValue(r(n.rawValue,e.rawValue),{forceEmit:!1,last:!0})})}function Ot(n,e){const r=n*(e.altKey?.1:1)*(e.shiftKey?10:1);return e.upKey?+r:e.downKey?-r:0}function Er(n){return{altKey:n.altKey,downKey:n.key==="ArrowDown",shiftKey:n.shiftKey,upKey:n.key==="ArrowUp"}}function Me(n){return{altKey:n.altKey,downKey:n.key==="ArrowLeft",shiftKey:n.shiftKey,upKey:n.key==="ArrowRight"}}function Hw(n){return n==="ArrowUp"||n==="ArrowDown"}function uh(n){return Hw(n)||n==="ArrowLeft"||n==="ArrowRight"}function $o(n,e){var r,i;const o=e.ownerDocument.defaultView,s=e.getBoundingClientRect();return{x:n.pageX-(((r=o&&o.scrollX)!==null&&r!==void 0?r:0)+s.left),y:n.pageY-(((i=o&&o.scrollY)!==null&&i!==void 0?i:0)+s.top)}}class gn{constructor(e){this.lastTouch_=null,this.onDocumentMouseMove_=this.onDocumentMouseMove_.bind(this),this.onDocumentMouseUp_=this.onDocumentMouseUp_.bind(this),this.onMouseDown_=this.onMouseDown_.bind(this),this.onTouchEnd_=this.onTouchEnd_.bind(this),this.onTouchMove_=this.onTouchMove_.bind(this),this.onTouchStart_=this.onTouchStart_.bind(this),this.elem_=e,this.emitter=new ft,e.addEventListener("touchstart",this.onTouchStart_,{passive:!1}),e.addEventListener("touchmove",this.onTouchMove_,{passive:!0}),e.addEventListener("touchend",this.onTouchEnd_),e.addEventListener("mousedown",this.onMouseDown_)}computePosition_(e){const r=this.elem_.getBoundingClientRect();return{bounds:{width:r.width,height:r.height},point:e?{x:e.x,y:e.y}:null}}onMouseDown_(e){var r;e.preventDefault(),(r=e.currentTarget)===null||r===void 0||r.focus();const i=this.elem_.ownerDocument;i.addEventListener("mousemove",this.onDocumentMouseMove_),i.addEventListener("mouseup",this.onDocumentMouseUp_),this.emitter.emit("down",{altKey:e.altKey,data:this.computePosition_($o(e,this.elem_)),sender:this,shiftKey:e.shiftKey})}onDocumentMouseMove_(e){this.emitter.emit("move",{altKey:e.altKey,data:this.computePosition_($o(e,this.elem_)),sender:this,shiftKey:e.shiftKey})}onDocumentMouseUp_(e){const r=this.elem_.ownerDocument;r.removeEventListener("mousemove",this.onDocumentMouseMove_),r.removeEventListener("mouseup",this.onDocumentMouseUp_),this.emitter.emit("up",{altKey:e.altKey,data:this.computePosition_($o(e,this.elem_)),sender:this,shiftKey:e.shiftKey})}onTouchStart_(e){e.preventDefault();const r=e.targetTouches.item(0),i=this.elem_.getBoundingClientRect();this.emitter.emit("down",{altKey:e.altKey,data:this.computePosition_(r?{x:r.clientX-i.left,y:r.clientY-i.top}:void 0),sender:this,shiftKey:e.shiftKey}),this.lastTouch_=r}onTouchMove_(e){const r=e.targetTouches.item(0),i=this.elem_.getBoundingClientRect();this.emitter.emit("move",{altKey:e.altKey,data:this.computePosition_(r?{x:r.clientX-i.left,y:r.clientY-i.top}:void 0),sender:this,shiftKey:e.shiftKey}),this.lastTouch_=r}onTouchEnd_(e){var r;const i=(r=e.targetTouches.item(0))!==null&&r!==void 0?r:this.lastTouch_,o=this.elem_.getBoundingClientRect();this.emitter.emit("up",{altKey:e.altKey,data:this.computePosition_(i?{x:i.clientX-o.left,y:i.clientY-o.top}:void 0),sender:this,shiftKey:e.shiftKey})}}const Ut=Y("txt");class qw{constructor(e,r){this.onChange_=this.onChange_.bind(this),this.props_=r.props,this.props_.emitter.on("change",this.onChange_),this.element=e.createElement("div"),this.element.classList.add(Ut(),Ut(void 0,"num")),r.arrayPosition&&this.element.classList.add(Ut(void 0,r.arrayPosition)),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("input");i.classList.add(Ut("i")),i.type="text",r.viewProps.bindDisabled(i),this.element.appendChild(i),this.inputElement=i,this.onDraggingChange_=this.onDraggingChange_.bind(this),this.dragging_=r.dragging,this.dragging_.emitter.on("change",this.onDraggingChange_),this.element.classList.add(Ut()),this.inputElement.classList.add(Ut("i"));const o=e.createElement("div");o.classList.add(Ut("k")),this.element.appendChild(o),this.knobElement=o;const s=e.createElementNS(ie,"svg");s.classList.add(Ut("g")),this.knobElement.appendChild(s);const a=e.createElementNS(ie,"path");a.classList.add(Ut("gb")),s.appendChild(a),this.guideBodyElem_=a;const l=e.createElementNS(ie,"path");l.classList.add(Ut("gh")),s.appendChild(l),this.guideHeadElem_=l;const c=e.createElement("div");c.classList.add(Y("tt")()),this.knobElement.appendChild(c),this.tooltipElem_=c,r.value.emitter.on("change",this.onChange_),this.value=r.value,this.refresh()}onDraggingChange_(e){if(e.rawValue===null){this.element.classList.remove(Ut(void 0,"drg"));return}this.element.classList.add(Ut(void 0,"drg"));const r=e.rawValue/this.props_.get("pointerScale"),i=r+(r>0?-1:r<0?1:0),o=vt(-i,-4,4);this.guideHeadElem_.setAttributeNS(null,"d",[`M ${i+o},0 L${i},4 L${i+o},8`,`M ${r},-1 L${r},9`].join(" ")),this.guideBodyElem_.setAttributeNS(null,"d",`M 0,4 L${r},4`);const s=this.props_.get("formatter");this.tooltipElem_.textContent=s(this.value.rawValue),this.tooltipElem_.style.left=`${r}px`}refresh(){const e=this.props_.get("formatter");this.inputElement.value=e(this.value.rawValue)}onChange_(){this.refresh()}}class Fr{constructor(e,r){var i;this.originRawValue_=0,this.onInputChange_=this.onInputChange_.bind(this),this.onInputKeyDown_=this.onInputKeyDown_.bind(this),this.onInputKeyUp_=this.onInputKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.parser_=r.parser,this.props=r.props,this.sliderProps_=(i=r.sliderProps)!==null&&i!==void 0?i:null,this.value=r.value,this.viewProps=r.viewProps,this.dragging_=at(null),this.view=new qw(e,{arrayPosition:r.arrayPosition,dragging:this.dragging_,props:this.props,value:this.value,viewProps:this.viewProps}),this.view.inputElement.addEventListener("change",this.onInputChange_),this.view.inputElement.addEventListener("keydown",this.onInputKeyDown_),this.view.inputElement.addEventListener("keyup",this.onInputKeyUp_);const o=new gn(this.view.knobElement);o.emitter.on("down",this.onPointerDown_),o.emitter.on("move",this.onPointerMove_),o.emitter.on("up",this.onPointerUp_)}constrainValue_(e){var r,i;const o=(r=this.sliderProps_)===null||r===void 0?void 0:r.get("min"),s=(i=this.sliderProps_)===null||i===void 0?void 0:i.get("max");let a=e;return o!==void 0&&(a=Math.max(a,o)),s!==void 0&&(a=Math.min(a,s)),a}onInputChange_(e){const i=e.currentTarget.value,o=this.parser_(i);rt(o)||(this.value.rawValue=this.constrainValue_(o)),this.view.refresh()}onInputKeyDown_(e){const r=Ot(this.props.get("keyScale"),Er(e));r!==0&&this.value.setRawValue(this.constrainValue_(this.value.rawValue+r),{forceEmit:!1,last:!1})}onInputKeyUp_(e){Ot(this.props.get("keyScale"),Er(e))!==0&&this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}onPointerDown_(){this.originRawValue_=this.value.rawValue,this.dragging_.rawValue=0}computeDraggingValue_(e){if(!e.point)return null;const r=e.point.x-e.bounds.width/2;return this.constrainValue_(this.originRawValue_+r*this.props.get("pointerScale"))}onPointerMove_(e){const r=this.computeDraggingValue_(e.data);r!==null&&(this.value.setRawValue(r,{forceEmit:!1,last:!1}),this.dragging_.rawValue=this.value.rawValue-this.originRawValue_)}onPointerUp_(e){const r=this.computeDraggingValue_(e.data);r!==null&&(this.value.setRawValue(r,{forceEmit:!0,last:!0}),this.dragging_.rawValue=null)}}const To=Y("sld");class Kw{constructor(e,r){this.onChange_=this.onChange_.bind(this),this.props_=r.props,this.props_.emitter.on("change",this.onChange_),this.element=e.createElement("div"),this.element.classList.add(To()),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("div");i.classList.add(To("t")),r.viewProps.bindTabIndex(i),this.element.appendChild(i),this.trackElement=i;const o=e.createElement("div");o.classList.add(To("k")),this.trackElement.appendChild(o),this.knobElement=o,r.value.emitter.on("change",this.onChange_),this.value=r.value,this.update_()}update_(){const e=vt(et(this.value.rawValue,this.props_.get("min"),this.props_.get("max"),0,100),0,100);this.knobElement.style.width=`${e}%`}onChange_(){this.update_()}}class Gw{constructor(e,r){this.onKeyDown_=this.onKeyDown_.bind(this),this.onKeyUp_=this.onKeyUp_.bind(this),this.onPointerDownOrMove_=this.onPointerDownOrMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.value=r.value,this.viewProps=r.viewProps,this.props=r.props,this.view=new Kw(e,{props:this.props,value:this.value,viewProps:this.viewProps}),this.ptHandler_=new gn(this.view.trackElement),this.ptHandler_.emitter.on("down",this.onPointerDownOrMove_),this.ptHandler_.emitter.on("move",this.onPointerDownOrMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.trackElement.addEventListener("keydown",this.onKeyDown_),this.view.trackElement.addEventListener("keyup",this.onKeyUp_)}handlePointerEvent_(e,r){e.point&&this.value.setRawValue(et(vt(e.point.x,0,e.bounds.width),0,e.bounds.width,this.props.get("min"),this.props.get("max")),r)}onPointerDownOrMove_(e){this.handlePointerEvent_(e.data,{forceEmit:!1,last:!1})}onPointerUp_(e){this.handlePointerEvent_(e.data,{forceEmit:!0,last:!0})}onKeyDown_(e){const r=Ot(this.props.get("keyScale"),Me(e));r!==0&&this.value.setRawValue(this.value.rawValue+r,{forceEmit:!1,last:!1})}onKeyUp_(e){Ot(this.props.get("keyScale"),Me(e))!==0&&this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}const Io=Y("sldtxt");class Ww{constructor(e,r){this.element=e.createElement("div"),this.element.classList.add(Io());const i=e.createElement("div");i.classList.add(Io("s")),this.sliderView_=r.sliderView,i.appendChild(this.sliderView_.element),this.element.appendChild(i);const o=e.createElement("div");o.classList.add(Io("t")),this.textView_=r.textView,o.appendChild(this.textView_.element),this.element.appendChild(o)}}class Ki{constructor(e,r){this.value=r.value,this.viewProps=r.viewProps,this.sliderC_=new Gw(e,{props:r.sliderProps,value:r.value,viewProps:this.viewProps}),this.textC_=new Fr(e,{parser:r.parser,props:r.textProps,sliderProps:r.sliderProps,value:r.value,viewProps:r.viewProps}),this.view=new Ww(e,{sliderView:this.sliderC_.view,textView:this.textC_.view})}get sliderController(){return this.sliderC_}get textController(){return this.textC_}importProps(e){return Ft(e,null,r=>({max:r.required.number,min:r.required.number}),r=>{const i=this.sliderC_.props;return i.set("max",r.max),i.set("min",r.min),!0})}exportProps(){const e=this.sliderC_.props;return Vt(null,{max:e.get("max"),min:e.get("min")})}}function dh(n){return{sliderProps:new K({keyScale:n.keyScale,max:n.max,min:n.min}),textProps:new K({formatter:at(n.formatter),keyScale:n.keyScale,pointerScale:at(n.pointerScale)})}}const Yw={containerUnitSize:"cnt-usz"};function hh(n){return`--${Yw[n]}`}function kr(n){return Wd(n)}function Ue(n){if(xs(n))return lt(n,kr)}function Ee(n,e){if(!n)return;const r=[],i=qd(n,e);i&&r.push(i);const o=Kd(n);return o&&r.push(o),new Lr(r)}function Xw(n){return n?n.major===Ln.major:!1}function ph(n){if(n==="inline"||n==="popup")return n}function Vr(n,e){n.write(e)}const Qr=Y("ckb");class Zw{constructor(e,r){this.onValueChange_=this.onValueChange_.bind(this),this.element=e.createElement("div"),this.element.classList.add(Qr()),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("label");i.classList.add(Qr("l")),this.element.appendChild(i),this.labelElement=i;const o=e.createElement("input");o.classList.add(Qr("i")),o.type="checkbox",this.labelElement.appendChild(o),this.inputElement=o,r.viewProps.bindDisabled(this.inputElement);const s=e.createElement("div");s.classList.add(Qr("w")),this.labelElement.appendChild(s);const a=so(e,"check");s.appendChild(a),r.value.emitter.on("change",this.onValueChange_),this.value=r.value,this.update_()}update_(){this.inputElement.checked=this.value.rawValue}onValueChange_(){this.update_()}}class Jw{constructor(e,r){this.onInputChange_=this.onInputChange_.bind(this),this.onLabelMouseDown_=this.onLabelMouseDown_.bind(this),this.value=r.value,this.viewProps=r.viewProps,this.view=new Zw(e,{value:this.value,viewProps:this.viewProps}),this.view.inputElement.addEventListener("change",this.onInputChange_),this.view.labelElement.addEventListener("mousedown",this.onLabelMouseDown_)}onInputChange_(e){const r=e.currentTarget;this.value.rawValue=r.checked,e.preventDefault(),e.stopPropagation()}onLabelMouseDown_(e){e.preventDefault()}}function Qw(n){const e=[],r=Ma(n.options);return r&&e.push(r),new Lr(e)}const t1=St({id:"input-bool",type:"input",accept:(n,e)=>{if(typeof n!="boolean")return null;const r=lt(e,i=>({options:i.optional.custom(Nr),readonly:i.optional.constant(!1)}));return r?{initialValue:n,params:r}:null},binding:{reader:n=>lh,constraint:n=>Qw(n.params),writer:n=>Vr},controller:n=>{const e=n.document,r=n.value,i=n.constraint,o=i&&Hi(i,zr);return o?new Ke(e,{props:new K({options:o.values.value("options")}),value:r,viewProps:n.viewProps}):new Jw(e,{value:r,viewProps:n.viewProps})},api(n){return typeof n.controller.value.rawValue!="boolean"?null:n.controller.valueController instanceof Ke?new Pa(n.controller):null}}),Qe=Y("col");class e1{constructor(e,r){this.element=e.createElement("div"),this.element.classList.add(Qe()),r.foldable.bindExpandedClass(this.element,Qe(void 0,"expanded")),ae(r.foldable,"completed",jn(this.element,Qe(void 0,"cpl")));const i=e.createElement("div");i.classList.add(Qe("h")),this.element.appendChild(i);const o=e.createElement("div");o.classList.add(Qe("s")),i.appendChild(o),this.swatchElement=o;const s=e.createElement("div");if(s.classList.add(Qe("t")),i.appendChild(s),this.textElement=s,r.pickerLayout==="inline"){const a=e.createElement("div");a.classList.add(Qe("p")),this.element.appendChild(a),this.pickerElement=a}else this.pickerElement=null}}function n1(n,e,r){const i=vt(n/255,0,1),o=vt(e/255,0,1),s=vt(r/255,0,1),a=Math.max(i,o,s),l=Math.min(i,o,s),c=a-l;let u=0,h=0;const d=(l+a)/2;return c!==0&&(h=c/(1-Math.abs(a+l-1)),i===a?u=(o-s)/c:o===a?u=2+(s-i)/c:u=4+(i-o)/c,u=u/6+(u<0?1:0)),[u*360,h*100,d*100]}function r1(n,e,r){const i=(n%360+360)%360,o=vt(e/100,0,1),s=vt(r/100,0,1),a=(1-Math.abs(2*s-1))*o,l=a*(1-Math.abs(i/60%2-1)),c=s-a/2;let u,h,d;return i>=0&&i<60?[u,h,d]=[a,l,0]:i>=60&&i<120?[u,h,d]=[l,a,0]:i>=120&&i<180?[u,h,d]=[0,a,l]:i>=180&&i<240?[u,h,d]=[0,l,a]:i>=240&&i<300?[u,h,d]=[l,0,a]:[u,h,d]=[a,0,l],[(u+c)*255,(h+c)*255,(d+c)*255]}function i1(n,e,r){const i=vt(n/255,0,1),o=vt(e/255,0,1),s=vt(r/255,0,1),a=Math.max(i,o,s),l=Math.min(i,o,s),c=a-l;let u;c===0?u=0:a===i?u=60*(((o-s)/c%6+6)%6):a===o?u=60*((s-i)/c+2):u=60*((i-o)/c+4);const h=a===0?0:c/a,d=a;return[u,h*100,d*100]}function fh(n,e,r){const i=Bd(n,360),o=vt(e/100,0,1),s=vt(r/100,0,1),a=s*o,l=a*(1-Math.abs(i/60%2-1)),c=s-a;let u,h,d;return i>=0&&i<60?[u,h,d]=[a,l,0]:i>=60&&i<120?[u,h,d]=[l,a,0]:i>=120&&i<180?[u,h,d]=[0,a,l]:i>=180&&i<240?[u,h,d]=[0,l,a]:i>=240&&i<300?[u,h,d]=[l,0,a]:[u,h,d]=[a,0,l],[(u+c)*255,(h+c)*255,(d+c)*255]}function o1(n,e,r){const i=r+e*(100-Math.abs(2*r-100))/200;return[n,i!==0?e*(100-Math.abs(2*r-100))/i:0,r+e*(100-Math.abs(2*r-100))/200]}function s1(n,e,r){const i=100-Math.abs(r*(200-e)/100-100);return[n,i!==0?e*r/i:0,r*(200-e)/200]}function le(n){return[n[0],n[1],n[2]]}function lo(n,e){return[n[0],n[1],n[2],e]}const a1={hsl:{hsl:(n,e,r)=>[n,e,r],hsv:o1,rgb:r1},hsv:{hsl:s1,hsv:(n,e,r)=>[n,e,r],rgb:fh},rgb:{hsl:n1,hsv:i1,rgb:(n,e,r)=>[n,e,r]}};function On(n,e){return[e==="float"?1:n==="rgb"?255:360,e==="float"?1:n==="rgb"?255:100,e==="float"?1:n==="rgb"?255:100]}function l1(n,e){return n===e?e:Bd(n,e)}function vh(n,e,r){var i;const o=On(e,r);return[e==="rgb"?vt(n[0],0,o[0]):l1(n[0],o[0]),vt(n[1],0,o[1]),vt(n[2],0,o[2]),vt((i=n[3])!==null&&i!==void 0?i:1,0,1)]}function Sc(n,e,r,i){const o=On(e,r),s=On(e,i);return n.map((a,l)=>a/o[l]*s[l])}function mh(n,e,r){const i=Sc(n,e.mode,e.type,"int"),o=a1[e.mode][r.mode](...i);return Sc(o,r.mode,"int",r.type)}class X{static black(){return new X([0,0,0],"rgb")}constructor(e,r){this.type="int",this.mode=r,this.comps_=vh(e,r,this.type)}getComponents(e){return lo(mh(le(this.comps_),{mode:this.mode,type:this.type},{mode:e??this.mode,type:this.type}),this.comps_[3])}toRgbaObject(){const e=this.getComponents("rgb");return{r:e[0],g:e[1],b:e[2],a:e[3]}}}const Re=Y("colp");class c1{constructor(e,r){this.alphaViews_=null,this.element=e.createElement("div"),this.element.classList.add(Re()),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("div");i.classList.add(Re("hsv"));const o=e.createElement("div");o.classList.add(Re("sv")),this.svPaletteView_=r.svPaletteView,o.appendChild(this.svPaletteView_.element),i.appendChild(o);const s=e.createElement("div");s.classList.add(Re("h")),this.hPaletteView_=r.hPaletteView,s.appendChild(this.hPaletteView_.element),i.appendChild(s),this.element.appendChild(i);const a=e.createElement("div");if(a.classList.add(Re("rgb")),this.textsView_=r.textsView,a.appendChild(this.textsView_.element),this.element.appendChild(a),r.alphaViews){this.alphaViews_={palette:r.alphaViews.palette,text:r.alphaViews.text};const l=e.createElement("div");l.classList.add(Re("a"));const c=e.createElement("div");c.classList.add(Re("ap")),c.appendChild(this.alphaViews_.palette.element),l.appendChild(c);const u=e.createElement("div");u.classList.add(Re("at")),u.appendChild(this.alphaViews_.text.element),l.appendChild(u),this.element.appendChild(l)}}get allFocusableElements(){const e=[this.svPaletteView_.element,this.hPaletteView_.element,this.textsView_.modeSelectElement,...this.textsView_.inputViews.map(r=>r.inputElement)];return this.alphaViews_&&e.push(this.alphaViews_.palette.element,this.alphaViews_.text.inputElement),e}}function u1(n){return n==="int"?"int":n==="float"?"float":void 0}function $a(n){return lt(n,e=>({color:e.optional.object({alpha:e.optional.boolean,type:e.optional.custom(u1)}),expanded:e.optional.boolean,picker:e.optional.custom(ph),readonly:e.optional.constant(!1)}))}function pn(n){return n?.1:1}function gh(n){var e;return(e=n.color)===null||e===void 0?void 0:e.type}class Ta{constructor(e,r){this.type="float",this.mode=r,this.comps_=vh(e,r,this.type)}getComponents(e){return lo(mh(le(this.comps_),{mode:this.mode,type:this.type},{mode:e??this.mode,type:this.type}),this.comps_[3])}toRgbaObject(){const e=this.getComponents("rgb");return{r:e[0],g:e[1],b:e[2],a:e[3]}}}const d1={int:(n,e)=>new X(n,e),float:(n,e)=>new Ta(n,e)};function Ia(n,e,r){return d1[r](n,e)}function h1(n){return n.type==="float"}function p1(n){return n.type==="int"}function f1(n){const e=n.getComponents(),r=On(n.mode,"int");return new X([Math.round(et(e[0],0,1,0,r[0])),Math.round(et(e[1],0,1,0,r[1])),Math.round(et(e[2],0,1,0,r[2])),e[3]],n.mode)}function v1(n){const e=n.getComponents(),r=On(n.mode,"int");return new Ta([et(e[0],0,r[0],0,1),et(e[1],0,r[1],0,1),et(e[2],0,r[2],0,1),e[3]],n.mode)}function At(n,e){if(n.type===e)return n;if(p1(n)&&e==="float")return v1(n);if(h1(n)&&e==="int")return f1(n);throw ct.shouldNeverHappen()}function m1(n,e){return n.alpha===e.alpha&&n.mode===e.mode&&n.notation===e.notation&&n.type===e.type}function Gt(n,e){const r=n.match(/^(.+)%$/);return Math.min(r?parseFloat(r[1])*.01*e:parseFloat(n),e)}const g1={deg:n=>n,grad:n=>n*360/400,rad:n=>n*360/(2*Math.PI),turn:n=>n*360};function bh(n){const e=n.match(/^([0-9.]+?)(deg|grad|rad|turn)$/);if(!e)return parseFloat(n);const r=parseFloat(e[1]),i=e[2];return g1[i](r)}function _h(n){const e=n.match(/^rgb\(\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*\)$/);if(!e)return null;const r=[Gt(e[1],255),Gt(e[2],255),Gt(e[3],255)];return isNaN(r[0])||isNaN(r[1])||isNaN(r[2])?null:r}function b1(n){const e=_h(n);return e?new X(e,"rgb"):null}function yh(n){const e=n.match(/^rgba\(\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*\)$/);if(!e)return null;const r=[Gt(e[1],255),Gt(e[2],255),Gt(e[3],255),Gt(e[4],1)];return isNaN(r[0])||isNaN(r[1])||isNaN(r[2])||isNaN(r[3])?null:r}function _1(n){const e=yh(n);return e?new X(e,"rgb"):null}function xh(n){const e=n.match(/^hsl\(\s*([0-9A-Fa-f.]+(?:deg|grad|rad|turn)?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*\)$/);if(!e)return null;const r=[bh(e[1]),Gt(e[2],100),Gt(e[3],100)];return isNaN(r[0])||isNaN(r[1])||isNaN(r[2])?null:r}function y1(n){const e=xh(n);return e?new X(e,"hsl"):null}function wh(n){const e=n.match(/^hsla\(\s*([0-9A-Fa-f.]+(?:deg|grad|rad|turn)?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*,\s*([0-9A-Fa-f.]+%?)\s*\)$/);if(!e)return null;const r=[bh(e[1]),Gt(e[2],100),Gt(e[3],100),Gt(e[4],1)];return isNaN(r[0])||isNaN(r[1])||isNaN(r[2])||isNaN(r[3])?null:r}function x1(n){const e=wh(n);return e?new X(e,"hsl"):null}function Ch(n){const e=n.match(/^#([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])$/);if(e)return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];const r=n.match(/^(?:#|0x)([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})$/);return r?[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]:null}function w1(n){const e=Ch(n);return e?new X(e,"rgb"):null}function Eh(n){const e=n.match(/^#([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])$/);if(e)return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),et(parseInt(e[4]+e[4],16),0,255,0,1)];const r=n.match(/^(?:#|0x)?([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})$/);return r?[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),et(parseInt(r[4],16),0,255,0,1)]:null}function C1(n){const e=Eh(n);return e?new X(e,"rgb"):null}function kh(n){const e=n.match(/^\{\s*r\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*g\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*b\s*:\s*([0-9A-Fa-f.]+%?)\s*\}$/);if(!e)return null;const r=[parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])];return isNaN(r[0])||isNaN(r[1])||isNaN(r[2])?null:r}function E1(n){return e=>{const r=kh(e);return r?Ia(r,"rgb",n):null}}function Ah(n){const e=n.match(/^\{\s*r\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*g\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*b\s*:\s*([0-9A-Fa-f.]+%?)\s*,\s*a\s*:\s*([0-9A-Fa-f.]+%?)\s*\}$/);if(!e)return null;const r=[parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4])];return isNaN(r[0])||isNaN(r[1])||isNaN(r[2])||isNaN(r[3])?null:r}function k1(n){return e=>{const r=Ah(e);return r?Ia(r,"rgb",n):null}}const A1=[{parser:Ch,result:{alpha:!1,mode:"rgb",notation:"hex"}},{parser:Eh,result:{alpha:!0,mode:"rgb",notation:"hex"}},{parser:_h,result:{alpha:!1,mode:"rgb",notation:"func"}},{parser:yh,result:{alpha:!0,mode:"rgb",notation:"func"}},{parser:xh,result:{alpha:!1,mode:"hsl",notation:"func"}},{parser:wh,result:{alpha:!0,mode:"hsl",notation:"func"}},{parser:kh,result:{alpha:!1,mode:"rgb",notation:"object"}},{parser:Ah,result:{alpha:!0,mode:"rgb",notation:"object"}}];function P1(n){return A1.reduce((e,{parser:r,result:i})=>e||(r(n)?i:null),null)}function S1(n,e="int"){const r=P1(n);return r?r.notation==="hex"&&e!=="float"?Object.assign(Object.assign({},r),{type:"int"}):r.notation==="func"?Object.assign(Object.assign({},r),{type:e}):null:null}function Br(n){const e=[w1,C1,b1,_1,y1,x1];e.push(E1("int"),k1("int"));const r=Bw(e);return i=>{const o=r(i);return o?At(o,n):null}}function M1(n){const e=Br("int");if(typeof n!="string")return X.black();const r=e(n);return r??X.black()}function Ph(n){const e=vt(Math.floor(n),0,255).toString(16);return e.length===1?`0${e}`:e}function Oa(n,e="#"){const r=le(n.getComponents("rgb")).map(Ph).join("");return`${e}${r}`}function Da(n,e="#"){const r=n.getComponents("rgb"),i=[r[0],r[1],r[2],r[3]*255].map(Ph).join("");return`${e}${i}`}function Sh(n){const e=Rt(0),r=At(n,"int");return`rgb(${le(r.getComponents("rgb")).map(o=>e(o)).join(", ")})`}function yi(n){const e=Rt(2),r=Rt(0);return`rgba(${At(n,"int").getComponents("rgb").map((s,a)=>(a===3?e:r)(s)).join(", ")})`}function $1(n){const e=[Rt(0),qi,qi],r=At(n,"int");return`hsl(${le(r.getComponents("hsl")).map((o,s)=>e[s](o)).join(", ")})`}function T1(n){const e=[Rt(0),qi,qi,Rt(2)];return`hsla(${At(n,"int").getComponents("hsl").map((o,s)=>e[s](o)).join(", ")})`}function Mh(n,e){const r=Rt(e==="float"?2:0),i=["r","g","b"],o=At(n,e);return`{${le(o.getComponents("rgb")).map((a,l)=>`${i[l]}: ${r(a)}`).join(", ")}}`}function I1(n){return e=>Mh(e,n)}function $h(n,e){const r=Rt(2),i=Rt(e==="float"?2:0),o=["r","g","b","a"];return`{${At(n,e).getComponents("rgb").map((l,c)=>{const u=c===3?r:i;return`${o[c]}: ${u(l)}`}).join(", ")}}`}function O1(n){return e=>$h(e,n)}const D1=[{format:{alpha:!1,mode:"rgb",notation:"hex",type:"int"},stringifier:Oa},{format:{alpha:!0,mode:"rgb",notation:"hex",type:"int"},stringifier:Da},{format:{alpha:!1,mode:"rgb",notation:"func",type:"int"},stringifier:Sh},{format:{alpha:!0,mode:"rgb",notation:"func",type:"int"},stringifier:yi},{format:{alpha:!1,mode:"hsl",notation:"func",type:"int"},stringifier:$1},{format:{alpha:!0,mode:"hsl",notation:"func",type:"int"},stringifier:T1},...["int","float"].reduce((n,e)=>[...n,{format:{alpha:!1,mode:"rgb",notation:"object",type:e},stringifier:I1(e)},{format:{alpha:!0,mode:"rgb",notation:"object",type:e},stringifier:O1(e)}],[])];function Th(n){return D1.reduce((e,r)=>e||(m1(r.format,n)?r.stringifier:null),null)}const Jn=Y("apl");class R1{constructor(e,r){this.onValueChange_=this.onValueChange_.bind(this),this.value=r.value,this.value.emitter.on("change",this.onValueChange_),this.element=e.createElement("div"),this.element.classList.add(Jn()),r.viewProps.bindClassModifiers(this.element),r.viewProps.bindTabIndex(this.element);const i=e.createElement("div");i.classList.add(Jn("b")),this.element.appendChild(i);const o=e.createElement("div");o.classList.add(Jn("c")),i.appendChild(o),this.colorElem_=o;const s=e.createElement("div");s.classList.add(Jn("m")),this.element.appendChild(s),this.markerElem_=s;const a=e.createElement("div");a.classList.add(Jn("p")),this.markerElem_.appendChild(a),this.previewElem_=a,this.update_()}update_(){const e=this.value.rawValue,r=e.getComponents("rgb"),i=new X([r[0],r[1],r[2],0],"rgb"),o=new X([r[0],r[1],r[2],255],"rgb"),s=["to right",yi(i),yi(o)];this.colorElem_.style.background=`linear-gradient(${s.join(",")})`,this.previewElem_.style.backgroundColor=yi(e);const a=et(r[3],0,1,0,100);this.markerElem_.style.left=`${a}%`}onValueChange_(){this.update_()}}class j1{constructor(e,r){this.onKeyDown_=this.onKeyDown_.bind(this),this.onKeyUp_=this.onKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.value=r.value,this.viewProps=r.viewProps,this.view=new R1(e,{value:this.value,viewProps:this.viewProps}),this.ptHandler_=new gn(this.view.element),this.ptHandler_.emitter.on("down",this.onPointerDown_),this.ptHandler_.emitter.on("move",this.onPointerMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.element.addEventListener("keydown",this.onKeyDown_),this.view.element.addEventListener("keyup",this.onKeyUp_)}handlePointerEvent_(e,r){if(!e.point)return;const i=e.point.x/e.bounds.width,o=this.value.rawValue,[s,a,l]=o.getComponents("hsv");this.value.setRawValue(new X([s,a,l,i],"hsv"),r)}onPointerDown_(e){this.handlePointerEvent_(e.data,{forceEmit:!1,last:!1})}onPointerMove_(e){this.handlePointerEvent_(e.data,{forceEmit:!1,last:!1})}onPointerUp_(e){this.handlePointerEvent_(e.data,{forceEmit:!0,last:!0})}onKeyDown_(e){const r=Ot(pn(!0),Me(e));if(r===0)return;const i=this.value.rawValue,[o,s,a,l]=i.getComponents("hsv");this.value.setRawValue(new X([o,s,a,l+r],"hsv"),{forceEmit:!1,last:!1})}onKeyUp_(e){Ot(pn(!0),Me(e))!==0&&this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}const xn=Y("coltxt");function L1(n){const e=n.createElement("select"),r=[{text:"RGB",value:"rgb"},{text:"HSL",value:"hsl"},{text:"HSV",value:"hsv"},{text:"HEX",value:"hex"}];return e.appendChild(r.reduce((i,o)=>{const s=n.createElement("option");return s.textContent=o.text,s.value=o.value,i.appendChild(s),i},n.createDocumentFragment())),e}class z1{constructor(e,r){this.element=e.createElement("div"),this.element.classList.add(xn()),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("div");i.classList.add(xn("m")),this.modeElem_=L1(e),this.modeElem_.classList.add(xn("ms")),i.appendChild(this.modeSelectElement),r.viewProps.bindDisabled(this.modeElem_);const o=e.createElement("div");o.classList.add(xn("mm")),o.appendChild(so(e,"dropdown")),i.appendChild(o),this.element.appendChild(i);const s=e.createElement("div");s.classList.add(xn("w")),this.element.appendChild(s),this.inputsElem_=s,this.inputViews_=r.inputViews,this.applyInputViews_(),Ae(r.mode,a=>{this.modeElem_.value=a})}get modeSelectElement(){return this.modeElem_}get inputViews(){return this.inputViews_}set inputViews(e){this.inputViews_=e,this.applyInputViews_()}applyInputViews_(){Zd(this.inputsElem_);const e=this.element.ownerDocument;this.inputViews_.forEach(r=>{const i=e.createElement("div");i.classList.add(xn("c")),i.appendChild(r.element),this.inputsElem_.appendChild(i)})}}function N1(n){return Rt(n==="float"?2:0)}function F1(n,e,r){const i=On(n,e)[r];return new Dr({min:0,max:i})}function V1(n,e,r){return new Fr(n,{arrayPosition:r===0?"fst":r===2?"lst":"mid",parser:e.parser,props:K.fromObject({formatter:N1(e.colorType),keyScale:pn(!1),pointerScale:e.colorType==="float"?.01:1}),value:at(0,{constraint:F1(e.colorMode,e.colorType,r)}),viewProps:e.viewProps})}function B1(n,e){const r={colorMode:e.colorMode,colorType:e.colorType,parser:Se,viewProps:e.viewProps};return[0,1,2].map(i=>{const o=V1(n,r,i);return Nn({primary:e.value,secondary:o.value,forward(s){return At(s,e.colorType).getComponents(e.colorMode)[i]},backward(s,a){const l=e.colorMode,u=At(s,e.colorType).getComponents(l);u[i]=a;const h=Ia(lo(le(u),u[3]),l,e.colorType);return At(h,"int")}}),o})}function U1(n,e){const r=new Cr(n,{parser:Br("int"),props:K.fromObject({formatter:Oa}),value:at(X.black()),viewProps:e.viewProps});return Nn({primary:e.value,secondary:r.value,forward:i=>new X(le(i.getComponents()),i.mode),backward:(i,o)=>new X(lo(le(o.getComponents(i.mode)),i.getComponents()[3]),i.mode)}),[r]}function H1(n){return n!=="hex"}class q1{constructor(e,r){this.onModeSelectChange_=this.onModeSelectChange_.bind(this),this.colorType_=r.colorType,this.value=r.value,this.viewProps=r.viewProps,this.colorMode=at(this.value.rawValue.mode),this.ccs_=this.createComponentControllers_(e),this.view=new z1(e,{mode:this.colorMode,inputViews:[this.ccs_[0].view,this.ccs_[1].view,this.ccs_[2].view],viewProps:this.viewProps}),this.view.modeSelectElement.addEventListener("change",this.onModeSelectChange_)}createComponentControllers_(e){const r=this.colorMode.rawValue;return H1(r)?B1(e,{colorMode:r,colorType:this.colorType_,value:this.value,viewProps:this.viewProps}):U1(e,{value:this.value,viewProps:this.viewProps})}onModeSelectChange_(e){const r=e.currentTarget;this.colorMode.rawValue=r.value,this.ccs_=this.createComponentControllers_(this.view.element.ownerDocument),this.view.inputViews=this.ccs_.map(i=>i.view)}}const Oo=Y("hpl");class K1{constructor(e,r){this.onValueChange_=this.onValueChange_.bind(this),this.value=r.value,this.value.emitter.on("change",this.onValueChange_),this.element=e.createElement("div"),this.element.classList.add(Oo()),r.viewProps.bindClassModifiers(this.element),r.viewProps.bindTabIndex(this.element);const i=e.createElement("div");i.classList.add(Oo("c")),this.element.appendChild(i);const o=e.createElement("div");o.classList.add(Oo("m")),this.element.appendChild(o),this.markerElem_=o,this.update_()}update_(){const e=this.value.rawValue,[r]=e.getComponents("hsv");this.markerElem_.style.backgroundColor=Sh(new X([r,100,100],"hsv"));const i=et(r,0,360,0,100);this.markerElem_.style.left=`${i}%`}onValueChange_(){this.update_()}}class G1{constructor(e,r){this.onKeyDown_=this.onKeyDown_.bind(this),this.onKeyUp_=this.onKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.value=r.value,this.viewProps=r.viewProps,this.view=new K1(e,{value:this.value,viewProps:this.viewProps}),this.ptHandler_=new gn(this.view.element),this.ptHandler_.emitter.on("down",this.onPointerDown_),this.ptHandler_.emitter.on("move",this.onPointerMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.element.addEventListener("keydown",this.onKeyDown_),this.view.element.addEventListener("keyup",this.onKeyUp_)}handlePointerEvent_(e,r){if(!e.point)return;const i=et(vt(e.point.x,0,e.bounds.width),0,e.bounds.width,0,360),o=this.value.rawValue,[,s,a,l]=o.getComponents("hsv");this.value.setRawValue(new X([i,s,a,l],"hsv"),r)}onPointerDown_(e){this.handlePointerEvent_(e.data,{forceEmit:!1,last:!1})}onPointerMove_(e){this.handlePointerEvent_(e.data,{forceEmit:!1,last:!1})}onPointerUp_(e){this.handlePointerEvent_(e.data,{forceEmit:!0,last:!0})}onKeyDown_(e){const r=Ot(pn(!1),Me(e));if(r===0)return;const i=this.value.rawValue,[o,s,a,l]=i.getComponents("hsv");this.value.setRawValue(new X([o+r,s,a,l],"hsv"),{forceEmit:!1,last:!1})}onKeyUp_(e){Ot(pn(!1),Me(e))!==0&&this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}const Do=Y("svp"),Mc=64;class W1{constructor(e,r){this.onValueChange_=this.onValueChange_.bind(this),this.value=r.value,this.value.emitter.on("change",this.onValueChange_),this.element=e.createElement("div"),this.element.classList.add(Do()),r.viewProps.bindClassModifiers(this.element),r.viewProps.bindTabIndex(this.element);const i=e.createElement("canvas");i.height=Mc,i.width=Mc,i.classList.add(Do("c")),this.element.appendChild(i),this.canvasElement=i;const o=e.createElement("div");o.classList.add(Do("m")),this.element.appendChild(o),this.markerElem_=o,this.update_()}update_(){const e=Gx(this.canvasElement);if(!e)return;const i=this.value.rawValue.getComponents("hsv"),o=this.canvasElement.width,s=this.canvasElement.height,a=e.getImageData(0,0,o,s),l=a.data;for(let h=0;h<s;h++)for(let d=0;d<o;d++){const f=et(d,0,o,0,100),p=et(h,0,s,100,0),m=fh(i[0],f,p),b=(h*o+d)*4;l[b]=m[0],l[b+1]=m[1],l[b+2]=m[2],l[b+3]=255}e.putImageData(a,0,0);const c=et(i[1],0,100,0,100);this.markerElem_.style.left=`${c}%`;const u=et(i[2],0,100,100,0);this.markerElem_.style.top=`${u}%`}onValueChange_(){this.update_()}}class Y1{constructor(e,r){this.onKeyDown_=this.onKeyDown_.bind(this),this.onKeyUp_=this.onKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.value=r.value,this.viewProps=r.viewProps,this.view=new W1(e,{value:this.value,viewProps:this.viewProps}),this.ptHandler_=new gn(this.view.element),this.ptHandler_.emitter.on("down",this.onPointerDown_),this.ptHandler_.emitter.on("move",this.onPointerMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.element.addEventListener("keydown",this.onKeyDown_),this.view.element.addEventListener("keyup",this.onKeyUp_)}handlePointerEvent_(e,r){if(!e.point)return;const i=et(e.point.x,0,e.bounds.width,0,100),o=et(e.point.y,0,e.bounds.height,100,0),[s,,,a]=this.value.rawValue.getComponents("hsv");this.value.setRawValue(new X([s,i,o,a],"hsv"),r)}onPointerDown_(e){this.handlePointerEvent_(e.data,{forceEmit:!1,last:!1})}onPointerMove_(e){this.handlePointerEvent_(e.data,{forceEmit:!1,last:!1})}onPointerUp_(e){this.handlePointerEvent_(e.data,{forceEmit:!0,last:!0})}onKeyDown_(e){uh(e.key)&&e.preventDefault();const[r,i,o,s]=this.value.rawValue.getComponents("hsv"),a=pn(!1),l=Ot(a,Me(e)),c=Ot(a,Er(e));l===0&&c===0||this.value.setRawValue(new X([r,i+l,o+c,s],"hsv"),{forceEmit:!1,last:!1})}onKeyUp_(e){const r=pn(!1),i=Ot(r,Me(e)),o=Ot(r,Er(e));i===0&&o===0||this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}class X1{constructor(e,r){this.value=r.value,this.viewProps=r.viewProps,this.hPaletteC_=new G1(e,{value:this.value,viewProps:this.viewProps}),this.svPaletteC_=new Y1(e,{value:this.value,viewProps:this.viewProps}),this.alphaIcs_=r.supportsAlpha?{palette:new j1(e,{value:this.value,viewProps:this.viewProps}),text:new Fr(e,{parser:Se,props:K.fromObject({pointerScale:.01,keyScale:.1,formatter:Rt(2)}),value:at(0,{constraint:new Dr({min:0,max:1})}),viewProps:this.viewProps})}:null,this.alphaIcs_&&Nn({primary:this.value,secondary:this.alphaIcs_.text.value,forward:i=>i.getComponents()[3],backward:(i,o)=>{const s=i.getComponents();return s[3]=o,new X(s,i.mode)}}),this.textsC_=new q1(e,{colorType:r.colorType,value:this.value,viewProps:this.viewProps}),this.view=new c1(e,{alphaViews:this.alphaIcs_?{palette:this.alphaIcs_.palette.view,text:this.alphaIcs_.text.view}:null,hPaletteView:this.hPaletteC_.view,supportsAlpha:r.supportsAlpha,svPaletteView:this.svPaletteC_.view,textsView:this.textsC_.view,viewProps:this.viewProps})}get textsController(){return this.textsC_}}const Ro=Y("colsw");class Z1{constructor(e,r){this.onValueChange_=this.onValueChange_.bind(this),r.value.emitter.on("change",this.onValueChange_),this.value=r.value,this.element=e.createElement("div"),this.element.classList.add(Ro()),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("div");i.classList.add(Ro("sw")),this.element.appendChild(i),this.swatchElem_=i;const o=e.createElement("button");o.classList.add(Ro("b")),r.viewProps.bindDisabled(o),this.element.appendChild(o),this.buttonElement=o,this.update_()}update_(){const e=this.value.rawValue;this.swatchElem_.style.backgroundColor=Da(e)}onValueChange_(){this.update_()}}class J1{constructor(e,r){this.value=r.value,this.viewProps=r.viewProps,this.view=new Z1(e,{value:this.value,viewProps:this.viewProps})}}class Ra{constructor(e,r){this.onButtonBlur_=this.onButtonBlur_.bind(this),this.onButtonClick_=this.onButtonClick_.bind(this),this.onPopupChildBlur_=this.onPopupChildBlur_.bind(this),this.onPopupChildKeydown_=this.onPopupChildKeydown_.bind(this),this.value=r.value,this.viewProps=r.viewProps,this.foldable_=jr.create(r.expanded),this.swatchC_=new J1(e,{value:this.value,viewProps:this.viewProps});const i=this.swatchC_.view.buttonElement;i.addEventListener("blur",this.onButtonBlur_),i.addEventListener("click",this.onButtonClick_),this.textC_=new Cr(e,{parser:r.parser,props:K.fromObject({formatter:r.formatter}),value:this.value,viewProps:this.viewProps}),this.view=new e1(e,{foldable:this.foldable_,pickerLayout:r.pickerLayout}),this.view.swatchElement.appendChild(this.swatchC_.view.element),this.view.textElement.appendChild(this.textC_.view.element),this.popC_=r.pickerLayout==="popup"?new ah(e,{viewProps:this.viewProps}):null;const o=new X1(e,{colorType:r.colorType,supportsAlpha:r.supportsAlpha,value:this.value,viewProps:this.viewProps});o.view.allFocusableElements.forEach(s=>{s.addEventListener("blur",this.onPopupChildBlur_),s.addEventListener("keydown",this.onPopupChildKeydown_)}),this.pickerC_=o,this.popC_?(this.view.element.appendChild(this.popC_.view.element),this.popC_.view.element.appendChild(o.view.element),Nn({primary:this.foldable_.value("expanded"),secondary:this.popC_.shows,forward:s=>s,backward:(s,a)=>a})):this.view.pickerElement&&(this.view.pickerElement.appendChild(this.pickerC_.view.element),Aa(this.foldable_,this.view.pickerElement))}get textController(){return this.textC_}onButtonBlur_(e){if(!this.popC_)return;const r=this.view.element,i=e.relatedTarget;(!i||!r.contains(i))&&(this.popC_.shows.rawValue=!1)}onButtonClick_(){this.foldable_.set("expanded",!this.foldable_.get("expanded")),this.foldable_.get("expanded")&&this.pickerC_.view.allFocusableElements[0].focus()}onPopupChildBlur_(e){if(!this.popC_)return;const r=this.popC_.view.element,i=Jd(e);i&&r.contains(i)||i&&i===this.swatchC_.view.buttonElement&&!ya(r.ownerDocument)||(this.popC_.shows.rawValue=!1)}onPopupChildKeydown_(e){this.popC_?e.key==="Escape"&&(this.popC_.shows.rawValue=!1):this.view.pickerElement&&e.key==="Escape"&&this.swatchC_.view.buttonElement.focus()}}function Q1(n){return le(n.getComponents("rgb")).reduce((e,r)=>e<<8|Math.floor(r)&255,0)}function tC(n){return n.getComponents("rgb").reduce((e,r,i)=>{const o=Math.floor(i===3?r*255:r)&255;return e<<8|o},0)>>>0}function eC(n){return new X([n>>16&255,n>>8&255,n&255],"rgb")}function nC(n){return new X([n>>24&255,n>>16&255,n>>8&255,et(n&255,0,255,0,1)],"rgb")}function rC(n){return typeof n!="number"?X.black():eC(n)}function iC(n){return typeof n!="number"?X.black():nC(n)}function xi(n,e){return typeof n!="object"||rt(n)?!1:e in n&&typeof n[e]=="number"}function Ih(n){return xi(n,"r")&&xi(n,"g")&&xi(n,"b")}function Oh(n){return Ih(n)&&xi(n,"a")}function Dh(n){return Ih(n)}function ja(n,e){if(n.mode!==e.mode||n.type!==e.type)return!1;const r=n.getComponents(),i=e.getComponents();for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function $c(n){return"a"in n?[n.r,n.g,n.b,n.a]:[n.r,n.g,n.b]}function oC(n){const e=Th(n);return e?(r,i)=>{Vr(r,e(i))}:null}function sC(n){const e=n?tC:Q1;return(r,i)=>{Vr(r,e(i))}}function aC(n,e,r){const o=At(e,r).toRgbaObject();n.writeProperty("r",o.r),n.writeProperty("g",o.g),n.writeProperty("b",o.b),n.writeProperty("a",o.a)}function lC(n,e,r){const o=At(e,r).toRgbaObject();n.writeProperty("r",o.r),n.writeProperty("g",o.g),n.writeProperty("b",o.b)}function cC(n,e){return(r,i)=>{n?aC(r,i,e):lC(r,i,e)}}function uC(n){var e;return!!(!((e=n==null?void 0:n.color)===null||e===void 0)&&e.alpha)}function dC(n){return n?e=>Da(e,"0x"):e=>Oa(e,"0x")}function hC(n){return"color"in n||n.view==="color"}const pC=St({id:"input-color-number",type:"input",accept:(n,e)=>{if(typeof n!="number"||!hC(e))return null;const r=$a(e);return r?{initialValue:n,params:Object.assign(Object.assign({},r),{supportsAlpha:uC(e)})}:null},binding:{reader:n=>n.params.supportsAlpha?iC:rC,equals:ja,writer:n=>sC(n.params.supportsAlpha)},controller:n=>{var e,r;return new Ra(n.document,{colorType:"int",expanded:(e=n.params.expanded)!==null&&e!==void 0?e:!1,formatter:dC(n.params.supportsAlpha),parser:Br("int"),pickerLayout:(r=n.params.picker)!==null&&r!==void 0?r:"popup",supportsAlpha:n.params.supportsAlpha,value:n.value,viewProps:n.viewProps})}});function fC(n,e){if(!Dh(n))return At(X.black(),e);if(e==="int"){const r=$c(n);return new X(r,"rgb")}if(e==="float"){const r=$c(n);return new Ta(r,"rgb")}return At(X.black(),"int")}function vC(n){return Oh(n)}function mC(n){return e=>{const r=fC(e,n);return At(r,"int")}}function gC(n,e){return r=>n?$h(r,e):Mh(r,e)}const bC=St({id:"input-color-object",type:"input",accept:(n,e)=>{var r;if(!Dh(n))return null;const i=$a(e);return i?{initialValue:n,params:Object.assign(Object.assign({},i),{colorType:(r=gh(e))!==null&&r!==void 0?r:"int"})}:null},binding:{reader:n=>mC(n.params.colorType),equals:ja,writer:n=>cC(vC(n.initialValue),n.params.colorType)},controller:n=>{var e,r;const i=Oh(n.initialValue);return new Ra(n.document,{colorType:n.params.colorType,expanded:(e=n.params.expanded)!==null&&e!==void 0?e:!1,formatter:gC(i,n.params.colorType),parser:Br("int"),pickerLayout:(r=n.params.picker)!==null&&r!==void 0?r:"popup",supportsAlpha:i,value:n.value,viewProps:n.viewProps})}}),_C=St({id:"input-color-string",type:"input",accept:(n,e)=>{if(typeof n!="string"||e.view==="text")return null;const r=S1(n,gh(e));if(!r)return null;const i=Th(r);if(!i)return null;const o=$a(e);return o?{initialValue:n,params:Object.assign(Object.assign({},o),{format:r,stringifier:i})}:null},binding:{reader:()=>M1,equals:ja,writer:n=>{const e=oC(n.params.format);if(!e)throw ct.notBindable();return e}},controller:n=>{var e,r;return new Ra(n.document,{colorType:n.params.format.type,expanded:(e=n.params.expanded)!==null&&e!==void 0?e:!1,formatter:n.params.stringifier,parser:Br("int"),pickerLayout:(r=n.params.picker)!==null&&r!==void 0?r:"popup",supportsAlpha:n.params.format.alpha,value:n.value,viewProps:n.viewProps})}});class La{constructor(e){this.components=e.components,this.asm_=e.assembly}constrain(e){const r=this.asm_.toComponents(e).map((i,o)=>{var s,a;return(a=(s=this.components[o])===null||s===void 0?void 0:s.constrain(i))!==null&&a!==void 0?a:i});return this.asm_.fromComponents(r)}}const Tc=Y("pndtxt");class yC{constructor(e,r){this.textViews=r.textViews,this.element=e.createElement("div"),this.element.classList.add(Tc()),this.textViews.forEach(i=>{const o=e.createElement("div");o.classList.add(Tc("a")),o.appendChild(i.element),this.element.appendChild(o)})}}function xC(n,e,r){return new Fr(n,{arrayPosition:r===0?"fst":r===e.axes.length-1?"lst":"mid",parser:e.parser,props:e.axes[r].textProps,value:at(0,{constraint:e.axes[r].constraint}),viewProps:e.viewProps})}class za{constructor(e,r){this.value=r.value,this.viewProps=r.viewProps,this.acs_=r.axes.map((i,o)=>xC(e,r,o)),this.acs_.forEach((i,o)=>{Nn({primary:this.value,secondary:i.value,forward:s=>r.assembly.toComponents(s)[o],backward:(s,a)=>{const l=r.assembly.toComponents(s);return l[o]=a,r.assembly.fromComponents(l)}})}),this.view=new yC(e,{textViews:this.acs_.map(i=>i.view)})}get textControllers(){return this.acs_}}class wC extends wr{get max(){return this.controller.valueController.sliderController.props.get("max")}set max(e){this.controller.valueController.sliderController.props.set("max",e)}get min(){return this.controller.valueController.sliderController.props.get("min")}set min(e){this.controller.valueController.sliderController.props.set("min",e)}}function CC(n,e){const r=[],i=qd(n,e);i&&r.push(i);const o=Kd(n);o&&r.push(o);const s=Ma(n.options);return s&&r.push(s),new Lr(r)}const EC=St({id:"input-number",type:"input",accept:(n,e)=>{if(typeof n!="number")return null;const r=lt(e,i=>Object.assign(Object.assign({},Wd(i)),{options:i.optional.custom(Nr),readonly:i.optional.constant(!1)}));return r?{initialValue:n,params:r}:null},binding:{reader:n=>Vd,constraint:n=>CC(n.params,n.initialValue),writer:n=>Vr},controller:n=>{const e=n.value,r=n.constraint,i=r&&Hi(r,zr);if(i)return new Ke(n.document,{props:new K({options:i.values.value("options")}),value:e,viewProps:n.viewProps});const o=Gd(n.params,e.rawValue),s=r&&Hi(r,Dr);return s?new Ki(n.document,Object.assign(Object.assign({},dh(Object.assign(Object.assign({},o),{keyScale:at(o.keyScale),max:s.values.value("max"),min:s.values.value("min")}))),{parser:Se,value:e,viewProps:n.viewProps})):new Fr(n.document,{parser:Se,props:K.fromObject(o),value:e,viewProps:n.viewProps})},api(n){return typeof n.controller.value.rawValue!="number"?null:n.controller.valueController instanceof Ki?new wC(n.controller):n.controller.valueController instanceof Ke?new Pa(n.controller):null}});class He{constructor(e=0,r=0){this.x=e,this.y=r}getComponents(){return[this.x,this.y]}static isObject(e){if(rt(e))return!1;const r=e.x,i=e.y;return!(typeof r!="number"||typeof i!="number")}static equals(e,r){return e.x===r.x&&e.y===r.y}toObject(){return{x:this.x,y:this.y}}}const Rh={toComponents:n=>n.getComponents(),fromComponents:n=>new He(...n)},wn=Y("p2d");class kC{constructor(e,r){this.element=e.createElement("div"),this.element.classList.add(wn()),r.viewProps.bindClassModifiers(this.element),Ae(r.expanded,jn(this.element,wn(void 0,"expanded")));const i=e.createElement("div");i.classList.add(wn("h")),this.element.appendChild(i);const o=e.createElement("button");o.classList.add(wn("b")),o.appendChild(so(e,"p2dpad")),r.viewProps.bindDisabled(o),i.appendChild(o),this.buttonElement=o;const s=e.createElement("div");if(s.classList.add(wn("t")),i.appendChild(s),this.textElement=s,r.pickerLayout==="inline"){const a=e.createElement("div");a.classList.add(wn("p")),this.element.appendChild(a),this.pickerElement=a}else this.pickerElement=null}}const je=Y("p2dp");class AC{constructor(e,r){this.onFoldableChange_=this.onFoldableChange_.bind(this),this.onPropsChange_=this.onPropsChange_.bind(this),this.onValueChange_=this.onValueChange_.bind(this),this.props_=r.props,this.props_.emitter.on("change",this.onPropsChange_),this.element=e.createElement("div"),this.element.classList.add(je()),r.layout==="popup"&&this.element.classList.add(je(void 0,"p")),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("div");i.classList.add(je("p")),r.viewProps.bindTabIndex(i),this.element.appendChild(i),this.padElement=i;const o=e.createElementNS(ie,"svg");o.classList.add(je("g")),this.padElement.appendChild(o),this.svgElem_=o;const s=e.createElementNS(ie,"line");s.classList.add(je("ax")),s.setAttributeNS(null,"x1","0"),s.setAttributeNS(null,"y1","50%"),s.setAttributeNS(null,"x2","100%"),s.setAttributeNS(null,"y2","50%"),this.svgElem_.appendChild(s);const a=e.createElementNS(ie,"line");a.classList.add(je("ax")),a.setAttributeNS(null,"x1","50%"),a.setAttributeNS(null,"y1","0"),a.setAttributeNS(null,"x2","50%"),a.setAttributeNS(null,"y2","100%"),this.svgElem_.appendChild(a);const l=e.createElementNS(ie,"line");l.classList.add(je("l")),l.setAttributeNS(null,"x1","50%"),l.setAttributeNS(null,"y1","50%"),this.svgElem_.appendChild(l),this.lineElem_=l;const c=e.createElement("div");c.classList.add(je("m")),this.padElement.appendChild(c),this.markerElem_=c,r.value.emitter.on("change",this.onValueChange_),this.value=r.value,this.update_()}get allFocusableElements(){return[this.padElement]}update_(){const[e,r]=this.value.rawValue.getComponents(),i=this.props_.get("max"),o=et(e,-i,+i,0,100),s=et(r,-i,+i,0,100),a=this.props_.get("invertsY")?100-s:s;this.lineElem_.setAttributeNS(null,"x2",`${o}%`),this.lineElem_.setAttributeNS(null,"y2",`${a}%`),this.markerElem_.style.left=`${o}%`,this.markerElem_.style.top=`${a}%`}onValueChange_(){this.update_()}onPropsChange_(){this.update_()}onFoldableChange_(){this.update_()}}function Ic(n,e,r){return[Ot(e[0],Me(n)),Ot(e[1],Er(n))*(r?1:-1)]}class PC{constructor(e,r){this.onPadKeyDown_=this.onPadKeyDown_.bind(this),this.onPadKeyUp_=this.onPadKeyUp_.bind(this),this.onPointerDown_=this.onPointerDown_.bind(this),this.onPointerMove_=this.onPointerMove_.bind(this),this.onPointerUp_=this.onPointerUp_.bind(this),this.props=r.props,this.value=r.value,this.viewProps=r.viewProps,this.view=new AC(e,{layout:r.layout,props:this.props,value:this.value,viewProps:this.viewProps}),this.ptHandler_=new gn(this.view.padElement),this.ptHandler_.emitter.on("down",this.onPointerDown_),this.ptHandler_.emitter.on("move",this.onPointerMove_),this.ptHandler_.emitter.on("up",this.onPointerUp_),this.view.padElement.addEventListener("keydown",this.onPadKeyDown_),this.view.padElement.addEventListener("keyup",this.onPadKeyUp_)}handlePointerEvent_(e,r){if(!e.point)return;const i=this.props.get("max"),o=et(e.point.x,0,e.bounds.width,-i,+i),s=et(this.props.get("invertsY")?e.bounds.height-e.point.y:e.point.y,0,e.bounds.height,-i,+i);this.value.setRawValue(new He(o,s),r)}onPointerDown_(e){this.handlePointerEvent_(e.data,{forceEmit:!1,last:!1})}onPointerMove_(e){this.handlePointerEvent_(e.data,{forceEmit:!1,last:!1})}onPointerUp_(e){this.handlePointerEvent_(e.data,{forceEmit:!0,last:!0})}onPadKeyDown_(e){uh(e.key)&&e.preventDefault();const[r,i]=Ic(e,[this.props.get("xKeyScale"),this.props.get("yKeyScale")],this.props.get("invertsY"));r===0&&i===0||this.value.setRawValue(new He(this.value.rawValue.x+r,this.value.rawValue.y+i),{forceEmit:!1,last:!1})}onPadKeyUp_(e){const[r,i]=Ic(e,[this.props.get("xKeyScale"),this.props.get("yKeyScale")],this.props.get("invertsY"));r===0&&i===0||this.value.setRawValue(this.value.rawValue,{forceEmit:!0,last:!0})}}class SC{constructor(e,r){var i,o;this.onPopupChildBlur_=this.onPopupChildBlur_.bind(this),this.onPopupChildKeydown_=this.onPopupChildKeydown_.bind(this),this.onPadButtonBlur_=this.onPadButtonBlur_.bind(this),this.onPadButtonClick_=this.onPadButtonClick_.bind(this),this.value=r.value,this.viewProps=r.viewProps,this.foldable_=jr.create(r.expanded),this.popC_=r.pickerLayout==="popup"?new ah(e,{viewProps:this.viewProps}):null;const s=new PC(e,{layout:r.pickerLayout,props:new K({invertsY:at(r.invertsY),max:at(r.max),xKeyScale:r.axes[0].textProps.value("keyScale"),yKeyScale:r.axes[1].textProps.value("keyScale")}),value:this.value,viewProps:this.viewProps});s.view.allFocusableElements.forEach(a=>{a.addEventListener("blur",this.onPopupChildBlur_),a.addEventListener("keydown",this.onPopupChildKeydown_)}),this.pickerC_=s,this.textC_=new za(e,{assembly:Rh,axes:r.axes,parser:r.parser,value:this.value,viewProps:this.viewProps}),this.view=new kC(e,{expanded:this.foldable_.value("expanded"),pickerLayout:r.pickerLayout,viewProps:this.viewProps}),this.view.textElement.appendChild(this.textC_.view.element),(i=this.view.buttonElement)===null||i===void 0||i.addEventListener("blur",this.onPadButtonBlur_),(o=this.view.buttonElement)===null||o===void 0||o.addEventListener("click",this.onPadButtonClick_),this.popC_?(this.view.element.appendChild(this.popC_.view.element),this.popC_.view.element.appendChild(this.pickerC_.view.element),Nn({primary:this.foldable_.value("expanded"),secondary:this.popC_.shows,forward:a=>a,backward:(a,l)=>l})):this.view.pickerElement&&(this.view.pickerElement.appendChild(this.pickerC_.view.element),Aa(this.foldable_,this.view.pickerElement))}get textController(){return this.textC_}onPadButtonBlur_(e){if(!this.popC_)return;const r=this.view.element,i=e.relatedTarget;(!i||!r.contains(i))&&(this.popC_.shows.rawValue=!1)}onPadButtonClick_(){this.foldable_.set("expanded",!this.foldable_.get("expanded")),this.foldable_.get("expanded")&&this.pickerC_.view.allFocusableElements[0].focus()}onPopupChildBlur_(e){if(!this.popC_)return;const r=this.popC_.view.element,i=Jd(e);i&&r.contains(i)||i&&i===this.view.buttonElement&&!ya(r.ownerDocument)||(this.popC_.shows.rawValue=!1)}onPopupChildKeydown_(e){this.popC_?e.key==="Escape"&&(this.popC_.shows.rawValue=!1):this.view.pickerElement&&e.key==="Escape"&&this.view.buttonElement.focus()}}function MC(n){return He.isObject(n)?new He(n.x,n.y):new He}function $C(n,e){n.writeProperty("x",e.x),n.writeProperty("y",e.y)}function TC(n,e){return new La({assembly:Rh,components:[Ee(Object.assign(Object.assign({},n),n.x),e.x),Ee(Object.assign(Object.assign({},n),n.y),e.y)]})}function Oc(n,e){var r,i;if(!rt(n.min)||!rt(n.max))return Math.max(Math.abs((r=n.min)!==null&&r!==void 0?r:0),Math.abs((i=n.max)!==null&&i!==void 0?i:0));const o=Ud(n);return Math.max(Math.abs(o)*10,Math.abs(e)*10)}function IC(n,e){var r,i;const o=Oc(dn(n,(r=n.x)!==null&&r!==void 0?r:{}),e.x),s=Oc(dn(n,(i=n.y)!==null&&i!==void 0?i:{}),e.y);return Math.max(o,s)}function OC(n){if(!("y"in n))return!1;const e=n.y;return e&&"inverted"in e?!!e.inverted:!1}const DC=St({id:"input-point2d",type:"input",accept:(n,e)=>{if(!He.isObject(n))return null;const r=lt(e,i=>Object.assign(Object.assign({},kr(i)),{expanded:i.optional.boolean,picker:i.optional.custom(ph),readonly:i.optional.constant(!1),x:i.optional.custom(Ue),y:i.optional.object(Object.assign(Object.assign({},kr(i)),{inverted:i.optional.boolean}))}));return r?{initialValue:n,params:r}:null},binding:{reader:()=>MC,constraint:n=>TC(n.params,n.initialValue),equals:He.equals,writer:()=>$C},controller:n=>{var e,r;const i=n.document,o=n.value,s=n.constraint,a=[n.params.x,n.params.y];return new SC(i,{axes:o.rawValue.getComponents().map((l,c)=>{var u;return _a({constraint:s.components[c],initialValue:l,params:dn(n.params,(u=a[c])!==null&&u!==void 0?u:{})})}),expanded:(e=n.params.expanded)!==null&&e!==void 0?e:!1,invertsY:OC(n.params),max:IC(n.params,o.rawValue),parser:Se,pickerLayout:(r=n.params.picker)!==null&&r!==void 0?r:"popup",value:o,viewProps:n.viewProps})}});class Sn{constructor(e=0,r=0,i=0){this.x=e,this.y=r,this.z=i}getComponents(){return[this.x,this.y,this.z]}static isObject(e){if(rt(e))return!1;const r=e.x,i=e.y,o=e.z;return!(typeof r!="number"||typeof i!="number"||typeof o!="number")}static equals(e,r){return e.x===r.x&&e.y===r.y&&e.z===r.z}toObject(){return{x:this.x,y:this.y,z:this.z}}}const jh={toComponents:n=>n.getComponents(),fromComponents:n=>new Sn(...n)};function RC(n){return Sn.isObject(n)?new Sn(n.x,n.y,n.z):new Sn}function jC(n,e){n.writeProperty("x",e.x),n.writeProperty("y",e.y),n.writeProperty("z",e.z)}function LC(n,e){return new La({assembly:jh,components:[Ee(Object.assign(Object.assign({},n),n.x),e.x),Ee(Object.assign(Object.assign({},n),n.y),e.y),Ee(Object.assign(Object.assign({},n),n.z),e.z)]})}const zC=St({id:"input-point3d",type:"input",accept:(n,e)=>{if(!Sn.isObject(n))return null;const r=lt(e,i=>Object.assign(Object.assign({},kr(i)),{readonly:i.optional.constant(!1),x:i.optional.custom(Ue),y:i.optional.custom(Ue),z:i.optional.custom(Ue)}));return r?{initialValue:n,params:r}:null},binding:{reader:n=>RC,constraint:n=>LC(n.params,n.initialValue),equals:Sn.equals,writer:n=>jC},controller:n=>{const e=n.value,r=n.constraint,i=[n.params.x,n.params.y,n.params.z];return new za(n.document,{assembly:jh,axes:e.rawValue.getComponents().map((o,s)=>{var a;return _a({constraint:r.components[s],initialValue:o,params:dn(n.params,(a=i[s])!==null&&a!==void 0?a:{})})}),parser:Se,value:e,viewProps:n.viewProps})}});class Mn{constructor(e=0,r=0,i=0,o=0){this.x=e,this.y=r,this.z=i,this.w=o}getComponents(){return[this.x,this.y,this.z,this.w]}static isObject(e){if(rt(e))return!1;const r=e.x,i=e.y,o=e.z,s=e.w;return!(typeof r!="number"||typeof i!="number"||typeof o!="number"||typeof s!="number")}static equals(e,r){return e.x===r.x&&e.y===r.y&&e.z===r.z&&e.w===r.w}toObject(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Lh={toComponents:n=>n.getComponents(),fromComponents:n=>new Mn(...n)};function NC(n){return Mn.isObject(n)?new Mn(n.x,n.y,n.z,n.w):new Mn}function FC(n,e){n.writeProperty("x",e.x),n.writeProperty("y",e.y),n.writeProperty("z",e.z),n.writeProperty("w",e.w)}function VC(n,e){return new La({assembly:Lh,components:[Ee(Object.assign(Object.assign({},n),n.x),e.x),Ee(Object.assign(Object.assign({},n),n.y),e.y),Ee(Object.assign(Object.assign({},n),n.z),e.z),Ee(Object.assign(Object.assign({},n),n.w),e.w)]})}const BC=St({id:"input-point4d",type:"input",accept:(n,e)=>{if(!Mn.isObject(n))return null;const r=lt(e,i=>Object.assign(Object.assign({},kr(i)),{readonly:i.optional.constant(!1),w:i.optional.custom(Ue),x:i.optional.custom(Ue),y:i.optional.custom(Ue),z:i.optional.custom(Ue)}));return r?{initialValue:n,params:r}:null},binding:{reader:n=>NC,constraint:n=>VC(n.params,n.initialValue),equals:Mn.equals,writer:n=>FC},controller:n=>{const e=n.value,r=n.constraint,i=[n.params.x,n.params.y,n.params.z,n.params.w];return new za(n.document,{assembly:Lh,axes:e.rawValue.getComponents().map((o,s)=>{var a;return _a({constraint:r.components[s],initialValue:o,params:dn(n.params,(a=i[s])!==null&&a!==void 0?a:{})})}),parser:Se,value:e,viewProps:n.viewProps})}});function UC(n){const e=[],r=Ma(n.options);return r&&e.push(r),new Lr(e)}const HC=St({id:"input-string",type:"input",accept:(n,e)=>{if(typeof n!="string")return null;const r=lt(e,i=>({readonly:i.optional.constant(!1),options:i.optional.custom(Nr)}));return r?{initialValue:n,params:r}:null},binding:{reader:n=>ch,constraint:n=>UC(n.params),writer:n=>Vr},controller:n=>{const e=n.document,r=n.value,i=n.constraint,o=i&&Hi(i,zr);return o?new Ke(e,{props:new K({options:o.values.value("options")}),value:r,viewProps:n.viewProps}):new Cr(e,{parser:s=>s,props:K.fromObject({formatter:As}),value:r,viewProps:n.viewProps})},api(n){return typeof n.controller.value.rawValue!="string"?null:n.controller.valueController instanceof Ke?new Pa(n.controller):null}}),Ur={monitor:{defaultInterval:200,defaultRows:3}},Dc=Y("mll");class qC{constructor(e,r){this.onValueUpdate_=this.onValueUpdate_.bind(this),this.formatter_=r.formatter,this.element=e.createElement("div"),this.element.classList.add(Dc()),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("textarea");i.classList.add(Dc("i")),i.style.height=`calc(var(${hh("containerUnitSize")}) * ${r.rows})`,i.readOnly=!0,r.viewProps.bindDisabled(i),this.element.appendChild(i),this.textareaElem_=i,r.value.emitter.on("change",this.onValueUpdate_),this.value=r.value,this.update_()}update_(){const e=this.textareaElem_,r=e.scrollTop===e.scrollHeight-e.clientHeight,i=[];this.value.rawValue.forEach(o=>{o!==void 0&&i.push(this.formatter_(o))}),e.textContent=i.join(`
46
+ `),r&&(e.scrollTop=e.scrollHeight)}onValueUpdate_(){this.update_()}}class Na{constructor(e,r){this.value=r.value,this.viewProps=r.viewProps,this.view=new qC(e,{formatter:r.formatter,rows:r.rows,value:this.value,viewProps:this.viewProps})}}const Rc=Y("sgl");class KC{constructor(e,r){this.onValueUpdate_=this.onValueUpdate_.bind(this),this.formatter_=r.formatter,this.element=e.createElement("div"),this.element.classList.add(Rc()),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("input");i.classList.add(Rc("i")),i.readOnly=!0,i.type="text",r.viewProps.bindDisabled(i),this.element.appendChild(i),this.inputElement=i,r.value.emitter.on("change",this.onValueUpdate_),this.value=r.value,this.update_()}update_(){const e=this.value.rawValue,r=e[e.length-1];this.inputElement.value=r!==void 0?this.formatter_(r):""}onValueUpdate_(){this.update_()}}class Fa{constructor(e,r){this.value=r.value,this.viewProps=r.viewProps,this.view=new KC(e,{formatter:r.formatter,value:this.value,viewProps:this.viewProps})}}const GC=St({id:"monitor-bool",type:"monitor",accept:(n,e)=>{if(typeof n!="boolean")return null;const r=lt(e,i=>({readonly:i.required.constant(!0),rows:i.optional.number}));return r?{initialValue:n,params:r}:null},binding:{reader:n=>lh},controller:n=>{var e;return n.value.rawValue.length===1?new Fa(n.document,{formatter:Pc,value:n.value,viewProps:n.viewProps}):new Na(n.document,{formatter:Pc,rows:(e=n.params.rows)!==null&&e!==void 0?e:Ur.monitor.defaultRows,value:n.value,viewProps:n.viewProps})}});class WC extends wr{get max(){return this.controller.valueController.props.get("max")}set max(e){this.controller.valueController.props.set("max",e)}get min(){return this.controller.valueController.props.get("min")}set min(e){this.controller.valueController.props.set("min",e)}}const Le=Y("grl");class YC{constructor(e,r){this.onCursorChange_=this.onCursorChange_.bind(this),this.onValueUpdate_=this.onValueUpdate_.bind(this),this.element=e.createElement("div"),this.element.classList.add(Le()),r.viewProps.bindClassModifiers(this.element),this.formatter_=r.formatter,this.props_=r.props,this.cursor_=r.cursor,this.cursor_.emitter.on("change",this.onCursorChange_);const i=e.createElementNS(ie,"svg");i.classList.add(Le("g")),i.style.height=`calc(var(${hh("containerUnitSize")}) * ${r.rows})`,this.element.appendChild(i),this.svgElem_=i;const o=e.createElementNS(ie,"polyline");this.svgElem_.appendChild(o),this.lineElem_=o;const s=e.createElement("div");s.classList.add(Le("t"),Y("tt")()),this.element.appendChild(s),this.tooltipElem_=s,r.value.emitter.on("change",this.onValueUpdate_),this.value=r.value,this.update_()}get graphElement(){return this.svgElem_}update_(){const{clientWidth:e,clientHeight:r}=this.element,i=this.value.rawValue.length-1,o=this.props_.get("min"),s=this.props_.get("max"),a=[];this.value.rawValue.forEach((d,f)=>{if(d===void 0)return;const p=et(f,0,i,0,e),m=et(d,o,s,r,0);a.push([p,m].join(","))}),this.lineElem_.setAttributeNS(null,"points",a.join(" "));const l=this.tooltipElem_,c=this.value.rawValue[this.cursor_.rawValue];if(c===void 0){l.classList.remove(Le("t","a"));return}const u=et(this.cursor_.rawValue,0,i,0,e),h=et(c,o,s,r,0);l.style.left=`${u}px`,l.style.top=`${h}px`,l.textContent=`${this.formatter_(c)}`,l.classList.contains(Le("t","a"))||(l.classList.add(Le("t","a"),Le("t","in")),Ui(l),l.classList.remove(Le("t","in")))}onValueUpdate_(){this.update_()}onCursorChange_(){this.update_()}}class zh{constructor(e,r){if(this.onGraphMouseMove_=this.onGraphMouseMove_.bind(this),this.onGraphMouseLeave_=this.onGraphMouseLeave_.bind(this),this.onGraphPointerDown_=this.onGraphPointerDown_.bind(this),this.onGraphPointerMove_=this.onGraphPointerMove_.bind(this),this.onGraphPointerUp_=this.onGraphPointerUp_.bind(this),this.props=r.props,this.value=r.value,this.viewProps=r.viewProps,this.cursor_=at(-1),this.view=new YC(e,{cursor:this.cursor_,formatter:r.formatter,rows:r.rows,props:this.props,value:this.value,viewProps:this.viewProps}),!ya(e))this.view.element.addEventListener("mousemove",this.onGraphMouseMove_),this.view.element.addEventListener("mouseleave",this.onGraphMouseLeave_);else{const i=new gn(this.view.element);i.emitter.on("down",this.onGraphPointerDown_),i.emitter.on("move",this.onGraphPointerMove_),i.emitter.on("up",this.onGraphPointerUp_)}}importProps(e){return Ft(e,null,r=>({max:r.required.number,min:r.required.number}),r=>(this.props.set("max",r.max),this.props.set("min",r.min),!0))}exportProps(){return Vt(null,{max:this.props.get("max"),min:this.props.get("min")})}onGraphMouseLeave_(){this.cursor_.rawValue=-1}onGraphMouseMove_(e){const{clientWidth:r}=this.view.element;this.cursor_.rawValue=Math.floor(et(e.offsetX,0,r,0,this.value.rawValue.length))}onGraphPointerDown_(e){this.onGraphPointerMove_(e)}onGraphPointerMove_(e){if(!e.data.point){this.cursor_.rawValue=-1;return}this.cursor_.rawValue=Math.floor(et(e.data.point.x,0,e.data.bounds.width,0,this.value.rawValue.length))}onGraphPointerUp_(){this.cursor_.rawValue=-1}}function Ps(n){return rt(n.format)?Rt(2):n.format}function XC(n){var e;return n.value.rawValue.length===1?new Fa(n.document,{formatter:Ps(n.params),value:n.value,viewProps:n.viewProps}):new Na(n.document,{formatter:Ps(n.params),rows:(e=n.params.rows)!==null&&e!==void 0?e:Ur.monitor.defaultRows,value:n.value,viewProps:n.viewProps})}function ZC(n){var e,r,i;return new zh(n.document,{formatter:Ps(n.params),rows:(e=n.params.rows)!==null&&e!==void 0?e:Ur.monitor.defaultRows,props:K.fromObject({max:(r=n.params.max)!==null&&r!==void 0?r:100,min:(i=n.params.min)!==null&&i!==void 0?i:0}),value:n.value,viewProps:n.viewProps})}function jc(n){return n.view==="graph"}const JC=St({id:"monitor-number",type:"monitor",accept:(n,e)=>{if(typeof n!="number")return null;const r=lt(e,i=>({format:i.optional.function,max:i.optional.number,min:i.optional.number,readonly:i.required.constant(!0),rows:i.optional.number,view:i.optional.string}));return r?{initialValue:n,params:r}:null},binding:{defaultBufferSize:n=>jc(n)?64:1,reader:n=>Vd},controller:n=>jc(n.params)?ZC(n):XC(n),api:n=>n.controller.valueController instanceof zh?new WC(n.controller):null}),QC=St({id:"monitor-string",type:"monitor",accept:(n,e)=>{if(typeof n!="string")return null;const r=lt(e,i=>({multiline:i.optional.boolean,readonly:i.required.constant(!0),rows:i.optional.number}));return r?{initialValue:n,params:r}:null},binding:{reader:n=>ch},controller:n=>{var e;const r=n.value;return r.rawValue.length>1||n.params.multiline?new Na(n.document,{formatter:As,rows:(e=n.params.rows)!==null&&e!==void 0?e:Ur.monitor.defaultRows,value:r,viewProps:n.viewProps}):new Fa(n.document,{formatter:As,value:r,viewProps:n.viewProps})}});class t2{constructor(){this.map_=new Map}get(e){var r;return(r=this.map_.get(e))!==null&&r!==void 0?r:null}has(e){return this.map_.has(e)}add(e,r){return this.map_.set(e,r),e.viewProps.handleDispose(()=>{this.map_.delete(e)}),r}}class e2{constructor(e){this.target=e.target,this.reader_=e.reader,this.writer_=e.writer}read(){return this.reader_(this.target.read())}write(e){this.writer_(this.target,e)}inject(e){this.write(this.reader_(e))}}function n2(n,e){var r;const i=n.accept(e.target.read(),e.params);if(rt(i))return null;const o={target:e.target,initialValue:i.initialValue,params:i.params},s=lt(e.params,d=>({disabled:d.optional.boolean,hidden:d.optional.boolean,label:d.optional.string,tag:d.optional.string})),a=n.binding.reader(o),l=n.binding.constraint?n.binding.constraint(o):void 0,c=new e2({reader:a,target:e.target,writer:n.binding.writer(o)}),u=new Nx(at(a(i.initialValue),{constraint:l,equals:n.binding.equals}),c),h=n.controller({constraint:l,document:e.document,initialValue:i.initialValue,params:i.params,value:u,viewProps:$e.create({disabled:s==null?void 0:s.disabled,hidden:s==null?void 0:s.hidden})});return new tw(e.document,{blade:zn(),props:K.fromObject({label:"label"in e.params?(r=s==null?void 0:s.label)!==null&&r!==void 0?r:null:e.target.key}),tag:s==null?void 0:s.tag,value:u,valueController:h})}class r2{constructor(e){this.target=e.target,this.reader_=e.reader}read(){return this.reader_(this.target.read())}}function i2(n,e){return e===0?new jw:new Lw(n,e??Ur.monitor.defaultInterval)}function o2(n,e){var r,i,o;const s=n.accept(e.target.read(),e.params);if(rt(s))return null;const a={target:e.target,initialValue:s.initialValue,params:s.params},l=lt(e.params,f=>({bufferSize:f.optional.number,disabled:f.optional.boolean,hidden:f.optional.boolean,interval:f.optional.number,label:f.optional.string})),c=n.binding.reader(a),u=(i=(r=l==null?void 0:l.bufferSize)!==null&&r!==void 0?r:n.binding.defaultBufferSize&&n.binding.defaultBufferSize(s.params))!==null&&i!==void 0?i:1,h=new ow({binding:new r2({reader:c,target:e.target}),bufferSize:u,ticker:i2(e.document,l==null?void 0:l.interval)}),d=n.controller({document:e.document,params:s.params,value:h,viewProps:$e.create({disabled:l==null?void 0:l.disabled,hidden:l==null?void 0:l.hidden})});return d.viewProps.bindDisabled(h.ticker),d.viewProps.handleDispose(()=>{h.ticker.dispose()}),new aw(e.document,{blade:zn(),props:K.fromObject({label:"label"in e.params?(o=l==null?void 0:l.label)!==null&&o!==void 0?o:null:e.target.key}),value:h,valueController:d})}class s2{constructor(e){this.pluginsMap_={blades:[],inputs:[],monitors:[]},this.apiCache_=e}getAll(){return[...this.pluginsMap_.blades,...this.pluginsMap_.inputs,...this.pluginsMap_.monitors]}register(e,r){if(!Xw(r.core))throw ct.notCompatible(e,r.id);r.type==="blade"?this.pluginsMap_.blades.unshift(r):r.type==="input"?this.pluginsMap_.inputs.unshift(r):r.type==="monitor"&&this.pluginsMap_.monitors.unshift(r)}createInput_(e,r,i){return this.pluginsMap_.inputs.reduce((o,s)=>o??n2(s,{document:e,target:r,params:i}),null)}createMonitor_(e,r,i){return this.pluginsMap_.monitors.reduce((o,s)=>o??o2(s,{document:e,params:i,target:r}),null)}createBinding(e,r,i){const o=r.read();if(rt(o))throw new ct({context:{key:r.key},type:"nomatchingcontroller"});const s=this.createInput_(e,r,i);if(s)return s;const a=this.createMonitor_(e,r,i);if(a)return a;throw new ct({context:{key:r.key},type:"nomatchingcontroller"})}createBlade(e,r){const i=this.pluginsMap_.blades.reduce((o,s)=>o??Rw(s,{document:e,params:r}),null);if(!i)throw new ct({type:"nomatchingview",context:{params:r}});return i}createInputBindingApi_(e){const r=this.pluginsMap_.inputs.reduce((i,o)=>{var s,a;return i||((a=(s=o.api)===null||s===void 0?void 0:s.call(o,{controller:e}))!==null&&a!==void 0?a:null)},null);return this.apiCache_.add(e,r??new wr(e))}createMonitorBindingApi_(e){const r=this.pluginsMap_.monitors.reduce((i,o)=>{var s,a;return i||((a=(s=o.api)===null||s===void 0?void 0:s.call(o,{controller:e}))!==null&&a!==void 0?a:null)},null);return this.apiCache_.add(e,r??new wr(e))}createBindingApi(e){if(this.apiCache_.has(e))return this.apiCache_.get(e);if(ew(e))return this.createInputBindingApi_(e);if(lw(e))return this.createMonitorBindingApi_(e);throw ct.shouldNeverHappen()}createApi(e){if(this.apiCache_.has(e))return this.apiCache_.get(e);if(Qx(e))return this.createBindingApi(e);const r=this.pluginsMap_.blades.reduce((i,o)=>i??o.api({controller:e,pool:this}),null);if(!r)throw ct.shouldNeverHappen();return this.apiCache_.add(e,r)}}const a2=new t2;function l2(){const n=new s2(a2);return[DC,zC,BC,HC,EC,_C,bC,pC,t1,GC,QC,JC,pw,Aw,sh].forEach(e=>{n.register("core",e)}),n}class c2 extends mn{constructor(e){super(e),this.emitter_=new ft,this.controller.value.emitter.on("change",r=>{this.emitter_.emit("change",new Rr(this,r.rawValue))})}get label(){return this.controller.labelController.props.get("label")}set label(e){this.controller.labelController.props.set("label",e)}get options(){return this.controller.valueController.props.get("options")}set options(e){this.controller.valueController.props.set("options",e)}get value(){return this.controller.value.rawValue}set value(e){this.controller.value.rawValue=e}on(e,r){const i=r.bind(this);return this.emitter_.on(e,o=>{i(o)},{key:r}),this}off(e,r){return this.emitter_.off(e,r),this}}class u2 extends mn{}class d2 extends mn{constructor(e){super(e),this.emitter_=new ft,this.controller.value.emitter.on("change",r=>{this.emitter_.emit("change",new Rr(this,r.rawValue))})}get label(){return this.controller.labelController.props.get("label")}set label(e){this.controller.labelController.props.set("label",e)}get max(){return this.controller.valueController.sliderController.props.get("max")}set max(e){this.controller.valueController.sliderController.props.set("max",e)}get min(){return this.controller.valueController.sliderController.props.get("min")}set min(e){this.controller.valueController.sliderController.props.set("min",e)}get value(){return this.controller.value.rawValue}set value(e){this.controller.value.rawValue=e}on(e,r){const i=r.bind(this);return this.emitter_.on(e,o=>{i(o)},{key:r}),this}off(e,r){return this.emitter_.off(e,r),this}}class h2 extends mn{constructor(e){super(e),this.emitter_=new ft,this.controller.value.emitter.on("change",r=>{this.emitter_.emit("change",new Rr(this,r.rawValue))})}get label(){return this.controller.labelController.props.get("label")}set label(e){this.controller.labelController.props.set("label",e)}get formatter(){return this.controller.valueController.props.get("formatter")}set formatter(e){this.controller.valueController.props.set("formatter",e)}get value(){return this.controller.value.rawValue}set value(e){this.controller.value.rawValue=e}on(e,r){const i=r.bind(this);return this.emitter_.on(e,o=>{i(o)},{key:r}),this}off(e,r){return this.emitter_.off(e,r),this}}const p2=(function(){return{id:"list",type:"blade",core:Ln,accept(n){const e=lt(n,r=>({options:r.required.custom(Nr),value:r.required.raw,view:r.required.constant("list"),label:r.optional.string}));return e?{params:e}:null},controller(n){const e=new zr(Sa(n.params.options)),r=at(n.params.value,{constraint:e}),i=new Ke(n.document,{props:new K({options:e.values.value("options")}),value:r,viewProps:n.viewProps});return new hn(n.document,{blade:n.blade,props:K.fromObject({label:n.params.label}),value:r,valueController:i})},api(n){return!(n.controller instanceof hn)||!(n.controller.valueController instanceof Ke)?null:new c2(n.controller)}}})();class f2 extends ih{constructor(e,r){super(e,r)}get element(){return this.controller.view.element}}class v2 extends Es{constructor(e,r){super(e,{expanded:r.expanded,blade:r.blade,props:r.props,root:!0,viewProps:r.viewProps})}}const Lc=Y("spr");class m2{constructor(e,r){this.element=e.createElement("div"),this.element.classList.add(Lc()),r.viewProps.bindClassModifiers(this.element);const i=e.createElement("hr");i.classList.add(Lc("r")),this.element.appendChild(i)}}class zc extends ao{constructor(e,r){super(Object.assign(Object.assign({},r),{view:new m2(e,{viewProps:r.viewProps})}))}}const g2={id:"separator",type:"blade",core:Ln,accept(n){const e=lt(n,r=>({view:r.required.constant("separator")}));return e?{params:e}:null},controller(n){return new zc(n.document,{blade:n.blade,viewProps:n.viewProps})},api(n){return n.controller instanceof zc?new u2(n.controller):null}},b2={id:"slider",type:"blade",core:Ln,accept(n){const e=lt(n,r=>({max:r.required.number,min:r.required.number,view:r.required.constant("slider"),format:r.optional.function,label:r.optional.string,value:r.optional.number}));return e?{params:e}:null},controller(n){var e,r;const i=(e=n.params.value)!==null&&e!==void 0?e:0,o=new Dr({max:n.params.max,min:n.params.min}),s=at(i,{constraint:o}),a=new Ki(n.document,Object.assign(Object.assign({},dh({formatter:(r=n.params.format)!==null&&r!==void 0?r:Dx,keyScale:at(1),max:o.values.value("max"),min:o.values.value("min"),pointerScale:Hd(n.params,i)})),{parser:Se,value:s,viewProps:n.viewProps}));return new hn(n.document,{blade:n.blade,props:K.fromObject({label:n.params.label}),value:s,valueController:a})},api(n){return!(n.controller instanceof hn)||!(n.controller.valueController instanceof Ki)?null:new d2(n.controller)}},_2=(function(){return{id:"text",type:"blade",core:Ln,accept(n){const e=lt(n,r=>({parse:r.required.function,value:r.required.raw,view:r.required.constant("text"),format:r.optional.function,label:r.optional.string}));return e?{params:e}:null},controller(n){var e;const r=at(n.params.value),i=new Cr(n.document,{parser:n.params.parse,props:K.fromObject({formatter:(e=n.params.format)!==null&&e!==void 0?e:(o=>String(o))}),value:r,viewProps:n.viewProps});return new hn(n.document,{blade:n.blade,props:K.fromObject({label:n.params.label}),value:r,valueController:i})},api(n){return!(n.controller instanceof hn)||!(n.controller.valueController instanceof Cr)?null:new h2(n.controller)}}})();function y2(n){const e=n.createElement("div");return e.classList.add(Y("dfw")()),n.body&&n.body.appendChild(e),e}function x2(n,e,r){if(n.querySelector(`style[data-tp-style=${e}]`))return;const i=n.createElement("style");i.dataset.tpStyle=e,i.textContent=r,n.head.appendChild(i)}class w2 extends f2{constructor(e){var r,i;const o=e??{},s=(r=o.document)!==null&&r!==void 0?r:Kx(),a=l2(),l=new v2(s,{expanded:o.expanded,blade:zn(),props:K.fromObject({title:o.title}),viewProps:$e.create()});super(l,a),this.pool_=a,this.containerElem_=(i=o.container)!==null&&i!==void 0?i:y2(s),this.containerElem_.appendChild(this.element),this.doc_=s,this.usesDefaultWrapper_=!o.container,this.setUpDefaultPlugins_()}get document(){if(!this.doc_)throw ct.alreadyDisposed();return this.doc_}dispose(){const e=this.containerElem_;if(!e)throw ct.alreadyDisposed();if(this.usesDefaultWrapper_){const r=e.parentElement;r&&r.removeChild(e)}this.containerElem_=null,this.doc_=null,super.dispose()}registerPlugin(e){e.css&&x2(this.document,`plugin-${e.id}`,e.css),("plugin"in e?[e.plugin]:"plugins"in e?e.plugins:[]).forEach(i=>{this.pool_.register(e.id,i)})}setUpDefaultPlugins_(){this.registerPlugin({id:"default",css:'.tp-tbiv_b,.tp-coltxtv_ms,.tp-colswv_b,.tp-ckbv_i,.tp-sglv_i,.tp-mllv_i,.tp-grlv_g,.tp-txtv_i,.tp-p2dpv_p,.tp-colswv_sw,.tp-rotv_b,.tp-fldv_b,.tp-p2dv_b,.tp-btnv_b,.tp-lstv_s{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:rgba(0,0,0,0);border-width:0;font-family:inherit;font-size:inherit;font-weight:inherit;margin:0;outline:none;padding:0}.tp-p2dv_b,.tp-btnv_b,.tp-lstv_s{background-color:var(--btn-bg);border-radius:var(--bld-br);color:var(--btn-fg);cursor:pointer;display:block;font-weight:bold;height:var(--cnt-usz);line-height:var(--cnt-usz);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tp-p2dv_b:hover,.tp-btnv_b:hover,.tp-lstv_s:hover{background-color:var(--btn-bg-h)}.tp-p2dv_b:focus,.tp-btnv_b:focus,.tp-lstv_s:focus{background-color:var(--btn-bg-f)}.tp-p2dv_b:active,.tp-btnv_b:active,.tp-lstv_s:active{background-color:var(--btn-bg-a)}.tp-p2dv_b:disabled,.tp-btnv_b:disabled,.tp-lstv_s:disabled{opacity:.5}.tp-rotv_c>.tp-cntv.tp-v-lst,.tp-tbpv_c>.tp-cntv.tp-v-lst,.tp-fldv_c>.tp-cntv.tp-v-lst{margin-bottom:calc(-1*var(--cnt-vp))}.tp-rotv_c>.tp-fldv.tp-v-lst .tp-fldv_c,.tp-tbpv_c>.tp-fldv.tp-v-lst .tp-fldv_c,.tp-fldv_c>.tp-fldv.tp-v-lst .tp-fldv_c{border-bottom-left-radius:0}.tp-rotv_c>.tp-fldv.tp-v-lst .tp-fldv_b,.tp-tbpv_c>.tp-fldv.tp-v-lst .tp-fldv_b,.tp-fldv_c>.tp-fldv.tp-v-lst .tp-fldv_b{border-bottom-left-radius:0}.tp-rotv_c>*:not(.tp-v-fst),.tp-tbpv_c>*:not(.tp-v-fst),.tp-fldv_c>*:not(.tp-v-fst){margin-top:var(--cnt-usp)}.tp-rotv_c>.tp-sprv:not(.tp-v-fst),.tp-tbpv_c>.tp-sprv:not(.tp-v-fst),.tp-fldv_c>.tp-sprv:not(.tp-v-fst),.tp-rotv_c>.tp-cntv:not(.tp-v-fst),.tp-tbpv_c>.tp-cntv:not(.tp-v-fst),.tp-fldv_c>.tp-cntv:not(.tp-v-fst){margin-top:var(--cnt-vp)}.tp-rotv_c>.tp-sprv+*:not(.tp-v-hidden),.tp-tbpv_c>.tp-sprv+*:not(.tp-v-hidden),.tp-fldv_c>.tp-sprv+*:not(.tp-v-hidden),.tp-rotv_c>.tp-cntv+*:not(.tp-v-hidden),.tp-tbpv_c>.tp-cntv+*:not(.tp-v-hidden),.tp-fldv_c>.tp-cntv+*:not(.tp-v-hidden){margin-top:var(--cnt-vp)}.tp-rotv_c>.tp-sprv:not(.tp-v-hidden)+.tp-sprv,.tp-tbpv_c>.tp-sprv:not(.tp-v-hidden)+.tp-sprv,.tp-fldv_c>.tp-sprv:not(.tp-v-hidden)+.tp-sprv,.tp-rotv_c>.tp-cntv:not(.tp-v-hidden)+.tp-cntv,.tp-tbpv_c>.tp-cntv:not(.tp-v-hidden)+.tp-cntv,.tp-fldv_c>.tp-cntv:not(.tp-v-hidden)+.tp-cntv{margin-top:0}.tp-tbpv_c>.tp-cntv,.tp-fldv_c>.tp-cntv{margin-left:4px}.tp-tbpv_c>.tp-fldv>.tp-fldv_b,.tp-fldv_c>.tp-fldv>.tp-fldv_b{border-top-left-radius:var(--bld-br);border-bottom-left-radius:var(--bld-br)}.tp-tbpv_c>.tp-fldv.tp-fldv-expanded>.tp-fldv_b,.tp-fldv_c>.tp-fldv.tp-fldv-expanded>.tp-fldv_b{border-bottom-left-radius:0}.tp-tbpv_c .tp-fldv>.tp-fldv_c,.tp-fldv_c .tp-fldv>.tp-fldv_c{border-bottom-left-radius:var(--bld-br)}.tp-tbpv_c>.tp-cntv+.tp-fldv>.tp-fldv_b,.tp-fldv_c>.tp-cntv+.tp-fldv>.tp-fldv_b{border-top-left-radius:0}.tp-tbpv_c>.tp-cntv+.tp-tabv>.tp-tabv_t,.tp-fldv_c>.tp-cntv+.tp-tabv>.tp-tabv_t{border-top-left-radius:0}.tp-tbpv_c>.tp-tabv>.tp-tabv_t,.tp-fldv_c>.tp-tabv>.tp-tabv_t{border-top-left-radius:var(--bld-br)}.tp-tbpv_c .tp-tabv>.tp-tabv_c,.tp-fldv_c .tp-tabv>.tp-tabv_c{border-bottom-left-radius:var(--bld-br)}.tp-rotv_b,.tp-fldv_b{background-color:var(--cnt-bg);color:var(--cnt-fg);cursor:pointer;display:block;height:calc(var(--cnt-usz) + 4px);line-height:calc(var(--cnt-usz) + 4px);overflow:hidden;padding-left:var(--cnt-hp);padding-right:calc(4px + var(--cnt-usz) + var(--cnt-hp));position:relative;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:100%;transition:border-radius .2s ease-in-out .2s}.tp-rotv_b:hover,.tp-fldv_b:hover{background-color:var(--cnt-bg-h)}.tp-rotv_b:focus,.tp-fldv_b:focus{background-color:var(--cnt-bg-f)}.tp-rotv_b:active,.tp-fldv_b:active{background-color:var(--cnt-bg-a)}.tp-rotv_b:disabled,.tp-fldv_b:disabled{opacity:.5}.tp-rotv_m,.tp-fldv_m{background:linear-gradient(to left, var(--cnt-fg), var(--cnt-fg) 2px, transparent 2px, transparent 4px, var(--cnt-fg) 4px);border-radius:2px;bottom:0;content:"";display:block;height:6px;right:calc(var(--cnt-hp) + (var(--cnt-usz) + 4px - 6px)/2 - 2px);margin:auto;opacity:.5;position:absolute;top:0;transform:rotate(90deg);transition:transform .2s ease-in-out;width:6px}.tp-rotv.tp-rotv-expanded .tp-rotv_m,.tp-fldv.tp-fldv-expanded>.tp-fldv_b>.tp-fldv_m{transform:none}.tp-rotv_c,.tp-fldv_c{box-sizing:border-box;height:0;opacity:0;overflow:hidden;padding-bottom:0;padding-top:0;position:relative;transition:height .2s ease-in-out,opacity .2s linear,padding .2s ease-in-out}.tp-rotv.tp-rotv-cpl:not(.tp-rotv-expanded) .tp-rotv_c,.tp-fldv.tp-fldv-cpl:not(.tp-fldv-expanded)>.tp-fldv_c{display:none}.tp-rotv.tp-rotv-expanded .tp-rotv_c,.tp-fldv.tp-fldv-expanded>.tp-fldv_c{opacity:1;padding-bottom:var(--cnt-vp);padding-top:var(--cnt-vp);transform:none;overflow:visible;transition:height .2s ease-in-out,opacity .2s linear .2s,padding .2s ease-in-out}.tp-txtv_i,.tp-p2dpv_p,.tp-colswv_sw{background-color:var(--in-bg);border-radius:var(--bld-br);box-sizing:border-box;color:var(--in-fg);font-family:inherit;height:var(--cnt-usz);line-height:var(--cnt-usz);min-width:0;width:100%}.tp-txtv_i:hover,.tp-p2dpv_p:hover,.tp-colswv_sw:hover{background-color:var(--in-bg-h)}.tp-txtv_i:focus,.tp-p2dpv_p:focus,.tp-colswv_sw:focus{background-color:var(--in-bg-f)}.tp-txtv_i:active,.tp-p2dpv_p:active,.tp-colswv_sw:active{background-color:var(--in-bg-a)}.tp-txtv_i:disabled,.tp-p2dpv_p:disabled,.tp-colswv_sw:disabled{opacity:.5}.tp-lstv,.tp-coltxtv_m{position:relative}.tp-lstv_s{padding:0 20px 0 4px;width:100%}.tp-lstv_m,.tp-coltxtv_mm{bottom:0;margin:auto;pointer-events:none;position:absolute;right:2px;top:0}.tp-lstv_m svg,.tp-coltxtv_mm svg{bottom:0;height:16px;margin:auto;position:absolute;right:0;top:0;width:16px}.tp-lstv_m svg path,.tp-coltxtv_mm svg path{fill:currentColor}.tp-sglv_i,.tp-mllv_i,.tp-grlv_g{background-color:var(--mo-bg);border-radius:var(--bld-br);box-sizing:border-box;color:var(--mo-fg);height:var(--cnt-usz);scrollbar-color:currentColor rgba(0,0,0,0);scrollbar-width:thin;width:100%}.tp-sglv_i::-webkit-scrollbar,.tp-mllv_i::-webkit-scrollbar,.tp-grlv_g::-webkit-scrollbar{height:8px;width:8px}.tp-sglv_i::-webkit-scrollbar-corner,.tp-mllv_i::-webkit-scrollbar-corner,.tp-grlv_g::-webkit-scrollbar-corner{background-color:rgba(0,0,0,0)}.tp-sglv_i::-webkit-scrollbar-thumb,.tp-mllv_i::-webkit-scrollbar-thumb,.tp-grlv_g::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:currentColor;border:rgba(0,0,0,0) solid 2px;border-radius:4px}.tp-pndtxtv,.tp-coltxtv_w{display:flex}.tp-pndtxtv_a,.tp-coltxtv_c{width:100%}.tp-pndtxtv_a+.tp-pndtxtv_a,.tp-coltxtv_c+.tp-pndtxtv_a,.tp-pndtxtv_a+.tp-coltxtv_c,.tp-coltxtv_c+.tp-coltxtv_c{margin-left:2px}.tp-rotv{--bs-bg: var(--tp-base-background-color, hsl(230, 7%, 17%));--bs-br: var(--tp-base-border-radius, 6px);--bs-ff: var(--tp-base-font-family, Roboto Mono, Source Code Pro, Menlo, Courier, monospace);--bs-sh: var(--tp-base-shadow-color, rgba(0, 0, 0, 0.2));--bld-br: var(--tp-blade-border-radius, 2px);--bld-hp: var(--tp-blade-horizontal-padding, 4px);--bld-vw: var(--tp-blade-value-width, 160px);--btn-bg: var(--tp-button-background-color, hsl(230, 7%, 70%));--btn-bg-a: var(--tp-button-background-color-active, #d6d7db);--btn-bg-f: var(--tp-button-background-color-focus, #c8cad0);--btn-bg-h: var(--tp-button-background-color-hover, #bbbcc4);--btn-fg: var(--tp-button-foreground-color, hsl(230, 7%, 17%));--cnt-bg: var(--tp-container-background-color, rgba(187, 188, 196, 0.1));--cnt-bg-a: var(--tp-container-background-color-active, rgba(187, 188, 196, 0.25));--cnt-bg-f: var(--tp-container-background-color-focus, rgba(187, 188, 196, 0.2));--cnt-bg-h: var(--tp-container-background-color-hover, rgba(187, 188, 196, 0.15));--cnt-fg: var(--tp-container-foreground-color, hsl(230, 7%, 75%));--cnt-hp: var(--tp-container-horizontal-padding, 4px);--cnt-vp: var(--tp-container-vertical-padding, 4px);--cnt-usp: var(--tp-container-unit-spacing, 4px);--cnt-usz: var(--tp-container-unit-size, 20px);--in-bg: var(--tp-input-background-color, rgba(187, 188, 196, 0.1));--in-bg-a: var(--tp-input-background-color-active, rgba(187, 188, 196, 0.25));--in-bg-f: var(--tp-input-background-color-focus, rgba(187, 188, 196, 0.2));--in-bg-h: var(--tp-input-background-color-hover, rgba(187, 188, 196, 0.15));--in-fg: var(--tp-input-foreground-color, hsl(230, 7%, 75%));--lbl-fg: var(--tp-label-foreground-color, rgba(187, 188, 196, 0.7));--mo-bg: var(--tp-monitor-background-color, rgba(0, 0, 0, 0.2));--mo-fg: var(--tp-monitor-foreground-color, rgba(187, 188, 196, 0.7));--grv-fg: var(--tp-groove-foreground-color, rgba(187, 188, 196, 0.1))}.tp-btnv_b{width:100%}.tp-btnv_t{text-align:center}.tp-ckbv_l{display:block;position:relative}.tp-ckbv_i{left:0;opacity:0;position:absolute;top:0}.tp-ckbv_w{background-color:var(--in-bg);border-radius:var(--bld-br);cursor:pointer;display:block;height:var(--cnt-usz);position:relative;width:var(--cnt-usz)}.tp-ckbv_w svg{display:block;height:16px;inset:0;margin:auto;opacity:0;position:absolute;width:16px}.tp-ckbv_w svg path{fill:none;stroke:var(--in-fg);stroke-width:2}.tp-ckbv_i:hover+.tp-ckbv_w{background-color:var(--in-bg-h)}.tp-ckbv_i:focus+.tp-ckbv_w{background-color:var(--in-bg-f)}.tp-ckbv_i:active+.tp-ckbv_w{background-color:var(--in-bg-a)}.tp-ckbv_i:checked+.tp-ckbv_w svg{opacity:1}.tp-ckbv.tp-v-disabled .tp-ckbv_w{opacity:.5}.tp-colv{position:relative}.tp-colv_h{display:flex}.tp-colv_s{flex-grow:0;flex-shrink:0;width:var(--cnt-usz)}.tp-colv_t{flex:1;margin-left:4px}.tp-colv_p{height:0;margin-top:0;opacity:0;overflow:hidden;transition:height .2s ease-in-out,opacity .2s linear,margin .2s ease-in-out}.tp-colv.tp-colv-expanded.tp-colv-cpl .tp-colv_p{overflow:visible}.tp-colv.tp-colv-expanded .tp-colv_p{margin-top:var(--cnt-usp);opacity:1}.tp-colv .tp-popv{left:calc(-1*var(--cnt-hp));right:calc(-1*var(--cnt-hp));top:var(--cnt-usz)}.tp-colpv_h,.tp-colpv_ap{margin-left:6px;margin-right:6px}.tp-colpv_h{margin-top:var(--cnt-usp)}.tp-colpv_rgb{display:flex;margin-top:var(--cnt-usp);width:100%}.tp-colpv_a{display:flex;margin-top:var(--cnt-vp);padding-top:calc(var(--cnt-vp) + 2px);position:relative}.tp-colpv_a::before{background-color:var(--grv-fg);content:"";height:2px;left:calc(-1*var(--cnt-hp));position:absolute;right:calc(-1*var(--cnt-hp));top:0}.tp-colpv.tp-v-disabled .tp-colpv_a::before{opacity:.5}.tp-colpv_ap{align-items:center;display:flex;flex:3}.tp-colpv_at{flex:1;margin-left:4px}.tp-svpv{border-radius:var(--bld-br);outline:none;overflow:hidden;position:relative}.tp-svpv.tp-v-disabled{opacity:.5}.tp-svpv_c{cursor:crosshair;display:block;height:calc(var(--cnt-usz)*4);width:100%}.tp-svpv_m{border-radius:100%;border:rgba(255,255,255,.75) solid 2px;box-sizing:border-box;filter:drop-shadow(0 0 1px rgba(0, 0, 0, 0.3));height:12px;margin-left:-6px;margin-top:-6px;pointer-events:none;position:absolute;width:12px}.tp-svpv:focus .tp-svpv_m{border-color:#fff}.tp-hplv{cursor:pointer;height:var(--cnt-usz);outline:none;position:relative}.tp-hplv.tp-v-disabled{opacity:.5}.tp-hplv_c{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAAQ0lEQVQoU2P8z8Dwn0GCgQEDi2OK/RBgYHjBgIpfovFh8j8YBIgzFGQxuqEgPhaDOT5gOhPkdCxOZeBg+IDFZZiGAgCaSSMYtcRHLgAAAABJRU5ErkJggg==);background-position:left top;background-repeat:no-repeat;background-size:100% 100%;border-radius:2px;display:block;height:4px;left:0;margin-top:-2px;position:absolute;top:50%;width:100%}.tp-hplv_m{border-radius:var(--bld-br);border:rgba(255,255,255,.75) solid 2px;box-shadow:0 0 2px rgba(0,0,0,.1);box-sizing:border-box;height:12px;left:50%;margin-left:-6px;margin-top:-6px;position:absolute;top:50%;width:12px}.tp-hplv:focus .tp-hplv_m{border-color:#fff}.tp-aplv{cursor:pointer;height:var(--cnt-usz);outline:none;position:relative;width:100%}.tp-aplv.tp-v-disabled{opacity:.5}.tp-aplv_b{background-color:#fff;background-image:linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%),linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);background-size:4px 4px;background-position:0 0,2px 2px;border-radius:2px;display:block;height:4px;left:0;margin-top:-2px;overflow:hidden;position:absolute;top:50%;width:100%}.tp-aplv_c{inset:0;position:absolute}.tp-aplv_m{background-color:#fff;background-image:linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%),linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);background-size:12px 12px;background-position:0 0,6px 6px;border-radius:var(--bld-br);box-shadow:0 0 2px rgba(0,0,0,.1);height:12px;left:50%;margin-left:-6px;margin-top:-6px;overflow:hidden;position:absolute;top:50%;width:12px}.tp-aplv_p{border-radius:var(--bld-br);border:rgba(255,255,255,.75) solid 2px;box-sizing:border-box;inset:0;position:absolute}.tp-aplv:focus .tp-aplv_p{border-color:#fff}.tp-colswv{background-color:#fff;background-image:linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%),linear-gradient(to top right, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%);background-size:10px 10px;background-position:0 0,5px 5px;border-radius:var(--bld-br);overflow:hidden}.tp-colswv.tp-v-disabled{opacity:.5}.tp-colswv_sw{border-radius:0}.tp-colswv_b{cursor:pointer;display:block;height:var(--cnt-usz);left:0;position:absolute;top:0;width:var(--cnt-usz)}.tp-colswv_b:focus::after{border:rgba(255,255,255,.75) solid 2px;border-radius:var(--bld-br);content:"";display:block;inset:0;position:absolute}.tp-coltxtv{display:flex;width:100%}.tp-coltxtv_m{margin-right:4px}.tp-coltxtv_ms{border-radius:var(--bld-br);color:var(--lbl-fg);cursor:pointer;height:var(--cnt-usz);line-height:var(--cnt-usz);padding:0 18px 0 4px}.tp-coltxtv_ms:hover{background-color:var(--in-bg-h)}.tp-coltxtv_ms:focus{background-color:var(--in-bg-f)}.tp-coltxtv_ms:active{background-color:var(--in-bg-a)}.tp-coltxtv_mm{color:var(--lbl-fg)}.tp-coltxtv.tp-v-disabled .tp-coltxtv_mm{opacity:.5}.tp-coltxtv_w{flex:1}.tp-dfwv{position:absolute;top:8px;right:8px;width:256px}.tp-fldv{position:relative}.tp-fldv_t{padding-left:4px}.tp-fldv_b:disabled .tp-fldv_m{display:none}.tp-fldv_c{padding-left:4px}.tp-fldv_i{bottom:0;color:var(--cnt-bg);left:0;overflow:hidden;position:absolute;top:calc(var(--cnt-usz) + 4px);width:max(var(--bs-br),4px)}.tp-fldv_i::before{background-color:currentColor;bottom:0;content:"";left:0;position:absolute;top:0;width:4px}.tp-fldv_b:hover+.tp-fldv_i{color:var(--cnt-bg-h)}.tp-fldv_b:focus+.tp-fldv_i{color:var(--cnt-bg-f)}.tp-fldv_b:active+.tp-fldv_i{color:var(--cnt-bg-a)}.tp-fldv.tp-v-disabled>.tp-fldv_i{opacity:.5}.tp-grlv{position:relative}.tp-grlv_g{display:block;height:calc(var(--cnt-usz)*3)}.tp-grlv_g polyline{fill:none;stroke:var(--mo-fg);stroke-linejoin:round}.tp-grlv_t{margin-top:-4px;transition:left .05s,top .05s;visibility:hidden}.tp-grlv_t.tp-grlv_t-a{visibility:visible}.tp-grlv_t.tp-grlv_t-in{transition:none}.tp-grlv.tp-v-disabled .tp-grlv_g{opacity:.5}.tp-grlv .tp-ttv{background-color:var(--mo-fg)}.tp-grlv .tp-ttv::before{border-top-color:var(--mo-fg)}.tp-lblv{align-items:center;display:flex;line-height:1.3;padding-left:var(--cnt-hp);padding-right:var(--cnt-hp)}.tp-lblv.tp-lblv-nol{display:block}.tp-lblv_l{color:var(--lbl-fg);flex:1;-webkit-hyphens:auto;hyphens:auto;overflow:hidden;padding-left:4px;padding-right:16px}.tp-lblv.tp-v-disabled .tp-lblv_l{opacity:.5}.tp-lblv.tp-lblv-nol .tp-lblv_l{display:none}.tp-lblv_v{align-self:flex-start;flex-grow:0;flex-shrink:0;width:var(--bld-vw)}.tp-lblv.tp-lblv-nol .tp-lblv_v{width:100%}.tp-lstv_s{padding:0 20px 0 var(--bld-hp);width:100%}.tp-lstv_m{color:var(--btn-fg)}.tp-sglv_i{padding-left:var(--bld-hp);padding-right:var(--bld-hp)}.tp-sglv.tp-v-disabled .tp-sglv_i{opacity:.5}.tp-mllv_i{display:block;height:calc(var(--cnt-usz)*3);line-height:var(--cnt-usz);padding-left:var(--bld-hp);padding-right:var(--bld-hp);resize:none;white-space:pre}.tp-mllv.tp-v-disabled .tp-mllv_i{opacity:.5}.tp-p2dv{position:relative}.tp-p2dv_h{display:flex}.tp-p2dv_b{height:var(--cnt-usz);margin-right:4px;position:relative;width:var(--cnt-usz)}.tp-p2dv_b svg{display:block;height:16px;left:50%;margin-left:-8px;margin-top:-8px;position:absolute;top:50%;width:16px}.tp-p2dv_b svg path{stroke:currentColor;stroke-width:2}.tp-p2dv_b svg circle{fill:currentColor}.tp-p2dv_t{flex:1}.tp-p2dv_p{height:0;margin-top:0;opacity:0;overflow:hidden;transition:height .2s ease-in-out,opacity .2s linear,margin .2s ease-in-out}.tp-p2dv.tp-p2dv-expanded .tp-p2dv_p{margin-top:var(--cnt-usp);opacity:1}.tp-p2dv .tp-popv{left:calc(-1*var(--cnt-hp));right:calc(-1*var(--cnt-hp));top:var(--cnt-usz)}.tp-p2dpv{padding-left:calc(var(--cnt-usz) + 4px)}.tp-p2dpv_p{cursor:crosshair;height:0;overflow:hidden;padding-bottom:100%;position:relative}.tp-p2dpv.tp-v-disabled .tp-p2dpv_p{opacity:.5}.tp-p2dpv_g{display:block;height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.tp-p2dpv_ax{opacity:.1;stroke:var(--in-fg);stroke-dasharray:1}.tp-p2dpv_l{opacity:.5;stroke:var(--in-fg);stroke-dasharray:1}.tp-p2dpv_m{border:var(--in-fg) solid 1px;border-radius:50%;box-sizing:border-box;height:4px;margin-left:-2px;margin-top:-2px;position:absolute;width:4px}.tp-p2dpv_p:focus .tp-p2dpv_m{background-color:var(--in-fg);border-width:0}.tp-popv{background-color:var(--bs-bg);border-radius:var(--bs-br);box-shadow:0 2px 4px var(--bs-sh);display:none;max-width:var(--bld-vw);padding:var(--cnt-vp) var(--cnt-hp);position:absolute;visibility:hidden;z-index:1000}.tp-popv.tp-popv-v{display:block;visibility:visible}.tp-sldv.tp-v-disabled{opacity:.5}.tp-sldv_t{box-sizing:border-box;cursor:pointer;height:var(--cnt-usz);margin:0 6px;outline:none;position:relative}.tp-sldv_t::before{background-color:var(--in-bg);border-radius:1px;content:"";display:block;height:2px;inset:0;margin:auto;position:absolute}.tp-sldv_k{height:100%;left:0;position:absolute;top:0}.tp-sldv_k::before{background-color:var(--in-fg);border-radius:1px;content:"";display:block;height:2px;inset:0;margin-bottom:auto;margin-top:auto;position:absolute}.tp-sldv_k::after{background-color:var(--btn-bg);border-radius:var(--bld-br);bottom:0;content:"";display:block;height:12px;margin-bottom:auto;margin-top:auto;position:absolute;right:-6px;top:0;width:12px}.tp-sldv_t:hover .tp-sldv_k::after{background-color:var(--btn-bg-h)}.tp-sldv_t:focus .tp-sldv_k::after{background-color:var(--btn-bg-f)}.tp-sldv_t:active .tp-sldv_k::after{background-color:var(--btn-bg-a)}.tp-sldtxtv{display:flex}.tp-sldtxtv_s{flex:2}.tp-sldtxtv_t{flex:1;margin-left:4px}.tp-tabv{position:relative}.tp-tabv_t{align-items:flex-end;color:var(--cnt-bg);display:flex;overflow:hidden;position:relative}.tp-tabv_t:hover{color:var(--cnt-bg-h)}.tp-tabv_t:has(*:focus){color:var(--cnt-bg-f)}.tp-tabv_t:has(*:active){color:var(--cnt-bg-a)}.tp-tabv_t::before{background-color:currentColor;bottom:0;content:"";height:2px;left:0;pointer-events:none;position:absolute;right:0}.tp-tabv.tp-v-disabled .tp-tabv_t::before{opacity:.5}.tp-tabv.tp-tabv-nop .tp-tabv_t{height:calc(var(--cnt-usz) + 4px);position:relative}.tp-tabv.tp-tabv-nop .tp-tabv_t::before{background-color:var(--cnt-bg);bottom:0;content:"";height:2px;left:0;position:absolute;right:0}.tp-tabv_i{bottom:0;color:var(--cnt-bg);left:0;overflow:hidden;position:absolute;top:calc(var(--cnt-usz) + 4px);width:max(var(--bs-br),4px)}.tp-tabv_i::before{background-color:currentColor;bottom:0;content:"";left:0;position:absolute;top:0;width:4px}.tp-tabv_t:hover+.tp-tabv_i{color:var(--cnt-bg-h)}.tp-tabv_t:has(*:focus)+.tp-tabv_i{color:var(--cnt-bg-f)}.tp-tabv_t:has(*:active)+.tp-tabv_i{color:var(--cnt-bg-a)}.tp-tabv.tp-v-disabled>.tp-tabv_i{opacity:.5}.tp-tbiv{flex:1;min-width:0;position:relative}.tp-tbiv+.tp-tbiv{margin-left:2px}.tp-tbiv+.tp-tbiv.tp-v-disabled::before{opacity:.5}.tp-tbiv_b{display:block;padding-left:calc(var(--cnt-hp) + 4px);padding-right:calc(var(--cnt-hp) + 4px);position:relative;width:100%}.tp-tbiv_b:disabled{opacity:.5}.tp-tbiv_b::before{background-color:var(--cnt-bg);content:"";inset:0 0 2px;pointer-events:none;position:absolute}.tp-tbiv_b:hover::before{background-color:var(--cnt-bg-h)}.tp-tbiv_b:focus::before{background-color:var(--cnt-bg-f)}.tp-tbiv_b:active::before{background-color:var(--cnt-bg-a)}.tp-tbiv_t{color:var(--cnt-fg);height:calc(var(--cnt-usz) + 4px);line-height:calc(var(--cnt-usz) + 4px);opacity:.5;overflow:hidden;position:relative;text-overflow:ellipsis}.tp-tbiv.tp-tbiv-sel .tp-tbiv_t{opacity:1}.tp-tbpv_c{padding-bottom:var(--cnt-vp);padding-left:4px;padding-top:var(--cnt-vp)}.tp-txtv{position:relative}.tp-txtv_i{padding-left:var(--bld-hp);padding-right:var(--bld-hp)}.tp-txtv.tp-txtv-fst .tp-txtv_i{border-bottom-right-radius:0;border-top-right-radius:0}.tp-txtv.tp-txtv-mid .tp-txtv_i{border-radius:0}.tp-txtv.tp-txtv-lst .tp-txtv_i{border-bottom-left-radius:0;border-top-left-radius:0}.tp-txtv.tp-txtv-num .tp-txtv_i{text-align:right}.tp-txtv.tp-txtv-drg .tp-txtv_i{opacity:.3}.tp-txtv_k{cursor:pointer;height:100%;left:calc(var(--bld-hp) - 5px);position:absolute;top:0;width:12px}.tp-txtv_k::before{background-color:var(--in-fg);border-radius:1px;bottom:0;content:"";height:calc(var(--cnt-usz) - 4px);left:50%;margin-bottom:auto;margin-left:-1px;margin-top:auto;opacity:.1;position:absolute;top:0;transition:border-radius .1s,height .1s,transform .1s,width .1s;width:2px}.tp-txtv_k:hover::before,.tp-txtv.tp-txtv-drg .tp-txtv_k::before{opacity:1}.tp-txtv.tp-txtv-drg .tp-txtv_k::before{border-radius:50%;height:4px;transform:translateX(-1px);width:4px}.tp-txtv_g{bottom:0;display:block;height:8px;left:50%;margin:auto;overflow:visible;pointer-events:none;position:absolute;top:0;visibility:hidden;width:100%}.tp-txtv.tp-txtv-drg .tp-txtv_g{visibility:visible}.tp-txtv_gb{fill:none;stroke:var(--in-fg);stroke-dasharray:1}.tp-txtv_gh{fill:none;stroke:var(--in-fg)}.tp-txtv .tp-ttv{margin-left:6px;visibility:hidden}.tp-txtv.tp-txtv-drg .tp-ttv{visibility:visible}.tp-ttv{background-color:var(--in-fg);border-radius:var(--bld-br);color:var(--bs-bg);padding:2px 4px;pointer-events:none;position:absolute;transform:translate(-50%, -100%)}.tp-ttv::before{border-color:var(--in-fg) rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0);border-style:solid;border-width:2px;box-sizing:border-box;content:"";font-size:.9em;height:4px;left:50%;margin-left:-2px;position:absolute;top:100%;width:4px}.tp-rotv{background-color:var(--bs-bg);border-radius:var(--bs-br);box-shadow:0 2px 4px var(--bs-sh);font-family:var(--bs-ff);font-size:11px;font-weight:500;line-height:1;text-align:left}.tp-rotv_b{border-bottom-left-radius:var(--bs-br);border-bottom-right-radius:var(--bs-br);border-top-left-radius:var(--bs-br);border-top-right-radius:var(--bs-br);padding-left:calc(4px + var(--cnt-usz) + var(--cnt-hp));text-align:center}.tp-rotv.tp-rotv-expanded .tp-rotv_b{border-bottom-left-radius:0;border-bottom-right-radius:0;transition-delay:0s;transition-duration:0s}.tp-rotv.tp-rotv-not>.tp-rotv_b{display:none}.tp-rotv_b:disabled .tp-rotv_m{display:none}.tp-rotv_c>.tp-fldv.tp-v-lst>.tp-fldv_c{border-bottom-left-radius:var(--bs-br);border-bottom-right-radius:var(--bs-br)}.tp-rotv_c>.tp-fldv.tp-v-lst>.tp-fldv_i{border-bottom-left-radius:var(--bs-br)}.tp-rotv_c>.tp-fldv.tp-v-lst:not(.tp-fldv-expanded)>.tp-fldv_b{border-bottom-left-radius:var(--bs-br);border-bottom-right-radius:var(--bs-br)}.tp-rotv_c>.tp-fldv.tp-v-lst.tp-fldv-expanded>.tp-fldv_b{transition-delay:0s;transition-duration:0s}.tp-rotv_c .tp-fldv.tp-v-vlst:not(.tp-fldv-expanded)>.tp-fldv_b{border-bottom-right-radius:var(--bs-br)}.tp-rotv.tp-rotv-not .tp-rotv_c>.tp-fldv.tp-v-fst{margin-top:calc(-1*var(--cnt-vp))}.tp-rotv.tp-rotv-not .tp-rotv_c>.tp-fldv.tp-v-fst>.tp-fldv_b{border-top-left-radius:var(--bs-br);border-top-right-radius:var(--bs-br)}.tp-rotv_c>.tp-tabv.tp-v-lst>.tp-tabv_c{border-bottom-left-radius:var(--bs-br);border-bottom-right-radius:var(--bs-br)}.tp-rotv_c>.tp-tabv.tp-v-lst>.tp-tabv_i{border-bottom-left-radius:var(--bs-br)}.tp-rotv.tp-rotv-not .tp-rotv_c>.tp-tabv.tp-v-fst{margin-top:calc(-1*var(--cnt-vp))}.tp-rotv.tp-rotv-not .tp-rotv_c>.tp-tabv.tp-v-fst>.tp-tabv_t{border-top-left-radius:var(--bs-br);border-top-right-radius:var(--bs-br)}.tp-rotv.tp-v-disabled,.tp-rotv .tp-v-disabled{pointer-events:none}.tp-rotv.tp-v-hidden,.tp-rotv .tp-v-hidden{display:none}.tp-sprv_r{background-color:var(--grv-fg);border-width:0;display:block;height:2px;margin:0;width:100%}.tp-sprv.tp-v-disabled .tp-sprv_r{opacity:.5}',plugins:[p2,g2,b2,sh,_2]})}}new rh("4.0.5");const It=new w2({title:"parameters",container:document.getElementById("settingsPane")}),Nh=It.addFolder({title:"d3 forces settings",expanded:!1}),C2=[{key:"d3Charge",min:-800,max:100,step:10},{key:"d3LinkDistance",min:40,max:300,step:5},{key:"d3LinkStrength",min:0,max:1,step:.01},{key:"d3CollisionMultiplier",min:.5,max:2,step:.05},{key:"d3AlphaTarget",min:0,max:.5,step:.01},{key:"d3VelocityDecay",min:.01,max:.99,step:.01},{key:"d3ForceXYStrength",min:0,max:.99,step:.01}];for(const n of C2)Nh.addBinding(H,n.key,n).on("change",()=>{ut("d3-simulation-parameters-changed",null)});Nh.addBinding(H,"d3CenterForce").on("change",()=>{ut("d3-simulation-parameters-changed",null)});const Va=It.addFolder({title:"display options",expanded:!1});Va.addBinding(H,"showIsolated").on("change",()=>{ut("graph-ui-settings-updated",null)});Va.addBinding(H,"showGrid").on("change",()=>{ut("graph-ui-settings-updated",null)});Va.addBinding(H,"curvatureStep",{min:0,max:.2,step:.001}).on("change",()=>{ut("graph-ui-links-curvature-updated",null)});const Fh=It.addFolder({title:"label settings",expanded:!1}),E2=Fh.addBinding(H,"nodeLabelMode",{label:"node label",view:"list",options:[{text:"default",value:"default"},{text:"type",value:"type"},{text:"id",value:"id"},{text:"expression",value:"expression"}]}),Vh=Fh.addBinding(H,"nodeLabelExpression",{label:"expression"});function Bh(){Vh.hidden=H.nodeLabelMode!=="expression"}Bh();E2.on("change",()=>{Bh()});Vh.on("change",()=>{});const Xe=It.addFolder({title:"actions",expanded:!0});Xe.addButton({title:"reload sysgraph graph"}).on("click",async()=>{await Gs("reload-graph")});Xe.addBlade({view:"separator"});Xe.addButton({title:"pin all"}).on("click",()=>{J.graphData().nodes.forEach(e=>{e.fx=e.x,e.fy=e.y})});Xe.addButton({title:"unpin all"}).on("click",()=>{J.graphData().nodes.forEach(e=>{e.fx=void 0,e.fy=void 0})});Xe.addBlade({view:"separator"});Xe.addButton({title:"clear"}).on("click",async()=>{ut("clear-button-clicked",null)});Xe.addButton({title:"export data"}).on("click",()=>{const n=Gs("export-graph"),e=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=`${e}_graph.json`,i.click(),URL.revokeObjectURL(r)});Xe.addButton({title:"import data"}).on("click",()=>{document.getElementById("importFile").click()});document.getElementById("importFile").addEventListener("change",async n=>{const e=n.target.files[0];if(!e)return;const r=await e.text();await Gs("import-graph",r),n.target.value=""});let ti=It.addFolder({title:"node filters",expanded:!1}),ei=It.addFolder({title:"edge filters",expanded:!1}),ni=It.addFolder({title:"node colors",expanded:!0}),ri=It.addFolder({title:"edge colors",expanded:!0}),ii=It.addFolder({title:"edge widths",expanded:!1});function k2(){const n=ti.expanded,e=ei.expanded,r=ni.expanded,i=ri.expanded,o=ii.expanded;ti.dispose(),ei.dispose(),ni.dispose(),ri.dispose(),ii.dispose(),ti=It.addFolder({title:"node filters",expanded:n}),ei=It.addFolder({title:"edge filters",expanded:e}),ni=It.addFolder({title:"node colors",expanded:r}),ri=It.addFolder({title:"edge colors",expanded:i}),ii=It.addFolder({title:"edge widths",expanded:o});const s=vn(),a=new Set;for(const c of s.getNodes())a.add(c.type);const l=new Set;for(const c of s.getEdges())l.add(c.type);for(const c of a)c in H.nodeFilters||(H.nodeFilters[c]=!0),ti.addBinding(H.nodeFilters,c).on("change",()=>{ut("graph-filters-updated",null)});for(const c of l)c in H.edgeFilters||(H.edgeFilters[c]=!0),ei.addBinding(H.edgeFilters,c).on("change",()=>{ut("graph-filters-updated",null)});for(const c of a)c in H.nodeColors||(H.nodeColors[c]=structuredClone(fu(c))),ni.addBinding(H.nodeColors,c);for(const c of l)c in H.edgeColors||(H.edgeColors[c]=structuredClone(vu(c))),ri.addBinding(H.edgeColors,c);for(const c of l)c in H.edgeWidths||(H.edgeWidths[c]=mu(c)),ii.addBinding(H.edgeWidths,c,{min:.5,max:5,step:.5})}async function Nc(){const n=vn();function e(o){return!T.selection.selectedNodeIds.has(o.id)}function r(o){return!T.selection.selectedNodeIds.has(o.source_id)&&!T.selection.selectedNodeIds.has(o.target_id)}const i=cu(n,e,r);Zi(i),ut("graph-updated",null),T.selection.selectedNodeIds.clear(),ut("selection-changed",null)}function A2(n,e){const r=Math.min(e.x1,e.x2),i=Math.max(e.x1,e.x2),o=Math.min(e.y1,e.y2),s=Math.max(e.y1,e.y2),a=Math.max(4,(n.val||1)*3);return n.x+a>r&&n.x-a<i&&n.y+a>o&&n.y-a<s}function P2(){const n=document.getElementById("graph"),e=document.createElement("canvas");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.cursor="crosshair",e.style.zIndex="50",e.style.display="block",e.style.pointerEvents="none",e.style.background="transparent",n.appendChild(e);function r(){const l=n.getBoundingClientRect();J.width(l.width),J.height(l.height),e.width=l.width,e.height=l.height}r(),window.addEventListener("resize",()=>{r()});function i(){const l=e.getContext("2d");if(l.clearRect(0,0,e.width,e.height),T.selection.isSelecting&&T.selection.selectionStartCanvas&&T.selection.selectionEndCanvas){const c=T.selection.selectionStartCanvas.x,u=T.selection.selectionEndCanvas.x,h=T.selection.selectionStartCanvas.y,d=T.selection.selectionEndCanvas.y,f=Math.min(c,u),p=Math.max(c,u),m=Math.min(h,d),b=Math.max(h,d);l.fillStyle="rgba(33, 150, 243, 0.1)",l.fillRect(f,m,p-f,b-m),l.strokeStyle="rgba(33, 150, 243, 0.8)",l.lineWidth=1,l.strokeRect(f,m,p-f,b-m)}}const o=document.querySelector("#graph canvas");e.addEventListener("wheel",l=>{l.preventDefault(),o.dispatchEvent(new WheelEvent(l.type,l))},{passive:!1});let s=null,a=null;return n.addEventListener("mousedown",l=>{if(l.button===1){l.preventDefault(),l.stopPropagation();const c=T.currentTool==="rect-select"?e:o;a=c.style.cursor,c.style.cursor="grabbing",s={lastX:l.clientX,lastY:l.clientY}}},!0),window.addEventListener("mousemove",l=>{if(s){const c=l.clientX-s.lastX,u=l.clientY-s.lastY;s.lastX=l.clientX,s.lastY=l.clientY;const h=J.zoom(),d=J.centerAt();J.centerAt(d.x-c/h,d.y-u/h)}}),window.addEventListener("mouseup",l=>{if(s&&l.button===1){const c=T.currentTool==="rect-select"?e:o;c.style.cursor=a||"",s=null,a=null}}),e.addEventListener("mousedown",l=>{if(T.currentTool==="rect-select"){if(l.button!==0)return;const c=n.getBoundingClientRect(),u=l.clientX-c.left,h=l.clientY-c.top,d=J.screen2GraphCoords(u,h);T.selection.isSelecting=!0,T.selection.selectionStart=d,T.selection.selectionEnd=d,T.selection.selectionStartCanvas={x:u,y:h},T.selection.selectionEndCanvas={x:u,y:h},i()}}),e.addEventListener("mousemove",l=>{if(T.selection.isSelecting&&T.currentTool==="rect-select"){const c=n.getBoundingClientRect(),u=l.clientX-c.left,h=l.clientY-c.top,d=J.screen2GraphCoords(u,h);T.selection.selectionEnd=d,T.selection.selectionEndCanvas={x:u,y:h},i()}}),e.addEventListener("mouseup",l=>{if(T.selection.isSelecting&&T.currentTool==="rect-select"){const c=n.getBoundingClientRect(),u=l.clientX-c.left,h=l.clientY-c.top,d=J.screen2GraphCoords(u,h);T.selection.selectionEnd=d,T.selection.selectionEndCanvas={x:u,y:h},T.selection.isSelecting=!1;const f={x1:T.selection.selectionStart.x,y1:T.selection.selectionStart.y,x2:T.selection.selectionEnd.x,y2:T.selection.selectionEnd.y};l.shiftKey||T.selection.selectedNodeIds.clear(),J.graphData().nodes.forEach(m=>{A2(m,f)&&T.selection.selectedNodeIds.add(m.id)}),ut("selection-changed",null),T.selection.selectionStartCanvas=null,T.selection.selectionEndCanvas=null,i()}}),{selectionCanvas:e,canvas:o}}const Uh=document.getElementById("toolPointer"),Hh=document.getElementById("toolRectSelect"),qh=document.getElementById("toolSearch"),ar=document.getElementById("deleteSelected"),lr=document.getElementById("unselectAll"),jo=document.getElementById("selectionInfo"),En=document.getElementById("searchInput"),S2=document.getElementById("searchHelpTrigger"),Ss=document.getElementById("searchHelpAnchor"),Ms=document.getElementById("searchHelp"),Fc=document.getElementById("searchMatchCount"),wi=document.getElementById("addToSelection");function Qn(n,e,r){T.currentTool=n,Uh.classList.toggle("active",n==="pointer"),Hh.classList.toggle("active",n==="rect-select"),qh.classList.toggle("active",n==="search"),n==="rect-select"?(e.style.pointerEvents="auto",e.style.cursor="crosshair"):(e.style.pointerEvents="none",r.style.cursor="default"),n==="search"?(En.style.display="inline-block",Ss.style.display="inline-flex",wi.style.display="inline-block",En.focus(),En.value?ut("search-expression-changed",En.value):(Fc.style.display="none",wi.disabled=!0)):(En.style.display="none",Ss.style.display="none",Ms.classList.remove("open"),Fc.style.display="none",wi.style.display="none",ut("search-expression-changed","")),Gi()}function Gi(){T.currentTool==="rect-select"||T.currentTool==="search"?(ar.style.display="inline-block",lr.style.display="inline-block",T.selection.selectedNodeIds.size>0?(jo.textContent=`${T.selection.selectedNodeIds.size} node${T.selection.selectedNodeIds.size!==1?"s":""} selected`,ar.disabled=!1,lr.disabled=!1):(jo.textContent="",ar.disabled=!0,lr.disabled=!0)):(jo.textContent="",ar.style.display="none",lr.style.display="none")}function M2(n,e){En.addEventListener("input",r=>{r.stopPropagation(),ut("search-expression-changed",r.target.value)}),S2.addEventListener("click",r=>{r.stopPropagation(),Ms.classList.toggle("open")}),document.addEventListener("click",r=>{Ss.contains(r.target)||Ms.classList.remove("open")}),Uh.addEventListener("click",()=>{Qn("pointer",n,e)}),Hh.addEventListener("click",()=>{Qn("rect-select",n,e)}),qh.addEventListener("click",()=>{Qn("search",n,e)}),ar.addEventListener("click",async()=>{await Nc()}),lr.addEventListener("click",()=>{T.selection.selectedNodeIds.clear(),Gi()}),wi.addEventListener("click",()=>{if(T.search&&T.search.matchesMap.size>0){for(const r of T.search.matchesMap.keys())T.selection.selectedNodeIds.add(r);Gi()}}),document.addEventListener("keydown",async r=>{const i=r.target;i.tagName==="INPUT"||i.tagName==="MD-OUTLINED-TEXT-FIELD"||i.tagName==="TEXTAREA"||i.isContentEditable||(r.key==="p"||r.key==="P"?Qn("pointer",n,e):r.key==="r"||r.key==="R"?Qn("rect-select",n,e):r.key==="Delete"&&T.currentTool==="rect-select"&&T.selection.selectedNodeIds.size>0&&await Nc())})}function Kh(n){return n===null?"null":typeof n}function Gh(n){return!!n&&typeof n=="object"}function Wh(n){if(n===void 0)return"";if(n===null||typeof n=="object"&&!n.constructor)return"Object";var e=/function ([^(]*)/.exec(n.constructor.toString());return e&&e.length>1?e[1]:""}function Yh(n,e,r){return n==="null"||n==="undefined"?n:(n!=="string"&&n!=="stringifiable"||(r='"'+(r.replace(/"/g,'\\"')+'"')),n==="function"?e.toString().replace(/[\r\n]/g,"").replace(/\{.*\}/,"")+"{…}":r)}function Vc(n){var e="";return Gh(n)?(e=Wh(n),Array.isArray(n)&&(e+="["+n.length+"]")):e=Yh(Kh(n),n,n),e}function $t(n){return"json-formatter-".concat(n)}function mt(n,e,r){var i=document.createElement(n);return e&&i.classList.add($t(e)),r!==void 0&&(r instanceof Node?i.appendChild(r):i.appendChild(document.createTextNode(String(r)))),i}(function(n){if(typeof window<"u"){var e=document.createElement("style");e.setAttribute("media","screen"),e.innerHTML=n,document.head.appendChild(e)}})(`.json-formatter-row {
47
+ font-family: monospace;
48
+ }
49
+ .json-formatter-row,
50
+ .json-formatter-row a,
51
+ .json-formatter-row a:hover {
52
+ color: black;
53
+ text-decoration: none;
54
+ }
55
+ .json-formatter-row .json-formatter-row {
56
+ margin-left: 1rem;
57
+ }
58
+ .json-formatter-row .json-formatter-children.json-formatter-empty {
59
+ opacity: 0.5;
60
+ margin-left: 1rem;
61
+ }
62
+ .json-formatter-row .json-formatter-children.json-formatter-empty:after {
63
+ display: none;
64
+ }
65
+ .json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {
66
+ content: "No properties";
67
+ }
68
+ .json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {
69
+ content: "[]";
70
+ }
71
+ .json-formatter-row .json-formatter-string,
72
+ .json-formatter-row .json-formatter-stringifiable {
73
+ color: green;
74
+ white-space: pre;
75
+ word-wrap: break-word;
76
+ }
77
+ .json-formatter-row .json-formatter-number {
78
+ color: blue;
79
+ }
80
+ .json-formatter-row .json-formatter-boolean {
81
+ color: red;
82
+ }
83
+ .json-formatter-row .json-formatter-null {
84
+ color: #855a00;
85
+ }
86
+ .json-formatter-row .json-formatter-undefined {
87
+ color: #ca0b69;
88
+ }
89
+ .json-formatter-row .json-formatter-function {
90
+ color: #FF20ED;
91
+ }
92
+ .json-formatter-row .json-formatter-date {
93
+ background-color: rgba(0, 0, 0, 0.05);
94
+ }
95
+ .json-formatter-row .json-formatter-url {
96
+ text-decoration: underline;
97
+ color: blue;
98
+ cursor: pointer;
99
+ }
100
+ .json-formatter-row .json-formatter-bracket {
101
+ color: blue;
102
+ }
103
+ .json-formatter-row .json-formatter-key {
104
+ color: #00008b;
105
+ padding-right: 0.2rem;
106
+ }
107
+ .json-formatter-row .json-formatter-toggler-link {
108
+ cursor: pointer;
109
+ }
110
+ .json-formatter-row .json-formatter-toggler {
111
+ line-height: 1.2rem;
112
+ font-size: 0.7rem;
113
+ vertical-align: middle;
114
+ opacity: 0.6;
115
+ cursor: pointer;
116
+ padding-right: 0.2rem;
117
+ }
118
+ .json-formatter-row .json-formatter-toggler:after {
119
+ display: inline-block;
120
+ transition: transform 100ms ease-in;
121
+ content: "►";
122
+ }
123
+ .json-formatter-row > a > .json-formatter-preview-text {
124
+ opacity: 0;
125
+ transition: opacity 0.15s ease-in;
126
+ font-style: italic;
127
+ }
128
+ .json-formatter-row:hover > a > .json-formatter-preview-text {
129
+ opacity: 0.6;
130
+ }
131
+ .json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {
132
+ transform: rotate(90deg);
133
+ }
134
+ .json-formatter-row.json-formatter-open > .json-formatter-children:after {
135
+ display: inline-block;
136
+ }
137
+ .json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {
138
+ display: none;
139
+ }
140
+ .json-formatter-row.json-formatter-open.json-formatter-empty:after {
141
+ display: block;
142
+ }
143
+ .json-formatter-dark.json-formatter-row {
144
+ font-family: monospace;
145
+ }
146
+ .json-formatter-dark.json-formatter-row,
147
+ .json-formatter-dark.json-formatter-row a,
148
+ .json-formatter-dark.json-formatter-row a:hover {
149
+ color: white;
150
+ text-decoration: none;
151
+ }
152
+ .json-formatter-dark.json-formatter-row .json-formatter-row {
153
+ margin-left: 1rem;
154
+ }
155
+ .json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty {
156
+ opacity: 0.5;
157
+ margin-left: 1rem;
158
+ }
159
+ .json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty:after {
160
+ display: none;
161
+ }
162
+ .json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {
163
+ content: "No properties";
164
+ }
165
+ .json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {
166
+ content: "[]";
167
+ }
168
+ .json-formatter-dark.json-formatter-row .json-formatter-string,
169
+ .json-formatter-dark.json-formatter-row .json-formatter-stringifiable {
170
+ color: #31f031;
171
+ white-space: pre;
172
+ word-wrap: break-word;
173
+ }
174
+ .json-formatter-dark.json-formatter-row .json-formatter-number {
175
+ color: #66c2ff;
176
+ }
177
+ .json-formatter-dark.json-formatter-row .json-formatter-boolean {
178
+ color: #EC4242;
179
+ }
180
+ .json-formatter-dark.json-formatter-row .json-formatter-null {
181
+ color: #EEC97D;
182
+ }
183
+ .json-formatter-dark.json-formatter-row .json-formatter-undefined {
184
+ color: #ef8fbe;
185
+ }
186
+ .json-formatter-dark.json-formatter-row .json-formatter-function {
187
+ color: #FD48CB;
188
+ }
189
+ .json-formatter-dark.json-formatter-row .json-formatter-date {
190
+ background-color: rgba(255, 255, 255, 0.05);
191
+ }
192
+ .json-formatter-dark.json-formatter-row .json-formatter-url {
193
+ text-decoration: underline;
194
+ color: #027bff;
195
+ cursor: pointer;
196
+ }
197
+ .json-formatter-dark.json-formatter-row .json-formatter-bracket {
198
+ color: #9494ff;
199
+ }
200
+ .json-formatter-dark.json-formatter-row .json-formatter-key {
201
+ color: #23a0db;
202
+ padding-right: 0.2rem;
203
+ }
204
+ .json-formatter-dark.json-formatter-row .json-formatter-toggler-link {
205
+ cursor: pointer;
206
+ }
207
+ .json-formatter-dark.json-formatter-row .json-formatter-toggler {
208
+ line-height: 1.2rem;
209
+ font-size: 0.7rem;
210
+ vertical-align: middle;
211
+ opacity: 0.6;
212
+ cursor: pointer;
213
+ padding-right: 0.2rem;
214
+ }
215
+ .json-formatter-dark.json-formatter-row .json-formatter-toggler:after {
216
+ display: inline-block;
217
+ transition: transform 100ms ease-in;
218
+ content: "►";
219
+ }
220
+ .json-formatter-dark.json-formatter-row > a > .json-formatter-preview-text {
221
+ opacity: 0;
222
+ transition: opacity 0.15s ease-in;
223
+ font-style: italic;
224
+ }
225
+ .json-formatter-dark.json-formatter-row:hover > a > .json-formatter-preview-text {
226
+ opacity: 0.6;
227
+ }
228
+ .json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {
229
+ transform: rotate(90deg);
230
+ }
231
+ .json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-children:after {
232
+ display: inline-block;
233
+ }
234
+ .json-formatter-dark.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {
235
+ display: none;
236
+ }
237
+ .json-formatter-dark.json-formatter-row.json-formatter-open.json-formatter-empty:after {
238
+ display: block;
239
+ }
240
+ `);var $2=/(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[012])\d:[0-5])\d\s*[ap]m)?$/,T2=/\d{2}:\d{2}:\d{2} GMT-\d{4}/,I2=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,O2=/^https?:\/\//,oi=window.requestAnimationFrame||function(n){return n(),0},Cn={hoverPreviewEnabled:!1,hoverPreviewArrayCount:100,hoverPreviewFieldCount:5,animateOpen:!0,animateClose:!0,theme:null,useToJSON:!0,sortPropertiesBy:null,maxArrayItems:100,exposePath:!1},Xh=(function(){function n(e,r,i,o,s,a,l){r===void 0&&(r=1),i===void 0&&(i=Cn),a===void 0&&(a=[]),this.json=e,this.open=r,this.config=i,this.key=o,this.displayKey=s,this.path=a,this.arrayRange=l,this._isOpen=null,this.config.hoverPreviewEnabled===void 0&&(this.config.hoverPreviewEnabled=Cn.hoverPreviewEnabled),this.config.hoverPreviewArrayCount===void 0&&(this.config.hoverPreviewArrayCount=Cn.hoverPreviewArrayCount),this.config.hoverPreviewFieldCount===void 0&&(this.config.hoverPreviewFieldCount=Cn.hoverPreviewFieldCount),this.config.useToJSON===void 0&&(this.config.useToJSON=Cn.useToJSON),this.config.maxArrayItems===void 0&&(this.config.maxArrayItems=Cn.maxArrayItems),this.key===""&&(this.key='""'),this.displayKey===void 0&&(this.displayKey=this.key)}return Object.defineProperty(n.prototype,"isOpen",{get:function(){return this._isOpen!==null?this._isOpen:this.open>0},set:function(e){this._isOpen=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDate",{get:function(){return this.json instanceof Date||this.type==="string"&&($2.test(this.json)||I2.test(this.json)||T2.test(this.json))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUrl",{get:function(){return this.type==="string"&&O2.test(this.json)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isArray",{get:function(){return Array.isArray(this.json)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isLargeArray",{get:function(){return this.isArray&&this.json.length>this.config.maxArrayItems},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isArrayRange",{get:function(){return this.isArray&&this.arrayRange!==void 0&&this.arrayRange.length==2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isObject",{get:function(){return Gh(this.json)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isEmptyObject",{get:function(){return!this.keys.length&&!this.isArray},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isEmpty",{get:function(){return this.isEmptyObject||this.keys&&!this.keys.length&&this.isArray},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"useToJSON",{get:function(){return this.config.useToJSON&&this.type==="stringifiable"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hasKey",{get:function(){return this.key!==void 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"constructorName",{get:function(){return Wh(this.json)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.config.useToJSON&&this.json&&this.json.toJSON?"stringifiable":Kh(this.json)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"keys",{get:function(){if(this.isObject){var e=Object.keys(this.json);if(this.isLargeArray){var r=Math.ceil(this.json.length/this.config.maxArrayItems);e=[];for(var i=0;i<r;i++){var o=i*this.config.maxArrayItems,s=Math.min(this.json.length-1,o+(this.config.maxArrayItems-1));e.push("".concat(o," … ").concat(s))}}return!this.isArray&&this.config.sortPropertiesBy?e.sort(this.config.sortPropertiesBy):e}return[]},enumerable:!1,configurable:!0}),n.prototype.toggleOpen=function(){this.isOpen=!this.isOpen,this.element&&(this.isOpen?this.appendChildren(this.config.animateOpen):this.removeChildren(this.config.animateClose),this.element.classList.toggle($t("open")))},n.prototype.openAtDepth=function(e){e===void 0&&(e=1),e<0||(this.open=e,this.isOpen=e!==0,this.element&&(this.removeChildren(!1),e===0?this.element.classList.remove($t("open")):(this.appendChildren(this.config.animateOpen),this.element.classList.add($t("open")))))},n.prototype.getInlinepreview=function(){var e=this;if(this.isArray)return this.json.length>this.config.hoverPreviewArrayCount?"Array[".concat(this.json.length,"]"):"[".concat(this.json.map(Vc).join(", "),"]");var r=this.keys,i=r.slice(0,this.config.hoverPreviewFieldCount).map((function(s){return"".concat(s,":").concat(Vc(e.json[s]))})),o=r.length>=this.config.hoverPreviewFieldCount?"…":"";return"{".concat(i.join(", ")).concat(o,"}")},n.prototype.render=function(){this.element=mt("div","row");var e=this.isObject?mt("a","toggler-link"):mt("span");if(this.isObject&&!this.useToJSON&&e.appendChild(mt("span","toggler")),this.isArrayRange?e.appendChild(mt("span","range","[".concat(this.displayKey,"]"))):this.hasKey&&(e.appendChild(mt("span","key","".concat(this.displayKey,":"))),this.config.exposePath&&(this.element.dataset.path=JSON.stringify(this.path))),this.isObject&&!this.useToJSON){var r=mt("span","value"),i=mt("span");if(!this.isArrayRange){var o=mt("span","constructor-name",this.constructorName);i.appendChild(o)}if(this.isArray&&!this.isArrayRange){var s=mt("span");s.appendChild(mt("span","bracket","[")),s.appendChild(mt("span","number",this.json.length)),s.appendChild(mt("span","bracket","]")),i.appendChild(s)}r.appendChild(i),e.appendChild(r)}else{(r=this.isUrl?mt("a"):mt("span")).classList.add($t(this.type)),this.isDate&&r.classList.add($t("date")),this.isUrl&&(r.classList.add($t("url")),r.setAttribute("href",this.json));var a=Yh(this.type,this.json,this.useToJSON?this.json.toJSON():this.json);r.appendChild(document.createTextNode(a)),e.appendChild(r)}if(this.isObject&&this.config.hoverPreviewEnabled){var l=mt("span","preview-text");l.appendChild(document.createTextNode(this.getInlinepreview())),e.appendChild(l)}var c=mt("div","children");return this.isObject&&c.classList.add($t("object")),this.isArray&&c.classList.add($t("array")),this.isEmpty&&c.classList.add($t("empty")),this.config&&this.config.theme&&this.element.classList.add($t(this.config.theme)),this.isOpen&&this.element.classList.add($t("open")),this.element.appendChild(e),this.element.appendChild(c),this.isObject&&this.isOpen&&this.appendChildren(),this.isObject&&!this.useToJSON&&e.addEventListener("click",this.toggleOpen.bind(this)),this.element},n.prototype.appendChildren=function(e){var r=this;e===void 0&&(e=!1);var i=this.element.querySelector("div.".concat($t("children")));if(i&&!this.isEmpty){var o=function(l,c){var u=r.isLargeArray?[c*r.config.maxArrayItems,Math.min(r.json.length-1,c*r.config.maxArrayItems+(r.config.maxArrayItems-1))]:void 0,h=r.isArrayRange?(r.arrayRange[0]+c).toString():l,d=new n(u?r.json.slice(u[0],u[1]+1):r.json[l],r.open-1,r.config,l,h,u?r.path:r.path.concat(h),u);i.appendChild(d.render())};if(e){var s=0,a=function(){var l=r.keys[s];o(l,s),(s+=1)<r.keys.length&&(s>10?a():oi(a))};oi(a)}else this.keys.forEach((function(l,c){return o(l,c)}))}},n.prototype.removeChildren=function(e){e===void 0&&(e=!1);var r=this.element.querySelector("div.".concat($t("children")));if(e){var i=0,o=function(){r&&r.children.length&&(r.removeChild(r.children[0]),(i+=1)>10?o():oi(o))};oi(o)}else r&&(r.innerHTML="")},n})();const Ba=document.getElementById("detailsPanel"),Bc=document.getElementById("detailsPanelBody"),D2=document.getElementById("detailsPanelClose"),R2=document.getElementById("content");let si=0;function Zh(n){return{id:n.id,type:n.type,kind:n.kind,properties:n.properties||{}}}function j2(n){const e=new Xh(Zh(n),2);Bc.innerHTML="",Bc.appendChild(e.render()),Ba.classList.add("open")}function L2(){Ba.classList.remove("open")}D2.addEventListener("click",()=>L2());function Jh(n){const e=n.querySelector(".panel-header");let r=!1,i=0,o=0,s=0,a=0;e.addEventListener("pointerdown",l=>{l.target.closest("md-icon-button")||(r=!0,i=l.clientX,o=l.clientY,s=n.offsetLeft,a=n.offsetTop,e.setPointerCapture(l.pointerId))}),e.addEventListener("pointermove",l=>{if(!r)return;const c=n.parentElement,u=Math.max(0,Math.min(s+l.clientX-i,c.clientWidth-n.offsetWidth)),h=Math.max(0,Math.min(a+l.clientY-o,c.clientHeight-n.offsetHeight));n.style.left=u+"px",n.style.top=h+"px"}),e.addEventListener("pointerup",()=>{r=!1})}Jh(Ba);function z2(n){si++;const e=8+si*30,r=document.createElement("div");r.className="details-panel open",r.style.top=e+"px",r.style.left=e+"px";const i=document.createElement("div");i.className="panel-header";const o=document.createElement("span");o.className="panel-title",o.textContent="Details";const s=document.createElement("md-icon-button"),a=document.createElement("md-icon");a.textContent="close",s.appendChild(a),s.addEventListener("click",()=>{r.remove(),si=Math.max(0,si-1)}),i.appendChild(o),i.appendChild(s);const l=document.createElement("div");l.className="panel-body";const c=new Xh(Zh(n),2);l.appendChild(c.render()),r.appendChild(i),r.appendChild(l),R2.appendChild(r),Jh(r)}function Qh(n){n.shiftKey?z2(n.data):j2(n.data)}ce("node-clicked",Qh);ce("link-clicked",Qh);function $(n,e,r,i){var o=arguments.length,s=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,r,i);else for(var l=n.length-1;l>=0;l--)(a=n[l])&&(s=(o<3?a(s):o>3?a(e,r,s):a(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}/**
241
+ * @license
242
+ * Copyright 2017 Google LLC
243
+ * SPDX-License-Identifier: BSD-3-Clause
244
+ */const de=n=>(e,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(n,e)}):customElements.define(n,e)};/**
245
+ * @license
246
+ * Copyright 2019 Google LLC
247
+ * SPDX-License-Identifier: BSD-3-Clause
248
+ */const Ci=globalThis,Ua=Ci.ShadowRoot&&(Ci.ShadyCSS===void 0||Ci.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ha=Symbol(),Uc=new WeakMap;let tp=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Ha)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(Ua&&e===void 0){const i=r!==void 0&&r.length===1;i&&(e=Uc.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Uc.set(r,e))}return e}toString(){return this.cssText}};const N2=n=>new tp(typeof n=="string"?n:n+"",void 0,Ha),Mt=(n,...e)=>{const r=n.length===1?n[0]:e.reduce((i,o,s)=>i+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+n[s+1],n[0]);return new tp(r,n,Ha)},F2=(n,e)=>{if(Ua)n.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const i=document.createElement("style"),o=Ci.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=r.cssText,n.appendChild(i)}},Hc=Ua?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return N2(r)})(n):n;/**
249
+ * @license
250
+ * Copyright 2017 Google LLC
251
+ * SPDX-License-Identifier: BSD-3-Clause
252
+ */const{is:V2,defineProperty:B2,getOwnPropertyDescriptor:U2,getOwnPropertyNames:H2,getOwnPropertySymbols:q2,getPrototypeOf:K2}=Object,qe=globalThis,qc=qe.trustedTypes,G2=qc?qc.emptyScript:"",Lo=qe.reactiveElementPolyfillSupport,pr=(n,e)=>n,Wi={toAttribute(n,e){switch(e){case Boolean:n=n?G2:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let r=n;switch(e){case Boolean:r=n!==null;break;case Number:r=n===null?null:Number(n);break;case Object:case Array:try{r=JSON.parse(n)}catch{r=null}}return r}},qa=(n,e)=>!V2(n,e),Kc={attribute:!0,type:String,converter:Wi,reflect:!1,useDefault:!1,hasChanged:qa};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),qe.litPropertyMetadata??(qe.litPropertyMetadata=new WeakMap);let kn=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=Kc){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(e,i,r);o!==void 0&&B2(this.prototype,e,o)}}static getPropertyDescriptor(e,r,i){const{get:o,set:s}=U2(this.prototype,e)??{get(){return this[r]},set(a){this[r]=a}};return{get:o,set(a){const l=o==null?void 0:o.call(this);s==null||s.call(this,a),this.requestUpdate(e,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Kc}static _$Ei(){if(this.hasOwnProperty(pr("elementProperties")))return;const e=K2(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(pr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(pr("properties"))){const r=this.properties,i=[...H2(r),...q2(r)];for(const o of i)this.createProperty(o,r[o])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[i,o]of r)this.elementProperties.set(i,o)}this._$Eh=new Map;for(const[r,i]of this.elementProperties){const o=this._$Eu(r,i);o!==void 0&&this._$Eh.set(o,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const o of i)r.unshift(Hc(o))}else e!==void 0&&r.push(Hc(e));return r}static _$Eu(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const i of r.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return F2(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var i;return(i=r.hostDisconnected)==null?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$ET(e,r){var s;const i=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,i);if(o!==void 0&&i.reflect===!0){const a=(((s=i.converter)==null?void 0:s.toAttribute)!==void 0?i.converter:Wi).toAttribute(r,i.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,r){var s,a;const i=this.constructor,o=i._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const l=i.getPropertyOptions(o),c=typeof l.converter=="function"?{fromAttribute:l.converter}:((s=l.converter)==null?void 0:s.fromAttribute)!==void 0?l.converter:Wi;this._$Em=o;const u=c.fromAttribute(r,l.type);this[o]=u??((a=this._$Ej)==null?void 0:a.get(o))??u,this._$Em=null}}requestUpdate(e,r,i,o=!1,s){var a;if(e!==void 0){const l=this.constructor;if(o===!1&&(s=this[e]),i??(i=l.getPropertyOptions(e)),!((i.hasChanged??qa)(s,r)||i.useDefault&&i.reflect&&s===((a=this._$Ej)==null?void 0:a.get(e))&&!this.hasAttribute(l._$Eu(e,i))))return;this.C(e,r,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:i,reflect:o,wrapped:s},a){i&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??r??this[e]),s!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(r=void 0),this._$AL.set(e,r)),o===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,a]of this._$Ep)this[s]=a;this._$Ep=void 0}const o=this.constructor.elementProperties;if(o.size>0)for(const[s,a]of o){const{wrapped:l}=a,c=this[s];l!==!0||this._$AL.has(s)||c===void 0||this.C(s,void 0,a,c)}}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),(i=this._$EO)==null||i.forEach(o=>{var s;return(s=o.hostUpdate)==null?void 0:s.call(o)}),this.update(r)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(r)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(i=>{var o;return(o=i.hostUpdated)==null?void 0:o.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(r=>this._$ET(r,this[r]))),this._$EM()}updated(e){}firstUpdated(e){}};kn.elementStyles=[],kn.shadowRootOptions={mode:"open"},kn[pr("elementProperties")]=new Map,kn[pr("finalized")]=new Map,Lo==null||Lo({ReactiveElement:kn}),(qe.reactiveElementVersions??(qe.reactiveElementVersions=[])).push("2.1.2");/**
253
+ * @license
254
+ * Copyright 2017 Google LLC
255
+ * SPDX-License-Identifier: BSD-3-Clause
256
+ */const W2={attribute:!0,type:String,converter:Wi,reflect:!1,hasChanged:qa},Y2=(n=W2,e,r)=>{const{kind:i,metadata:o}=r;let s=globalThis.litPropertyMetadata.get(o);if(s===void 0&&globalThis.litPropertyMetadata.set(o,s=new Map),i==="setter"&&((n=Object.create(n)).wrapped=!0),s.set(r.name,n),i==="accessor"){const{name:a}=r;return{set(l){const c=e.get.call(this);e.set.call(this,l),this.requestUpdate(a,c,n,!0,l)},init(l){return l!==void 0&&this.C(a,void 0,n,l),l}}}if(i==="setter"){const{name:a}=r;return function(l){const c=this[a];e.call(this,l),this.requestUpdate(a,c,n,!0,l)}}throw Error("Unsupported decorator location: "+i)};function j(n){return(e,r)=>typeof r=="object"?Y2(n,e,r):((i,o,s)=>{const a=o.hasOwnProperty(s);return o.constructor.createProperty(s,i),a?Object.getOwnPropertyDescriptor(o,s):void 0})(n,e,r)}/**
257
+ * @license
258
+ * Copyright 2017 Google LLC
259
+ * SPDX-License-Identifier: BSD-3-Clause
260
+ */function he(n){return j({...n,state:!0,attribute:!1})}/**
261
+ * @license
262
+ * Copyright 2017 Google LLC
263
+ * SPDX-License-Identifier: BSD-3-Clause
264
+ */const ep=(n,e,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(n,e,r),r);/**
265
+ * @license
266
+ * Copyright 2017 Google LLC
267
+ * SPDX-License-Identifier: BSD-3-Clause
268
+ */function bn(n,e){return(r,i,o)=>{const s=a=>{var l;return((l=a.renderRoot)==null?void 0:l.querySelector(n))??null};return ep(r,i,{get(){return s(this)}})}}/**
269
+ * @license
270
+ * Copyright 2021 Google LLC
271
+ * SPDX-License-Identifier: BSD-3-Clause
272
+ */function co(n){return(e,r)=>{const{slot:i,selector:o}=n??{},s="slot"+(i?`[name=${i}]`:":not([name])");return ep(e,r,{get(){var c;const a=(c=this.renderRoot)==null?void 0:c.querySelector(s),l=(a==null?void 0:a.assignedElements(n))??[];return o===void 0?l:l.filter(u=>u.matches(o))}})}}/**
273
+ * @license
274
+ * Copyright 2017 Google LLC
275
+ * SPDX-License-Identifier: BSD-3-Clause
276
+ */const fr=globalThis,Gc=n=>n,Yi=fr.trustedTypes,Wc=Yi?Yi.createPolicy("lit-html",{createHTML:n=>n}):void 0,np="$lit$",Ve=`lit$${Math.random().toFixed(9).slice(2)}$`,rp="?"+Ve,X2=`<${rp}>`,fn=document,Ar=()=>fn.createComment(""),Pr=n=>n===null||typeof n!="object"&&typeof n!="function",Ka=Array.isArray,Z2=n=>Ka(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",zo=`[
277
+ \f\r]`,tr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Yc=/-->/g,Xc=/>/g,tn=RegExp(`>|${zo}(?:([^\\s"'>=/]+)(${zo}*=${zo}*(?:[^
278
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Zc=/'/g,Jc=/"/g,ip=/^(?:script|style|textarea|title)$/i,J2=n=>(e,...r)=>({_$litType$:n,strings:e,values:r}),tt=J2(1),Wt=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),Qc=new WeakMap,on=fn.createTreeWalker(fn,129);function op(n,e){if(!Ka(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Wc!==void 0?Wc.createHTML(e):e}const Q2=(n,e)=>{const r=n.length-1,i=[];let o,s=e===2?"<svg>":e===3?"<math>":"",a=tr;for(let l=0;l<r;l++){const c=n[l];let u,h,d=-1,f=0;for(;f<c.length&&(a.lastIndex=f,h=a.exec(c),h!==null);)f=a.lastIndex,a===tr?h[1]==="!--"?a=Yc:h[1]!==void 0?a=Xc:h[2]!==void 0?(ip.test(h[2])&&(o=RegExp("</"+h[2],"g")),a=tn):h[3]!==void 0&&(a=tn):a===tn?h[0]===">"?(a=o??tr,d=-1):h[1]===void 0?d=-2:(d=a.lastIndex-h[2].length,u=h[1],a=h[3]===void 0?tn:h[3]==='"'?Jc:Zc):a===Jc||a===Zc?a=tn:a===Yc||a===Xc?a=tr:(a=tn,o=void 0);const p=a===tn&&n[l+1].startsWith("/>")?" ":"";s+=a===tr?c+X2:d>=0?(i.push(u),c.slice(0,d)+np+c.slice(d)+Ve+p):c+Ve+(d===-2?l:p)}return[op(n,s+(n[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class Sr{constructor({strings:e,_$litType$:r},i){let o;this.parts=[];let s=0,a=0;const l=e.length-1,c=this.parts,[u,h]=Q2(e,r);if(this.el=Sr.createElement(u,i),on.currentNode=this.el.content,r===2||r===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(o=on.nextNode())!==null&&c.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(const d of o.getAttributeNames())if(d.endsWith(np)){const f=h[a++],p=o.getAttribute(d).split(Ve),m=/([.?@])?(.*)/.exec(f);c.push({type:1,index:s,name:m[2],strings:p,ctor:m[1]==="."?eE:m[1]==="?"?nE:m[1]==="@"?rE:uo}),o.removeAttribute(d)}else d.startsWith(Ve)&&(c.push({type:6,index:s}),o.removeAttribute(d));if(ip.test(o.tagName)){const d=o.textContent.split(Ve),f=d.length-1;if(f>0){o.textContent=Yi?Yi.emptyScript:"";for(let p=0;p<f;p++)o.append(d[p],Ar()),on.nextNode(),c.push({type:2,index:++s});o.append(d[f],Ar())}}}else if(o.nodeType===8)if(o.data===rp)c.push({type:2,index:s});else{let d=-1;for(;(d=o.data.indexOf(Ve,d+1))!==-1;)c.push({type:7,index:s}),d+=Ve.length-1}s++}}static createElement(e,r){const i=fn.createElement("template");return i.innerHTML=e,i}}function Dn(n,e,r=n,i){var a,l;if(e===Wt)return e;let o=i!==void 0?(a=r._$Co)==null?void 0:a[i]:r._$Cl;const s=Pr(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==s&&((l=o==null?void 0:o._$AO)==null||l.call(o,!1),s===void 0?o=void 0:(o=new s(n),o._$AT(n,r,i)),i!==void 0?(r._$Co??(r._$Co=[]))[i]=o:r._$Cl=o),o!==void 0&&(e=Dn(n,o._$AS(n,e.values),o,i)),e}class tE{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:r},parts:i}=this._$AD,o=((e==null?void 0:e.creationScope)??fn).importNode(r,!0);on.currentNode=o;let s=on.nextNode(),a=0,l=0,c=i[0];for(;c!==void 0;){if(a===c.index){let u;c.type===2?u=new Hr(s,s.nextSibling,this,e):c.type===1?u=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(u=new iE(s,this,e)),this._$AV.push(u),c=i[++l]}a!==(c==null?void 0:c.index)&&(s=on.nextNode(),a++)}return on.currentNode=fn,o}p(e){let r=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}}class Hr{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,r,i,o){this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Dn(this,e,r),Pr(e)?e===L||e==null||e===""?(this._$AH!==L&&this._$AR(),this._$AH=L):e!==this._$AH&&e!==Wt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Z2(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==L&&Pr(this._$AH)?this._$AA.nextSibling.data=e:this.T(fn.createTextNode(e)),this._$AH=e}$(e){var s;const{values:r,_$litType$:i}=e,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Sr.createElement(op(i.h,i.h[0]),this.options)),i);if(((s=this._$AH)==null?void 0:s._$AD)===o)this._$AH.p(r);else{const a=new tE(o,this),l=a.u(this.options);a.p(r),this.T(l),this._$AH=a}}_$AC(e){let r=Qc.get(e.strings);return r===void 0&&Qc.set(e.strings,r=new Sr(e)),r}k(e){Ka(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let i,o=0;for(const s of e)o===r.length?r.push(i=new Hr(this.O(Ar()),this.O(Ar()),this,this.options)):i=r[o],i._$AI(s),o++;o<r.length&&(this._$AR(i&&i._$AB.nextSibling,o),r.length=o)}_$AR(e=this._$AA.nextSibling,r){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,r);e!==this._$AB;){const o=Gc(e).nextSibling;Gc(e).remove(),e=o}}setConnected(e){var r;this._$AM===void 0&&(this._$Cv=e,(r=this._$AP)==null||r.call(this,e))}}class uo{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,i,o,s){this.type=1,this._$AH=L,this._$AN=void 0,this.element=e,this.name=r,this._$AM=o,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=L}_$AI(e,r=this,i,o){const s=this.strings;let a=!1;if(s===void 0)e=Dn(this,e,r,0),a=!Pr(e)||e!==this._$AH&&e!==Wt,a&&(this._$AH=e);else{const l=e;let c,u;for(e=s[0],c=0;c<s.length-1;c++)u=Dn(this,l[i+c],r,c),u===Wt&&(u=this._$AH[c]),a||(a=!Pr(u)||u!==this._$AH[c]),u===L?e=L:e!==L&&(e+=(u??"")+s[c+1]),this._$AH[c]=u}a&&!o&&this.j(e)}j(e){e===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class eE extends uo{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===L?void 0:e}}class nE extends uo{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==L)}}class rE extends uo{constructor(e,r,i,o,s){super(e,r,i,o,s),this.type=5}_$AI(e,r=this){if((e=Dn(this,e,r,0)??L)===Wt)return;const i=this._$AH,o=e===L&&i!==L||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==L&&(i===L||o);o&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r;typeof this._$AH=="function"?this._$AH.call(((r=this.options)==null?void 0:r.host)??this.element,e):this._$AH.handleEvent(e)}}class iE{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Dn(this,e)}}const No=fr.litHtmlPolyfillSupport;No==null||No(Sr,Hr),(fr.litHtmlVersions??(fr.litHtmlVersions=[])).push("3.3.2");const sp=(n,e,r)=>{const i=(r==null?void 0:r.renderBefore)??e;let o=i._$litPart$;if(o===void 0){const s=(r==null?void 0:r.renderBefore)??null;i._$litPart$=o=new Hr(e.insertBefore(Ar(),s),s,void 0,r??{})}return o._$AI(n),o};/**
279
+ * @license
280
+ * Copyright 2017 Google LLC
281
+ * SPDX-License-Identifier: BSD-3-Clause
282
+ */const ln=globalThis;let Nt=class extends kn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=sp(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Wt}};var lu;Nt._$litElement$=!0,Nt.finalized=!0,(lu=ln.litElementHydrateSupport)==null||lu.call(ln,{LitElement:Nt});const Fo=ln.litElementPolyfillSupport;Fo==null||Fo({LitElement:Nt});(ln.litElementVersions??(ln.litElementVersions=[])).push("4.2.2");/**
283
+ * @license
284
+ * Copyright 2023 Google LLC
285
+ * SPDX-License-Identifier: Apache-2.0
286
+ */const ap=Symbol("attachableController");let Ei;Ei=new MutationObserver(n=>{var e;for(const r of n)(e=r.target[ap])==null||e.hostConnected()});class lp{get htmlFor(){return this.host.getAttribute("for")}set htmlFor(e){e===null?this.host.removeAttribute("for"):this.host.setAttribute("for",e)}get control(){return this.host.hasAttribute("for")?!this.htmlFor||!this.host.isConnected?null:this.host.getRootNode().querySelector(`#${this.htmlFor}`):this.currentControl||this.host.parentElement}set control(e){e?this.attach(e):this.detach()}constructor(e,r){this.host=e,this.onControlChange=r,this.currentControl=null,e.addController(this),e[ap]=this,Ei==null||Ei.observe(e,{attributeFilter:["for"]})}attach(e){e!==this.currentControl&&(this.setCurrentControl(e),this.host.removeAttribute("for"))}detach(){this.setCurrentControl(null),this.host.setAttribute("for","")}hostConnected(){this.setCurrentControl(this.control)}hostDisconnected(){this.setCurrentControl(null)}setCurrentControl(e){this.onControlChange(this.currentControl,e),this.currentControl=e}}/**
287
+ * @license
288
+ * Copyright 2021 Google LLC
289
+ * SPDX-License-Identifier: Apache-2.0
290
+ */const oE=["focusin","focusout","pointerdown"];class Ga extends Nt{constructor(){super(...arguments),this.visible=!1,this.inward=!1,this.attachableController=new lp(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(e){this.attachableController.htmlFor=e}get control(){return this.attachableController.control}set control(e){this.attachableController.control=e}attach(e){this.attachableController.attach(e)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}handleEvent(e){var r;if(!e[tu]){switch(e.type){default:return;case"focusin":this.visible=((r=this.control)==null?void 0:r.matches(":focus-visible"))??!1;break;case"focusout":case"pointerdown":this.visible=!1;break}e[tu]=!0}}onControlChange(e,r){for(const i of oE)e==null||e.removeEventListener(i,this),r==null||r.addEventListener(i,this)}update(e){e.has("visible")&&this.dispatchEvent(new Event("visibility-changed")),super.update(e)}}$([j({type:Boolean,reflect:!0})],Ga.prototype,"visible",void 0);$([j({type:Boolean,reflect:!0})],Ga.prototype,"inward",void 0);const tu=Symbol("handledByFocusRing");/**
291
+ * @license
292
+ * Copyright 2024 Google LLC
293
+ * SPDX-License-Identifier: Apache-2.0
294
+ */const sE=Mt`:host{animation-delay:0s,calc(var(--md-focus-ring-duration, 600ms)*.25);animation-duration:calc(var(--md-focus-ring-duration, 600ms)*.25),calc(var(--md-focus-ring-duration, 600ms)*.75);animation-timing-function:cubic-bezier(0.2, 0, 0, 1);box-sizing:border-box;color:var(--md-focus-ring-color, var(--md-sys-color-secondary, #625b71));display:none;pointer-events:none;position:absolute}:host([visible]){display:flex}:host(:not([inward])){animation-name:outward-grow,outward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));inset:calc(-1*var(--md-focus-ring-outward-offset, 2px));outline:var(--md-focus-ring-width, 3px) solid currentColor}:host([inward]){animation-name:inward-grow,inward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border:var(--md-focus-ring-width, 3px) solid currentColor;inset:var(--md-focus-ring-inward-offset, 0px)}@keyframes outward-grow{from{outline-width:0}to{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes outward-shrink{from{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-grow{from{border-width:0}to{border-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-shrink{from{border-width:var(--md-focus-ring-active-width, 8px)}}@media(prefers-reduced-motion){:host{animation:none}}
295
+ `;/**
296
+ * @license
297
+ * Copyright 2021 Google LLC
298
+ * SPDX-License-Identifier: Apache-2.0
299
+ */let $s=class extends Ga{};$s.styles=[sE];$s=$([de("md-focus-ring")],$s);/**
300
+ * @license
301
+ * Copyright 2017 Google LLC
302
+ * SPDX-License-Identifier: BSD-3-Clause
303
+ */const Fe={ATTRIBUTE:1,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Wa=n=>(...e)=>({_$litDirective$:n,values:e});let Ya=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};/**
304
+ * @license
305
+ * Copyright 2018 Google LLC
306
+ * SPDX-License-Identifier: BSD-3-Clause
307
+ */const Rn=Wa(class extends Ya{constructor(n){var e;if(super(n),n.type!==Fe.ATTRIBUTE||n.name!=="class"||((e=n.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(n){return" "+Object.keys(n).filter(e=>n[e]).join(" ")+" "}update(n,[e]){var i,o;if(this.st===void 0){this.st=new Set,n.strings!==void 0&&(this.nt=new Set(n.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!((i=this.nt)!=null&&i.has(s))&&this.st.add(s);return this.render(e)}const r=n.element.classList;for(const s of this.st)s in e||(r.remove(s),this.st.delete(s));for(const s in e){const a=!!e[s];a===this.st.has(s)||(o=this.nt)!=null&&o.has(s)||(a?(r.add(s),this.st.add(s)):(r.remove(s),this.st.delete(s)))}return Wt}});/**
308
+ * @license
309
+ * Copyright 2021 Google LLC
310
+ * SPDX-License-Identifier: Apache-2.0
311
+ */const cp={STANDARD:"cubic-bezier(0.2, 0, 0, 1)"};/**
312
+ * @license
313
+ * Copyright 2022 Google LLC
314
+ * SPDX-License-Identifier: Apache-2.0
315
+ */const aE=450,eu=225,lE=.2,cE=10,uE=75,dE=.35,hE="::after",pE="forwards";var xt;(function(n){n[n.INACTIVE=0]="INACTIVE",n[n.TOUCH_DELAY=1]="TOUCH_DELAY",n[n.HOLDING=2]="HOLDING",n[n.WAITING_FOR_CLICK=3]="WAITING_FOR_CLICK"})(xt||(xt={}));const fE=["click","contextmenu","pointercancel","pointerdown","pointerenter","pointerleave","pointerup"],vE=150,Vo=window.matchMedia("(forced-colors: active)");class qr extends Nt{constructor(){super(...arguments),this.disabled=!1,this.hovered=!1,this.pressed=!1,this.rippleSize="",this.rippleScale="",this.initialSize=0,this.state=xt.INACTIVE,this.attachableController=new lp(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(e){this.attachableController.htmlFor=e}get control(){return this.attachableController.control}set control(e){this.attachableController.control=e}attach(e){this.attachableController.attach(e)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){const e={hovered:this.hovered,pressed:this.pressed};return tt`<div class="surface ${Rn(e)}"></div>`}update(e){e.has("disabled")&&this.disabled&&(this.hovered=!1,this.pressed=!1),super.update(e)}handlePointerenter(e){this.shouldReactToEvent(e)&&(this.hovered=!0)}handlePointerleave(e){this.shouldReactToEvent(e)&&(this.hovered=!1,this.state!==xt.INACTIVE&&this.endPressAnimation())}handlePointerup(e){if(this.shouldReactToEvent(e)){if(this.state===xt.HOLDING){this.state=xt.WAITING_FOR_CLICK;return}if(this.state===xt.TOUCH_DELAY){this.state=xt.WAITING_FOR_CLICK,this.startPressAnimation(this.rippleStartEvent);return}}}async handlePointerdown(e){if(this.shouldReactToEvent(e)){if(this.rippleStartEvent=e,!this.isTouch(e)){this.state=xt.WAITING_FOR_CLICK,this.startPressAnimation(e);return}this.state=xt.TOUCH_DELAY,await new Promise(r=>{setTimeout(r,vE)}),this.state===xt.TOUCH_DELAY&&(this.state=xt.HOLDING,this.startPressAnimation(e))}}handleClick(){if(!this.disabled){if(this.state===xt.WAITING_FOR_CLICK){this.endPressAnimation();return}this.state===xt.INACTIVE&&(this.startPressAnimation(),this.endPressAnimation())}}handlePointercancel(e){this.shouldReactToEvent(e)&&this.endPressAnimation()}handleContextmenu(){this.disabled||this.endPressAnimation()}determineRippleSize(){const{height:e,width:r}=this.getBoundingClientRect(),i=Math.max(e,r),o=Math.max(dE*i,uE),s=this.currentCSSZoom??1,a=Math.floor(i*lE/s),c=Math.sqrt(r**2+e**2)+cE;this.initialSize=a;const u=(c+o)/a;this.rippleScale=`${u/s}`,this.rippleSize=`${a}px`}getNormalizedPointerEventCoords(e){const{scrollX:r,scrollY:i}=window,{left:o,top:s}=this.getBoundingClientRect(),a=r+o,l=i+s,{pageX:c,pageY:u}=e,h=this.currentCSSZoom??1;return{x:(c-a)/h,y:(u-l)/h}}getTranslationCoordinates(e){const{height:r,width:i}=this.getBoundingClientRect(),o=this.currentCSSZoom??1,s={x:(i/o-this.initialSize)/2,y:(r/o-this.initialSize)/2};let a;return e instanceof PointerEvent?a=this.getNormalizedPointerEventCoords(e):a={x:i/o/2,y:r/o/2},a={x:a.x-this.initialSize/2,y:a.y-this.initialSize/2},{startPoint:a,endPoint:s}}startPressAnimation(e){var a;if(!this.mdRoot)return;this.pressed=!0,(a=this.growAnimation)==null||a.cancel(),this.determineRippleSize();const{startPoint:r,endPoint:i}=this.getTranslationCoordinates(e),o=`${r.x}px, ${r.y}px`,s=`${i.x}px, ${i.y}px`;this.growAnimation=this.mdRoot.animate({top:[0,0],left:[0,0],height:[this.rippleSize,this.rippleSize],width:[this.rippleSize,this.rippleSize],transform:[`translate(${o}) scale(1)`,`translate(${s}) scale(${this.rippleScale})`]},{pseudoElement:hE,duration:aE,easing:cp.STANDARD,fill:pE})}async endPressAnimation(){this.rippleStartEvent=void 0,this.state=xt.INACTIVE;const e=this.growAnimation;let r=1/0;if(typeof(e==null?void 0:e.currentTime)=="number"?r=e.currentTime:e!=null&&e.currentTime&&(r=e.currentTime.to("ms").value),r>=eu){this.pressed=!1;return}await new Promise(i=>{setTimeout(i,eu-r)}),this.growAnimation===e&&(this.pressed=!1)}shouldReactToEvent(e){if(this.disabled||!e.isPrimary||this.rippleStartEvent&&this.rippleStartEvent.pointerId!==e.pointerId)return!1;if(e.type==="pointerenter"||e.type==="pointerleave")return!this.isTouch(e);const r=e.buttons===1;return this.isTouch(e)||r}isTouch({pointerType:e}){return e==="touch"}async handleEvent(e){if(!(Vo!=null&&Vo.matches))switch(e.type){case"click":this.handleClick();break;case"contextmenu":this.handleContextmenu();break;case"pointercancel":this.handlePointercancel(e);break;case"pointerdown":await this.handlePointerdown(e);break;case"pointerenter":this.handlePointerenter(e);break;case"pointerleave":this.handlePointerleave(e);break;case"pointerup":this.handlePointerup(e);break}}onControlChange(e,r){for(const i of fE)e==null||e.removeEventListener(i,this),r==null||r.addEventListener(i,this)}}$([j({type:Boolean,reflect:!0})],qr.prototype,"disabled",void 0);$([he()],qr.prototype,"hovered",void 0);$([he()],qr.prototype,"pressed",void 0);$([bn(".surface")],qr.prototype,"mdRoot",void 0);/**
316
+ * @license
317
+ * Copyright 2024 Google LLC
318
+ * SPDX-License-Identifier: Apache-2.0
319
+ */const mE=Mt`:host{display:flex;margin:auto;pointer-events:none}:host([disabled]){display:none}@media(forced-colors: active){:host{display:none}}:host,.surface{border-radius:inherit;position:absolute;inset:0;overflow:hidden}.surface{-webkit-tap-highlight-color:rgba(0,0,0,0)}.surface::before,.surface::after{content:"";opacity:0;position:absolute}.surface::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));inset:0;transition:opacity 15ms linear,background-color 15ms linear}.surface::after{background:radial-gradient(closest-side, var(--md-ripple-pressed-color, var(--md-sys-color-on-surface, #1d1b20)) max(100% - 70px, 65%), transparent 100%);transform-origin:center center;transition:opacity 375ms linear}.hovered::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-ripple-hover-opacity, 0.08)}.pressed::after{opacity:var(--md-ripple-pressed-opacity, 0.12);transition-duration:105ms}
320
+ `;/**
321
+ * @license
322
+ * Copyright 2022 Google LLC
323
+ * SPDX-License-Identifier: Apache-2.0
324
+ */let Ts=class extends qr{};Ts.styles=[mE];Ts=$([de("md-ripple")],Ts);/**
325
+ * @license
326
+ * Copyright 2023 Google LLC
327
+ * SPDX-License-Identifier: Apache-2.0
328
+ */const up=["role","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"],gE=up.map(dp);function Bo(n){return gE.includes(n)}function dp(n){return n.replace("aria","aria-").replace(/Elements?/g,"").toLowerCase()}/**
329
+ * @license
330
+ * Copyright 2023 Google LLC
331
+ * SPDX-License-Identifier: Apache-2.0
332
+ */const ai=Symbol("privateIgnoreAttributeChangesFor");function Xa(n){var e;class r extends n{constructor(){super(...arguments),this[e]=new Set}attributeChangedCallback(o,s,a){if(!Bo(o)){super.attributeChangedCallback(o,s,a);return}if(this[ai].has(o))return;this[ai].add(o),this.removeAttribute(o),this[ai].delete(o);const l=Os(o);a===null?delete this.dataset[l]:this.dataset[l]=a,this.requestUpdate(Os(o),s)}getAttribute(o){return Bo(o)?super.getAttribute(Is(o)):super.getAttribute(o)}removeAttribute(o){super.removeAttribute(o),Bo(o)&&(super.removeAttribute(Is(o)),this.requestUpdate())}}return e=ai,bE(r),r}function bE(n){for(const e of up){const r=dp(e),i=Is(r),o=Os(r);n.createProperty(e,{attribute:r,noAccessor:!0}),n.createProperty(Symbol(i),{attribute:i,noAccessor:!0}),Object.defineProperty(n.prototype,e,{configurable:!0,enumerable:!0,get(){return this.dataset[o]??null},set(s){const a=this.dataset[o]??null;s!==a&&(s===null?delete this.dataset[o]:this.dataset[o]=s,this.requestUpdate(e,a))}})}}function Is(n){return`data-${n}`}function Os(n){return n.replace(/-\w/,e=>e[1].toUpperCase())}/**
333
+ * @license
334
+ * Copyright 2023 Google LLC
335
+ * SPDX-License-Identifier: Apache-2.0
336
+ */const wt=Symbol("internals"),Uo=Symbol("privateInternals");function Za(n){class e extends n{get[wt](){return this[Uo]||(this[Uo]=this.attachInternals()),this[Uo]}}return e}/**
337
+ * @license
338
+ * Copyright 2023 Google LLC
339
+ * SPDX-License-Identifier: Apache-2.0
340
+ */function hp(n){n.addInitializer(e=>{const r=e;r.addEventListener("click",async i=>{const{type:o,[wt]:s}=r,{form:a}=s;if(!(!a||o==="button")&&(await new Promise(l=>{setTimeout(l)}),!i.defaultPrevented)){if(o==="reset"){a.reset();return}a.addEventListener("submit",l=>{Object.defineProperty(l,"submitter",{configurable:!0,enumerable:!0,get:()=>r})},{capture:!0,once:!0}),s.setFormValue(r.value),a.requestSubmit()}})})}/**
341
+ * @license
342
+ * Copyright 2021 Google LLC
343
+ * SPDX-License-Identifier: Apache-2.0
344
+ */function _E(n){const e=new MouseEvent("click",{bubbles:!0});return n.dispatchEvent(e),e}function yE(n){return n.currentTarget!==n.target||n.composedPath()[0]!==n.target||n.target.disabled?!1:!xE(n)}function xE(n){const e=Ds;return e&&(n.preventDefault(),n.stopImmediatePropagation()),wE(),e}let Ds=!1;async function wE(){Ds=!0,await null,Ds=!1}/**
345
+ * @license
346
+ * Copyright 2019 Google LLC
347
+ * SPDX-License-Identifier: Apache-2.0
348
+ */const CE=Xa(Za(Nt));class bt extends CE{get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get form(){return this[wt].form}constructor(){super(),this.disabled=!1,this.softDisabled=!1,this.href="",this.download="",this.target="",this.trailingIcon=!1,this.hasIcon=!1,this.type="submit",this.value="",this.addEventListener("click",this.handleClick.bind(this))}focus(){var e;(e=this.buttonElement)==null||e.focus()}blur(){var e;(e=this.buttonElement)==null||e.blur()}render(){var o;const e=this.disabled||this.softDisabled,r=this.href?this.renderLink():this.renderButton(),i=this.href?"link":"button";return tt`
349
+ ${(o=this.renderElevationOrOutline)==null?void 0:o.call(this)}
350
+ <div class="background"></div>
351
+ <md-focus-ring part="focus-ring" for=${i}></md-focus-ring>
352
+ <md-ripple
353
+ part="ripple"
354
+ for=${i}
355
+ ?disabled="${e}"></md-ripple>
356
+ ${r}
357
+ `}renderButton(){const{ariaLabel:e,ariaHasPopup:r,ariaExpanded:i}=this;return tt`<button
358
+ id="button"
359
+ class="button"
360
+ ?disabled=${this.disabled}
361
+ aria-disabled=${this.softDisabled||L}
362
+ aria-label="${e||L}"
363
+ aria-haspopup="${r||L}"
364
+ aria-expanded="${i||L}">
365
+ ${this.renderContent()}
366
+ </button>`}renderLink(){const{ariaLabel:e,ariaHasPopup:r,ariaExpanded:i}=this;return tt`<a
367
+ id="link"
368
+ class="button"
369
+ aria-label="${e||L}"
370
+ aria-haspopup="${r||L}"
371
+ aria-expanded="${i||L}"
372
+ aria-disabled=${this.disabled||this.softDisabled||L}
373
+ tabindex="${this.disabled&&!this.softDisabled?-1:L}"
374
+ href=${this.href}
375
+ download=${this.download||L}
376
+ target=${this.target||L}
377
+ >${this.renderContent()}
378
+ </a>`}renderContent(){const e=tt`<slot
379
+ name="icon"
380
+ @slotchange="${this.handleSlotChange}"></slot>`;return tt`
381
+ <span class="touch"></span>
382
+ ${this.trailingIcon?L:e}
383
+ <span class="label"><slot></slot></span>
384
+ ${this.trailingIcon?e:L}
385
+ `}handleClick(e){if(this.softDisabled||this.disabled&&this.href){e.stopImmediatePropagation(),e.preventDefault();return}!yE(e)||!this.buttonElement||(this.focus(),_E(this.buttonElement))}handleSlotChange(){this.hasIcon=this.assignedIcons.length>0}}hp(bt);bt.formAssociated=!0;bt.shadowRootOptions={mode:"open",delegatesFocus:!0};$([j({type:Boolean,reflect:!0})],bt.prototype,"disabled",void 0);$([j({type:Boolean,attribute:"soft-disabled",reflect:!0})],bt.prototype,"softDisabled",void 0);$([j()],bt.prototype,"href",void 0);$([j()],bt.prototype,"download",void 0);$([j()],bt.prototype,"target",void 0);$([j({type:Boolean,attribute:"trailing-icon",reflect:!0})],bt.prototype,"trailingIcon",void 0);$([j({type:Boolean,attribute:"has-icon",reflect:!0})],bt.prototype,"hasIcon",void 0);$([j()],bt.prototype,"type",void 0);$([j({reflect:!0})],bt.prototype,"value",void 0);$([bn(".button")],bt.prototype,"buttonElement",void 0);$([co({slot:"icon",flatten:!0})],bt.prototype,"assignedIcons",void 0);/**
386
+ * @license
387
+ * Copyright 2021 Google LLC
388
+ * SPDX-License-Identifier: Apache-2.0
389
+ */class EE extends bt{renderElevationOrOutline(){return tt`<div class="outline"></div>`}}/**
390
+ * @license
391
+ * Copyright 2024 Google LLC
392
+ * SPDX-License-Identifier: Apache-2.0
393
+ */const kE=Mt`:host{--_container-height: var(--md-outlined-button-container-height, 40px);--_disabled-label-text-color: var(--md-outlined-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-button-disabled-label-text-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-button-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-button-disabled-outline-opacity, 0.12);--_focus-label-text-color: var(--md-outlined-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-label-text-color: var(--md-outlined-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-outlined-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-outlined-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-outlined-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-outlined-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-outlined-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-outlined-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-outlined-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_outline-color: var(--md-outlined-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-button-outline-width, 1px);--_pressed-label-text-color: var(--md-outlined-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-outline-color: var(--md-outlined-button-pressed-outline-color, var(--md-sys-color-outline, #79747e));--_pressed-state-layer-color: var(--md-outlined-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-outlined-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-outlined-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-outlined-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-outlined-button-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-icon-color: var(--md-outlined-button-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-color: var(--md-outlined-button-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-outlined-button-icon-size, 18px);--_pressed-icon-color: var(--md-outlined-button-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_container-shape-start-start: var(--md-outlined-button-container-shape-start-start, var(--md-outlined-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-outlined-button-container-shape-start-end, var(--md-outlined-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-outlined-button-container-shape-end-end, var(--md-outlined-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-outlined-button-container-shape-end-start, var(--md-outlined-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_leading-space: var(--md-outlined-button-leading-space, 24px);--_trailing-space: var(--md-outlined-button-trailing-space, 24px);--_with-leading-icon-leading-space: var(--md-outlined-button-with-leading-icon-leading-space, 16px);--_with-leading-icon-trailing-space: var(--md-outlined-button-with-leading-icon-trailing-space, 24px);--_with-trailing-icon-leading-space: var(--md-outlined-button-with-trailing-icon-leading-space, 24px);--_with-trailing-icon-trailing-space: var(--md-outlined-button-with-trailing-icon-trailing-space, 16px);--_container-color: none;--_disabled-container-color: none;--_disabled-container-opacity: 0}.outline{inset:0;border-style:solid;position:absolute;box-sizing:border-box;border-color:var(--_outline-color);border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}:host(:active) .outline{border-color:var(--_pressed-outline-color)}:host(:is([disabled],[soft-disabled])) .outline{border-color:var(--_disabled-outline-color);opacity:var(--_disabled-outline-opacity)}@media(forced-colors: active){:host(:is([disabled],[soft-disabled])) .background{border-color:GrayText}:host(:is([disabled],[soft-disabled])) .outline{opacity:1}}.outline,md-ripple{border-width:var(--_outline-width)}md-ripple{inline-size:calc(100% - 2*var(--_outline-width));block-size:calc(100% - 2*var(--_outline-width));border-style:solid;border-color:rgba(0,0,0,0)}
394
+ `;/**
395
+ * @license
396
+ * Copyright 2024 Google LLC
397
+ * SPDX-License-Identifier: Apache-2.0
398
+ */const Ja=Mt`:host{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end);box-sizing:border-box;cursor:pointer;display:inline-flex;gap:8px;min-height:var(--_container-height);outline:none;padding-block:calc((var(--_container-height) - max(var(--_label-text-line-height),var(--_icon-size)))/2);padding-inline-start:var(--_leading-space);padding-inline-end:var(--_trailing-space);place-content:center;place-items:center;position:relative;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);text-overflow:ellipsis;text-wrap:nowrap;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);vertical-align:top;--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host(:is([disabled],[soft-disabled])){cursor:default;pointer-events:none}.button{border-radius:inherit;cursor:inherit;display:inline-flex;align-items:center;justify-content:center;border:none;outline:none;-webkit-appearance:none;vertical-align:middle;background:rgba(0,0,0,0);text-decoration:none;min-width:calc(64px - var(--_leading-space) - var(--_trailing-space));width:100%;z-index:0;height:100%;font:inherit;color:var(--_label-text-color);padding:0;gap:inherit;text-transform:inherit}.button::-moz-focus-inner{padding:0;border:0}:host(:hover) .button{color:var(--_hover-label-text-color)}:host(:focus-within) .button{color:var(--_focus-label-text-color)}:host(:active) .button{color:var(--_pressed-label-text-color)}.background{background:var(--_container-color);border-radius:inherit;inset:0;position:absolute}.label{overflow:hidden}:is(.button,.label,.label slot),.label ::slotted(*){text-overflow:inherit}:host(:is([disabled],[soft-disabled])) .label{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}:host(:is([disabled],[soft-disabled])) .background{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}@media(forced-colors: active){.background{border:1px solid CanvasText}:host(:is([disabled],[soft-disabled])){--_disabled-icon-color: GrayText;--_disabled-icon-opacity: 1;--_disabled-container-opacity: 1;--_disabled-label-text-color: GrayText;--_disabled-label-text-opacity: 1}}:host([has-icon]:not([trailing-icon])){padding-inline-start:var(--_with-leading-icon-leading-space);padding-inline-end:var(--_with-leading-icon-trailing-space)}:host([has-icon][trailing-icon]){padding-inline-start:var(--_with-trailing-icon-leading-space);padding-inline-end:var(--_with-trailing-icon-trailing-space)}::slotted([slot=icon]){display:inline-flex;position:relative;writing-mode:horizontal-tb;fill:currentColor;flex-shrink:0;color:var(--_icon-color);font-size:var(--_icon-size);inline-size:var(--_icon-size);block-size:var(--_icon-size)}:host(:hover) ::slotted([slot=icon]){color:var(--_hover-icon-color)}:host(:focus-within) ::slotted([slot=icon]){color:var(--_focus-icon-color)}:host(:active) ::slotted([slot=icon]){color:var(--_pressed-icon-color)}:host(:is([disabled],[soft-disabled])) ::slotted([slot=icon]){color:var(--_disabled-icon-color);opacity:var(--_disabled-icon-opacity)}.touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) 0}:host([touch-target=none]) .touch{display:none}
399
+ `;/**
400
+ * @license
401
+ * Copyright 2021 Google LLC
402
+ * SPDX-License-Identifier: Apache-2.0
403
+ */let Rs=class extends EE{};Rs.styles=[Ja,kE];Rs=$([de("md-outlined-button")],Rs);/**
404
+ * @license
405
+ * Copyright 2022 Google LLC
406
+ * SPDX-License-Identifier: Apache-2.0
407
+ */class AE extends Nt{connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){return tt`<span class="shadow"></span>`}}/**
408
+ * @license
409
+ * Copyright 2024 Google LLC
410
+ * SPDX-License-Identifier: Apache-2.0
411
+ */const PE=Mt`:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-property:inherit;transition-timing-function:inherit}:host{display:flex;pointer-events:none;transition-property:box-shadow,opacity}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity;--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000))}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);opacity:.15}
412
+ `;/**
413
+ * @license
414
+ * Copyright 2022 Google LLC
415
+ * SPDX-License-Identifier: Apache-2.0
416
+ */let js=class extends AE{};js.styles=[PE];js=$([de("md-elevation")],js);/**
417
+ * @license
418
+ * Copyright 2021 Google LLC
419
+ * SPDX-License-Identifier: Apache-2.0
420
+ */class SE extends bt{renderElevationOrOutline(){return tt`<md-elevation part="elevation"></md-elevation>`}}/**
421
+ * @license
422
+ * Copyright 2024 Google LLC
423
+ * SPDX-License-Identifier: Apache-2.0
424
+ */const ME=Mt`:host{--_container-color: var(--md-filled-tonal-button-container-color, var(--md-sys-color-secondary-container, #e8def8));--_container-elevation: var(--md-filled-tonal-button-container-elevation, 0);--_container-height: var(--md-filled-tonal-button-container-height, 40px);--_container-shadow-color: var(--md-filled-tonal-button-container-shadow-color, var(--md-sys-color-shadow, #000));--_disabled-container-color: var(--md-filled-tonal-button-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-elevation: var(--md-filled-tonal-button-disabled-container-elevation, 0);--_disabled-container-opacity: var(--md-filled-tonal-button-disabled-container-opacity, 0.12);--_disabled-label-text-color: var(--md-filled-tonal-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-tonal-button-disabled-label-text-opacity, 0.38);--_focus-container-elevation: var(--md-filled-tonal-button-focus-container-elevation, 0);--_focus-label-text-color: var(--md-filled-tonal-button-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-container-elevation: var(--md-filled-tonal-button-hover-container-elevation, 1);--_hover-label-text-color: var(--md-filled-tonal-button-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-color: var(--md-filled-tonal-button-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-opacity: var(--md-filled-tonal-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-filled-tonal-button-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_label-text-font: var(--md-filled-tonal-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-filled-tonal-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-filled-tonal-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-filled-tonal-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-container-elevation: var(--md-filled-tonal-button-pressed-container-elevation, 0);--_pressed-label-text-color: var(--md-filled-tonal-button-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-color: var(--md-filled-tonal-button-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-opacity: var(--md-filled-tonal-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-filled-tonal-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-filled-tonal-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-filled-tonal-button-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-icon-color: var(--md-filled-tonal-button-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_icon-color: var(--md-filled-tonal-button-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_icon-size: var(--md-filled-tonal-button-icon-size, 18px);--_pressed-icon-color: var(--md-filled-tonal-button-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_container-shape-start-start: var(--md-filled-tonal-button-container-shape-start-start, var(--md-filled-tonal-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-filled-tonal-button-container-shape-start-end, var(--md-filled-tonal-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-filled-tonal-button-container-shape-end-end, var(--md-filled-tonal-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-filled-tonal-button-container-shape-end-start, var(--md-filled-tonal-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_leading-space: var(--md-filled-tonal-button-leading-space, 24px);--_trailing-space: var(--md-filled-tonal-button-trailing-space, 24px);--_with-leading-icon-leading-space: var(--md-filled-tonal-button-with-leading-icon-leading-space, 16px);--_with-leading-icon-trailing-space: var(--md-filled-tonal-button-with-leading-icon-trailing-space, 24px);--_with-trailing-icon-leading-space: var(--md-filled-tonal-button-with-trailing-icon-leading-space, 24px);--_with-trailing-icon-trailing-space: var(--md-filled-tonal-button-with-trailing-icon-trailing-space, 16px)}
425
+ `;/**
426
+ * @license
427
+ * Copyright 2024 Google LLC
428
+ * SPDX-License-Identifier: Apache-2.0
429
+ */const $E=Mt`md-elevation{transition-duration:280ms}:host(:is([disabled],[soft-disabled])) md-elevation{transition:none}md-elevation{--md-elevation-level: var(--_container-elevation);--md-elevation-shadow-color: var(--_container-shadow-color)}:host(:focus-within) md-elevation{--md-elevation-level: var(--_focus-container-elevation)}:host(:hover) md-elevation{--md-elevation-level: var(--_hover-container-elevation)}:host(:active) md-elevation{--md-elevation-level: var(--_pressed-container-elevation)}:host(:is([disabled],[soft-disabled])) md-elevation{--md-elevation-level: var(--_disabled-container-elevation)}
430
+ `;/**
431
+ * @license
432
+ * Copyright 2021 Google LLC
433
+ * SPDX-License-Identifier: Apache-2.0
434
+ */let Ls=class extends SE{};Ls.styles=[Ja,$E,ME];Ls=$([de("md-filled-tonal-button")],Ls);/**
435
+ * @license
436
+ * Copyright 2021 Google LLC
437
+ * SPDX-License-Identifier: Apache-2.0
438
+ */class TE extends bt{}/**
439
+ * @license
440
+ * Copyright 2024 Google LLC
441
+ * SPDX-License-Identifier: Apache-2.0
442
+ */const IE=Mt`:host{--_container-height: var(--md-text-button-container-height, 40px);--_disabled-label-text-color: var(--md-text-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-text-button-disabled-label-text-opacity, 0.38);--_focus-label-text-color: var(--md-text-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-label-text-color: var(--md-text-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-text-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-text-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-text-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-text-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-text-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-text-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-text-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-label-text-color: var(--md-text-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-text-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-text-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-text-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-text-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-text-button-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-icon-color: var(--md-text-button-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-color: var(--md-text-button-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-text-button-icon-size, 18px);--_pressed-icon-color: var(--md-text-button-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_container-shape-start-start: var(--md-text-button-container-shape-start-start, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-start-end: var(--md-text-button-container-shape-start-end, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-end: var(--md-text-button-container-shape-end-end, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_container-shape-end-start: var(--md-text-button-container-shape-end-start, var(--md-text-button-container-shape, var(--md-sys-shape-corner-full, 9999px)));--_leading-space: var(--md-text-button-leading-space, 12px);--_trailing-space: var(--md-text-button-trailing-space, 12px);--_with-leading-icon-leading-space: var(--md-text-button-with-leading-icon-leading-space, 12px);--_with-leading-icon-trailing-space: var(--md-text-button-with-leading-icon-trailing-space, 16px);--_with-trailing-icon-leading-space: var(--md-text-button-with-trailing-icon-leading-space, 16px);--_with-trailing-icon-trailing-space: var(--md-text-button-with-trailing-icon-trailing-space, 12px);--_container-color: none;--_disabled-container-color: none;--_disabled-container-opacity: 0}
443
+ `;/**
444
+ * @license
445
+ * Copyright 2021 Google LLC
446
+ * SPDX-License-Identifier: Apache-2.0
447
+ */let zs=class extends TE{};zs.styles=[Ja,IE];zs=$([de("md-text-button")],zs);/**
448
+ * @license
449
+ * Copyright 2022 Google LLC
450
+ * SPDX-License-Identifier: Apache-2.0
451
+ */class OE extends Nt{render(){return tt`<slot></slot>`}connectedCallback(){if(super.connectedCallback(),this.getAttribute("aria-hidden")==="false"){this.removeAttribute("aria-hidden");return}this.setAttribute("aria-hidden","true")}}/**
452
+ * @license
453
+ * Copyright 2024 Google LLC
454
+ * SPDX-License-Identifier: Apache-2.0
455
+ */const DE=Mt`:host{font-size:var(--md-icon-size, 24px);width:var(--md-icon-size, 24px);height:var(--md-icon-size, 24px);color:inherit;font-variation-settings:inherit;font-weight:400;font-family:var(--md-icon-font, Material Symbols Outlined);display:inline-flex;font-style:normal;place-items:center;place-content:center;line-height:1;overflow:hidden;letter-spacing:normal;text-transform:none;user-select:none;white-space:nowrap;word-wrap:normal;flex-shrink:0;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale}::slotted(svg){fill:currentColor}::slotted(*){height:100%;width:100%}
456
+ `;/**
457
+ * @license
458
+ * Copyright 2022 Google LLC
459
+ * SPDX-License-Identifier: Apache-2.0
460
+ */let Ns=class extends OE{};Ns.styles=[DE];Ns=$([de("md-icon")],Ns);/**
461
+ * @license
462
+ * Copyright 2020 Google LLC
463
+ * SPDX-License-Identifier: BSD-3-Clause
464
+ */const pp=Symbol.for(""),RE=n=>{if((n==null?void 0:n.r)===pp)return n==null?void 0:n._$litStatic$},Xi=(n,...e)=>({_$litStatic$:e.reduce((r,i,o)=>r+(s=>{if(s._$litStatic$!==void 0)return s._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${s}. Use 'unsafeStatic' to pass non-literal values, but
465
+ take care to ensure page security.`)})(i)+n[o+1],n[0]),r:pp}),nu=new Map,jE=n=>(e,...r)=>{const i=r.length;let o,s;const a=[],l=[];let c,u=0,h=!1;for(;u<i;){for(c=e[u];u<i&&(s=r[u],(o=RE(s))!==void 0);)c+=o+e[++u],h=!0;u!==i&&l.push(s),a.push(c),u++}if(u===i&&a.push(e[i]),h){const d=a.join("$$lit$$");(e=nu.get(d))===void 0&&(a.raw=a,nu.set(d,e=a)),r=l}return n(e,...r)},fp=jE(tt);/**
466
+ * @license
467
+ * Copyright 2022 Google LLC
468
+ * SPDX-License-Identifier: Apache-2.0
469
+ */function ru(n,e=!0){return e&&getComputedStyle(n).getPropertyValue("direction").trim()==="rtl"}/**
470
+ * @license
471
+ * Copyright 2018 Google LLC
472
+ * SPDX-License-Identifier: Apache-2.0
473
+ */const LE=Xa(Za(Nt));class yt extends LE{get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get form(){return this[wt].form}get labels(){return this[wt].labels}constructor(){super(),this.disabled=!1,this.softDisabled=!1,this.flipIconInRtl=!1,this.href="",this.download="",this.target="",this.ariaLabelSelected="",this.toggle=!1,this.selected=!1,this.type="submit",this.value="",this.flipIcon=ru(this,this.flipIconInRtl),this.addEventListener("click",this.handleClick.bind(this))}willUpdate(){this.href&&(this.disabled=!1,this.softDisabled=!1)}render(){const e=this.href?Xi`div`:Xi`button`,{ariaLabel:r,ariaHasPopup:i,ariaExpanded:o}=this,s=r&&this.ariaLabelSelected,a=this.toggle?this.selected:L;let l=L;return this.href||(l=s&&this.selected?this.ariaLabelSelected:r),fp`<${e}
474
+ class="icon-button ${Rn(this.getRenderClasses())}"
475
+ id="button"
476
+ aria-label="${l||L}"
477
+ aria-haspopup="${!this.href&&i||L}"
478
+ aria-expanded="${!this.href&&o||L}"
479
+ aria-pressed="${a}"
480
+ aria-disabled=${!this.href&&this.softDisabled||L}
481
+ ?disabled="${!this.href&&this.disabled}"
482
+ @click="${this.handleClickOnChild}">
483
+ ${this.renderFocusRing()}
484
+ ${this.renderRipple()}
485
+ ${this.selected?L:this.renderIcon()}
486
+ ${this.selected?this.renderSelectedIcon():L}
487
+ ${this.href?this.renderLink():this.renderTouchTarget()}
488
+ </${e}>`}renderLink(){const{ariaLabel:e}=this;return tt`
489
+ <a
490
+ class="link"
491
+ id="link"
492
+ href="${this.href}"
493
+ download="${this.download||L}"
494
+ target="${this.target||L}"
495
+ aria-label="${e||L}">
496
+ ${this.renderTouchTarget()}
497
+ </a>
498
+ `}getRenderClasses(){return{"flip-icon":this.flipIcon,selected:this.toggle&&this.selected}}renderIcon(){return tt`<span class="icon"><slot></slot></span>`}renderSelectedIcon(){return tt`<span class="icon icon--selected"
499
+ ><slot name="selected"><slot></slot></slot
500
+ ></span>`}renderTouchTarget(){return tt`<span class="touch"></span>`}renderFocusRing(){return tt`<md-focus-ring
501
+ part="focus-ring"
502
+ for=${this.href?"link":"button"}></md-focus-ring>`}renderRipple(){const e=!this.href&&(this.disabled||this.softDisabled);return tt`<md-ripple
503
+ for=${this.href?"link":L}
504
+ ?disabled="${e}"></md-ripple>`}connectedCallback(){this.flipIcon=ru(this,this.flipIconInRtl),super.connectedCallback()}handleClick(e){if(!this.href&&this.softDisabled){e.stopImmediatePropagation(),e.preventDefault();return}}async handleClickOnChild(e){await 0,!(!this.toggle||this.disabled||this.softDisabled||e.defaultPrevented)&&(this.selected=!this.selected,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))}}hp(yt);yt.formAssociated=!0;yt.shadowRootOptions={mode:"open",delegatesFocus:!0};$([j({type:Boolean,reflect:!0})],yt.prototype,"disabled",void 0);$([j({type:Boolean,attribute:"soft-disabled",reflect:!0})],yt.prototype,"softDisabled",void 0);$([j({type:Boolean,attribute:"flip-icon-in-rtl"})],yt.prototype,"flipIconInRtl",void 0);$([j()],yt.prototype,"href",void 0);$([j()],yt.prototype,"download",void 0);$([j()],yt.prototype,"target",void 0);$([j({attribute:"aria-label-selected"})],yt.prototype,"ariaLabelSelected",void 0);$([j({type:Boolean})],yt.prototype,"toggle",void 0);$([j({type:Boolean,reflect:!0})],yt.prototype,"selected",void 0);$([j()],yt.prototype,"type",void 0);$([j({reflect:!0})],yt.prototype,"value",void 0);$([he()],yt.prototype,"flipIcon",void 0);/**
505
+ * @license
506
+ * Copyright 2024 Google LLC
507
+ * SPDX-License-Identifier: Apache-2.0
508
+ */const zE=Mt`:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);height:var(--_container-height);width:var(--_container-width);justify-content:center}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) max(0px,(48px - var(--_container-width))/2)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host(:is([disabled],[soft-disabled])){pointer-events:none}.icon-button{place-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:flex;place-content:center;outline:none;padding:0;position:relative;text-decoration:none;user-select:none;z-index:0;flex:1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.icon ::slotted(*){font-size:var(--_icon-size);height:var(--_icon-size);width:var(--_icon-size);font-weight:inherit}md-ripple{z-index:-1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.flip-icon .icon{transform:scaleX(-1)}.icon{display:inline-flex}.link{display:grid;height:100%;outline:none;place-items:center;position:absolute;width:100%}.touch{position:absolute;height:max(48px,100%);width:max(48px,100%)}:host([touch-target=none]) .touch{display:none}@media(forced-colors: active){:host(:is([disabled],[soft-disabled])){--_disabled-icon-color: GrayText;--_disabled-icon-opacity: 1}}
509
+ `;/**
510
+ * @license
511
+ * Copyright 2024 Google LLC
512
+ * SPDX-License-Identifier: Apache-2.0
513
+ */const NE=Mt`:host{--_disabled-icon-color: var(--md-icon-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-icon-button-disabled-icon-opacity, 0.38);--_icon-size: var(--md-icon-button-icon-size, 24px);--_selected-focus-icon-color: var(--md-icon-button-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-icon-color: var(--md-icon-button-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-color: var(--md-icon-button-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-icon-button-selected-hover-state-layer-opacity, 0.08);--_selected-icon-color: var(--md-icon-button-selected-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-icon-color: var(--md-icon-button-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-color: var(--md-icon-button-selected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-opacity: var(--md-icon-button-selected-pressed-state-layer-opacity, 0.12);--_state-layer-height: var(--md-icon-button-state-layer-height, 40px);--_state-layer-shape: var(--md-icon-button-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));--_state-layer-width: var(--md-icon-button-state-layer-width, 40px);--_focus-icon-color: var(--md-icon-button-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-icon-color: var(--md-icon-button-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-icon-button-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-opacity: var(--md-icon-button-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-icon-button-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-icon-color: var(--md-icon-button-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-color: var(--md-icon-button-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-opacity: var(--md-icon-button-pressed-state-layer-opacity, 0.12);--_container-shape-start-start: 0;--_container-shape-start-end: 0;--_container-shape-end-end: 0;--_container-shape-end-start: 0;--_container-height: 0;--_container-width: 0;height:var(--_state-layer-height);width:var(--_state-layer-width)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_state-layer-height))/2) max(0px,(48px - var(--_state-layer-width))/2)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_state-layer-shape);--md-focus-ring-shape-start-end: var(--_state-layer-shape);--md-focus-ring-shape-end-end: var(--_state-layer-shape);--md-focus-ring-shape-end-start: var(--_state-layer-shape)}.standard{background-color:rgba(0,0,0,0);color:var(--_icon-color);--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}.standard:hover{color:var(--_hover-icon-color)}.standard:focus{color:var(--_focus-icon-color)}.standard:active{color:var(--_pressed-icon-color)}.standard:is(:disabled,[aria-disabled=true]){color:var(--_disabled-icon-color)}md-ripple{border-radius:var(--_state-layer-shape)}.standard:is(:disabled,[aria-disabled=true]){opacity:var(--_disabled-icon-opacity)}.selected:not(:disabled,[aria-disabled=true]){color:var(--_selected-icon-color)}.selected:not(:disabled,[aria-disabled=true]):hover{color:var(--_selected-hover-icon-color)}.selected:not(:disabled,[aria-disabled=true]):focus{color:var(--_selected-focus-icon-color)}.selected:not(:disabled,[aria-disabled=true]):active{color:var(--_selected-pressed-icon-color)}.selected{--md-ripple-hover-color: var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity: var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-color: var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_selected-pressed-state-layer-opacity)}
514
+ `;/**
515
+ * @license
516
+ * Copyright 2021 Google LLC
517
+ * SPDX-License-Identifier: Apache-2.0
518
+ */let Fs=class extends yt{getRenderClasses(){return{...super.getRenderClasses(),standard:!0}}};Fs.styles=[zE,NE];Fs=$([de("md-icon-button")],Fs);/**
519
+ * @license
520
+ * Copyright 2021 Google LLC
521
+ * SPDX-License-Identifier: Apache-2.0
522
+ */class dt extends Nt{constructor(){super(...arguments),this.disabled=!1,this.error=!1,this.focused=!1,this.label="",this.noAsterisk=!1,this.populated=!1,this.required=!1,this.resizable=!1,this.supportingText="",this.errorText="",this.count=-1,this.max=-1,this.hasStart=!1,this.hasEnd=!1,this.isAnimating=!1,this.refreshErrorAlert=!1,this.disableTransitions=!1}get counterText(){const e=this.count??-1,r=this.max??-1;return e<0||r<=0?"":`${e} / ${r}`}get supportingOrErrorText(){return this.error&&this.errorText?this.errorText:this.supportingText}reannounceError(){this.refreshErrorAlert=!0}update(e){e.has("disabled")&&e.get("disabled")!==void 0&&(this.disableTransitions=!0),this.disabled&&this.focused&&(e.set("focused",!0),this.focused=!1),this.animateLabelIfNeeded({wasFocused:e.get("focused"),wasPopulated:e.get("populated")}),super.update(e)}render(){var s,a,l,c;const e=this.renderLabel(!0),r=this.renderLabel(!1),i=(s=this.renderOutline)==null?void 0:s.call(this,e),o={disabled:this.disabled,"disable-transitions":this.disableTransitions,error:this.error&&!this.disabled,focused:this.focused,"with-start":this.hasStart,"with-end":this.hasEnd,populated:this.populated,resizable:this.resizable,required:this.required,"no-label":!this.label};return tt`
523
+ <div class="field ${Rn(o)}">
524
+ <div class="container-overflow">
525
+ ${(a=this.renderBackground)==null?void 0:a.call(this)}
526
+ <slot name="container"></slot>
527
+ ${(l=this.renderStateLayer)==null?void 0:l.call(this)} ${(c=this.renderIndicator)==null?void 0:c.call(this)} ${i}
528
+ <div class="container">
529
+ <div class="start">
530
+ <slot name="start"></slot>
531
+ </div>
532
+ <div class="middle">
533
+ <div class="label-wrapper">
534
+ ${r} ${i?L:e}
535
+ </div>
536
+ <div class="content">
537
+ <slot></slot>
538
+ </div>
539
+ </div>
540
+ <div class="end">
541
+ <slot name="end"></slot>
542
+ </div>
543
+ </div>
544
+ </div>
545
+ ${this.renderSupportingText()}
546
+ </div>
547
+ `}updated(e){(e.has("supportingText")||e.has("errorText")||e.has("count")||e.has("max"))&&this.updateSlottedAriaDescribedBy(),this.refreshErrorAlert&&requestAnimationFrame(()=>{this.refreshErrorAlert=!1}),this.disableTransitions&&requestAnimationFrame(()=>{this.disableTransitions=!1})}renderSupportingText(){const{supportingOrErrorText:e,counterText:r}=this;if(!e&&!r)return L;const i=tt`<span>${e}</span>`,o=r?tt`<span class="counter">${r}</span>`:L,a=this.error&&this.errorText&&!this.refreshErrorAlert?"alert":L;return tt`
548
+ <div class="supporting-text" role=${a}>${i}${o}</div>
549
+ <slot
550
+ name="aria-describedby"
551
+ @slotchange=${this.updateSlottedAriaDescribedBy}></slot>
552
+ `}updateSlottedAriaDescribedBy(){for(const e of this.slottedAriaDescribedBy)sp(tt`${this.supportingOrErrorText} ${this.counterText}`,e),e.setAttribute("hidden","")}renderLabel(e){if(!this.label)return L;let r;e?r=this.focused||this.populated||this.isAnimating:r=!this.focused&&!this.populated&&!this.isAnimating;const i={hidden:!r,floating:e,resting:!e},o=`${this.label}${this.required&&!this.noAsterisk?"*":""}`;return tt`
553
+ <span class="label ${Rn(i)}" aria-hidden=${!r}
554
+ >${o}</span
555
+ >
556
+ `}animateLabelIfNeeded({wasFocused:e,wasPopulated:r}){var s,a,l;if(!this.label)return;e??(e=this.focused),r??(r=this.populated);const i=e||r,o=this.focused||this.populated;i!==o&&(this.isAnimating=!0,(s=this.labelAnimation)==null||s.cancel(),this.labelAnimation=(a=this.floatingLabelEl)==null?void 0:a.animate(this.getLabelKeyframes(),{duration:150,easing:cp.STANDARD}),(l=this.labelAnimation)==null||l.addEventListener("finish",()=>{this.isAnimating=!1}))}getLabelKeyframes(){const{floatingLabelEl:e,restingLabelEl:r}=this;if(!e||!r)return[];const{x:i,y:o,height:s}=e.getBoundingClientRect(),{x:a,y:l,height:c}=r.getBoundingClientRect(),u=e.scrollWidth,h=r.scrollWidth,d=h/u,f=a-i,p=l-o+Math.round((c-s*d)/2),m=`translateX(${f}px) translateY(${p}px) scale(${d})`,b="translateX(0) translateY(0) scale(1)",g=r.clientWidth,x=h>g?`${g/d}px`:"";return this.focused||this.populated?[{transform:m,width:x},{transform:b,width:x}]:[{transform:b,width:x},{transform:m,width:x}]}getSurfacePositionClientRect(){return this.containerEl.getBoundingClientRect()}}$([j({type:Boolean})],dt.prototype,"disabled",void 0);$([j({type:Boolean})],dt.prototype,"error",void 0);$([j({type:Boolean})],dt.prototype,"focused",void 0);$([j()],dt.prototype,"label",void 0);$([j({type:Boolean,attribute:"no-asterisk"})],dt.prototype,"noAsterisk",void 0);$([j({type:Boolean})],dt.prototype,"populated",void 0);$([j({type:Boolean})],dt.prototype,"required",void 0);$([j({type:Boolean})],dt.prototype,"resizable",void 0);$([j({attribute:"supporting-text"})],dt.prototype,"supportingText",void 0);$([j({attribute:"error-text"})],dt.prototype,"errorText",void 0);$([j({type:Number})],dt.prototype,"count",void 0);$([j({type:Number})],dt.prototype,"max",void 0);$([j({type:Boolean,attribute:"has-start"})],dt.prototype,"hasStart",void 0);$([j({type:Boolean,attribute:"has-end"})],dt.prototype,"hasEnd",void 0);$([co({slot:"aria-describedby"})],dt.prototype,"slottedAriaDescribedBy",void 0);$([he()],dt.prototype,"isAnimating",void 0);$([he()],dt.prototype,"refreshErrorAlert",void 0);$([he()],dt.prototype,"disableTransitions",void 0);$([bn(".label.floating")],dt.prototype,"floatingLabelEl",void 0);$([bn(".label.resting")],dt.prototype,"restingLabelEl",void 0);$([bn(".container")],dt.prototype,"containerEl",void 0);/**
557
+ * @license
558
+ * Copyright 2021 Google LLC
559
+ * SPDX-License-Identifier: Apache-2.0
560
+ */class FE extends dt{renderOutline(e){return tt`
561
+ <div class="outline">
562
+ <div class="outline-start"></div>
563
+ <div class="outline-notch">
564
+ <div class="outline-panel-inactive"></div>
565
+ <div class="outline-panel-active"></div>
566
+ <div class="outline-label">${e}</div>
567
+ </div>
568
+ <div class="outline-end"></div>
569
+ </div>
570
+ `}}/**
571
+ * @license
572
+ * Copyright 2024 Google LLC
573
+ * SPDX-License-Identifier: Apache-2.0
574
+ */const VE=Mt`@layer styles{:host{--_bottom-space: var(--md-outlined-field-bottom-space, 16px);--_content-color: var(--md-outlined-field-content-color, var(--md-sys-color-on-surface, #1d1b20));--_content-font: var(--md-outlined-field-content-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_content-line-height: var(--md-outlined-field-content-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_content-size: var(--md-outlined-field-content-size, var(--md-sys-typescale-body-large-size, 1rem));--_content-space: var(--md-outlined-field-content-space, 16px);--_content-weight: var(--md-outlined-field-content-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_disabled-content-color: var(--md-outlined-field-disabled-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-content-opacity: var(--md-outlined-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-outlined-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-content-opacity: var(--md-outlined-field-disabled-leading-content-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-field-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-field-disabled-outline-opacity, 0.12);--_disabled-outline-width: var(--md-outlined-field-disabled-outline-width, 1px);--_disabled-supporting-text-color: var(--md-outlined-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-outlined-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-outlined-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-content-opacity: var(--md-outlined-field-disabled-trailing-content-opacity, 0.38);--_error-content-color: var(--md-outlined-field-error-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-content-color: var(--md-outlined-field-error-focus-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-label-text-color: var(--md-outlined-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-outlined-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-outline-color: var(--md-outlined-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_error-focus-supporting-text-color: var(--md-outlined-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-outlined-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-content-color: var(--md-outlined-field-error-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-outlined-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-outlined-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-outline-color: var(--md-outlined-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-supporting-text-color: var(--md-outlined-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-outlined-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-outlined-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-outlined-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-outline-color: var(--md-outlined-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_error-supporting-text-color: var(--md-outlined-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-outlined-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-content-color: var(--md-outlined-field-focus-content-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-outlined-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-outlined-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-outline-color: var(--md-outlined-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-width: var(--md-outlined-field-focus-outline-width, 3px);--_focus-supporting-text-color: var(--md-outlined-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-outlined-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-content-color: var(--md-outlined-field-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-outlined-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-leading-content-color: var(--md-outlined-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-outline-color: var(--md-outlined-field-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-outline-width: var(--md-outlined-field-hover-outline-width, 1px);--_hover-supporting-text-color: var(--md-outlined-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-outlined-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-outlined-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-outlined-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-outlined-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_label-text-padding-bottom: var(--md-outlined-field-label-text-padding-bottom, 8px);--_label-text-populated-line-height: var(--md-outlined-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_label-text-populated-size: var(--md-outlined-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_label-text-size: var(--md-outlined-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_label-text-weight: var(--md-outlined-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_leading-content-color: var(--md-outlined-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-space: var(--md-outlined-field-leading-space, 16px);--_outline-color: var(--md-outlined-field-outline-color, var(--md-sys-color-outline, #79747e));--_outline-label-padding: var(--md-outlined-field-outline-label-padding, 4px);--_outline-width: var(--md-outlined-field-outline-width, 1px);--_supporting-text-color: var(--md-outlined-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-outlined-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_supporting-text-leading-space: var(--md-outlined-field-supporting-text-leading-space, 16px);--_supporting-text-line-height: var(--md-outlined-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_supporting-text-size: var(--md-outlined-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_supporting-text-top-space: var(--md-outlined-field-supporting-text-top-space, 4px);--_supporting-text-trailing-space: var(--md-outlined-field-supporting-text-trailing-space, 16px);--_supporting-text-weight: var(--md-outlined-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_top-space: var(--md-outlined-field-top-space, 16px);--_trailing-content-color: var(--md-outlined-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-space: var(--md-outlined-field-trailing-space, 16px);--_with-leading-content-leading-space: var(--md-outlined-field-with-leading-content-leading-space, 12px);--_with-trailing-content-trailing-space: var(--md-outlined-field-with-trailing-content-trailing-space, 12px);--_container-shape-start-start: var(--md-outlined-field-container-shape-start-start, var(--md-outlined-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-start-end: var(--md-outlined-field-container-shape-start-end, var(--md-outlined-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-end-end: var(--md-outlined-field-container-shape-end-end, var(--md-outlined-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-end-start: var(--md-outlined-field-container-shape-end-start, var(--md-outlined-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)))}.outline{border-color:var(--_outline-color);border-radius:inherit;display:flex;pointer-events:none;height:100%;position:absolute;width:100%;z-index:1}.outline-start::before,.outline-start::after,.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after,.outline-end::before,.outline-end::after{border:inherit;content:"";inset:0;position:absolute}.outline-start,.outline-end{border:inherit;border-radius:inherit;box-sizing:border-box;position:relative}.outline-start::before,.outline-start::after,.outline-end::before,.outline-end::after{border-bottom-style:solid;border-top-style:solid}.outline-start::after,.outline-end::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .outline-start::after,.focused .outline-end::after{opacity:1}.outline-start::before,.outline-start::after{border-inline-start-style:solid;border-inline-end-style:none;border-start-start-radius:inherit;border-start-end-radius:0;border-end-start-radius:inherit;border-end-end-radius:0;margin-inline-end:var(--_outline-label-padding)}.outline-end{flex-grow:1;margin-inline-start:calc(-1*var(--_outline-label-padding))}.outline-end::before,.outline-end::after{border-inline-start-style:none;border-inline-end-style:solid;border-start-start-radius:0;border-start-end-radius:inherit;border-end-start-radius:0;border-end-end-radius:inherit}.outline-notch{align-items:flex-start;border:inherit;display:flex;margin-inline-start:calc(-1*var(--_outline-label-padding));margin-inline-end:var(--_outline-label-padding);max-width:calc(100% - var(--_leading-space) - var(--_trailing-space));padding:0 var(--_outline-label-padding);position:relative}.no-label .outline-notch{display:none}.outline-panel-inactive,.outline-panel-active{border:inherit;border-bottom-style:solid;inset:0;position:absolute}.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after{border-top-style:solid;border-bottom:none;bottom:auto;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.2, 0, 0, 1)}.outline-panel-inactive::before,.outline-panel-active::before{right:50%;transform-origin:top left}.outline-panel-inactive::after,.outline-panel-active::after{left:50%;transform-origin:top right}.populated .outline-panel-inactive::before,.populated .outline-panel-inactive::after,.populated .outline-panel-active::before,.populated .outline-panel-active::after,.focused .outline-panel-inactive::before,.focused .outline-panel-inactive::after,.focused .outline-panel-active::before,.focused .outline-panel-active::after{transform:scaleX(0)}.outline-panel-active{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .outline-panel-active{opacity:1}.outline-label{display:flex;max-width:100%;transform:translateY(calc(-100% + var(--_label-text-padding-bottom)))}.outline-start,.field:not(.with-start) .content ::slotted(*){padding-inline-start:max(var(--_leading-space),max(var(--_container-shape-start-start),var(--_container-shape-end-start)) + var(--_outline-label-padding))}.field:not(.with-start) .label-wrapper{margin-inline-start:max(var(--_leading-space),max(var(--_container-shape-start-start),var(--_container-shape-end-start)) + var(--_outline-label-padding))}.field:not(.with-end) .content ::slotted(*){padding-inline-end:max(var(--_trailing-space),max(var(--_container-shape-start-end),var(--_container-shape-end-end)))}.field:not(.with-end) .label-wrapper{margin-inline-end:max(var(--_trailing-space),max(var(--_container-shape-start-end),var(--_container-shape-end-end)))}.outline-start::before,.outline-end::before,.outline-panel-inactive,.outline-panel-inactive::before,.outline-panel-inactive::after{border-width:var(--_outline-width)}:hover .outline{border-color:var(--_hover-outline-color);color:var(--_hover-outline-color)}:hover .outline-start::before,:hover .outline-end::before,:hover .outline-panel-inactive,:hover .outline-panel-inactive::before,:hover .outline-panel-inactive::after{border-width:var(--_hover-outline-width)}.focused .outline{border-color:var(--_focus-outline-color);color:var(--_focus-outline-color)}.outline-start::after,.outline-end::after,.outline-panel-active,.outline-panel-active::before,.outline-panel-active::after{border-width:var(--_focus-outline-width)}.disabled .outline{border-color:var(--_disabled-outline-color);color:var(--_disabled-outline-color)}.disabled .outline-start,.disabled .outline-end,.disabled .outline-panel-inactive{opacity:var(--_disabled-outline-opacity)}.disabled .outline-start::before,.disabled .outline-end::before,.disabled .outline-panel-inactive,.disabled .outline-panel-inactive::before,.disabled .outline-panel-inactive::after{border-width:var(--_disabled-outline-width)}.error .outline{border-color:var(--_error-outline-color);color:var(--_error-outline-color)}.error:hover .outline{border-color:var(--_error-hover-outline-color);color:var(--_error-hover-outline-color)}.error.focused .outline{border-color:var(--_error-focus-outline-color);color:var(--_error-focus-outline-color)}.resizable .container{bottom:var(--_focus-outline-width);inset-inline-end:var(--_focus-outline-width);clip-path:inset(var(--_focus-outline-width) 0 0 var(--_focus-outline-width))}.resizable .container>*{top:var(--_focus-outline-width);inset-inline-start:var(--_focus-outline-width)}.resizable .container:dir(rtl){clip-path:inset(var(--_focus-outline-width) var(--_focus-outline-width) 0 0)}}@layer hcm{@media(forced-colors: active){.disabled .outline{border-color:GrayText;color:GrayText}.disabled :is(.outline-start,.outline-end,.outline-panel-inactive){opacity:1}}}
575
+ `;/**
576
+ * @license
577
+ * Copyright 2024 Google LLC
578
+ * SPDX-License-Identifier: Apache-2.0
579
+ */const BE=Mt`:host{display:inline-flex;resize:both}.field{display:flex;flex:1;flex-direction:column;writing-mode:horizontal-tb;max-width:100%}.container-overflow{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:flex;height:100%;position:relative}.container{align-items:center;border-radius:inherit;display:flex;flex:1;max-height:100%;min-height:100%;min-width:min-content;position:relative}.field,.container-overflow{resize:inherit}.resizable:not(.disabled) .container{resize:inherit;overflow:hidden}.disabled{pointer-events:none}slot[name=container]{border-radius:inherit}slot[name=container]::slotted(*){border-radius:inherit;inset:0;pointer-events:none;position:absolute}@layer styles{.start,.middle,.end{display:flex;box-sizing:border-box;height:100%;position:relative}.start{color:var(--_leading-content-color)}.end{color:var(--_trailing-content-color)}.start,.end{align-items:center;justify-content:center}.with-start .start{margin-inline:var(--_with-leading-content-leading-space) var(--_content-space)}.with-end .end{margin-inline:var(--_content-space) var(--_with-trailing-content-trailing-space)}.middle{align-items:stretch;align-self:baseline;flex:1}.content{color:var(--_content-color);display:flex;flex:1;opacity:0;transition:opacity 83ms cubic-bezier(0.2, 0, 0, 1)}.no-label .content,.focused .content,.populated .content{opacity:1;transition-delay:67ms}:is(.disabled,.disable-transitions) .content{transition:none}.content ::slotted(*){all:unset;color:currentColor;font-family:var(--_content-font);font-size:var(--_content-size);line-height:var(--_content-line-height);font-weight:var(--_content-weight);width:100%;overflow-wrap:revert;white-space:revert}.content ::slotted(:not(textarea)){padding-top:var(--_top-space);padding-bottom:var(--_bottom-space)}.content ::slotted(textarea){margin-top:var(--_top-space);margin-bottom:var(--_bottom-space)}:hover .content{color:var(--_hover-content-color)}:hover .start{color:var(--_hover-leading-content-color)}:hover .end{color:var(--_hover-trailing-content-color)}.focused .content{color:var(--_focus-content-color)}.focused .start{color:var(--_focus-leading-content-color)}.focused .end{color:var(--_focus-trailing-content-color)}.disabled .content{color:var(--_disabled-content-color)}.disabled.no-label .content,.disabled.focused .content,.disabled.populated .content{opacity:var(--_disabled-content-opacity)}.disabled .start{color:var(--_disabled-leading-content-color);opacity:var(--_disabled-leading-content-opacity)}.disabled .end{color:var(--_disabled-trailing-content-color);opacity:var(--_disabled-trailing-content-opacity)}.error .content{color:var(--_error-content-color)}.error .start{color:var(--_error-leading-content-color)}.error .end{color:var(--_error-trailing-content-color)}.error:hover .content{color:var(--_error-hover-content-color)}.error:hover .start{color:var(--_error-hover-leading-content-color)}.error:hover .end{color:var(--_error-hover-trailing-content-color)}.error.focused .content{color:var(--_error-focus-content-color)}.error.focused .start{color:var(--_error-focus-leading-content-color)}.error.focused .end{color:var(--_error-focus-trailing-content-color)}}@layer hcm{@media(forced-colors: active){.disabled :is(.start,.content,.end){color:GrayText;opacity:1}}}@layer styles{.label{box-sizing:border-box;color:var(--_label-text-color);overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap;z-index:1;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);width:min-content}.label-wrapper{inset:0;pointer-events:none;position:absolute}.label.resting{position:absolute;top:var(--_top-space)}.label.floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height);transform-origin:top left}.label.hidden{opacity:0}.no-label .label{display:none}.label-wrapper{inset:0;position:absolute;text-align:initial}:hover .label{color:var(--_hover-label-text-color)}.focused .label{color:var(--_focus-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color)}.disabled .label:not(.hidden){opacity:var(--_disabled-label-text-opacity)}.error .label{color:var(--_error-label-text-color)}.error:hover .label{color:var(--_error-hover-label-text-color)}.error.focused .label{color:var(--_error-focus-label-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .label:not(.hidden){color:GrayText;opacity:1}}}@layer styles{.supporting-text{color:var(--_supporting-text-color);display:flex;font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);gap:16px;justify-content:space-between;padding-inline-start:var(--_supporting-text-leading-space);padding-inline-end:var(--_supporting-text-trailing-space);padding-top:var(--_supporting-text-top-space)}.supporting-text :nth-child(2){flex-shrink:0}:hover .supporting-text{color:var(--_hover-supporting-text-color)}.focus .supporting-text{color:var(--_focus-supporting-text-color)}.disabled .supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.error .supporting-text{color:var(--_error-supporting-text-color)}.error:hover .supporting-text{color:var(--_error-hover-supporting-text-color)}.error.focus .supporting-text{color:var(--_error-focus-supporting-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .supporting-text{color:GrayText;opacity:1}}}
580
+ `;/**
581
+ * @license
582
+ * Copyright 2021 Google LLC
583
+ * SPDX-License-Identifier: Apache-2.0
584
+ */let Vs=class extends FE{};Vs.styles=[BE,VE];Vs=$([de("md-outlined-field")],Vs);/**
585
+ * @license
586
+ * Copyright 2024 Google LLC
587
+ * SPDX-License-Identifier: Apache-2.0
588
+ */const UE=Mt`:host{--_caret-color: var(--md-outlined-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_disabled-input-text-color: var(--md-outlined-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-input-text-opacity: var(--md-outlined-text-field-disabled-input-text-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-text-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-outlined-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-outlined-text-field-disabled-leading-icon-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-text-field-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-text-field-disabled-outline-opacity, 0.12);--_disabled-outline-width: var(--md-outlined-text-field-disabled-outline-width, 1px);--_disabled-supporting-text-color: var(--md-outlined-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-outlined-text-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-outlined-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-outlined-text-field-disabled-trailing-icon-opacity, 0.38);--_error-focus-caret-color: var(--md-outlined-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_error-focus-input-text-color: var(--md-outlined-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-label-text-color: var(--md-outlined-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-outlined-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-outline-color: var(--md-outlined-text-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_error-focus-supporting-text-color: var(--md-outlined-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-outlined-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-input-text-color: var(--md-outlined-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-outlined-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-outlined-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-outline-color: var(--md-outlined-text-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-supporting-text-color: var(--md-outlined-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-outlined-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-input-text-color: var(--md-outlined-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-label-text-color: var(--md-outlined-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-outlined-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-outline-color: var(--md-outlined-text-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_error-supporting-text-color: var(--md-outlined-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-outlined-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-input-text-color: var(--md-outlined-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-outlined-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-outlined-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-outline-color: var(--md-outlined-text-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-width: var(--md-outlined-text-field-focus-outline-width, 3px);--_focus-supporting-text-color: var(--md-outlined-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-outlined-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-input-text-color: var(--md-outlined-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-outlined-text-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-leading-icon-color: var(--md-outlined-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-outline-color: var(--md-outlined-text-field-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-outline-width: var(--md-outlined-text-field-hover-outline-width, 1px);--_hover-supporting-text-color: var(--md-outlined-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-outlined-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-color: var(--md-outlined-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_input-text-font: var(--md-outlined-text-field-input-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_input-text-line-height: var(--md-outlined-text-field-input-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_input-text-placeholder-color: var(--md-outlined-text-field-input-text-placeholder-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-prefix-color: var(--md-outlined-text-field-input-text-prefix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-size: var(--md-outlined-text-field-input-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_input-text-suffix-color: var(--md-outlined-text-field-input-text-suffix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-weight: var(--md-outlined-text-field-input-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_label-text-color: var(--md-outlined-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-outlined-text-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-outlined-text-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_label-text-populated-line-height: var(--md-outlined-text-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_label-text-populated-size: var(--md-outlined-text-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_label-text-size: var(--md-outlined-text-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_label-text-weight: var(--md-outlined-text-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_leading-icon-color: var(--md-outlined-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-outlined-text-field-leading-icon-size, 24px);--_outline-color: var(--md-outlined-text-field-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-text-field-outline-width, 1px);--_supporting-text-color: var(--md-outlined-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-outlined-text-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_supporting-text-line-height: var(--md-outlined-text-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_supporting-text-size: var(--md-outlined-text-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_supporting-text-weight: var(--md-outlined-text-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_trailing-icon-color: var(--md-outlined-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-outlined-text-field-trailing-icon-size, 24px);--_container-shape-start-start: var(--md-outlined-text-field-container-shape-start-start, var(--md-outlined-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-start-end: var(--md-outlined-text-field-container-shape-start-end, var(--md-outlined-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-end-end: var(--md-outlined-text-field-container-shape-end-end, var(--md-outlined-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_container-shape-end-start: var(--md-outlined-text-field-container-shape-end-start, var(--md-outlined-text-field-container-shape, var(--md-sys-shape-corner-extra-small, 4px)));--_icon-input-space: var(--md-outlined-text-field-icon-input-space, 16px);--_leading-space: var(--md-outlined-text-field-leading-space, 16px);--_trailing-space: var(--md-outlined-text-field-trailing-space, 16px);--_top-space: var(--md-outlined-text-field-top-space, 16px);--_bottom-space: var(--md-outlined-text-field-bottom-space, 16px);--_input-text-prefix-trailing-space: var(--md-outlined-text-field-input-text-prefix-trailing-space, 2px);--_input-text-suffix-leading-space: var(--md-outlined-text-field-input-text-suffix-leading-space, 2px);--_focus-caret-color: var(--md-outlined-text-field-focus-caret-color, var(--md-sys-color-primary, #6750a4));--_with-leading-icon-leading-space: var(--md-outlined-text-field-with-leading-icon-leading-space, 12px);--_with-trailing-icon-trailing-space: var(--md-outlined-text-field-with-trailing-icon-trailing-space, 12px);--md-outlined-field-bottom-space: var(--_bottom-space);--md-outlined-field-container-shape-end-end: var(--_container-shape-end-end);--md-outlined-field-container-shape-end-start: var(--_container-shape-end-start);--md-outlined-field-container-shape-start-end: var(--_container-shape-start-end);--md-outlined-field-container-shape-start-start: var(--_container-shape-start-start);--md-outlined-field-content-color: var(--_input-text-color);--md-outlined-field-content-font: var(--_input-text-font);--md-outlined-field-content-line-height: var(--_input-text-line-height);--md-outlined-field-content-size: var(--_input-text-size);--md-outlined-field-content-space: var(--_icon-input-space);--md-outlined-field-content-weight: var(--_input-text-weight);--md-outlined-field-disabled-content-color: var(--_disabled-input-text-color);--md-outlined-field-disabled-content-opacity: var(--_disabled-input-text-opacity);--md-outlined-field-disabled-label-text-color: var(--_disabled-label-text-color);--md-outlined-field-disabled-label-text-opacity: var(--_disabled-label-text-opacity);--md-outlined-field-disabled-leading-content-color: var(--_disabled-leading-icon-color);--md-outlined-field-disabled-leading-content-opacity: var(--_disabled-leading-icon-opacity);--md-outlined-field-disabled-outline-color: var(--_disabled-outline-color);--md-outlined-field-disabled-outline-opacity: var(--_disabled-outline-opacity);--md-outlined-field-disabled-outline-width: var(--_disabled-outline-width);--md-outlined-field-disabled-supporting-text-color: var(--_disabled-supporting-text-color);--md-outlined-field-disabled-supporting-text-opacity: var(--_disabled-supporting-text-opacity);--md-outlined-field-disabled-trailing-content-color: var(--_disabled-trailing-icon-color);--md-outlined-field-disabled-trailing-content-opacity: var(--_disabled-trailing-icon-opacity);--md-outlined-field-error-content-color: var(--_error-input-text-color);--md-outlined-field-error-focus-content-color: var(--_error-focus-input-text-color);--md-outlined-field-error-focus-label-text-color: var(--_error-focus-label-text-color);--md-outlined-field-error-focus-leading-content-color: var(--_error-focus-leading-icon-color);--md-outlined-field-error-focus-outline-color: var(--_error-focus-outline-color);--md-outlined-field-error-focus-supporting-text-color: var(--_error-focus-supporting-text-color);--md-outlined-field-error-focus-trailing-content-color: var(--_error-focus-trailing-icon-color);--md-outlined-field-error-hover-content-color: var(--_error-hover-input-text-color);--md-outlined-field-error-hover-label-text-color: var(--_error-hover-label-text-color);--md-outlined-field-error-hover-leading-content-color: var(--_error-hover-leading-icon-color);--md-outlined-field-error-hover-outline-color: var(--_error-hover-outline-color);--md-outlined-field-error-hover-supporting-text-color: var(--_error-hover-supporting-text-color);--md-outlined-field-error-hover-trailing-content-color: var(--_error-hover-trailing-icon-color);--md-outlined-field-error-label-text-color: var(--_error-label-text-color);--md-outlined-field-error-leading-content-color: var(--_error-leading-icon-color);--md-outlined-field-error-outline-color: var(--_error-outline-color);--md-outlined-field-error-supporting-text-color: var(--_error-supporting-text-color);--md-outlined-field-error-trailing-content-color: var(--_error-trailing-icon-color);--md-outlined-field-focus-content-color: var(--_focus-input-text-color);--md-outlined-field-focus-label-text-color: var(--_focus-label-text-color);--md-outlined-field-focus-leading-content-color: var(--_focus-leading-icon-color);--md-outlined-field-focus-outline-color: var(--_focus-outline-color);--md-outlined-field-focus-outline-width: var(--_focus-outline-width);--md-outlined-field-focus-supporting-text-color: var(--_focus-supporting-text-color);--md-outlined-field-focus-trailing-content-color: var(--_focus-trailing-icon-color);--md-outlined-field-hover-content-color: var(--_hover-input-text-color);--md-outlined-field-hover-label-text-color: var(--_hover-label-text-color);--md-outlined-field-hover-leading-content-color: var(--_hover-leading-icon-color);--md-outlined-field-hover-outline-color: var(--_hover-outline-color);--md-outlined-field-hover-outline-width: var(--_hover-outline-width);--md-outlined-field-hover-supporting-text-color: var(--_hover-supporting-text-color);--md-outlined-field-hover-trailing-content-color: var(--_hover-trailing-icon-color);--md-outlined-field-label-text-color: var(--_label-text-color);--md-outlined-field-label-text-font: var(--_label-text-font);--md-outlined-field-label-text-line-height: var(--_label-text-line-height);--md-outlined-field-label-text-populated-line-height: var(--_label-text-populated-line-height);--md-outlined-field-label-text-populated-size: var(--_label-text-populated-size);--md-outlined-field-label-text-size: var(--_label-text-size);--md-outlined-field-label-text-weight: var(--_label-text-weight);--md-outlined-field-leading-content-color: var(--_leading-icon-color);--md-outlined-field-leading-space: var(--_leading-space);--md-outlined-field-outline-color: var(--_outline-color);--md-outlined-field-outline-width: var(--_outline-width);--md-outlined-field-supporting-text-color: var(--_supporting-text-color);--md-outlined-field-supporting-text-font: var(--_supporting-text-font);--md-outlined-field-supporting-text-line-height: var(--_supporting-text-line-height);--md-outlined-field-supporting-text-size: var(--_supporting-text-size);--md-outlined-field-supporting-text-weight: var(--_supporting-text-weight);--md-outlined-field-top-space: var(--_top-space);--md-outlined-field-trailing-content-color: var(--_trailing-icon-color);--md-outlined-field-trailing-space: var(--_trailing-space);--md-outlined-field-with-leading-content-leading-space: var(--_with-leading-icon-leading-space);--md-outlined-field-with-trailing-content-trailing-space: var(--_with-trailing-icon-trailing-space)}
589
+ `;/**
590
+ * @license
591
+ * Copyright 2020 Google LLC
592
+ * SPDX-License-Identifier: BSD-3-Clause
593
+ */const HE=n=>n.strings===void 0,qE={},KE=(n,e=qE)=>n._$AH=e;/**
594
+ * @license
595
+ * Copyright 2020 Google LLC
596
+ * SPDX-License-Identifier: BSD-3-Clause
597
+ */const iu=Wa(class extends Ya{constructor(n){if(super(n),n.type!==Fe.PROPERTY&&n.type!==Fe.ATTRIBUTE&&n.type!==Fe.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!HE(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[e]){if(e===Wt||e===L)return e;const r=n.element,i=n.name;if(n.type===Fe.PROPERTY){if(e===r[i])return Wt}else if(n.type===Fe.BOOLEAN_ATTRIBUTE){if(!!e===r.hasAttribute(i))return Wt}else if(n.type===Fe.ATTRIBUTE&&r.getAttribute(i)===e+"")return Wt;return KE(n),e}});/**
598
+ * @license
599
+ * Copyright 2018 Google LLC
600
+ * SPDX-License-Identifier: BSD-3-Clause
601
+ */const vp="important",GE=" !"+vp,ou=Wa(class extends Ya{constructor(n){var e;if(super(n),n.type!==Fe.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,r)=>{const i=n[r];return i==null?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(n,[e]){const{style:r}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?r.removeProperty(i):r[i]=null);for(const i in e){const o=e[i];if(o!=null){this.ft.add(i);const s=typeof o=="string"&&o.endsWith(GE);i.includes("-")||s?r.setProperty(i,s?o.slice(0,-11):o,s?vp:""):r[i]=o}}return Wt}});/**
602
+ * @license
603
+ * Copyright 2022 Google LLC
604
+ * SPDX-License-Identifier: Apache-2.0
605
+ */const WE={fromAttribute(n){return n??""},toAttribute(n){return n||null}};/**
606
+ * @license
607
+ * Copyright 2021 Google LLC
608
+ * SPDX-License-Identifier: Apache-2.0
609
+ */function YE(n,e){e.bubbles&&(!n.shadowRoot||e.composed)&&e.stopPropagation();const r=Reflect.construct(e.constructor,[e.type,e]),i=n.dispatchEvent(r);return i||e.preventDefault(),i}/**
610
+ * @license
611
+ * Copyright 2023 Google LLC
612
+ * SPDX-License-Identifier: Apache-2.0
613
+ */const Bs=Symbol("createValidator"),Us=Symbol("getValidityAnchor"),Ho=Symbol("privateValidator"),_e=Symbol("privateSyncValidity"),li=Symbol("privateCustomValidationMessage");function XE(n){var e;class r extends n{constructor(){super(...arguments),this[e]=""}get validity(){return this[_e](),this[wt].validity}get validationMessage(){return this[_e](),this[wt].validationMessage}get willValidate(){return this[_e](),this[wt].willValidate}checkValidity(){return this[_e](),this[wt].checkValidity()}reportValidity(){return this[_e](),this[wt].reportValidity()}setCustomValidity(o){this[li]=o,this[_e]()}requestUpdate(o,s,a){super.requestUpdate(o,s,a),this[_e]()}firstUpdated(o){super.firstUpdated(o),this[_e]()}[(e=li,_e)](){this[Ho]||(this[Ho]=this[Bs]());const{validity:o,validationMessage:s}=this[Ho].getValidity(),a=!!this[li],l=this[li]||s;this[wt].setValidity({...o,customError:a},l,this[Us]()??void 0)}[Bs](){throw new Error("Implement [createValidator]")}[Us](){throw new Error("Implement [getValidityAnchor]")}}return r}/**
614
+ * @license
615
+ * Copyright 2023 Google LLC
616
+ * SPDX-License-Identifier: Apache-2.0
617
+ */const ki=Symbol("getFormValue"),su=Symbol("getFormState");function ZE(n){class e extends n{get form(){return this[wt].form}get labels(){return this[wt].labels}get name(){return this.getAttribute("name")??""}set name(i){this.setAttribute("name",i)}get disabled(){return this.hasAttribute("disabled")}set disabled(i){this.toggleAttribute("disabled",i)}attributeChangedCallback(i,o,s){if(i==="name"||i==="disabled"){const a=i==="disabled"?o!==null:o;this.requestUpdate(i,a);return}super.attributeChangedCallback(i,o,s)}requestUpdate(i,o,s){super.requestUpdate(i,o,s),this[wt].setFormValue(this[ki](),this[su]())}[ki](){throw new Error("Implement [getFormValue]")}[su](){return this[ki]()}formDisabledCallback(i){this.disabled=i}}return e.formAssociated=!0,$([j({noAccessor:!0})],e.prototype,"name",null),$([j({type:Boolean,noAccessor:!0})],e.prototype,"disabled",null),e}/**
618
+ * @license
619
+ * Copyright 2023 Google LLC
620
+ * SPDX-License-Identifier: Apache-2.0
621
+ */const Hs=Symbol("onReportValidity"),ci=Symbol("privateCleanupFormListeners"),ui=Symbol("privateDoNotReportInvalid"),di=Symbol("privateIsSelfReportingValidity"),hi=Symbol("privateCallOnReportValidity");function JE(n){var e,r,i;class o extends n{constructor(...a){super(...a),this[e]=new AbortController,this[r]=!1,this[i]=!1,this.addEventListener("invalid",l=>{this[ui]||!l.isTrusted||this.addEventListener("invalid",()=>{this[hi](l)},{once:!0})},{capture:!0})}checkValidity(){this[ui]=!0;const a=super.checkValidity();return this[ui]=!1,a}reportValidity(){this[di]=!0;const a=super.reportValidity();return a&&this[hi](null),this[di]=!1,a}[(e=ci,r=ui,i=di,hi)](a){const l=a==null?void 0:a.defaultPrevented;l||(this[Hs](a),!(!l&&(a==null?void 0:a.defaultPrevented)))||(this[di]||ek(this[wt].form,this))&&this.focus()}[Hs](a){throw new Error("Implement [onReportValidity]")}formAssociatedCallback(a){super.formAssociatedCallback&&super.formAssociatedCallback(a),this[ci].abort(),a&&(this[ci]=new AbortController,QE(this,a,()=>{this[hi](null)},this[ci].signal))}}return o}function QE(n,e,r,i){const o=tk(e);let s=!1,a,l=!1;o.addEventListener("before",()=>{l=!0,a=new AbortController,s=!1,n.addEventListener("invalid",()=>{s=!0},{signal:a.signal})},{signal:i}),o.addEventListener("after",()=>{l=!1,a==null||a.abort(),!s&&r()},{signal:i}),e.addEventListener("submit",()=>{l||r()},{signal:i})}const qo=new WeakMap;function tk(n){if(!qo.has(n)){const e=new EventTarget;qo.set(n,e);for(const r of["reportValidity","requestSubmit"]){const i=n[r];n[r]=function(){e.dispatchEvent(new Event("before"));const o=Reflect.apply(i,this,arguments);return e.dispatchEvent(new Event("after")),o}}}return qo.get(n)}function ek(n,e){if(!n)return!0;let r;for(const i of n.elements)if(i.matches(":invalid")){r=i;break}return r===e}/**
622
+ * @license
623
+ * Copyright 2023 Google LLC
624
+ * SPDX-License-Identifier: Apache-2.0
625
+ */class nk{constructor(e){this.getCurrentState=e,this.currentValidity={validity:{},validationMessage:""}}getValidity(){const e=this.getCurrentState();if(!(!this.prevState||!this.equals(this.prevState,e)))return this.currentValidity;const{validity:i,validationMessage:o}=this.computeValidity(e);return this.prevState=this.copy(e),this.currentValidity={validationMessage:o,validity:{badInput:i.badInput,customError:i.customError,patternMismatch:i.patternMismatch,rangeOverflow:i.rangeOverflow,rangeUnderflow:i.rangeUnderflow,stepMismatch:i.stepMismatch,tooLong:i.tooLong,tooShort:i.tooShort,typeMismatch:i.typeMismatch,valueMissing:i.valueMissing}},this.currentValidity}}/**
626
+ * @license
627
+ * Copyright 2023 Google LLC
628
+ * SPDX-License-Identifier: Apache-2.0
629
+ */class rk extends nk{computeValidity({state:e,renderedControl:r}){let i=r;er(e)&&!i?(i=this.inputControl||document.createElement("input"),this.inputControl=i):i||(i=this.textAreaControl||document.createElement("textarea"),this.textAreaControl=i);const o=er(e)?i:null;if(o&&(o.type=e.type),i.value!==e.value&&(i.value=e.value),i.required=e.required,o){const s=e;s.pattern?o.pattern=s.pattern:o.removeAttribute("pattern"),s.min?o.min=s.min:o.removeAttribute("min"),s.max?o.max=s.max:o.removeAttribute("max"),s.step?o.step=s.step:o.removeAttribute("step")}return(e.minLength??-1)>-1?i.setAttribute("minlength",String(e.minLength)):i.removeAttribute("minlength"),(e.maxLength??-1)>-1?i.setAttribute("maxlength",String(e.maxLength)):i.removeAttribute("maxlength"),{validity:i.validity,validationMessage:i.validationMessage}}equals({state:e},{state:r}){const i=e.type===r.type&&e.value===r.value&&e.required===r.required&&e.minLength===r.minLength&&e.maxLength===r.maxLength;return!er(e)||!er(r)?i:i&&e.pattern===r.pattern&&e.min===r.min&&e.max===r.max&&e.step===r.step}copy({state:e}){return{state:er(e)?this.copyInput(e):this.copyTextArea(e),renderedControl:null}}copyInput(e){const{type:r,pattern:i,min:o,max:s,step:a}=e;return{...this.copySharedState(e),type:r,pattern:i,min:o,max:s,step:a}}copyTextArea(e){return{...this.copySharedState(e),type:e.type}}copySharedState({value:e,required:r,minLength:i,maxLength:o}){return{value:e,required:r,minLength:i,maxLength:o}}}function er(n){return n.type!=="textarea"}/**
630
+ * @license
631
+ * Copyright 2021 Google LLC
632
+ * SPDX-License-Identifier: Apache-2.0
633
+ */const ik=Xa(JE(XE(ZE(Za(Nt)))));class G extends ik{constructor(){super(...arguments),this.error=!1,this.errorText="",this.label="",this.noAsterisk=!1,this.required=!1,this.value="",this.prefixText="",this.suffixText="",this.hasLeadingIcon=!1,this.hasTrailingIcon=!1,this.supportingText="",this.textDirection="",this.rows=2,this.cols=20,this.inputMode="",this.max="",this.maxLength=-1,this.min="",this.minLength=-1,this.noSpinner=!1,this.pattern="",this.placeholder="",this.readOnly=!1,this.multiple=!1,this.step="",this.type="text",this.autocomplete="",this.dirty=!1,this.focused=!1,this.nativeError=!1,this.nativeErrorText=""}get selectionDirection(){return this.getInputOrTextarea().selectionDirection}set selectionDirection(e){this.getInputOrTextarea().selectionDirection=e}get selectionEnd(){return this.getInputOrTextarea().selectionEnd}set selectionEnd(e){this.getInputOrTextarea().selectionEnd=e}get selectionStart(){return this.getInputOrTextarea().selectionStart}set selectionStart(e){this.getInputOrTextarea().selectionStart=e}get valueAsNumber(){const e=this.getInput();return e?e.valueAsNumber:NaN}set valueAsNumber(e){const r=this.getInput();r&&(r.valueAsNumber=e,this.value=r.value)}get valueAsDate(){const e=this.getInput();return e?e.valueAsDate:null}set valueAsDate(e){const r=this.getInput();r&&(r.valueAsDate=e,this.value=r.value)}get hasError(){return this.error||this.nativeError}select(){this.getInputOrTextarea().select()}setRangeText(...e){this.getInputOrTextarea().setRangeText(...e),this.value=this.getInputOrTextarea().value}setSelectionRange(e,r,i){this.getInputOrTextarea().setSelectionRange(e,r,i)}showPicker(){const e=this.getInput();e&&e.showPicker()}stepDown(e){const r=this.getInput();r&&(r.stepDown(e),this.value=r.value)}stepUp(e){const r=this.getInput();r&&(r.stepUp(e),this.value=r.value)}reset(){this.dirty=!1,this.value=this.getAttribute("value")??"",this.nativeError=!1,this.nativeErrorText=""}attributeChangedCallback(e,r,i){e==="value"&&this.dirty||super.attributeChangedCallback(e,r,i)}render(){const e={disabled:this.disabled,error:!this.disabled&&this.hasError,textarea:this.type==="textarea","no-spinner":this.noSpinner};return tt`
634
+ <span class="text-field ${Rn(e)}">
635
+ ${this.renderField()}
636
+ </span>
637
+ `}updated(e){const r=this.getInputOrTextarea().value;this.value!==r&&(this.value=r)}renderField(){return fp`<${this.fieldTag}
638
+ class="field"
639
+ count=${this.value.length}
640
+ ?disabled=${this.disabled}
641
+ ?error=${this.hasError}
642
+ error-text=${this.getErrorText()}
643
+ ?focused=${this.focused}
644
+ ?has-end=${this.hasTrailingIcon}
645
+ ?has-start=${this.hasLeadingIcon}
646
+ label=${this.label}
647
+ ?no-asterisk=${this.noAsterisk}
648
+ max=${this.maxLength}
649
+ ?populated=${!!this.value}
650
+ ?required=${this.required}
651
+ ?resizable=${this.type==="textarea"}
652
+ supporting-text=${this.supportingText}
653
+ >
654
+ ${this.renderLeadingIcon()}
655
+ ${this.renderInputOrTextarea()}
656
+ ${this.renderTrailingIcon()}
657
+ <div id="description" slot="aria-describedby"></div>
658
+ <slot name="container" slot="container"></slot>
659
+ </${this.fieldTag}>`}renderLeadingIcon(){return tt`
660
+ <span class="icon leading" slot="start">
661
+ <slot name="leading-icon" @slotchange=${this.handleIconChange}></slot>
662
+ </span>
663
+ `}renderTrailingIcon(){return tt`
664
+ <span class="icon trailing" slot="end">
665
+ <slot name="trailing-icon" @slotchange=${this.handleIconChange}></slot>
666
+ </span>
667
+ `}renderInputOrTextarea(){const e={direction:this.textDirection},r=this.ariaLabel||this.label||L,i=this.autocomplete,o=(this.maxLength??-1)>-1,s=(this.minLength??-1)>-1;if(this.type==="textarea")return tt`
668
+ <textarea
669
+ class="input"
670
+ style=${ou(e)}
671
+ aria-describedby="description"
672
+ aria-invalid=${this.hasError}
673
+ aria-label=${r}
674
+ autocomplete=${i||L}
675
+ name=${this.name||L}
676
+ ?disabled=${this.disabled}
677
+ maxlength=${o?this.maxLength:L}
678
+ minlength=${s?this.minLength:L}
679
+ placeholder=${this.placeholder||L}
680
+ ?readonly=${this.readOnly}
681
+ ?required=${this.required}
682
+ rows=${this.rows}
683
+ cols=${this.cols}
684
+ .value=${iu(this.value)}
685
+ @change=${this.redispatchEvent}
686
+ @focus=${this.handleFocusChange}
687
+ @blur=${this.handleFocusChange}
688
+ @input=${this.handleInput}
689
+ @select=${this.redispatchEvent}></textarea>
690
+ `;const a=this.renderPrefix(),l=this.renderSuffix(),c=this.inputMode;return tt`
691
+ <div class="input-wrapper">
692
+ ${a}
693
+ <input
694
+ class="input"
695
+ style=${ou(e)}
696
+ aria-describedby="description"
697
+ aria-invalid=${this.hasError}
698
+ aria-label=${r}
699
+ autocomplete=${i||L}
700
+ name=${this.name||L}
701
+ ?disabled=${this.disabled}
702
+ inputmode=${c||L}
703
+ max=${this.max||L}
704
+ maxlength=${o?this.maxLength:L}
705
+ min=${this.min||L}
706
+ minlength=${s?this.minLength:L}
707
+ pattern=${this.pattern||L}
708
+ placeholder=${this.placeholder||L}
709
+ ?readonly=${this.readOnly}
710
+ ?required=${this.required}
711
+ ?multiple=${this.multiple}
712
+ step=${this.step||L}
713
+ type=${this.type}
714
+ .value=${iu(this.value)}
715
+ @change=${this.redispatchEvent}
716
+ @focus=${this.handleFocusChange}
717
+ @blur=${this.handleFocusChange}
718
+ @input=${this.handleInput}
719
+ @select=${this.redispatchEvent} />
720
+ ${l}
721
+ </div>
722
+ `}renderPrefix(){return this.renderAffix(this.prefixText,!1)}renderSuffix(){return this.renderAffix(this.suffixText,!0)}renderAffix(e,r){return e?tt`<span class="${Rn({suffix:r,prefix:!r})}">${e}</span>`:L}getErrorText(){return this.error?this.errorText:this.nativeErrorText}handleFocusChange(){var e;this.focused=((e=this.inputOrTextarea)==null?void 0:e.matches(":focus"))??!1}handleInput(e){this.dirty=!0,this.value=e.target.value}redispatchEvent(e){YE(this,e)}getInputOrTextarea(){return this.inputOrTextarea||(this.connectedCallback(),this.scheduleUpdate()),this.isUpdatePending&&this.scheduleUpdate(),this.inputOrTextarea}getInput(){return this.type==="textarea"?null:this.getInputOrTextarea()}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0,this.hasTrailingIcon=this.trailingIcons.length>0}[ki](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(e){this.value=e}focus(){this.getInputOrTextarea().focus()}[Bs](){return new rk(()=>({state:this,renderedControl:this.inputOrTextarea}))}[Us](){return this.inputOrTextarea}[Hs](e){var i;e==null||e.preventDefault();const r=this.getErrorText();this.nativeError=!!e,this.nativeErrorText=this.validationMessage,r===this.getErrorText()&&((i=this.field)==null||i.reannounceError())}}G.shadowRootOptions={...Nt.shadowRootOptions,delegatesFocus:!0};$([j({type:Boolean,reflect:!0})],G.prototype,"error",void 0);$([j({attribute:"error-text"})],G.prototype,"errorText",void 0);$([j()],G.prototype,"label",void 0);$([j({type:Boolean,attribute:"no-asterisk"})],G.prototype,"noAsterisk",void 0);$([j({type:Boolean,reflect:!0})],G.prototype,"required",void 0);$([j()],G.prototype,"value",void 0);$([j({attribute:"prefix-text"})],G.prototype,"prefixText",void 0);$([j({attribute:"suffix-text"})],G.prototype,"suffixText",void 0);$([j({type:Boolean,attribute:"has-leading-icon"})],G.prototype,"hasLeadingIcon",void 0);$([j({type:Boolean,attribute:"has-trailing-icon"})],G.prototype,"hasTrailingIcon",void 0);$([j({attribute:"supporting-text"})],G.prototype,"supportingText",void 0);$([j({attribute:"text-direction"})],G.prototype,"textDirection",void 0);$([j({type:Number})],G.prototype,"rows",void 0);$([j({type:Number})],G.prototype,"cols",void 0);$([j({reflect:!0})],G.prototype,"inputMode",void 0);$([j()],G.prototype,"max",void 0);$([j({type:Number})],G.prototype,"maxLength",void 0);$([j()],G.prototype,"min",void 0);$([j({type:Number})],G.prototype,"minLength",void 0);$([j({type:Boolean,attribute:"no-spinner"})],G.prototype,"noSpinner",void 0);$([j()],G.prototype,"pattern",void 0);$([j({reflect:!0,converter:WE})],G.prototype,"placeholder",void 0);$([j({type:Boolean,reflect:!0})],G.prototype,"readOnly",void 0);$([j({type:Boolean,reflect:!0})],G.prototype,"multiple",void 0);$([j()],G.prototype,"step",void 0);$([j({reflect:!0})],G.prototype,"type",void 0);$([j({reflect:!0})],G.prototype,"autocomplete",void 0);$([he()],G.prototype,"dirty",void 0);$([he()],G.prototype,"focused",void 0);$([he()],G.prototype,"nativeError",void 0);$([he()],G.prototype,"nativeErrorText",void 0);$([bn(".input")],G.prototype,"inputOrTextarea",void 0);$([bn(".field")],G.prototype,"field",void 0);$([co({slot:"leading-icon"})],G.prototype,"leadingIcons",void 0);$([co({slot:"trailing-icon"})],G.prototype,"trailingIcons",void 0);/**
723
+ * @license
724
+ * Copyright 2021 Google LLC
725
+ * SPDX-License-Identifier: Apache-2.0
726
+ */class ok extends G{constructor(){super(...arguments),this.fieldTag=Xi`md-outlined-field`}}/**
727
+ * @license
728
+ * Copyright 2024 Google LLC
729
+ * SPDX-License-Identifier: Apache-2.0
730
+ */const sk=Mt`:host{display:inline-flex;outline:none;resize:both;text-align:start;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}slot[name=container]{border-radius:inherit}.icon{color:currentColor;display:flex;align-items:center;justify-content:center;fill:currentColor;position:relative}.icon ::slotted(*){display:flex;position:absolute}[has-start] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[has-end] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}.no-spinner .input::-webkit-inner-spin-button,.no-spinner .input::-webkit-outer-spin-button{display:none}.no-spinner .input[type=number]{-moz-appearance:textfield}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}
731
+ `;/**
732
+ * @license
733
+ * Copyright 2021 Google LLC
734
+ * SPDX-License-Identifier: Apache-2.0
735
+ */let qs=class extends ok{constructor(){super(...arguments),this.fieldTag=Xi`md-outlined-field`}};qs.styles=[sk,UE];qs=$([de("md-outlined-text-field")],qs);const Ko=document.getElementById("searchMatchCount"),au=document.getElementById("addToSelection");ce("graph-updated",async()=>{k2(),await rn()});ce("clear-button-clicked",async()=>{du(),ut("graph-updated",null)});ce("graph-filters-updated",async()=>{await rn()});ce("search-expression-changed",n=>{if(n&&n.trim()){const e=vn(),r=Gy(e,n),i=new Map(r.map(o=>[o.nodeId,o]));T.search={matchesMap:i,matchColorsMap:W_(i)},Ko.textContent=`${i.size} match${i.size!==1?"es":""}`,Ko.style.display="inline",au.disabled=i.size===0}else T.search=null,Ko.style.display="none",au.disabled=!0});ce("selection-changed",()=>Gi());ce("graph-ui-settings-updated",async()=>{await rn()});ce("graph-ui-links-curvature-updated",Ad);ce("d3-simulation-parameters-changed",ey);Ks("export-graph",()=>{const n=vn();return new Blob([Wy(n)],{type:"application/json"})});Ks("import-graph",n=>{const e=Qy(n);du(),Zi(new Mr(e.nodes,e.edges)),ut("graph-updated",null)});Ks("reload-graph",async()=>{const n=await jd();Zi(new Mr(n.nodes,n.edges)),ut("graph-updated",null)});const{selectionCanvas:ak,canvas:lk}=P2();M2(ak,lk);window.addEventListener("load",async()=>{console.log("initial loading..."),ut("d3-simulation-parameters-changed",null);const n=await jd(),e=new Mr(n.nodes,n.edges);Zi(e),ut("graph-updated",null)});