apextree 1.4.3 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apextree.es.min.js +1562 -6505
- package/apextree.min.js +1 -1
- package/lib/ApexTree.d.ts +4 -3
- package/lib/models/DagreGraph.d.ts +4 -3
- package/lib/models/Paper.d.ts +3 -1
- package/lib/models/PositionManager.d.ts +57 -0
- package/lib/settings/Options.d.ts +3 -0
- package/lib/utils/GraphUtils.d.ts +13 -2
- package/package.json +2 -2
package/apextree.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexTree={})}(this,(function(t){"use strict";var e=Object.defineProperty,n=(t,n,r)=>(((t,n,r)=>{n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r})(t,"symbol"!=typeof n?n+"":n,r),r);var r,i=(r={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},function(t){return null==r?void 0:r[t]}),s="object"==typeof global&&global&&global.Object===Object&&global,o="object"==typeof self&&self&&self.Object===Object&&self,u=(s||o||Function("return this")()).Symbol;var a=Array.isArray,h=Object.prototype,l=h.hasOwnProperty,c=h.toString,f=u?u.toStringTag:void 0;var d=Object.prototype.toString;var p="[object Null]",m="[object Undefined]",g=u?u.toStringTag:void 0;function y(t){return null==t?void 0===t?m:p:g&&g in Object(t)?function(t){var e=l.call(t,f),n=t[f];try{t[f]=void 0;var r=!0}catch(s){}var i=c.call(t);return r&&(e?t[f]=n:delete t[f]),i}(t):function(t){return d.call(t)}(t)}var _="[object Symbol]";var v=1/0,w=u?u.prototype:void 0,b=w?w.toString:void 0;function x(t){if("string"==typeof t)return t;if(a(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,x)+"";if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&y(t)==_}(t))return b?b.call(t):"";var e=t+"";return"0"==e&&1/t==-v?"-0":e}function E(t){return null==t?"":x(t)}var O=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,M=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var k=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var C=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var A="\\ud800-\\udfff",S="\\u2700-\\u27bf",N="a-z\\xdf-\\xf6\\xf8-\\xff",j="A-Z\\xc0-\\xd6\\xd8-\\xde",T="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",I="["+T+"]",R="\\d+",L="["+S+"]",z="["+N+"]",D="[^"+A+T+R+S+N+j+"]",P="(?:\\ud83c[\\udde6-\\uddff]){2}",F="[\\ud800-\\udbff][\\udc00-\\udfff]",$="["+j+"]",Y="(?:"+z+"|"+D+")",X="(?:"+$+"|"+D+")",G="(?:['’](?:d|ll|m|re|s|t|ve))?",B="(?:['’](?:D|LL|M|RE|S|T|VE))?",W="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",q="[\\ufe0e\\ufe0f]?",V=q+W+("(?:\\u200d(?:"+["[^"+A+"]",P,F].join("|")+")"+q+W+")*"),H="(?:"+[L,P,F].join("|")+")"+V,U=RegExp([$+"?"+z+"+"+G+"(?="+[I,$,"$"].join("|")+")",X+"+"+B+"(?="+[I,$+Y,"$"].join("|")+")",$+"?"+Y+"+"+G,$+"+"+B,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",R,H].join("|"),"g");function Z(t,e,n){return t=E(t),void 0===e?function(t){return C.test(t)}(t)?function(t){return t.match(U)||[]}(t):function(t){return t.match(k)||[]}(t):t.match(e)||[]}var K=RegExp("['’]","g");var J,Q=(J=function(t,e,n){return t+(n?"-":"")+e.toLowerCase()},function(t){return function(t,e,n,r){for(var i=-1,s=null==t?0:t.length;++i<s;)n=e(n,t[i],i,t);return n}(Z(function(t){return(t=E(t))&&t.replace(O,i).replace(M,"")}(t).replace(K,"")),J,"")});const tt=(t="",e,n="")=>{const r=document.getElementById(t);e?null==r||r.setAttribute("style",e):null==r||r.removeAttribute("style"),(null==r?void 0:r.innerHTML.replaceAll("'",'"'))!==n.replaceAll("'",'"')&&r&&(r.innerHTML=n)},et=({bgColor:t,borderColor:e,fontColor:n,fontFamily:r,fontSize:i,fontWeight:s,maxWidth:o,offset:u=20,padding:a,x:h,y:l})=>{const c=["position: absolute;",`left: ${h+u}px;`,`top: ${l+u}px;`,`border: 1px solid ${e};`,"border-radius: 5px;","z-index: 1000;"];return n&&c.push(`color: ${n};`),r&&c.push(`font-family: ${r};`),s&&c.push(`font-weight: ${s};`),i&&c.push(`font-size: ${i};`),t&&c.push(`background-color: ${t};`),o&&c.push(`max-width: ${o}px`),void 0!==a&&c.push(`padding: ${a}px`),c.join(" ")},nt=(t={})=>{const e=[];for(const n in t){const r=`${Q(n)}: ${t[n]};`;e.push(r)}return e.join(" ")};function rt(){}class it{constructor(t,e="apex"){this.canvas=t,this.prefix=e}getSvgString(){return this.canvas.svg().replace(/(<img [\w\W]+?)(>)/g,"$1 />").replace(/(<br)(>)/g,"$1 />").replace(/(<hr)(>)/g,"$1 />")}svgUrl(){const t=this.getSvgString(),e=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)}triggerDownload(t,e){const n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}exportToSVG(){this.triggerDownload(this.svgUrl(),`${this.prefix}-${(new Date).getTime()}.svg`)}}const st=class{static decodeLicenseData(t){try{const e=window.atob(t),n=JSON.parse(e);return n.issueDate&&n.expiryDate&&n.plan?{expiryDate:n.expiryDate,issueDate:n.issueDate,plan:n.plan,valid:!0}:null}catch{return null}}static generateLicenseKey(t,e,n="standard"){const r={expiryDate:e,issueDate:t,plan:n};return`APEX-${window.btoa(JSON.stringify(r))}`}static getLicenseStatus(){return this.licenseKey?(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult):{expired:!1,valid:!1}}static isLicenseValid(){return!!this.licenseKey&&(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult.valid)}static setLicense(t){this.licenseKey=t,this.validationResult=this.validateLicense(t),this.validationResult.valid||console.error(`[Apex] ${this.validationResult.message}`)}static validateLicense(t){try{if(!t.startsWith("APEX-"))return{expired:!1,message:'Invalid license key format. License key must start with "APEX-".',valid:!1};const e=t.split("-");if(2!==e.length)return{expired:!1,message:"Invalid license key format. Expected format: APEX-{encoded-data}.",valid:!1};const n=e[1],r=this.decodeLicenseData(n);if(!r)return{expired:!1,message:"Invalid license key. Unable to decode license data.",valid:!1};const i=new Date;return new Date(r.expiryDate)<i?{data:r,expired:!0,message:`License expired on ${r.expiryDate}. Please renew your license.`,valid:!1}:{data:r,expired:!1,valid:!0}}catch{return{expired:!1,message:"Invalid license key format or corrupted data.",valid:!1}}}};st.licenseKey=null,st.validationResult=null;let ot=st;var ut,at,ht="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},lt={exports:{}};ut=lt,at=lt.exports,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",i=16,s=32,o=64,u=128,a=256,h=1/0,l=9007199254740991,c=NaN,f=4294967295,d=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",s],["partialRight",o],["rearg",a]],p="[object Arguments]",m="[object Array]",g="[object Boolean]",y="[object Date]",_="[object Error]",v="[object Function]",w="[object GeneratorFunction]",b="[object Map]",x="[object Number]",E="[object Object]",O="[object Promise]",M="[object RegExp]",k="[object Set]",C="[object String]",A="[object Symbol]",S="[object WeakMap]",N="[object ArrayBuffer]",j="[object DataView]",T="[object Float32Array]",I="[object Float64Array]",R="[object Int8Array]",L="[object Int16Array]",z="[object Int32Array]",D="[object Uint8Array]",P="[object Uint8ClampedArray]",F="[object Uint16Array]",$="[object Uint32Array]",Y=/\b__p \+= '';/g,X=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,B=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,q=RegExp(B.source),V=RegExp(W.source),H=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),nt=/^\s+/,rt=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,st=/\{\n\/\* \[wrapped with (.+)\] \*/,ot=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ft=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,mt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,_t=/^0o[0-7]+$/i,vt=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,Et="\\ud800-\\udfff",Ot="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Mt="\\u2700-\\u27bf",kt="a-z\\xdf-\\xf6\\xf8-\\xff",Ct="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Nt="['’]",jt="["+Et+"]",Tt="["+St+"]",It="["+Ot+"]",Rt="\\d+",Lt="["+Mt+"]",zt="["+kt+"]",Dt="[^"+Et+St+Rt+Mt+kt+Ct+"]",Pt="\\ud83c[\\udffb-\\udfff]",Ft="[^"+Et+"]",$t="(?:\\ud83c[\\udde6-\\uddff]){2}",Yt="[\\ud800-\\udbff][\\udc00-\\udfff]",Xt="["+Ct+"]",Gt="\\u200d",Bt="(?:"+zt+"|"+Dt+")",Wt="(?:"+Xt+"|"+Dt+")",qt="(?:['’](?:d|ll|m|re|s|t|ve))?",Vt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ht="(?:"+It+"|"+Pt+")?",Ut="["+At+"]?",Zt=Ut+Ht+"(?:"+Gt+"(?:"+[Ft,$t,Yt].join("|")+")"+Ut+Ht+")*",Kt="(?:"+[Lt,$t,Yt].join("|")+")"+Zt,Jt="(?:"+[Ft+It+"?",It,$t,Yt,jt].join("|")+")",Qt=RegExp(Nt,"g"),te=RegExp(It,"g"),ee=RegExp(Pt+"(?="+Pt+")|"+Jt+Zt,"g"),ne=RegExp([Xt+"?"+zt+"+"+qt+"(?="+[Tt,Xt,"$"].join("|")+")",Wt+"+"+Vt+"(?="+[Tt,Xt+Bt,"$"].join("|")+")",Xt+"?"+Bt+"+"+qt,Xt+"+"+Vt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rt,Kt].join("|"),"g"),re=RegExp("["+Gt+Et+Ot+At+"]"),ie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,se=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ue={};ue[T]=ue[I]=ue[R]=ue[L]=ue[z]=ue[D]=ue[P]=ue[F]=ue[$]=!0,ue[p]=ue[m]=ue[N]=ue[g]=ue[j]=ue[y]=ue[_]=ue[v]=ue[b]=ue[x]=ue[E]=ue[M]=ue[k]=ue[C]=ue[S]=!1;var ae={};ae[p]=ae[m]=ae[N]=ae[j]=ae[g]=ae[y]=ae[T]=ae[I]=ae[R]=ae[L]=ae[z]=ae[b]=ae[x]=ae[E]=ae[M]=ae[k]=ae[C]=ae[A]=ae[D]=ae[P]=ae[F]=ae[$]=!0,ae[_]=ae[v]=ae[S]=!1;var he={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,ce=parseInt,fe="object"==typeof ht&&ht&&ht.Object===Object&&ht,de="object"==typeof self&&self&&self.Object===Object&&self,pe=fe||de||Function("return this")(),me=at&&!at.nodeType&&at,ge=me&&ut&&!ut.nodeType&&ut,ye=ge&&ge.exports===me,_e=ye&&fe.process,ve=function(){try{var t=ge&&ge.require&&ge.require("util").types;return t||_e&&_e.binding&&_e.binding("util")}catch(e){}}(),we=ve&&ve.isArrayBuffer,be=ve&&ve.isDate,xe=ve&&ve.isMap,Ee=ve&&ve.isRegExp,Oe=ve&&ve.isSet,Me=ve&&ve.isTypedArray;function ke(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ce(t,e,n,r){for(var i=-1,s=null==t?0:t.length;++i<s;){var o=t[i];e(r,o,n(o),t)}return r}function Ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Se(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ne(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function je(t,e){for(var n=-1,r=null==t?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function Te(t,e){return!(null==t||!t.length)&&Xe(t,e,0)>-1}function Ie(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Re(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Le(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function ze(t,e,n,r){var i=-1,s=null==t?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function De(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Pe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Fe=qe("length");function $e(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function Ye(t,e,n,r){for(var i=t.length,s=n+(r?1:-1);r?s--:++s<i;)if(e(t[s],s,t))return s;return-1}function Xe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Ye(t,Be,n)}function Ge(t,e,n,r){for(var i=n-1,s=t.length;++i<s;)if(r(t[i],e))return i;return-1}function Be(t){return t!=t}function We(t,e){var n=null==t?0:t.length;return n?Ue(t,e)/n:c}function qe(e){return function(n){return null==n?t:n[e]}}function Ve(e){return function(n){return null==e?t:e[n]}}function He(t,e,n,r,i){return i(t,(function(t,i,s){n=r?(r=!1,t):e(n,t,i,s)})),n}function Ue(e,n){for(var r,i=-1,s=e.length;++i<s;){var o=n(e[i]);o!==t&&(r=r===t?o:r+o)}return r}function Ze(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Ke(t){return t?t.slice(0,pn(t)+1).replace(nt,""):t}function Je(t){return function(e){return t(e)}}function Qe(t,e){return Re(e,(function(e){return t[e]}))}function tn(t,e){return t.has(e)}function en(t,e){for(var n=-1,r=t.length;++n<r&&Xe(e,t[n],0)>-1;);return n}function nn(t,e){for(var n=t.length;n--&&Xe(e,t[n],0)>-1;);return n}var rn=Ve({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),sn=Ve({"&":"&","<":"<",">":">",'"':""","'":"'"});function on(t){return"\\"+he[t]}function un(t){return re.test(t)}function an(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function hn(t,e){return function(n){return t(e(n))}}function ln(t,e){for(var n=-1,i=t.length,s=0,o=[];++n<i;){var u=t[n];u!==e&&u!==r||(t[n]=r,o[s++]=n)}return o}function cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function fn(t){return un(t)?function(t){for(var e=ee.lastIndex=0;ee.test(t);)++e;return e}(t):Fe(t)}function dn(t){return un(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.split("")}(t)}function pn(t){for(var e=t.length;e--&&rt.test(t.charAt(e)););return e}var mn=Ve({"&":"&","<":"<",">":">",""":'"',"'":"'"}),gn=function rt(ut){var at,ht=(ut=null==ut?pe:gn.defaults(pe.Object(),ut,gn.pick(pe,se))).Array,Et=ut.Date,Ot=ut.Error,Mt=ut.Function,kt=ut.Math,Ct=ut.Object,At=ut.RegExp,St=ut.String,Nt=ut.TypeError,jt=ht.prototype,Tt=Mt.prototype,It=Ct.prototype,Rt=ut["__core-js_shared__"],Lt=Tt.toString,zt=It.hasOwnProperty,Dt=0,Pt=(at=/[^.]+$/.exec(Rt&&Rt.keys&&Rt.keys.IE_PROTO||""))?"Symbol(src)_1."+at:"",Ft=It.toString,$t=Lt.call(Ct),Yt=pe._,Xt=At("^"+Lt.call(zt).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gt=ye?ut.Buffer:t,Bt=ut.Symbol,Wt=ut.Uint8Array,qt=Gt?Gt.allocUnsafe:t,Vt=hn(Ct.getPrototypeOf,Ct),Ht=Ct.create,Ut=It.propertyIsEnumerable,Zt=jt.splice,Kt=Bt?Bt.isConcatSpreadable:t,Jt=Bt?Bt.iterator:t,ee=Bt?Bt.toStringTag:t,re=function(){try{var t=cs(Ct,"defineProperty");return t({},"",{}),t}catch(e){}}(),he=ut.clearTimeout!==pe.clearTimeout&&ut.clearTimeout,fe=Et&&Et.now!==pe.Date.now&&Et.now,de=ut.setTimeout!==pe.setTimeout&&ut.setTimeout,me=kt.ceil,ge=kt.floor,_e=Ct.getOwnPropertySymbols,ve=Gt?Gt.isBuffer:t,Fe=ut.isFinite,Ve=jt.join,yn=hn(Ct.keys,Ct),_n=kt.max,vn=kt.min,wn=Et.now,bn=ut.parseInt,xn=kt.random,En=jt.reverse,On=cs(ut,"DataView"),Mn=cs(ut,"Map"),kn=cs(ut,"Promise"),Cn=cs(ut,"Set"),An=cs(ut,"WeakMap"),Sn=cs(Ct,"create"),Nn=An&&new An,jn={},Tn=$s(On),In=$s(Mn),Rn=$s(kn),Ln=$s(Cn),zn=$s(An),Dn=Bt?Bt.prototype:t,Pn=Dn?Dn.valueOf:t,Fn=Dn?Dn.toString:t;function $n(t){if(iu(t)&&!Vo(t)&&!(t instanceof Bn)){if(t instanceof Gn)return t;if(zt.call(t,"__wrapped__"))return Ys(t)}return new Gn(t)}var Yn=function(){function e(){}return function(n){if(!ru(n))return{};if(Ht)return Ht(n);e.prototype=n;var r=new e;return e.prototype=t,r}}();function Xn(){}function Gn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function Bn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Vn;++e<n;)this.add(t[e])}function Un(t){var e=this.__data__=new qn(t);this.size=e.size}function Zn(t,e){var n=Vo(t),r=!n&&qo(t),i=!n&&!r&&Ko(t),s=!n&&!r&&!i&&fu(t),o=n||r||i||s,u=o?Ze(t.length,St):[],a=u.length;for(var h in t)!e&&!zt.call(t,h)||o&&("length"==h||i&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||_s(h,a))||u.push(h);return u}function Kn(e){var n=e.length;return n?e[Hr(0,n-1)]:t}function Jn(t,e){return Rs(Si(t),ur(e,0,t.length))}function Qn(t){return Rs(Si(t))}function tr(e,n,r){(r!==t&&!Go(e[n],r)||r===t&&!(n in e))&&sr(e,n,r)}function er(e,n,r){var i=e[n];zt.call(e,n)&&Go(i,r)&&(r!==t||n in e)||sr(e,n,r)}function nr(t,e){for(var n=t.length;n--;)if(Go(t[n][0],e))return n;return-1}function rr(t,e,n,r){return fr(t,(function(t,i,s){e(r,t,n(t),s)})),r}function ir(t,e){return t&&Ni(e,Ru(e),t)}function sr(t,e,n){"__proto__"==e&&re?re(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function or(e,n){for(var r=-1,i=n.length,s=ht(i),o=null==e;++r<i;)s[r]=o?t:Su(e,n[r]);return s}function ur(e,n,r){return e==e&&(r!==t&&(e=e<=r?e:r),n!==t&&(e=e>=n?e:n)),e}function ar(e,n,r,i,s,o){var u,a=1&n,h=2&n,l=4&n;if(r&&(u=s?r(e,i,s,o):r(e)),u!==t)return u;if(!ru(e))return e;var c=Vo(e);if(c){if(u=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&zt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!a)return Si(e,u)}else{var f=ps(e),d=f==v||f==w;if(Ko(e))return Ei(e,a);if(f==E||f==p||d&&!s){if(u=h||d?{}:gs(e),!a)return h?function(t,e){return Ni(t,ds(t),e)}(e,function(t,e){return t&&Ni(e,Lu(e),t)}(u,e)):function(t,e){return Ni(t,fs(t),e)}(e,ir(u,e))}else{if(!ae[f])return s?e:{};u=function(t,e,n){var r,i=t.constructor;switch(e){case N:return Oi(t);case g:case y:return new i(+t);case j:return function(t,e){var n=e?Oi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case T:case I:case R:case L:case z:case D:case P:case F:case $:return Mi(t,n);case b:return new i;case x:case C:return new i(t);case M:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case k:return new i;case A:return r=t,Pn?Ct(Pn.call(r)):{}}}(e,f,a)}}o||(o=new Un);var m=o.get(e);if(m)return m;o.set(e,u),hu(e)?e.forEach((function(t){u.add(ar(t,n,r,t,e,o))})):su(e)&&e.forEach((function(t,i){u.set(i,ar(t,n,r,i,e,o))}));var _=c?t:(l?h?is:rs:h?Lu:Ru)(e);return Ae(_||e,(function(t,i){_&&(t=e[i=t]),er(u,i,ar(t,n,r,i,e,o))})),u}function hr(e,n,r){var i=r.length;if(null==e)return!i;for(e=Ct(e);i--;){var s=r[i],o=n[s],u=e[s];if(u===t&&!(s in e)||!o(u))return!1}return!0}function lr(n,r,i){if("function"!=typeof n)throw new Nt(e);return Ns((function(){n.apply(t,i)}),r)}function cr(t,e,n,r){var i=-1,s=Te,o=!0,u=t.length,a=[],h=e.length;if(!u)return a;n&&(e=Re(e,Je(n))),r?(s=Ie,o=!1):e.length>=200&&(s=tn,o=!1,e=new Hn(e));t:for(;++i<u;){var l=t[i],c=null==n?l:n(l);if(l=r||0!==l?l:0,o&&c==c){for(var f=h;f--;)if(e[f]===c)continue t;a.push(l)}else s(e,c,r)||a.push(l)}return a}$n.templateSettings={escape:H,evaluate:U,interpolate:Z,variable:"",imports:{_:$n}},$n.prototype=Xn.prototype,$n.prototype.constructor=$n,Gn.prototype=Yn(Xn.prototype),Gn.prototype.constructor=Gn,Bn.prototype=Yn(Xn.prototype),Bn.prototype.constructor=Bn,Wn.prototype.clear=function(){this.__data__=Sn?Sn(null):{},this.size=0},Wn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Wn.prototype.get=function(e){var r=this.__data__;if(Sn){var i=r[e];return i===n?t:i}return zt.call(r,e)?r[e]:t},Wn.prototype.has=function(e){var n=this.__data__;return Sn?n[e]!==t:zt.call(n,e)},Wn.prototype.set=function(e,r){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Sn&&r===t?n:r,this},qn.prototype.clear=function(){this.__data__=[],this.size=0},qn.prototype.delete=function(t){var e=this.__data__,n=nr(e,t);return!(n<0||(n==e.length-1?e.pop():Zt.call(e,n,1),--this.size,0))},qn.prototype.get=function(e){var n=this.__data__,r=nr(n,e);return r<0?t:n[r][1]},qn.prototype.has=function(t){return nr(this.__data__,t)>-1},qn.prototype.set=function(t,e){var n=this.__data__,r=nr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Vn.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(Mn||qn),string:new Wn}},Vn.prototype.delete=function(t){var e=hs(this,t).delete(t);return this.size-=e?1:0,e},Vn.prototype.get=function(t){return hs(this,t).get(t)},Vn.prototype.has=function(t){return hs(this,t).has(t)},Vn.prototype.set=function(t,e){var n=hs(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Hn.prototype.add=Hn.prototype.push=function(t){return this.__data__.set(t,n),this},Hn.prototype.has=function(t){return this.__data__.has(t)},Un.prototype.clear=function(){this.__data__=new qn,this.size=0},Un.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Un.prototype.get=function(t){return this.__data__.get(t)},Un.prototype.has=function(t){return this.__data__.has(t)},Un.prototype.set=function(t,e){var n=this.__data__;if(n instanceof qn){var r=n.__data__;if(!Mn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Vn(r)}return n.set(t,e),this.size=n.size,this};var fr=Ii(wr),dr=Ii(br,!0);function pr(t,e){var n=!0;return fr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function mr(e,n,r){for(var i=-1,s=e.length;++i<s;){var o=e[i],u=n(o);if(null!=u&&(a===t?u==u&&!cu(u):r(u,a)))var a=u,h=o}return h}function gr(t,e){var n=[];return fr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function yr(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=ys),i||(i=[]);++s<o;){var u=t[s];e>0&&n(u)?e>1?yr(u,e-1,n,r,i):Le(i,u):r||(i[i.length]=u)}return i}var _r=Ri(),vr=Ri(!0);function wr(t,e){return t&&_r(t,e,Ru)}function br(t,e){return t&&vr(t,e,Ru)}function xr(t,e){return je(e,(function(e){return tu(t[e])}))}function Er(e,n){for(var r=0,i=(n=vi(n,e)).length;null!=e&&r<i;)e=e[Fs(n[r++])];return r&&r==i?e:t}function Or(t,e,n){var r=e(t);return Vo(t)?r:Le(r,n(t))}function Mr(e){return null==e?e===t?"[object Undefined]":"[object Null]":ee&&ee in Ct(e)?function(e){var n=zt.call(e,ee),r=e[ee];try{e[ee]=t;var i=!0}catch(o){}var s=Ft.call(e);return i&&(n?e[ee]=r:delete e[ee]),s}(e):function(t){return Ft.call(t)}(e)}function kr(t,e){return t>e}function Cr(t,e){return null!=t&&zt.call(t,e)}function Ar(t,e){return null!=t&&e in Ct(t)}function Sr(e,n,r){for(var i=r?Ie:Te,s=e[0].length,o=e.length,u=o,a=ht(o),h=1/0,l=[];u--;){var c=e[u];u&&n&&(c=Re(c,Je(n))),h=vn(c.length,h),a[u]=!r&&(n||s>=120&&c.length>=120)?new Hn(u&&c):t}c=e[0];var f=-1,d=a[0];t:for(;++f<s&&l.length<h;){var p=c[f],m=n?n(p):p;if(p=r||0!==p?p:0,!(d?tn(d,m):i(l,m,r))){for(u=o;--u;){var g=a[u];if(!(g?tn(g,m):i(e[u],m,r)))continue t}d&&d.push(m),l.push(p)}}return l}function Nr(e,n,r){var i=null==(e=Cs(e,n=vi(n,e)))?e:e[Fs(Js(n))];return null==i?t:ke(i,e,r)}function jr(t){return iu(t)&&Mr(t)==p}function Tr(e,n,r,i,s){return e===n||(null==e||null==n||!iu(e)&&!iu(n)?e!=e&&n!=n:function(e,n,r,i,s,o){var u=Vo(e),a=Vo(n),h=u?m:ps(e),l=a?m:ps(n),c=(h=h==p?E:h)==E,f=(l=l==p?E:l)==E,d=h==l;if(d&&Ko(e)){if(!Ko(n))return!1;u=!0,c=!1}if(d&&!c)return o||(o=new Un),u||fu(e)?es(e,n,r,i,s,o):function(t,e,n,r,i,s,o){switch(n){case j:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case N:return!(t.byteLength!=e.byteLength||!s(new Wt(t),new Wt(e)));case g:case y:case x:return Go(+t,+e);case _:return t.name==e.name&&t.message==e.message;case M:case C:return t==e+"";case b:var u=an;case k:var a=1&r;if(u||(u=cn),t.size!=e.size&&!a)return!1;var h=o.get(t);if(h)return h==e;r|=2,o.set(t,e);var l=es(u(t),u(e),r,i,s,o);return o.delete(t),l;case A:if(Pn)return Pn.call(t)==Pn.call(e)}return!1}(e,n,h,r,i,s,o);if(!(1&r)){var v=c&&zt.call(e,"__wrapped__"),w=f&&zt.call(n,"__wrapped__");if(v||w){var O=v?e.value():e,S=w?n.value():n;return o||(o=new Un),s(O,S,r,i,o)}}return!!d&&(o||(o=new Un),function(e,n,r,i,s,o){var u=1&r,a=rs(e),h=a.length,l=rs(n),c=l.length;if(h!=c&&!u)return!1;for(var f=h;f--;){var d=a[f];if(!(u?d in n:zt.call(n,d)))return!1}var p=o.get(e),m=o.get(n);if(p&&m)return p==n&&m==e;var g=!0;o.set(e,n),o.set(n,e);for(var y=u;++f<h;){var _=e[d=a[f]],v=n[d];if(i)var w=u?i(v,_,d,n,e,o):i(_,v,d,e,n,o);if(!(w===t?_===v||s(_,v,r,i,o):w)){g=!1;break}y||(y="constructor"==d)}if(g&&!y){var b=e.constructor,x=n.constructor;b==x||!("constructor"in e)||!("constructor"in n)||"function"==typeof b&&b instanceof b&&"function"==typeof x&&x instanceof x||(g=!1)}return o.delete(e),o.delete(n),g}(e,n,r,i,s,o))}(e,n,r,i,Tr,s))}function Ir(e,n,r,i){var s=r.length,o=s,u=!i;if(null==e)return!o;for(e=Ct(e);s--;){var a=r[s];if(u&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++s<o;){var h=(a=r[s])[0],l=e[h],c=a[1];if(u&&a[2]){if(l===t&&!(h in e))return!1}else{var f=new Un;if(i)var d=i(l,c,h,e,n,f);if(!(d===t?Tr(c,l,3,i,f):d))return!1}}return!0}function Rr(t){return!(!ru(t)||(e=t,Pt&&Pt in e))&&(tu(t)?Xt:yt).test($s(t));var e}function Lr(t){return"function"==typeof t?t:null==t?oa:"object"==typeof t?Vo(t)?Yr(t[0],t[1]):$r(t):ma(t)}function zr(t){if(!Es(t))return yn(t);var e=[];for(var n in Ct(t))zt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Dr(t){if(!ru(t))return function(t){var e=[];if(null!=t)for(var n in Ct(t))e.push(n);return e}(t);var e=Es(t),n=[];for(var r in t)("constructor"!=r||!e&&zt.call(t,r))&&n.push(r);return n}function Pr(t,e){return t<e}function Fr(t,e){var n=-1,r=Uo(t)?ht(t.length):[];return fr(t,(function(t,i,s){r[++n]=e(t,i,s)})),r}function $r(t){var e=ls(t);return 1==e.length&&e[0][2]?Ms(e[0][0],e[0][1]):function(n){return n===t||Ir(n,t,e)}}function Yr(e,n){return ws(e)&&Os(n)?Ms(Fs(e),n):function(r){var i=Su(r,e);return i===t&&i===n?Nu(r,e):Tr(n,i,3)}}function Xr(e,n,r,i,s){e!==n&&_r(n,(function(o,u){if(s||(s=new Un),ru(o))!function(e,n,r,i,s,o,u){var a=As(e,r),h=As(n,r),l=u.get(h);if(l)tr(e,r,l);else{var c=o?o(a,h,r+"",e,n,u):t,f=c===t;if(f){var d=Vo(h),p=!d&&Ko(h),m=!d&&!p&&fu(h);c=h,d||p||m?Vo(a)?c=a:Zo(a)?c=Si(a):p?(f=!1,c=Ei(h,!0)):m?(f=!1,c=Mi(h,!0)):c=[]:uu(h)||qo(h)?(c=a,qo(a)?c=wu(a):ru(a)&&!tu(a)||(c=gs(h))):f=!1}f&&(u.set(h,c),s(c,h,i,o,u),u.delete(h)),tr(e,r,c)}}(e,n,u,r,Xr,i,s);else{var a=i?i(As(e,u),o,u+"",e,n,s):t;a===t&&(a=o),tr(e,u,a)}}),Lu)}function Gr(e,n){var r=e.length;if(r)return _s(n+=n<0?r:0,r)?e[n]:t}function Br(t,e,n){e=e.length?Re(e,(function(t){return Vo(t)?function(e){return Er(e,1===t.length?t[0]:t)}:t})):[oa];var r=-1;return e=Re(e,Je(as())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(Fr(t,(function(t,n,i){return{criteria:Re(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,s=e.criteria,o=i.length,u=n.length;++r<o;){var a=ki(i[r],s[r]);if(a)return r>=u?a:a*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Wr(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],u=Er(t,o);n(u,o)&&Qr(s,vi(o,t),u)}return s}function qr(t,e,n,r){var i=r?Ge:Xe,s=-1,o=e.length,u=t;for(t===e&&(e=Si(e)),n&&(u=Re(t,Je(n)));++s<o;)for(var a=0,h=e[s],l=n?n(h):h;(a=i(u,l,a,r))>-1;)u!==t&&Zt.call(u,a,1),Zt.call(t,a,1);return t}function Vr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==s){var s=i;_s(i)?Zt.call(t,i,1):ci(t,i)}}return t}function Hr(t,e){return t+ge(xn()*(e-t+1))}function Ur(t,e){var n="";if(!t||e<1||e>l)return n;do{e%2&&(n+=t),(e=ge(e/2))&&(t+=t)}while(e);return n}function Zr(t,e){return js(ks(t,e,oa),t+"")}function Kr(t){return Kn(Gu(t))}function Jr(t,e){var n=Gu(t);return Rs(n,ur(e,0,n.length))}function Qr(e,n,r,i){if(!ru(e))return e;for(var s=-1,o=(n=vi(n,e)).length,u=o-1,a=e;null!=a&&++s<o;){var h=Fs(n[s]),l=r;if("__proto__"===h||"constructor"===h||"prototype"===h)return e;if(s!=u){var c=a[h];(l=i?i(c,h,a):t)===t&&(l=ru(c)?c:_s(n[s+1])?[]:{})}er(a,h,l),a=a[h]}return e}var ti=Nn?function(t,e){return Nn.set(t,e),t}:oa,ei=re?function(t,e){return re(t,"toString",{configurable:!0,enumerable:!1,value:ra(e),writable:!0})}:oa;function ni(t){return Rs(Gu(t))}function ri(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=ht(i);++r<i;)s[r]=t[r+e];return s}function ii(t,e){var n;return fr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function si(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var s=r+i>>>1,o=t[s];null!==o&&!cu(o)&&(n?o<=e:o<e)?r=s+1:i=s}return i}return oi(t,e,oa,n)}function oi(e,n,r,i){var s=0,o=null==e?0:e.length;if(0===o)return 0;for(var u=(n=r(n))!=n,a=null===n,h=cu(n),l=n===t;s<o;){var c=ge((s+o)/2),f=r(e[c]),d=f!==t,p=null===f,m=f==f,g=cu(f);if(u)var y=i||m;else y=l?m&&(i||d):a?m&&d&&(i||!p):h?m&&d&&!p&&(i||!g):!p&&!g&&(i?f<=n:f<n);y?s=c+1:o=c}return vn(o,4294967294)}function ui(t,e){for(var n=-1,r=t.length,i=0,s=[];++n<r;){var o=t[n],u=e?e(o):o;if(!n||!Go(u,a)){var a=u;s[i++]=0===o?0:o}}return s}function ai(t){return"number"==typeof t?t:cu(t)?c:+t}function hi(t){if("string"==typeof t)return t;if(Vo(t))return Re(t,hi)+"";if(cu(t))return Fn?Fn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function li(t,e,n){var r=-1,i=Te,s=t.length,o=!0,u=[],a=u;if(n)o=!1,i=Ie;else if(s>=200){var h=e?null:Ui(t);if(h)return cn(h);o=!1,i=tn,a=new Hn}else a=e?[]:u;t:for(;++r<s;){var l=t[r],c=e?e(l):l;if(l=n||0!==l?l:0,o&&c==c){for(var f=a.length;f--;)if(a[f]===c)continue t;e&&a.push(c),u.push(l)}else i(a,c,n)||(a!==u&&a.push(c),u.push(l))}return u}function ci(t,e){return null==(t=Cs(t,e=vi(e,t)))||delete t[Fs(Js(e))]}function fi(t,e,n,r){return Qr(t,e,n(Er(t,e)),r)}function di(t,e,n,r){for(var i=t.length,s=r?i:-1;(r?s--:++s<i)&&e(t[s],s,t););return n?ri(t,r?0:s,r?s+1:i):ri(t,r?s+1:0,r?i:s)}function pi(t,e){var n=t;return n instanceof Bn&&(n=n.value()),ze(e,(function(t,e){return e.func.apply(e.thisArg,Le([t],e.args))}),n)}function mi(t,e,n){var r=t.length;if(r<2)return r?li(t[0]):[];for(var i=-1,s=ht(r);++i<r;)for(var o=t[i],u=-1;++u<r;)u!=i&&(s[i]=cr(s[i]||o,t[u],e,n));return li(yr(s,1),e,n)}function gi(e,n,r){for(var i=-1,s=e.length,o=n.length,u={};++i<s;){var a=i<o?n[i]:t;r(u,e[i],a)}return u}function yi(t){return Zo(t)?t:[]}function _i(t){return"function"==typeof t?t:oa}function vi(t,e){return Vo(t)?t:ws(t,e)?[t]:Ps(bu(t))}var wi=Zr;function bi(e,n,r){var i=e.length;return r=r===t?i:r,!n&&r>=i?e:ri(e,n,r)}var xi=he||function(t){return pe.clearTimeout(t)};function Ei(t,e){if(e)return t.slice();var n=t.length,r=qt?qt(n):new t.constructor(n);return t.copy(r),r}function Oi(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Mi(t,e){var n=e?Oi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function ki(e,n){if(e!==n){var r=e!==t,i=null===e,s=e==e,o=cu(e),u=n!==t,a=null===n,h=n==n,l=cu(n);if(!a&&!l&&!o&&e>n||o&&u&&h&&!a&&!l||i&&u&&h||!r&&h||!s)return 1;if(!i&&!o&&!l&&e<n||l&&r&&s&&!i&&!o||a&&r&&s||!u&&s||!h)return-1}return 0}function Ci(t,e,n,r){for(var i=-1,s=t.length,o=n.length,u=-1,a=e.length,h=_n(s-o,0),l=ht(a+h),c=!r;++u<a;)l[u]=e[u];for(;++i<o;)(c||i<s)&&(l[n[i]]=t[i]);for(;h--;)l[u++]=t[i++];return l}function Ai(t,e,n,r){for(var i=-1,s=t.length,o=-1,u=n.length,a=-1,h=e.length,l=_n(s-u,0),c=ht(l+h),f=!r;++i<l;)c[i]=t[i];for(var d=i;++a<h;)c[d+a]=e[a];for(;++o<u;)(f||i<s)&&(c[d+n[o]]=t[i++]);return c}function Si(t,e){var n=-1,r=t.length;for(e||(e=ht(r));++n<r;)e[n]=t[n];return e}function Ni(e,n,r,i){var s=!r;r||(r={});for(var o=-1,u=n.length;++o<u;){var a=n[o],h=i?i(r[a],e[a],a,r,e):t;h===t&&(h=e[a]),s?sr(r,a,h):er(r,a,h)}return r}function ji(t,e){return function(n,r){var i=Vo(n)?Ce:rr,s=e?e():{};return i(n,t,as(r,2),s)}}function Ti(e){return Zr((function(n,r){var i=-1,s=r.length,o=s>1?r[s-1]:t,u=s>2?r[2]:t;for(o=e.length>3&&"function"==typeof o?(s--,o):t,u&&vs(r[0],r[1],u)&&(o=s<3?t:o,s=1),n=Ct(n);++i<s;){var a=r[i];a&&e(n,a,i,o)}return n}))}function Ii(t,e){return function(n,r){if(null==n)return n;if(!Uo(n))return t(n,r);for(var i=n.length,s=e?i:-1,o=Ct(n);(e?s--:++s<i)&&!1!==r(o[s],s,o););return n}}function Ri(t){return function(e,n,r){for(var i=-1,s=Ct(e),o=r(e),u=o.length;u--;){var a=o[t?u:++i];if(!1===n(s[a],a,s))break}return e}}function Li(e){return function(n){var r=un(n=bu(n))?dn(n):t,i=r?r[0]:n.charAt(0),s=r?bi(r,1).join(""):n.slice(1);return i[e]()+s}}function zi(t){return function(e){return ze(ta(qu(e).replace(Qt,"")),t,"")}}function Di(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Yn(t.prototype),r=t.apply(n,e);return ru(r)?r:n}}function Pi(e){return function(n,r,i){var s=Ct(n);if(!Uo(n)){var o=as(r,3);n=Ru(n),r=function(t){return o(s[t],t,s)}}var u=e(n,r,i);return u>-1?s[o?n[u]:u]:t}}function Fi(n){return ns((function(r){var i=r.length,s=i,o=Gn.prototype.thru;for(n&&r.reverse();s--;){var u=r[s];if("function"!=typeof u)throw new Nt(e);if(o&&!a&&"wrapper"==os(u))var a=new Gn([],!0)}for(s=a?s:i;++s<i;){var h=os(u=r[s]),l="wrapper"==h?ss(u):t;a=l&&bs(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[os(l[0])].apply(a,l[3]):1==u.length&&bs(u)?a[h]():a.thru(u)}return function(){var t=arguments,e=t[0];if(a&&1==t.length&&Vo(e))return a.plant(e).value();for(var n=0,s=i?r[n].apply(this,t):e;++n<i;)s=r[n].call(this,s);return s}}))}function $i(e,n,r,i,s,o,a,h,l,c){var f=n&u,d=1&n,p=2&n,m=24&n,g=512&n,y=p?t:Di(e);return function u(){for(var _=arguments.length,v=ht(_),w=_;w--;)v[w]=arguments[w];if(m)var b=us(u),x=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(v,b);if(i&&(v=Ci(v,i,s,m)),o&&(v=Ai(v,o,a,m)),_-=x,m&&_<c){var E=ln(v,b);return Vi(e,n,$i,u.placeholder,r,v,E,h,l,c-_)}var O=d?r:this,M=p?O[e]:e;return _=v.length,h?v=function(e,n){for(var r=e.length,i=vn(n.length,r),s=Si(e);i--;){var o=n[i];e[i]=_s(o,r)?s[o]:t}return e}(v,h):g&&_>1&&v.reverse(),f&&l<_&&(v.length=l),this&&this!==pe&&this instanceof u&&(M=y||Di(M)),M.apply(O,v)}}function Yi(t,e){return function(n,r){return function(t,e,n,r){return wr(t,(function(t,i,s){e(r,n(t),i,s)})),r}(n,t,e(r),{})}}function Xi(e,n){return function(r,i){var s;if(r===t&&i===t)return n;if(r!==t&&(s=r),i!==t){if(s===t)return i;"string"==typeof r||"string"==typeof i?(r=hi(r),i=hi(i)):(r=ai(r),i=ai(i)),s=e(r,i)}return s}}function Gi(t){return ns((function(e){return e=Re(e,Je(as())),Zr((function(n){var r=this;return t(e,(function(t){return ke(t,r,n)}))}))}))}function Bi(e,n){var r=(n=n===t?" ":hi(n)).length;if(r<2)return r?Ur(n,e):n;var i=Ur(n,me(e/fn(n)));return un(n)?bi(dn(i),0,e).join(""):i.slice(0,e)}function Wi(e){return function(n,r,i){return i&&"number"!=typeof i&&vs(n,r,i)&&(r=i=t),n=gu(n),r===t?(r=n,n=0):r=gu(r),function(t,e,n,r){for(var i=-1,s=_n(me((e-t)/(n||1)),0),o=ht(s);s--;)o[r?s:++i]=t,t+=n;return o}(n,r,i=i===t?n<r?1:-1:gu(i),e)}}function qi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=vu(e),n=vu(n)),t(e,n)}}function Vi(e,n,r,i,u,a,h,l,c,f){var d=8&n;n|=d?s:o,4&(n&=~(d?o:s))||(n&=-4);var p=[e,n,u,d?a:t,d?h:t,d?t:a,d?t:h,l,c,f],m=r.apply(t,p);return bs(e)&&Ss(m,p),m.placeholder=i,Ts(m,e,n)}function Hi(t){var e=kt[t];return function(t,n){if(t=vu(t),(n=null==n?0:vn(yu(n),292))&&Fe(t)){var r=(bu(t)+"e").split("e");return+((r=(bu(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Ui=Cn&&1/cn(new Cn([,-0]))[1]==h?function(t){return new Cn(t)}:ca;function Zi(t){return function(e){var n=ps(e);return n==b?an(e):n==k?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return Re(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Ki(n,h,l,c,f,d,p,m){var g=2&h;if(!g&&"function"!=typeof n)throw new Nt(e);var y=c?c.length:0;if(y||(h&=-97,c=f=t),p=p===t?p:_n(yu(p),0),m=m===t?m:yu(m),y-=f?f.length:0,h&o){var _=c,v=f;c=f=t}var w=g?t:ss(n),b=[n,h,l,c,f,_,v,d,p,m];if(w&&function(t,e){var n=t[1],i=e[1],s=n|i,o=s<131,h=i==u&&8==n||i==u&&n==a&&t[7].length<=e[8]||384==i&&e[7].length<=e[8]&&8==n;if(!o&&!h)return t;1&i&&(t[2]=e[2],s|=1&n?0:4);var l=e[3];if(l){var c=t[3];t[3]=c?Ci(c,l,e[4]):l,t[4]=c?ln(t[3],r):e[4]}(l=e[5])&&(c=t[5],t[5]=c?Ai(c,l,e[6]):l,t[6]=c?ln(t[5],r):e[6]),(l=e[7])&&(t[7]=l),i&u&&(t[8]=null==t[8]?e[8]:vn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=s}(b,w),n=b[0],h=b[1],l=b[2],c=b[3],f=b[4],!(m=b[9]=b[9]===t?g?0:n.length:_n(b[9]-y,0))&&24&h&&(h&=-25),h&&1!=h)x=8==h||h==i?function(e,n,r){var i=Di(e);return function s(){for(var o=arguments.length,u=ht(o),a=o,h=us(s);a--;)u[a]=arguments[a];var l=o<3&&u[0]!==h&&u[o-1]!==h?[]:ln(u,h);return(o-=l.length)<r?Vi(e,n,$i,s.placeholder,t,u,l,t,t,r-o):ke(this&&this!==pe&&this instanceof s?i:e,this,u)}}(n,h,m):h!=s&&33!=h||f.length?$i.apply(t,b):function(t,e,n,r){var i=1&e,s=Di(t);return function e(){for(var o=-1,u=arguments.length,a=-1,h=r.length,l=ht(h+u),c=this&&this!==pe&&this instanceof e?s:t;++a<h;)l[a]=r[a];for(;u--;)l[a++]=arguments[++o];return ke(c,i?n:this,l)}}(n,h,l,c);else var x=function(t,e,n){var r=1&e,i=Di(t);return function e(){return(this&&this!==pe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(n,h,l);return Ts((w?ti:Ss)(x,b),n,h)}function Ji(e,n,r,i){return e===t||Go(e,It[r])&&!zt.call(i,r)?n:e}function Qi(e,n,r,i,s,o){return ru(e)&&ru(n)&&(o.set(n,e),Xr(e,n,t,Qi,o),o.delete(n)),e}function ts(e){return uu(e)?t:e}function es(e,n,r,i,s,o){var u=1&r,a=e.length,h=n.length;if(a!=h&&!(u&&h>a))return!1;var l=o.get(e),c=o.get(n);if(l&&c)return l==n&&c==e;var f=-1,d=!0,p=2&r?new Hn:t;for(o.set(e,n),o.set(n,e);++f<a;){var m=e[f],g=n[f];if(i)var y=u?i(g,m,f,n,e,o):i(m,g,f,e,n,o);if(y!==t){if(y)continue;d=!1;break}if(p){if(!Pe(n,(function(t,e){if(!tn(p,e)&&(m===t||s(m,t,r,i,o)))return p.push(e)}))){d=!1;break}}else if(m!==g&&!s(m,g,r,i,o)){d=!1;break}}return o.delete(e),o.delete(n),d}function ns(e){return js(ks(e,t,Vs),e+"")}function rs(t){return Or(t,Ru,fs)}function is(t){return Or(t,Lu,ds)}var ss=Nn?function(t){return Nn.get(t)}:ca;function os(t){for(var e=t.name+"",n=jn[e],r=zt.call(jn,e)?n.length:0;r--;){var i=n[r],s=i.func;if(null==s||s==t)return i.name}return e}function us(t){return(zt.call($n,"placeholder")?$n:t).placeholder}function as(){var t=$n.iteratee||ua;return t=t===ua?Lr:t,arguments.length?t(arguments[0],arguments[1]):t}function hs(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function ls(t){for(var e=Ru(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Os(i)]}return e}function cs(e,n){var r=function(e,n){return null==e?t:e[n]}(e,n);return Rr(r)?r:t}var fs=_e?function(t){return null==t?[]:(t=Ct(t),je(_e(t),(function(e){return Ut.call(t,e)})))}:_a,ds=_e?function(t){for(var e=[];t;)Le(e,fs(t)),t=Vt(t);return e}:_a,ps=Mr;function ms(t,e,n){for(var r=-1,i=(e=vi(e,t)).length,s=!1;++r<i;){var o=Fs(e[r]);if(!(s=null!=t&&n(t,o)))break;t=t[o]}return s||++r!=i?s:!!(i=null==t?0:t.length)&&nu(i)&&_s(o,i)&&(Vo(t)||qo(t))}function gs(t){return"function"!=typeof t.constructor||Es(t)?{}:Yn(Vt(t))}function ys(t){return Vo(t)||qo(t)||!!(Kt&&t&&t[Kt])}function _s(t,e){var n=typeof t;return!!(e=null==e?l:e)&&("number"==n||"symbol"!=n&&vt.test(t))&&t>-1&&t%1==0&&t<e}function vs(t,e,n){if(!ru(n))return!1;var r=typeof e;return!!("number"==r?Uo(n)&&_s(e,n.length):"string"==r&&e in n)&&Go(n[e],t)}function ws(t,e){if(Vo(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!cu(t))||J.test(t)||!K.test(t)||null!=e&&t in Ct(e)}function bs(t){var e=os(t),n=$n[e];if("function"!=typeof n||!(e in Bn.prototype))return!1;if(t===n)return!0;var r=ss(n);return!!r&&t===r[0]}(On&&ps(new On(new ArrayBuffer(1)))!=j||Mn&&ps(new Mn)!=b||kn&&ps(kn.resolve())!=O||Cn&&ps(new Cn)!=k||An&&ps(new An)!=S)&&(ps=function(e){var n=Mr(e),r=n==E?e.constructor:t,i=r?$s(r):"";if(i)switch(i){case Tn:return j;case In:return b;case Rn:return O;case Ln:return k;case zn:return S}return n});var xs=Rt?tu:va;function Es(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||It)}function Os(t){return t==t&&!ru(t)}function Ms(e,n){return function(r){return null!=r&&r[e]===n&&(n!==t||e in Ct(r))}}function ks(e,n,r){return n=_n(n===t?e.length-1:n,0),function(){for(var t=arguments,i=-1,s=_n(t.length-n,0),o=ht(s);++i<s;)o[i]=t[n+i];i=-1;for(var u=ht(n+1);++i<n;)u[i]=t[i];return u[n]=r(o),ke(e,this,u)}}function Cs(t,e){return e.length<2?t:Er(t,ri(e,0,-1))}function As(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ss=Is(ti),Ns=de||function(t,e){return pe.setTimeout(t,e)},js=Is(ei);function Ts(t,e,n){var r=e+"";return js(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ae(d,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(st);return e?e[1].split(ot):[]}(r),n)))}function Is(e){var n=0,r=0;return function(){var i=wn(),s=16-(i-r);if(r=i,s>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Rs(e,n){var r=-1,i=e.length,s=i-1;for(n=n===t?i:n;++r<n;){var o=Hr(r,s),u=e[o];e[o]=e[r],e[r]=u}return e.length=n,e}var Ls,zs,Ds,Ps=(Ls=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Q,(function(t,n,r,i){e.push(r?i.replace(ft,"$1"):n||t)})),e},zs=Do(Ls,(function(t){return 500===Ds.size&&Ds.clear(),t})),Ds=zs.cache,zs);function Fs(t){if("string"==typeof t||cu(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function $s(t){if(null!=t){try{return Lt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Ys(t){if(t instanceof Bn)return t.clone();var e=new Gn(t.__wrapped__,t.__chain__);return e.__actions__=Si(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Xs=Zr((function(t,e){return Zo(t)?cr(t,yr(e,1,Zo,!0)):[]})),Gs=Zr((function(e,n){var r=Js(n);return Zo(r)&&(r=t),Zo(e)?cr(e,yr(n,1,Zo,!0),as(r,2)):[]})),Bs=Zr((function(e,n){var r=Js(n);return Zo(r)&&(r=t),Zo(e)?cr(e,yr(n,1,Zo,!0),t,r):[]}));function Ws(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:yu(n);return i<0&&(i=_n(r+i,0)),Ye(t,as(e,3),i)}function qs(e,n,r){var i=null==e?0:e.length;if(!i)return-1;var s=i-1;return r!==t&&(s=yu(r),s=r<0?_n(i+s,0):vn(s,i-1)),Ye(e,as(n,3),s,!0)}function Vs(t){return null!=t&&t.length?yr(t,1):[]}function Hs(e){return e&&e.length?e[0]:t}var Us=Zr((function(t){var e=Re(t,yi);return e.length&&e[0]===t[0]?Sr(e):[]})),Zs=Zr((function(e){var n=Js(e),r=Re(e,yi);return n===Js(r)?n=t:r.pop(),r.length&&r[0]===e[0]?Sr(r,as(n,2)):[]})),Ks=Zr((function(e){var n=Js(e),r=Re(e,yi);return(n="function"==typeof n?n:t)&&r.pop(),r.length&&r[0]===e[0]?Sr(r,t,n):[]}));function Js(e){var n=null==e?0:e.length;return n?e[n-1]:t}var Qs=Zr(to);function to(t,e){return t&&t.length&&e&&e.length?qr(t,e):t}var eo=ns((function(t,e){var n=null==t?0:t.length,r=or(t,e);return Vr(t,Re(e,(function(t){return _s(t,n)?+t:t})).sort(ki)),r}));function no(t){return null==t?t:En.call(t)}var ro=Zr((function(t){return li(yr(t,1,Zo,!0))})),io=Zr((function(e){var n=Js(e);return Zo(n)&&(n=t),li(yr(e,1,Zo,!0),as(n,2))})),so=Zr((function(e){var n=Js(e);return n="function"==typeof n?n:t,li(yr(e,1,Zo,!0),t,n)}));function oo(t){if(!t||!t.length)return[];var e=0;return t=je(t,(function(t){if(Zo(t))return e=_n(t.length,e),!0})),Ze(e,(function(e){return Re(t,qe(e))}))}function uo(e,n){if(!e||!e.length)return[];var r=oo(e);return null==n?r:Re(r,(function(e){return ke(n,t,e)}))}var ao=Zr((function(t,e){return Zo(t)?cr(t,e):[]})),ho=Zr((function(t){return mi(je(t,Zo))})),lo=Zr((function(e){var n=Js(e);return Zo(n)&&(n=t),mi(je(e,Zo),as(n,2))})),co=Zr((function(e){var n=Js(e);return n="function"==typeof n?n:t,mi(je(e,Zo),t,n)})),fo=Zr(oo),po=Zr((function(e){var n=e.length,r=n>1?e[n-1]:t;return r="function"==typeof r?(e.pop(),r):t,uo(e,r)}));function mo(t){var e=$n(t);return e.__chain__=!0,e}function go(t,e){return e(t)}var yo=ns((function(e){var n=e.length,r=n?e[0]:0,i=this.__wrapped__,s=function(t){return or(t,e)};return!(n>1||this.__actions__.length)&&i instanceof Bn&&_s(r)?((i=i.slice(r,+r+(n?1:0))).__actions__.push({func:go,args:[s],thisArg:t}),new Gn(i,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(s)})),_o=ji((function(t,e,n){zt.call(t,n)?++t[n]:sr(t,n,1)})),vo=Pi(Ws),wo=Pi(qs);function bo(t,e){return(Vo(t)?Ae:fr)(t,as(e,3))}function xo(t,e){return(Vo(t)?Se:dr)(t,as(e,3))}var Eo=ji((function(t,e,n){zt.call(t,n)?t[n].push(e):sr(t,n,[e])})),Oo=Zr((function(t,e,n){var r=-1,i="function"==typeof e,s=Uo(t)?ht(t.length):[];return fr(t,(function(t){s[++r]=i?ke(e,t,n):Nr(t,e,n)})),s})),Mo=ji((function(t,e,n){sr(t,n,e)}));function ko(t,e){return(Vo(t)?Re:Fr)(t,as(e,3))}var Co=ji((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Ao=Zr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&vs(t,e[0],e[1])?e=[]:n>2&&vs(e[0],e[1],e[2])&&(e=[e[0]]),Br(t,yr(e,1),[])})),So=fe||function(){return pe.Date.now()};function No(e,n,r){return n=r?t:n,n=e&&null==n?e.length:n,Ki(e,u,t,t,t,t,n)}function jo(n,r){var i;if("function"!=typeof r)throw new Nt(e);return n=yu(n),function(){return--n>0&&(i=r.apply(this,arguments)),n<=1&&(r=t),i}}var To=Zr((function(t,e,n){var r=1;if(n.length){var i=ln(n,us(To));r|=s}return Ki(t,r,e,n,i)})),Io=Zr((function(t,e,n){var r=3;if(n.length){var i=ln(n,us(Io));r|=s}return Ki(e,r,t,n,i)}));function Ro(n,r,i){var s,o,u,a,h,l,c=0,f=!1,d=!1,p=!0;if("function"!=typeof n)throw new Nt(e);function m(e){var r=s,i=o;return s=o=t,c=e,a=n.apply(i,r)}function g(e){var n=e-l;return l===t||n>=r||n<0||d&&e-c>=u}function y(){var t=So();if(g(t))return _(t);h=Ns(y,function(t){var e=r-(t-l);return d?vn(e,u-(t-c)):e}(t))}function _(e){return h=t,p&&s?m(e):(s=o=t,a)}function v(){var e=So(),n=g(e);if(s=arguments,o=this,l=e,n){if(h===t)return function(t){return c=t,h=Ns(y,r),f?m(t):a}(l);if(d)return xi(h),h=Ns(y,r),m(l)}return h===t&&(h=Ns(y,r)),a}return r=vu(r)||0,ru(i)&&(f=!!i.leading,u=(d="maxWait"in i)?_n(vu(i.maxWait)||0,r):u,p="trailing"in i?!!i.trailing:p),v.cancel=function(){h!==t&&xi(h),c=0,s=l=o=h=t},v.flush=function(){return h===t?a:_(So())},v}var Lo=Zr((function(t,e){return lr(t,1,e)})),zo=Zr((function(t,e,n){return lr(t,vu(e)||0,n)}));function Do(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Nt(e);var r=function(){var e=arguments,i=n?n.apply(this,e):e[0],s=r.cache;if(s.has(i))return s.get(i);var o=t.apply(this,e);return r.cache=s.set(i,o)||s,o};return r.cache=new(Do.Cache||Vn),r}function Po(t){if("function"!=typeof t)throw new Nt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Do.Cache=Vn;var Fo=wi((function(t,e){var n=(e=1==e.length&&Vo(e[0])?Re(e[0],Je(as())):Re(yr(e,1),Je(as()))).length;return Zr((function(r){for(var i=-1,s=vn(r.length,n);++i<s;)r[i]=e[i].call(this,r[i]);return ke(t,this,r)}))})),$o=Zr((function(e,n){var r=ln(n,us($o));return Ki(e,s,t,n,r)})),Yo=Zr((function(e,n){var r=ln(n,us(Yo));return Ki(e,o,t,n,r)})),Xo=ns((function(e,n){return Ki(e,a,t,t,t,n)}));function Go(t,e){return t===e||t!=t&&e!=e}var Bo=qi(kr),Wo=qi((function(t,e){return t>=e})),qo=jr(function(){return arguments}())?jr:function(t){return iu(t)&&zt.call(t,"callee")&&!Ut.call(t,"callee")},Vo=ht.isArray,Ho=we?Je(we):function(t){return iu(t)&&Mr(t)==N};function Uo(t){return null!=t&&nu(t.length)&&!tu(t)}function Zo(t){return iu(t)&&Uo(t)}var Ko=ve||va,Jo=be?Je(be):function(t){return iu(t)&&Mr(t)==y};function Qo(t){if(!iu(t))return!1;var e=Mr(t);return e==_||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!uu(t)}function tu(t){if(!ru(t))return!1;var e=Mr(t);return e==v||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function eu(t){return"number"==typeof t&&t==yu(t)}function nu(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=l}function ru(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function iu(t){return null!=t&&"object"==typeof t}var su=xe?Je(xe):function(t){return iu(t)&&ps(t)==b};function ou(t){return"number"==typeof t||iu(t)&&Mr(t)==x}function uu(t){if(!iu(t)||Mr(t)!=E)return!1;var e=Vt(t);if(null===e)return!0;var n=zt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Lt.call(n)==$t}var au=Ee?Je(Ee):function(t){return iu(t)&&Mr(t)==M},hu=Oe?Je(Oe):function(t){return iu(t)&&ps(t)==k};function lu(t){return"string"==typeof t||!Vo(t)&&iu(t)&&Mr(t)==C}function cu(t){return"symbol"==typeof t||iu(t)&&Mr(t)==A}var fu=Me?Je(Me):function(t){return iu(t)&&nu(t.length)&&!!ue[Mr(t)]},du=qi(Pr),pu=qi((function(t,e){return t<=e}));function mu(t){if(!t)return[];if(Uo(t))return lu(t)?dn(t):Si(t);if(Jt&&t[Jt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Jt]());var e=ps(t);return(e==b?an:e==k?cn:Gu)(t)}function gu(t){return t?(t=vu(t))===h||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function yu(t){var e=gu(t),n=e%1;return e==e?n?e-n:e:0}function _u(t){return t?ur(yu(t),0,f):0}function vu(t){if("number"==typeof t)return t;if(cu(t))return c;if(ru(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ru(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ke(t);var n=gt.test(t);return n||_t.test(t)?ce(t.slice(2),n?2:8):mt.test(t)?c:+t}function wu(t){return Ni(t,Lu(t))}function bu(t){return null==t?"":hi(t)}var xu=Ti((function(t,e){if(Es(e)||Uo(e))Ni(e,Ru(e),t);else for(var n in e)zt.call(e,n)&&er(t,n,e[n])})),Eu=Ti((function(t,e){Ni(e,Lu(e),t)})),Ou=Ti((function(t,e,n,r){Ni(e,Lu(e),t,r)})),Mu=Ti((function(t,e,n,r){Ni(e,Ru(e),t,r)})),ku=ns(or),Cu=Zr((function(e,n){e=Ct(e);var r=-1,i=n.length,s=i>2?n[2]:t;for(s&&vs(n[0],n[1],s)&&(i=1);++r<i;)for(var o=n[r],u=Lu(o),a=-1,h=u.length;++a<h;){var l=u[a],c=e[l];(c===t||Go(c,It[l])&&!zt.call(e,l))&&(e[l]=o[l])}return e})),Au=Zr((function(e){return e.push(t,Qi),ke(Du,t,e)}));function Su(e,n,r){var i=null==e?t:Er(e,n);return i===t?r:i}function Nu(t,e){return null!=t&&ms(t,e,Ar)}var ju=Yi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ft.call(e)),t[e]=n}),ra(oa)),Tu=Yi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ft.call(e)),zt.call(t,e)?t[e].push(n):t[e]=[n]}),as),Iu=Zr(Nr);function Ru(t){return Uo(t)?Zn(t):zr(t)}function Lu(t){return Uo(t)?Zn(t,!0):Dr(t)}var zu=Ti((function(t,e,n){Xr(t,e,n)})),Du=Ti((function(t,e,n,r){Xr(t,e,n,r)})),Pu=ns((function(t,e){var n={};if(null==t)return n;var r=!1;e=Re(e,(function(e){return e=vi(e,t),r||(r=e.length>1),e})),Ni(t,is(t),n),r&&(n=ar(n,7,ts));for(var i=e.length;i--;)ci(n,e[i]);return n})),Fu=ns((function(t,e){return null==t?{}:function(t,e){return Wr(t,e,(function(e,n){return Nu(t,n)}))}(t,e)}));function $u(t,e){if(null==t)return{};var n=Re(is(t),(function(t){return[t]}));return e=as(e),Wr(t,n,(function(t,n){return e(t,n[0])}))}var Yu=Zi(Ru),Xu=Zi(Lu);function Gu(t){return null==t?[]:Qe(t,Ru(t))}var Bu=zi((function(t,e,n){return e=e.toLowerCase(),t+(n?Wu(e):e)}));function Wu(t){return Qu(bu(t).toLowerCase())}function qu(t){return(t=bu(t))&&t.replace(wt,rn).replace(te,"")}var Vu=zi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Hu=zi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Uu=Li("toLowerCase"),Zu=zi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Ku=zi((function(t,e,n){return t+(n?" ":"")+Qu(e)})),Ju=zi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Qu=Li("toUpperCase");function ta(e,n,r){return e=bu(e),(n=r?t:n)===t?function(t){return ie.test(t)}(e)?function(t){return t.match(ne)||[]}(e):function(t){return t.match(lt)||[]}(e):e.match(n)||[]}var ea=Zr((function(e,n){try{return ke(e,t,n)}catch(r){return Qo(r)?r:new Ot(r)}})),na=ns((function(t,e){return Ae(e,(function(e){e=Fs(e),sr(t,e,To(t[e],t))})),t}));function ra(t){return function(){return t}}var ia=Fi(),sa=Fi(!0);function oa(t){return t}function ua(t){return Lr("function"==typeof t?t:ar(t,1))}var aa=Zr((function(t,e){return function(n){return Nr(n,t,e)}})),ha=Zr((function(t,e){return function(n){return Nr(t,n,e)}}));function la(t,e,n){var r=Ru(e),i=xr(e,r);null!=n||ru(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=xr(e,Ru(e)));var s=!(ru(n)&&"chain"in n&&!n.chain),o=tu(t);return Ae(i,(function(n){var r=e[n];t[n]=r,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__);return(n.__actions__=Si(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Le([this.value()],arguments))})})),t}function ca(){}var fa=Gi(Re),da=Gi(Ne),pa=Gi(Pe);function ma(t){return ws(t)?qe(Fs(t)):function(t){return function(e){return Er(e,t)}}(t)}var ga=Wi(),ya=Wi(!0);function _a(){return[]}function va(){return!1}var wa,ba=Xi((function(t,e){return t+e}),0),xa=Hi("ceil"),Ea=Xi((function(t,e){return t/e}),1),Oa=Hi("floor"),Ma=Xi((function(t,e){return t*e}),1),ka=Hi("round"),Ca=Xi((function(t,e){return t-e}),0);return $n.after=function(t,n){if("function"!=typeof n)throw new Nt(e);return t=yu(t),function(){if(--t<1)return n.apply(this,arguments)}},$n.ary=No,$n.assign=xu,$n.assignIn=Eu,$n.assignInWith=Ou,$n.assignWith=Mu,$n.at=ku,$n.before=jo,$n.bind=To,$n.bindAll=na,$n.bindKey=Io,$n.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Vo(t)?t:[t]},$n.chain=mo,$n.chunk=function(e,n,r){n=(r?vs(e,n,r):n===t)?1:_n(yu(n),0);var i=null==e?0:e.length;if(!i||n<1)return[];for(var s=0,o=0,u=ht(me(i/n));s<i;)u[o++]=ri(e,s,s+=n);return u},$n.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i},$n.concat=function(){var t=arguments.length;if(!t)return[];for(var e=ht(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Le(Vo(n)?Si(n):[n],yr(e,1))},$n.cond=function(t){var n=null==t?0:t.length,r=as();return t=n?Re(t,(function(t){if("function"!=typeof t[1])throw new Nt(e);return[r(t[0]),t[1]]})):[],Zr((function(e){for(var r=-1;++r<n;){var i=t[r];if(ke(i[0],this,e))return ke(i[1],this,e)}}))},$n.conforms=function(t){return function(t){var e=Ru(t);return function(n){return hr(n,t,e)}}(ar(t,1))},$n.constant=ra,$n.countBy=_o,$n.create=function(t,e){var n=Yn(t);return null==e?n:ir(n,e)},$n.curry=function e(n,r,i){var s=Ki(n,8,t,t,t,t,t,r=i?t:r);return s.placeholder=e.placeholder,s},$n.curryRight=function e(n,r,s){var o=Ki(n,i,t,t,t,t,t,r=s?t:r);return o.placeholder=e.placeholder,o},$n.debounce=Ro,$n.defaults=Cu,$n.defaultsDeep=Au,$n.defer=Lo,$n.delay=zo,$n.difference=Xs,$n.differenceBy=Gs,$n.differenceWith=Bs,$n.drop=function(e,n,r){var i=null==e?0:e.length;return i?ri(e,(n=r||n===t?1:yu(n))<0?0:n,i):[]},$n.dropRight=function(e,n,r){var i=null==e?0:e.length;return i?ri(e,0,(n=i-(n=r||n===t?1:yu(n)))<0?0:n):[]},$n.dropRightWhile=function(t,e){return t&&t.length?di(t,as(e,3),!0,!0):[]},$n.dropWhile=function(t,e){return t&&t.length?di(t,as(e,3),!0):[]},$n.fill=function(e,n,r,i){var s=null==e?0:e.length;return s?(r&&"number"!=typeof r&&vs(e,n,r)&&(r=0,i=s),function(e,n,r,i){var s=e.length;for((r=yu(r))<0&&(r=-r>s?0:s+r),(i=i===t||i>s?s:yu(i))<0&&(i+=s),i=r>i?0:_u(i);r<i;)e[r++]=n;return e}(e,n,r,i)):[]},$n.filter=function(t,e){return(Vo(t)?je:gr)(t,as(e,3))},$n.flatMap=function(t,e){return yr(ko(t,e),1)},$n.flatMapDeep=function(t,e){return yr(ko(t,e),h)},$n.flatMapDepth=function(e,n,r){return r=r===t?1:yu(r),yr(ko(e,n),r)},$n.flatten=Vs,$n.flattenDeep=function(t){return null!=t&&t.length?yr(t,h):[]},$n.flattenDepth=function(e,n){return null!=e&&e.length?yr(e,n=n===t?1:yu(n)):[]},$n.flip=function(t){return Ki(t,512)},$n.flow=ia,$n.flowRight=sa,$n.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},$n.functions=function(t){return null==t?[]:xr(t,Ru(t))},$n.functionsIn=function(t){return null==t?[]:xr(t,Lu(t))},$n.groupBy=Eo,$n.initial=function(t){return null!=t&&t.length?ri(t,0,-1):[]},$n.intersection=Us,$n.intersectionBy=Zs,$n.intersectionWith=Ks,$n.invert=ju,$n.invertBy=Tu,$n.invokeMap=Oo,$n.iteratee=ua,$n.keyBy=Mo,$n.keys=Ru,$n.keysIn=Lu,$n.map=ko,$n.mapKeys=function(t,e){var n={};return e=as(e,3),wr(t,(function(t,r,i){sr(n,e(t,r,i),t)})),n},$n.mapValues=function(t,e){var n={};return e=as(e,3),wr(t,(function(t,r,i){sr(n,r,e(t,r,i))})),n},$n.matches=function(t){return $r(ar(t,1))},$n.matchesProperty=function(t,e){return Yr(t,ar(e,1))},$n.memoize=Do,$n.merge=zu,$n.mergeWith=Du,$n.method=aa,$n.methodOf=ha,$n.mixin=la,$n.negate=Po,$n.nthArg=function(t){return t=yu(t),Zr((function(e){return Gr(e,t)}))},$n.omit=Pu,$n.omitBy=function(t,e){return $u(t,Po(as(e)))},$n.once=function(t){return jo(2,t)},$n.orderBy=function(e,n,r,i){return null==e?[]:(Vo(n)||(n=null==n?[]:[n]),Vo(r=i?t:r)||(r=null==r?[]:[r]),Br(e,n,r))},$n.over=fa,$n.overArgs=Fo,$n.overEvery=da,$n.overSome=pa,$n.partial=$o,$n.partialRight=Yo,$n.partition=Co,$n.pick=Fu,$n.pickBy=$u,$n.property=ma,$n.propertyOf=function(e){return function(n){return null==e?t:Er(e,n)}},$n.pull=Qs,$n.pullAll=to,$n.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?qr(t,e,as(n,2)):t},$n.pullAllWith=function(e,n,r){return e&&e.length&&n&&n.length?qr(e,n,t,r):e},$n.pullAt=eo,$n.range=ga,$n.rangeRight=ya,$n.rearg=Xo,$n.reject=function(t,e){return(Vo(t)?je:gr)(t,Po(as(e,3)))},$n.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],s=t.length;for(e=as(e,3);++r<s;){var o=t[r];e(o,r,t)&&(n.push(o),i.push(r))}return Vr(t,i),n},$n.rest=function(n,r){if("function"!=typeof n)throw new Nt(e);return Zr(n,r=r===t?r:yu(r))},$n.reverse=no,$n.sampleSize=function(e,n,r){return n=(r?vs(e,n,r):n===t)?1:yu(n),(Vo(e)?Jn:Jr)(e,n)},$n.set=function(t,e,n){return null==t?t:Qr(t,e,n)},$n.setWith=function(e,n,r,i){return i="function"==typeof i?i:t,null==e?e:Qr(e,n,r,i)},$n.shuffle=function(t){return(Vo(t)?Qn:ni)(t)},$n.slice=function(e,n,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&vs(e,n,r)?(n=0,r=i):(n=null==n?0:yu(n),r=r===t?i:yu(r)),ri(e,n,r)):[]},$n.sortBy=Ao,$n.sortedUniq=function(t){return t&&t.length?ui(t):[]},$n.sortedUniqBy=function(t,e){return t&&t.length?ui(t,as(e,2)):[]},$n.split=function(e,n,r){return r&&"number"!=typeof r&&vs(e,n,r)&&(n=r=t),(r=r===t?f:r>>>0)?(e=bu(e))&&("string"==typeof n||null!=n&&!au(n))&&!(n=hi(n))&&un(e)?bi(dn(e),0,r):e.split(n,r):[]},$n.spread=function(t,n){if("function"!=typeof t)throw new Nt(e);return n=null==n?0:_n(yu(n),0),Zr((function(e){var r=e[n],i=bi(e,0,n);return r&&Le(i,r),ke(t,this,i)}))},$n.tail=function(t){var e=null==t?0:t.length;return e?ri(t,1,e):[]},$n.take=function(e,n,r){return e&&e.length?ri(e,0,(n=r||n===t?1:yu(n))<0?0:n):[]},$n.takeRight=function(e,n,r){var i=null==e?0:e.length;return i?ri(e,(n=i-(n=r||n===t?1:yu(n)))<0?0:n,i):[]},$n.takeRightWhile=function(t,e){return t&&t.length?di(t,as(e,3),!1,!0):[]},$n.takeWhile=function(t,e){return t&&t.length?di(t,as(e,3)):[]},$n.tap=function(t,e){return e(t),t},$n.throttle=function(t,n,r){var i=!0,s=!0;if("function"!=typeof t)throw new Nt(e);return ru(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),Ro(t,n,{leading:i,maxWait:n,trailing:s})},$n.thru=go,$n.toArray=mu,$n.toPairs=Yu,$n.toPairsIn=Xu,$n.toPath=function(t){return Vo(t)?Re(t,Fs):cu(t)?[t]:Si(Ps(bu(t)))},$n.toPlainObject=wu,$n.transform=function(t,e,n){var r=Vo(t),i=r||Ko(t)||fu(t);if(e=as(e,4),null==n){var s=t&&t.constructor;n=i?r?new s:[]:ru(t)&&tu(s)?Yn(Vt(t)):{}}return(i?Ae:wr)(t,(function(t,r,i){return e(n,t,r,i)})),n},$n.unary=function(t){return No(t,1)},$n.union=ro,$n.unionBy=io,$n.unionWith=so,$n.uniq=function(t){return t&&t.length?li(t):[]},$n.uniqBy=function(t,e){return t&&t.length?li(t,as(e,2)):[]},$n.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?li(e,t,n):[]},$n.unset=function(t,e){return null==t||ci(t,e)},$n.unzip=oo,$n.unzipWith=uo,$n.update=function(t,e,n){return null==t?t:fi(t,e,_i(n))},$n.updateWith=function(e,n,r,i){return i="function"==typeof i?i:t,null==e?e:fi(e,n,_i(r),i)},$n.values=Gu,$n.valuesIn=function(t){return null==t?[]:Qe(t,Lu(t))},$n.without=ao,$n.words=ta,$n.wrap=function(t,e){return $o(_i(e),t)},$n.xor=ho,$n.xorBy=lo,$n.xorWith=co,$n.zip=fo,$n.zipObject=function(t,e){return gi(t||[],e||[],er)},$n.zipObjectDeep=function(t,e){return gi(t||[],e||[],Qr)},$n.zipWith=po,$n.entries=Yu,$n.entriesIn=Xu,$n.extend=Eu,$n.extendWith=Ou,la($n,$n),$n.add=ba,$n.attempt=ea,$n.camelCase=Bu,$n.capitalize=Wu,$n.ceil=xa,$n.clamp=function(e,n,r){return r===t&&(r=n,n=t),r!==t&&(r=(r=vu(r))==r?r:0),n!==t&&(n=(n=vu(n))==n?n:0),ur(vu(e),n,r)},$n.clone=function(t){return ar(t,4)},$n.cloneDeep=function(t){return ar(t,5)},$n.cloneDeepWith=function(e,n){return ar(e,5,n="function"==typeof n?n:t)},$n.cloneWith=function(e,n){return ar(e,4,n="function"==typeof n?n:t)},$n.conformsTo=function(t,e){return null==e||hr(t,e,Ru(e))},$n.deburr=qu,$n.defaultTo=function(t,e){return null==t||t!=t?e:t},$n.divide=Ea,$n.endsWith=function(e,n,r){e=bu(e),n=hi(n);var i=e.length,s=r=r===t?i:ur(yu(r),0,i);return(r-=n.length)>=0&&e.slice(r,s)==n},$n.eq=Go,$n.escape=function(t){return(t=bu(t))&&V.test(t)?t.replace(W,sn):t},$n.escapeRegExp=function(t){return(t=bu(t))&&et.test(t)?t.replace(tt,"\\$&"):t},$n.every=function(e,n,r){var i=Vo(e)?Ne:pr;return r&&vs(e,n,r)&&(n=t),i(e,as(n,3))},$n.find=vo,$n.findIndex=Ws,$n.findKey=function(t,e){return $e(t,as(e,3),wr)},$n.findLast=wo,$n.findLastIndex=qs,$n.findLastKey=function(t,e){return $e(t,as(e,3),br)},$n.floor=Oa,$n.forEach=bo,$n.forEachRight=xo,$n.forIn=function(t,e){return null==t?t:_r(t,as(e,3),Lu)},$n.forInRight=function(t,e){return null==t?t:vr(t,as(e,3),Lu)},$n.forOwn=function(t,e){return t&&wr(t,as(e,3))},$n.forOwnRight=function(t,e){return t&&br(t,as(e,3))},$n.get=Su,$n.gt=Bo,$n.gte=Wo,$n.has=function(t,e){return null!=t&&ms(t,e,Cr)},$n.hasIn=Nu,$n.head=Hs,$n.identity=oa,$n.includes=function(t,e,n,r){t=Uo(t)?t:Gu(t),n=n&&!r?yu(n):0;var i=t.length;return n<0&&(n=_n(i+n,0)),lu(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Xe(t,e,n)>-1},$n.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:yu(n);return i<0&&(i=_n(r+i,0)),Xe(t,e,i)},$n.inRange=function(e,n,r){return n=gu(n),r===t?(r=n,n=0):r=gu(r),function(t,e,n){return t>=vn(e,n)&&t<_n(e,n)}(e=vu(e),n,r)},$n.invoke=Iu,$n.isArguments=qo,$n.isArray=Vo,$n.isArrayBuffer=Ho,$n.isArrayLike=Uo,$n.isArrayLikeObject=Zo,$n.isBoolean=function(t){return!0===t||!1===t||iu(t)&&Mr(t)==g},$n.isBuffer=Ko,$n.isDate=Jo,$n.isElement=function(t){return iu(t)&&1===t.nodeType&&!uu(t)},$n.isEmpty=function(t){if(null==t)return!0;if(Uo(t)&&(Vo(t)||"string"==typeof t||"function"==typeof t.splice||Ko(t)||fu(t)||qo(t)))return!t.length;var e=ps(t);if(e==b||e==k)return!t.size;if(Es(t))return!zr(t).length;for(var n in t)if(zt.call(t,n))return!1;return!0},$n.isEqual=function(t,e){return Tr(t,e)},$n.isEqualWith=function(e,n,r){var i=(r="function"==typeof r?r:t)?r(e,n):t;return i===t?Tr(e,n,t,r):!!i},$n.isError=Qo,$n.isFinite=function(t){return"number"==typeof t&&Fe(t)},$n.isFunction=tu,$n.isInteger=eu,$n.isLength=nu,$n.isMap=su,$n.isMatch=function(t,e){return t===e||Ir(t,e,ls(e))},$n.isMatchWith=function(e,n,r){return r="function"==typeof r?r:t,Ir(e,n,ls(n),r)},$n.isNaN=function(t){return ou(t)&&t!=+t},$n.isNative=function(t){if(xs(t))throw new Ot("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rr(t)},$n.isNil=function(t){return null==t},$n.isNull=function(t){return null===t},$n.isNumber=ou,$n.isObject=ru,$n.isObjectLike=iu,$n.isPlainObject=uu,$n.isRegExp=au,$n.isSafeInteger=function(t){return eu(t)&&t>=-9007199254740991&&t<=l},$n.isSet=hu,$n.isString=lu,$n.isSymbol=cu,$n.isTypedArray=fu,$n.isUndefined=function(e){return e===t},$n.isWeakMap=function(t){return iu(t)&&ps(t)==S},$n.isWeakSet=function(t){return iu(t)&&"[object WeakSet]"==Mr(t)},$n.join=function(t,e){return null==t?"":Ve.call(t,e)},$n.kebabCase=Vu,$n.last=Js,$n.lastIndexOf=function(e,n,r){var i=null==e?0:e.length;if(!i)return-1;var s=i;return r!==t&&(s=(s=yu(r))<0?_n(i+s,0):vn(s,i-1)),n==n?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(e,n,s):Ye(e,Be,s,!0)},$n.lowerCase=Hu,$n.lowerFirst=Uu,$n.lt=du,$n.lte=pu,$n.max=function(e){return e&&e.length?mr(e,oa,kr):t},$n.maxBy=function(e,n){return e&&e.length?mr(e,as(n,2),kr):t},$n.mean=function(t){return We(t,oa)},$n.meanBy=function(t,e){return We(t,as(e,2))},$n.min=function(e){return e&&e.length?mr(e,oa,Pr):t},$n.minBy=function(e,n){return e&&e.length?mr(e,as(n,2),Pr):t},$n.stubArray=_a,$n.stubFalse=va,$n.stubObject=function(){return{}},$n.stubString=function(){return""},$n.stubTrue=function(){return!0},$n.multiply=Ma,$n.nth=function(e,n){return e&&e.length?Gr(e,yu(n)):t},$n.noConflict=function(){return pe._===this&&(pe._=Yt),this},$n.noop=ca,$n.now=So,$n.pad=function(t,e,n){t=bu(t);var r=(e=yu(e))?fn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Bi(ge(i),n)+t+Bi(me(i),n)},$n.padEnd=function(t,e,n){t=bu(t);var r=(e=yu(e))?fn(t):0;return e&&r<e?t+Bi(e-r,n):t},$n.padStart=function(t,e,n){t=bu(t);var r=(e=yu(e))?fn(t):0;return e&&r<e?Bi(e-r,n)+t:t},$n.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),bn(bu(t).replace(nt,""),e||0)},$n.random=function(e,n,r){if(r&&"boolean"!=typeof r&&vs(e,n,r)&&(n=r=t),r===t&&("boolean"==typeof n?(r=n,n=t):"boolean"==typeof e&&(r=e,e=t)),e===t&&n===t?(e=0,n=1):(e=gu(e),n===t?(n=e,e=0):n=gu(n)),e>n){var i=e;e=n,n=i}if(r||e%1||n%1){var s=xn();return vn(e+s*(n-e+le("1e-"+((s+"").length-1))),n)}return Hr(e,n)},$n.reduce=function(t,e,n){var r=Vo(t)?ze:He,i=arguments.length<3;return r(t,as(e,4),n,i,fr)},$n.reduceRight=function(t,e,n){var r=Vo(t)?De:He,i=arguments.length<3;return r(t,as(e,4),n,i,dr)},$n.repeat=function(e,n,r){return n=(r?vs(e,n,r):n===t)?1:yu(n),Ur(bu(e),n)},$n.replace=function(){var t=arguments,e=bu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},$n.result=function(e,n,r){var i=-1,s=(n=vi(n,e)).length;for(s||(s=1,e=t);++i<s;){var o=null==e?t:e[Fs(n[i])];o===t&&(i=s,o=r),e=tu(o)?o.call(e):o}return e},$n.round=ka,$n.runInContext=rt,$n.sample=function(t){return(Vo(t)?Kn:Kr)(t)},$n.size=function(t){if(null==t)return 0;if(Uo(t))return lu(t)?fn(t):t.length;var e=ps(t);return e==b||e==k?t.size:zr(t).length},$n.snakeCase=Zu,$n.some=function(e,n,r){var i=Vo(e)?Pe:ii;return r&&vs(e,n,r)&&(n=t),i(e,as(n,3))},$n.sortedIndex=function(t,e){return si(t,e)},$n.sortedIndexBy=function(t,e,n){return oi(t,e,as(n,2))},$n.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=si(t,e);if(r<n&&Go(t[r],e))return r}return-1},$n.sortedLastIndex=function(t,e){return si(t,e,!0)},$n.sortedLastIndexBy=function(t,e,n){return oi(t,e,as(n,2),!0)},$n.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=si(t,e,!0)-1;if(Go(t[n],e))return n}return-1},$n.startCase=Ku,$n.startsWith=function(t,e,n){return t=bu(t),n=null==n?0:ur(yu(n),0,t.length),e=hi(e),t.slice(n,n+e.length)==e},$n.subtract=Ca,$n.sum=function(t){return t&&t.length?Ue(t,oa):0},$n.sumBy=function(t,e){return t&&t.length?Ue(t,as(e,2)):0},$n.template=function(e,n,r){var i=$n.templateSettings;r&&vs(e,n,r)&&(n=t),e=bu(e),n=Ou({},n,i,Ji);var s,o,u=Ou({},n.imports,i.imports,Ji),a=Ru(u),h=Qe(u,a),l=0,c=n.interpolate||bt,f="__p += '",d=At((n.escape||bt).source+"|"+c.source+"|"+(c===Z?dt:bt).source+"|"+(n.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(zt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";e.replace(d,(function(t,n,r,i,u,a){return r||(r=i),f+=e.slice(l,a).replace(xt,on),n&&(s=!0,f+="' +\n__e("+n+") +\n'"),u&&(o=!0,f+="';\n"+u+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=a+t.length,t})),f+="';\n";var m=zt.call(n,"variable")&&n.variable;if(m){if(ct.test(m))throw new Ot("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(o?f.replace(Y,""):f).replace(X,"$1").replace(G,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g=ea((function(){return Mt(a,p+"return "+f).apply(t,h)}));if(g.source=f,Qo(g))throw g;return g},$n.times=function(t,e){if((t=yu(t))<1||t>l)return[];var n=f,r=vn(t,f);e=as(e),t-=f;for(var i=Ze(r,e);++n<t;)e(n);return i},$n.toFinite=gu,$n.toInteger=yu,$n.toLength=_u,$n.toLower=function(t){return bu(t).toLowerCase()},$n.toNumber=vu,$n.toSafeInteger=function(t){return t?ur(yu(t),-9007199254740991,l):0===t?t:0},$n.toString=bu,$n.toUpper=function(t){return bu(t).toUpperCase()},$n.trim=function(e,n,r){if((e=bu(e))&&(r||n===t))return Ke(e);if(!e||!(n=hi(n)))return e;var i=dn(e),s=dn(n);return bi(i,en(i,s),nn(i,s)+1).join("")},$n.trimEnd=function(e,n,r){if((e=bu(e))&&(r||n===t))return e.slice(0,pn(e)+1);if(!e||!(n=hi(n)))return e;var i=dn(e);return bi(i,0,nn(i,dn(n))+1).join("")},$n.trimStart=function(e,n,r){if((e=bu(e))&&(r||n===t))return e.replace(nt,"");if(!e||!(n=hi(n)))return e;var i=dn(e);return bi(i,en(i,dn(n))).join("")},$n.truncate=function(e,n){var r=30,i="...";if(ru(n)){var s="separator"in n?n.separator:s;r="length"in n?yu(n.length):r,i="omission"in n?hi(n.omission):i}var o=(e=bu(e)).length;if(un(e)){var u=dn(e);o=u.length}if(r>=o)return e;var a=r-fn(i);if(a<1)return i;var h=u?bi(u,0,a).join(""):e.slice(0,a);if(s===t)return h+i;if(u&&(a+=h.length-a),au(s)){if(e.slice(a).search(s)){var l,c=h;for(s.global||(s=At(s.source,bu(pt.exec(s))+"g")),s.lastIndex=0;l=s.exec(c);)var f=l.index;h=h.slice(0,f===t?a:f)}}else if(e.indexOf(hi(s),a)!=a){var d=h.lastIndexOf(s);d>-1&&(h=h.slice(0,d))}return h+i},$n.unescape=function(t){return(t=bu(t))&&q.test(t)?t.replace(B,mn):t},$n.uniqueId=function(t){var e=++Dt;return bu(t)+e},$n.upperCase=Ju,$n.upperFirst=Qu,$n.each=bo,$n.eachRight=xo,$n.first=Hs,la($n,(wa={},wr($n,(function(t,e){zt.call($n.prototype,e)||(wa[e]=t)})),wa),{chain:!1}),$n.VERSION="4.17.21",Ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){$n[t].placeholder=$n})),Ae(["drop","take"],(function(e,n){Bn.prototype[e]=function(r){r=r===t?1:_n(yu(r),0);var i=this.__filtered__&&!n?new Bn(this):this.clone();return i.__filtered__?i.__takeCount__=vn(r,i.__takeCount__):i.__views__.push({size:vn(r,f),type:e+(i.__dir__<0?"Right":"")}),i},Bn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ae(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Bn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:as(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ae(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Bn.prototype[t]=function(){return this[n](1).value()[0]}})),Ae(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Bn.prototype[t]=function(){return this.__filtered__?new Bn(this):this[n](1)}})),Bn.prototype.compact=function(){return this.filter(oa)},Bn.prototype.find=function(t){return this.filter(t).head()},Bn.prototype.findLast=function(t){return this.reverse().find(t)},Bn.prototype.invokeMap=Zr((function(t,e){return"function"==typeof t?new Bn(this):this.map((function(n){return Nr(n,t,e)}))})),Bn.prototype.reject=function(t){return this.filter(Po(as(t)))},Bn.prototype.slice=function(e,n){e=yu(e);var r=this;return r.__filtered__&&(e>0||n<0)?new Bn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),n!==t&&(r=(n=yu(n))<0?r.dropRight(-n):r.take(n-e)),r)},Bn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Bn.prototype.toArray=function(){return this.take(f)},wr(Bn.prototype,(function(e,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),i=/^(?:head|last)$/.test(n),s=$n[i?"take"+("last"==n?"Right":""):n],o=i||/^find/.test(n);s&&($n.prototype[n]=function(){var n=this.__wrapped__,u=i?[1]:arguments,a=n instanceof Bn,h=u[0],l=a||Vo(n),c=function(t){var e=s.apply($n,Le([t],u));return i&&f?e[0]:e};l&&r&&"function"==typeof h&&1!=h.length&&(a=l=!1);var f=this.__chain__,d=!!this.__actions__.length,p=o&&!f,m=a&&!d;if(!o&&l){n=m?n:new Bn(this);var g=e.apply(n,u);return g.__actions__.push({func:go,args:[c],thisArg:t}),new Gn(g,f)}return p&&m?e.apply(this,u):(g=this.thru(c),p?i?g.value()[0]:g.value():g)})})),Ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=jt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);$n.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Vo(i)?i:[],t)}return this[n]((function(n){return e.apply(Vo(n)?n:[],t)}))}})),wr(Bn.prototype,(function(t,e){var n=$n[e];if(n){var r=n.name+"";zt.call(jn,r)||(jn[r]=[]),jn[r].push({name:e,func:n})}})),jn[$i(t,2).name]=[{name:"wrapper",func:t}],Bn.prototype.clone=function(){var t=new Bn(this.__wrapped__);return t.__actions__=Si(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Si(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Si(this.__views__),t},Bn.prototype.reverse=function(){if(this.__filtered__){var t=new Bn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Bn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Vo(t),r=e<0,i=n?t.length:0,s=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var s=n[r],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=vn(e,t+o);break;case"takeRight":t=_n(t,e-o)}}return{start:t,end:e}}(0,i,this.__views__),o=s.start,u=s.end,a=u-o,h=r?u:o-1,l=this.__iteratees__,c=l.length,f=0,d=vn(a,this.__takeCount__);if(!n||!r&&i==a&&d==a)return pi(t,this.__actions__);var p=[];t:for(;a--&&f<d;){for(var m=-1,g=t[h+=e];++m<c;){var y=l[m],_=y.iteratee,v=y.type,w=_(g);if(2==v)g=w;else if(!w){if(1==v)continue t;break t}}p[f++]=g}return p},$n.prototype.at=yo,$n.prototype.chain=function(){return mo(this)},$n.prototype.commit=function(){return new Gn(this.value(),this.__chain__)},$n.prototype.next=function(){this.__values__===t&&(this.__values__=mu(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},$n.prototype.plant=function(e){for(var n,r=this;r instanceof Xn;){var i=Ys(r);i.__index__=0,i.__values__=t,n?s.__wrapped__=i:n=i;var s=i;r=r.__wrapped__}return s.__wrapped__=e,n},$n.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Bn){var n=e;return this.__actions__.length&&(n=new Bn(this)),(n=n.reverse()).__actions__.push({func:go,args:[no],thisArg:t}),new Gn(n,this.__chain__)}return this.thru(no)},$n.prototype.toJSON=$n.prototype.valueOf=$n.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},$n.prototype.first=$n.prototype.head,Jt&&($n.prototype[Jt]=function(){return this}),$n}();ge?((ge.exports=gn)._=gn,me._=gn):pe._=gn}.call(ht);const ct={},ft=[];function dt(t,e){if(Array.isArray(t))for(const n of t)dt(n,e);else if("object"!=typeof t)mt(Object.getOwnPropertyNames(e)),ct[t]=Object.assign(ct[t]||{},e);else for(const n in t)dt(n,t[n])}function pt(t){return ct[t]||{}}function mt(t){ft.push(...t)}function gt(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function yt(t){return t%360*Math.PI/180}function _t(t){return t.charAt(0).toUpperCase()+t.slice(1)}function vt(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function wt(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:u,y:a}=e.bbox();s&&(r=r.includes("left")?u:r.includes("right")?u+n:u+n/2),o&&(i=i.includes("top")?a:i.includes("bottom")?a+t:a+t/2)}return[r,i]}const bt=new Set(["desc","metadata","title"]),xt=t=>bt.has(t.nodeName),Et=(t,e,n={})=>{const r={...e};for(const i in r)r[i].valueOf()===n[i]&&delete r[i];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},Ot="http://www.w3.org/2000/svg",Mt="http://www.w3.org/2000/xmlns/",kt="http://www.w3.org/1999/xlink",Ct={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};let At=class{};const St={},Nt="___SYMBOL___ROOT___";function jt(t,e=Ot){return Ct.document.createElementNS(e,t)}function Tt(t,e=!1){if(t instanceof At)return t;if("object"==typeof t)return Lt(t);if(null==t)return new St[Nt];if("string"==typeof t&&"<"!==t.charAt(0))return Lt(Ct.document.querySelector(t));const n=e?Ct.document.createElement("div"):jt("svg");return n.innerHTML=t,t=Lt(n.firstChild),n.removeChild(n.firstChild),t}function It(t,e){return e&&(e instanceof Ct.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:jt(t)}function Rt(t){if(!t)return null;if(t.instance instanceof At)return t.instance;if("#document-fragment"===t.nodeName)return new St.Fragment(t);let e=_t(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":St[e]||(e="Dom"),new St[e](t)}let Lt=Rt;function zt(t,e=t.name,n=!1){return St[e]=t,n&&(St[Nt]=t),mt(Object.getOwnPropertyNames(t.prototype)),t}let Dt=1e3;function Pt(t){return"Svgjs"+_t(t)+Dt++}function Ft(t){for(let e=t.children.length-1;e>=0;e--)Ft(t.children[e]);return t.id?(t.id=Pt(t.nodeName),t):t}function $t(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function Yt(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}dt("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=Tt(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=Tt(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=Tt(t)).before(this),this},insertAfter:function(t){return(t=Tt(t)).after(this),this}});const Xt=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,Gt=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Bt=/rgb\((\d+),(\d+),(\d+)\)/,Wt=/(#[a-z_][a-z0-9\-_]*)/i,qt=/\)\s*,?\s*/,Vt=/\s/g,Ht=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,Ut=/^rgb\(/,Zt=/^(\s+)?$/,Kt=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Jt=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Qt=/[\s,]+/,te=/[MLHVCSQTAZ]/i;function ee(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function ne(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function re(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}dt("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Qt)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),dt("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||Zt.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||Zt.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),dt("Dom",{data:function(t,e,n){if(null==t)return this.data(gt(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(r){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),dt("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});let ie=class t{constructor(...t){this.init(...t)}static isColor(e){return e&&(e instanceof t||this.isRgb(e)||this.test(e))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(e="vibrant",n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===e){const e=24*r()+57,n=38*r()+45,i=360*r();return new t(e,n,i,"lch")}if("sine"===e){const e=i(80*s(2*o*(n=null==n?r():n)/.5+.01)+150),u=i(50*s(2*o*n/.5+4.6)+200),a=i(100*s(2*o*n/.5+2.3)+150);return new t(e,u,a)}if("pastel"===e){const e=8*r()+86,n=17*r()+9,i=360*r();return new t(e,n,i,"lch")}if("dark"===e){const e=10+10*r(),n=50*r()+86,i=360*r();return new t(e,n,i,"lch")}if("rgb"===e){const e=255*r(),n=255*r(),i=255*r();return new t(e,n,i)}if("lab"===e){const e=100*r(),n=256*r()-128,i=256*r()-128;return new t(e,n,i,"lab")}if("grey"===e){const e=255*r();return new t(e,e,e)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(Ht.test(t)||Ut.test(t))}cmyk(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),u=Math.min(1-i,1-s,1-o);if(1===u)return new t(0,0,0,1,"cmyk");return new t((1-i-u)/(1-u),(1-s-u)/(1-u),(1-o-u)/(1-u),u,"cmyk")}hsl(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),u=Math.max(i,s,o),a=Math.min(i,s,o),h=(u+a)/2,l=u===a,c=u-a;return new t(360*(l?0:u===i?((s-o)/c+(s<o?6:0))/6:u===s?((o-i)/c+2)/6:u===o?((i-s)/c+4)/6:0),100*(l?0:h>.5?c/(2-u-a):c/(u+a)),100*h,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const c in this.space)delete this[this.space[c]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=ne(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:ne(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:ne(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:ne(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:ne(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:ne(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(Ut.test(t)){const e=t.replace(Vt,""),[n,r,i]=Bt.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!Ht.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=Gt.exec((s=t,4===s.length?["#",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(""):s)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var s;const{_a:o,_b:u,_c:a,_d:h}=this,l="rgb"===this.space?{r:o,g:u,b:a}:"xyz"===this.space?{x:o,y:u,z:a}:"hsl"===this.space?{h:o,s:u,l:a}:"lab"===this.space?{l:o,a:u,b:a}:"lch"===this.space?{l:o,c:u,h:a}:"cmyk"===this.space?{c:o,m:u,y:a,k:h}:{};Object.assign(this,l)}lab(){const{x:e,y:n,z:r}=this.xyz();return new t(116*n-16,500*(e-n),200*(n-r),"lab")}lch(){const{l:e,a:n,b:r}=this.lab(),i=Math.sqrt(n**2+r**2);let s=180*Math.atan2(r,n)/Math.PI;s<0&&(s*=-1,s=360-s);return new t(e,i,s,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(e=this.space)||"xyz"===e||"lch"===e){let{x:e,y:n,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:t,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(t+16)/116,u=i/500+o,a=o-s/200,h=16/116,l=.008856,c=7.787;e=.95047*(u**3>l?u**3:(u-h)/c),n=1*(o**3>l?o**3:(o-h)/c),r=1.08883*(a**3>l?a**3:(a-h)/c)}const i=3.2406*e+-1.5372*n+-.4986*r,s=-.9689*e+1.8758*n+.0415*r,o=.0557*e+-.204*n+1.057*r,u=Math.pow,a=.0031308,h=i>a?1.055*u(i,1/2.4)-.055:12.92*i,l=s>a?1.055*u(s,1/2.4)-.055:12.92*s,c=o>a?1.055*u(o,1/2.4)-.055:12.92*o;return new t(255*h,255*l,255*c)}if("hsl"===this.space){let{h:e,s:n,l:r}=this;if(e/=360,n/=100,r/=100,0===n){r*=255;return new t(r,r,r)}const i=r<.5?r*(1+n):r+n-r*n,s=2*r-i,o=255*re(s,i,e+1/3),u=255*re(s,i,e),a=255*re(s,i,e-1/3);return new t(o,u,a)}if("cmyk"===this.space){const{c:e,m:n,y:r,k:i}=this,s=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,n*(1-i)+i)),u=255*(1-Math.min(1,r*(1-i)+i));return new t(s,o,u)}return this;var e}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(ee);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),u=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,l=(.4124*u+.3576*a+.1805*h)/.95047,c=(.2126*u+.7152*a+.0722*h)/1,f=(.0193*u+.1192*a+.9505*h)/1.08883,d=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116,m=f>.008856?Math.pow(f,1/3):7.787*f+16/116;return new t(d,p,m,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}},se=class t{constructor(...t){this.init(...t)}clone(){return new t(this)}init(t,e){const n=0,r=0,i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ue.isMatrixLike(t)||(t=new ue(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}};function oe(t,e,n){return Math.abs(e-t)<1e-6}let ue=class t{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,u=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,a=t.shear||0,h=t.rotate||t.theta||0,l=new se(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new se(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new se(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,_=g.y,v=new se(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:u,skewX:i,skewY:s,shear:a,theta:h,rx:v.x,ry:v.y,tx:y,ty:_,ox:c,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,u=t.e+t.a*e.e+t.c*e.f,a=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=u,n.f=a,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new t(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,u=this.f,a=n*s-r*i,h=a>0?1:-1,l=h*Math.sqrt(n*n+r*r),c=Math.atan2(h*r,h*n),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/a,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*l+e*(m*d*l-p*g),translateY:u-e+t*p*l+e*(m*p*l+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;const n=new t(e);return oe(this.a,n.a)&&oe(this.b,n.b)&&oe(this.c,n.c)&&oe(this.d,n.d)&&oe(this.e,n.e)&&oe(this.f,n.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(e){const n=t.fromArray([1,0,0,1,0,0]);return e=e instanceof Te?e.matrixify():"string"==typeof e?t.fromArray(e.split(Qt).map(parseFloat)):Array.isArray(e)?t.fromArray(e):"object"==typeof e&&t.isMatrixLike(e)?e:"object"==typeof e?(new t).transform(e):6===arguments.length?t.fromArray([].slice.call(arguments)):n,this.a=null!=e.a?e.a:n.a,this.b=null!=e.b?e.b:n.b,this.c=null!=e.c?e.c:n.c,this.d=null!=e.d?e.d:n.d,this.e=null!=e.e?e.e:n.e,this.f=null!=e.f?e.f:n.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const u=r/o,a=-e/o,h=-n/o,l=t/o,c=-(u*i+h*s),f=-(a*i+l*s);return this.a=u,this.b=a,this.c=h,this.d=l,this.e=c,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(e){const n=e instanceof t?e:new t(e);return t.matrixMultiply(n,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(e){const n=e instanceof t?e:new t(e);return t.matrixMultiply(this,n,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=yt(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:u,d:a,e:h,f:l}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=u*r-a*i,this.d=a*r+u*i,this.e=h*r-l*i+n*i-e*r+e,this.f=l*r+h*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:u,e:a,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=u*e,this.e=a*t-n*t+n,this.f=h*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:u,f:a}=this;return this.a=r+i*t,this.c=s+o*t,this.e=u+a*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=yt(t),e=yt(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:u,c:a,d:h,e:l,f:c}=this;return this.a=o+u*i,this.b=u+o*s,this.c=a+h*i,this.d=h+a*s,this.e=l+c*i-r*i,this.f=c+l*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(e){if(t.isMatrixLike(e)){return new t(e).multiplyO(this)}const n=t.formatTransforms(e),{x:r,y:i}=new se(n.ox,n.oy).transform(this),s=(new t).translateO(n.rx,n.ry).lmultiplyO(this).translateO(-r,-i).scaleO(n.scaleX,n.scaleY).skewO(n.skewX,n.skewY).shearO(n.shear).rotateO(n.theta).translateO(r,i);if(isFinite(n.px)||isFinite(n.py)){const t=new se(r,i).transform(s),e=isFinite(n.px)?n.px-t.x:0,o=isFinite(n.py)?n.py-t.y:0;s.translateO(e,o)}return s.translateO(n.tx,n.ty),s}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}};function ae(){if(!ae.nodes){const t=Tt().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;ae.nodes={svg:t,path:e}}if(!ae.nodes.svg.node.parentNode){const t=Ct.document.body||Ct.document.documentElement;ae.nodes.svg.addTo(t)}return ae.nodes}function he(t){return!(t.width||t.height||t.x||t.y)}zt(ue,"Matrix");let le=class t{constructor(...t){this.init(...t)}addOffset(){return this.x+=Ct.window.pageXOffset,this.y+=Ct.window.pageYOffset,new t(this)}init(t){return t="string"==typeof t?t.split(Qt).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return he(this)}merge(e){const n=Math.min(this.x,e.x),r=Math.min(this.y,e.y),i=Math.max(this.x+this.width,e.x+e.width)-n,s=Math.max(this.y+this.height,e.y+e.height)-r;return new t(n,r,i,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof ue||(e=new ue(e));let n=1/0,r=-1/0,i=1/0,s=-1/0;return[new se(this.x,this.y),new se(this.x2,this.y),new se(this.x,this.y2),new se(this.x2,this.y2)].forEach((function(t){t=t.transform(e),n=Math.min(n,t.x),r=Math.max(r,t.x),i=Math.min(i,t.y),s=Math.max(s,t.y)})),new t(n,i,r-n,s-i)}};function ce(t,e,n){let r;try{if(r=e(t.node),he(r)&&((i=t.node)!==Ct.document&&!(Ct.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===Ct.document}).call(Ct.document.documentElement,i)))throw new Error("Element not in the dom")}catch(s){r=n(t)}var i;return r}dt({viewbox:{viewbox(t,e,n,r){return null==t?new le(this.attr("viewBox")):this.attr("viewBox",new le(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,u=Math.min(s,o);if(null==t)return u;let a=u/t;a===1/0&&(a=Number.MAX_SAFE_INTEGER/100),e=e||new se(n/2/s+i.x,r/2/o+i.y);const h=new le(i).transform(new ue({scale:a,origin:e}));return this.viewbox(h)}}}),zt(le,"Box");let fe=class extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}};$t([fe],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const de=["toArray","constructor","each"];function pe(t,e){return new fe(gt((e||Ct.document).querySelectorAll(t),(function(t){return Rt(t)})))}fe.extend=function(t){t=t.reduce(((t,e)=>(de.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),$t([fe],t)};let me=0;const ge={};function ye(t){let e=t.getEventHolder();return e===Ct.window&&(e=ge),e.events||(e.events={}),e.events}function _e(t){return t.getEventTarget()}function ve(t,e,n,r,i){const s=n.bind(r||t),o=Tt(t),u=ye(o),a=_e(o);e=Array.isArray(e)?e:e.split(Qt),n._svgjsListenerId||(n._svgjsListenerId=++me),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";u[e]=u[e]||{},u[e][r]=u[e][r]||{},u[e][r][n._svgjsListenerId]=s,a.addEventListener(e,s,i||!1)}))}function we(t,e,n,r){const i=Tt(t),s=ye(i),o=_e(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Qt)).forEach((function(t){const e=t&&t.split(".")[0],u=t&&t.split(".")[1];let a,h;if(n)s[e]&&s[e][u||"*"]&&(o.removeEventListener(e,s[e][u||"*"][n],r||!1),delete s[e][u||"*"][n]);else if(e&&u){if(s[e]&&s[e][u]){for(h in s[e][u])we(o,[e,u].join("."),h);delete s[e][u]}}else if(u)for(t in s)for(a in s[t])u===a&&we(o,[t,u].join("."));else if(e){if(s[e]){for(a in s[e])we(o,[e,a].join("."));delete s[e]}}else{for(t in s)we(o,t);!function(t){let e=t.getEventHolder();e===Ct.window&&(e=ge),e.events&&(e.events={})}(i)}}))}let be=class extends At{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=_e(t);return e instanceof Ct.window.Event||(e=new Ct.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const r in n)for(const e in n[r])n[r][e](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return we(this,t,e,n),this}on(t,e,n,r){return ve(this,t,e,n,r),this}removeEventListener(){}};function xe(){}zt(be,"EventTarget");const Ee=400,Oe=">",Me=0,ke={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};let Ce=class extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(Qt).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}},Ae=class t{constructor(...t){this.init(...t)}convert(e){return new t(this.value,e)}divide(e){return e=new t(e),new t(this/e,this.unit||e.unit)}init(e,n){return n=Array.isArray(e)?e[1]:n,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=n||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(n=e.match(Xt))&&(this.value=parseFloat(n[1]),"%"===n[5]?this.value/=100:"s"===n[5]&&(this.value*=1e3),this.unit=n[5]):e instanceof t&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new t(e),new t(this-e,this.unit||e.unit)}plus(e){return e=new t(e),new t(this+e,this.unit||e.unit)}times(e){return e=new t(e),new t(this*e,this.unit||e.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}};const Se=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Ne=[];let je=class t extends be{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=Tt(t)).removeNamespace&&this.node instanceof Ct.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return Tt(t).put(this,e)}children(){return new fe(gt(this.node.children,(function(t){return Rt(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=Ft(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(e,n){return this.put(new t(jt(e),n))}first(){return Rt(this.node.firstChild)}get(t){return Rt(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=Pt(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return Rt(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=Rt(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=Rt(e.node.parentNode));return e}put(t,e){return t=Tt(t),this.add(t,e),t}putIn(t,e){return Tt(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=Tt(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const i in r)"number"==typeof r[i]&&(r[i]=Math.round(r[i]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,Ot)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=Rt(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=jt("wrapper",n),i=Ct.document.createDocumentFragment();r.innerHTML=t;for(let o=r.children.length;o--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}};$t(je,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=Kt.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?ke[t]:Kt.test(e)?parseFloat(e):e;"number"==typeof(e=Ne.reduce(((e,n)=>n(t,e,this)),e))?e=new Ae(e):Se.has(t)&&ie.isColor(e)?e=new ie(e):e.constructor===Array&&(e=new Ce(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return pe(t,this.node)},findOne:function(t){return Rt(this.node.querySelector(t))}}),zt(je,"Dom");let Te=class extends je{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new Ae(t).plus(this.x()))}dy(t=0){return this.y(new Ae(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=Tt(t));const n=new fe;let r=this;for(;(r=r.parent())&&r.node!==Ct.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(Wt);return e?Tt(e[1]):null}root(){const t=this.parent(St[Nt]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=vt(this,t,e);return this.width(new Ae(n.width)).height(new Ae(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return Et(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}};$t(Te,{bbox:function(){const t=ce(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(ae().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new le(t)},rbox:function(t){const e=ce(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new le(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new se(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new ue(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new ue(e)}return new ue(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new ue}}}),zt(Te,"Element");const Ie={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof ie||ie.isRgb(e)||e instanceof Te)this.attr(t,e);else for(n=Ie[t].length-1;n>=0;n--)null!=e[Ie[t][n]]&&this.attr(Ie.prefix(t,Ie[t][n]),e[Ie[t][n]]);return this},dt(["Element","Runner"],e)})),dt(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new ue(this):this.attr("transform",new ue(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),dt("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Ae(t)):this.rx(t).ry(e)}}),dt("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new se(this.node.getPointAtLength(t))}}),dt(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});dt("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),dt("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(qt).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(Qt).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(ue.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new ue)},toParent:function(t,e){if(this===t)return this;if(xt(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new ue(this).decompose();return null==t?e:e[t]}ue.isMatrixLike(t)||(t={...t,origin:wt(t,this)});const n=new ue(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});let Re=class t extends Te{flatten(){return this.each((function(){if(this instanceof t)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}};zt(Re,"Container");let Le=class extends Re{constructor(t,e=t){super(It("defs",t),e)}flatten(){return this}ungroup(){return this}};zt(Le,"Defs");let ze=class extends Te{};function De(t){return this.attr("rx",t)}function Pe(t){return this.attr("ry",t)}function Fe(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function $e(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Ye(t){return this.attr("cx",t)}function Xe(t){return this.attr("cy",t)}function Ge(t){return null==t?2*this.rx():this.rx(new Ae(t).divide(2))}function Be(t){return null==t?2*this.ry():this.ry(new Ae(t).divide(2))}zt(ze,"Shape");const We=Object.freeze(Object.defineProperty({__proto__:null,cx:Ye,cy:Xe,height:Be,rx:De,ry:Pe,width:Ge,x:Fe,y:$e},Symbol.toStringTag,{value:"Module"}));let qe=class extends ze{constructor(t,e=t){super(It("ellipse",t),e)}size(t,e){const n=vt(this,t,e);return this.rx(new Ae(n.width).divide(2)).ry(new Ae(n.height).divide(2))}};$t(qe,We),dt("Container",{ellipse:Yt((function(t=0,e=t){return this.put(new qe).size(t,e).move(0,0)}))}),zt(qe,"Ellipse");let Ve=class extends je{constructor(t=Ct.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new je(jt("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}};function He(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Ae(t),fy:new Ae(e)}):this.attr({x1:new Ae(t),y1:new Ae(e)})}function Ue(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Ae(t),cy:new Ae(e)}):this.attr({x2:new Ae(t),y2:new Ae(e)})}zt(Ve,"Fragment");const Ze=Object.freeze(Object.defineProperty({__proto__:null,from:He,to:Ue},Symbol.toStringTag,{value:"Module"}));let Ke=class extends Re{constructor(t,e){super(It(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new le}targets(){return pe("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};$t(Ke,Ze),dt({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:Yt((function(t,e){return this.put(new Ke(t)).update(e)}))}}),zt(Ke,"Gradient");let Je=class extends Re{constructor(t,e=t){super(It("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new le}targets(){return pe("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};dt({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:Yt((function(t,e,n){return this.put(new Je).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),zt(Je,"Pattern");let Qe=class extends ze{constructor(t,e=t){super(It("image",t),e)}load(t,e){if(!t)return this;const n=new Ct.window.Image;return ve(n,"load",(function(t){const r=this.parent(Je);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof Je&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),ve(n,"load error",(function(){we(n)})),this.attr("href",n.src=t,kt)}};var tn;tn=function(t,e,n){return"fill"!==t&&"stroke"!==t||Jt.test(e)&&(e=n.root().defs().image(e)),e instanceof Qe&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Ne.push(tn),dt({Container:{image:Yt((function(t,e){return this.put(new Qe).size(0,0).load(t,e)}))}}),zt(Qe,"Image");let en=class extends Ce{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new le(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(Qt).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){ue.isMatrixLike(t)||(t=new ue(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}};const nn=en;const rn=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:nn,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},Symbol.toStringTag,{value:"Module"}));let sn=class extends ze{constructor(t,e=t){super(It("line",t),e)}array(){return new en([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new en(t).toLine(),this.attr(t))}size(t,e){const n=vt(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}};$t(sn,rn),dt({Container:{line:Yt((function(...t){return sn.prototype.plot.apply(this.put(new sn),null!=t[0]?t:[0,0,0,0])}))}}),zt(sn,"Line");let on=class extends Re{constructor(t,e=t){super(It("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}};function un(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}dt({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:Yt((function(t,e,n){return this.put(new on).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof on?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),zt(on,"Marker");const an={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};let hn=class{done(){return!1}},ln=class extends hn{constructor(t=Oe){super(),this.ease=an[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}},cn=class extends hn{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}};function fn(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}$t(class extends cn{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:un("_duration",fn),overshoot:un("_overshoot",fn)});$t(class extends cn{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,u=this._windup;return!1!==u&&(s=Math.max(-u,Math.min(s,u))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:un("_windup"),p:un("P"),i:un("I"),d:un("D")});const dn={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},pn={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},mn="mlhvqtcsaz".split("");for(let kh=0,Ch=mn.length;kh<Ch;++kh)pn[mn[kh]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,i=e.length;t<i;++t)e[t]=e[t]+(t%2?n.y:n.x);return pn[t](e,n,r)}}(mn[kh].toUpperCase());function gn(t){return t.segment.length&&t.segment.length-1===dn[t.segment[0].toUpperCase()]}function yn(t,e){t.inNumber&&_n(t,!1);const n=te.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function _n(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,gn(t)&&vn(t)}function vn(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return pn[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function wn(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function bn(t){return"E"===t.lastToken.toUpperCase()}const xn=new Set([" ",",","\t","\n","\r","\f"]);let En=class extends Ce{bbox(){return ae().path.setAttribute("d",this.toString()),new le(ae.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=t,this[i][2]+=e):"H"===r?this[i][1]+=t:"V"===r?this[i][1]+=e:"C"===r||"S"===r||"Q"===r?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===r&&(this[i][5]+=t,this[i][6]+=e)):"A"===r&&(this[i][6]+=t,this[i][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new se,p:new se};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!yn(i,r))if("."!==r)if(isNaN(parseInt(r)))if(xn.has(r))i.inNumber&&_n(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(te.test(r)){if(i.inNumber)_n(i,!1);else{if(!gn(i))throw new Error("parser Error");vn(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!bn(i)){_n(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||wn(i)){i.inNumber=!0,i.number=r,_n(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){_n(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&_n(i,!1),i.inSegment&&gn(i)&&vn(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}};const On=t=>{const e=typeof t;return"number"===e?Ae:"string"===e?ie.isColor(t)?ie:Qt.test(t)?te.test(t)?En:Ce:Xt.test(t)?Ae:kn:Nn.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Ce:"object"===e?Sn:kn};let Mn=class{constructor(t){this._stepper=t||new ln("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(On(t));let e=new this._type(t);return this._type===ie&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Sn&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}},kn=class{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}},Cn=class t{constructor(...t){this.init(...t)}init(e){return Array.isArray(e)&&(e={scaleX:e[0],scaleY:e[1],shear:e[2],rotate:e[3],translateX:e[4],translateY:e[5],originX:e[6],originY:e[7]}),Object.assign(this,t.defaults,e),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}};Cn.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const An=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;let Sn=class{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===ie&&t[n+7]!==e[n+7]){const e=t[n+7],r=new ie(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=On(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(An),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}};const Nn=[kn,Cn,Sn];let jn=class extends ze{constructor(t,e=t){super(It("path",t),e)}array(){return this._array||(this._array=new En(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new En(t))}size(t,e){const n=vt(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}};jn.prototype.MorphArray=En,dt({Container:{path:Yt((function(t){return this.put(new jn).plot(t||new En)}))}}),zt(jn,"Path");const Tn=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new en(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new en(t))},size:function(t,e){const n=vt(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));let In=class extends ze{constructor(t,e=t){super(It("polygon",t),e)}};dt({Container:{polygon:Yt((function(t){return this.put(new In).plot(t||new en)}))}}),$t(In,rn),$t(In,Tn),zt(In,"Polygon");let Rn=class extends ze{constructor(t,e=t){super(It("polyline",t),e)}};dt({Container:{polyline:Yt((function(t){return this.put(new Rn).plot(t||new en)}))}}),$t(Rn,rn),$t(Rn,Tn),zt(Rn,"Polyline");let Ln=class extends ze{constructor(t,e=t){super(It("rect",t),e)}};$t(Ln,{rx:De,ry:Pe}),dt({Container:{rect:Yt((function(t,e){return this.put(new Ln).size(t,e)}))}}),zt(Ln,"Rect");let zn=class{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}};const Dn={nextDraw:null,frames:new zn,timeouts:new zn,immediates:new zn,timer:()=>Ct.window.performance||Ct.window.Date,transforms:[],frame(t){const e=Dn.frames.push({run:t});return null===Dn.nextDraw&&(Dn.nextDraw=Ct.window.requestAnimationFrame(Dn._draw)),e},timeout(t,e){e=e||0;const n=Dn.timer().now()+e,r=Dn.timeouts.push({run:t,time:n});return null===Dn.nextDraw&&(Dn.nextDraw=Ct.window.requestAnimationFrame(Dn._draw)),r},immediate(t){const e=Dn.immediates.push(t);return null===Dn.nextDraw&&(Dn.nextDraw=Ct.window.requestAnimationFrame(Dn._draw)),e},cancelFrame(t){null!=t&&Dn.frames.remove(t)},clearTimeout(t){null!=t&&Dn.timeouts.remove(t)},cancelImmediate(t){null!=t&&Dn.immediates.remove(t)},_draw(t){let e=null;const n=Dn.timeouts.last();for(;(e=Dn.timeouts.shift())&&(t>=e.time?e.run():Dn.timeouts.push(e),e!==n););let r=null;const i=Dn.frames.last();for(;r!==i&&(r=Dn.frames.shift());)r.run(t);let s=null;for(;s=Dn.immediates.shift();)s();Dn.nextDraw=Dn.timeouts.first()||Dn.frames.first()?Ct.window.requestAnimationFrame(Dn._draw):null}},Pn=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Fn=function(){const t=Ct.window;return(t.performance||t.Date).now()};let $n=class extends be{constructor(t=Fn){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(Pn);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Dn.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Dn.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let s=this._runners.length;s--;){const t=this._runners[s],e=t.runner;this._time-t.start<=0&&e.reset()}let i=!1;for(let s=0,o=this._runners.length;s<o;s++){const t=this._runners[s],e=t.runner;let n=r;const u=this._time-t.start;if(u<=0){i=!0;continue}if(u<n&&(n=u),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--s,--o)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}};dt({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new $n,this._timeline):(this._timeline=t,this)}}});let Yn=class t extends be{constructor(e){super(),this.id=t.id++,e="function"==typeof(e=null==e?Ee:e)?new cn(e):e,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof e&&e,this._isDeclarative=e instanceof cn,this._stepper=this._isDeclarative?e:new ln,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ue,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e??Me,n=n||"last","object"!=typeof(t=t??Ee)||t instanceof hn||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,s=t.wait??s,t=t.duration??Ee),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(e,n,r){const i=t.sanitise(e,n,r),s=new t(i.duration);return this._timeline&&s.timeline(this._timeline),this._element&&s.element(this._element),s.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new ue,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new ln(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let u;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,u=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(u,1),0)},a=i*(r+n)-r;return u=e<=0?Math.round(t(1e-5)):e<a?t(e):Math.round(t(a-1e-5)),u}const a=Math.floor(this.loops()),h=s&&a%2==0;return u=a+(h&&!o||o&&h?t:1-t),this.loops(u)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){this._queue.push({initialiser:t||xe,runner:e||xe,retarget:n,isTransform:r,initialised:!1,finished:!1});return this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof $n||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let u=!1;return(n||o)&&(this._initialise(n),this.transforms=new ue,u=this._run(o?t:e),this.fire("step",this)),this.done=this.done||u&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}};Yn.id=0;let Xn=class{constructor(t=new ue,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}};$t([Yn,Xn],{mergeWith(t){return new Xn(t.transforms.lmultiply(this.transforms),t.id)}});const Gn=(t,e)=>t.lmultiplyO(e),Bn=t=>t.transforms;function Wn(){const t=this._transformationRunners.runners.map(Bn).reduce(Gn,new ue);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}let qn=class{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Xn).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(t&&n.done&&t.done&&(!n._timeline||!n._timeline._runnerIds.includes(n.id))&&(!t._timeline||!t._timeline._runnerIds.includes(t.id))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}};dt({Element:{animate(t,e,n){const r=Yn.sanitise(t,e,n),i=this.timeline();return new Yn(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Bn).reduce(Gn,new ue)},_addRunner(t){this._transformationRunners.add(t),Dn.cancelImmediate(this._frameId),this._frameId=Dn.immediate(Wn.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new qn).add(new Xn(new ue(this))))}}});$t(Yn,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new Mn(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(u=s,n.filter((t=>!u.includes(t))));var u;if(o.length){const e=this.element()[t](o),n=new Sn(i.from()).valueOf();Object.assign(n,e),i.from(n)}const a=new Sn(i.to()).valueOf();Object.assign(a,e),i.to(a),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new Mn(this._stepper).to(new Ae(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=ue.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new Mn(this._stepper).type(n?Cn:ue);let s,o,u,a,h;return this.queue((function(){o=o||this.element(),s=s||wt(t,o),h=new ue(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:f}=new se(s).transform(o._currentTransform(this));let d=new ue({...t,origin:[c,f]}),p=this._isDeclarative&&u?u:h;if(n){d=d.decompose(c,f),p=p.decompose(c,f);const t=d.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);d.rotate=n[s]}e&&(r||(d.rotate=t.rotate||0),this._isDeclarative&&a&&(p.rotate=a)),i.from(p),i.to(d);const m=i.at(l);return a=m.rotate,u=new ue(m),this.addTransform(u),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=wt(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new Ae(e),this._tryRetarget(t,e))return this;const n=new Mn(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new Ae(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new Mn(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new Ae(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new Mn(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new le(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),$t(Yn,{rx:De,ry:Pe,from:He,to:Ue}),zt(Yn,"Runner");let Vn=class extends Re{constructor(t,e=t){super(It("svg",t),e),this.namespace()}defs(){return this.isRoot()?Rt(this.node.querySelector("defs"))||this.put(new Le):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof Ct.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:Ot,version:"1.1"}).attr("xmlns:xlink",kt,Mt):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,Mt).attr("xmlns:svgjs",null,Mt)}root(){return this.isRoot()?this:super.root()}};dt({Container:{nested:Yt((function(){return this.put(new Vn)}))}}),zt(Vn,"Svg",!0);let Hn=class extends Re{constructor(t,e=t){super(It("symbol",t),e)}};dt({Container:{symbol:Yt((function(){return this.put(new Hn)}))}}),zt(Hn,"Symbol");const Un=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(Ct.document.createTextNode(t)),this},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}},Symbol.toStringTag,{value:"Module"}));let Zn=class extends ze{constructor(t,e=t){super(It("text",t),e),this.dom.leading=this.dom.leading??new Ae(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Ae(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){if(xt(this.node))return;const i=Ct.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new Ae(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Ae(t.leading||1.3),this}writeDataToDom(){return Et(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||xt(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===Rt(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}};$t(Zn,Un),dt({Container:{text:Yt((function(t=""){return this.put(new Zn).text(t)})),plain:Yt((function(t=""){return this.put(new Zn).plain(t)}))}}),zt(Zn,"Text");let Kn=class extends ze{constructor(t,e=t){super(It("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof Zn))return this;const e=t.index(this),n=Ct.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new Ae(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}};$t(Kn,Un),dt({Tspan:{tspan:Yt((function(t=""){const e=new Kn;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),zt(Kn,"Tspan");let Jn=class extends ze{constructor(t,e=t){super(It("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new Ae(t).divide(2))}};$t(Jn,{x:Fe,y:$e,cx:Ye,cy:Xe,width:Ge,height:Be}),dt({Container:{circle:Yt((function(t=0){return this.put(new Jn).size(t).move(0,0)}))}}),zt(Jn,"Circle");let Qn=class extends Re{constructor(t,e=t){super(It("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return pe("svg [clip-path*="+this.id()+"]")}};dt({Container:{clip:Yt((function(){return this.defs().put(new Qn)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Qn?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),zt(Qn,"ClipPath");let tr=class extends Te{constructor(t,e=t){super(It("foreignObject",t),e)}};dt({Container:{foreignObject:Yt((function(t,e){return this.put(new tr).size(t,e)}))}}),zt(tr,"ForeignObject");const er=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof Ct.window.SVGSVGElement?new le(n.attr(["x","y","width","height"])):n.bbox()}catch(u){return}const i=new ue(n),s=i.translate(t,e).transform(i.inverse()),o=new se(r.x,r.y).transform(s);n.move(o.x,o.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=vt(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach((t=>{const e=new se(n).transform(new ue(t).inverse());t.scale(i,s,e.x,e.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}},Symbol.toStringTag,{value:"Module"}));let nr=class extends Re{constructor(t,e=t){super(It("g",t),e)}};$t(nr,er),dt({Container:{group:Yt((function(){return this.put(new nr)}))}}),zt(nr,"G");let rr=class extends Re{constructor(t,e=t){super(It("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,kt)}};$t(rr,er),dt({Container:{link:Yt((function(t){return this.put(new rr).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new rr,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),zt(rr,"A");let ir=class extends Re{constructor(t,e=t){super(It("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return pe("svg [mask*="+this.id()+"]")}};dt({Container:{mask:Yt((function(){return this.defs().put(new ir)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof ir?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),zt(ir,"Mask");let sr=class extends Te{constructor(t,e=t){super(It("stop",t),e)}update(t){return("number"==typeof t||t instanceof Ae)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new Ae(t.offset)),this}};dt({Gradient:{stop:function(t,e,n){return this.put(new sr).update(t,e,n)}}}),zt(sr,"Stop");let or=class extends Te{constructor(t,e=t){super(It("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const r in e)n+=r.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[r]+";";return n+="}",n}(t,e))}};dt("Dom",{style(t,e){return this.put(new or).rule(t,e)},fontface(t,e,n){return this.put(new or).font(t,e,n)}}),zt(or,"Style");let ur=class extends Zn{constructor(t,e=t){super(It("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}};dt({Container:{textPath:Yt((function(t,e){return t instanceof Zn||(t=this.text(t)),t.path(e)}))},Text:{path:Yt((function(t,e=!0){const n=new ur;let r;if(t instanceof jn||(t=this.defs().path(t)),n.attr("href","#"+t,kt),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:Yt((function(t){return t instanceof Zn||(t=(new Zn).addTo(this.parent()).text(t)),t.path(this)})),targets(){return pe("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),ur.prototype.MorphArray=En,zt(ur,"TextPath");let ar=class extends ze{constructor(t,e=t){super(It("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,kt)}};dt({Container:{use:Yt((function(t,e){return this.put(new ar).use(t,e)}))}}),zt(ar,"Use"),$t([Vn,Hn,Qe,Je,on],pt("viewbox")),$t([sn,Rn,In,jn],pt("marker")),$t(Zn,pt("Text")),$t(jn,pt("Path")),$t(Le,pt("Defs")),$t([Zn,Kn],pt("Tspan")),$t([Ln,qe,Ke,Yn],pt("radius")),$t(be,pt("EventTarget")),$t(je,pt("Dom")),$t(Te,pt("Element")),$t(ze,pt("Shape")),$t([Re,Ve],pt("Container")),$t(Ke,pt("Gradient")),$t(Yn,pt("Runner")),fe.extend([...new Set(ft)]),function(t=[]){Nn.push(...[].concat(t))}([Ae,ie,le,ue,Ce,en,En,se]),$t(Nn,{to(t){return(new Mn).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});const hr={export:"data:image/svg+xml,%3csvg%20fill='%23000000'%20width='20px'%20height='20px'%20viewBox='0%200%2024%2024'%20id='export-2'%20xmlns='http://www.w3.org/2000/svg'%20class='icon%20line'%3e%3cpolyline%20id='primary'%20points='15%203%2021%203%2021%209'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/polyline%3e%3cpath%20id='primary-2'%20data-name='primary'%20d='M21,13v7a1,1,0,0,1-1,1H4a1,1,0,0,1-1-1V4A1,1,0,0,1,4,3h7'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/path%3e%3cline%20id='primary-3'%20data-name='primary'%20x1='11'%20y1='13'%20x2='21'%20y2='3'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/line%3e%3c/svg%3e","fit-screen":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='8%202%202%202%202%208%204%208%204%204%208%204%208%202'/%3e%3cpolygon%20points='24%202%2030%202%2030%208%2028%208%2028%204%2024%204%2024%202'/%3e%3cpolygon%20points='8%2030%202%2030%202%2024%204%2024%204%2028%208%2028%208%2030'/%3e%3cpolygon%20points='24%2030%2030%2030%2030%2024%2028%2024%2028%2028%2024%2028%2024%2030'/%3e%3cpath%20d='M24,24H8a2.0023,2.0023,0,0,1-2-2V10A2.0023,2.0023,0,0,1,8,8H24a2.0023,2.0023,0,0,1,2,2V22A2.0023,2.0023,0,0,1,24,24ZM8,10V22H24V10Z'/%3e%3crect%20fill='none'%20width='32'%20height='32'/%3e%3c/svg%3e","zoom-in":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:sketch='http://www.bohemiancoding.com/sketch/ns'%3e%3cg%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20transform='translate(-308.000000,%20-1139.000000)'%20fill='%23000000'%3e%3cpath%20d='M321.46,1163.45%20C315.17,1163.45%20310.07,1158.44%20310.07,1152.25%20C310.07,1146.06%20315.17,1141.04%20321.46,1141.04%20C327.75,1141.04%20332.85,1146.06%20332.85,1152.25%20C332.85,1158.44%20327.75,1163.45%20321.46,1163.45%20L321.46,1163.45%20Z%20M339.688,1169.25%20L331.429,1161.12%20C333.592,1158.77%20334.92,1155.67%20334.92,1152.25%20C334.92,1144.93%20328.894,1139%20321.46,1139%20C314.026,1139%20308,1144.93%20308,1152.25%20C308,1159.56%20314.026,1165.49%20321.46,1165.49%20C324.672,1165.49%20327.618,1164.38%20329.932,1162.53%20L338.225,1170.69%20C338.629,1171.09%20339.284,1171.09%20339.688,1170.69%20C340.093,1170.3%20340.093,1169.65%20339.688,1169.25%20L339.688,1169.25%20Z%20M326.519,1151.41%20L322.522,1151.41%20L322.522,1147.41%20C322.522,1146.85%20322.075,1146.41%20321.523,1146.41%20C320.972,1146.41%20320.524,1146.85%20320.524,1147.41%20L320.524,1151.41%20L316.529,1151.41%20C315.978,1151.41%20315.53,1151.59%20315.53,1152.14%20C315.53,1152.7%20315.978,1153.41%20316.529,1153.41%20L320.524,1153.41%20L320.524,1157.41%20C320.524,1157.97%20320.972,1158.41%20321.523,1158.41%20C322.075,1158.41%20322.522,1157.97%20322.522,1157.41%20L322.522,1153.41%20L326.519,1153.41%20C327.07,1153.41%20327.518,1152.96%20327.518,1152.41%20C327.518,1151.86%20327.07,1151.41%20326.519,1151.41%20L326.519,1151.41%20Z'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e","zoom-out":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20%3e%3cg%20transform='translate(-360.000000,%20-1139.000000)'%20fill='%23000000'%3e%3cpath%20d='M373.46,1163.45%20C367.17,1163.45%20362.071,1158.44%20362.071,1152.25%20C362.071,1146.06%20367.17,1141.04%20373.46,1141.04%20C379.75,1141.04%20384.85,1146.06%20384.85,1152.25%20C384.85,1158.44%20379.75,1163.45%20373.46,1163.45%20L373.46,1163.45%20Z%20M391.688,1169.25%20L383.429,1161.12%20C385.592,1158.77%20386.92,1155.67%20386.92,1152.25%20C386.92,1144.93%20380.894,1139%20373.46,1139%20C366.026,1139%20360,1144.93%20360,1152.25%20C360,1159.56%20366.026,1165.49%20373.46,1165.49%20C376.672,1165.49%20379.618,1164.38%20381.932,1162.53%20L390.225,1170.69%20C390.629,1171.09%20391.284,1171.09%20391.688,1170.69%20C392.093,1170.3%20392.093,1169.65%20391.688,1169.25%20L391.688,1169.25%20Z%20M378.689,1151.41%20L368.643,1151.41%20C368.102,1151.41%20367.663,1151.84%20367.663,1152.37%20C367.663,1152.9%20368.102,1153.33%20368.643,1153.33%20L378.689,1153.33%20C379.23,1153.33%20379.669,1152.9%20379.669,1152.37%20C379.669,1151.84%20379.23,1151.41%20378.689,1151.41%20L378.689,1151.41%20Z'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e"};class lr{constructor(t){this.element=t}createToolbarItem(t,e){const n=document.createElement("div"),r=new Image;r.src=e,n.id=t,n.append(r);const i=nt({alignItems:"center",backgroundColor:"#FFFFFF",border:"1px solid #BCBCBC",cursor:"pointer",display:"flex",height:"30px",justifyContent:"center",width:"30px"});return n.setAttribute("style",i),n}render({enableExport:t=!1,enableFitscreen:e=!1,enableZoom:n=!1,onExport:r=rt,onFitscreen:i=rt,onZoom:s=rt}){var o;const u=document.createElement("div");u.id="toolbar";const a=nt({display:"flex",gap:"5px",position:"absolute",right:"10px",top:"10px"});if(u.setAttribute("style",a),t){const t=this.createToolbarItem("export",hr.export);t.addEventListener("click",(()=>{r()})),u.append(t)}if(n){const t=this.createToolbarItem("zoom-in",hr["zoom-in"]),e=this.createToolbarItem("zoom-out",hr["zoom-out"]);t.addEventListener("click",(()=>{s(.1)})),e.addEventListener("click",(()=>{s(-.1)})),u.append(t,e)}if(e){const t=this.createToolbarItem("fit-screen",hr["fit-screen"]);t.addEventListener("click",(()=>{i()})),u.append(t)}null==(o=this.element)||o.append(u)}}const cr=class{static add(t){this.remove(t);const e=document.createElement("div");e.className=this.WATERMARK_CLASS,e.textContent=this.WATERMARK_TEXT,Object.assign(e.style,{bottom:"5px",color:"#666",fontFamily:"Arial, sans-serif",fontSize:"14px",msUserSelect:"none",pointerEvents:"none",position:"absolute",right:"5px",userSelect:"none",webkitUserSelect:"none",zIndex:"1000"}),"static"===getComputedStyle(t).position&&(t.style.position="relative"),t.appendChild(e)}static exists(t){return!!t.querySelector(`.${this.WATERMARK_CLASS}`)}static remove(t){const e=t.querySelector(`.${this.WATERMARK_CLASS}`);e&&e.remove()}};cr.WATERMARK_CLASS="apexgantt-watermark",cr.WATERMARK_TEXT="Powered by apexcharts.com";let fr=cr;var dr="\0",pr="\0",mr="";function gr(t,e){t[e]?t[e]++:t[e]=1}function yr(t,e){--t[e]||delete t[e]}function _r(t,e,n,r){var i=""+e,s=""+n;if(!t&&i>s){var o=i;i=s,s=o}return i+mr+s+mr+(void 0===r?dr:r)}function vr(t,e){return _r(t,e.v,e.w,e.name)}var wr=class{constructor(t){n(this,"_isDirected",!0),n(this,"_isMultigraph",!1),n(this,"_isCompound",!1),n(this,"_label"),n(this,"_defaultNodeLabelFn",(()=>{})),n(this,"_defaultEdgeLabelFn",(()=>{})),n(this,"_nodes",{}),n(this,"_in",{}),n(this,"_preds",{}),n(this,"_out",{}),n(this,"_sucs",{}),n(this,"_edgeObjs",{}),n(this,"_edgeLabels",{}),n(this,"_nodeCount",0),n(this,"_edgeCount",0),n(this,"_parent"),n(this,"_children"),t&&(this._isDirected=!Object.hasOwn(t,"directed")||t.directed,this._isMultigraph=!!Object.hasOwn(t,"multigraph")&&t.multigraph,this._isCompound=!!Object.hasOwn(t,"compound")&&t.compound),this._isCompound&&(this._parent={},this._children={},this._children[pr]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return this._defaultNodeLabelFn=t,"function"!=typeof t&&(this._defaultNodeLabelFn=()=>t),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var t=this;return this.nodes().filter((e=>0===Object.keys(t._in[e]).length))}sinks(){var t=this;return this.nodes().filter((e=>0===Object.keys(t._out[e]).length))}setNodes(t,e){var n=arguments,r=this;return t.forEach((function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this}setNode(t,e){return Object.hasOwn(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=pr,this._children[t]={},this._children[pr][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.hasOwn(this._nodes,t)}removeNode(t){var e=this;if(Object.hasOwn(this._nodes,t)){var n=t=>e.removeEdge(e._edgeObjs[t]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach((function(t){e.setParent(t)})),delete this._children[t]),Object.keys(this._in[t]).forEach(n),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(void 0===e)e=pr;else{for(var n=e+="";void 0!==n;n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==pr)return e}}children(t=pr){if(this._isCompound){var e=this._children[t];if(e)return Object.keys(e)}else{if(t===pr)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var e=this._preds[t];if(e)return Object.keys(e)}successors(t){var e=this._sucs[t];if(e)return Object.keys(e)}neighbors(t){var e=this.predecessors(t);if(e){const r=new Set(e);for(var n of this.successors(t))r.add(n);return Array.from(r.values())}}isLeaf(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach((function([n,r]){t(n)&&e.setNode(n,r)})),Object.values(this._edgeObjs).forEach((function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function i(t){var s=n.parent(t);return void 0===s||e.hasNode(s)?(r[t]=s,s):s in r?r[s]:i(s)}return this._isCompound&&e.nodes().forEach((t=>e.setParent(t,i(t)))),e}setDefaultEdgeLabel(t){return this._defaultEdgeLabelFn=t,"function"!=typeof t&&(this._defaultEdgeLabelFn=()=>t),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,e){var n=this,r=arguments;return t.reduce((function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this}setEdge(){var t,e,n,r,i=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(t=s.v,e=s.w,n=s.name,2===arguments.length&&(r=arguments[1],i=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),t=""+t,e=""+e,void 0!==n&&(n=""+n);var o=_r(this._isDirected,t,e,n);if(Object.hasOwn(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(void 0!==n&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(t,e,n);var u=function(t,e,n,r){var i=""+e,s=""+n;if(!t&&i>s){var o=i;i=s,s=o}var u={v:i,w:s};r&&(u.name=r);return u}(this._isDirected,t,e,n);return t=u.v,e=u.w,Object.freeze(u),this._edgeObjs[o]=u,gr(this._preds[e],t),gr(this._sucs[t],e),this._in[e][o]=u,this._out[t][o]=u,this._edgeCount++,this}edge(t,e,n){var r=1===arguments.length?vr(this._isDirected,arguments[0]):_r(this._isDirected,t,e,n);return this._edgeLabels[r]}edgeAsObj(){const t=this.edge(...arguments);return"object"!=typeof t?{label:t}:t}hasEdge(t,e,n){var r=1===arguments.length?vr(this._isDirected,arguments[0]):_r(this._isDirected,t,e,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(t,e,n){var r=1===arguments.length?vr(this._isDirected,arguments[0]):_r(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],yr(this._preds[e],t),yr(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this}inEdges(t,e){var n=this._in[t];if(n){var r=Object.values(n);return e?r.filter((t=>t.v===e)):r}}outEdges(t,e){var n=this._out[t];if(n){var r=Object.values(n);return e?r.filter((t=>t.w===e)):r}}nodeEdges(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},br={Graph:wr,version:"2.2.4"},xr=wr,Er={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Or(t),edges:Mr(t)};void 0!==t.graph()&&(e.value=structuredClone(t.graph()));return e},read:function(t){var e=new xr(t.options).setGraph(t.value);return t.nodes.forEach((function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),t.edges.forEach((function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function Or(t){return t.nodes().map((function(e){var n=t.node(e),r=t.parent(e),i={v:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.parent=r),i}))}function Mr(t){return t.edges().map((function(e){var n=t.edge(e),r={v:e.v,w:e.w};return void 0!==e.name&&(r.name=e.name),void 0!==n&&(r.value=n),r}))}var kr=function(t){var e,n={},r=[];function i(r){Object.hasOwn(n,r)||(n[r]=!0,e.push(r),t.successors(r).forEach(i),t.predecessors(r).forEach(i))}return t.nodes().forEach((function(t){e=[],i(t),e.length&&r.push(e)})),r};var Cr=class{constructor(){n(this,"_arr",[]),n(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map((function(t){return t.key}))}has(t){return Object.hasOwn(this._keyIndices,t)}priority(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority}min(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key}add(t,e){var n=this._keyIndices;if(t=String(t),!Object.hasOwn(n,t)){var r=this._arr,i=r.length;return n[t]=i,r.push({key:t,priority:e}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)}_heapify(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))}_decrease(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e}_swap(t,e){var n=this._arr,r=this._keyIndices,i=n[t],s=n[e];n[t]=s,n[e]=i,r[s.key]=t,r[i.key]=e}},Ar=Cr,Sr=function(t,e,n,r){return function(t,e,n,r){var i,s,o={},u=new Ar,a=function(t){var e=t.v!==i?t.v:t.w,r=o[e],a=n(t),h=s.distance+a;if(a<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);h<r.distance&&(r.distance=h,r.predecessor=i,u.decrease(e,h))};t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;o[t]={distance:n},u.add(t,n)}));for(;u.size()>0&&(i=u.removeMin(),(s=o[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(a);return o}(t,String(e),n||Nr,r||function(e){return t.outEdges(e)})},Nr=()=>1;var jr=Sr,Tr=function(t,e,n){return t.nodes().reduce((function(r,i){return r[i]=jr(t,i,e,n),r}),{})};var Ir=function(t){var e=0,n=[],r={},i=[];function s(o){var u=r[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),t.successors(o).forEach((function(t){Object.hasOwn(r,t)?r[t].onStack&&(u.lowlink=Math.min(u.lowlink,r[t].index)):(s(t),u.lowlink=Math.min(u.lowlink,r[t].lowlink))})),u.lowlink===u.index){var a,h=[];do{a=n.pop(),r[a].onStack=!1,h.push(a)}while(o!==a);i.push(h)}}return t.nodes().forEach((function(t){Object.hasOwn(r,t)||s(t)})),i};var Rr=Ir,Lr=function(t){return Rr(t).filter((function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))};var zr=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,s=e(n);r[t][i]={distance:s,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var s=r[n];i.forEach((function(n){var r=s[t],i=e[n],o=s[n],u=r.distance+i.distance;u<o.distance&&(o.distance=u,o.predecessor=i.predecessor)}))}))})),r}(t,e||Dr,n||function(e){return t.outEdges(e)})},Dr=()=>1;function Pr(t){var e={},n={},r=[];if(t.sinks().forEach((function i(s){if(Object.hasOwn(n,s))throw new Fr;Object.hasOwn(e,s)||(n[s]=!0,e[s]=!0,t.predecessors(s).forEach(i),delete n[s],r.push(s))})),Object.keys(e).length!==t.nodeCount())throw new Fr;return r}class Fr extends Error{constructor(){super(...arguments)}}var $r=Pr;Pr.CycleException=Fr;var Yr=$r;var Xr=function(t,e,n){Array.isArray(e)||(e=[e]);var r=t.isDirected()?e=>t.successors(e):e=>t.neighbors(e),i="post"===n?Gr:Br,s=[],o={};return e.forEach((e=>{if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);i(e,r,o,s)})),s};function Gr(t,e,n,r){for(var i=[[t,!1]];i.length>0;){var s=i.pop();s[1]?r.push(s[0]):Object.hasOwn(n,s[0])||(n[s[0]]=!0,i.push([s[0],!0]),Wr(e(s[0]),(t=>i.push([t,!1]))))}}function Br(t,e,n,r){for(var i=[t];i.length>0;){var s=i.pop();Object.hasOwn(n,s)||(n[s]=!0,r.push(s),Wr(e(s),(t=>i.push(t))))}}function Wr(t,e){for(var n=t.length;n--;)e(t[n],n,t);return t}var qr=Xr;var Vr=Xr;var Hr=wr,Ur=Cr;var Zr={Graph:br.Graph,json:Er,alg:{components:kr,dijkstra:Sr,dijkstraAll:Tr,findCycles:Lr,floydWarshall:zr,isAcyclic:function(t){try{Yr(t)}catch(e){if(e instanceof Yr.CycleException)return!1;throw e}return!0},postorder:function(t,e){return qr(t,e,"post")},preorder:function(t,e){return Vr(t,e,"pre")},prim:function(t,e){var n,r=new Hr,i={},s=new Ur;function o(t){var r=t.v===n?t.w:t.v,o=s.priority(r);if(void 0!==o){var u=e(t);u<o&&(i[r]=n,s.decrease(r,u))}}if(0===t.nodeCount())return r;t.nodes().forEach((function(t){s.add(t,Number.POSITIVE_INFINITY),r.setNode(t)})),s.decrease(t.nodes()[0],0);var u=!1;for(;s.size()>0;){if(n=s.removeMin(),Object.hasOwn(i,n))r.setEdge(n,i[n]);else{if(u)throw new Error("Input graph is not connected: "+t);u=!0}t.nodeEdges(n).forEach(o)}return r},tarjan:Ir,topsort:$r},version:br.version};function Kr(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Jr(t,e){if("_next"!==t&&"_prev"!==t)return e}let Qr=Zr.Graph,ti=class{constructor(){let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return Kr(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&Kr(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){let t=[],e=this._sentinel,n=e._prev;for(;n!==e;)t.push(JSON.stringify(n,Jr)),n=n._prev;return"["+t.join(", ")+"]"}};var ei=function(t,e){if(t.nodeCount()<=1)return[];let n=function(t,e){let n=new Qr,r=0,i=0;t.nodes().forEach((t=>{n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((t=>{let s=n.edge(t.v,t.w)||0,o=e(t),u=s+o;n.setEdge(t.v,t.w,u),i=Math.max(i,n.node(t.v).out+=o),r=Math.max(r,n.node(t.w).in+=o)}));let s=function(t){const e=[];for(let n=0;n<t;n++)e.push(n);return e}(i+r+3).map((()=>new ti)),o=r+1;return n.nodes().forEach((t=>{ii(s,o,n.node(t))})),{graph:n,buckets:s,zeroIdx:o}}(t,e||ni);return function(t,e,n){let r,i=[],s=e[e.length-1],o=e[0];for(;t.nodeCount();){for(;r=o.dequeue();)ri(t,e,n,r);for(;r=s.dequeue();)ri(t,e,n,r);if(t.nodeCount())for(let s=e.length-2;s>0;--s)if(r=e[s].dequeue(),r){i=i.concat(ri(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx).flatMap((e=>t.outEdges(e.v,e.w)))};let ni=()=>1;function ri(t,e,n,r,i){let s=i?[]:void 0;return t.inEdges(r.v).forEach((r=>{let o=t.edge(r),u=t.node(r.v);i&&s.push({v:r.v,w:r.w}),u.out-=o,ii(e,n,u)})),t.outEdges(r.v).forEach((r=>{let i=t.edge(r),s=r.w,o=t.node(s);o.in-=i,ii(e,n,o)})),t.removeNode(r.v),s}function ii(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}let si=Zr.Graph;var oi={addBorderNode:function(t,e,n,r){let i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return ui(t,"border",i,e)},addDummyNode:ui,applyWithChunking:hi,asNonCompoundGraph:function(t){let e=new si({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((n=>{t.children(n).length||e.setNode(n,t.node(n))})),t.edges().forEach((n=>{e.setEdge(n,t.edge(n))})),e},buildLayerMatrix:function(t){let e=di(li(t)+1).map((()=>[]));return t.nodes().forEach((n=>{let r=t.node(n),i=r.rank;void 0!==i&&(e[i][r.order]=n)})),e},intersectRect:function(t,e){let n,r,i=t.x,s=t.y,o=e.x-i,u=e.y-s,a=t.width/2,h=t.height/2;if(!o&&!u)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(u)*a>Math.abs(o)*h?(u<0&&(h=-h),n=h*o/u,r=h):(o<0&&(a=-a),n=a,r=a*u/o);return{x:i+n,y:s+r}},mapValues:function(t,e){let n=e;"string"==typeof e&&(n=t=>t[e]);return Object.entries(t).reduce(((t,[e,r])=>(t[e]=n(r,e),t)),{})},maxRank:li,normalizeRanks:function(t){let e=t.nodes().map((e=>{let n=t.node(e).rank;return void 0===n?Number.MAX_VALUE:n})),n=hi(Math.min,e);t.nodes().forEach((e=>{let r=t.node(e);Object.hasOwn(r,"rank")&&(r.rank-=n)}))},notime:function(t,e){return e()},partition:function(t,e){let n={lhs:[],rhs:[]};return t.forEach((t=>{e(t)?n.lhs.push(t):n.rhs.push(t)})),n},pick:function(t,e){const n={};for(const r of e)void 0!==t[r]&&(n[r]=t[r]);return n},predecessorWeights:function(t){let e=t.nodes().map((e=>{let n={};return t.inEdges(e).forEach((e=>{n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return pi(t.nodes(),e)},range:di,removeEmptyRanks:function(t){let e=t.nodes().map((e=>t.node(e).rank)),n=hi(Math.min,e),r=[];t.nodes().forEach((e=>{let i=t.node(e).rank-n;r[i]||(r[i]=[]),r[i].push(e)}));let i=0,s=t.graph().nodeRankFactor;Array.from(r).forEach(((e,n)=>{void 0===e&&n%s!=0?--i:void 0!==e&&i&&e.forEach((e=>t.node(e).rank+=i))}))},simplify:function(t){let e=(new si).setGraph(t.graph());return t.nodes().forEach((n=>e.setNode(n,t.node(n)))),t.edges().forEach((n=>{let r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},successorWeights:function(t){let e=t.nodes().map((e=>{let n={};return t.outEdges(e).forEach((e=>{n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return pi(t.nodes(),e)},time:function(t,e){let n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}},uniqueId:fi,zipObject:pi};function ui(t,e,n,r){let i;do{i=fi(r)}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}const ai=65535;function hi(t,e){if(e.length>ai){const n=function(t,e=ai){const n=[];for(let r=0;r<t.length;r+=e){const i=t.slice(r,r+e);n.push(i)}return n}(e);return t.apply(null,n.map((e=>t.apply(null,e))))}return t.apply(null,e)}function li(t){const e=t.nodes().map((e=>{let n=t.node(e).rank;return void 0===n?Number.MIN_VALUE:n}));return hi(Math.max,e)}let ci=0;function fi(t){var e=++ci;return toString(t)+e}function di(t,e,n=1){null==e&&(e=t,t=0);let r=t=>t<e;n<0&&(r=t=>e<t);const i=[];for(let s=t;r(s);s+=n)i.push(s);return i}function pi(t,e){return t.reduce(((t,n,r)=>(t[n]=e[r],t)),{})}let mi=ei,gi=oi.uniqueId;var yi={run:function(t){("greedy"===t.graph().acyclicer?mi(t,(e=t,t=>e.edge(t).weight)):function(t){let e=[],n={},r={};function i(s){Object.hasOwn(r,s)||(r[s]=!0,n[s]=!0,t.outEdges(s).forEach((t=>{Object.hasOwn(n,t.w)?e.push(t):i(t.w)})),delete n[s])}return t.nodes().forEach(i),e}(t)).forEach((e=>{let n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,gi("rev"))}));var e},undo:function(t){t.edges().forEach((e=>{let n=t.edge(e);if(n.reversed){t.removeEdge(e);let r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}};let _i=oi;var vi={run:function(t){t.graph().dummyChains=[],t.edges().forEach((e=>function(t,e){let n,r,i,s=e.v,o=t.node(s).rank,u=e.w,a=t.node(u).rank,h=e.name,l=t.edge(e),c=l.labelRank;if(a===o+1)return;for(t.removeEdge(e),i=0,++o;o<a;++i,++o)l.points=[],r={width:0,height:0,edgeLabel:l,edgeObj:e,rank:o},n=_i.addDummyNode(t,"edge",r,"_d"),o===c&&(r.width=l.width,r.height=l.height,r.dummy="edge-label",r.labelpos=l.labelpos),t.setEdge(s,n,{weight:l.weight},h),0===i&&t.graph().dummyChains.push(n),s=n;t.setEdge(s,u,{weight:l.weight},h)}(t,e)))},undo:function(t){t.graph().dummyChains.forEach((e=>{let n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}};const{applyWithChunking:wi}=oi;var bi={longestPath:function(t){var e={};t.sources().forEach((function n(r){var i=t.node(r);if(Object.hasOwn(e,r))return i.rank;e[r]=!0;let s=t.outEdges(r).map((e=>null==e?Number.POSITIVE_INFINITY:n(e.w)-t.edge(e).minlen));var o=wi(Math.min,s);return o===Number.POSITIVE_INFINITY&&(o=0),i.rank=o}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}};var xi=Zr.Graph,Ei=bi.slack,Oi=function(t){var e,n,r=new xi({directed:!1}),i=t.nodes()[0],s=t.nodeCount();r.setNode(i,{});for(;Mi(r,t)<s;)e=ki(r,t),n=r.hasNode(e.v)?Ei(t,e):-Ei(t,e),Ci(r,t,n);return r};function Mi(t,e){return t.nodes().forEach((function n(r){e.nodeEdges(r).forEach((i=>{var s=i.v,o=r===s?i.w:s;t.hasNode(o)||Ei(e,i)||(t.setNode(o,{}),t.setEdge(r,o,{}),n(o))}))})),t.nodeCount()}function ki(t,e){return e.edges().reduce(((n,r)=>{let i=Number.POSITIVE_INFINITY;return t.hasNode(r.v)!==t.hasNode(r.w)&&(i=Ei(e,r)),i<n[0]?[i,r]:n}),[Number.POSITIVE_INFINITY,null])[1]}function Ci(t,e,n){t.nodes().forEach((t=>e.node(t).rank+=n))}var Ai=Oi,Si=bi.slack,Ni=bi.longestPath,ji=Zr.alg.preorder,Ti=Zr.alg.postorder,Ii=oi.simplify,Ri=Li;function Li(t){t=Ii(t),Ni(t);var e,n=Ai(t);for(Pi(n),zi(n,t);e=$i(n);)Xi(n,t,e,Yi(n,t,e))}function zi(t,e){var n=Ti(t,t.nodes());(n=n.slice(0,n.length-1)).forEach((n=>function(t,e,n){var r=t.node(n),i=r.parent;t.edge(n,i).cutvalue=Di(t,e,n)}(t,e,n)))}function Di(t,e,n){var r=t.node(n).parent,i=!0,s=e.edge(n,r),o=0;return s||(i=!1,s=e.edge(r,n)),o=s.weight,e.nodeEdges(n).forEach((s=>{var u,a,h=s.v===n,l=h?s.w:s.v;if(l!==r){var c=h===i,f=e.edge(s).weight;if(o+=c?f:-f,u=n,a=l,t.hasEdge(u,a)){var d=t.edge(n,l).cutvalue;o+=c?-d:d}}})),o}function Pi(t,e){arguments.length<2&&(e=t.nodes()[0]),Fi(t,{},1,e)}function Fi(t,e,n,r,i){var s=n,o=t.node(r);return e[r]=!0,t.neighbors(r).forEach((i=>{Object.hasOwn(e,i)||(n=Fi(t,e,n,i,r))})),o.low=s,o.lim=n++,i?o.parent=i:delete o.parent,n}function $i(t){return t.edges().find((e=>t.edge(e).cutvalue<0))}function Yi(t,e,n){var r=n.v,i=n.w;e.hasEdge(r,i)||(r=n.w,i=n.v);var s=t.node(r),o=t.node(i),u=s,a=!1;return s.lim>o.lim&&(u=o,a=!0),e.edges().filter((e=>a===Gi(t,t.node(e.v),u)&&a!==Gi(t,t.node(e.w),u))).reduce(((t,n)=>Si(e,n)<Si(e,t)?n:t))}function Xi(t,e,n,r){var i=n.v,s=n.w;t.removeEdge(i,s),t.setEdge(r.v,r.w,{}),Pi(t),zi(t,e),function(t,e){var n=t.nodes().find((t=>!e.node(t).parent)),r=ji(t,n);(r=r.slice(1)).forEach((n=>{var r=t.node(n).parent,i=e.edge(n,r),s=!1;i||(i=e.edge(r,n),s=!0),e.node(n).rank=e.node(r).rank+(s?i.minlen:-i.minlen)}))}(t,e)}function Gi(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}Li.initLowLimValues=Pi,Li.initCutValues=zi,Li.calcCutValue=Di,Li.leaveEdge=$i,Li.enterEdge=Yi,Li.exchangeEdges=Xi;var Bi=bi.longestPath,Wi=Oi,qi=Ri,Vi=function(t){switch(t.graph().ranker){case"network-simplex":default:Ui(t);break;case"tight-tree":!function(t){Bi(t),Wi(t)}(t);break;case"longest-path":Hi(t)}};var Hi=Bi;function Ui(t){qi(t)}let Zi=oi;function Ki(t,e,n,r,i,s,o){let u=t.children(o);if(!u.length)return void(o!==e&&t.setEdge(e,o,{weight:0,minlen:n}));let a=Zi.addBorderNode(t,"_bt"),h=Zi.addBorderNode(t,"_bb"),l=t.node(o);t.setParent(a,o),l.borderTop=a,t.setParent(h,o),l.borderBottom=h,u.forEach((u=>{Ki(t,e,n,r,i,s,u);let l=t.node(u),c=l.borderTop?l.borderTop:u,f=l.borderBottom?l.borderBottom:u,d=l.borderTop?r:2*r,p=c!==f?1:i-s[o]+1;t.setEdge(a,c,{weight:d,minlen:p,nestingEdge:!0}),t.setEdge(f,h,{weight:d,minlen:p,nestingEdge:!0})})),t.parent(o)||t.setEdge(e,a,{weight:0,minlen:i+s[o]})}let Ji=oi;function Qi(t,e,n,r,i,s){let o={width:0,height:0,rank:s,borderType:e},u=i[e][s-1],a=Ji.addDummyNode(t,"border",o,n);i[e][s]=a,t.setParent(a,r),u&&t.setEdge(u,a,{weight:1})}function ts(t){t.nodes().forEach((e=>es(t.node(e)))),t.edges().forEach((e=>es(t.edge(e))))}function es(t){let e=t.width;t.width=t.height,t.height=e}function ns(t){t.y=-t.y}function rs(t){let e=t.x;t.x=t.y,t.y=e}let is=oi;let ss=oi.zipObject;function os(t,e,n){let r=ss(n,n.map(((t,e)=>e))),i=e.flatMap((e=>t.outEdges(e).map((e=>({pos:r[e.w],weight:t.edge(e).weight}))).sort(((t,e)=>t.pos-e.pos)))),s=1;for(;s<n.length;)s<<=1;let o=2*s-1;s-=1;let u=new Array(o).fill(0),a=0;return i.forEach((t=>{let e=t.pos+s;u[e]+=t.weight;let n=0;for(;e>0;)e%2&&(n+=u[e+1]),e=e-1>>1,u[e]+=t.weight;a+=t.weight*n})),a}let us=oi;let as=oi;function hs(t,e,n){let r;for(;e.length&&(r=e[e.length-1]).i<=n;)e.pop(),t.push(r.vs),n++;return n}let ls=function(t,e=[]){return e.map((e=>{let n=t.inEdges(e);if(n.length){let r=n.reduce(((e,n)=>{let r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))},cs=function(t,e){let n={};return t.forEach(((t,e)=>{let r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};void 0!==t.barycenter&&(r.barycenter=t.barycenter,r.weight=t.weight)})),e.edges().forEach((t=>{let e=n[t.v],r=n[t.w];void 0!==e&&void 0!==r&&(r.indegree++,e.out.push(n[t.w]))})),function(t){let e=[];function n(t){return e=>{e.merged||(void 0===e.barycenter||void 0===t.barycenter||e.barycenter>=t.barycenter)&&function(t,e){let n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return n=>{n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){let i=t.pop();e.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return e.filter((t=>!t.merged)).map((t=>us.pick(t,["vs","i","barycenter","weight"])))}(Object.values(n).filter((t=>!t.indegree)))},fs=function(t,e){let n=as.partition(t,(t=>Object.hasOwn(t,"barycenter"))),r=n.lhs,i=n.rhs.sort(((t,e)=>e.i-t.i)),s=[],o=0,u=0,a=0;r.sort((h=!!e,(t,e)=>t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:h?e.i-t.i:t.i-e.i)),a=hs(s,i,a),r.forEach((t=>{a+=t.vs.length,s.push(t.vs),o+=t.barycenter*t.weight,u+=t.weight,a=hs(s,i,a)}));var h;let l={vs:s.flat(!0)};u&&(l.barycenter=o/u,l.weight=u);return l};var ds=function t(e,n,r,i){let s=e.children(n),o=e.node(n),u=o?o.borderLeft:void 0,a=o?o.borderRight:void 0,h={};u&&(s=s.filter((t=>t!==u&&t!==a)));let l=ls(e,s);l.forEach((n=>{if(e.children(n.v).length){let u=t(e,n.v,r,i);h[n.v]=u,Object.hasOwn(u,"barycenter")&&(o=u,void 0!==(s=n).barycenter?(s.barycenter=(s.barycenter*s.weight+o.barycenter*o.weight)/(s.weight+o.weight),s.weight+=o.weight):(s.barycenter=o.barycenter,s.weight=o.weight))}var s,o}));let c=cs(l,r);!function(t,e){t.forEach((t=>{t.vs=t.vs.flatMap((t=>e[t]?e[t].vs:t))}))}(c,h);let f=fs(c,i);if(u&&(f.vs=[u,f.vs,a].flat(!0),e.predecessors(u).length)){let t=e.node(e.predecessors(u)[0]),n=e.node(e.predecessors(a)[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+t.order+n.order)/(f.weight+2),f.weight+=2}return f};let ps=Zr.Graph,ms=oi;let gs=function(t){let e={},n=t.nodes().filter((e=>!t.children(e).length)),r=n.map((e=>t.node(e).rank)),i=is.applyWithChunking(Math.max,r),s=is.range(i+1).map((()=>[]));return n.sort(((e,n)=>t.node(e).rank-t.node(n).rank)).forEach((function n(r){if(e[r])return;e[r]=!0;let i=t.node(r);s[i.rank].push(r),t.successors(r).forEach(n)})),s},ys=function(t,e){let n=0;for(let r=1;r<e.length;++r)n+=os(t,e[r-1],e[r]);return n},_s=ds,vs=function(t,e,n){let r=function(t){var e;for(;t.hasNode(e=ms.uniqueId("_root")););return e}(t),i=new ps({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((e=>t.node(e)));return t.nodes().forEach((s=>{let o=t.node(s),u=t.parent(s);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(s),i.setParent(s,u||r),t[n](s).forEach((e=>{let n=e.v===s?e.w:e.v,r=i.edge(n,s),o=void 0!==r?r.weight:0;i.setEdge(n,s,{weight:t.edge(e).weight+o})})),Object.hasOwn(o,"minRank")&&i.setNode(s,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))})),i},ws=function(t,e,n){let r,i={};n.forEach((n=>{let s,o,u=t.parent(n);for(;u;){if(s=t.parent(u),s?(o=i[s],i[s]=u):(o=r,r=u),o&&o!==u)return void e.setEdge(o,u);u=s}}))},bs=Zr.Graph,xs=oi;var Es=function t(e,n){if(n&&"function"==typeof n.customOrder)return void n.customOrder(e,t);let r=xs.maxRank(e),i=Os(e,xs.range(1,r+1),"inEdges"),s=Os(e,xs.range(r-1,-1,-1),"outEdges"),o=gs(e);if(ks(e,o),n&&n.disableOptimalOrderHeuristic)return;let u,a=Number.POSITIVE_INFINITY;for(let h=0,l=0;l<4;++h,++l){Ms(h%2?i:s,h%4>=2),o=xs.buildLayerMatrix(e);let t=ys(e,o);t<a&&(l=0,u=Object.assign({},o),a=t)}ks(e,u)};function Os(t,e,n){return e.map((function(e){return vs(t,e,n)}))}function Ms(t,e){let n=new bs;t.forEach((function(t){let r=t.graph().root,i=_s(t,r,n,e);i.vs.forEach(((e,n)=>t.node(e).order=n)),ws(t,n,i.vs)}))}function ks(t,e){Object.values(e).forEach((e=>e.forEach(((e,n)=>t.node(e).order=n))))}let Cs=Zr.Graph,As=oi;var Ss=function(t){let e,n=As.buildLayerMatrix(t),r=Object.assign(Ns(t,n),js(t,n)),i={};["u","d"].forEach((s=>{e="u"===s?n:Object.values(n).reverse(),["l","r"].forEach((n=>{"r"===n&&(e=e.map((t=>Object.values(t).reverse())));let o=("u"===s?t.predecessors:t.successors).bind(t),u=Rs(t,e,r,o),a=Ls(t,e,u.root,u.align,"r"===n);"r"===n&&(a=As.mapValues(a,(t=>-t))),i[s+n]=a}))}));let s=zs(t,i);return Ds(i,s),Ps(i,t.graph().align)};function Ns(t,e){let n={};return e.length&&e.reduce((function(e,r){let i=0,s=0,o=e.length,u=r[r.length-1];return r.forEach(((e,a)=>{let h=function(t,e){if(t.node(e).dummy)return t.predecessors(e).find((e=>t.node(e).dummy))}(t,e),l=h?t.node(h).order:o;(h||e===u)&&(r.slice(s,a+1).forEach((e=>{t.predecessors(e).forEach((r=>{let s=t.node(r),o=s.order;!(o<i||l<o)||s.dummy&&t.node(e).dummy||Ts(n,r,e)}))})),s=a+1,i=l)})),r})),n}function js(t,e){let n={};function r(e,r,i,s,o){let u;As.range(r,i).forEach((r=>{u=e[r],t.node(u).dummy&&t.predecessors(u).forEach((e=>{let r=t.node(e);r.dummy&&(r.order<s||r.order>o)&&Ts(n,e,u)}))}))}return e.length&&e.reduce((function(e,n){let i,s=-1,o=0;return n.forEach(((u,a)=>{if("border"===t.node(u).dummy){let e=t.predecessors(u);e.length&&(i=t.node(e[0]).order,r(n,o,a,s,i),o=a,s=i)}r(n,o,n.length,i,e.length)})),n})),n}function Ts(t,e,n){if(e>n){let t=e;e=n,n=t}let r=t[e];r||(t[e]=r={}),r[n]=!0}function Is(t,e,n){if(e>n){let t=e;e=n,n=t}return!!t[e]&&Object.hasOwn(t[e],n)}function Rs(t,e,n,r){let i={},s={},o={};return e.forEach((t=>{t.forEach(((t,e)=>{i[t]=t,s[t]=t,o[t]=e}))})),e.forEach((t=>{let e=-1;t.forEach((t=>{let u=r(t);if(u.length){u=u.sort(((t,e)=>o[t]-o[e]));let r=(u.length-1)/2;for(let a=Math.floor(r),h=Math.ceil(r);a<=h;++a){let r=u[a];s[t]===t&&e<o[r]&&!Is(n,t,r)&&(s[r]=t,s[t]=i[t]=i[r],e=o[r])}}}))})),{root:i,align:s}}function Ls(t,e,n,r,i){let s={},o=function(t,e,n,r){let i=new Cs,s=t.graph(),o=function(t,e,n){return(r,i,s)=>{let o,u=r.node(i),a=r.node(s),h=0;if(h+=u.width/2,Object.hasOwn(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":o=-u.width/2;break;case"r":o=u.width/2}if(o&&(h+=n?o:-o),o=0,h+=(u.dummy?e:t)/2,h+=(a.dummy?e:t)/2,h+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":o=a.width/2;break;case"r":o=-a.width/2}return o&&(h+=n?o:-o),o=0,h}}(s.nodesep,s.edgesep,r);return e.forEach((e=>{let r;e.forEach((e=>{let s=n[e];if(i.setNode(s),r){var u=n[r],a=i.edge(u,s);i.setEdge(u,s,Math.max(o(t,e,r),a||0))}r=e}))})),i}(t,e,n,i),u=i?"borderLeft":"borderRight";function a(t,e){let n=o.nodes(),r=n.pop(),i={};for(;r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return a((function(t){s[t]=o.inEdges(t).reduce(((t,e)=>Math.max(t,s[e.v]+o.edge(e))),0)}),o.predecessors.bind(o)),a((function(e){let n=o.outEdges(e).reduce(((t,e)=>Math.min(t,s[e.w]-o.edge(e))),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(s[e]=Math.max(s[e],n))}),o.successors.bind(o)),Object.keys(r).forEach((t=>s[t]=s[n[t]])),s}function zs(t,e){return Object.values(e).reduce(((e,n)=>{let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(n).forEach((([e,n])=>{let s=function(t,e){return t.node(e).width}(t,e)/2;r=Math.max(n+s,r),i=Math.min(n-s,i)}));const s=r-i;return s<e[0]&&(e=[s,n]),e}),[Number.POSITIVE_INFINITY,null])[1]}function Ds(t,e){let n=Object.values(e),r=As.applyWithChunking(Math.min,n),i=As.applyWithChunking(Math.max,n);["u","d"].forEach((n=>{["l","r"].forEach((s=>{let o=n+s,u=t[o];if(u===e)return;let a=Object.values(u),h=r-As.applyWithChunking(Math.min,a);"l"!==s&&(h=i-As.applyWithChunking(Math.max,a)),h&&(t[o]=As.mapValues(u,(t=>t+h)))}))}))}function Ps(t,e){return As.mapValues(t.ul,((n,r)=>{if(e)return t[e.toLowerCase()][r];{let e=Object.values(t).map((t=>t[r])).sort(((t,e)=>t-e));return(e[1]+e[2])/2}}))}let Fs=oi,$s=Ss;let Ys=yi,Xs=vi,Gs=Vi,Bs=oi.normalizeRanks,Ws=function(t){let e=function(t){let e={},n=0;function r(i){let s=n;t.children(i).forEach(r),e[i]={low:s,lim:n++}}return t.children().forEach(r),e}(t);t.graph().dummyChains.forEach((n=>{let r=t.node(n),i=r.edgeObj,s=function(t,e,n,r){let i,s,o=[],u=[],a=Math.min(e[n].low,e[r].low),h=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),o.push(i)}while(i&&(e[i].low>a||h>e[i].lim));s=i,i=r;for(;(i=t.parent(i))!==s;)u.push(i);return{path:o.concat(u.reverse()),lca:s}}(t,e,i.v,i.w),o=s.path,u=s.lca,a=0,h=o[a],l=!0;for(;n!==i.w;){if(r=t.node(n),l){for(;(h=o[a])!==u&&t.node(h).maxRank<r.rank;)a++;h===u&&(l=!1)}if(!l){for(;a<o.length-1&&t.node(h=o[a+1]).minRank<=r.rank;)a++;h=o[a]}t.setParent(n,h),n=t.successors(n)[0]}}))},qs=oi.removeEmptyRanks,Vs={run:function(t){let e=Zi.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,i){var s=t.children(r);s&&s.length&&s.forEach((t=>n(t,i+1))),e[r]=i}return t.children().forEach((t=>n(t,1))),e}(t),r=Object.values(n),i=Zi.applyWithChunking(Math.max,r)-1,s=2*i+1;t.graph().nestingRoot=e,t.edges().forEach((e=>t.edge(e).minlen*=s));let o=function(t){return t.edges().reduce(((e,n)=>e+t.edge(n).weight),0)}(t)+1;t.children().forEach((r=>Ki(t,e,s,o,i,n,r))),t.graph().nodeRankFactor=s},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((e=>{t.edge(e).nestingEdge&&t.removeEdge(e)}))}},Hs=function(t){t.children().forEach((function e(n){let r=t.children(n),i=t.node(n);if(r.length&&r.forEach(e),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let e=i.minRank,r=i.maxRank+1;e<r;++e)Qi(t,"borderLeft","_bl",n,i,e),Qi(t,"borderRight","_br",n,i,e)}}))},Us={adjust:function(t){let e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||ts(t)},undo:function(t){let e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){t.nodes().forEach((e=>ns(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);n.points.forEach(ns),Object.hasOwn(n,"y")&&ns(n)}))}(t);"lr"!==e&&"rl"!==e||(!function(t){t.nodes().forEach((e=>rs(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);n.points.forEach(rs),Object.hasOwn(n,"x")&&rs(n)}))}(t),ts(t))}},Zs=Es,Ks=function(t){(function(t){let e=Fs.buildLayerMatrix(t),n=t.graph().ranksep,r=0;e.forEach((e=>{const i=e.reduce(((e,n)=>{const r=t.node(n).height;return e>r?e:r}),0);e.forEach((e=>t.node(e).y=r+i/2)),r+=i+n}))})(t=Fs.asNonCompoundGraph(t)),Object.entries($s(t)).forEach((([e,n])=>t.node(e).x=n))},Js=oi,Qs=Zr.Graph;var to=function(t,e){let n=e&&e.debugTiming?Js.time:Js.notime;n("layout",(()=>{let r=n(" buildLayoutGraph",(()=>function(t){let e=new Qs({multigraph:!0,compound:!0}),n=lo(t.graph());return e.setGraph(Object.assign({},no,ho(n,eo),Js.pick(n,ro))),t.nodes().forEach((n=>{const r=ho(lo(t.node(n)),io);Object.keys(so).forEach((t=>{void 0===r[t]&&(r[t]=so[t])})),e.setNode(n,r),e.setParent(n,t.parent(n))})),t.edges().forEach((n=>{let r=lo(t.edge(n));e.setEdge(n,Object.assign({},uo,ho(r,oo),Js.pick(r,ao)))})),e}(t)));n(" runLayout",(()=>function(t,e,n){e(" makeSpaceForEdgeLabels",(()=>function(t){let e=t.graph();e.ranksep/=2,t.edges().forEach((n=>{let r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t))),e(" removeSelfEdges",(()=>function(t){t.edges().forEach((e=>{if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t))),e(" acyclic",(()=>Ys.run(t))),e(" nestingGraph.run",(()=>Vs.run(t))),e(" rank",(()=>Gs(Js.asNonCompoundGraph(t)))),e(" injectEdgeLabelProxies",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);if(n.width&&n.height){let n=t.node(e.v),r={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};Js.addDummyNode(t,"edge-proxy",r,"_ep")}}))}(t))),e(" removeEmptyRanks",(()=>qs(t))),e(" nestingGraph.cleanup",(()=>Vs.cleanup(t))),e(" normalizeRanks",(()=>Bs(t))),e(" assignRankMinMax",(()=>function(t){let e=0;t.nodes().forEach((n=>{let r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank))})),t.graph().maxRank=e}(t))),e(" removeEdgeLabelProxies",(()=>function(t){t.nodes().forEach((e=>{let n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t))),e(" normalize.run",(()=>Xs.run(t))),e(" parentDummyChains",(()=>Ws(t))),e(" addBorderSegments",(()=>Hs(t))),e(" order",(()=>Zs(t,n))),e(" insertSelfEdges",(()=>function(t){var e=Js.buildLayerMatrix(t);e.forEach((e=>{var n=0;e.forEach(((e,r)=>{var i=t.node(e);i.order=r+n,(i.selfEdges||[]).forEach((e=>{Js.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))}(t))),e(" adjustCoordinateSystem",(()=>Us.adjust(t))),e(" position",(()=>Ks(t))),e(" positionSelfEdges",(()=>function(t){t.nodes().forEach((e=>{var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,s=r.y,o=n.x-i,u=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*o/3,y:s-u},{x:i+5*o/6,y:s-u},{x:i+o,y:s},{x:i+5*o/6,y:s+u},{x:i+2*o/3,y:s+u}],n.label.x=n.x,n.label.y=n.y}}))}(t))),e(" removeBorderNodes",(()=>function(t){t.nodes().forEach((e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),s=t.node(n.borderLeft[n.borderLeft.length-1]),o=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-s.x),n.height=Math.abs(i.y-r.y),n.x=s.x+n.width/2,n.y=r.y+n.height/2}})),t.nodes().forEach((e=>{"border"===t.node(e).dummy&&t.removeNode(e)}))}(t))),e(" normalize.undo",(()=>Xs.undo(t))),e(" fixupEdgeLabelCoords",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t))),e(" undoCoordinateSystem",(()=>Us.undo(t))),e(" translateGraph",(()=>function(t){let e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,s=t.graph(),o=s.marginx||0,u=s.marginy||0;function a(t){let s=t.x,o=t.y,u=t.width,a=t.height;e=Math.min(e,s-u/2),n=Math.max(n,s+u/2),r=Math.min(r,o-a/2),i=Math.max(i,o+a/2)}t.nodes().forEach((e=>a(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);Object.hasOwn(n,"x")&&a(n)})),e-=o,r-=u,t.nodes().forEach((n=>{let i=t.node(n);i.x-=e,i.y-=r})),t.edges().forEach((n=>{let i=t.edge(n);i.points.forEach((t=>{t.x-=e,t.y-=r})),Object.hasOwn(i,"x")&&(i.x-=e),Object.hasOwn(i,"y")&&(i.y-=r)})),s.width=n-e+o,s.height=i-r+u}(t))),e(" assignNodeIntersects",(()=>function(t){t.edges().forEach((e=>{let n,r,i=t.edge(e),s=t.node(e.v),o=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=o,r=s),i.points.unshift(Js.intersectRect(s,n)),i.points.push(Js.intersectRect(o,r))}))}(t))),e(" reversePoints",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);n.reversed&&n.points.reverse()}))}(t))),e(" acyclic.undo",(()=>Ys.undo(t)))}(r,n,e))),n(" updateInputGraph",(()=>function(t,e){t.nodes().forEach((n=>{let r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,r.rank=i.rank,e.children(n).length&&(r.width=i.width,r.height=i.height))})),t.edges().forEach((n=>{let r=t.edge(n),i=e.edge(n);r.points=i.points,Object.hasOwn(i,"x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,r)))}))};let eo=["nodesep","edgesep","ranksep","marginx","marginy"],no={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ro=["acyclicer","ranker","rankdir","align"],io=["width","height"],so={width:0,height:0},oo=["minlen","weight","width","height","labeloffset"],uo={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ao=["labelpos"];function ho(t,e){return Js.mapValues(Js.pick(t,e),Number)}function lo(t){var e={};return t&&Object.entries(t).forEach((([t,n])=>{"string"==typeof t&&(t=t.toLowerCase()),e[t]=n})),e}let co=oi,fo=Zr.Graph;var po={graphlib:Zr,layout:to,debug:{debugOrdering:function(t){let e=co.buildLayerMatrix(t),n=new fo({compound:!0,multigraph:!0}).setGraph({});return t.nodes().forEach((e=>{n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),t.edges().forEach((t=>n.setEdge(t.v,t.w,{},t.name))),e.forEach(((t,e)=>{let r="layer"+e;n.setNode(r,{rank:"same"}),t.reduce(((t,e)=>(n.setEdge(t,e,{style:"invis"}),e)))})),n}},util:{time:oi.time,notime:oi.notime},version:"1.1.4"};const mo=(t,e,n)=>{const{x:r,y:i}=t,s=e.x,o=e.y,u=(null==n?void 0:n.x)??r,a=(null==n?void 0:n.y)??i,h=s-r<0?-1:1,l=o-i<0?-1:1;let c=Math.abs(s-r)/2<35?Math.abs(s-r)/2:35;c=Math.abs(o-i)/2<c?Math.abs(o-i)/2:c;const f=Math.abs(s-r)/2-c;return[`M ${u} ${a}`,`L ${u} ${i}`,`L ${r} ${i}`,`L ${r+f*h} ${i}`,`C ${r+f*h+c*h} ${i} ${r+f*h+c*h} ${i} ${r+f*h+c*h} ${i+c*l}`,`L ${r+f*h+c*h} ${o-c*l}`,`C ${r+f*h+c*h} ${o} ${r+f*h+c*h} ${o} ${s-f*h} ${o}`,`L ${s} ${o}`].join(" ")},go=(t,e,n,r={sy:0})=>{const{x:i}=t;let{y:s}=t;const o=e.x,u=e.y,a=(null==n?void 0:n.x)??i,h=(null==n?void 0:n.y)??s,l=o-i<0?-1:1,c=u-s<0?-1:1;s+=r.sy;let f=Math.abs(o-i)/2<35?Math.abs(o-i)/2:35;f=Math.abs(u-s)/2<f?Math.abs(u-s)/2:f;const d=Math.abs(u-s)/2-f;return[`M ${a} ${h}`,`L ${i} ${h}`,`L ${i} ${s}`,`L ${i} ${s+d*c}`,`C ${i} ${s+d*c+f*c} ${i} ${s+d*c+f*c} ${i+f*l} ${s+d*c+f*c}`,`L ${i+(Math.abs(o-i)-2*f)*l+f*l} ${s+d*c+f*c}`,`C ${o} ${s+d*c+f*c} ${o} ${s+d*c+f*c} ${o} ${u-d*c}`,`L ${o} ${u}`].join(" ")},yo={bottom:{calculateEdge:go,edgeMidX:({node:t})=>t.x,edgeMidY:({node:t})=>t.y+t.height/2,edgeParentX:({parent:t})=>t.x,edgeParentY:({parent:t})=>t.y-t.height/2,edgeX:({node:t})=>t.x,edgeY:({node:t})=>t.y+t.height/2,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y,leafHeight:({childLength:t,childrenSpacing:e,nodeHeight:n})=>(n+e)*t,leafWidth:({nodeWidth:t})=>t,leafX:()=>0,leafY:({childrenSpacing:t,index:e,nodeHeight:n})=>(n+t)*-e},left:{calculateEdge:mo,edgeMidX:({node:t})=>t.x-t.width/2,edgeMidY:({node:t})=>t.y,edgeParentX:({parent:t})=>t.x+t.width/2,edgeParentY:({parent:t})=>t.y,edgeX:({node:t})=>t.x-t.width/2,edgeY:({node:t})=>t.y,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({nodeHeight:t})=>t,leafWidth:({childLength:t,nodeWidth:e})=>e*t,leafX:({childrenSpacing:t,index:e,nodeWidth:n})=>(n+t)*e,leafY:()=>0},right:{calculateEdge:mo,edgeMidX:({node:t})=>t.x+t.width/2,edgeMidY:({node:t})=>t.y,edgeParentX:({parent:t})=>t.x-t.width/2,edgeParentY:({parent:t})=>t.y,edgeX:({node:t})=>t.x+t.width/2,edgeY:({node:t})=>t.y,leafGroupX:({node:t})=>t.x,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({nodeHeight:t})=>t,leafWidth:({childLength:t,nodeWidth:e})=>e*t,leafX:({childrenSpacing:t,index:e,nodeWidth:n})=>(n+t)*-e,leafY:()=>0},top:{calculateEdge:go,edgeMidX:({node:t})=>t.x,edgeMidY:({node:t})=>t.y-t.height/2,edgeParentX:({parent:t})=>t.x,edgeParentY:({parent:t})=>t.y+t.height/2,edgeX:({node:t})=>t.x,edgeY:({node:t})=>t.y-t.height/2,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({childLength:t,childrenSpacing:e,nodeHeight:n})=>(n+e)*t,leafWidth:({nodeWidth:t})=>t,leafX:()=>0,leafY:({childrenSpacing:t,index:e,nodeHeight:n})=>(n+t)*e}},_o={bottom:"BT",left:"LR",right:"RL",top:"TB"},vo={borderColor:"#BCBCBC",borderColorHover:"#5C6BC0",borderRadius:"5px",borderStyle:"solid",borderWidth:1,canvasStyle:"",childrenSpacing:50,containerClassName:"root",contentKey:"name",direction:"top",edgeColor:"#BCBCBC",edgeColorHover:"#5C6BC0",edgeWidth:1,enableExpandCollapse:!1,enableToolbar:!1,enableTooltip:!1,fontColor:"#000000",fontFamily:"",fontSize:"14px",fontWeight:"400",groupLeafNodes:!1,groupLeafNodesSpacing:10,height:"auto",highlightOnHover:!0,nodeBGColor:"#FFFFFF",nodeBGColorHover:"#FFFFFF",nodeClassName:"apextree-node",nodeHeight:30,nodeStyle:"",nodeTemplate:t=>`<div style='display: flex;justify-content: center;align-items: center; text-align: center; height: 100%;'>${t}</div>`,nodeWidth:50,siblingSpacing:50,tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#BCBCBC",tooltipId:"apextree-tooltip-container",tooltipMaxWidth:100,viewPortHeight:600,viewPortWidth:800,width:"100%"},wo=(t,e={})=>{for(const n in e)null==t||t.setAttribute(n,e[n])},bo=(t,e,n,r)=>{const i=null==t?void 0:t.options,s=(null==i?void 0:i.borderWidth)||r.borderWidth;let o=(null==i?void 0:i.borderColor)||r.borderColor,u=(null==i?void 0:i.nodeBGColor)||r.nodeBGColor;n&&(o=(null==i?void 0:i.borderColorHover)||r.borderColorHover,u=(null==i?void 0:i.nodeBGColorHover)||r.nodeBGColorHover);const a=document.querySelector(`[data-self='${t.id}'] foreignObject div`);if(a&&!t.id.endsWith("_leafs")&&(a.style.borderWidth=`${s}px`,a.style.borderColor=o,a.style.backgroundColor=u),t.parent){const i=document.getElementById(`${t.parent}-${t.id}`);wo(i,n?{stroke:r.edgeColorHover,"stroke-width":r.edgeWidth+1}:{stroke:r.edgeColor,"stroke-width":r.edgeWidth}),t.parent&&bo(e[t.parent],e,n,r)}};function xo(t,e,n){const{children:r,...i}=t,s={...i,children:r?r.map((t=>t.id)):[],parent:e?e.id:void 0};if(n[s.id]=s,null==r?void 0:r.length)for(const o of r)xo(o,s,n)}function Eo(t){const e={};return xo(t,void 0,e),e}const Oo={},Mo=[];function ko(t,e){if(Array.isArray(t))for(const n of t)ko(n,e);else if("object"!=typeof t)Ao(Object.getOwnPropertyNames(e)),Oo[t]=Object.assign(Oo[t]||{},e);else for(const n in t)ko(n,t[n])}function Co(t){return Oo[t]||{}}function Ao(t){Mo.push(...t)}function So(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function No(t){return t%360*Math.PI/180}function jo(t){return t.charAt(0).toUpperCase()+t.slice(1)}function To(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function Io(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:u,y:a}=e.bbox();s&&(r=r.includes("left")?u:r.includes("right")?u+n:u+n/2),o&&(i=i.includes("top")?a:i.includes("bottom")?a+t:a+t/2)}return[r,i]}const Ro=new Set(["desc","metadata","title"]),Lo=t=>Ro.has(t.nodeName),zo=(t,e,n={})=>{const r={...e};for(const i in r)r[i].valueOf()===n[i]&&delete r[i];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},Do="http://www.w3.org/2000/svg",Po="http://www.w3.org/2000/xmlns/",Fo="http://www.w3.org/1999/xlink",$o={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class Yo{}const Xo={},Go="___SYMBOL___ROOT___";function Bo(t,e=Do){return $o.document.createElementNS(e,t)}function Wo(t,e=!1){if(t instanceof Yo)return t;if("object"==typeof t)return Ho(t);if(null==t)return new Xo[Go];if("string"==typeof t&&"<"!==t.charAt(0))return Ho($o.document.querySelector(t));const n=e?$o.document.createElement("div"):Bo("svg");return n.innerHTML=t,t=Ho(n.firstChild),n.removeChild(n.firstChild),t}function qo(t,e){return e&&(e instanceof $o.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:Bo(t)}function Vo(t){if(!t)return null;if(t.instance instanceof Yo)return t.instance;if("#document-fragment"===t.nodeName)return new Xo.Fragment(t);let e=jo(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":Xo[e]||(e="Dom"),new Xo[e](t)}let Ho=Vo;function Uo(t,e=t.name,n=!1){return Xo[e]=t,n&&(Xo[Go]=t),Ao(Object.getOwnPropertyNames(t.prototype)),t}let Zo=1e3;function Ko(t){return"Svgjs"+jo(t)+Zo++}function Jo(t){for(let e=t.children.length-1;e>=0;e--)Jo(t.children[e]);return t.id?(t.id=Ko(t.nodeName),t):t}function Qo(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function tu(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}ko("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=Wo(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=Wo(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=Wo(t)).before(this),this},insertAfter:function(t){return(t=Wo(t)).after(this),this}});const eu=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,nu=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ru=/rgb\((\d+),(\d+),(\d+)\)/,iu=/(#[a-z_][a-z0-9\-_]*)/i,su=/\)\s*,?\s*/,ou=/\s/g,uu=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,au=/^rgb\(/,hu=/^(\s+)?$/,lu=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,cu=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,fu=/[\s,]+/,du=/[MLHVCSQTAZ]/i;function pu(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function mu(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function gu(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}ko("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(fu)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),ko("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||hu.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||hu.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),ko("Dom",{data:function(t,e,n){if(null==t)return this.data(So(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(r){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),ko("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class yu{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof yu||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:n,round:r,sin:i,PI:s}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new yu(t,e,r,"lch")}if("sine"===t){const t=r(80*i(2*s*(e=null==e?n():e)/.5+.01)+150),o=r(50*i(2*s*e/.5+4.6)+200),u=r(100*i(2*s*e/.5+2.3)+150);return new yu(t,o,u)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new yu(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new yu(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new yu(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new yu(t,e,r,"lab")}if("grey"===t){const t=255*n();return new yu(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(uu.test(t)||au.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);if(1===o)return new yu(0,0,0,1,"cmyk");return new yu((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),u=Math.min(r,i,s),a=(o+u)/2,h=o===u,l=o-u;return new yu(360*(h?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(h?0:a>.5?l/(2-o-u):l/(o+u)),100*a,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const c in this.space)delete this[this.space[c]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=mu(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:mu(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:mu(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:mu(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:mu(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:mu(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(au.test(t)){const e=t.replace(ou,""),[n,r,i]=ru.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!uu.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=nu.exec((s=t,4===s.length?["#",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(""):s)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var s;const{_a:o,_b:u,_c:a,_d:h}=this,l="rgb"===this.space?{r:o,g:u,b:a}:"xyz"===this.space?{x:o,y:u,z:a}:"hsl"===this.space?{h:o,s:u,l:a}:"lab"===this.space?{l:o,a:u,b:a}:"lch"===this.space?{l:o,c:u,h:a}:"cmyk"===this.space?{c:o,m:u,y:a,k:h}:{};Object.assign(this,l)}lab(){const{x:t,y:e,z:n}=this.xyz();return new yu(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;i<0&&(i*=-1,i=360-i);return new yu(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,u=i/500+o,a=o-s/200,h=16/116,l=.008856,c=7.787;t=.95047*(u**3>l?u**3:(u-h)/c),e=1*(o**3>l?o**3:(o-h)/c),n=1.08883*(a**3>l?a**3:(a-h)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,u=.0031308,a=r>u?1.055*o(r,1/2.4)-.055:12.92*r,h=i>u?1.055*o(i,1/2.4)-.055:12.92*i,l=s>u?1.055*o(s,1/2.4)-.055:12.92*s;return new yu(255*a,255*h,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e){n*=255;return new yu(n,n,n)}const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*gu(i,r,t+1/3),o=255*gu(i,r,t),u=255*gu(i,r,t-1/3);return new yu(s,o,u)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new yu(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(pu);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,u=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,h=(.4124*o+.3576*u+.1805*a)/.95047,l=(.2126*o+.7152*u+.0722*a)/1,c=(.0193*o+.1192*u+.9505*a)/1.08883,f=h>.008856?Math.pow(h,1/3):7.787*h+16/116,d=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new yu(f,d,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class _u{constructor(...t){this.init(...t)}clone(){return new _u(this)}init(t,e){const n=0,r=0,i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){wu.isMatrixLike(t)||(t=new wu(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function vu(t,e,n){return Math.abs(e-t)<1e-6}class wu{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,u=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,a=t.shear||0,h=t.rotate||t.theta||0,l=new _u(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new _u(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,g=new _u(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,_=g.y,v=new _u(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:u,skewX:i,skewY:s,shear:a,theta:h,rx:v.x,ry:v.y,tx:y,ty:_,ox:c,oy:f,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,u=t.e+t.a*e.e+t.c*e.f,a=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=u,n.f=a,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new wu(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,u=this.f,a=n*s-r*i,h=a>0?1:-1,l=h*Math.sqrt(n*n+r*r),c=Math.atan2(h*r,h*n),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/a,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:f,translateX:o-t+t*d*l+e*(m*d*l-p*g),translateY:u-e+t*p*l+e*(m*p*l+d*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new wu(t);return vu(this.a,e.a)&&vu(this.b,e.b)&&vu(this.c,e.c)&&vu(this.d,e.d)&&vu(this.e,e.e)&&vu(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=wu.fromArray([1,0,0,1,0,0]);return t=t instanceof Wu?t.matrixify():"string"==typeof t?wu.fromArray(t.split(fu).map(parseFloat)):Array.isArray(t)?wu.fromArray(t):"object"==typeof t&&wu.isMatrixLike(t)?t:"object"==typeof t?(new wu).transform(t):6===arguments.length?wu.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const u=r/o,a=-e/o,h=-n/o,l=t/o,c=-(u*i+h*s),f=-(a*i+l*s);return this.a=u,this.b=a,this.c=h,this.d=l,this.e=c,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof wu?t:new wu(t);return wu.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof wu?t:new wu(t);return wu.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=No(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:u,d:a,e:h,f:l}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=u*r-a*i,this.d=a*r+u*i,this.e=h*r-l*i+n*i-e*r+e,this.f=l*r+h*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:u,e:a,f:h}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=u*e,this.e=a*t-n*t+n,this.f=h*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:u,f:a}=this;return this.a=r+i*t,this.c=s+o*t,this.e=u+a*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=No(t),e=No(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:u,c:a,d:h,e:l,f:c}=this;return this.a=o+u*i,this.b=u+o*s,this.c=a+h*i,this.d=h+a*s,this.e=l+c*i-r*i,this.f=c+l*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(wu.isMatrixLike(t)){return new wu(t).multiplyO(this)}const e=wu.formatTransforms(t),{x:n,y:r}=new _u(e.ox,e.oy).transform(this),i=(new wu).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new _u(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function bu(){if(!bu.nodes){const t=Wo().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;bu.nodes={svg:t,path:e}}if(!bu.nodes.svg.node.parentNode){const t=$o.document.body||$o.document.documentElement;bu.nodes.svg.addTo(t)}return bu.nodes}function xu(t){return!(t.width||t.height||t.x||t.y)}Uo(wu,"Matrix");class Eu{constructor(...t){this.init(...t)}addOffset(){return this.x+=$o.window.pageXOffset,this.y+=$o.window.pageYOffset,new Eu(this)}init(t){return t="string"==typeof t?t.split(fu).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return xu(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new Eu(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof wu||(t=new wu(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new _u(this.x,this.y),new _u(this.x2,this.y),new _u(this.x,this.y2),new _u(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new Eu(e,r,n-e,i-r)}}function Ou(t,e,n){let r;try{if(r=e(t.node),xu(r)&&((i=t.node)!==$o.document&&!($o.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===$o.document}).call($o.document.documentElement,i)))throw new Error("Element not in the dom")}catch(s){r=n(t)}var i;return r}ko({viewbox:{viewbox(t,e,n,r){return null==t?new Eu(this.attr("viewBox")):this.attr("viewBox",new Eu(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,u=Math.min(s,o);if(null==t)return u;let a=u/t;a===1/0&&(a=Number.MAX_SAFE_INTEGER/100),e=e||new _u(n/2/s+i.x,r/2/o+i.y);const h=new Eu(i).transform(new wu({scale:a,origin:e}));return this.viewbox(h)}}}),Uo(Eu,"Box");class Mu extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}Qo([Mu],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const ku=["toArray","constructor","each"];function Cu(t,e){return new Mu(So((e||$o.document).querySelectorAll(t),(function(t){return Vo(t)})))}Mu.extend=function(t){t=t.reduce(((t,e)=>(ku.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),Qo([Mu],t)};let Au=0;const Su={};function Nu(t){let e=t.getEventHolder();return e===$o.window&&(e=Su),e.events||(e.events={}),e.events}function ju(t){return t.getEventTarget()}function Tu(t,e,n,r,i){const s=n.bind(r||t),o=Wo(t),u=Nu(o),a=ju(o);e=Array.isArray(e)?e:e.split(fu),n._svgjsListenerId||(n._svgjsListenerId=++Au),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";u[e]=u[e]||{},u[e][r]=u[e][r]||{},u[e][r][n._svgjsListenerId]=s,a.addEventListener(e,s,i||!1)}))}function Iu(t,e,n,r){const i=Wo(t),s=Nu(i),o=ju(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(fu)).forEach((function(t){const e=t&&t.split(".")[0],u=t&&t.split(".")[1];let a,h;if(n)s[e]&&s[e][u||"*"]&&(o.removeEventListener(e,s[e][u||"*"][n],r||!1),delete s[e][u||"*"][n]);else if(e&&u){if(s[e]&&s[e][u]){for(h in s[e][u])Iu(o,[e,u].join("."),h);delete s[e][u]}}else if(u)for(t in s)for(a in s[t])u===a&&Iu(o,[t,u].join("."));else if(e){if(s[e]){for(a in s[e])Iu(o,[e,a].join("."));delete s[e]}}else{for(t in s)Iu(o,t);!function(t){let e=t.getEventHolder();e===$o.window&&(e=Su),e.events&&(e.events={})}(i)}}))}class Ru extends Yo{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=ju(t);return e instanceof $o.window.Event||(e=new $o.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const r in n)for(const e in n[r])n[r][e](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return Iu(this,t,e,n),this}on(t,e,n,r){return Tu(this,t,e,n,r),this}removeEventListener(){}}function Lu(){}Uo(Ru,"EventTarget");const zu=400,Du=">",Pu=0,Fu={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class $u extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(fu).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class Yu{constructor(...t){this.init(...t)}convert(t){return new Yu(this.value,t)}divide(t){return t=new Yu(t),new Yu(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(eu))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof Yu&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new Yu(t),new Yu(this-t,this.unit||t.unit)}plus(t){return t=new Yu(t),new Yu(this+t,this.unit||t.unit)}times(t){return t=new Yu(t),new Yu(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Xu=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Gu=[];class Bu extends Ru{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=Wo(t)).removeNamespace&&this.node instanceof $o.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return Wo(t).put(this,e)}children(){return new Mu(So(this.node.children,(function(t){return Vo(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=Jo(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new Bu(Bo(t),e))}first(){return Vo(this.node.firstChild)}get(t){return Vo(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=Ko(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return Vo(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=Vo(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=Vo(e.node.parentNode));return e}put(t,e){return t=Wo(t),this.add(t,e),t}putIn(t,e){return Wo(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=Wo(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const i in r)"number"==typeof r[i]&&(r[i]=Math.round(r[i]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,Do)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=Vo(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=Bo("wrapper",n),i=$o.document.createDocumentFragment();r.innerHTML=t;for(let o=r.children.length;o--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}Qo(Bu,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=lu.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Fu[t]:lu.test(e)?parseFloat(e):e;"number"==typeof(e=Gu.reduce(((e,n)=>n(t,e,this)),e))?e=new Yu(e):Xu.has(t)&&yu.isColor(e)?e=new yu(e):e.constructor===Array&&(e=new $u(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return Cu(t,this.node)},findOne:function(t){return Vo(this.node.querySelector(t))}}),Uo(Bu,"Dom");class Wu extends Bu{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new Yu(t).plus(this.x()))}dy(t=0){return this.y(new Yu(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=Wo(t));const n=new Mu;let r=this;for(;(r=r.parent())&&r.node!==$o.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(iu);return e?Wo(e[1]):null}root(){const t=this.parent(Xo[Go]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=To(this,t,e);return this.width(new Yu(n.width)).height(new Yu(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return zo(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}Qo(Wu,{bbox:function(){const t=Ou(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(bu().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new Eu(t)},rbox:function(t){const e=Ou(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new Eu(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new _u(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new wu(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new wu(e)}return new wu(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new wu}}}),Uo(Wu,"Element");const qu={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof yu||yu.isRgb(e)||e instanceof Wu)this.attr(t,e);else for(n=qu[t].length-1;n>=0;n--)null!=e[qu[t][n]]&&this.attr(qu.prefix(t,qu[t][n]),e[qu[t][n]]);return this},ko(["Element","Runner"],e)})),ko(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new wu(this):this.attr("transform",new wu(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),ko("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Yu(t)):this.rx(t).ry(e)}}),ko("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new _u(this.node.getPointAtLength(t))}}),ko(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});ko("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),ko("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(su).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(fu).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(wu.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new wu)},toParent:function(t,e){if(this===t)return this;if(Lo(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new wu(this).decompose();return null==t?e:e[t]}wu.isMatrixLike(t)||(t={...t,origin:Io(t,this)});const n=new wu(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class Vu extends Wu{flatten(){return this.each((function(){if(this instanceof Vu)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}Uo(Vu,"Container");class Hu extends Vu{constructor(t,e=t){super(qo("defs",t),e)}flatten(){return this}ungroup(){return this}}Uo(Hu,"Defs");class Uu extends Wu{}function Zu(t){return this.attr("rx",t)}function Ku(t){return this.attr("ry",t)}function Ju(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Qu(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function ta(t){return this.attr("cx",t)}function ea(t){return this.attr("cy",t)}function na(t){return null==t?2*this.rx():this.rx(new Yu(t).divide(2))}function ra(t){return null==t?2*this.ry():this.ry(new Yu(t).divide(2))}Uo(Uu,"Shape");const ia=Object.freeze(Object.defineProperty({__proto__:null,cx:ta,cy:ea,height:ra,rx:Zu,ry:Ku,width:na,x:Ju,y:Qu},Symbol.toStringTag,{value:"Module"}));class sa extends Uu{constructor(t,e=t){super(qo("ellipse",t),e)}size(t,e){const n=To(this,t,e);return this.rx(new Yu(n.width).divide(2)).ry(new Yu(n.height).divide(2))}}Qo(sa,ia),ko("Container",{ellipse:tu((function(t=0,e=t){return this.put(new sa).size(t,e).move(0,0)}))}),Uo(sa,"Ellipse");class oa extends Bu{constructor(t=$o.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new Bu(Bo("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function ua(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Yu(t),fy:new Yu(e)}):this.attr({x1:new Yu(t),y1:new Yu(e)})}function aa(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Yu(t),cy:new Yu(e)}):this.attr({x2:new Yu(t),y2:new Yu(e)})}Uo(oa,"Fragment");const ha=Object.freeze(Object.defineProperty({__proto__:null,from:ua,to:aa},Symbol.toStringTag,{value:"Module"}));class la extends Vu{constructor(t,e){super(qo(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new Eu}targets(){return Cu("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}Qo(la,ha),ko({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:tu((function(t,e){return this.put(new la(t)).update(e)}))}}),Uo(la,"Gradient");class ca extends Vu{constructor(t,e=t){super(qo("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new Eu}targets(){return Cu("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}ko({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:tu((function(t,e,n){return this.put(new ca).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),Uo(ca,"Pattern");let fa=class extends Uu{constructor(t,e=t){super(qo("image",t),e)}load(t,e){if(!t)return this;const n=new $o.window.Image;return Tu(n,"load",(function(t){const r=this.parent(ca);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof ca&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),Tu(n,"load error",(function(){Iu(n)})),this.attr("href",n.src=t,Fo)}};!function(t){Gu.push(t)}((function(t,e,n){return"fill"!==t&&"stroke"!==t||cu.test(e)&&(e=n.root().defs().image(e)),e instanceof fa&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e})),ko({Container:{image:tu((function(t,e){return this.put(new fa).size(0,0).load(t,e)}))}}),Uo(fa,"Image");class da extends $u{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new Eu(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(fu).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){wu.isMatrixLike(t)||(t=new wu(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}const pa=da;const ma=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:pa,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},Symbol.toStringTag,{value:"Module"}));class ga extends Uu{constructor(t,e=t){super(qo("line",t),e)}array(){return new da([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new da(t).toLine(),this.attr(t))}size(t,e){const n=To(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}Qo(ga,ma),ko({Container:{line:tu((function(...t){return ga.prototype.plot.apply(this.put(new ga),null!=t[0]?t:[0,0,0,0])}))}}),Uo(ga,"Line");class ya extends Vu{constructor(t,e=t){super(qo("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function _a(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}ko({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:tu((function(t,e,n){return this.put(new ya).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof ya?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),Uo(ya,"Marker");const va={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class wa{done(){return!1}}class ba extends wa{constructor(t=Du){super(),this.ease=va[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class xa extends wa{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function Ea(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}Qo(class extends xa{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:_a("_duration",Ea),overshoot:_a("_overshoot",Ea)});Qo(class extends xa{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,u=this._windup;return!1!==u&&(s=Math.max(-u,Math.min(s,u))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:_a("_windup"),p:_a("P"),i:_a("I"),d:_a("D")});const Oa={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Ma={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},ka="mlhvqtcsaz".split("");for(let kh=0,Ch=ka.length;kh<Ch;++kh)Ma[ka[kh]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,i=e.length;t<i;++t)e[t]=e[t]+(t%2?n.y:n.x);return Ma[t](e,n,r)}}(ka[kh].toUpperCase());function Ca(t){return t.segment.length&&t.segment.length-1===Oa[t.segment[0].toUpperCase()]}function Aa(t,e){t.inNumber&&Sa(t,!1);const n=du.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function Sa(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,Ca(t)&&Na(t)}function Na(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Ma[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function ja(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function Ta(t){return"E"===t.lastToken.toUpperCase()}const Ia=new Set([" ",",","\t","\n","\r","\f"]);class Ra extends $u{bbox(){return bu().path.setAttribute("d",this.toString()),new Eu(bu.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=t,this[i][2]+=e):"H"===r?this[i][1]+=t:"V"===r?this[i][1]+=e:"C"===r||"S"===r||"Q"===r?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===r&&(this[i][5]+=t,this[i][6]+=e)):"A"===r&&(this[i][6]+=t,this[i][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new _u,p:new _u};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!Aa(i,r))if("."!==r)if(isNaN(parseInt(r)))if(Ia.has(r))i.inNumber&&Sa(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(du.test(r)){if(i.inNumber)Sa(i,!1);else{if(!Ca(i))throw new Error("parser Error");Na(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!Ta(i)){Sa(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||ja(i)){i.inNumber=!0,i.number=r,Sa(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){Sa(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&Sa(i,!1),i.inSegment&&Ca(i)&&Na(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const La=t=>{const e=typeof t;return"number"===e?Yu:"string"===e?yu.isColor(t)?yu:fu.test(t)?du.test(t)?Ra:$u:eu.test(t)?Yu:Da:Ya.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?$u:"object"===e?$a:Da};class za{constructor(t){this._stepper=t||new ba("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(La(t));let e=new this._type(t);return this._type===yu&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===$a&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class Da{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Pa{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Pa.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Pa.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Fa=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class $a{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===yu&&t[n+7]!==e[n+7]){const e=t[n+7],r=new yu(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=La(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(Fa),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const Ya=[Da,Pa,$a];class Xa extends Uu{constructor(t,e=t){super(qo("path",t),e)}array(){return this._array||(this._array=new Ra(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new Ra(t))}size(t,e){const n=To(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}Xa.prototype.MorphArray=Ra,ko({Container:{path:tu((function(t){return this.put(new Xa).plot(t||new Ra)}))}}),Uo(Xa,"Path");const Ga=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new da(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new da(t))},size:function(t,e){const n=To(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));class Ba extends Uu{constructor(t,e=t){super(qo("polygon",t),e)}}ko({Container:{polygon:tu((function(t){return this.put(new Ba).plot(t||new da)}))}}),Qo(Ba,ma),Qo(Ba,Ga),Uo(Ba,"Polygon");class Wa extends Uu{constructor(t,e=t){super(qo("polyline",t),e)}}ko({Container:{polyline:tu((function(t){return this.put(new Wa).plot(t||new da)}))}}),Qo(Wa,ma),Qo(Wa,Ga),Uo(Wa,"Polyline");class qa extends Uu{constructor(t,e=t){super(qo("rect",t),e)}}Qo(qa,{rx:Zu,ry:Ku}),ko({Container:{rect:tu((function(t,e){return this.put(new qa).size(t,e)}))}}),Uo(qa,"Rect");class Va{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Ha={nextDraw:null,frames:new Va,timeouts:new Va,immediates:new Va,timer:()=>$o.window.performance||$o.window.Date,transforms:[],frame(t){const e=Ha.frames.push({run:t});return null===Ha.nextDraw&&(Ha.nextDraw=$o.window.requestAnimationFrame(Ha._draw)),e},timeout(t,e){e=e||0;const n=Ha.timer().now()+e,r=Ha.timeouts.push({run:t,time:n});return null===Ha.nextDraw&&(Ha.nextDraw=$o.window.requestAnimationFrame(Ha._draw)),r},immediate(t){const e=Ha.immediates.push(t);return null===Ha.nextDraw&&(Ha.nextDraw=$o.window.requestAnimationFrame(Ha._draw)),e},cancelFrame(t){null!=t&&Ha.frames.remove(t)},clearTimeout(t){null!=t&&Ha.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ha.immediates.remove(t)},_draw(t){let e=null;const n=Ha.timeouts.last();for(;(e=Ha.timeouts.shift())&&(t>=e.time?e.run():Ha.timeouts.push(e),e!==n););let r=null;const i=Ha.frames.last();for(;r!==i&&(r=Ha.frames.shift());)r.run(t);let s=null;for(;s=Ha.immediates.shift();)s();Ha.nextDraw=Ha.timeouts.first()||Ha.frames.first()?$o.window.requestAnimationFrame(Ha._draw):null}},Ua=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Za=function(){const t=$o.window;return(t.performance||t.Date).now()};class Ka extends Ru{constructor(t=Za){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(Ua);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ha.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ha.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let s=this._runners.length;s--;){const t=this._runners[s],e=t.runner;this._time-t.start<=0&&e.reset()}let i=!1;for(let s=0,o=this._runners.length;s<o;s++){const t=this._runners[s],e=t.runner;let n=r;const u=this._time-t.start;if(u<=0){i=!0;continue}if(u<n&&(n=u),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--s,--o)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}ko({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Ka,this._timeline):(this._timeline=t,this)}}});class Ja extends Ru{constructor(t){super(),this.id=Ja.id++,t="function"==typeof(t=null==t?zu:t)?new xa(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof xa,this._stepper=this._isDeclarative?t:new ba,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new wu,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e??Pu,n=n||"last","object"!=typeof(t=t??zu)||t instanceof wa||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,s=t.wait??s,t=t.duration??zu),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Ja.sanitise(t,e,n),i=new Ja(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new wu,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new ba(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let u;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,u=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(u,1),0)},a=i*(r+n)-r;return u=e<=0?Math.round(t(1e-5)):e<a?t(e):Math.round(t(a-1e-5)),u}const a=Math.floor(this.loops()),h=s&&a%2==0;return u=a+(h&&!o||o&&h?t:1-t),this.loops(u)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){this._queue.push({initialiser:t||Lu,runner:e||Lu,retarget:n,isTransform:r,initialised:!1,finished:!1});return this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof Ka||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let u=!1;return(n||o)&&(this._initialise(n),this.transforms=new wu,u=this._run(o?t:e),this.fire("step",this)),this.done=this.done||u&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Ja.id=0;class Qa{constructor(t=new wu,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}Qo([Ja,Qa],{mergeWith(t){return new Qa(t.transforms.lmultiply(this.transforms),t.id)}});const th=(t,e)=>t.lmultiplyO(e),eh=t=>t.transforms;function nh(){const t=this._transformationRunners.runners.map(eh).reduce(th,new wu);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class rh{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Qa).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(t&&n.done&&t.done&&(!n._timeline||!n._timeline._runnerIds.includes(n.id))&&(!t._timeline||!t._timeline._runnerIds.includes(t.id))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}ko({Element:{animate(t,e,n){const r=Ja.sanitise(t,e,n),i=this.timeline();return new Ja(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(eh).reduce(th,new wu)},_addRunner(t){this._transformationRunners.add(t),Ha.cancelImmediate(this._frameId),this._frameId=Ha.immediate(nh.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new rh).add(new Qa(new wu(this))))}}});Qo(Ja,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new za(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(u=s,n.filter((t=>!u.includes(t))));var u;if(o.length){const e=this.element()[t](o),n=new $a(i.from()).valueOf();Object.assign(n,e),i.from(n)}const a=new $a(i.to()).valueOf();Object.assign(a,e),i.to(a),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new za(this._stepper).to(new Yu(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=wu.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new za(this._stepper).type(n?Pa:wu);let s,o,u,a,h;return this.queue((function(){o=o||this.element(),s=s||Io(t,o),h=new wu(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:f}=new _u(s).transform(o._currentTransform(this));let d=new wu({...t,origin:[c,f]}),p=this._isDeclarative&&u?u:h;if(n){d=d.decompose(c,f),p=p.decompose(c,f);const t=d.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);d.rotate=n[s]}e&&(r||(d.rotate=t.rotate||0),this._isDeclarative&&a&&(p.rotate=a)),i.from(p),i.to(d);const m=i.at(l);return a=m.rotate,u=new wu(m),this.addTransform(u),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=Io(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new Yu(e),this._tryRetarget(t,e))return this;const n=new za(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new Yu(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new za(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new Yu(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new za(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new Eu(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),Qo(Ja,{rx:Zu,ry:Ku,from:ua,to:aa}),Uo(Ja,"Runner");class ih extends Vu{constructor(t,e=t){super(qo("svg",t),e),this.namespace()}defs(){return this.isRoot()?Vo(this.node.querySelector("defs"))||this.put(new Hu):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof $o.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:Do,version:"1.1"}).attr("xmlns:xlink",Fo,Po):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,Po).attr("xmlns:svgjs",null,Po)}root(){return this.isRoot()?this:super.root()}}ko({Container:{nested:tu((function(){return this.put(new ih)}))}}),Uo(ih,"Svg",!0);let sh=class extends Vu{constructor(t,e=t){super(qo("symbol",t),e)}};ko({Container:{symbol:tu((function(){return this.put(new sh)}))}}),Uo(sh,"Symbol");const oh=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild($o.document.createTextNode(t)),this},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}},Symbol.toStringTag,{value:"Module"}));class uh extends Uu{constructor(t,e=t){super(qo("text",t),e),this.dom.leading=this.dom.leading??new Yu(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Yu(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){if(Lo(this.node))return;const i=$o.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new Yu(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Yu(t.leading||1.3),this}writeDataToDom(){return zo(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||Lo(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===Vo(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}Qo(uh,oh),ko({Container:{text:tu((function(t=""){return this.put(new uh).text(t)})),plain:tu((function(t=""){return this.put(new uh).plain(t)}))}}),Uo(uh,"Text");class ah extends Uu{constructor(t,e=t){super(qo("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof uh))return this;const e=t.index(this),n=$o.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new Yu(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}Qo(ah,oh),ko({Tspan:{tspan:tu((function(t=""){const e=new ah;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),Uo(ah,"Tspan");class hh extends Uu{constructor(t,e=t){super(qo("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new Yu(t).divide(2))}}Qo(hh,{x:Ju,y:Qu,cx:ta,cy:ea,width:na,height:ra}),ko({Container:{circle:tu((function(t=0){return this.put(new hh).size(t).move(0,0)}))}}),Uo(hh,"Circle");class lh extends Vu{constructor(t,e=t){super(qo("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return Cu("svg [clip-path*="+this.id()+"]")}}ko({Container:{clip:tu((function(){return this.defs().put(new lh)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof lh?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),Uo(lh,"ClipPath");class ch extends Wu{constructor(t,e=t){super(qo("foreignObject",t),e)}}ko({Container:{foreignObject:tu((function(t,e){return this.put(new ch).size(t,e)}))}}),Uo(ch,"ForeignObject");const fh=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof $o.window.SVGSVGElement?new Eu(n.attr(["x","y","width","height"])):n.bbox()}catch(u){return}const i=new wu(n),s=i.translate(t,e).transform(i.inverse()),o=new _u(r.x,r.y).transform(s);n.move(o.x,o.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=To(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach((t=>{const e=new _u(n).transform(new wu(t).inverse());t.scale(i,s,e.x,e.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}},Symbol.toStringTag,{value:"Module"}));class dh extends Vu{constructor(t,e=t){super(qo("g",t),e)}}Qo(dh,fh),ko({Container:{group:tu((function(){return this.put(new dh)}))}}),Uo(dh,"G");class ph extends Vu{constructor(t,e=t){super(qo("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,Fo)}}Qo(ph,fh),ko({Container:{link:tu((function(t){return this.put(new ph).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new ph,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),Uo(ph,"A");class mh extends Vu{constructor(t,e=t){super(qo("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return Cu("svg [mask*="+this.id()+"]")}}ko({Container:{mask:tu((function(){return this.defs().put(new mh)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof mh?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),Uo(mh,"Mask");class gh extends Wu{constructor(t,e=t){super(qo("stop",t),e)}update(t){return("number"==typeof t||t instanceof Yu)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new Yu(t.offset)),this}}ko({Gradient:{stop:function(t,e,n){return this.put(new gh).update(t,e,n)}}}),Uo(gh,"Stop");class yh extends Wu{constructor(t,e=t){super(qo("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const r in e)n+=r.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[r]+";";return n+="}",n}(t,e))}}ko("Dom",{style(t,e){return this.put(new yh).rule(t,e)},fontface(t,e,n){return this.put(new yh).font(t,e,n)}}),Uo(yh,"Style");class _h extends uh{constructor(t,e=t){super(qo("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}ko({Container:{textPath:tu((function(t,e){return t instanceof uh||(t=this.text(t)),t.path(e)}))},Text:{path:tu((function(t,e=!0){const n=new _h;let r;if(t instanceof Xa||(t=this.defs().path(t)),n.attr("href","#"+t,Fo),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:tu((function(t){return t instanceof uh||(t=(new uh).addTo(this.parent()).text(t)),t.path(this)})),targets(){return Cu("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),_h.prototype.MorphArray=Ra,Uo(_h,"TextPath");class vh extends Uu{constructor(t,e=t){super(qo("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,Fo)}}ko({Container:{use:tu((function(t,e){return this.put(new vh).use(t,e)}))}}),Uo(vh,"Use");const wh=Wo;Qo([ih,sh,fa,ca,ya],Co("viewbox")),Qo([ga,Wa,Ba,Xa],Co("marker")),Qo(uh,Co("Text")),Qo(Xa,Co("Path")),Qo(Hu,Co("Defs")),Qo([uh,ah],Co("Tspan")),Qo([qa,sa,la,Ja],Co("radius")),Qo(Ru,Co("EventTarget")),Qo(Bu,Co("Dom")),Qo(Wu,Co("Element")),Qo(Uu,Co("Shape")),Qo([Vu,oa],Co("Container")),Qo(la,Co("Gradient")),Qo(Ja,Co("Runner")),Mu.extend([...new Set(Mo)]),function(t=[]){Ya.push(...[].concat(t))}([Yu,yu,Eu,wu,$u,da,Ra,_u]),Qo(Ya,{to(t){return(new za).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var bh=function(t){return t.touches||[{clientX:t.clientX,clientY:t.clientY}]};Qo(ih,{panZoom:function(t){var e,n,r,i,s,o,u,a,h,l,c,f,d=this;if(this.off(".panZoom"),!1===t)return this;var p,m,g=null!=(n=(t=null!=(e=t)?e:{}).zoomFactor)?n:2,y=null!=(r=t.zoomMin)?r:Number.MIN_VALUE,_=null!=(i=t.zoomMax)?i:Number.MAX_VALUE,v=null==(s=t.wheelZoom)||s,w=null==(o=t.pinchZoom)||o,b=null==(u=t.panning)||u,x=null!=(a=t.panButton)?a:0,E=null!=(h=t.oneFingerPan)&&h,O=null!=(l=t.margins)&&l,M=null!=(c=t.wheelZoomDeltaModeLinePixels)?c:17,k=null!=(f=t.wheelZoomDeltaModeScreenPixels)?f:53,C=!1,A=this.viewbox(),S=function(t){if(!O)return t;var e=O.top,n=O.left,r=O.bottom,i=O.right,s=d.attr(["width","height"]),o=s.width,u=s.height,a=d.node.preserveAspectRatio.baseVal,h=0,l=0,c=0,f=0;if(a.align!==a.SVG_PRESERVEASPECTRATIO_NONE){var p=o/u,m=A.width/A.height;if(m!==p){var g=a.meetOrSlice!==a.SVG_MEETORSLICE_SLICE,y=p>m?"width":"height",_="width"===y,v=g&&_||!g&&!_,w=v?p/m:m/p,b=t[y]-t[y]*w;v?a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMAX?(h=b/2,l=-b/2):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMAX?l=-b:a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMIN&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMID&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMAX||(h=b):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMAXYMID?(c=b/2,f=-b/2):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMAXYMIN?f=-b:a.align!==a.SVG_PRESERVEASPECTRATIO_XMINYMAX&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMIDYMAX&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMAX||(c=b)}}var x=A.width+A.x-n-h,E=A.x+i-t.width-l,M=A.height+A.y-e-c,k=A.y+r-t.height-f;return t.x=Math.min(x,Math.max(E,t.x)),t.y=Math.min(M,Math.max(k,t.y)),t},N=function t(e){(m=bh(e)).length<2?b&&E&&I.call(this,e):(b&&E&&R.call(this,e),e.preventDefault(),this.dispatch("pinchZoomStart",{event:e}).defaultPrevented||(this.off("touchstart.panZoom",t),C=!0,Tu(document,"touchmove.panZoom",T,this,{passive:!1}),Tu(document,"touchend.panZoom",j,this,{passive:!1})))},j=function t(e){e.preventDefault();var n=bh(e);n.length>1||(C=!1,this.dispatch("pinchZoomEnd",{event:e}),Iu(document,"touchmove.panZoom",T),Iu(document,"touchend.panZoom",t),this.on("touchstart.panZoom",N),n.length&&b&&E&&I.call(this,e))},T=function(t){t.preventDefault();var e=bh(t),n=this.zoom(),r=Math.sqrt(Math.pow(m[0].clientX-m[1].clientX,2)+Math.pow(m[0].clientY-m[1].clientY,2))/Math.sqrt(Math.pow(e[0].clientX-e[1].clientX,2)+Math.pow(e[0].clientY-e[1].clientY,2));(n<y&&r>1||n>_&&r<1)&&(r=1);var i={x:e[0].clientX+.5*(e[1].clientX-e[0].clientX),y:e[0].clientY+.5*(e[1].clientY-e[0].clientY)},s=m[0].clientX+.5*(m[1].clientX-m[0].clientX),o=m[0].clientY+.5*(m[1].clientY-m[0].clientY),u=this.point(i.x,i.y),a=this.point(2*i.x-s,2*i.y-o),h=new Eu(this.viewbox()).transform((new wu).translate(-a.x,-a.y).scale(r,0,0).translate(u.x,u.y));S(h),this.viewbox(h),m=e,this.dispatch("zoom",{box:h,focus:a})},I=function t(e){e.type.indexOf("mouse")>-1&&e.button!==x&&e.which!==x+1||(e.preventDefault(),this.off("mousedown.panZoom",t),m=bh(e),C||(this.dispatch("panStart",{event:e}),p={x:m[0].clientX,y:m[0].clientY},Tu(document,"touchmove.panZoom mousemove.panZoom",L,this,{passive:!1}),Tu(document,"touchend.panZoom mouseup.panZoom",R,this,{passive:!1})))},R=function t(e){e.preventDefault(),Iu(document,"touchmove.panZoom mousemove.panZoom",L),Iu(document,"touchend.panZoom mouseup.panZoom",t),this.on("mousedown.panZoom",I),this.dispatch("panEnd",{event:e})},L=function(t){t.preventDefault();var e=bh(t),n={x:e[0].clientX,y:e[0].clientY},r=this.point(n.x,n.y),i=this.point(p.x,p.y),s=[i.x-r.x,i.y-r.y];if(s[0]||s[1]){var o=new Eu(this.viewbox()).transform((new wu).translate(s[0],s[1]));p=n,S(o),this.dispatch("panning",{box:o,event:t}).defaultPrevented||this.viewbox(o)}};return v&&this.on("wheel.panZoom",(function(t){var e;switch(t.preventDefault(),t.deltaMode){case 1:e=t.deltaY*M;break;case 2:e=t.deltaY*k;break;default:e=t.deltaY}var n=Math.pow(1+g,-1*e/100)*this.zoom(),r=this.point(t.clientX,t.clientY);if(n>_&&(n=_),n<y&&(n=y),this.dispatch("zoom",{level:n,focus:r}).defaultPrevented)return this;if(this.zoom(n,r),O){var i=S(this.viewbox());this.viewbox(i)}}),this,{passive:!1}),w&&this.on("touchstart.panZoom",N,this,{passive:!1}),b&&this.on("mousedown.panZoom",I,this,{passive:!1}),this}});class xh{constructor(t,e,n,r){this.width=e,this.height=n,t.innerHTML="",this.canvas=wh().addTo(t).size("100%","100%").viewbox(`0 0 ${e} ${n}`).panZoom({zoomFactor:.2,zoomMin:.1}).attr({style:r})}static drawCircle(t={}){const e=new hh;return e.attr(t),e}static drawGroup(t=0,e=0,n,r){const i=new dh;return i.attr({"data-parent":r,"data-self":n,transform:`translate(${t}, ${e})`}),i}static drawPath(t,{borderColor:e=vo.borderColor,id:n=""}={}){const r=new Xa({d:t});return r.id(n),r.fill("none").stroke({color:e,width:1}),r}static drawRect({color:t="#fefefe",height:e=0,opacity:n=1,radius:r=0,width:i=0,x1:s,y1:o}={}){const u=new qa;return u.attr({height:e,opacity:n,rx:r,ry:r,width:i,x:s??void 0,y:o??void 0}),u.fill(t),u}static drawTemplate(t,{nodeHeight:e,nodeWidth:n}={}){const r=new ch({height:e,width:n}),i=document.createElement("div");return i.innerHTML=t,i.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),r.add(i),r}static drawText(t="",{dx:e,dy:n,x:r,y:i}){const s=new uh;return s.font({fill:"#f06"}),s.tspan(t),void 0!==r&&void 0!==i&&s.move(r,i),void 0!==e&&void 0!==n&&s.attr({dx:e,dy:n}),s}add(t){this.canvas.add(t)}clear(){this.canvas.clear().viewbox(`0 0 ${this.width} ${this.height}`)}exportToSvg(){new it(this.canvas,"apextree").exportToSVG()}resetViewBox(){this.canvas.viewbox(`0 0 ${this.width} ${this.height}`)}updateViewBox(t,e,n,r){this.canvas.viewbox(`${t} ${e} ${n} ${r}`)}zoom(t){const e=this.canvas.zoom()+t;e>=.1&&this.canvas.zoom(e)}}const Eh={marginx:100,marginy:100,rankdir:"TB"};class Oh extends xh{constructor(t,e){super(t,e.viewPortWidth,e.viewPortHeight,e.canvasStyle),this.element=t,this.options=e}calculateLayout(){const{childrenSpacing:t,siblingSpacing:e}=this.options,n=_o[this.options.direction];this.graph.setGraph({...Eh,nodesep:e,rankdir:n,ranksep:t}),po.layout(this.graph)}resetGraph(){this.graph=new po.graphlib.Graph,this.graph.setDefaultEdgeLabel((function(){return{}}))}setGraphNodesAndEdges(t){this.resetGraph(),this.setNodesRecursively(t)}setNodesRecursively(t,e){var n;const{direction:r,groupLeafNodesSpacing:i,nodeHeight:s,nodeWidth:o}=this.options,u=this.nodeMap[t],a={...u,parent:e||void 0};if(this.graph.setNode(t,{...a,height:s,width:o}),e&&this.graph.setEdge(e,t),u.onlyLeafNodes){const e=yo[r].leafWidth({childLength:u.children.length,childrenSpacing:i,nodeWidth:o}),n=yo[r].leafHeight({childLength:u.children.length,childrenSpacing:i,nodeHeight:s});this.graph.setNode(`${t}_leafs`,{...a,height:n,id:`${t}_leafs`,parent:t,width:e}),this.graph.setEdge(t,`${t}_leafs`)}else if(null==(n=u.children)?void 0:n.length)for(const h of u.children)this.setNodesRecursively(h,t)}changeLayout(t="top"){this.options={...this.options,direction:t},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!1})}collapse(t){const e=this.nodeMap[t];(null==e?void 0:e.children)&&(this.nodeMap[t]={...e,children:void 0,hiddenChildren:e.children},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!0}))}construct(t){if(this.nodeMap=Eo(t),this.data=t,this.options.groupLeafNodes){(function(t){const e=[];function n(t){return!t.children||0===t.children.length}return function t(r){if(r.children&&0!==r.children.length){r.children.every(n)&&e.push(r);for(const e of r.children)t(e)}}(t),e})(t).forEach((t=>{this.nodeMap[t.id]={...this.nodeMap[t.id],onlyLeafNodes:!0},this.nodeMap[`${t.id}_leafs`]={...this.nodeMap[t.id],id:`${t.id}_leafs`,onlyLeafNodes:!0,parent:t.id},this.nodeMap[t.id].children.forEach((e=>{this.nodeMap[e]={...this.nodeMap[e],parent:`${t.id}_leafs`}}))}))}this.setGraphNodesAndEdges(t.id)}expand(t){const e=this.nodeMap[t];(null==e?void 0:e.hiddenChildren)&&(this.nodeMap[t]={...e,children:e.hiddenChildren,hiddenChildren:void 0},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!0}))}fitScreen(){const{height:t,width:e}=this.graph.graph();this.updateViewBox(0,0,e,t)}render({keepOldPosition:t=!1}={}){const e=this.canvas.viewbox();this.clear(),this.calculateLayout();const{containerClassName:n,enableTooltip:r,fontColor:i,fontFamily:s,fontSize:o,fontWeight:u,tooltipId:a}=this.options,h=nt({color:i,fontFamily:s,fontSize:o,fontWeight:u}),l=xh.drawGroup(0,0,n);l.attr("style",h),l.id(n),console.log("graph",this.graph);const c=this.graph.nodes();if(this.graph.edges().forEach((t=>{this.renderEdge(t,l)})),c.forEach((t=>{t.endsWith("_leafs")?this.renderGroupedLeafNodes(t,l):this.renderNode(t,l)})),this.add(l),this.fitScreen(),t&&this.updateViewBox(e.x,e.y,e.width,e.height),r){const t=((t="apex-tooltip-container")=>{const e=document.getElementById(t)||document.createElement("div");return e.id=t,e})(a);(document.body||document.getElementsByTagName("body")[0]).append(t)}}renderEdge(t,e){const n=this.graph.node(t.w),r=this.graph.node(t.v),{nodeHeight:i,nodeWidth:s}=this.options,o=((t,e,n,r,i)=>{if(!(null==t?void 0:t.parent))return null;const{calculateEdge:s,edgeMidX:o,edgeMidY:u,edgeParentX:a,edgeParentY:h,edgeX:l,edgeY:c}=yo[i];return s({x:l({node:t,nodeHeight:r,nodeWidth:n}),y:c({node:t,nodeHeight:r,nodeWidth:n})},{x:a({nodeHeight:r,nodeWidth:n,parent:e}),y:h({nodeHeight:r,nodeWidth:n,parent:e})},{x:o({node:t,nodeHeight:r,nodeWidth:n}),y:u({node:t,nodeHeight:r,nodeWidth:n})},{sy:0})})(n,r,s,i,this.options.direction);if(!o)return;const u=xh.drawPath(o,{id:`${t.v}-${t.w}`});e.add(u)}renderGroupedLeafNodes(t,e){const n=this.graph.node(t),{options:r}=this,{direction:i}=r,s=yo[i].leafGroupX({node:n}),o=yo[i].leafGroupY({node:n}),u=xh.drawGroup(s,o,n.id,n.parent);n.children.forEach(((t,e)=>{this.renderLeafNode(t,u,e)})),e.add(u)}renderLeafNode(t,e,n){const r=this.nodeMap[t],{options:i}=this,{borderRadius:s,direction:o,enableTooltip:u,groupLeafNodesSpacing:a,highlightOnHover:h,nodeTemplate:l,tooltipTemplate:c}=i,{borderColor:f,borderStyle:d,borderWidth:p,fontColor:m,fontFamily:g,fontSize:y,fontWeight:_,nodeBGColor:v,nodeClassName:w,nodeHeight:b,nodeStyle:x,nodeWidth:E,tooltipBGColor:O,tooltipBorderColor:M,tooltipId:k,tooltipMaxWidth:C}={...i,...r.options},A=this,S=yo[o].leafX({childrenSpacing:a,index:n,nodeHeight:b,nodeWidth:E}),N=yo[o].leafY({childrenSpacing:a,index:n,nodeHeight:b,nodeWidth:E}),j=xh.drawGroup(S,N,r.id,r.parent),T=l(r[i.contentKey]),I=xh.drawTemplate(T,{nodeHeight:b,nodeWidth:E}),R=nt({color:m,fontFamily:g,fontSize:y,fontWeight:_}),L=nt({backgroundColor:v,borderColor:f,borderRadius:s,borderStyle:d,borderWidth:`${p}px`,boxSizing:"border-box",height:"100%"});if(I.first().attr("style",L.concat(x)),I.attr("class",w),j.attr("style",R),j.add(I),h&&(j.on("mouseover",(function(){const{self:t}=this.node.dataset,e=A.nodeMap[t];e&&bo(e,A.nodeMap,!0,i)})),j.on("mouseout",(function(){const{self:t}=this.node.dataset,e=A.nodeMap[t];e&&bo(e,A.nodeMap,!1,i)}))),u){const t=c?c(r[this.options.contentKey]):T;j.on("mousemove",(e=>{const n=et({bgColor:O,borderColor:M,maxWidth:C,padding:c?0:10,x:e.pageX,y:e.pageY});tt(k,n,t)})),j.on("mouseout",(t=>{"svg"===t.relatedTarget.tagName&&tt(k)}))}e.add(j)}renderNode(t,e){var n,r;const i=this.graph.node(t),{options:s}=this,{borderRadius:o,enableExpandCollapse:u,enableTooltip:a,highlightOnHover:h,nodeHeight:l,nodeTemplate:c,nodeWidth:f,tooltipTemplate:d}=s,{borderColor:p,borderStyle:m,borderWidth:g,fontColor:y,fontFamily:_,fontSize:v,fontWeight:w,nodeBGColor:b,nodeClassName:x,nodeStyle:E,tooltipBGColor:O,tooltipBorderColor:M,tooltipId:k,tooltipMaxWidth:C}={...s,...i.options},{height:A,width:S,x:N,y:j}=i,T=this,I=xh.drawGroup(N-f/2,j-l/2,i.id,i.parent),R=c(i[s.contentKey]),L=xh.drawTemplate(R,{nodeHeight:A,nodeWidth:S}),z=nt({color:y,fontFamily:_,fontSize:v,fontWeight:w}),D=nt({backgroundColor:b,borderColor:p,borderRadius:o,borderStyle:m,borderWidth:`${g}px`,boxSizing:"border-box",height:"100%"});if(L.first().attr("style",D.concat(E)),L.attr("class",x),I.attr("style",z),I.add(L),h&&(I.on("mouseover",(function(){const{self:t}=this.node.dataset,e=T.nodeMap[t];e&&bo(e,T.nodeMap,!0,s)})),I.on("mouseout",(function(){const{self:t}=this.node.dataset,e=T.nodeMap[t];e&&bo(e,T.nodeMap,!1,s)}))),a){const t=d?d(i[this.options.contentKey]):R;I.on("mousemove",(e=>{const n=et({bgColor:O,borderColor:M,maxWidth:C,padding:d?0:10,x:e.pageX,y:e.pageY});tt(k,n,t)})),I.on("mouseout",(t=>{"svg"===t.relatedTarget.tagName&&tt(k)}))}if(e.add(I),(i.children||i.hiddenChildren)&&u&&((null==(n=i.children)?void 0:n.length)||(null==(r=i.hiddenChildren)?void 0:r.length))){const t=7,n=xh.drawGroup(N+f/2-t,j+l-t,i.id),r=xh.drawCircle({cx:t,cy:t,r:t,style:"fill: #FFF; cursor: pointer;"});n.data("expanded",!1),n.add(r),i.hiddenChildren?n.add('<svg height="14" viewBox="0 0 24 24" width="14" xmlns="http://www.w3.org/2000/svg">\n <path d="m12 0a12 12 0 1 0 12 12 12.013 12.013 0 0 0 -12-12zm0 22a10 10 0 1 1 10-10 10.011 10.011 0 0 1 -10 10zm5-10a1 1 0 0 1 -1 1h-3v3a1 1 0 0 1 -2 0v-3h-3a1 1 0 0 1 0-2h3v-3a1 1 0 0 1 2 0v3h3a1 1 0 0 1 1 1z"/>\n</svg>'):n.add('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14">\n <path d="m12,0C5.383,0,0,5.383,0,12s5.383,12,12,12,12-5.383,12-12S18.617,0,12,0Zm0,22c-5.514,0-10-4.486-10-10S6.486,2,12,2s10,4.486,10,10-4.486,10-10,10Zm5-10c0,.552-.448,1-1,1h-8c-.552,0-1-.448-1-1s.448-1,1-1h8c.552,0,1,.448,1,1Z"/>\n</svg>\n'),n.on("click",(function(){i.hiddenChildren?T.expand(this.node.dataset.self):T.collapse(this.node.dataset.self)})),e.add(n)}}}class Mh{constructor(t,e){this.element=t,this.options={...vo,...e};const{height:n,width:r}=this.options;this.graph=new Oh(this.element,this.options);let i=!1,s=0;"string"==typeof r&&/^\d+(\.\d+)?%$/.test(r)?(s=Number(r.substring(0,r.length-1)),i=!0):s=Number(r);const o="auto"===n?s/1.6:n;this.element.style.width=`${s}${i?"%":"px"}`,this.element.style.height=`${o}${i?"%":"px"}`,this.element.style.position="relative",this.handleWatermark()}static setLicense(t){ot.setLicense(t)}handleWatermark(){const t=this.element;t&&(ot.isLicenseValid()?fr.remove(t):fr.add(t))}render(t){if(!this.element)throw new Error("Element not found");if(this.graph.construct(t),this.graph.render(),this.options.enableToolbar){new lr(this.element).render({enableExport:!0,enableFitscreen:!0,enableZoom:!0,onExport:this.graph.exportToSvg.bind(this.graph),onFitscreen:this.graph.fitScreen.bind(this.graph),onZoom:this.graph.zoom.bind(this.graph)})}return this.graph}}"undefined"!=typeof window&&(window.ApexTree=Mh),t.ApexTree=Mh,t.default=Mh,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexTree={})}(this,(function(t){"use strict";var e=Object.defineProperty,n=(t,n,r)=>(((t,n,r)=>{n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r})(t,"symbol"!=typeof n?n+"":n,r),r);class r{constructor(t,e){this.injectedStyles=new Set,this.chartContainer=null,this.instanceId=e||Math.random().toString(36).substr(2,9),this.context=this.detectContext(t),this.chartContainer=t}getChartContainer(){return this.chartContainer}getChartScopedContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.chartContainer||this.context}detectContext(t){const e=t.getRootNode();return e instanceof ShadowRoot?e:document}getContext(){return this.context}getInstanceId(){return this.instanceId}isShadowDOM(){return this.context instanceof ShadowRoot}createElement(t){return document.createElement(t)}createElementNS(t,e){return document.createElementNS(t,e)}createTextNode(t){return document.createTextNode(t)}getElementById(t){return this.context===document?document.getElementById(t):this.context.querySelector(`#${t}`)}getElementsByClassName(t){if(this.context===document)return document.getElementsByClassName(t);const e=this.context.querySelectorAll(`.${t}`),n=Array.from(e);return{item:t=>n[t]||null,get length(){return n.length},[Symbol.iterator]:()=>n[Symbol.iterator](),...Object.fromEntries(n.map(((t,e)=>[e,t])))}}querySelector(t){return this.context.querySelector(t)}querySelectorAll(t){return this.context.querySelectorAll(t)}getAppendContainer(){return this.context===document?document.body||document.getElementsByTagName("body")[0]:this.context}getChartBounds(){var t;return(null==(t=this.chartContainer)?void 0:t.getBoundingClientRect())||new DOMRect}getBody(){if(this.context===document)return document.body||document.getElementsByTagName("body")[0];return this.context.host}dispatchEvent(t){this.context===document?document.dispatchEvent(t):this.context.dispatchEvent(t)}addEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.addEventListener(t,e,n):this.context.addEventListener(t,e,n)}removeEventListener(t,e,n){this.context===document||"mousemove"===t||"mouseup"===t||"keydown"===t?document.removeEventListener(t,e,n):this.context.removeEventListener(t,e,n)}injectStyles(t,e,n={}){const{force:r=!1,priority:i="normal"}=n;if(!r&&this.injectedStyles.has(e))return;if(r){const t=this.context.querySelector(`#${e}`);t&&(t.remove(),this.injectedStyles.delete(e))}if(this.context.querySelector(`#${e}`)&&!r)return void this.injectedStyles.add(e);const s=document.createElement("style");if(s.id=e,s.textContent=t,"normal"!==i&&s.setAttribute("data-priority",i),this.context===document)document.head.appendChild(s);else{const t=this.context;"high"===i?t.insertBefore(s,t.firstChild):t.appendChild(s)}this.injectedStyles.add(e)}injectStylesheets(t){t.forEach((({content:t,id:e,options:n})=>{this.injectStyles(t,e,n)}))}hasInjectedStyles(t){return this.injectedStyles.has(t)}removeStyles(t){const e=this.context.querySelector(`#${t}`);e&&(e.remove(),this.injectedStyles.delete(t))}removeAllStyles(){this.injectedStyles.forEach((t=>{const e=this.context.querySelector(`#${t}`);e&&e.remove()})),this.injectedStyles.clear()}getInjectedStyleIds(){return Array.from(this.injectedStyles)}getActiveElement(){if(this.context===document)return document.activeElement;return this.context.activeElement||document.activeElement}destroy(){this.removeAllStyles(),this.injectedStyles.clear()}}class i{constructor(t,e){if(!t)throw new Error("Container element is required");this.element=t,this.chartContext=new r(t,e)}getContext(){return this.chartContext}isShadowDOM(){return this.chartContext.isShadowDOM()}getTooltipContainer(){return this.chartContext.getAppendContainer()}injectStyles(t,e){this.chartContext.injectStyles(t,e)}createElement(t){return this.chartContext.createElement(t)}querySelector(t){return this.chartContext.querySelector(t)}addEventListener(t,e,n){this.chartContext.addEventListener(t,e,n)}removeEventListener(t,e,n){this.chartContext.removeEventListener(t,e,n)}dispatchEvent(t){this.chartContext.dispatchEvent(t)}destroy(){this.chartContext.destroy()}getInstanceId(){return this.chartContext.getInstanceId()}}function s(){}class o{constructor(t,e="apex"){this.canvas=t,this.prefix=e}getSvgString(){return this.canvas.svg().replace(/(<img [\w\W]+?)(>)/g,"$1 />").replace(/(<br)(>)/g,"$1 />").replace(/(<hr)(>)/g,"$1 />")}svgUrl(){const t=this.getSvgString(),e=new Blob([t],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(e)}triggerDownload(t,e){const n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}exportToSVG(){this.triggerDownload(this.svgUrl(),`${this.prefix}-${(new Date).getTime()}.svg`)}}const h=class{static decodeLicenseData(t){try{const e=window.atob(t),n=JSON.parse(e);return n.issueDate&&n.expiryDate&&n.plan?{expiryDate:n.expiryDate,issueDate:n.issueDate,plan:n.plan,valid:!0}:null}catch{return null}}static generateLicenseKey(t,e,n="standard"){const r={expiryDate:e,issueDate:t,plan:n};return`APEX-${window.btoa(JSON.stringify(r))}`}static getLicenseStatus(){return this.licenseKey?(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult):{expired:!1,valid:!1}}static isLicenseValid(){return!!this.licenseKey&&(this.validationResult||(this.validationResult=this.validateLicense(this.licenseKey)),this.validationResult.valid)}static setLicense(t){this.licenseKey=t,this.validationResult=this.validateLicense(t),this.validationResult.valid||console.error(`[Apex] ${this.validationResult.message}`)}static validateLicense(t){try{if(!t.startsWith("APEX-"))return{expired:!1,message:'Invalid license key format. License key must start with "APEX-".',valid:!1};const e=t.split("-");if(2!==e.length)return{expired:!1,message:"Invalid license key format. Expected format: APEX-{encoded-data}.",valid:!1};const n=e[1],r=this.decodeLicenseData(n);if(!r)return{expired:!1,message:"Invalid license key. Unable to decode license data.",valid:!1};const i=new Date;return new Date(r.expiryDate)<i?{data:r,expired:!0,message:`License expired on ${r.expiryDate}. Please renew your license.`,valid:!1}:{data:r,expired:!1,valid:!0}}catch{return{expired:!1,message:"Invalid license key format or corrupted data.",valid:!1}}}};h.licenseKey=null,h.validationResult=null;let a=h;const u={},l=[];function c(t,e){if(Array.isArray(t))for(const n of t)c(n,e);else if("object"!=typeof t)f(Object.getOwnPropertyNames(e)),u[t]=Object.assign(u[t]||{},e);else for(const n in t)c(n,t[n])}function d(t){return u[t]||{}}function f(t){l.push(...t)}function p(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function m(t){return t%360*Math.PI/180}function g(t){return t.charAt(0).toUpperCase()+t.slice(1)}function y(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function w(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:h,y:a}=e.bbox();s&&(r=r.includes("left")?h:r.includes("right")?h+n:h+n/2),o&&(i=i.includes("top")?a:i.includes("bottom")?a+t:a+t/2)}return[r,i]}const b=new Set(["desc","metadata","title"]),x=t=>b.has(t.nodeName),v=(t,e,n={})=>{const r={...e};for(const i in r)r[i].valueOf()===n[i]&&delete r[i];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},_="http://www.w3.org/2000/svg",E="http://www.w3.org/2000/xmlns/",C="http://www.w3.org/1999/xlink",O={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};let M=class{};const k={},S="___SYMBOL___ROOT___";function N(t,e=_){return O.document.createElementNS(e,t)}function A(t,e=!1){if(t instanceof M)return t;if("object"==typeof t)return I(t);if(null==t)return new k[S];if("string"==typeof t&&"<"!==t.charAt(0))return I(O.document.querySelector(t));const n=e?O.document.createElement("div"):N("svg");return n.innerHTML=t,t=I(n.firstChild),n.removeChild(n.firstChild),t}function T(t,e){return e&&(e instanceof O.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:N(t)}function j(t){if(!t)return null;if(t.instance instanceof M)return t.instance;if("#document-fragment"===t.nodeName)return new k.Fragment(t);let e=g(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":k[e]||(e="Dom"),new k[e](t)}let I=j;function L(t,e=t.name,n=!1){return k[e]=t,n&&(k[S]=t),f(Object.getOwnPropertyNames(t.prototype)),t}let R=1e3;function P(t){return"Svgjs"+g(t)+R++}function D(t){for(let e=t.children.length-1;e>=0;e--)D(t.children[e]);return t.id?(t.id=P(t.nodeName),t):t}function z(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function F(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}c("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=A(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=A(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=A(t)).before(this),this},insertAfter:function(t){return(t=A(t)).after(this),this}});const $=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,Y=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,X=/rgb\((\d+),(\d+),(\d+)\)/,G=/(#[a-z_][a-z0-9\-_]*)/i,q=/\)\s*,?\s*/,B=/\s/g,V=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,H=/^rgb\(/,W=/^(\s+)?$/,Z=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,U=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Q=/[\s,]+/,K=/[MLHVCSQTAZ]/i;function J(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function tt(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function et(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}c("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Q)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),c("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||W.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||W.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),c("Dom",{data:function(t,e,n){if(null==t)return this.data(p(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(r){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),c("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});let nt=class t{constructor(...t){this.init(...t)}static isColor(e){return e&&(e instanceof t||this.isRgb(e)||this.test(e))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(e="vibrant",n){const{random:r,round:i,sin:s,PI:o}=Math;if("vibrant"===e){const e=24*r()+57,n=38*r()+45,i=360*r();return new t(e,n,i,"lch")}if("sine"===e){const e=i(80*s(2*o*(n=null==n?r():n)/.5+.01)+150),h=i(50*s(2*o*n/.5+4.6)+200),a=i(100*s(2*o*n/.5+2.3)+150);return new t(e,h,a)}if("pastel"===e){const e=8*r()+86,n=17*r()+9,i=360*r();return new t(e,n,i,"lch")}if("dark"===e){const e=10+10*r(),n=50*r()+86,i=360*r();return new t(e,n,i,"lch")}if("rgb"===e){const e=255*r(),n=255*r(),i=255*r();return new t(e,n,i)}if("lab"===e){const e=100*r(),n=256*r()-128,i=256*r()-128;return new t(e,n,i,"lab")}if("grey"===e){const e=255*r();return new t(e,e,e)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(V.test(t)||H.test(t))}cmyk(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),h=Math.min(1-i,1-s,1-o);if(1===h)return new t(0,0,0,1,"cmyk");return new t((1-i-h)/(1-h),(1-s-h)/(1-h),(1-o-h)/(1-h),h,"cmyk")}hsl(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),h=Math.max(i,s,o),a=Math.min(i,s,o),u=(h+a)/2,l=h===a,c=h-a;return new t(360*(l?0:h===i?((s-o)/c+(s<o?6:0))/6:h===s?((o-i)/c+2)/6:h===o?((i-s)/c+4)/6:0),100*(l?0:u>.5?c/(2-h-a):c/(h+a)),100*u,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const c in this.space)delete this[this.space[c]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=tt(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:tt(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:tt(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:tt(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:tt(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:tt(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(H.test(t)){const e=t.replace(B,""),[n,r,i]=X.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!V.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=Y.exec((s=t,4===s.length?["#",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(""):s)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var s;const{_a:o,_b:h,_c:a,_d:u}=this,l="rgb"===this.space?{r:o,g:h,b:a}:"xyz"===this.space?{x:o,y:h,z:a}:"hsl"===this.space?{h:o,s:h,l:a}:"lab"===this.space?{l:o,a:h,b:a}:"lch"===this.space?{l:o,c:h,h:a}:"cmyk"===this.space?{c:o,m:h,y:a,k:u}:{};Object.assign(this,l)}lab(){const{x:e,y:n,z:r}=this.xyz();return new t(116*n-16,500*(e-n),200*(n-r),"lab")}lch(){const{l:e,a:n,b:r}=this.lab(),i=Math.sqrt(n**2+r**2);let s=180*Math.atan2(r,n)/Math.PI;s<0&&(s*=-1,s=360-s);return new t(e,i,s,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(e=this.space)||"xyz"===e||"lch"===e){let{x:e,y:n,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:t,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(t+16)/116,h=i/500+o,a=o-s/200,u=16/116,l=.008856,c=7.787;e=.95047*(h**3>l?h**3:(h-u)/c),n=1*(o**3>l?o**3:(o-u)/c),r=1.08883*(a**3>l?a**3:(a-u)/c)}const i=3.2406*e+-1.5372*n+-.4986*r,s=-.9689*e+1.8758*n+.0415*r,o=.0557*e+-.204*n+1.057*r,h=Math.pow,a=.0031308,u=i>a?1.055*h(i,1/2.4)-.055:12.92*i,l=s>a?1.055*h(s,1/2.4)-.055:12.92*s,c=o>a?1.055*h(o,1/2.4)-.055:12.92*o;return new t(255*u,255*l,255*c)}if("hsl"===this.space){let{h:e,s:n,l:r}=this;if(e/=360,n/=100,r/=100,0===n){r*=255;return new t(r,r,r)}const i=r<.5?r*(1+n):r+n-r*n,s=2*r-i,o=255*et(s,i,e+1/3),h=255*et(s,i,e),a=255*et(s,i,e-1/3);return new t(o,h,a)}if("cmyk"===this.space){const{c:e,m:n,y:r,k:i}=this,s=255*(1-Math.min(1,e*(1-i)+i)),o=255*(1-Math.min(1,n*(1-i)+i)),h=255*(1-Math.min(1,r*(1-i)+i));return new t(s,o,h)}return this;var e}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(J);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:e,_b:n,_c:r}=this.rgb(),[i,s,o]=[e,n,r].map((t=>t/255)),h=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,l=(.4124*h+.3576*a+.1805*u)/.95047,c=(.2126*h+.7152*a+.0722*u)/1,d=(.0193*h+.1192*a+.9505*u)/1.08883,f=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116,m=d>.008856?Math.pow(d,1/3):7.787*d+16/116;return new t(f,p,m,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}},rt=class t{constructor(...t){this.init(...t)}clone(){return new t(this)}init(t,e){const n=0,r=0,i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){st.isMatrixLike(t)||(t=new st(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}};function it(t,e,n){return Math.abs(e-t)<1e-6}let st=class t{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,h=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,a=t.shear||0,u=t.rotate||t.theta||0,l=new rt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,d=l.y,f=new rt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new rt(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,w=g.y,b=new rt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:h,skewX:i,skewY:s,shear:a,theta:u,rx:b.x,ry:b.y,tx:y,ty:w,ox:c,oy:d,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,h=t.e+t.a*e.e+t.c*e.f,a=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=h,n.f=a,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new t(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,h=this.f,a=n*s-r*i,u=a>0?1:-1,l=u*Math.sqrt(n*n+r*r),c=Math.atan2(u*r,u*n),d=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/a,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*l+e*(m*f*l-p*g),translateY:h-e+t*p*l+e*(m*p*l+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(e){if(e===this)return!0;const n=new t(e);return it(this.a,n.a)&&it(this.b,n.b)&&it(this.c,n.c)&&it(this.d,n.d)&&it(this.e,n.e)&&it(this.f,n.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(e){const n=t.fromArray([1,0,0,1,0,0]);return e=e instanceof At?e.matrixify():"string"==typeof e?t.fromArray(e.split(Q).map(parseFloat)):Array.isArray(e)?t.fromArray(e):"object"==typeof e&&t.isMatrixLike(e)?e:"object"==typeof e?(new t).transform(e):6===arguments.length?t.fromArray([].slice.call(arguments)):n,this.a=null!=e.a?e.a:n.a,this.b=null!=e.b?e.b:n.b,this.c=null!=e.c?e.c:n.c,this.d=null!=e.d?e.d:n.d,this.e=null!=e.e?e.e:n.e,this.f=null!=e.f?e.f:n.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const h=r/o,a=-e/o,u=-n/o,l=t/o,c=-(h*i+u*s),d=-(a*i+l*s);return this.a=h,this.b=a,this.c=u,this.d=l,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(e){const n=e instanceof t?e:new t(e);return t.matrixMultiply(n,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(e){const n=e instanceof t?e:new t(e);return t.matrixMultiply(this,n,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=m(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:h,d:a,e:u,f:l}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=h*r-a*i,this.d=a*r+h*i,this.e=u*r-l*i+n*i-e*r+e,this.f=l*r+u*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:h,e:a,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=h*e,this.e=a*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:h,f:a}=this;return this.a=r+i*t,this.c=s+o*t,this.e=h+a*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=m(t),e=m(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:h,c:a,d:u,e:l,f:c}=this;return this.a=o+h*i,this.b=h+o*s,this.c=a+u*i,this.d=u+a*s,this.e=l+c*i-r*i,this.f=c+l*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(e){if(t.isMatrixLike(e)){return new t(e).multiplyO(this)}const n=t.formatTransforms(e),{x:r,y:i}=new rt(n.ox,n.oy).transform(this),s=(new t).translateO(n.rx,n.ry).lmultiplyO(this).translateO(-r,-i).scaleO(n.scaleX,n.scaleY).skewO(n.skewX,n.skewY).shearO(n.shear).rotateO(n.theta).translateO(r,i);if(isFinite(n.px)||isFinite(n.py)){const t=new rt(r,i).transform(s),e=isFinite(n.px)?n.px-t.x:0,o=isFinite(n.py)?n.py-t.y:0;s.translateO(e,o)}return s.translateO(n.tx,n.ty),s}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}};function ot(){if(!ot.nodes){const t=A().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;ot.nodes={svg:t,path:e}}if(!ot.nodes.svg.node.parentNode){const t=O.document.body||O.document.documentElement;ot.nodes.svg.addTo(t)}return ot.nodes}function ht(t){return!(t.width||t.height||t.x||t.y)}L(st,"Matrix");let at=class t{constructor(...t){this.init(...t)}addOffset(){return this.x+=O.window.pageXOffset,this.y+=O.window.pageYOffset,new t(this)}init(t){return t="string"==typeof t?t.split(Q).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return ht(this)}merge(e){const n=Math.min(this.x,e.x),r=Math.min(this.y,e.y),i=Math.max(this.x+this.width,e.x+e.width)-n,s=Math.max(this.y+this.height,e.y+e.height)-r;return new t(n,r,i,s)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(e){e instanceof st||(e=new st(e));let n=1/0,r=-1/0,i=1/0,s=-1/0;return[new rt(this.x,this.y),new rt(this.x2,this.y),new rt(this.x,this.y2),new rt(this.x2,this.y2)].forEach((function(t){t=t.transform(e),n=Math.min(n,t.x),r=Math.max(r,t.x),i=Math.min(i,t.y),s=Math.max(s,t.y)})),new t(n,i,r-n,s-i)}};function ut(t,e,n){let r;try{if(r=e(t.node),ht(r)&&((i=t.node)!==O.document&&!(O.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===O.document}).call(O.document.documentElement,i)))throw new Error("Element not in the dom")}catch(s){r=n(t)}var i;return r}c({viewbox:{viewbox(t,e,n,r){return null==t?new at(this.attr("viewBox")):this.attr("viewBox",new at(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,h=Math.min(s,o);if(null==t)return h;let a=h/t;a===1/0&&(a=Number.MAX_SAFE_INTEGER/100),e=e||new rt(n/2/s+i.x,r/2/o+i.y);const u=new at(i).transform(new st({scale:a,origin:e}));return this.viewbox(u)}}}),L(at,"Box");let lt=class extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}};z([lt],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const ct=["toArray","constructor","each"];function dt(t,e){return new lt(p((e||O.document).querySelectorAll(t),(function(t){return j(t)})))}lt.extend=function(t){t=t.reduce(((t,e)=>(ct.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),z([lt],t)};let ft=0;const pt={};function mt(t){let e=t.getEventHolder();return e===O.window&&(e=pt),e.events||(e.events={}),e.events}function gt(t){return t.getEventTarget()}function yt(t,e,n,r,i){const s=n.bind(r||t),o=A(t),h=mt(o),a=gt(o);e=Array.isArray(e)?e:e.split(Q),n._svgjsListenerId||(n._svgjsListenerId=++ft),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";h[e]=h[e]||{},h[e][r]=h[e][r]||{},h[e][r][n._svgjsListenerId]=s,a.addEventListener(e,s,i||!1)}))}function wt(t,e,n,r){const i=A(t),s=mt(i),o=gt(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(Q)).forEach((function(t){const e=t&&t.split(".")[0],h=t&&t.split(".")[1];let a,u;if(n)s[e]&&s[e][h||"*"]&&(o.removeEventListener(e,s[e][h||"*"][n],r||!1),delete s[e][h||"*"][n]);else if(e&&h){if(s[e]&&s[e][h]){for(u in s[e][h])wt(o,[e,h].join("."),u);delete s[e][h]}}else if(h)for(t in s)for(a in s[t])h===a&&wt(o,[t,h].join("."));else if(e){if(s[e]){for(a in s[e])wt(o,[e,a].join("."));delete s[e]}}else{for(t in s)wt(o,t);!function(t){let e=t.getEventHolder();e===O.window&&(e=pt),e.events&&(e.events={})}(i)}}))}let bt=class extends M{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=gt(t);return e instanceof O.window.Event||(e=new O.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const r in n)for(const e in n[r])n[r][e](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return wt(this,t,e,n),this}on(t,e,n,r){return yt(this,t,e,n,r),this}removeEventListener(){}};function xt(){}L(bt,"EventTarget");const vt=400,_t=">",Et=0,Ct={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};let Ot=class extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(Q).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}},Mt=class t{constructor(...t){this.init(...t)}convert(e){return new t(this.value,e)}divide(e){return e=new t(e),new t(this/e,this.unit||e.unit)}init(e,n){return n=Array.isArray(e)?e[1]:n,e=Array.isArray(e)?e[0]:e,this.value=0,this.unit=n||"","number"==typeof e?this.value=isNaN(e)?0:isFinite(e)?e:e<0?-34e37:34e37:"string"==typeof e?(n=e.match($))&&(this.value=parseFloat(n[1]),"%"===n[5]?this.value/=100:"s"===n[5]&&(this.value*=1e3),this.unit=n[5]):e instanceof t&&(this.value=e.valueOf(),this.unit=e.unit),this}minus(e){return e=new t(e),new t(this-e,this.unit||e.unit)}plus(e){return e=new t(e),new t(this+e,this.unit||e.unit)}times(e){return e=new t(e),new t(this*e,this.unit||e.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}};const kt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),St=[];let Nt=class t extends bt{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=A(t)).removeNamespace&&this.node instanceof O.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return A(t).put(this,e)}children(){return new lt(p(this.node.children,(function(t){return j(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=D(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(e,n){return this.put(new t(N(e),n))}first(){return j(this.node.firstChild)}get(t){return j(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=P(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return j(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=j(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=j(e.node.parentNode));return e}put(t,e){return t=A(t),this.add(t,e),t}putIn(t,e){return A(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=A(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const i in r)"number"==typeof r[i]&&(r[i]=Math.round(r[i]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,_)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=j(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=N("wrapper",n),i=O.document.createDocumentFragment();r.innerHTML=t;for(let o=r.children.length;o--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}};z(Nt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=Z.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?Ct[t]:Z.test(e)?parseFloat(e):e;"number"==typeof(e=St.reduce(((e,n)=>n(t,e,this)),e))?e=new Mt(e):kt.has(t)&&nt.isColor(e)?e=new nt(e):e.constructor===Array&&(e=new Ot(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return dt(t,this.node)},findOne:function(t){return j(this.node.querySelector(t))}}),L(Nt,"Dom");let At=class extends Nt{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new Mt(t).plus(this.x()))}dy(t=0){return this.y(new Mt(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=A(t));const n=new lt;let r=this;for(;(r=r.parent())&&r.node!==O.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(G);return e?A(e[1]):null}root(){const t=this.parent(k[S]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=y(this,t,e);return this.width(new Mt(n.width)).height(new Mt(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return v(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}};z(At,{bbox:function(){const t=ut(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(ot().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new at(t)},rbox:function(t){const e=ut(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new at(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new rt(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new st(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new st(e)}return new st(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new st}}}),L(At,"Element");const Tt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof nt||nt.isRgb(e)||e instanceof At)this.attr(t,e);else for(n=Tt[t].length-1;n>=0;n--)null!=e[Tt[t][n]]&&this.attr(Tt.prefix(t,Tt[t][n]),e[Tt[t][n]]);return this},c(["Element","Runner"],e)})),c(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new st(this):this.attr("transform",new st(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),c("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new Mt(t)):this.rx(t).ry(e)}}),c("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new rt(this.node.getPointAtLength(t))}}),c(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});c("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),c("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(q).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(Q).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(st.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new st)},toParent:function(t,e){if(this===t)return this;if(x(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new st(this).decompose();return null==t?e:e[t]}st.isMatrixLike(t)||(t={...t,origin:w(t,this)});const n=new st(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});let jt=class t extends At{flatten(){return this.each((function(){if(this instanceof t)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}};L(jt,"Container");let It=class extends jt{constructor(t,e=t){super(T("defs",t),e)}flatten(){return this}ungroup(){return this}};L(It,"Defs");let Lt=class extends At{};function Rt(t){return this.attr("rx",t)}function Pt(t){return this.attr("ry",t)}function Dt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function zt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Ft(t){return this.attr("cx",t)}function $t(t){return this.attr("cy",t)}function Yt(t){return null==t?2*this.rx():this.rx(new Mt(t).divide(2))}function Xt(t){return null==t?2*this.ry():this.ry(new Mt(t).divide(2))}L(Lt,"Shape");const Gt=Object.freeze(Object.defineProperty({__proto__:null,cx:Ft,cy:$t,height:Xt,rx:Rt,ry:Pt,width:Yt,x:Dt,y:zt},Symbol.toStringTag,{value:"Module"}));let qt=class extends Lt{constructor(t,e=t){super(T("ellipse",t),e)}size(t,e){const n=y(this,t,e);return this.rx(new Mt(n.width).divide(2)).ry(new Mt(n.height).divide(2))}};z(qt,Gt),c("Container",{ellipse:F((function(t=0,e=t){return this.put(new qt).size(t,e).move(0,0)}))}),L(qt,"Ellipse");let Bt=class extends Nt{constructor(t=O.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new Nt(N("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}};function Vt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Mt(t),fy:new Mt(e)}):this.attr({x1:new Mt(t),y1:new Mt(e)})}function Ht(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Mt(t),cy:new Mt(e)}):this.attr({x2:new Mt(t),y2:new Mt(e)})}L(Bt,"Fragment");const Wt=Object.freeze(Object.defineProperty({__proto__:null,from:Vt,to:Ht},Symbol.toStringTag,{value:"Module"}));let Zt=class extends jt{constructor(t,e){super(T(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new at}targets(){return dt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};z(Zt,Wt),c({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:F((function(t,e){return this.put(new Zt(t)).update(e)}))}}),L(Zt,"Gradient");let Ut=class extends jt{constructor(t,e=t){super(T("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new at}targets(){return dt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}};c({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:F((function(t,e,n){return this.put(new Ut).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),L(Ut,"Pattern");let Qt=class extends Lt{constructor(t,e=t){super(T("image",t),e)}load(t,e){if(!t)return this;const n=new O.window.Image;return yt(n,"load",(function(t){const r=this.parent(Ut);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof Ut&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),yt(n,"load error",(function(){wt(n)})),this.attr("href",n.src=t,C)}};var Kt;Kt=function(t,e,n){return"fill"!==t&&"stroke"!==t||U.test(e)&&(e=n.root().defs().image(e)),e instanceof Qt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},St.push(Kt),c({Container:{image:F((function(t,e){return this.put(new Qt).size(0,0).load(t,e)}))}}),L(Qt,"Image");let Jt=class extends Ot{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new at(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(Q).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){st.isMatrixLike(t)||(t=new st(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}};const te=Jt;const ee=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:te,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},Symbol.toStringTag,{value:"Module"}));let ne=class extends Lt{constructor(t,e=t){super(T("line",t),e)}array(){return new Jt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new Jt(t).toLine(),this.attr(t))}size(t,e){const n=y(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}};z(ne,ee),c({Container:{line:F((function(...t){return ne.prototype.plot.apply(this.put(new ne),null!=t[0]?t:[0,0,0,0])}))}}),L(ne,"Line");let re=class extends jt{constructor(t,e=t){super(T("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}};function ie(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}c({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:F((function(t,e,n){return this.put(new re).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof re?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),L(re,"Marker");const se={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};let oe=class{done(){return!1}},he=class extends oe{constructor(t=_t){super(),this.ease=se[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}},ae=class extends oe{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}};function ue(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}z(class extends ae{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:ie("_duration",ue),overshoot:ie("_overshoot",ue)});z(class extends ae{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,h=this._windup;return!1!==h&&(s=Math.max(-h,Math.min(s,h))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:ie("_windup"),p:ie("P"),i:ie("I"),d:ie("D")});const le={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},ce={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},de="mlhvqtcsaz".split("");for(let Ou=0,Mu=de.length;Ou<Mu;++Ou)ce[de[Ou]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,i=e.length;t<i;++t)e[t]=e[t]+(t%2?n.y:n.x);return ce[t](e,n,r)}}(de[Ou].toUpperCase());function fe(t){return t.segment.length&&t.segment.length-1===le[t.segment[0].toUpperCase()]}function pe(t,e){t.inNumber&&me(t,!1);const n=K.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function me(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,fe(t)&&ge(t)}function ge(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return ce[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function ye(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function we(t){return"E"===t.lastToken.toUpperCase()}const be=new Set([" ",",","\t","\n","\r","\f"]);let xe=class extends Ot{bbox(){return ot().path.setAttribute("d",this.toString()),new at(ot.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=t,this[i][2]+=e):"H"===r?this[i][1]+=t:"V"===r?this[i][1]+=e:"C"===r||"S"===r||"Q"===r?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===r&&(this[i][5]+=t,this[i][6]+=e)):"A"===r&&(this[i][6]+=t,this[i][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new rt,p:new rt};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!pe(i,r))if("."!==r)if(isNaN(parseInt(r)))if(be.has(r))i.inNumber&&me(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(K.test(r)){if(i.inNumber)me(i,!1);else{if(!fe(i))throw new Error("parser Error");ge(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!we(i)){me(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||ye(i)){i.inNumber=!0,i.number=r,me(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){me(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&me(i,!1),i.inSegment&&fe(i)&&ge(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}};const ve=t=>{const e=typeof t;return"number"===e?Mt:"string"===e?nt.isColor(t)?nt:Q.test(t)?K.test(t)?xe:Ot:$.test(t)?Mt:Ee:ke.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Ot:"object"===e?Me:Ee};let _e=class{constructor(t){this._stepper=t||new he("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(ve(t));let e=new this._type(t);return this._type===nt&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Me&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}},Ee=class{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}},Ce=class t{constructor(...t){this.init(...t)}init(e){return Array.isArray(e)&&(e={scaleX:e[0],scaleY:e[1],shear:e[2],rotate:e[3],translateX:e[4],translateY:e[5],originX:e[6],originY:e[7]}),Object.assign(this,t.defaults,e),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}};Ce.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const Oe=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;let Me=class{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===nt&&t[n+7]!==e[n+7]){const e=t[n+7],r=new nt(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=ve(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(Oe),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}};const ke=[Ee,Ce,Me];let Se=class extends Lt{constructor(t,e=t){super(T("path",t),e)}array(){return this._array||(this._array=new xe(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new xe(t))}size(t,e){const n=y(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}};Se.prototype.MorphArray=xe,c({Container:{path:F((function(t){return this.put(new Se).plot(t||new xe)}))}}),L(Se,"Path");const Ne=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new Jt(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Jt(t))},size:function(t,e){const n=y(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));let Ae=class extends Lt{constructor(t,e=t){super(T("polygon",t),e)}};c({Container:{polygon:F((function(t){return this.put(new Ae).plot(t||new Jt)}))}}),z(Ae,ee),z(Ae,Ne),L(Ae,"Polygon");let Te=class extends Lt{constructor(t,e=t){super(T("polyline",t),e)}};c({Container:{polyline:F((function(t){return this.put(new Te).plot(t||new Jt)}))}}),z(Te,ee),z(Te,Ne),L(Te,"Polyline");let je=class extends Lt{constructor(t,e=t){super(T("rect",t),e)}};z(je,{rx:Rt,ry:Pt}),c({Container:{rect:F((function(t,e){return this.put(new je).size(t,e)}))}}),L(je,"Rect");let Ie=class{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}};const Le={nextDraw:null,frames:new Ie,timeouts:new Ie,immediates:new Ie,timer:()=>O.window.performance||O.window.Date,transforms:[],frame(t){const e=Le.frames.push({run:t});return null===Le.nextDraw&&(Le.nextDraw=O.window.requestAnimationFrame(Le._draw)),e},timeout(t,e){e=e||0;const n=Le.timer().now()+e,r=Le.timeouts.push({run:t,time:n});return null===Le.nextDraw&&(Le.nextDraw=O.window.requestAnimationFrame(Le._draw)),r},immediate(t){const e=Le.immediates.push(t);return null===Le.nextDraw&&(Le.nextDraw=O.window.requestAnimationFrame(Le._draw)),e},cancelFrame(t){null!=t&&Le.frames.remove(t)},clearTimeout(t){null!=t&&Le.timeouts.remove(t)},cancelImmediate(t){null!=t&&Le.immediates.remove(t)},_draw(t){let e=null;const n=Le.timeouts.last();for(;(e=Le.timeouts.shift())&&(t>=e.time?e.run():Le.timeouts.push(e),e!==n););let r=null;const i=Le.frames.last();for(;r!==i&&(r=Le.frames.shift());)r.run(t);let s=null;for(;s=Le.immediates.shift();)s();Le.nextDraw=Le.timeouts.first()||Le.frames.first()?O.window.requestAnimationFrame(Le._draw):null}},Re=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Pe=function(){const t=O.window;return(t.performance||t.Date).now()};let De=class extends bt{constructor(t=Pe){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(Re);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Le.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Le.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let s=this._runners.length;s--;){const t=this._runners[s],e=t.runner;this._time-t.start<=0&&e.reset()}let i=!1;for(let s=0,o=this._runners.length;s<o;s++){const t=this._runners[s],e=t.runner;let n=r;const h=this._time-t.start;if(h<=0){i=!0;continue}if(h<n&&(n=h),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--s,--o)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}};c({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new De,this._timeline):(this._timeline=t,this)}}});let ze=class t extends bt{constructor(e){super(),this.id=t.id++,e="function"==typeof(e=null==e?vt:e)?new ae(e):e,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof e&&e,this._isDeclarative=e instanceof ae,this._stepper=this._isDeclarative?e:new he,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new st,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e??Et,n=n||"last","object"!=typeof(t=t??vt)||t instanceof oe||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,s=t.wait??s,t=t.duration??vt),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(e,n,r){const i=t.sanitise(e,n,r),s=new t(i.duration);return this._timeline&&s.timeline(this._timeline),this._element&&s.element(this._element),s.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new st,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new he(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let h;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,h=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(h,1),0)},a=i*(r+n)-r;return h=e<=0?Math.round(t(1e-5)):e<a?t(e):Math.round(t(a-1e-5)),h}const a=Math.floor(this.loops()),u=s&&a%2==0;return h=a+(u&&!o||o&&u?t:1-t),this.loops(h)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){this._queue.push({initialiser:t||xt,runner:e||xt,retarget:n,isTransform:r,initialised:!1,finished:!1});return this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof De||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let h=!1;return(n||o)&&(this._initialise(n),this.transforms=new st,h=this._run(o?t:e),this.fire("step",this)),this.done=this.done||h&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}};ze.id=0;let Fe=class{constructor(t=new st,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}};z([ze,Fe],{mergeWith(t){return new Fe(t.transforms.lmultiply(this.transforms),t.id)}});const $e=(t,e)=>t.lmultiplyO(e),Ye=t=>t.transforms;function Xe(){const t=this._transformationRunners.runners.map(Ye).reduce($e,new st);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}let Ge=class{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Fe).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(t&&n.done&&t.done&&(!n._timeline||!n._timeline._runnerIds.includes(n.id))&&(!t._timeline||!t._timeline._runnerIds.includes(t.id))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}};c({Element:{animate(t,e,n){const r=ze.sanitise(t,e,n),i=this.timeline();return new ze(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(Ye).reduce($e,new st)},_addRunner(t){this._transformationRunners.add(t),Le.cancelImmediate(this._frameId),this._frameId=Le.immediate(Xe.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ge).add(new Fe(new st(this))))}}});z(ze,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new _e(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(h=s,n.filter((t=>!h.includes(t))));var h;if(o.length){const e=this.element()[t](o),n=new Me(i.from()).valueOf();Object.assign(n,e),i.from(n)}const a=new Me(i.to()).valueOf();Object.assign(a,e),i.to(a),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new _e(this._stepper).to(new Mt(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=st.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new _e(this._stepper).type(n?Ce:st);let s,o,h,a,u;return this.queue((function(){o=o||this.element(),s=s||w(t,o),u=new st(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:d}=new rt(s).transform(o._currentTransform(this));let f=new st({...t,origin:[c,d]}),p=this._isDeclarative&&h?h:u;if(n){f=f.decompose(c,d),p=p.decompose(c,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);f.rotate=n[s]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&a&&(p.rotate=a)),i.from(p),i.to(f);const m=i.at(l);return a=m.rotate,h=new st(m),this.addTransform(h),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=w(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new Mt(e),this._tryRetarget(t,e))return this;const n=new _e(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new Mt(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new _e(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new Mt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new _e(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new at(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),z(ze,{rx:Rt,ry:Pt,from:Vt,to:Ht}),L(ze,"Runner");let qe=class extends jt{constructor(t,e=t){super(T("svg",t),e),this.namespace()}defs(){return this.isRoot()?j(this.node.querySelector("defs"))||this.put(new It):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof O.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:_,version:"1.1"}).attr("xmlns:xlink",C,E):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,E).attr("xmlns:svgjs",null,E)}root(){return this.isRoot()?this:super.root()}};c({Container:{nested:F((function(){return this.put(new qe)}))}}),L(qe,"Svg",!0);let Be=class extends jt{constructor(t,e=t){super(T("symbol",t),e)}};c({Container:{symbol:F((function(){return this.put(new Be)}))}}),L(Be,"Symbol");const Ve=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(O.document.createTextNode(t)),this},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}},Symbol.toStringTag,{value:"Module"}));let He=class extends Lt{constructor(t,e=t){super(T("text",t),e),this.dom.leading=this.dom.leading??new Mt(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new Mt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){if(x(this.node))return;const i=O.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new Mt(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new Mt(t.leading||1.3),this}writeDataToDom(){return v(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||x(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===j(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}};z(He,Ve),c({Container:{text:F((function(t=""){return this.put(new He).text(t)})),plain:F((function(t=""){return this.put(new He).plain(t)}))}}),L(He,"Text");let We=class extends Lt{constructor(t,e=t){super(T("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof He))return this;const e=t.index(this),n=O.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new Mt(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}};z(We,Ve),c({Tspan:{tspan:F((function(t=""){const e=new We;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),L(We,"Tspan");let Ze=class extends Lt{constructor(t,e=t){super(T("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new Mt(t).divide(2))}};z(Ze,{x:Dt,y:zt,cx:Ft,cy:$t,width:Yt,height:Xt}),c({Container:{circle:F((function(t=0){return this.put(new Ze).size(t).move(0,0)}))}}),L(Ze,"Circle");let Ue=class extends jt{constructor(t,e=t){super(T("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return dt("svg [clip-path*="+this.id()+"]")}};c({Container:{clip:F((function(){return this.defs().put(new Ue)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof Ue?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),L(Ue,"ClipPath");let Qe=class extends At{constructor(t,e=t){super(T("foreignObject",t),e)}};c({Container:{foreignObject:F((function(t,e){return this.put(new Qe).size(t,e)}))}}),L(Qe,"ForeignObject");const Ke=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof O.window.SVGSVGElement?new at(n.attr(["x","y","width","height"])):n.bbox()}catch(h){return}const i=new st(n),s=i.translate(t,e).transform(i.inverse()),o=new rt(r.x,r.y).transform(s);n.move(o.x,o.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=y(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach((t=>{const e=new rt(n).transform(new st(t).inverse());t.scale(i,s,e.x,e.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}},Symbol.toStringTag,{value:"Module"}));let Je=class extends jt{constructor(t,e=t){super(T("g",t),e)}};z(Je,Ke),c({Container:{group:F((function(){return this.put(new Je)}))}}),L(Je,"G");let tn=class extends jt{constructor(t,e=t){super(T("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,C)}};z(tn,Ke),c({Container:{link:F((function(t){return this.put(new tn).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new tn,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),L(tn,"A");let en=class extends jt{constructor(t,e=t){super(T("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return dt("svg [mask*="+this.id()+"]")}};c({Container:{mask:F((function(){return this.defs().put(new en)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof en?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),L(en,"Mask");let nn=class extends At{constructor(t,e=t){super(T("stop",t),e)}update(t){return("number"==typeof t||t instanceof Mt)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new Mt(t.offset)),this}};c({Gradient:{stop:function(t,e,n){return this.put(new nn).update(t,e,n)}}}),L(nn,"Stop");let rn=class extends At{constructor(t,e=t){super(T("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const r in e)n+=r.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[r]+";";return n+="}",n}(t,e))}};c("Dom",{style(t,e){return this.put(new rn).rule(t,e)},fontface(t,e,n){return this.put(new rn).font(t,e,n)}}),L(rn,"Style");let sn=class extends He{constructor(t,e=t){super(T("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}};c({Container:{textPath:F((function(t,e){return t instanceof He||(t=this.text(t)),t.path(e)}))},Text:{path:F((function(t,e=!0){const n=new sn;let r;if(t instanceof Se||(t=this.defs().path(t)),n.attr("href","#"+t,C),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:F((function(t){return t instanceof He||(t=(new He).addTo(this.parent()).text(t)),t.path(this)})),targets(){return dt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),sn.prototype.MorphArray=xe,L(sn,"TextPath");let on=class extends Lt{constructor(t,e=t){super(T("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,C)}};c({Container:{use:F((function(t,e){return this.put(new on).use(t,e)}))}}),L(on,"Use"),z([qe,Be,Qt,Ut,re],d("viewbox")),z([ne,Te,Ae,Se],d("marker")),z(He,d("Text")),z(Se,d("Path")),z(It,d("Defs")),z([He,We],d("Tspan")),z([je,qt,Zt,ze],d("radius")),z(bt,d("EventTarget")),z(Nt,d("Dom")),z(At,d("Element")),z(Lt,d("Shape")),z([jt,Bt],d("Container")),z(Zt,d("Gradient")),z(ze,d("Runner")),lt.extend([...new Set(l)]),function(t=[]){ke.push(...[].concat(t))}([Mt,nt,at,st,Ot,Jt,xe,rt]),z(ke,{to(t){return(new _e).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});const hn={export:"data:image/svg+xml,%3csvg%20fill='%23000000'%20width='20px'%20height='20px'%20viewBox='0%200%2024%2024'%20id='export-2'%20xmlns='http://www.w3.org/2000/svg'%20class='icon%20line'%3e%3cpolyline%20id='primary'%20points='15%203%2021%203%2021%209'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/polyline%3e%3cpath%20id='primary-2'%20data-name='primary'%20d='M21,13v7a1,1,0,0,1-1,1H4a1,1,0,0,1-1-1V4A1,1,0,0,1,4,3h7'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/path%3e%3cline%20id='primary-3'%20data-name='primary'%20x1='11'%20y1='13'%20x2='21'%20y2='3'%20style='fill:%20none;%20stroke:%20rgb(0,%200,%200);%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%201.5;'%3e%3c/line%3e%3c/svg%3e","fit-screen":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpolygon%20points='8%202%202%202%202%208%204%208%204%204%208%204%208%202'/%3e%3cpolygon%20points='24%202%2030%202%2030%208%2028%208%2028%204%2024%204%2024%202'/%3e%3cpolygon%20points='8%2030%202%2030%202%2024%204%2024%204%2028%208%2028%208%2030'/%3e%3cpolygon%20points='24%2030%2030%2030%2030%2024%2028%2024%2028%2028%2024%2028%2024%2030'/%3e%3cpath%20d='M24,24H8a2.0023,2.0023,0,0,1-2-2V10A2.0023,2.0023,0,0,1,8,8H24a2.0023,2.0023,0,0,1,2,2V22A2.0023,2.0023,0,0,1,24,24ZM8,10V22H24V10Z'/%3e%3crect%20fill='none'%20width='32'%20height='32'/%3e%3c/svg%3e","zoom-in":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:sketch='http://www.bohemiancoding.com/sketch/ns'%3e%3cg%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20transform='translate(-308.000000,%20-1139.000000)'%20fill='%23000000'%3e%3cpath%20d='M321.46,1163.45%20C315.17,1163.45%20310.07,1158.44%20310.07,1152.25%20C310.07,1146.06%20315.17,1141.04%20321.46,1141.04%20C327.75,1141.04%20332.85,1146.06%20332.85,1152.25%20C332.85,1158.44%20327.75,1163.45%20321.46,1163.45%20L321.46,1163.45%20Z%20M339.688,1169.25%20L331.429,1161.12%20C333.592,1158.77%20334.92,1155.67%20334.92,1152.25%20C334.92,1144.93%20328.894,1139%20321.46,1139%20C314.026,1139%20308,1144.93%20308,1152.25%20C308,1159.56%20314.026,1165.49%20321.46,1165.49%20C324.672,1165.49%20327.618,1164.38%20329.932,1162.53%20L338.225,1170.69%20C338.629,1171.09%20339.284,1171.09%20339.688,1170.69%20C340.093,1170.3%20340.093,1169.65%20339.688,1169.25%20L339.688,1169.25%20Z%20M326.519,1151.41%20L322.522,1151.41%20L322.522,1147.41%20C322.522,1146.85%20322.075,1146.41%20321.523,1146.41%20C320.972,1146.41%20320.524,1146.85%20320.524,1147.41%20L320.524,1151.41%20L316.529,1151.41%20C315.978,1151.41%20315.53,1151.59%20315.53,1152.14%20C315.53,1152.7%20315.978,1153.41%20316.529,1153.41%20L320.524,1153.41%20L320.524,1157.41%20C320.524,1157.97%20320.972,1158.41%20321.523,1158.41%20C322.075,1158.41%20322.522,1157.97%20322.522,1157.41%20L322.522,1153.41%20L326.519,1153.41%20C327.07,1153.41%20327.518,1152.96%20327.518,1152.41%20C327.518,1151.86%20327.07,1151.41%20326.519,1151.41%20L326.519,1151.41%20Z'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e","zoom-out":"data:image/svg+xml,%3csvg%20width='20px'%20height='20px'%20viewBox='0%200%2032%2032'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cg%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20%3e%3cg%20transform='translate(-360.000000,%20-1139.000000)'%20fill='%23000000'%3e%3cpath%20d='M373.46,1163.45%20C367.17,1163.45%20362.071,1158.44%20362.071,1152.25%20C362.071,1146.06%20367.17,1141.04%20373.46,1141.04%20C379.75,1141.04%20384.85,1146.06%20384.85,1152.25%20C384.85,1158.44%20379.75,1163.45%20373.46,1163.45%20L373.46,1163.45%20Z%20M391.688,1169.25%20L383.429,1161.12%20C385.592,1158.77%20386.92,1155.67%20386.92,1152.25%20C386.92,1144.93%20380.894,1139%20373.46,1139%20C366.026,1139%20360,1144.93%20360,1152.25%20C360,1159.56%20366.026,1165.49%20373.46,1165.49%20C376.672,1165.49%20379.618,1164.38%20381.932,1162.53%20L390.225,1170.69%20C390.629,1171.09%20391.284,1171.09%20391.688,1170.69%20C392.093,1170.3%20392.093,1169.65%20391.688,1169.25%20L391.688,1169.25%20Z%20M378.689,1151.41%20L368.643,1151.41%20C368.102,1151.41%20367.663,1151.84%20367.663,1152.37%20C367.663,1152.9%20368.102,1153.33%20368.643,1153.33%20L378.689,1153.33%20C379.23,1153.33%20379.669,1152.9%20379.669,1152.37%20C379.669,1151.84%20379.23,1151.41%20378.689,1151.41%20L378.689,1151.41%20Z'%20/%3e%3c/g%3e%3c/g%3e%3c/svg%3e"};class an{constructor(t,e){this.element=t,t&&(this.chartContext=e||new r(t),this.injectStyles())}injectStyles(){const t=`toolbar-styles-${this.chartContext.getInstanceId()}`;this.chartContext.injectStyles("\n #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n \n .toolbar-item {\n align-items: center;\n background-color: var(--toolbar-bg-color, #FFFFFF);\n border: 1px solid var(--toolbar-border-color, #BCBCBC);\n cursor: pointer;\n display: flex;\n height: 30px;\n justify-content: center;\n width: 30px;\n border-radius: 3px;\n transition: all 0.2s ease;\n position: relative;\n }\n \n .toolbar-item:hover {\n background-color: var(--toolbar-hover-bg-color, #f8f9fa);\n border-color: var(--toolbar-border-color, #999);\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:active {\n transform: translateY(0);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n }\n \n .toolbar-item:focus {\n outline: none;\n border-color: var(--button-bg-color, #0066cc);\n box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);\n }\n \n .toolbar-item img {\n width: 16px;\n height: 16px;\n pointer-events: none;\n filter: var(--toolbar-icon-filter, none);\n }\n \n .toolbar-item[disabled] {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n }\n \n /* Tooltip styles */\n .toolbar-item::after {\n content: attr(data-tooltip);\n position: absolute;\n bottom: -35px;\n left: 50%;\n transform: translateX(-50%);\n background: var(--tooltip-bg-color, #333);\n color: var(--tooltip-text-color, white);\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 12px;\n white-space: nowrap;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item::before {\n content: '';\n position: absolute;\n bottom: -25px;\n left: 50%;\n transform: translateX(-50%);\n border: 5px solid transparent;\n border-bottom-color: var(--tooltip-bg-color, #333);\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s ease;\n z-index: 1000;\n }\n \n .toolbar-item:hover::after,\n .toolbar-item:hover::before {\n opacity: 1;\n }\n \n /* Shadow DOM specific adjustments */\n :host #toolbar {\n display: flex;\n gap: 5px;\n position: absolute;\n right: 10px;\n top: 10px;\n z-index: 100;\n }\n",t)}createToolbarItem(t,e,n){const r=this.chartContext.createElement("div"),i=new Image;return i.src=e,i.alt=n||t,r.id=t,r.className="toolbar-item",r.setAttribute("role","button"),r.setAttribute("tabindex","0"),n&&(r.setAttribute("data-tooltip",n),r.setAttribute("aria-label",n)),r.append(i),r.addEventListener("keydown",(t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r.click())})),r}render({enableExport:t=!1,enableFitscreen:e=!1,enableZoom:n=!1,onExport:r=s,onFitscreen:i=s,onZoom:o=s}){if(!this.element)return;const h=this.chartContext.querySelector("#toolbar");null==h||h.remove();const a=this.chartContext.createElement("div");if(a.id="toolbar",a.setAttribute("role","toolbar"),a.setAttribute("aria-label","Chart controls"),t){const t=this.createToolbarItem("export",hn.export,"Export chart");t.addEventListener("click",(()=>{r()})),a.append(t)}if(n){const t=this.createToolbarItem("zoom-in",hn["zoom-in"],"Zoom in"),e=this.createToolbarItem("zoom-out",hn["zoom-out"],"Zoom out");t.addEventListener("click",(()=>{o(.1)})),e.addEventListener("click",(()=>{o(-.1)})),a.append(t,e)}if(e){const t=this.createToolbarItem("fit-screen",hn["fit-screen"],"Fit to screen");t.addEventListener("click",(()=>{i()})),a.append(t)}this.element.append(a)}destroy(){const t=this.chartContext.querySelector("#toolbar");null==t||t.remove()}}const un=class{static add(t){this.remove(t);const e=document.createElement("div");e.className=this.WATERMARK_CLASS,e.textContent=this.WATERMARK_TEXT,Object.assign(e.style,{bottom:"5px",color:"#666",fontFamily:"Arial, sans-serif",fontSize:"14px",msUserSelect:"none",pointerEvents:"none",position:"absolute",right:"5px",userSelect:"none",webkitUserSelect:"none",zIndex:"1000"}),"static"===getComputedStyle(t).position&&(t.style.position="relative"),t.appendChild(e)}static exists(t){return!!t.querySelector(`.${this.WATERMARK_CLASS}`)}static remove(t){const e=t.querySelector(`.${this.WATERMARK_CLASS}`);e&&e.remove()}};un.WATERMARK_CLASS="apexgantt-watermark",un.WATERMARK_TEXT="Powered by apexcharts.com";let ln=un;var cn,dn=(cn={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},function(t){return null==cn?void 0:cn[t]}),fn="object"==typeof global&&global&&global.Object===Object&&global,pn="object"==typeof self&&self&&self.Object===Object&&self,mn=(fn||pn||Function("return this")()).Symbol;var gn=Array.isArray,yn=Object.prototype,wn=yn.hasOwnProperty,bn=yn.toString,xn=mn?mn.toStringTag:void 0;var vn=Object.prototype.toString;var _n="[object Null]",En="[object Undefined]",Cn=mn?mn.toStringTag:void 0;function On(t){return null==t?void 0===t?En:_n:Cn&&Cn in Object(t)?function(t){var e=wn.call(t,xn),n=t[xn];try{t[xn]=void 0;var r=!0}catch(s){}var i=bn.call(t);return r&&(e?t[xn]=n:delete t[xn]),i}(t):function(t){return vn.call(t)}(t)}var Mn="[object Symbol]";var kn=1/0,Sn=mn?mn.prototype:void 0,Nn=Sn?Sn.toString:void 0;function An(t){if("string"==typeof t)return t;if(gn(t))return function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}(t,An)+"";if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&On(t)==Mn}(t))return Nn?Nn.call(t):"";var e=t+"";return"0"==e&&1/t==-kn?"-0":e}function Tn(t){return null==t?"":An(t)}var jn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,In=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var Ln=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Rn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Pn="\\ud800-\\udfff",Dn="\\u2700-\\u27bf",zn="a-z\\xdf-\\xf6\\xf8-\\xff",Fn="A-Z\\xc0-\\xd6\\xd8-\\xde",$n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Yn="["+$n+"]",Xn="\\d+",Gn="["+Dn+"]",qn="["+zn+"]",Bn="[^"+Pn+$n+Xn+Dn+zn+Fn+"]",Vn="(?:\\ud83c[\\udde6-\\uddff]){2}",Hn="[\\ud800-\\udbff][\\udc00-\\udfff]",Wn="["+Fn+"]",Zn="(?:"+qn+"|"+Bn+")",Un="(?:"+Wn+"|"+Bn+")",Qn="(?:['’](?:d|ll|m|re|s|t|ve))?",Kn="(?:['’](?:D|LL|M|RE|S|T|VE))?",Jn="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",tr="[\\ufe0e\\ufe0f]?",er=tr+Jn+("(?:\\u200d(?:"+["[^"+Pn+"]",Vn,Hn].join("|")+")"+tr+Jn+")*"),nr="(?:"+[Gn,Vn,Hn].join("|")+")"+er,rr=RegExp([Wn+"?"+qn+"+"+Qn+"(?="+[Yn,Wn,"$"].join("|")+")",Un+"+"+Kn+"(?="+[Yn,Wn+Zn,"$"].join("|")+")",Wn+"?"+Zn+"+"+Qn,Wn+"+"+Kn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Xn,nr].join("|"),"g");function ir(t,e,n){return t=Tn(t),void 0===e?function(t){return Rn.test(t)}(t)?function(t){return t.match(rr)||[]}(t):function(t){return t.match(Ln)||[]}(t):t.match(e)||[]}var sr=RegExp("['’]","g");var or,hr=(or=function(t,e,n){return t+(n?"-":"")+e.toLowerCase()},function(t){return function(t,e,n,r){for(var i=-1,s=null==t?0:t.length;++i<s;)n=e(n,t[i],i,t);return n}(ir(function(t){return(t=Tn(t))&&t.replace(jn,dn).replace(In,"")}(t).replace(sr,"")),or,"")});const ar=(t,e="apex-tooltip-container")=>{let n=t.getElementById(e);if(!n){n=t.createElement("div"),n.id=e,n.setAttribute("role","tooltip"),n.setAttribute("aria-hidden","true");t.getAppendContainer().appendChild(n)}return n},ur=(t,e="",n,r="")=>{const i=t.getElementById(e);if(!i)return console.warn("Tooltip: Element not found, creating it"),ar(t,e),ur(t,e,n,r);if(n&&r){const t=r.includes("tooltip-content"),e=n.match(/background-color:\s*([^;]+);?/),s=n.match(/color:\s*([^;]+);?/),o=e?e[1]:"#333",h=s?s[1]:"white";i.innerHTML=t?r:`<div class="tooltip-content" style="background-color: ${o}; color: ${h};">${r}</div>`;const a=n+"; display: block !important; visibility: visible !important; opacity: 1 !important;";i.setAttribute("style",a),i.classList.add("visible"),i.setAttribute("aria-hidden","false")}else i.removeAttribute("style"),i.classList.remove("visible"),i.setAttribute("aria-hidden","true"),i.innerHTML=""},lr=(t={})=>{const e=[];for(const n in t){const r=`${hr(n)}: ${t[n]};`;e.push(r)}return e.join(" ")},cr=({bgColor:t,borderColor:e,fontColor:n,fontFamily:r,fontSize:i,fontWeight:s,maxWidth:o=300,padding:h,placement:a="top",x:u,y:l})=>{const c=["position: absolute;","z-index: 1000;","pointer-events: none;"];return c.push(`width: ${o}px;`),c.push(`max-width: ${o}px;`),c.push("box-sizing: border-box;"),c.push("word-wrap: break-word;"),c.push("overflow-wrap: break-word;"),c.push(`left: ${u}px;`),c.push(`top: ${l}px;`),c.push(`data-placement: ${a};`),e&&c.push(`border: 1px solid ${e};`),c.push("border-radius: 5px;"),n&&c.push(`color: ${n};`),r&&c.push(`font-family: ${r};`),s&&c.push(`font-weight: ${s};`),i&&c.push(`font-size: ${i};`),t&&c.push(`background-color: ${t};`),void 0!==h&&c.push(`padding: ${h}px;`),c.join(" ")};var dr="\0",fr="\0",pr="";function mr(t,e){t[e]?t[e]++:t[e]=1}function gr(t,e){--t[e]||delete t[e]}function yr(t,e,n,r){var i=""+e,s=""+n;if(!t&&i>s){var o=i;i=s,s=o}return i+pr+s+pr+(void 0===r?dr:r)}function wr(t,e){return yr(t,e.v,e.w,e.name)}var br=class{constructor(t){n(this,"_isDirected",!0),n(this,"_isMultigraph",!1),n(this,"_isCompound",!1),n(this,"_label"),n(this,"_defaultNodeLabelFn",(()=>{})),n(this,"_defaultEdgeLabelFn",(()=>{})),n(this,"_nodes",{}),n(this,"_in",{}),n(this,"_preds",{}),n(this,"_out",{}),n(this,"_sucs",{}),n(this,"_edgeObjs",{}),n(this,"_edgeLabels",{}),n(this,"_nodeCount",0),n(this,"_edgeCount",0),n(this,"_parent"),n(this,"_children"),t&&(this._isDirected=!Object.hasOwn(t,"directed")||t.directed,this._isMultigraph=!!Object.hasOwn(t,"multigraph")&&t.multigraph,this._isCompound=!!Object.hasOwn(t,"compound")&&t.compound),this._isCompound&&(this._parent={},this._children={},this._children[fr]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return this._defaultNodeLabelFn=t,"function"!=typeof t&&(this._defaultNodeLabelFn=()=>t),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var t=this;return this.nodes().filter((e=>0===Object.keys(t._in[e]).length))}sinks(){var t=this;return this.nodes().filter((e=>0===Object.keys(t._out[e]).length))}setNodes(t,e){var n=arguments,r=this;return t.forEach((function(t){n.length>1?r.setNode(t,e):r.setNode(t)})),this}setNode(t,e){return Object.hasOwn(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=fr,this._children[t]={},this._children[fr][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.hasOwn(this._nodes,t)}removeNode(t){var e=this;if(Object.hasOwn(this._nodes,t)){var n=t=>e.removeEdge(e._edgeObjs[t]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach((function(t){e.setParent(t)})),delete this._children[t]),Object.keys(this._in[t]).forEach(n),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(void 0===e)e=fr;else{for(var n=e+="";void 0!==n;n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==fr)return e}}children(t=fr){if(this._isCompound){var e=this._children[t];if(e)return Object.keys(e)}else{if(t===fr)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var e=this._preds[t];if(e)return Object.keys(e)}successors(t){var e=this._sucs[t];if(e)return Object.keys(e)}neighbors(t){var e=this.predecessors(t);if(e){const r=new Set(e);for(var n of this.successors(t))r.add(n);return Array.from(r.values())}}isLeaf(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach((function([n,r]){t(n)&&e.setNode(n,r)})),Object.values(this._edgeObjs).forEach((function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var r={};function i(t){var s=n.parent(t);return void 0===s||e.hasNode(s)?(r[t]=s,s):s in r?r[s]:i(s)}return this._isCompound&&e.nodes().forEach((t=>e.setParent(t,i(t)))),e}setDefaultEdgeLabel(t){return this._defaultEdgeLabelFn=t,"function"!=typeof t&&(this._defaultEdgeLabelFn=()=>t),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,e){var n=this,r=arguments;return t.reduce((function(t,i){return r.length>1?n.setEdge(t,i,e):n.setEdge(t,i),i})),this}setEdge(){var t,e,n,r,i=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(t=s.v,e=s.w,n=s.name,2===arguments.length&&(r=arguments[1],i=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),t=""+t,e=""+e,void 0!==n&&(n=""+n);var o=yr(this._isDirected,t,e,n);if(Object.hasOwn(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(void 0!==n&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(t,e,n);var h=function(t,e,n,r){var i=""+e,s=""+n;if(!t&&i>s){var o=i;i=s,s=o}var h={v:i,w:s};r&&(h.name=r);return h}(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[o]=h,mr(this._preds[e],t),mr(this._sucs[t],e),this._in[e][o]=h,this._out[t][o]=h,this._edgeCount++,this}edge(t,e,n){var r=1===arguments.length?wr(this._isDirected,arguments[0]):yr(this._isDirected,t,e,n);return this._edgeLabels[r]}edgeAsObj(){const t=this.edge(...arguments);return"object"!=typeof t?{label:t}:t}hasEdge(t,e,n){var r=1===arguments.length?wr(this._isDirected,arguments[0]):yr(this._isDirected,t,e,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(t,e,n){var r=1===arguments.length?wr(this._isDirected,arguments[0]):yr(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],gr(this._preds[e],t),gr(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this}inEdges(t,e){var n=this._in[t];if(n){var r=Object.values(n);return e?r.filter((t=>t.v===e)):r}}outEdges(t,e){var n=this._out[t];if(n){var r=Object.values(n);return e?r.filter((t=>t.w===e)):r}}nodeEdges(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},xr={Graph:br,version:"2.2.4"},vr=br,_r={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Er(t),edges:Cr(t)};void 0!==t.graph()&&(e.value=structuredClone(t.graph()));return e},read:function(t){var e=new vr(t.options).setGraph(t.value);return t.nodes.forEach((function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),t.edges.forEach((function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}};function Er(t){return t.nodes().map((function(e){var n=t.node(e),r=t.parent(e),i={v:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.parent=r),i}))}function Cr(t){return t.edges().map((function(e){var n=t.edge(e),r={v:e.v,w:e.w};return void 0!==e.name&&(r.name=e.name),void 0!==n&&(r.value=n),r}))}var Or=function(t){var e,n={},r=[];function i(r){Object.hasOwn(n,r)||(n[r]=!0,e.push(r),t.successors(r).forEach(i),t.predecessors(r).forEach(i))}return t.nodes().forEach((function(t){e=[],i(t),e.length&&r.push(e)})),r};var Mr=class{constructor(){n(this,"_arr",[]),n(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map((function(t){return t.key}))}has(t){return Object.hasOwn(this._keyIndices,t)}priority(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority}min(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key}add(t,e){var n=this._keyIndices;if(t=String(t),!Object.hasOwn(n,t)){var r=this._arr,i=r.length;return n[t]=i,r.push({key:t,priority:e}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)}_heapify(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))}_decrease(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e}_swap(t,e){var n=this._arr,r=this._keyIndices,i=n[t],s=n[e];n[t]=s,n[e]=i,r[s.key]=t,r[i.key]=e}},kr=Mr,Sr=function(t,e,n,r){return function(t,e,n,r){var i,s,o={},h=new kr,a=function(t){var e=t.v!==i?t.v:t.w,r=o[e],a=n(t),u=s.distance+a;if(a<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+a);u<r.distance&&(r.distance=u,r.predecessor=i,h.decrease(e,u))};t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;o[t]={distance:n},h.add(t,n)}));for(;h.size()>0&&(i=h.removeMin(),(s=o[i]).distance!==Number.POSITIVE_INFINITY);)r(i).forEach(a);return o}(t,String(e),n||Nr,r||function(e){return t.outEdges(e)})},Nr=()=>1;var Ar=Sr,Tr=function(t,e,n){return t.nodes().reduce((function(r,i){return r[i]=Ar(t,i,e,n),r}),{})};var jr=function(t){var e=0,n=[],r={},i=[];function s(o){var h=r[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),t.successors(o).forEach((function(t){Object.hasOwn(r,t)?r[t].onStack&&(h.lowlink=Math.min(h.lowlink,r[t].index)):(s(t),h.lowlink=Math.min(h.lowlink,r[t].lowlink))})),h.lowlink===h.index){var a,u=[];do{a=n.pop(),r[a].onStack=!1,u.push(a)}while(o!==a);i.push(u)}}return t.nodes().forEach((function(t){Object.hasOwn(r,t)||s(t)})),i};var Ir=jr,Lr=function(t){return Ir(t).filter((function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))};var Rr=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,s=e(n);r[t][i]={distance:s,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var s=r[n];i.forEach((function(n){var r=s[t],i=e[n],o=s[n],h=r.distance+i.distance;h<o.distance&&(o.distance=h,o.predecessor=i.predecessor)}))}))})),r}(t,e||Pr,n||function(e){return t.outEdges(e)})},Pr=()=>1;function Dr(t){var e={},n={},r=[];if(t.sinks().forEach((function i(s){if(Object.hasOwn(n,s))throw new zr;Object.hasOwn(e,s)||(n[s]=!0,e[s]=!0,t.predecessors(s).forEach(i),delete n[s],r.push(s))})),Object.keys(e).length!==t.nodeCount())throw new zr;return r}class zr extends Error{constructor(){super(...arguments)}}var Fr=Dr;Dr.CycleException=zr;var $r=Fr;var Yr=function(t,e,n){Array.isArray(e)||(e=[e]);var r=t.isDirected()?e=>t.successors(e):e=>t.neighbors(e),i="post"===n?Xr:Gr,s=[],o={};return e.forEach((e=>{if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);i(e,r,o,s)})),s};function Xr(t,e,n,r){for(var i=[[t,!1]];i.length>0;){var s=i.pop();s[1]?r.push(s[0]):Object.hasOwn(n,s[0])||(n[s[0]]=!0,i.push([s[0],!0]),qr(e(s[0]),(t=>i.push([t,!1]))))}}function Gr(t,e,n,r){for(var i=[t];i.length>0;){var s=i.pop();Object.hasOwn(n,s)||(n[s]=!0,r.push(s),qr(e(s),(t=>i.push(t))))}}function qr(t,e){for(var n=t.length;n--;)e(t[n],n,t);return t}var Br=Yr;var Vr=Yr;var Hr=br,Wr=Mr;var Zr={Graph:xr.Graph,json:_r,alg:{components:Or,dijkstra:Sr,dijkstraAll:Tr,findCycles:Lr,floydWarshall:Rr,isAcyclic:function(t){try{$r(t)}catch(e){if(e instanceof $r.CycleException)return!1;throw e}return!0},postorder:function(t,e){return Br(t,e,"post")},preorder:function(t,e){return Vr(t,e,"pre")},prim:function(t,e){var n,r=new Hr,i={},s=new Wr;function o(t){var r=t.v===n?t.w:t.v,o=s.priority(r);if(void 0!==o){var h=e(t);h<o&&(i[r]=n,s.decrease(r,h))}}if(0===t.nodeCount())return r;t.nodes().forEach((function(t){s.add(t,Number.POSITIVE_INFINITY),r.setNode(t)})),s.decrease(t.nodes()[0],0);var h=!1;for(;s.size()>0;){if(n=s.removeMin(),Object.hasOwn(i,n))r.setEdge(n,i[n]);else{if(h)throw new Error("Input graph is not connected: "+t);h=!0}t.nodeEdges(n).forEach(o)}return r},tarjan:jr,topsort:Fr},version:xr.version};function Ur(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function Qr(t,e){if("_next"!==t&&"_prev"!==t)return e}let Kr=Zr.Graph,Jr=class{constructor(){let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,e=t._prev;if(e!==t)return Ur(e),e}enqueue(t){let e=this._sentinel;t._prev&&t._next&&Ur(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e}toString(){let t=[],e=this._sentinel,n=e._prev;for(;n!==e;)t.push(JSON.stringify(n,Qr)),n=n._prev;return"["+t.join(", ")+"]"}};var ti=function(t,e){if(t.nodeCount()<=1)return[];let n=function(t,e){let n=new Kr,r=0,i=0;t.nodes().forEach((t=>{n.setNode(t,{v:t,in:0,out:0})})),t.edges().forEach((t=>{let s=n.edge(t.v,t.w)||0,o=e(t),h=s+o;n.setEdge(t.v,t.w,h),i=Math.max(i,n.node(t.v).out+=o),r=Math.max(r,n.node(t.w).in+=o)}));let s=function(t){const e=[];for(let n=0;n<t;n++)e.push(n);return e}(i+r+3).map((()=>new Jr)),o=r+1;return n.nodes().forEach((t=>{ri(s,o,n.node(t))})),{graph:n,buckets:s,zeroIdx:o}}(t,e||ei);return function(t,e,n){let r,i=[],s=e[e.length-1],o=e[0];for(;t.nodeCount();){for(;r=o.dequeue();)ni(t,e,n,r);for(;r=s.dequeue();)ni(t,e,n,r);if(t.nodeCount())for(let s=e.length-2;s>0;--s)if(r=e[s].dequeue(),r){i=i.concat(ni(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx).flatMap((e=>t.outEdges(e.v,e.w)))};let ei=()=>1;function ni(t,e,n,r,i){let s=i?[]:void 0;return t.inEdges(r.v).forEach((r=>{let o=t.edge(r),h=t.node(r.v);i&&s.push({v:r.v,w:r.w}),h.out-=o,ri(e,n,h)})),t.outEdges(r.v).forEach((r=>{let i=t.edge(r),s=r.w,o=t.node(s);o.in-=i,ri(e,n,o)})),t.removeNode(r.v),s}function ri(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}let ii=Zr.Graph;var si={addBorderNode:function(t,e,n,r){let i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return oi(t,"border",i,e)},addDummyNode:oi,applyWithChunking:ai,asNonCompoundGraph:function(t){let e=new ii({multigraph:t.isMultigraph()}).setGraph(t.graph());return t.nodes().forEach((n=>{t.children(n).length||e.setNode(n,t.node(n))})),t.edges().forEach((n=>{e.setEdge(n,t.edge(n))})),e},buildLayerMatrix:function(t){let e=di(ui(t)+1).map((()=>[]));return t.nodes().forEach((n=>{let r=t.node(n),i=r.rank;void 0!==i&&(e[i][r.order]=n)})),e},intersectRect:function(t,e){let n,r,i=t.x,s=t.y,o=e.x-i,h=e.y-s,a=t.width/2,u=t.height/2;if(!o&&!h)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(h)*a>Math.abs(o)*u?(h<0&&(u=-u),n=u*o/h,r=u):(o<0&&(a=-a),n=a,r=a*h/o);return{x:i+n,y:s+r}},mapValues:function(t,e){let n=e;"string"==typeof e&&(n=t=>t[e]);return Object.entries(t).reduce(((t,[e,r])=>(t[e]=n(r,e),t)),{})},maxRank:ui,normalizeRanks:function(t){let e=t.nodes().map((e=>{let n=t.node(e).rank;return void 0===n?Number.MAX_VALUE:n})),n=ai(Math.min,e);t.nodes().forEach((e=>{let r=t.node(e);Object.hasOwn(r,"rank")&&(r.rank-=n)}))},notime:function(t,e){return e()},partition:function(t,e){let n={lhs:[],rhs:[]};return t.forEach((t=>{e(t)?n.lhs.push(t):n.rhs.push(t)})),n},pick:function(t,e){const n={};for(const r of e)void 0!==t[r]&&(n[r]=t[r]);return n},predecessorWeights:function(t){let e=t.nodes().map((e=>{let n={};return t.inEdges(e).forEach((e=>{n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return fi(t.nodes(),e)},range:di,removeEmptyRanks:function(t){let e=t.nodes().map((e=>t.node(e).rank)),n=ai(Math.min,e),r=[];t.nodes().forEach((e=>{let i=t.node(e).rank-n;r[i]||(r[i]=[]),r[i].push(e)}));let i=0,s=t.graph().nodeRankFactor;Array.from(r).forEach(((e,n)=>{void 0===e&&n%s!=0?--i:void 0!==e&&i&&e.forEach((e=>t.node(e).rank+=i))}))},simplify:function(t){let e=(new ii).setGraph(t.graph());return t.nodes().forEach((n=>e.setNode(n,t.node(n)))),t.edges().forEach((n=>{let r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},successorWeights:function(t){let e=t.nodes().map((e=>{let n={};return t.outEdges(e).forEach((e=>{n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return fi(t.nodes(),e)},time:function(t,e){let n=Date.now();try{return e()}finally{console.log(t+" time: "+(Date.now()-n)+"ms")}},uniqueId:ci,zipObject:fi};function oi(t,e,n,r){let i;do{i=ci(r)}while(t.hasNode(i));return n.dummy=e,t.setNode(i,n),i}const hi=65535;function ai(t,e){if(e.length>hi){const n=function(t,e=hi){const n=[];for(let r=0;r<t.length;r+=e){const i=t.slice(r,r+e);n.push(i)}return n}(e);return t.apply(null,n.map((e=>t.apply(null,e))))}return t.apply(null,e)}function ui(t){const e=t.nodes().map((e=>{let n=t.node(e).rank;return void 0===n?Number.MIN_VALUE:n}));return ai(Math.max,e)}let li=0;function ci(t){var e=++li;return toString(t)+e}function di(t,e,n=1){null==e&&(e=t,t=0);let r=t=>t<e;n<0&&(r=t=>e<t);const i=[];for(let s=t;r(s);s+=n)i.push(s);return i}function fi(t,e){return t.reduce(((t,n,r)=>(t[n]=e[r],t)),{})}let pi=ti,mi=si.uniqueId;var gi={run:function(t){("greedy"===t.graph().acyclicer?pi(t,(e=t,t=>e.edge(t).weight)):function(t){let e=[],n={},r={};function i(s){Object.hasOwn(r,s)||(r[s]=!0,n[s]=!0,t.outEdges(s).forEach((t=>{Object.hasOwn(n,t.w)?e.push(t):i(t.w)})),delete n[s])}return t.nodes().forEach(i),e}(t)).forEach((e=>{let n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,mi("rev"))}));var e},undo:function(t){t.edges().forEach((e=>{let n=t.edge(e);if(n.reversed){t.removeEdge(e);let r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}};let yi=si;var wi={run:function(t){t.graph().dummyChains=[],t.edges().forEach((e=>function(t,e){let n,r,i,s=e.v,o=t.node(s).rank,h=e.w,a=t.node(h).rank,u=e.name,l=t.edge(e),c=l.labelRank;if(a===o+1)return;for(t.removeEdge(e),i=0,++o;o<a;++i,++o)l.points=[],r={width:0,height:0,edgeLabel:l,edgeObj:e,rank:o},n=yi.addDummyNode(t,"edge",r,"_d"),o===c&&(r.width=l.width,r.height=l.height,r.dummy="edge-label",r.labelpos=l.labelpos),t.setEdge(s,n,{weight:l.weight},u),0===i&&t.graph().dummyChains.push(n),s=n;t.setEdge(s,h,{weight:l.weight},u)}(t,e)))},undo:function(t){t.graph().dummyChains.forEach((e=>{let n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}};const{applyWithChunking:bi}=si;var xi={longestPath:function(t){var e={};t.sources().forEach((function n(r){var i=t.node(r);if(Object.hasOwn(e,r))return i.rank;e[r]=!0;let s=t.outEdges(r).map((e=>null==e?Number.POSITIVE_INFINITY:n(e.w)-t.edge(e).minlen));var o=bi(Math.min,s);return o===Number.POSITIVE_INFINITY&&(o=0),i.rank=o}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}};var vi=Zr.Graph,_i=xi.slack,Ei=function(t){var e,n,r=new vi({directed:!1}),i=t.nodes()[0],s=t.nodeCount();r.setNode(i,{});for(;Ci(r,t)<s;)e=Oi(r,t),n=r.hasNode(e.v)?_i(t,e):-_i(t,e),Mi(r,t,n);return r};function Ci(t,e){return t.nodes().forEach((function n(r){e.nodeEdges(r).forEach((i=>{var s=i.v,o=r===s?i.w:s;t.hasNode(o)||_i(e,i)||(t.setNode(o,{}),t.setEdge(r,o,{}),n(o))}))})),t.nodeCount()}function Oi(t,e){return e.edges().reduce(((n,r)=>{let i=Number.POSITIVE_INFINITY;return t.hasNode(r.v)!==t.hasNode(r.w)&&(i=_i(e,r)),i<n[0]?[i,r]:n}),[Number.POSITIVE_INFINITY,null])[1]}function Mi(t,e,n){t.nodes().forEach((t=>e.node(t).rank+=n))}var ki=Ei,Si=xi.slack,Ni=xi.longestPath,Ai=Zr.alg.preorder,Ti=Zr.alg.postorder,ji=si.simplify,Ii=Li;function Li(t){t=ji(t),Ni(t);var e,n=ki(t);for(Di(n),Ri(n,t);e=Fi(n);)Yi(n,t,e,$i(n,t,e))}function Ri(t,e){var n=Ti(t,t.nodes());(n=n.slice(0,n.length-1)).forEach((n=>function(t,e,n){var r=t.node(n),i=r.parent;t.edge(n,i).cutvalue=Pi(t,e,n)}(t,e,n)))}function Pi(t,e,n){var r=t.node(n).parent,i=!0,s=e.edge(n,r),o=0;return s||(i=!1,s=e.edge(r,n)),o=s.weight,e.nodeEdges(n).forEach((s=>{var h,a,u=s.v===n,l=u?s.w:s.v;if(l!==r){var c=u===i,d=e.edge(s).weight;if(o+=c?d:-d,h=n,a=l,t.hasEdge(h,a)){var f=t.edge(n,l).cutvalue;o+=c?-f:f}}})),o}function Di(t,e){arguments.length<2&&(e=t.nodes()[0]),zi(t,{},1,e)}function zi(t,e,n,r,i){var s=n,o=t.node(r);return e[r]=!0,t.neighbors(r).forEach((i=>{Object.hasOwn(e,i)||(n=zi(t,e,n,i,r))})),o.low=s,o.lim=n++,i?o.parent=i:delete o.parent,n}function Fi(t){return t.edges().find((e=>t.edge(e).cutvalue<0))}function $i(t,e,n){var r=n.v,i=n.w;e.hasEdge(r,i)||(r=n.w,i=n.v);var s=t.node(r),o=t.node(i),h=s,a=!1;return s.lim>o.lim&&(h=o,a=!0),e.edges().filter((e=>a===Xi(t,t.node(e.v),h)&&a!==Xi(t,t.node(e.w),h))).reduce(((t,n)=>Si(e,n)<Si(e,t)?n:t))}function Yi(t,e,n,r){var i=n.v,s=n.w;t.removeEdge(i,s),t.setEdge(r.v,r.w,{}),Di(t),Ri(t,e),function(t,e){var n=t.nodes().find((t=>!e.node(t).parent)),r=Ai(t,n);(r=r.slice(1)).forEach((n=>{var r=t.node(n).parent,i=e.edge(n,r),s=!1;i||(i=e.edge(r,n),s=!0),e.node(n).rank=e.node(r).rank+(s?i.minlen:-i.minlen)}))}(t,e)}function Xi(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}Li.initLowLimValues=Di,Li.initCutValues=Ri,Li.calcCutValue=Pi,Li.leaveEdge=Fi,Li.enterEdge=$i,Li.exchangeEdges=Yi;var Gi=xi.longestPath,qi=Ei,Bi=Ii,Vi=function(t){switch(t.graph().ranker){case"network-simplex":default:Wi(t);break;case"tight-tree":!function(t){Gi(t),qi(t)}(t);break;case"longest-path":Hi(t)}};var Hi=Gi;function Wi(t){Bi(t)}let Zi=si;function Ui(t,e,n,r,i,s,o){let h=t.children(o);if(!h.length)return void(o!==e&&t.setEdge(e,o,{weight:0,minlen:n}));let a=Zi.addBorderNode(t,"_bt"),u=Zi.addBorderNode(t,"_bb"),l=t.node(o);t.setParent(a,o),l.borderTop=a,t.setParent(u,o),l.borderBottom=u,h.forEach((h=>{Ui(t,e,n,r,i,s,h);let l=t.node(h),c=l.borderTop?l.borderTop:h,d=l.borderBottom?l.borderBottom:h,f=l.borderTop?r:2*r,p=c!==d?1:i-s[o]+1;t.setEdge(a,c,{weight:f,minlen:p,nestingEdge:!0}),t.setEdge(d,u,{weight:f,minlen:p,nestingEdge:!0})})),t.parent(o)||t.setEdge(e,a,{weight:0,minlen:i+s[o]})}let Qi=si;function Ki(t,e,n,r,i,s){let o={width:0,height:0,rank:s,borderType:e},h=i[e][s-1],a=Qi.addDummyNode(t,"border",o,n);i[e][s]=a,t.setParent(a,r),h&&t.setEdge(h,a,{weight:1})}function Ji(t){t.nodes().forEach((e=>ts(t.node(e)))),t.edges().forEach((e=>ts(t.edge(e))))}function ts(t){let e=t.width;t.width=t.height,t.height=e}function es(t){t.y=-t.y}function ns(t){let e=t.x;t.x=t.y,t.y=e}let rs=si;let is=si.zipObject;function ss(t,e,n){let r=is(n,n.map(((t,e)=>e))),i=e.flatMap((e=>t.outEdges(e).map((e=>({pos:r[e.w],weight:t.edge(e).weight}))).sort(((t,e)=>t.pos-e.pos)))),s=1;for(;s<n.length;)s<<=1;let o=2*s-1;s-=1;let h=new Array(o).fill(0),a=0;return i.forEach((t=>{let e=t.pos+s;h[e]+=t.weight;let n=0;for(;e>0;)e%2&&(n+=h[e+1]),e=e-1>>1,h[e]+=t.weight;a+=t.weight*n})),a}let os=si;let hs=si;function as(t,e,n){let r;for(;e.length&&(r=e[e.length-1]).i<=n;)e.pop(),t.push(r.vs),n++;return n}let us=function(t,e=[]){return e.map((e=>{let n=t.inEdges(e);if(n.length){let r=n.reduce(((e,n)=>{let r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:r.sum/r.weight,weight:r.weight}}return{v:e}}))},ls=function(t,e){let n={};return t.forEach(((t,e)=>{let r=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};void 0!==t.barycenter&&(r.barycenter=t.barycenter,r.weight=t.weight)})),e.edges().forEach((t=>{let e=n[t.v],r=n[t.w];void 0!==e&&void 0!==r&&(r.indegree++,e.out.push(n[t.w]))})),function(t){let e=[];function n(t){return e=>{e.merged||(void 0===e.barycenter||void 0===t.barycenter||e.barycenter>=t.barycenter)&&function(t,e){let n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function r(e){return n=>{n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){let i=t.pop();e.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return e.filter((t=>!t.merged)).map((t=>os.pick(t,["vs","i","barycenter","weight"])))}(Object.values(n).filter((t=>!t.indegree)))},cs=function(t,e){let n=hs.partition(t,(t=>Object.hasOwn(t,"barycenter"))),r=n.lhs,i=n.rhs.sort(((t,e)=>e.i-t.i)),s=[],o=0,h=0,a=0;r.sort((u=!!e,(t,e)=>t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:u?e.i-t.i:t.i-e.i)),a=as(s,i,a),r.forEach((t=>{a+=t.vs.length,s.push(t.vs),o+=t.barycenter*t.weight,h+=t.weight,a=as(s,i,a)}));var u;let l={vs:s.flat(!0)};h&&(l.barycenter=o/h,l.weight=h);return l};var ds=function t(e,n,r,i){let s=e.children(n),o=e.node(n),h=o?o.borderLeft:void 0,a=o?o.borderRight:void 0,u={};h&&(s=s.filter((t=>t!==h&&t!==a)));let l=us(e,s);l.forEach((n=>{if(e.children(n.v).length){let h=t(e,n.v,r,i);u[n.v]=h,Object.hasOwn(h,"barycenter")&&(o=h,void 0!==(s=n).barycenter?(s.barycenter=(s.barycenter*s.weight+o.barycenter*o.weight)/(s.weight+o.weight),s.weight+=o.weight):(s.barycenter=o.barycenter,s.weight=o.weight))}var s,o}));let c=ls(l,r);!function(t,e){t.forEach((t=>{t.vs=t.vs.flatMap((t=>e[t]?e[t].vs:t))}))}(c,u);let d=cs(c,i);if(h&&(d.vs=[h,d.vs,a].flat(!0),e.predecessors(h).length)){let t=e.node(e.predecessors(h)[0]),n=e.node(e.predecessors(a)[0]);Object.hasOwn(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+t.order+n.order)/(d.weight+2),d.weight+=2}return d};let fs=Zr.Graph,ps=si;let ms=function(t){let e={},n=t.nodes().filter((e=>!t.children(e).length)),r=n.map((e=>t.node(e).rank)),i=rs.applyWithChunking(Math.max,r),s=rs.range(i+1).map((()=>[]));return n.sort(((e,n)=>t.node(e).rank-t.node(n).rank)).forEach((function n(r){if(e[r])return;e[r]=!0;let i=t.node(r);s[i.rank].push(r),t.successors(r).forEach(n)})),s},gs=function(t,e){let n=0;for(let r=1;r<e.length;++r)n+=ss(t,e[r-1],e[r]);return n},ys=ds,ws=function(t,e,n){let r=function(t){var e;for(;t.hasNode(e=ps.uniqueId("_root")););return e}(t),i=new fs({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((e=>t.node(e)));return t.nodes().forEach((s=>{let o=t.node(s),h=t.parent(s);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(s),i.setParent(s,h||r),t[n](s).forEach((e=>{let n=e.v===s?e.w:e.v,r=i.edge(n,s),o=void 0!==r?r.weight:0;i.setEdge(n,s,{weight:t.edge(e).weight+o})})),Object.hasOwn(o,"minRank")&&i.setNode(s,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))})),i},bs=function(t,e,n){let r,i={};n.forEach((n=>{let s,o,h=t.parent(n);for(;h;){if(s=t.parent(h),s?(o=i[s],i[s]=h):(o=r,r=h),o&&o!==h)return void e.setEdge(o,h);h=s}}))},xs=Zr.Graph,vs=si;var _s=function t(e,n){if(n&&"function"==typeof n.customOrder)return void n.customOrder(e,t);let r=vs.maxRank(e),i=Es(e,vs.range(1,r+1),"inEdges"),s=Es(e,vs.range(r-1,-1,-1),"outEdges"),o=ms(e);if(Os(e,o),n&&n.disableOptimalOrderHeuristic)return;let h,a=Number.POSITIVE_INFINITY;for(let u=0,l=0;l<4;++u,++l){Cs(u%2?i:s,u%4>=2),o=vs.buildLayerMatrix(e);let t=gs(e,o);t<a&&(l=0,h=Object.assign({},o),a=t)}Os(e,h)};function Es(t,e,n){return e.map((function(e){return ws(t,e,n)}))}function Cs(t,e){let n=new xs;t.forEach((function(t){let r=t.graph().root,i=ys(t,r,n,e);i.vs.forEach(((e,n)=>t.node(e).order=n)),bs(t,n,i.vs)}))}function Os(t,e){Object.values(e).forEach((e=>e.forEach(((e,n)=>t.node(e).order=n))))}let Ms=Zr.Graph,ks=si;var Ss=function(t){let e,n=ks.buildLayerMatrix(t),r=Object.assign(Ns(t,n),As(t,n)),i={};["u","d"].forEach((s=>{e="u"===s?n:Object.values(n).reverse(),["l","r"].forEach((n=>{"r"===n&&(e=e.map((t=>Object.values(t).reverse())));let o=("u"===s?t.predecessors:t.successors).bind(t),h=Is(t,e,r,o),a=Ls(t,e,h.root,h.align,"r"===n);"r"===n&&(a=ks.mapValues(a,(t=>-t))),i[s+n]=a}))}));let s=Rs(t,i);return Ps(i,s),Ds(i,t.graph().align)};function Ns(t,e){let n={};return e.length&&e.reduce((function(e,r){let i=0,s=0,o=e.length,h=r[r.length-1];return r.forEach(((e,a)=>{let u=function(t,e){if(t.node(e).dummy)return t.predecessors(e).find((e=>t.node(e).dummy))}(t,e),l=u?t.node(u).order:o;(u||e===h)&&(r.slice(s,a+1).forEach((e=>{t.predecessors(e).forEach((r=>{let s=t.node(r),o=s.order;!(o<i||l<o)||s.dummy&&t.node(e).dummy||Ts(n,r,e)}))})),s=a+1,i=l)})),r})),n}function As(t,e){let n={};function r(e,r,i,s,o){let h;ks.range(r,i).forEach((r=>{h=e[r],t.node(h).dummy&&t.predecessors(h).forEach((e=>{let r=t.node(e);r.dummy&&(r.order<s||r.order>o)&&Ts(n,e,h)}))}))}return e.length&&e.reduce((function(e,n){let i,s=-1,o=0;return n.forEach(((h,a)=>{if("border"===t.node(h).dummy){let e=t.predecessors(h);e.length&&(i=t.node(e[0]).order,r(n,o,a,s,i),o=a,s=i)}r(n,o,n.length,i,e.length)})),n})),n}function Ts(t,e,n){if(e>n){let t=e;e=n,n=t}let r=t[e];r||(t[e]=r={}),r[n]=!0}function js(t,e,n){if(e>n){let t=e;e=n,n=t}return!!t[e]&&Object.hasOwn(t[e],n)}function Is(t,e,n,r){let i={},s={},o={};return e.forEach((t=>{t.forEach(((t,e)=>{i[t]=t,s[t]=t,o[t]=e}))})),e.forEach((t=>{let e=-1;t.forEach((t=>{let h=r(t);if(h.length){h=h.sort(((t,e)=>o[t]-o[e]));let r=(h.length-1)/2;for(let a=Math.floor(r),u=Math.ceil(r);a<=u;++a){let r=h[a];s[t]===t&&e<o[r]&&!js(n,t,r)&&(s[r]=t,s[t]=i[t]=i[r],e=o[r])}}}))})),{root:i,align:s}}function Ls(t,e,n,r,i){let s={},o=function(t,e,n,r){let i=new Ms,s=t.graph(),o=function(t,e,n){return(r,i,s)=>{let o,h=r.node(i),a=r.node(s),u=0;if(u+=h.width/2,Object.hasOwn(h,"labelpos"))switch(h.labelpos.toLowerCase()){case"l":o=-h.width/2;break;case"r":o=h.width/2}if(o&&(u+=n?o:-o),o=0,u+=(h.dummy?e:t)/2,u+=(a.dummy?e:t)/2,u+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":o=a.width/2;break;case"r":o=-a.width/2}return o&&(u+=n?o:-o),o=0,u}}(s.nodesep,s.edgesep,r);return e.forEach((e=>{let r;e.forEach((e=>{let s=n[e];if(i.setNode(s),r){var h=n[r],a=i.edge(h,s);i.setEdge(h,s,Math.max(o(t,e,r),a||0))}r=e}))})),i}(t,e,n,i),h=i?"borderLeft":"borderRight";function a(t,e){let n=o.nodes(),r=n.pop(),i={};for(;r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return a((function(t){s[t]=o.inEdges(t).reduce(((t,e)=>Math.max(t,s[e.v]+o.edge(e))),0)}),o.predecessors.bind(o)),a((function(e){let n=o.outEdges(e).reduce(((t,e)=>Math.min(t,s[e.w]-o.edge(e))),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==h&&(s[e]=Math.max(s[e],n))}),o.successors.bind(o)),Object.keys(r).forEach((t=>s[t]=s[n[t]])),s}function Rs(t,e){return Object.values(e).reduce(((e,n)=>{let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(n).forEach((([e,n])=>{let s=function(t,e){return t.node(e).width}(t,e)/2;r=Math.max(n+s,r),i=Math.min(n-s,i)}));const s=r-i;return s<e[0]&&(e=[s,n]),e}),[Number.POSITIVE_INFINITY,null])[1]}function Ps(t,e){let n=Object.values(e),r=ks.applyWithChunking(Math.min,n),i=ks.applyWithChunking(Math.max,n);["u","d"].forEach((n=>{["l","r"].forEach((s=>{let o=n+s,h=t[o];if(h===e)return;let a=Object.values(h),u=r-ks.applyWithChunking(Math.min,a);"l"!==s&&(u=i-ks.applyWithChunking(Math.max,a)),u&&(t[o]=ks.mapValues(h,(t=>t+u)))}))}))}function Ds(t,e){return ks.mapValues(t.ul,((n,r)=>{if(e)return t[e.toLowerCase()][r];{let e=Object.values(t).map((t=>t[r])).sort(((t,e)=>t-e));return(e[1]+e[2])/2}}))}let zs=si,Fs=Ss;let $s=gi,Ys=wi,Xs=Vi,Gs=si.normalizeRanks,qs=function(t){let e=function(t){let e={},n=0;function r(i){let s=n;t.children(i).forEach(r),e[i]={low:s,lim:n++}}return t.children().forEach(r),e}(t);t.graph().dummyChains.forEach((n=>{let r=t.node(n),i=r.edgeObj,s=function(t,e,n,r){let i,s,o=[],h=[],a=Math.min(e[n].low,e[r].low),u=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),o.push(i)}while(i&&(e[i].low>a||u>e[i].lim));s=i,i=r;for(;(i=t.parent(i))!==s;)h.push(i);return{path:o.concat(h.reverse()),lca:s}}(t,e,i.v,i.w),o=s.path,h=s.lca,a=0,u=o[a],l=!0;for(;n!==i.w;){if(r=t.node(n),l){for(;(u=o[a])!==h&&t.node(u).maxRank<r.rank;)a++;u===h&&(l=!1)}if(!l){for(;a<o.length-1&&t.node(u=o[a+1]).minRank<=r.rank;)a++;u=o[a]}t.setParent(n,u),n=t.successors(n)[0]}}))},Bs=si.removeEmptyRanks,Vs={run:function(t){let e=Zi.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(r,i){var s=t.children(r);s&&s.length&&s.forEach((t=>n(t,i+1))),e[r]=i}return t.children().forEach((t=>n(t,1))),e}(t),r=Object.values(n),i=Zi.applyWithChunking(Math.max,r)-1,s=2*i+1;t.graph().nestingRoot=e,t.edges().forEach((e=>t.edge(e).minlen*=s));let o=function(t){return t.edges().reduce(((e,n)=>e+t.edge(n).weight),0)}(t)+1;t.children().forEach((r=>Ui(t,e,s,o,i,n,r))),t.graph().nodeRankFactor=s},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,t.edges().forEach((e=>{t.edge(e).nestingEdge&&t.removeEdge(e)}))}},Hs=function(t){t.children().forEach((function e(n){let r=t.children(n),i=t.node(n);if(r.length&&r.forEach(e),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let e=i.minRank,r=i.maxRank+1;e<r;++e)Ki(t,"borderLeft","_bl",n,i,e),Ki(t,"borderRight","_br",n,i,e)}}))},Ws={adjust:function(t){let e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||Ji(t)},undo:function(t){let e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){t.nodes().forEach((e=>es(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);n.points.forEach(es),Object.hasOwn(n,"y")&&es(n)}))}(t);"lr"!==e&&"rl"!==e||(!function(t){t.nodes().forEach((e=>ns(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);n.points.forEach(ns),Object.hasOwn(n,"x")&&ns(n)}))}(t),Ji(t))}},Zs=_s,Us=function(t){(function(t){let e=zs.buildLayerMatrix(t),n=t.graph().ranksep,r=0;e.forEach((e=>{const i=e.reduce(((e,n)=>{const r=t.node(n).height;return e>r?e:r}),0);e.forEach((e=>t.node(e).y=r+i/2)),r+=i+n}))})(t=zs.asNonCompoundGraph(t)),Object.entries(Fs(t)).forEach((([e,n])=>t.node(e).x=n))},Qs=si,Ks=Zr.Graph;var Js=function(t,e){let n=e&&e.debugTiming?Qs.time:Qs.notime;n("layout",(()=>{let r=n(" buildLayoutGraph",(()=>function(t){let e=new Ks({multigraph:!0,compound:!0}),n=uo(t.graph());return e.setGraph(Object.assign({},eo,ao(n,to),Qs.pick(n,no))),t.nodes().forEach((n=>{const r=ao(uo(t.node(n)),ro);Object.keys(io).forEach((t=>{void 0===r[t]&&(r[t]=io[t])})),e.setNode(n,r),e.setParent(n,t.parent(n))})),t.edges().forEach((n=>{let r=uo(t.edge(n));e.setEdge(n,Object.assign({},oo,ao(r,so),Qs.pick(r,ho)))})),e}(t)));n(" runLayout",(()=>function(t,e,n){e(" makeSpaceForEdgeLabels",(()=>function(t){let e=t.graph();e.ranksep/=2,t.edges().forEach((n=>{let r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t))),e(" removeSelfEdges",(()=>function(t){t.edges().forEach((e=>{if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t))),e(" acyclic",(()=>$s.run(t))),e(" nestingGraph.run",(()=>Vs.run(t))),e(" rank",(()=>Xs(Qs.asNonCompoundGraph(t)))),e(" injectEdgeLabelProxies",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);if(n.width&&n.height){let n=t.node(e.v),r={rank:(t.node(e.w).rank-n.rank)/2+n.rank,e:e};Qs.addDummyNode(t,"edge-proxy",r,"_ep")}}))}(t))),e(" removeEmptyRanks",(()=>Bs(t))),e(" nestingGraph.cleanup",(()=>Vs.cleanup(t))),e(" normalizeRanks",(()=>Gs(t))),e(" assignRankMinMax",(()=>function(t){let e=0;t.nodes().forEach((n=>{let r=t.node(n);r.borderTop&&(r.minRank=t.node(r.borderTop).rank,r.maxRank=t.node(r.borderBottom).rank,e=Math.max(e,r.maxRank))})),t.graph().maxRank=e}(t))),e(" removeEdgeLabelProxies",(()=>function(t){t.nodes().forEach((e=>{let n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t))),e(" normalize.run",(()=>Ys.run(t))),e(" parentDummyChains",(()=>qs(t))),e(" addBorderSegments",(()=>Hs(t))),e(" order",(()=>Zs(t,n))),e(" insertSelfEdges",(()=>function(t){var e=Qs.buildLayerMatrix(t);e.forEach((e=>{var n=0;e.forEach(((e,r)=>{var i=t.node(e);i.order=r+n,(i.selfEdges||[]).forEach((e=>{Qs.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:i.rank,order:r+ ++n,e:e.e,label:e.label},"_se")})),delete i.selfEdges}))}))}(t))),e(" adjustCoordinateSystem",(()=>Ws.adjust(t))),e(" position",(()=>Us(t))),e(" positionSelfEdges",(()=>function(t){t.nodes().forEach((e=>{var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,s=r.y,o=n.x-i,h=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*o/3,y:s-h},{x:i+5*o/6,y:s-h},{x:i+o,y:s},{x:i+5*o/6,y:s+h},{x:i+2*o/3,y:s+h}],n.label.x=n.x,n.label.y=n.y}}))}(t))),e(" removeBorderNodes",(()=>function(t){t.nodes().forEach((e=>{if(t.children(e).length){let n=t.node(e),r=t.node(n.borderTop),i=t.node(n.borderBottom),s=t.node(n.borderLeft[n.borderLeft.length-1]),o=t.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-s.x),n.height=Math.abs(i.y-r.y),n.x=s.x+n.width/2,n.y=r.y+n.height/2}})),t.nodes().forEach((e=>{"border"===t.node(e).dummy&&t.removeNode(e)}))}(t))),e(" normalize.undo",(()=>Ys.undo(t))),e(" fixupEdgeLabelCoords",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);if(Object.hasOwn(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t))),e(" undoCoordinateSystem",(()=>Ws.undo(t))),e(" translateGraph",(()=>function(t){let e=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,s=t.graph(),o=s.marginx||0,h=s.marginy||0;function a(t){let s=t.x,o=t.y,h=t.width,a=t.height;e=Math.min(e,s-h/2),n=Math.max(n,s+h/2),r=Math.min(r,o-a/2),i=Math.max(i,o+a/2)}t.nodes().forEach((e=>a(t.node(e)))),t.edges().forEach((e=>{let n=t.edge(e);Object.hasOwn(n,"x")&&a(n)})),e-=o,r-=h,t.nodes().forEach((n=>{let i=t.node(n);i.x-=e,i.y-=r})),t.edges().forEach((n=>{let i=t.edge(n);i.points.forEach((t=>{t.x-=e,t.y-=r})),Object.hasOwn(i,"x")&&(i.x-=e),Object.hasOwn(i,"y")&&(i.y-=r)})),s.width=n-e+o,s.height=i-r+h}(t))),e(" assignNodeIntersects",(()=>function(t){t.edges().forEach((e=>{let n,r,i=t.edge(e),s=t.node(e.v),o=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=o,r=s),i.points.unshift(Qs.intersectRect(s,n)),i.points.push(Qs.intersectRect(o,r))}))}(t))),e(" reversePoints",(()=>function(t){t.edges().forEach((e=>{let n=t.edge(e);n.reversed&&n.points.reverse()}))}(t))),e(" acyclic.undo",(()=>$s.undo(t)))}(r,n,e))),n(" updateInputGraph",(()=>function(t,e){t.nodes().forEach((n=>{let r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,r.rank=i.rank,e.children(n).length&&(r.width=i.width,r.height=i.height))})),t.edges().forEach((n=>{let r=t.edge(n),i=e.edge(n);r.points=i.points,Object.hasOwn(i,"x")&&(r.x=i.x,r.y=i.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,r)))}))};let to=["nodesep","edgesep","ranksep","marginx","marginy"],eo={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},no=["acyclicer","ranker","rankdir","align"],ro=["width","height"],io={width:0,height:0},so=["minlen","weight","width","height","labeloffset"],oo={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ho=["labelpos"];function ao(t,e){return Qs.mapValues(Qs.pick(t,e),Number)}function uo(t){var e={};return t&&Object.entries(t).forEach((([t,n])=>{"string"==typeof t&&(t=t.toLowerCase()),e[t]=n})),e}let lo=si,co=Zr.Graph;var fo={graphlib:Zr,layout:Js,debug:{debugOrdering:function(t){let e=lo.buildLayerMatrix(t),n=new co({compound:!0,multigraph:!0}).setGraph({});return t.nodes().forEach((e=>{n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),t.edges().forEach((t=>n.setEdge(t.v,t.w,{},t.name))),e.forEach(((t,e)=>{let r="layer"+e;n.setNode(r,{rank:"same"}),t.reduce(((t,e)=>(n.setEdge(t,e,{style:"invis"}),e)))})),n}},util:{time:si.time,notime:si.notime},version:"1.1.4"};const po=(t,e,n)=>{const{x:r,y:i}=t,s=e.x,o=e.y,h=(null==n?void 0:n.x)??r,a=(null==n?void 0:n.y)??i,u=s-r<0?-1:1,l=o-i<0?-1:1;let c=Math.abs(s-r)/2<35?Math.abs(s-r)/2:35;c=Math.abs(o-i)/2<c?Math.abs(o-i)/2:c;const d=Math.abs(s-r)/2-c;return[`M ${h} ${a}`,`L ${h} ${i}`,`L ${r} ${i}`,`L ${r+d*u} ${i}`,`C ${r+d*u+c*u} ${i} ${r+d*u+c*u} ${i} ${r+d*u+c*u} ${i+c*l}`,`L ${r+d*u+c*u} ${o-c*l}`,`C ${r+d*u+c*u} ${o} ${r+d*u+c*u} ${o} ${s-d*u} ${o}`,`L ${s} ${o}`].join(" ")},mo=(t,e,n,r={sy:0})=>{const{x:i}=t;let{y:s}=t;const o=e.x,h=e.y,a=(null==n?void 0:n.x)??i,u=(null==n?void 0:n.y)??s,l=o-i<0?-1:1,c=h-s<0?-1:1;s+=r.sy;let d=Math.abs(o-i)/2<35?Math.abs(o-i)/2:35;d=Math.abs(h-s)/2<d?Math.abs(h-s)/2:d;const f=Math.abs(h-s)/2-d;return[`M ${a} ${u}`,`L ${i} ${u}`,`L ${i} ${s}`,`L ${i} ${s+f*c}`,`C ${i} ${s+f*c+d*c} ${i} ${s+f*c+d*c} ${i+d*l} ${s+f*c+d*c}`,`L ${i+(Math.abs(o-i)-2*d)*l+d*l} ${s+f*c+d*c}`,`C ${o} ${s+f*c+d*c} ${o} ${s+f*c+d*c} ${o} ${h-f*c}`,`L ${o} ${h}`].join(" ")},go={bottom:{calculateEdge:mo,edgeMidX:({node:t})=>t.x,edgeMidY:({node:t})=>t.y+t.height/2,edgeParentX:({parent:t})=>t.x,edgeParentY:({parent:t})=>t.y-t.height/2,edgeX:({node:t})=>t.x,edgeY:({node:t})=>t.y+t.height/2,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y,leafHeight:({childLength:t,childrenSpacing:e,nodeHeight:n})=>(n+e)*t,leafWidth:({nodeWidth:t})=>t,leafX:()=>0,leafY:({childrenSpacing:t,index:e,nodeHeight:n})=>(n+t)*-e},left:{calculateEdge:po,edgeMidX:({node:t})=>t.x-t.width/2,edgeMidY:({node:t})=>t.y,edgeParentX:({parent:t})=>t.x+t.width/2,edgeParentY:({parent:t})=>t.y,edgeX:({node:t})=>t.x-t.width/2,edgeY:({node:t})=>t.y,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({nodeHeight:t})=>t,leafWidth:({childLength:t,nodeWidth:e})=>e*t,leafX:({childrenSpacing:t,index:e,nodeWidth:n})=>(n+t)*e,leafY:()=>0},right:{calculateEdge:po,edgeMidX:({node:t})=>t.x+t.width/2,edgeMidY:({node:t})=>t.y,edgeParentX:({parent:t})=>t.x-t.width/2,edgeParentY:({parent:t})=>t.y,edgeX:({node:t})=>t.x+t.width/2,edgeY:({node:t})=>t.y,leafGroupX:({node:t})=>t.x,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({nodeHeight:t})=>t,leafWidth:({childLength:t,nodeWidth:e})=>e*t,leafX:({childrenSpacing:t,index:e,nodeWidth:n})=>(n+t)*-e,leafY:()=>0},top:{calculateEdge:mo,edgeMidX:({node:t})=>t.x,edgeMidY:({node:t})=>t.y-t.height/2,edgeParentX:({parent:t})=>t.x,edgeParentY:({parent:t})=>t.y+t.height/2,edgeX:({node:t})=>t.x,edgeY:({node:t})=>t.y-t.height/2,leafGroupX:({node:t})=>t.x-t.width/2,leafGroupY:({node:t})=>t.y-t.height/2,leafHeight:({childLength:t,childrenSpacing:e,nodeHeight:n})=>(n+e)*t,leafWidth:({nodeWidth:t})=>t,leafX:()=>0,leafY:({childrenSpacing:t,index:e,nodeHeight:n})=>(n+t)*e}},yo={bottom:"BT",left:"LR",right:"RL",top:"TB"},wo={borderColor:"#BCBCBC",borderColorHover:"#5C6BC0",borderRadius:"5px",borderStyle:"solid",borderWidth:1,canvasStyle:"",childrenSpacing:50,containerClassName:"root",contentKey:"name",direction:"top",edgeColor:"#BCBCBC",edgeColorHover:"#5C6BC0",edgeWidth:1,enableExpandCollapse:!1,enableToolbar:!1,enableTooltip:!1,expandCollapseButtonBGColor:"#FFFFFF",expandCollapseButtonBorderColor:"#BCBCBC",fontColor:"#000000",fontFamily:"",fontSize:"14px",fontWeight:"400",groupLeafNodes:!1,groupLeafNodesSpacing:10,height:"auto",highlightOnHover:!0,nodeBGColor:"#FFFFFF",nodeBGColorHover:"#FFFFFF",nodeClassName:"apextree-node",nodeHeight:30,nodeStyle:"",nodeTemplate:t=>`<div style='display: flex;justify-content: center;align-items: center; text-align: center; height: 100%;'>${t}</div>`,nodeWidth:50,onNodeClick:void 0,siblingSpacing:50,tooltipBGColor:"#FFFFFF",tooltipBorderColor:"#BCBCBC",tooltipId:"apextree-tooltip-container",tooltipMaxWidth:100,viewPortHeight:600,viewPortWidth:800,width:"100%"},bo=(t,e={})=>{for(const n in e)null==t||t.setAttribute(n,e[n])},xo=(t,e,n,r,i)=>{const s=null==t?void 0:t.options,o=(null==s?void 0:s.borderWidth)||r.borderWidth;let h=(null==s?void 0:s.borderColor)||r.borderColor,a=(null==s?void 0:s.nodeBGColor)||r.nodeBGColor;n&&(h=(null==s?void 0:s.borderColorHover)||r.borderColorHover,a=(null==s?void 0:s.nodeBGColorHover)||r.nodeBGColorHover);const u=i.querySelector(`[data-self='${t.id}'] foreignObject div`);if(u&&!t.id.endsWith("_leafs")&&(u.style.borderWidth=`${o}px`,u.style.borderColor=h,u.style.backgroundColor=a),t.parent){const s=i.getElementById(`${t.parent}-${t.id}`);bo(s,n?{stroke:r.edgeColorHover,"stroke-width":r.edgeWidth+1}:{stroke:r.edgeColor,"stroke-width":r.edgeWidth}),t.parent&&xo(e[t.parent],e,n,r,i)}};function vo(t,e,n){const{children:r,...i}=t,s={...i,children:r?r.map((t=>t.id)):[],parent:e?e.id:void 0};if(n[s.id]=s,null==r?void 0:r.length)for(const o of r)vo(o,s,n)}function _o(t){const e={};return vo(t,void 0,e),e}const Eo={},Co=[];function Oo(t,e){if(Array.isArray(t))for(const n of t)Oo(n,e);else if("object"!=typeof t)ko(Object.getOwnPropertyNames(e)),Eo[t]=Object.assign(Eo[t]||{},e);else for(const n in t)Oo(n,t[n])}function Mo(t){return Eo[t]||{}}function ko(t){Co.push(...t)}function So(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)i.push(e(t[n]));return i}function No(t){return t%360*Math.PI/180}function Ao(t){return t.charAt(0).toUpperCase()+t.slice(1)}function To(t,e,n,r){return null!=e&&null!=n||(r=r||t.bbox(),null==e?e=r.width/r.height*n:null==n&&(n=r.height/r.width*e)),{width:e,height:n}}function jo(t,e){const n=t.origin;let r=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",i=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([r,i]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const s="string"==typeof r,o="string"==typeof i;if(s||o){const{height:t,width:n,x:h,y:a}=e.bbox();s&&(r=r.includes("left")?h:r.includes("right")?h+n:h+n/2),o&&(i=i.includes("top")?a:i.includes("bottom")?a+t:a+t/2)}return[r,i]}const Io=new Set(["desc","metadata","title"]),Lo=t=>Io.has(t.nodeName),Ro=(t,e,n={})=>{const r={...e};for(const i in r)r[i].valueOf()===n[i]&&delete r[i];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},Po="http://www.w3.org/2000/svg",Do="http://www.w3.org/2000/xmlns/",zo="http://www.w3.org/1999/xlink",Fo={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class $o{}const Yo={},Xo="___SYMBOL___ROOT___";function Go(t,e=Po){return Fo.document.createElementNS(e,t)}function qo(t,e=!1){if(t instanceof $o)return t;if("object"==typeof t)return Ho(t);if(null==t)return new Yo[Xo];if("string"==typeof t&&"<"!==t.charAt(0))return Ho(Fo.document.querySelector(t));const n=e?Fo.document.createElement("div"):Go("svg");return n.innerHTML=t,t=Ho(n.firstChild),n.removeChild(n.firstChild),t}function Bo(t,e){return e&&(e instanceof Fo.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:Go(t)}function Vo(t){if(!t)return null;if(t.instance instanceof $o)return t.instance;if("#document-fragment"===t.nodeName)return new Yo.Fragment(t);let e=Ao(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":Yo[e]||(e="Dom"),new Yo[e](t)}let Ho=Vo;function Wo(t,e=t.name,n=!1){return Yo[e]=t,n&&(Yo[Xo]=t),ko(Object.getOwnPropertyNames(t.prototype)),t}let Zo=1e3;function Uo(t){return"Svgjs"+Ao(t)+Zo++}function Qo(t){for(let e=t.children.length-1;e>=0;e--)Qo(t.children[e]);return t.id?(t.id=Uo(t.nodeName),t):t}function Ko(t,e){let n,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;r>=0;r--)for(n in e)t[r].prototype[n]=e[n]}function Jo(t){return function(...e){const n=e[e.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(n)}}Oo("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=qo(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=qo(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=qo(t)).before(this),this},insertAfter:function(t){return(t=qo(t)).after(this),this}});const th=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,eh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,nh=/rgb\((\d+),(\d+),(\d+)\)/,rh=/(#[a-z_][a-z0-9\-_]*)/i,ih=/\)\s*,?\s*/,sh=/\s/g,oh=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,hh=/^rgb\(/,ah=/^(\s+)?$/,uh=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,lh=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,ch=/[\s,]+/,dh=/[MLHVCSQTAZ]/i;function fh(t){const e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function ph(t,e){for(let n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function mh(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}Oo("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(ch)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(e){return e!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),Oo("Dom",{css:function(t,e){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const e=t.split(/\s*:\s*/);n[e[0]]=e[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const e of t){const t=e;n[e]=this.node.style.getPropertyValue(t)}return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const e in t)this.node.style.setProperty(e,null==t[e]||ah.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||ah.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),Oo("Dom",{data:function(t,e,n){if(null==t)return this.data(So(function(t,e){let n;const r=t.length,i=[];for(n=0;n<r;n++)e(t[n])&&i.push(t[n]);return i}(this.node.attributes,(t=>0===t.nodeName.indexOf("data-"))),(t=>t.nodeName.slice(5))));if(t instanceof Array){const e={};for(const n of t)e[n]=this.data(n);return e}if("object"==typeof t)for(e in t)this.data(e,t[e]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(r){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===n||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),Oo("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(const n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class gh{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof gh||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",e){const{random:n,round:r,sin:i,PI:s}=Math;if("vibrant"===t){const t=24*n()+57,e=38*n()+45,r=360*n();return new gh(t,e,r,"lch")}if("sine"===t){const t=r(80*i(2*s*(e=null==e?n():e)/.5+.01)+150),o=r(50*i(2*s*e/.5+4.6)+200),h=r(100*i(2*s*e/.5+2.3)+150);return new gh(t,o,h)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new gh(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new gh(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new gh(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new gh(t,e,r,"lab")}if("grey"===t){const t=255*n();return new gh(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(oh.test(t)||hh.test(t))}cmyk(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.min(1-r,1-i,1-s);if(1===o)return new gh(0,0,0,1,"cmyk");return new gh((1-r-o)/(1-o),(1-i-o)/(1-o),(1-s-o)/(1-o),o,"cmyk")}hsl(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=Math.max(r,i,s),h=Math.min(r,i,s),a=(o+h)/2,u=o===h,l=o-h;return new gh(360*(u?0:o===r?((i-s)/l+(i<s?6:0))/6:o===i?((s-r)/l+2)/6:o===s?((r-i)/l+4)/6:0),100*(u?0:a>.5?l/(2-o-h):l/(o+h)),100*a,"hsl")}init(t=0,e=0,n=0,r=0,i="rgb"){if(t=t||0,this.space)for(const c in this.space)delete this[this.space[c]];if("number"==typeof t)i="string"==typeof r?r:i,r="string"==typeof r?0:r,Object.assign(this,{_a:t,_b:e,_c:n,_d:r,space:i});else if(t instanceof Array)this.space=e||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,e){const n=ph(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:ph(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:ph(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:ph(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:ph(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:ph(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(t,e);Object.assign(this,n)}else if("string"==typeof t)if(hh.test(t)){const e=t.replace(sh,""),[n,r,i]=nh.exec(e).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}else{if(!oh.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,n,r,i]=eh.exec((s=t,4===s.length?["#",s.substring(1,2),s.substring(1,2),s.substring(2,3),s.substring(2,3),s.substring(3,4),s.substring(3,4)].join(""):s)).map(e);Object.assign(this,{_a:n,_b:r,_c:i,_d:0,space:"rgb"})}}var s;const{_a:o,_b:h,_c:a,_d:u}=this,l="rgb"===this.space?{r:o,g:h,b:a}:"xyz"===this.space?{x:o,y:h,z:a}:"hsl"===this.space?{h:o,s:h,l:a}:"lab"===this.space?{l:o,a:h,b:a}:"lch"===this.space?{l:o,c:h,h:a}:"cmyk"===this.space?{c:o,m:h,y:a,k:u}:{};Object.assign(this,l)}lab(){const{x:t,y:e,z:n}=this.xyz();return new gh(116*e-16,500*(t-e),200*(e-n),"lab")}lch(){const{l:t,a:e,b:n}=this.lab(),r=Math.sqrt(e**2+n**2);let i=180*Math.atan2(n,e)/Math.PI;i<0&&(i*=-1,i=360-i);return new gh(t,r,i,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:r,a:i,b:s}=this;if("lch"===this.space){const{c:t,h:e}=this,n=Math.PI/180;i=t*Math.cos(n*e),s=t*Math.sin(n*e)}const o=(r+16)/116,h=i/500+o,a=o-s/200,u=16/116,l=.008856,c=7.787;t=.95047*(h**3>l?h**3:(h-u)/c),e=1*(o**3>l?o**3:(o-u)/c),n=1.08883*(a**3>l?a**3:(a-u)/c)}const r=3.2406*t+-1.5372*e+-.4986*n,i=-.9689*t+1.8758*e+.0415*n,s=.0557*t+-.204*e+1.057*n,o=Math.pow,h=.0031308,a=r>h?1.055*o(r,1/2.4)-.055:12.92*r,u=i>h?1.055*o(i,1/2.4)-.055:12.92*i,l=s>h?1.055*o(s,1/2.4)-.055:12.92*s;return new gh(255*a,255*u,255*l)}if("hsl"===this.space){let{h:t,s:e,l:n}=this;if(t/=360,e/=100,n/=100,0===e){n*=255;return new gh(n,n,n)}const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*mh(i,r,t+1/3),o=255*mh(i,r,t),h=255*mh(i,r,t-1/3);return new gh(s,o,h)}if("cmyk"===this.space){const{c:t,m:e,y:n,k:r}=this,i=255*(1-Math.min(1,t*(1-r)+r)),s=255*(1-Math.min(1,e*(1-r)+r)),o=255*(1-Math.min(1,n*(1-r)+r));return new gh(i,s,o)}return this;var t}toArray(){const{_a:t,_b:e,_c:n,_d:r,space:i}=this;return[t,e,n,r,i]}toHex(){const[t,e,n]=this._clamped().map(fh);return`#${t}${e}${n}`}toRgb(){const[t,e,n]=this._clamped();return`rgb(${t},${e},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:e,_c:n}=this.rgb(),[r,i,s]=[t,e,n].map((t=>t/255)),o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,h=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,a=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*o+.3576*h+.1805*a)/.95047,l=(.2126*o+.7152*h+.0722*a)/1,c=(.0193*o+.1192*h+.9505*a)/1.08883,d=u>.008856?Math.pow(u,1/3):7.787*u+16/116,f=l>.008856?Math.pow(l,1/3):7.787*l+16/116,p=c>.008856?Math.pow(c,1/3):7.787*c+16/116;return new gh(d,f,p,"xyz")}_clamped(){const{_a:t,_b:e,_c:n}=this.rgb(),{max:r,min:i,round:s}=Math;return[t,e,n].map((t=>r(0,i(s(t),255))))}}class yh{constructor(...t){this.init(...t)}clone(){return new yh(this)}init(t,e){const n=0,r=0,i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e};return this.x=null==i.x?n:i.x,this.y=null==i.y?r:i.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){bh.isMatrixLike(t)||(t=new bh(t));const{x:e,y:n}=this;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}}function wh(t,e,n){return Math.abs(e-t)<1e-6}class bh{constructor(...t){this.init(...t)}static formatTransforms(t){const e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,r=t.flip&&(e||"y"===t.flip)?-1:1,i=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,s=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,o=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,h=t.scale&&t.scale.length?t.scale[1]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleY)?t.scaleY*r:r,a=t.shear||0,u=t.rotate||t.theta||0,l=new yh(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,d=l.y,f=new yh(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=f.x,m=f.y,g=new yh(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=g.x,w=g.y,b=new yh(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:o,scaleY:h,skewX:i,skewY:s,shear:a,theta:u,rx:b.x,ry:b.y,tx:y,ty:w,ox:c,oy:d,px:p,py:m}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,e,n){const r=t.a*e.a+t.c*e.b,i=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,o=t.b*e.c+t.d*e.d,h=t.e+t.a*e.e+t.c*e.f,a=t.f+t.b*e.e+t.d*e.f;return n.a=r,n.b=i,n.c=s,n.d=o,n.e=h,n.f=a,n}around(t,e,n){return this.clone().aroundO(t,e,n)}aroundO(t,e,n){const r=t||0,i=e||0;return this.translateO(-r,-i).lmultiplyO(n).translateO(r,i)}clone(){return new bh(this)}decompose(t=0,e=0){const n=this.a,r=this.b,i=this.c,s=this.d,o=this.e,h=this.f,a=n*s-r*i,u=a>0?1:-1,l=u*Math.sqrt(n*n+r*r),c=Math.atan2(u*r,u*n),d=180/Math.PI*c,f=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/a,g=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:g,shear:m,rotate:d,translateX:o-t+t*f*l+e*(m*f*l-p*g),translateY:h-e+t*p*l+e*(m*p*l+f*g),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const e=new bh(t);return wh(this.a,e.a)&&wh(this.b,e.b)&&wh(this.c,e.c)&&wh(this.d,e.d)&&wh(this.e,e.e)&&wh(this.f,e.f)}flip(t,e){return this.clone().flipO(t,e)}flipO(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}init(t){const e=bh.fromArray([1,0,0,1,0,0]);return t=t instanceof qh?t.matrixify():"string"==typeof t?bh.fromArray(t.split(ch).map(parseFloat)):Array.isArray(t)?bh.fromArray(t):"object"==typeof t&&bh.isMatrixLike(t)?t:"object"==typeof t?(new bh).transform(t):6===arguments.length?bh.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,e=this.b,n=this.c,r=this.d,i=this.e,s=this.f,o=t*r-e*n;if(!o)throw new Error("Cannot invert "+this);const h=r/o,a=-e/o,u=-n/o,l=t/o,c=-(h*i+u*s),d=-(a*i+l*s);return this.a=h,this.b=a,this.c=u,this.d=l,this.e=c,this.f=d,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof bh?t:new bh(t);return bh.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof bh?t:new bh(t);return bh.matrixMultiply(this,e,this)}rotate(t,e,n){return this.clone().rotateO(t,e,n)}rotateO(t,e=0,n=0){t=No(t);const r=Math.cos(t),i=Math.sin(t),{a:s,b:o,c:h,d:a,e:u,f:l}=this;return this.a=s*r-o*i,this.b=o*r+s*i,this.c=h*r-a*i,this.d=a*r+h*i,this.e=u*r-l*i+n*i-e*r+e,this.f=l*r+u*i-e*i-n*r+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t);const{a:i,b:s,c:o,d:h,e:a,f:u}=this;return this.a=i*t,this.b=s*e,this.c=o*t,this.d=h*e,this.e=a*t-n*t+n,this.f=u*e-r*e+r,this}shear(t,e,n){return this.clone().shearO(t,e,n)}shearO(t,e=0,n=0){const{a:r,b:i,c:s,d:o,e:h,f:a}=this;return this.a=r+i*t,this.c=s+o*t,this.e=h+a*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,e=t,n=0,r=0){3===arguments.length&&(r=n,n=e,e=t),t=No(t),e=No(e);const i=Math.tan(t),s=Math.tan(e),{a:o,b:h,c:a,d:u,e:l,f:c}=this;return this.a=o+h*i,this.b=h+o*s,this.c=a+u*i,this.d=u+a*s,this.e=l+c*i-r*i,this.f=c+l*s-n*s,this}skewX(t,e,n){return this.skew(t,0,e,n)}skewY(t,e,n){return this.skew(0,t,e,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(bh.isMatrixLike(t)){return new bh(t).multiplyO(this)}const e=bh.formatTransforms(t),{x:n,y:r}=new yh(e.ox,e.oy).transform(this),i=(new bh).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-n,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(n,r);if(isFinite(e.px)||isFinite(e.py)){const t=new yh(n,r).transform(i),s=isFinite(e.px)?e.px-t.x:0,o=isFinite(e.py)?e.py-t.y:0;i.translateO(s,o)}return i.translateO(e.tx,e.ty),i}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function xh(){if(!xh.nodes){const t=qo().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const e=t.path().node;xh.nodes={svg:t,path:e}}if(!xh.nodes.svg.node.parentNode){const t=Fo.document.body||Fo.document.documentElement;xh.nodes.svg.addTo(t)}return xh.nodes}function vh(t){return!(t.width||t.height||t.x||t.y)}Wo(bh,"Matrix");class _h{constructor(...t){this.init(...t)}addOffset(){return this.x+=Fo.window.pageXOffset,this.y+=Fo.window.pageYOffset,new _h(this)}init(t){return t="string"==typeof t?t.split(ch).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return vh(this)}merge(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x+this.width,t.x+t.width)-e,i=Math.max(this.y+this.height,t.y+t.height)-n;return new _h(e,n,r,i)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof bh||(t=new bh(t));let e=1/0,n=-1/0,r=1/0,i=-1/0;return[new yh(this.x,this.y),new yh(this.x2,this.y),new yh(this.x,this.y2),new yh(this.x2,this.y2)].forEach((function(s){s=s.transform(t),e=Math.min(e,s.x),n=Math.max(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.y)})),new _h(e,r,n-e,i-r)}}function Eh(t,e,n){let r;try{if(r=e(t.node),vh(r)&&((i=t.node)!==Fo.document&&!(Fo.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===Fo.document}).call(Fo.document.documentElement,i)))throw new Error("Element not in the dom")}catch(s){r=n(t)}var i;return r}Oo({viewbox:{viewbox(t,e,n,r){return null==t?new _h(this.attr("viewBox")):this.attr("viewBox",new _h(t,e,n,r))},zoom(t,e){let{width:n,height:r}=this.attr(["width","height"]);if((n||r)&&"string"!=typeof n&&"string"!=typeof r||(n=this.node.clientWidth,r=this.node.clientHeight),!n||!r)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const i=this.viewbox(),s=n/i.width,o=r/i.height,h=Math.min(s,o);if(null==t)return h;let a=h/t;a===1/0&&(a=Number.MAX_SAFE_INTEGER/100),e=e||new yh(n/2/s+i.x,r/2/o+i.y);const u=new _h(i).transform(new bh({scale:a,origin:e}));return this.viewbox(u)}}}),Wo(_h,"Box");class Ch extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}Ko([Ch],{each(t,...e){return"function"==typeof t?this.map(((e,n,r)=>t.call(e,e,n,r))):this.map((n=>n[t](...e)))},toArray(){return Array.prototype.concat.apply([],this)}});const Oh=["toArray","constructor","each"];function Mh(t,e){return new Ch(So((e||Fo.document).querySelectorAll(t),(function(t){return Vo(t)})))}Ch.extend=function(t){t=t.reduce(((t,e)=>(Oh.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),Ko([Ch],t)};let kh=0;const Sh={};function Nh(t){let e=t.getEventHolder();return e===Fo.window&&(e=Sh),e.events||(e.events={}),e.events}function Ah(t){return t.getEventTarget()}function Th(t,e,n,r,i){const s=n.bind(r||t),o=qo(t),h=Nh(o),a=Ah(o);e=Array.isArray(e)?e:e.split(ch),n._svgjsListenerId||(n._svgjsListenerId=++kh),e.forEach((function(t){const e=t.split(".")[0],r=t.split(".")[1]||"*";h[e]=h[e]||{},h[e][r]=h[e][r]||{},h[e][r][n._svgjsListenerId]=s,a.addEventListener(e,s,i||!1)}))}function jh(t,e,n,r){const i=qo(t),s=Nh(i),o=Ah(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(ch)).forEach((function(t){const e=t&&t.split(".")[0],h=t&&t.split(".")[1];let a,u;if(n)s[e]&&s[e][h||"*"]&&(o.removeEventListener(e,s[e][h||"*"][n],r||!1),delete s[e][h||"*"][n]);else if(e&&h){if(s[e]&&s[e][h]){for(u in s[e][h])jh(o,[e,h].join("."),u);delete s[e][h]}}else if(h)for(t in s)for(a in s[t])h===a&&jh(o,[t,h].join("."));else if(e){if(s[e]){for(a in s[e])jh(o,[e,a].join("."));delete s[e]}}else{for(t in s)jh(o,t);!function(t){let e=t.getEventHolder();e===Fo.window&&(e=Sh),e.events&&(e.events={})}(i)}}))}class Ih extends $o{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=Ah(t);return e instanceof Fo.window.Event||(e=new Fo.window.CustomEvent(e,{detail:n,cancelable:!0,...r})),i.dispatchEvent(e),e}(this,t,e,n)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const n=e[t.type];for(const r in n)for(const e in n[r])n[r][e](t);return!t.defaultPrevented}fire(t,e,n){return this.dispatch(t,e,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e,n){return jh(this,t,e,n),this}on(t,e,n,r){return Th(this,t,e,n,r),this}removeEventListener(){}}function Lh(){}Wo(Ih,"EventTarget");const Rh=400,Ph=">",Dh=0,zh={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class Fh extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(ch).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class $h{constructor(...t){this.init(...t)}convert(t){return new $h(this.value,t)}divide(t){return t=new $h(t),new $h(this/t,this.unit||t.unit)}init(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(th))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof $h&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new $h(t),new $h(this-t,this.unit||t.unit)}plus(t){return t=new $h(t),new $h(this+t,this.unit||t.unit)}times(t){return t=new $h(t),new $h(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const Yh=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Xh=[];class Gh extends Ih{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=qo(t)).removeNamespace&&this.node instanceof Fo.window.SVGElement&&t.removeNamespace(),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}addTo(t,e){return qo(t).put(this,e)}children(){return new Ch(So(this.node.children,(function(t){return Vo(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,e=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return e&&(n=Qo(n)),new this.constructor(n)}each(t,e){const n=this.children();let r,i;for(r=0,i=n.length;r<i;r++)t.apply(n[r],[r,n]),e&&n[r].each(t,e);return this}element(t,e){return this.put(new Gh(Go(t),e))}first(){return Vo(this.node.firstChild)}get(t){return Vo(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,e){return this.xml(t,e,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=Uo(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return Vo(this.node.lastChild)}matches(t){const e=this.node,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}parent(t){let e=this;if(!e.node.parentNode)return null;if(e=Vo(e.node.parentNode),!t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=Vo(e.node.parentNode));return e}put(t,e){return t=qo(t),this.add(t,e),t}putIn(t,e){return qo(t).add(this,e)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=qo(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e=null){const n=10**t,r=this.attr(e);for(const i in r)"number"==typeof r[i]&&(r[i]=Math.round(r[i]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,Po)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const e=this.parent();if(!e)return this.addTo(t);const n=e.index(this);return e.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let n=this;if(null!=t){if(n=Vo(n.node.cloneNode(!0)),e){const e=t(n);if(n=e||n,!1===e)return""}n.each((function(){const e=t(this),n=e||this;!1===e?this.remove():e&&this!==n&&this.replace(n)}),!0)}return e?n.node.outerHTML:n.node.innerHTML}e=null!=e&&e;const r=Go("wrapper",n),i=Fo.document.createDocumentFragment();r.innerHTML=t;for(let o=r.children.length;o--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}Ko(Gh,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=uh.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,e)=>(t[e]=this.attr(e),t)),{});if("object"==typeof t&&t.constructor===Object)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?zh[t]:uh.test(e)?parseFloat(e):e;"number"==typeof(e=Xh.reduce(((e,n)=>n(t,e,this)),e))?e=new $h(e):Yh.has(t)&&gh.isColor(e)?e=new gh(e):e.constructor===Array&&(e=new Fh(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return Mh(t,this.node)},findOne:function(t){return Vo(this.node.querySelector(t))}}),Wo(Gh,"Dom");class qh extends Gh{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,e){return this.cx(t).cy(e)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t=0){return this.x(new $h(t).plus(this.x()))}dy(t=0){return this.y(new $h(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,e){return this.x(t).y(e)}parents(t=this.root()){const e="string"==typeof t;e||(t=qo(t));const n=new Ch;let r=this;for(;(r=r.parent())&&r.node!==Fo.document&&"#document-fragment"!==r.nodeName&&(n.push(r),e||r.node!==t.node)&&(!e||!r.matches(t));)if(r.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const e=(t+"").match(rh);return e?qo(e[1]):null}root(){const t=this.parent(Yo[Xo]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=To(this,t,e);return this.width(new $h(n.width)).height(new $h(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return Ro(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}Ko(qh,{bbox:function(){const t=Eh(this,(t=>t.getBBox()),(t=>{try{const e=t.clone().addTo(xh().svg).show(),n=e.node.getBBox();return e.remove(),n}catch(e){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${e.toString()}`)}}));return new _h(t)},rbox:function(t){const e=Eh(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new _h(e);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,e){const n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height},point:function(t,e){return new yh(t,e).transformO(this.screenCTM().inverseO())},ctm:function(){return new bh(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new bh(e)}return new bh(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new bh}}}),Wo(qh,"Element");const Bh={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};["fill","stroke"].forEach((function(t){const e={};let n;e[t]=function(e){if(void 0===e)return this.attr(t);if("string"==typeof e||e instanceof gh||gh.isRgb(e)||e instanceof qh)this.attr(t,e);else for(n=Bh[t].length-1;n>=0;n--)null!=e[Bh[t][n]]&&this.attr(Bh.prefix(t,Bh[t][n]),e[Bh[t][n]]);return this},Oo(["Element","Runner"],e)})),Oo(["Element","Runner"],{matrix:function(t,e,n,r,i,s){return null==t?new bh(this):this.attr("transform",new bh(t,e,n,r,i,s))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:r},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,r){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:r},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t="both",e="center"){return-1==="xybothtrue".indexOf(t)&&(e=t,t="both"),this.transform({flip:t,origin:e},!0)},opacity:function(t){return this.attr("opacity",t)}}),Oo("radius",{radius:function(t,e=t){return"radialGradient"===(this._element||this).type?this.attr("r",new $h(t)):this.rx(t).ry(e)}}),Oo("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new yh(this.node.getPointAtLength(t))}}),Oo(["Element","Runner"],{font:function(t,e){if("object"==typeof t){for(e in t)this.font(e,t[e]);return this}return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e)}});Oo("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,e){return t[e]=function(t){return null===t?this.off(e):this.on(e,t),this},t}),{})),Oo("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(ih).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(ch).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,e){return"matrix"===e[0]?t.lmultiply(bh.fromArray(e[1])):t[e[0]].apply(t,e[1])}),new bh)},toParent:function(t,e){if(this===t)return this;if(Lo(this.node))return this.addTo(t,e);const n=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t,e).untransform().transform(r.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,e){if(null==t||"string"==typeof t){const e=new bh(this).decompose();return null==t?e:e[t]}bh.isMatrixLike(t)||(t={...t,origin:jo(t,this)});const n=new bh(!0===e?this:e||!1).transform(t);return this.attr("transform",n)}});class Vh extends qh{flatten(){return this.each((function(){if(this instanceof Vh)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),e=t.index(this)){return e=-1===e?t.children().length:e,this.each((function(n,r){return r[r.length-n-1].toParent(t,e)})),this.remove()}}Wo(Vh,"Container");class Hh extends Vh{constructor(t,e=t){super(Bo("defs",t),e)}flatten(){return this}ungroup(){return this}}Wo(Hh,"Defs");class Wh extends qh{}function Zh(t){return this.attr("rx",t)}function Uh(t){return this.attr("ry",t)}function Qh(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Kh(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Jh(t){return this.attr("cx",t)}function ta(t){return this.attr("cy",t)}function ea(t){return null==t?2*this.rx():this.rx(new $h(t).divide(2))}function na(t){return null==t?2*this.ry():this.ry(new $h(t).divide(2))}Wo(Wh,"Shape");const ra=Object.freeze(Object.defineProperty({__proto__:null,cx:Jh,cy:ta,height:na,rx:Zh,ry:Uh,width:ea,x:Qh,y:Kh},Symbol.toStringTag,{value:"Module"}));class ia extends Wh{constructor(t,e=t){super(Bo("ellipse",t),e)}size(t,e){const n=To(this,t,e);return this.rx(new $h(n.width).divide(2)).ry(new $h(n.height).divide(2))}}Ko(ia,ra),Oo("Container",{ellipse:Jo((function(t=0,e=t){return this.put(new ia).size(t,e).move(0,0)}))}),Wo(ia,"Ellipse");class sa extends Gh{constructor(t=Fo.document.createDocumentFragment()){super(t)}xml(t,e,n){if("boolean"==typeof t&&(n=e,e=t,t=null),null==t||"function"==typeof t){const t=new Gh(Go("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function oa(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new $h(t),fy:new $h(e)}):this.attr({x1:new $h(t),y1:new $h(e)})}function ha(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new $h(t),cy:new $h(e)}):this.attr({x2:new $h(t),y2:new $h(e)})}Wo(sa,"Fragment");const aa=Object.freeze(Object.defineProperty({__proto__:null,from:oa,to:ha},Symbol.toStringTag,{value:"Module"}));class ua extends Vh{constructor(t,e){super(Bo(t+"Gradient","string"==typeof t?null:t),e)}attr(t,e,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,n)}bbox(){return new _h}targets(){return Mh("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}Ko(ua,aa),Oo({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:Jo((function(t,e){return this.put(new ua(t)).update(e)}))}}),Wo(ua,"Gradient");class la extends Vh{constructor(t,e=t){super(Bo("pattern",t),e)}attr(t,e,n){return"transform"===t&&(t="patternTransform"),super.attr(t,e,n)}bbox(){return new _h}targets(){return Mh("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}Oo({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:Jo((function(t,e,n){return this.put(new la).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),Wo(la,"Pattern");let ca=class extends Wh{constructor(t,e=t){super(Bo("image",t),e)}load(t,e){if(!t)return this;const n=new Fo.window.Image;return Th(n,"load",(function(t){const r=this.parent(la);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof la&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),Th(n,"load error",(function(){jh(n)})),this.attr("href",n.src=t,zo)}};!function(t){Xh.push(t)}((function(t,e,n){return"fill"!==t&&"stroke"!==t||lh.test(e)&&(e=n.root().defs().image(e)),e instanceof ca&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e})),Oo({Container:{image:Jo((function(t,e){return this.put(new ca).size(0,0).load(t,e)}))}}),Wo(ca,"Image");class da extends Fh{bbox(){let t=-1/0,e=-1/0,n=1/0,r=1/0;return this.forEach((function(i){t=Math.max(i[0],t),e=Math.max(i[1],e),n=Math.min(i[0],n),r=Math.min(i[1],r)})),new _h(n,r,t-n,e-r)}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r=this.length-1;r>=0;r--)this[r]=[this[r][0]+t,this[r][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(ch).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,r=t.length;n<r;n+=2)e.push([t[n],t[n+1]]);return e}size(t,e){let n;const r=this.bbox();for(n=this.length-1;n>=0;n--)r.width&&(this[n][0]=(this[n][0]-r.x)*t/r.width+r.x),r.height&&(this[n][1]=(this[n][1]-r.y)*e/r.height+r.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push(this[e].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){bh.isMatrixLike(t)||(t=new bh(t));for(let e=this.length;e--;){const[n,r]=this[e];this[e][0]=t.a*n+t.c*r+t.e,this[e][1]=t.b*n+t.d*r+t.f}return this}}const fa=da;const pa=Object.freeze(Object.defineProperty({__proto__:null,MorphArray:fa,height:function(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)},width:function(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},Symbol.toStringTag,{value:"Module"}));class ma extends Wh{constructor(t,e=t){super(Bo("line",t),e)}array(){return new da([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,e){return this.attr(this.array().move(t,e).toLine())}plot(t,e,n,r){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:r}:new da(t).toLine(),this.attr(t))}size(t,e){const n=To(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}Ko(ma,pa),Oo({Container:{line:Jo((function(...t){return ma.prototype.plot.apply(this.put(new ma),null!=t[0]?t:[0,0,0,0])}))}}),Wo(ma,"Line");class ga extends Vh{constructor(t,e=t){super(Bo("marker",t),e)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function ya(t,e){return function(n){return null==n?this[t]:(this[t]=n,e&&e.call(this),this)}}Oo({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:Jo((function(t,e,n){return this.put(new ga).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)}))},marker:{marker(t,e,n,r){let i=["marker"];return"all"!==t&&i.push(t),i=i.join("-"),t=arguments[1]instanceof ga?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),Wo(ga,"Marker");const wa={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,e,n,r){return function(i){return i<0?t>0?e/t*i:n>0?r/n*i:0:i>1?n<1?(1-r)/(1-n)*i+(r-n)/(1-n):t<1?(1-e)/(1-t)*i+(e-t)/(1-t):1:3*i*(1-i)**2*e+3*i**2*(1-i)*r+i**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let n=t;return"none"===e?--n:"both"===e&&++n,(r,i=!1)=>{let s=Math.floor(r*t);const o=r*s%1==0;return"start"!==e&&"both"!==e||++s,i&&o&&--s,r>=0&&s<0&&(s=0),r<=1&&s>n&&(s=n),s/n}}};class ba{done(){return!1}}class xa extends ba{constructor(t=Ph){super(),this.ease=wa[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class va extends ba{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function _a(){const t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,r=Math.log(e/100+1e-10),i=-r/Math.sqrt(n*n+r*r),s=3.9/(i*t);this.d=2*i*s,this.k=s*s}Ko(class extends va{constructor(t=500,e=0){super(),this.duration(t).overshoot(e)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;n>100&&(n=16),n/=1e3;const i=r.velocity||0,s=-this.d*i-this.k*(t-e),o=t+i*n+s*n*n/2;return r.velocity=i+s*n,r.done=Math.abs(e-o)+Math.abs(i)<.002,r.done?e:o}},{duration:ya("_duration",_a),overshoot:ya("_overshoot",_a)});Ko(class extends va{constructor(t=.1,e=.01,n=0,r=1e3){super(),this.p(t).i(e).d(n).windup(r)}step(t,e,n,r){if("string"==typeof t)return t;if(r.done=n===1/0,n===1/0)return e;if(0===n)return t;const i=e-t;let s=(r.integral||0)+i*n;const o=(i-(r.error||0))/n,h=this._windup;return!1!==h&&(s=Math.max(-h,Math.min(s,h))),r.error=i,r.integral=s,r.done=Math.abs(i)<.001,r.done?e:t+(this.P*i+this.I*s+this.D*o)}},{windup:ya("_windup"),p:ya("P"),i:ya("I"),d:ya("D")});const Ea={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},Ca={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},Oa="mlhvqtcsaz".split("");for(let Ou=0,Mu=Oa.length;Ou<Mu;++Ou)Ca[Oa[Ou]]=function(t){return function(e,n,r){if("H"===t)e[0]=e[0]+n.x;else if("V"===t)e[0]=e[0]+n.y;else if("A"===t)e[5]=e[5]+n.x,e[6]=e[6]+n.y;else for(let t=0,i=e.length;t<i;++t)e[t]=e[t]+(t%2?n.y:n.x);return Ca[t](e,n,r)}}(Oa[Ou].toUpperCase());function Ma(t){return t.segment.length&&t.segment.length-1===Ea[t.segment[0].toUpperCase()]}function ka(t,e){t.inNumber&&Sa(t,!1);const n=dh.test(e);if(n)t.segment=[e];else{const e=t.lastCommand,n=e.toLowerCase(),r=e===n;t.segment=["m"===n?r?"l":"L":e]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function Sa(t,e){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=e,t.number="",t.pointSeen=!1,t.hasExponent=!1,Ma(t)&&Na(t)}function Na(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return Ca[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function Aa(t){if(!t.segment.length)return!1;const e="A"===t.segment[0].toUpperCase(),n=t.segment.length;return e&&(4===n||5===n)}function Ta(t){return"E"===t.lastToken.toUpperCase()}const ja=new Set([" ",",","\t","\n","\r","\f"]);class Ia extends Fh{bbox(){return xh().path.setAttribute("d",this.toString()),new _h(xh.nodes.path.getBBox())}move(t,e){const n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(let r,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]+=t,this[i][2]+=e):"H"===r?this[i][1]+=t:"V"===r?this[i][1]+=e:"C"===r||"S"===r||"Q"===r?(this[i][1]+=t,this[i][2]+=e,this[i][3]+=t,this[i][4]+=e,"C"===r&&(this[i][5]+=t,this[i][6]+=e)):"A"===r&&(this[i][6]+=t,this[i][7]+=e);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,e=!0){let n=0,r="";const i={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:e,p0:new yh,p:new yh};for(;i.lastToken=r,r=t.charAt(n++);)if(i.inSegment||!ka(i,r))if("."!==r)if(isNaN(parseInt(r)))if(ja.has(r))i.inNumber&&Sa(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(dh.test(r)){if(i.inNumber)Sa(i,!1);else{if(!Ma(i))throw new Error("parser Error");Na(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!Ta(i)){Sa(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||Aa(i)){i.inNumber=!0,i.number=r,Sa(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){Sa(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&Sa(i,!1),i.inSegment&&Ma(i)&&Na(i),i.segments}(t)}size(t,e){const n=this.bbox();let r,i;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,r=this.length-1;r>=0;r--)i=this[r][0],"M"===i||"L"===i||"T"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y):"H"===i?this[r][1]=(this[r][1]-n.x)*t/n.width+n.x:"V"===i?this[r][1]=(this[r][1]-n.y)*e/n.height+n.y:"C"===i||"S"===i||"Q"===i?(this[r][1]=(this[r][1]-n.x)*t/n.width+n.x,this[r][2]=(this[r][2]-n.y)*e/n.height+n.y,this[r][3]=(this[r][3]-n.x)*t/n.width+n.x,this[r][4]=(this[r][4]-n.y)*e/n.height+n.y,"C"===i&&(this[r][5]=(this[r][5]-n.x)*t/n.width+n.x,this[r][6]=(this[r][6]-n.y)*e/n.height+n.y)):"A"===i&&(this[r][1]=this[r][1]*t/n.width,this[r][2]=this[r][2]*e/n.height,this[r][6]=(this[r][6]-n.x)*t/n.width+n.x,this[r][7]=(this[r][7]-n.y)*e/n.height+n.y);return this}toString(){return function(t){let e="";for(let n=0,r=t.length;n<r;n++)e+=t[n][0],null!=t[n][1]&&(e+=t[n][1],null!=t[n][2]&&(e+=" ",e+=t[n][2],null!=t[n][3]&&(e+=" ",e+=t[n][3],e+=" ",e+=t[n][4],null!=t[n][5]&&(e+=" ",e+=t[n][5],e+=" ",e+=t[n][6],null!=t[n][7]&&(e+=" ",e+=t[n][7])))));return e+" "}(this)}}const La=t=>{const e=typeof t;return"number"===e?$h:"string"===e?gh.isColor(t)?gh:ch.test(t)?dh.test(t)?Ia:Fh:th.test(t)?$h:Pa:$a.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Fh:"object"===e?Fa:Pa};class Ra{constructor(t){this._stepper=t||new xa("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,e){return t&&e}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(La(t));let e=new this._type(t);return this._type===gh&&(e=this._to?e[this._to[4]]():this._from?e[this._from[4]]():e),this._type===Fa&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(e.length)).map(Object).map((function(t){return t.done=!0,t})),e}}class Pa{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class Da{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,Da.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Da.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const za=(t,e)=>t[0]<e[0]?-1:t[0]>e[0]?1:0;class Fa{constructor(...t){this.init(...t)}align(t){const e=this.values;for(let n=0,r=e.length;n<r;++n){if(e[n+1]===t[n+1]){if(e[n+1]===gh&&t[n+7]!==e[n+7]){const e=t[n+7],r=new gh(this.values.splice(n+3,5))[e]().toArray();this.values.splice(n+3,0,...r)}n+=e[n+2]+2;continue}if(!t[n+1])return this;const r=(new t[n+1]).toArray(),i=e[n+2]+3;e.splice(n,i,t[n],t[n+1],t[n+2],...r),n+=e[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const e=[];for(const n in t){const r=La(t[n]),i=new r(t[n]).toArray();e.push([n,r,i.length,...i])}return e.sort(za),this.values=e.reduce(((t,e)=>t.concat(e)),[]),this}toArray(){return this.values}valueOf(){const t={},e=this.values;for(;e.length;){const n=e.shift(),r=e.shift(),i=e.shift(),s=e.splice(0,i);t[n]=new r(s)}return t}}const $a=[Pa,Da,Fa];class Ya extends Wh{constructor(t,e=t){super(Bo("path",t),e)}array(){return this._array||(this._array=new Ia(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,e){return this.attr("d",this.array().move(t,e))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new Ia(t))}size(t,e){const n=To(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}Ya.prototype.MorphArray=Ia,Oo({Container:{path:Jo((function(t){return this.put(new Ya).plot(t||new Ia)}))}}),Wo(Ya,"Path");const Xa=Object.freeze(Object.defineProperty({__proto__:null,array:function(){return this._array||(this._array=new da(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new da(t))},size:function(t,e){const n=To(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Symbol.toStringTag,{value:"Module"}));class Ga extends Wh{constructor(t,e=t){super(Bo("polygon",t),e)}}Oo({Container:{polygon:Jo((function(t){return this.put(new Ga).plot(t||new da)}))}}),Ko(Ga,pa),Ko(Ga,Xa),Wo(Ga,"Polygon");class qa extends Wh{constructor(t,e=t){super(Bo("polyline",t),e)}}Oo({Container:{polyline:Jo((function(t){return this.put(new qa).plot(t||new da)}))}}),Ko(qa,pa),Ko(qa,Xa),Wo(qa,"Polyline");class Ba extends Wh{constructor(t,e=t){super(Bo("rect",t),e)}}Ko(Ba,{rx:Zh,ry:Uh}),Oo({Container:{rect:Jo((function(t,e){return this.put(new Ba).size(t,e)}))}}),Wo(Ba,"Rect");class Va{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const e=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Ha={nextDraw:null,frames:new Va,timeouts:new Va,immediates:new Va,timer:()=>Fo.window.performance||Fo.window.Date,transforms:[],frame(t){const e=Ha.frames.push({run:t});return null===Ha.nextDraw&&(Ha.nextDraw=Fo.window.requestAnimationFrame(Ha._draw)),e},timeout(t,e){e=e||0;const n=Ha.timer().now()+e,r=Ha.timeouts.push({run:t,time:n});return null===Ha.nextDraw&&(Ha.nextDraw=Fo.window.requestAnimationFrame(Ha._draw)),r},immediate(t){const e=Ha.immediates.push(t);return null===Ha.nextDraw&&(Ha.nextDraw=Fo.window.requestAnimationFrame(Ha._draw)),e},cancelFrame(t){null!=t&&Ha.frames.remove(t)},clearTimeout(t){null!=t&&Ha.timeouts.remove(t)},cancelImmediate(t){null!=t&&Ha.immediates.remove(t)},_draw(t){let e=null;const n=Ha.timeouts.last();for(;(e=Ha.timeouts.shift())&&(t>=e.time?e.run():Ha.timeouts.push(e),e!==n););let r=null;const i=Ha.frames.last();for(;r!==i&&(r=Ha.frames.shift());)r.run(t);let s=null;for(;s=Ha.immediates.shift();)s();Ha.nextDraw=Ha.timeouts.first()||Ha.frames.first()?Fo.window.requestAnimationFrame(Ha._draw):null}},Wa=function(t){const e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Za=function(){const t=Fo.window;return(t.performance||t.Date).now()};class Ua extends Ih{constructor(t=Za){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),e=t?t.runner.duration():0;return(t?t.start:this._time)+e}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const e=this.speed();if(null==t)return this.speed(-e);const n=Math.abs(e);return this.speed(t?-n:n)}schedule(t,e,n){if(null==t)return this._runners.map(Wa);let r=0;const i=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)r=i;else if("absolute"===n||"start"===n)r=e,e=0;else if("now"===n)r=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(r=n.start+e,e=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();r=t?t.start:this._time}}t.unschedule(),t.timeline(this);const s=t.persist(),o={persist:null===s?this._persist:s,start:r+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(o),this._runners.sort(((t,e)=>t.start-e.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Ha.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Ha.frame(this._step)),this)}_stepFn(t=!1){const e=this._timeSource();let n=e-this._lastSourceTime;t&&(n=0);const r=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let s=this._runners.length;s--;){const t=this._runners[s],e=t.runner;this._time-t.start<=0&&e.reset()}let i=!1;for(let s=0,o=this._runners.length;s<o;s++){const t=this._runners[s],e=t.runner;let n=r;const h=this._time-t.start;if(h<=0){i=!0;continue}if(h<n&&(n=h),!e.active())continue;if(e.step(n).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--s,--o)}}else i=!0}return i&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}Oo({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Ua,this._timeline):(this._timeline=t,this)}}});class Qa extends Ih{constructor(t){super(),this.id=Qa.id++,t="function"==typeof(t=null==t?Rh:t)?new va(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof va,this._stepper=this._isDeclarative?t:new xa,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new bh,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,e,n){let r=1,i=!1,s=0;return e=e??Dh,n=n||"last","object"!=typeof(t=t??Rh)||t instanceof ba||(e=t.delay??e,n=t.when??n,i=t.swing||i,r=t.times??r,s=t.wait??s,t=t.duration??Rh),{duration:t,delay:e,swing:i,times:r,wait:s,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,e,n){const r=Qa.sanitise(t,e,n),i=new Qa(r.duration);return this._timeline&&i.timeline(this._timeline),this._element&&i.element(this._element),i.loop(r).schedule(r.delay,r.when)}clearTransform(){return this.transforms=new bh,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new xa(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,e,n){return"object"==typeof t&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const e=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/e),n=(this._time-t*e)/this._duration;return Math.min(t+n,this._times)}const n=t%1,r=e*Math.floor(t)+this._duration*n;return this.time(r)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const e=this._time,n=this._duration,r=this._wait,i=this._times,s=this._swing,o=this._reverse;let h;if(null==t){const t=function(t){const e=s*Math.floor(t%(2*(r+n))/(r+n)),i=e&&!o||!e&&o,h=Math.pow(-1,i)*(t%(r+n))/n+i;return Math.max(Math.min(h,1),0)},a=i*(r+n)-r;return h=e<=0?Math.round(t(1e-5)):e<a?t(e):Math.round(t(a-1e-5)),h}const a=Math.floor(this.loops()),u=s&&a%2==0;return h=a+(u&&!o||o&&u?t:1-t),this.loops(h)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,e,n,r){this._queue.push({initialiser:t||Lh,runner:e||Lh,retarget:n,isTransform:r,initialised:!1,finished:!1});return this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,e,n){if(t instanceof Ua||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;const e=this.position(),n=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;const r=this.duration(),i=this._lastTime<=0&&this._time>0,s=this._lastTime<r&&this._time>=r;this._lastTime=this._time,i&&this.fire("start",this);const o=this._isDeclarative;this.done=!o&&!s&&this._time>=r,this._reseted=!1;let h=!1;return(n||o)&&(this._initialise(n),this.transforms=new bh,h=this._run(o?t:e),this.fire("step",this)),this.done=this.done||h&&o,s&&this.fire("finished",this),this}time(t){if(null==t)return this._time;const e=t-this._time;return this.step(e),this}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let e=0,n=this._queue.length;e<n;++e){const n=this._queue[e],r=this._isDeclarative||!n.initialised&&t;t=!n.finished,r&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let e=!0;for(let n=0,r=this._queue.length;n<r;++n){const r=this._queue[n],i=r.runner.call(this,t);r.finished=r.finished||!0===i,e=e&&r.finished}return e}_tryRetarget(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){const e=this._queue.indexOf(this._history[t].caller);return this._queue.splice(e,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;const r=this.timeline();return r&&r.play(),!0}return!1}}Qa.id=0;class Ka{constructor(t=new bh,e=-1,n=!0){this.transforms=t,this.id=e,this.done=n}clearTransformsFromQueue(){}}Ko([Qa,Ka],{mergeWith(t){return new Ka(t.transforms.lmultiply(this.transforms),t.id)}});const Ja=(t,e)=>t.lmultiplyO(e),tu=t=>t.transforms;function eu(){const t=this._transformationRunners.runners.map(tu).reduce(Ja,new bh);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class nu{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const e=t.id+1;return this.runners.push(t),this.ids.push(e),this}clearBefore(t){const e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Ka).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,e){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let e=0;e<this.runners.length;++e){const n=this.runners[e];if(t&&n.done&&t.done&&(!n._timeline||!n._timeline._runnerIds.includes(n.id))&&(!t._timeline||!t._timeline._runnerIds.includes(t.id))){this.remove(n.id);const r=n.mergeWith(t);this.edit(t.id,r),t=r,--e}else t=n}return this}remove(t){const e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}}Oo({Element:{animate(t,e,n){const r=Qa.sanitise(t,e,n),i=this.timeline();return new Qa(r.duration).loop(r).element(this).timeline(i.play()).schedule(r.delay,r.when)},delay(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((e=>e.id<=t.id)).map(tu).reduce(Ja,new bh)},_addRunner(t){this._transformationRunners.add(t),Ha.cancelImmediate(this._frameId),this._frameId=Ha.immediate(eu.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new nu).add(new Ka(new bh(this))))}}});Ko(Qa,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,n){if("string"==typeof e)return this.styleAttr(t,{[e]:n});let r=e;if(this._tryRetarget(t,r))return this;let i=new Ra(this._stepper).to(r),s=Object.keys(r);return this.queue((function(){i=i.from(this.element()[t](s))}),(function(e){return this.element()[t](i.at(e).valueOf()),i.done()}),(function(e){const n=Object.keys(e),o=(h=s,n.filter((t=>!h.includes(t))));var h;if(o.length){const e=this.element()[t](o),n=new Fa(i.from()).valueOf();Object.assign(n,e),i.from(n)}const a=new Fa(i.to()).valueOf();Object.assign(a,e),i.to(a),s=n,r=e})),this._rememberMorpher(t,i),this},zoom(t,e){if(this._tryRetarget("zoom",t,e))return this;let n=new Ra(this._stepper).to(new $h(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),e),n.done()}),(function(t,r){e=r,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,e,n){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;const r=bh.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!r;const i=new Ra(this._stepper).type(n?Da:bh);let s,o,h,a,u;return this.queue((function(){o=o||this.element(),s=s||jo(t,o),u=new bh(e?void 0:o),o._addRunner(this),e||o._clearTransformRunnersBefore(this)}),(function(l){e||this.clearTransform();const{x:c,y:d}=new yh(s).transform(o._currentTransform(this));let f=new bh({...t,origin:[c,d]}),p=this._isDeclarative&&h?h:u;if(n){f=f.decompose(c,d),p=p.decompose(c,d);const t=f.rotate,e=p.rotate,n=[t-360,t,t+360],r=n.map((t=>Math.abs(t-e))),i=Math.min(...r),s=r.indexOf(i);f.rotate=n[s]}e&&(r||(f.rotate=t.rotate||0),this._isDeclarative&&a&&(p.rotate=a)),i.from(p),i.to(f);const m=i.at(l);return a=m.rotate,h=new bh(m),this.addTransform(h),o._addRunner(this),i.done()}),(function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=jo(e,o)),t={...e,origin:s}}),!0),this._isDeclarative&&this._rememberMorpher("transform",i),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,e){return this.dx(t).dy(e)},_queueNumberDelta(t,e){if(e=new $h(e),this._tryRetarget(t,e))return this;const n=new Ra(this._stepper).to(e);let r=null;return this.queue((function(){r=this.element()[t](),n.from(r),n.to(r+e)}),(function(e){return this.element()[t](n.at(e)),n.done()}),(function(t){n.to(r+new $h(t))})),this._rememberMorpher(t,n),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;const n=new Ra(this._stepper).to(e);return this.queue((function(){n.from(this.element()[t]())}),(function(e){return this.element()[t](n.at(e)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,e){return this._queueObject(t,new $h(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},amove(t,e){return this.ax(t).ay(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){let n;return t&&e||(n=this._element.bbox()),t||(t=n.width/n.height*e),e||(e=n.height/n.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,n,r){if(4===arguments.length)return this.plot([t,e,n,r]);if(this._tryRetarget("plot",t))return this;const i=new Ra(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){i.from(this._element.array())}),(function(t){return this._element.plot(i.at(t)),i.done()})),this._rememberMorpher("plot",i),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,n,r){return this._queueObject("viewbox",new _h(t,e,n,r))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),Ko(Qa,{rx:Zh,ry:Uh,from:oa,to:ha}),Wo(Qa,"Runner");class ru extends Vh{constructor(t,e=t){super(Bo("svg",t),e),this.namespace()}defs(){return this.isRoot()?Vo(this.node.querySelector("defs"))||this.put(new Hh):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof Fo.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:Po,version:"1.1"}).attr("xmlns:xlink",zo,Do):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,Do).attr("xmlns:svgjs",null,Do)}root(){return this.isRoot()?this:super.root()}}Oo({Container:{nested:Jo((function(){return this.put(new ru)}))}}),Wo(ru,"Svg",!0);let iu=class extends Vh{constructor(t,e=t){super(Bo("symbol",t),e)}};Oo({Container:{symbol:Jo((function(){return this.put(new iu)}))}}),Wo(iu,"Symbol");const su=Object.freeze(Object.defineProperty({__proto__:null,amove:function(t,e){return this.ax(t).ay(e)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,e,n=this.bbox()){return this.cx(t,n).cy(e,n)},cx:function(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)},cy:function(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)},length:function(){return this.node.getComputedTextLength()},move:function(t,e,n=this.bbox()){return this.x(t,n).y(e,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(Fo.document.createTextNode(t)),this},x:function(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)},y:function(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}},Symbol.toStringTag,{value:"Module"}));class ou extends Wh{constructor(t,e=t){super(Bo("text",t),e),this.dom.leading=this.dom.leading??new $h(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new $h(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let e=0;const n=this.dom.leading;this.each((function(r){if(Lo(this.node))return;const i=Fo.window.getComputedStyle(this.node).getPropertyValue("font-size"),s=n*new $h(i);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?e+=s:(this.attr("dy",r?s+e:0),e=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new $h(t.leading||1.3),this}writeDataToDom(){return Ro(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const e=this.node.childNodes;let n=0;t="";for(let r=0,i=e.length;r<i;++r)"textPath"===e[r].nodeName||Lo(e[r])?0===r&&(n=r+1):(r!==n&&3!==e[r].nodeType&&!0===Vo(e[r]).dom.newLined&&(t+="\n"),t+=e[r].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let e=0,n=(t=(t+"").split("\n")).length;e<n;e++)this.newLine(t[e]);return this.build(!1).rebuild()}}Ko(ou,su),Oo({Container:{text:Jo((function(t=""){return this.put(new ou).text(t)})),plain:Jo((function(t=""){return this.put(new ou).plain(t)}))}}),Wo(ou,"Text");class hu extends Wh{constructor(t,e=t){super(Bo("tspan",t),e),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof ou))return this;const e=t.index(this),n=Fo.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new $h(n);return this.dy(e?r:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}Ko(hu,su),Oo({Tspan:{tspan:Jo((function(t=""){const e=new hu;return this._build||this.clear(),this.put(e).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),Wo(hu,"Tspan");class au extends Wh{constructor(t,e=t){super(Bo("circle",t),e)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new $h(t).divide(2))}}Ko(au,{x:Qh,y:Kh,cx:Jh,cy:ta,width:ea,height:na}),Oo({Container:{circle:Jo((function(t=0){return this.put(new au).size(t).move(0,0)}))}}),Wo(au,"Circle");class uu extends Vh{constructor(t,e=t){super(Bo("clipPath",t),e)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return Mh("svg [clip-path*="+this.id()+"]")}}Oo({Container:{clip:Jo((function(){return this.defs().put(new uu)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const e=t instanceof uu?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+e.id()+")")},unclip(){return this.attr("clip-path",null)}}}),Wo(uu,"ClipPath");class lu extends qh{constructor(t,e=t){super(Bo("foreignObject",t),e)}}Oo({Container:{foreignObject:Jo((function(t,e){return this.put(new lu).size(t,e)}))}}),Wo(lu,"ForeignObject");const cu=Object.freeze(Object.defineProperty({__proto__:null,dmove:function(t,e){return this.children().forEach((n=>{let r;try{r=n.node instanceof Fo.window.SVGSVGElement?new _h(n.attr(["x","y","width","height"])):n.bbox()}catch(h){return}const i=new bh(n),s=i.translate(t,e).transform(i.inverse()),o=new yh(r.x,r.y).transform(s);n.move(o.x,o.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)},move:function(t=0,e=0,n=this.bbox()){const r=t-n.x,i=e-n.y;return this.dmove(r,i)},size:function(t,e,n=this.bbox()){const r=To(this,t,e,n),i=r.width/n.width,s=r.height/n.height;return this.children().forEach((t=>{const e=new yh(n).transform(new bh(t).inverse());t.scale(i,s,e.x,e.y)})),this},width:function(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)},x:function(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)},y:function(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}},Symbol.toStringTag,{value:"Module"}));class du extends Vh{constructor(t,e=t){super(Bo("g",t),e)}}Ko(du,cu),Oo({Container:{group:Jo((function(){return this.put(new du)}))}}),Wo(du,"G");class fu extends Vh{constructor(t,e=t){super(Bo("a",t),e)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,zo)}}Ko(fu,cu),Oo({Container:{link:Jo((function(t){return this.put(new fu).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const e=t.parent();if(!e)return this.remove();const n=e.index(t);return e.add(this,n),t.remove(),this},linkTo(t){let e=this.linker();return e||(e=new fu,this.wrap(e)),"function"==typeof t?t.call(e,e):e.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),Wo(fu,"A");class pu extends Vh{constructor(t,e=t){super(Bo("mask",t),e)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return Mh("svg [mask*="+this.id()+"]")}}Oo({Container:{mask:Jo((function(){return this.defs().put(new pu)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const e=t instanceof pu?t:this.parent().mask().add(t);return this.attr("mask","url(#"+e.id()+")")},unmask(){return this.attr("mask",null)}}}),Wo(pu,"Mask");class mu extends qh{constructor(t,e=t){super(Bo("stop",t),e)}update(t){return("number"==typeof t||t instanceof $h)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new $h(t.offset)),this}}Oo({Gradient:{stop:function(t,e,n){return this.put(new mu).update(t,e,n)}}}),Wo(mu,"Stop");class gu extends qh{constructor(t,e=t){super(Bo("style",t),e)}addText(t=""){return this.node.textContent+=t,this}font(t,e,n={}){return this.rule("@font-face",{fontFamily:t,src:e,...n})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;let n=t+"{";for(const r in e)n+=r.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))+":"+e[r]+";";return n+="}",n}(t,e))}}Oo("Dom",{style(t,e){return this.put(new gu).rule(t,e)},fontface(t,e,n){return this.put(new gu).font(t,e,n)}}),Wo(gu,"Style");class yu extends ou{constructor(t,e=t){super(Bo("textPath",t),e)}array(){const t=this.track();return t?t.array():null}plot(t){const e=this.track();let n=null;return e&&(n=e.plot(t)),null==t?n:this}track(){return this.reference("href")}}Oo({Container:{textPath:Jo((function(t,e){return t instanceof ou||(t=this.text(t)),t.path(e)}))},Text:{path:Jo((function(t,e=!0){const n=new yu;let r;if(t instanceof Ya||(t=this.defs().path(t)),n.attr("href","#"+t,zo),e)for(;r=this.node.firstChild;)n.node.appendChild(r);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:Jo((function(t){return t instanceof ou||(t=(new ou).addTo(this.parent()).text(t)),t.path(this)})),targets(){return Mh("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),yu.prototype.MorphArray=Ia,Wo(yu,"TextPath");class wu extends Wh{constructor(t,e=t){super(Bo("use",t),e)}use(t,e){return this.attr("href",(e||"")+"#"+t,zo)}}Oo({Container:{use:Jo((function(t,e){return this.put(new wu).use(t,e)}))}}),Wo(wu,"Use");const bu=qo;Ko([ru,iu,ca,la,ga],Mo("viewbox")),Ko([ma,qa,Ga,Ya],Mo("marker")),Ko(ou,Mo("Text")),Ko(Ya,Mo("Path")),Ko(Hh,Mo("Defs")),Ko([ou,hu],Mo("Tspan")),Ko([Ba,ia,ua,Qa],Mo("radius")),Ko(Ih,Mo("EventTarget")),Ko(Gh,Mo("Dom")),Ko(qh,Mo("Element")),Ko(Wh,Mo("Shape")),Ko([Vh,sa],Mo("Container")),Ko(ua,Mo("Gradient")),Ko(Qa,Mo("Runner")),Ch.extend([...new Set(Co)]),function(t=[]){$a.push(...[].concat(t))}([$h,gh,_h,bh,Fh,da,Ia,yh]),Ko($a,{to(t){return(new Ra).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,e,n,r,i){return this.fromArray(t.map((function(t,s){return r.step(t,e[s],n,i[s],i)})))}});var xu=function(t){return t.touches||[{clientX:t.clientX,clientY:t.clientY}]};Ko(ru,{panZoom:function(t){var e,n,r,i,s,o,h,a,u,l,c,d,f=this;if(this.off(".panZoom"),!1===t)return this;var p,m,g=null!=(n=(t=null!=(e=t)?e:{}).zoomFactor)?n:2,y=null!=(r=t.zoomMin)?r:Number.MIN_VALUE,w=null!=(i=t.zoomMax)?i:Number.MAX_VALUE,b=null==(s=t.wheelZoom)||s,x=null==(o=t.pinchZoom)||o,v=null==(h=t.panning)||h,_=null!=(a=t.panButton)?a:0,E=null!=(u=t.oneFingerPan)&&u,C=null!=(l=t.margins)&&l,O=null!=(c=t.wheelZoomDeltaModeLinePixels)?c:17,M=null!=(d=t.wheelZoomDeltaModeScreenPixels)?d:53,k=!1,S=this.viewbox(),N=function(t){if(!C)return t;var e=C.top,n=C.left,r=C.bottom,i=C.right,s=f.attr(["width","height"]),o=s.width,h=s.height,a=f.node.preserveAspectRatio.baseVal,u=0,l=0,c=0,d=0;if(a.align!==a.SVG_PRESERVEASPECTRATIO_NONE){var p=o/h,m=S.width/S.height;if(m!==p){var g=a.meetOrSlice!==a.SVG_MEETORSLICE_SLICE,y=p>m?"width":"height",w="width"===y,b=g&&w||!g&&!w,x=b?p/m:m/p,v=t[y]-t[y]*x;b?a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMAX?(u=v/2,l=-v/2):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMAX?l=-v:a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMIN&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMID&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMAX||(u=v):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMID||a.align===a.SVG_PRESERVEASPECTRATIO_XMAXYMID?(c=v/2,d=-v/2):a.align===a.SVG_PRESERVEASPECTRATIO_XMINYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMIDYMIN||a.align===a.SVG_PRESERVEASPECTRATIO_XMAXYMIN?d=-v:a.align!==a.SVG_PRESERVEASPECTRATIO_XMINYMAX&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMIDYMAX&&a.align!==a.SVG_PRESERVEASPECTRATIO_XMAXYMAX||(c=v)}}var _=S.width+S.x-n-u,E=S.x+i-t.width-l,O=S.height+S.y-e-c,M=S.y+r-t.height-d;return t.x=Math.min(_,Math.max(E,t.x)),t.y=Math.min(O,Math.max(M,t.y)),t},A=function t(e){(m=xu(e)).length<2?v&&E&&I.call(this,e):(v&&E&&L.call(this,e),e.preventDefault(),this.dispatch("pinchZoomStart",{event:e}).defaultPrevented||(this.off("touchstart.panZoom",t),k=!0,Th(document,"touchmove.panZoom",j,this,{passive:!1}),Th(document,"touchend.panZoom",T,this,{passive:!1})))},T=function t(e){e.preventDefault();var n=xu(e);n.length>1||(k=!1,this.dispatch("pinchZoomEnd",{event:e}),jh(document,"touchmove.panZoom",j),jh(document,"touchend.panZoom",t),this.on("touchstart.panZoom",A),n.length&&v&&E&&I.call(this,e))},j=function(t){t.preventDefault();var e=xu(t),n=this.zoom(),r=Math.sqrt(Math.pow(m[0].clientX-m[1].clientX,2)+Math.pow(m[0].clientY-m[1].clientY,2))/Math.sqrt(Math.pow(e[0].clientX-e[1].clientX,2)+Math.pow(e[0].clientY-e[1].clientY,2));(n<y&&r>1||n>w&&r<1)&&(r=1);var i={x:e[0].clientX+.5*(e[1].clientX-e[0].clientX),y:e[0].clientY+.5*(e[1].clientY-e[0].clientY)},s=m[0].clientX+.5*(m[1].clientX-m[0].clientX),o=m[0].clientY+.5*(m[1].clientY-m[0].clientY),h=this.point(i.x,i.y),a=this.point(2*i.x-s,2*i.y-o),u=new _h(this.viewbox()).transform((new bh).translate(-a.x,-a.y).scale(r,0,0).translate(h.x,h.y));N(u),this.viewbox(u),m=e,this.dispatch("zoom",{box:u,focus:a})},I=function t(e){e.type.indexOf("mouse")>-1&&e.button!==_&&e.which!==_+1||(e.preventDefault(),this.off("mousedown.panZoom",t),m=xu(e),k||(this.dispatch("panStart",{event:e}),p={x:m[0].clientX,y:m[0].clientY},Th(document,"touchmove.panZoom mousemove.panZoom",R,this,{passive:!1}),Th(document,"touchend.panZoom mouseup.panZoom",L,this,{passive:!1})))},L=function t(e){e.preventDefault(),jh(document,"touchmove.panZoom mousemove.panZoom",R),jh(document,"touchend.panZoom mouseup.panZoom",t),this.on("mousedown.panZoom",I),this.dispatch("panEnd",{event:e})},R=function(t){t.preventDefault();var e=xu(t),n={x:e[0].clientX,y:e[0].clientY},r=this.point(n.x,n.y),i=this.point(p.x,p.y),s=[i.x-r.x,i.y-r.y];if(s[0]||s[1]){var o=new _h(this.viewbox()).transform((new bh).translate(s[0],s[1]));p=n,N(o),this.dispatch("panning",{box:o,event:t}).defaultPrevented||this.viewbox(o)}};return b&&this.on("wheel.panZoom",(function(t){var e;switch(t.preventDefault(),t.deltaMode){case 1:e=t.deltaY*O;break;case 2:e=t.deltaY*M;break;default:e=t.deltaY}var n=Math.pow(1+g,-1*e/100)*this.zoom(),r=this.point(t.clientX,t.clientY);if(n>w&&(n=w),n<y&&(n=y),this.dispatch("zoom",{level:n,focus:r}).defaultPrevented)return this;if(this.zoom(n,r),C){var i=N(this.viewbox());this.viewbox(i)}}),this,{passive:!1}),x&&this.on("touchstart.panZoom",A,this,{passive:!1}),v&&this.on("mousedown.panZoom",I,this,{passive:!1}),this}});class vu{constructor(t,e,n,r,i){this.chartContext=i,this.width=e,this.height=n,t.innerHTML="",this.canvas=bu().addTo(t).size("100%","100%").viewbox(`0 0 ${e} ${n}`).panZoom({zoomFactor:.2,zoomMin:.1}).attr({style:r})}static drawCircle(t={}){const e=new au;return e.attr(t),e}static drawGroup(t=0,e=0,n,r){const i=new du;return i.attr({"data-parent":r,"data-self":n,transform:`translate(${t}, ${e})`}),i}static drawPath(t,{borderColor:e=wo.borderColor,id:n=""}={}){const r=new Ya({d:t});return r.id(n),r.fill("none").stroke({color:e,width:1}),r}static drawRect({color:t="#fefefe",height:e=0,opacity:n=1,radius:r=0,width:i=0,x1:s,y1:o}={}){const h=new Ba;return h.attr({height:e,opacity:n,rx:r,ry:r,width:i,x:s??void 0,y:o??void 0}),h.fill(t),h}static drawTemplate(t,{nodeHeight:e,nodeWidth:n}={}){const r=new lu({height:e,width:n}),i=document.createElement("div");return i.innerHTML=t,i.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),r.add(i),r}static drawText(t="",{dx:e,dy:n,x:r,y:i}){const s=new ou;return s.font({fill:"#f06"}),s.tspan(t),void 0!==r&&void 0!==i&&s.move(r,i),void 0!==e&&void 0!==n&&s.attr({dx:e,dy:n}),s}add(t){this.canvas.add(t)}clear(){this.canvas.clear().viewbox(`0 0 ${this.width} ${this.height}`)}exportToSvg(){new o(this.canvas,"apextree").exportToSVG()}resetViewBox(){this.canvas.viewbox(`0 0 ${this.width} ${this.height}`)}updateViewBox(t,e,n,r){this.canvas.viewbox(`${t} ${e} ${n} ${r}`)}zoom(t){const e=this.canvas.zoom()+t;e>=.1&&this.canvas.zoom(e)}}const _u={marginx:100,marginy:100,rankdir:"TB"};class Eu extends vu{constructor(t,e,n){super(t,e.viewPortWidth,e.viewPortHeight,e.canvasStyle,n),this.options=e,this.preservedPositions=new Map}calculateLayout(){const{childrenSpacing:t,siblingSpacing:e}=this.options,n=yo[this.options.direction];this.graph.setGraph({..._u,nodesep:e,rankdir:n,ranksep:t}),fo.layout(this.graph)}resetGraph(){this.graph=new fo.graphlib.Graph,this.graph.setDefaultEdgeLabel((function(){return{}}))}setGraphNodesAndEdges(t){this.resetGraph(),this.setNodesRecursively(t)}setNodesRecursively(t,e){var n;const{direction:r,groupLeafNodesSpacing:i,nodeHeight:s,nodeWidth:o}=this.options,h=this.nodeMap[t],a={...h,parent:e||void 0};if(this.graph.setNode(t,{...a,height:s,width:o}),e&&this.graph.setEdge(e,t),h.onlyLeafNodes){const e=go[r].leafWidth({childLength:h.children.length,childrenSpacing:i,nodeWidth:o}),n=go[r].leafHeight({childLength:h.children.length,childrenSpacing:i,nodeHeight:s});this.graph.setNode(`${t}_leafs`,{...a,height:n,id:`${t}_leafs`,parent:t,width:e}),this.graph.setEdge(t,`${t}_leafs`)}else if(null==(n=h.children)?void 0:n.length)for(const u of h.children)this.setNodesRecursively(u,t)}changeLayout(t="top"){this.options={...this.options,direction:t},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!1})}collapse(t){const e=this.nodeMap[t];(null==e?void 0:e.children)&&(this.graph.nodes().forEach((t=>{const e=this.graph.node(t);void 0!==(null==e?void 0:e.x)&&void 0!==(null==e?void 0:e.y)&&this.preservedPositions.set(t,{x:e.x,y:e.y})})),this.nodeMap[t]={...e,children:void 0,hiddenChildren:e.children},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!0}))}construct(t){if(this.nodeMap=_o(t),this.data=t,this.options.groupLeafNodes){(function(t){const e=[];function n(t){return!t.children||0===t.children.length}return function t(r){if(r.children&&0!==r.children.length){r.children.every(n)&&e.push(r);for(const e of r.children)t(e)}}(t),e})(t).forEach((t=>{this.nodeMap[t.id]={...this.nodeMap[t.id],onlyLeafNodes:!0},this.nodeMap[`${t.id}_leafs`]={...this.nodeMap[t.id],id:`${t.id}_leafs`,onlyLeafNodes:!0,parent:t.id},this.nodeMap[t.id].children.forEach((e=>{this.nodeMap[e]={...this.nodeMap[e],parent:`${t.id}_leafs`}}))}))}this.setGraphNodesAndEdges(t.id)}expand(t){const e=this.nodeMap[t];(null==e?void 0:e.hiddenChildren)&&(this.graph.nodes().forEach((t=>{const e=this.graph.node(t);void 0!==(null==e?void 0:e.x)&&void 0!==(null==e?void 0:e.y)&&this.preservedPositions.set(t,{x:e.x,y:e.y})})),this.nodeMap[t]={...e,children:e.hiddenChildren,hiddenChildren:void 0},this.setGraphNodesAndEdges(this.data.id),this.render({keepOldPosition:!0}))}fitScreen(){const{height:t,width:e}=this.graph.graph();this.updateViewBox(0,0,e,t)}render({keepOldPosition:t=!1}={}){const e=this.canvas.viewbox();this.clear(),this.calculateLayout(),t&&this.preservedPositions.size>0&&this.graph.nodes().forEach((t=>{const e=this.preservedPositions.get(t);if(e){const n=this.graph.node(t);n&&(n.x=e.x,n.y=e.y,this.graph.setNode(t,n))}}));const{containerClassName:n,enableTooltip:r,fontColor:i,fontFamily:s,fontSize:o,fontWeight:h,tooltipId:a}=this.options,u=lr({color:i,fontFamily:s,fontSize:o,fontWeight:h}),l=vu.drawGroup(0,0,n);l.attr("style",u),l.id(n);const c=this.graph.nodes();if(this.graph.edges().forEach((t=>{this.renderEdge(t,l)})),c.forEach((t=>{t.endsWith("_leafs")?this.renderGroupedLeafNodes(t,l):this.renderNode(t,l)})),this.add(l),this.fitScreen(),t&&this.updateViewBox(e.x,e.y,e.width,e.height),r){const t=ar(this.chartContext,a);this.chartContext.getAppendContainer().appendChild(t)}}renderEdge(t,e){const n=this.graph.node(t.w),r=this.graph.node(t.v),{nodeHeight:i,nodeWidth:s}=this.options,o=((t,e,n,r,i)=>{if(!(null==t?void 0:t.parent))return null;const{calculateEdge:s,edgeMidX:o,edgeMidY:h,edgeParentX:a,edgeParentY:u,edgeX:l,edgeY:c}=go[i];return s({x:l({node:t,nodeHeight:r,nodeWidth:n}),y:c({node:t,nodeHeight:r,nodeWidth:n})},{x:a({nodeHeight:r,nodeWidth:n,parent:e}),y:u({nodeHeight:r,nodeWidth:n,parent:e})},{x:o({node:t,nodeHeight:r,nodeWidth:n}),y:h({node:t,nodeHeight:r,nodeWidth:n})},{sy:0})})(n,r,s,i,this.options.direction);if(!o)return;const h=vu.drawPath(o,{id:`${t.v}-${t.w}`});e.add(h)}renderGroupedLeafNodes(t,e){const n=this.graph.node(t),{options:r}=this,{direction:i}=r,s=go[i].leafGroupX({node:n}),o=go[i].leafGroupY({node:n}),h=vu.drawGroup(s,o,n.id,n.parent);n.children.forEach(((t,e)=>{this.renderLeafNode(t,h,e)})),e.add(h)}renderLeafNode(t,e,n){const r=this.nodeMap[t],{options:i}=this,{borderRadius:s,contentKey:o,direction:h,enableTooltip:a,groupLeafNodesSpacing:u,highlightOnHover:l,nodeTemplate:c,tooltipTemplate:d}=i,{borderColor:f,borderStyle:p,borderWidth:m,fontColor:g,fontFamily:y,fontSize:w,fontWeight:b,nodeBGColor:x,nodeClassName:v,nodeHeight:_,nodeStyle:E,nodeWidth:C,tooltipBGColor:O,tooltipBorderColor:M,tooltipId:k,tooltipMaxWidth:S}={...i,...r.options},N=go[h].leafX({childrenSpacing:u,index:n,nodeHeight:_,nodeWidth:C}),A=go[h].leafY({childrenSpacing:u,index:n,nodeHeight:_,nodeWidth:C}),T=vu.drawGroup(N,A,r.id,r.parent),j=lr({background:x,borderColor:f,borderRadius:s,borderStyle:p,borderWidth:`${m}px`,color:g,fontFamily:y,fontSize:w,fontWeight:b}),I=c(r[o]),L=vu.drawTemplate(I,{nodeHeight:_,nodeWidth:C}),R=j+(E?"; "+E:"");L.attr("style",R),L.attr("class",v),T.add(L);const P=this;if(l&&(T.on("mouseover",(function(){const{self:t}=this.node.dataset,e=P.nodeMap[t];e&&xo(e,P.nodeMap,!0,i,P.chartContext)})),T.on("mouseout",(function(){const{self:t}=this.node.dataset,e=P.nodeMap[t];e&&xo(e,P.nodeMap,!1,i,P.chartContext)}))),a){const t=d?d(r[o]):I;T.on("mousemove",(e=>{const n=cr({bgColor:O,borderColor:M,maxWidth:S,padding:d?0:10,x:e.pageX,y:e.pageY});ur(P.chartContext,k,n,t)})),T.on("mouseout",(t=>{"svg"===t.relatedTarget.tagName&&ur(P.chartContext,k)}))}this.options.onNodeClick&&T.on("click",(()=>{this.options.onNodeClick(r)})),e.add(T)}renderNode(t,e){var n,r;const i=this.graph.node(t),{options:s}=this,{borderRadius:o,contentKey:h,direction:a,enableExpandCollapse:u,enableTooltip:l,highlightOnHover:c,nodeHeight:d,nodeTemplate:f,nodeWidth:p,tooltipTemplate:m}=s,{borderColor:g,borderStyle:y,borderWidth:w,fontColor:b,fontFamily:x,fontSize:v,fontWeight:_,nodeBGColor:E,nodeClassName:C,nodeStyle:O,tooltipBGColor:M,tooltipBorderColor:k,tooltipId:S,tooltipMaxWidth:N}={...s,...i.options},{height:A,width:T,x:j,y:I}=i,L=this,R=vu.drawGroup(j-p/2,I-d/2,i.id,i.parent),P=f(i[h]),D=vu.drawTemplate(P,{nodeHeight:A,nodeWidth:T}),z=lr({color:b,fontFamily:x,fontSize:v,fontWeight:_}),F=lr({backgroundColor:E,borderColor:g,borderRadius:o,borderStyle:y,borderWidth:`${w}px`,boxSizing:"border-box",height:"100%"})+(O?"; "+O:"");if(D.first().attr("style",F),D.attr("class",C),R.attr("style",z),R.add(D),c&&(R.on("mouseover",(function(){const{self:t}=this.node.dataset,e=L.nodeMap[t];e&&xo(e,L.nodeMap,!0,s,L.chartContext)})),R.on("mouseout",(function(){const{self:t}=this.node.dataset,e=L.nodeMap[t];e&&xo(e,L.nodeMap,!1,s,L.chartContext)}))),l){const t=m?m(i[h]):P;R.on("mousemove",(e=>{const n=cr({bgColor:M,borderColor:k,maxWidth:N,padding:m?0:10,x:e.pageX,y:e.pageY});ur(L.chartContext,S,n,t)})),R.on("mouseout",(t=>{"svg"===t.relatedTarget.tagName&&ur(L.chartContext,S)}))}if(u&&((null==(n=i.children)?void 0:n.length)||(null==(r=i.hiddenChildren)?void 0:r.length))){const t=7,e=((t,e,n,r)=>{switch(t){case"top":case"bottom":default:return{x:e/2-r,y:n-r};case"left":return{x:e-r,y:n/2-r};case"right":return{x:-r,y:n/2-r}}})(this.options.direction,p,d,t),n=!i.hiddenChildren,r=vu.drawGroup(e.x,e.y),s=vu.drawCircle({cx:t,cy:t,r:t});s.fill(this.options.expandCollapseButtonBGColor),s.stroke({color:this.options.expandCollapseButtonBorderColor,width:1}),r.add(s);const o=n?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14">\n <path d="m12,0C5.383,0,0,5.383,0,12s5.383,12,12,12,12-5.383,12-12S18.617,0,12,0Zm0,22c-5.514,0-10-4.486-10-10S6.486,2,12,2s10,4.486,10,10-4.486,10-10,10Zm5-10c0,.552-.448,1-1,1h-8c-.552,0-1-.448-1-1s.448-1,1-1h8c.552,0,1,.448,1,1Z"/>\n</svg>\n':'<svg height="14" viewBox="0 0 24 24" width="14" xmlns="http://www.w3.org/2000/svg">\n <path d="m12 0a12 12 0 1 0 12 12 12.013 12.013 0 0 0 -12-12zm0 22a10 10 0 1 1 10-10 10.011 10.011 0 0 1 -10 10zm5-10a1 1 0 0 1 -1 1h-3v3a1 1 0 0 1 -2 0v-3h-3a1 1 0 0 1 0-2h3v-3a1 1 0 0 1 2 0v3h3a1 1 0 0 1 1 1z"/>\n</svg>',h=vu.drawTemplate(o,{nodeHeight:14,nodeWidth:14});r.add(h),R.add(r),r.on("click",(t=>{t.stopPropagation(),n?this.collapse(i.id):this.expand(i.id)})),(t=>{const e=t.findOne("circle");if(!e)return;const n=e.attr("fill")||"#FFF",r=e.attr("stroke")||"#ddd",i=e.attr("stroke-width")||1,s=e.attr("r");t.on("mouseenter",(function(){e.attr({fill:"#f8f9fa",stroke:"#007bff","stroke-width":2,r:1.1*s}),t.attr("style","cursor: pointer; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));")})),t.on("mouseleave",(function(){e.attr({fill:n,stroke:r,"stroke-width":i,r:s}),t.attr("style","cursor: pointer;")}))})(r)}this.options.onNodeClick&&R.on("click",(()=>{this.options.onNodeClick(i)})),e.add(R)}}class Cu extends i{constructor(t,e={}){super(t,"tree_"+Math.random().toString(36).substr(2,9)),this.options={...wo,...e};const{height:n,width:r}=this.options;this.graph=new Eu(this.element,this.options,this.chartContext),this.setupElementDimensions(r,n),this.handleWatermark()}static setLicense(t){a.setLicense(t)}setupElementDimensions(t,e){let n=!1,r=0;"string"==typeof t&&/^\d+(\.\d+)?%$/.test(t)?(r=Number(t.substring(0,t.length-1)),n=!0):r=Number(t);const i="auto"===e?r/1.6:Number(e);this.element.style.width=`${r}${n?"%":"px"}`,this.element.style.height=`${i}${n?"%":"px"}`,this.element.style.position="relative"}handleWatermark(){this.element&&(a.isLicenseValid()?ln.remove(this.element):ln.add(this.element))}render(t){if(!this.element)throw new Error("Element not found");if(this.graph.construct(t),this.graph.render(),this.options.enableToolbar){new an(this.element,this.chartContext).render({enableExport:!0,enableFitscreen:!0,enableZoom:!0,onExport:this.graph.exportToSvg.bind(this.graph),onFitscreen:this.graph.fitScreen.bind(this.graph),onZoom:this.graph.zoom.bind(this.graph)})}return this.graph}}"undefined"!=typeof window&&(window.ApexTree=Cu),t.ApexTree=Cu,t.default=Cu,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|