text: var vexchords=function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/dist",r(r.s=0)}([function(t,e,r){"use strict";r.r(e);var i={};r.r(i),r.d(i,"rx",function(){return Dt}),r.d(i,"ry",function(){return Ft}),r.d(i,"x",function(){return zt}),r.d(i,"y",function(){return Rt}),r.d(i,"cx",function(){return qt}),r.d(i,"cy",function(){return It}),r.d(i,"width",function(){return Lt}),r.d(i,"height",function(){return Pt});var n={};r.r(n),r.d(n,"from",function(){return Vt}),r.d(n,"to",function(){return Ut});var s={};r.r(s),r.d(s,"MorphArray",function(){return ee}),r.d(s,"x",function(){return re}),r.d(s,"y",function(){return ie}),r.d(s,"width",function(){return ne}),r.d(s,"height",function(){return se});var h={};r.r(h),r.d(h,"array",function(){return Ce}),r.d(h,"plot",function(){return ke}),r.d(h,"clear",function(){return Te}),r.d(h,"move",function(){return Ee}),r.d(h,"size",function(){return je});var o={};r.r(o),r.d(o,"plain",function(){return Ue}),r.d(o,"length",function(){return $e});const a={},u=[];function l(t,e){if(Array.isArray(t))for(let r of t)l(r,e);else if("object"!=typeof t)f(Object.getOwnPropertyNames(e)),a[t]=Object.assign(a[t]||{},e);else for(let e in t)l(e,t[e])}function c(t){return a[t]||{}}function f(t){u.push(...t)}function d(t,e){var r,i=t.length,n=[];for(r=0;r<i;r++)n.push(e(t[r]));return n}function p(t){return t%360*Math.PI/180}function m(t){return t.toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()})}function y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(t,e,r,i){return null!=e&&null!=r||(i=i||t.bbox(),null==e?e=i.width/i.height*r:null==r&&(r=i.height/i.width*e)),{width:e,height:r}}function x(t,e){let r,i,n=t.origin;if("string"==typeof n||null==n){const s=(n||"center").toLowerCase().trim(),{height:h,width:o,x:a,y:u}=e.bbox();let l=s.includes("left")?a:s.includes("right")?a+o:a+o/2,c=s.includes("top")?u:s.includes("bottom")?u+h:u+h/2;r=null!=t.ox?t.ox:l,i=null!=t.oy?t.oy:c}else r=n[0],i=n[1];return[r,i]}let w="http://www.w3.org/2000/svg",v="http://www.w3.org/2000/xmlns/",_="http://www.w3.org/1999/xlink",b="http://svgjs.com/svgjs";const S={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class M{}const A={},O="___SYMBOL___ROOT___";function C(t){return S.document.createElementNS(w,t)}function k(t){if(t instanceof M)return t;if("object"==typeof t)return j(t);if(null==t)return new A[O];if("string"==typeof t&&"<"!==t.charAt(0))return j(S.document.querySelector(t));var e=C("svg");return e.innerHTML=t,t=j(e.firstChild)}function T(t,e){return e instanceof S.window.Node?e:C(t)}function E(t){if(!t)return null;if(t.instance instanceof M)return t.instance;var e=y(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":A[e]||(e="Dom"),new A[e](t)}let j=E;function N(t,e=t.name,r=!1){return A[e]=t,r&&(A[O]=t),f(Object.getOwnPropertyNames(t.prototype)),t}let D=1e3;function F(t){return"Svgjs"+y(t)+D++}function z(t,e,r){var i,n;for(n=(t=Array.isArray(t)?t:[t]).length-1;n>=0;n--)for(i in e){let s=e[i];r&&(s=R(e[i])),t[n].prototype[i]=s}}function R(t){return function(...e){let r=e[e.length-1];return!r||r.constructor!==Object||r instanceof Array?t.apply(this,e):t.apply(this,e.slice(0,-1)).attr(r)}}l("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(){var t=this.position()+1,e=this.parent();return e.removeElement(this).add(this,t),"function"==typeof e.isRoot&&e.isRoot()&&e.node.appendChild(e.defs().node),this},backward:function(){var t=this.position();return t>0&&this.parent().removeElement(this).add(this,t-1),this},front:function(){var t=this.parent();return t.node.appendChild(this.node),"function"==typeof t.isRoot&&t.isRoot()&&t.node.appendChild(t.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(t){(t=k(t)).remove();var e=this.position();return this.parent().add(t,e),this},after:function(t){(t=k(t)).remove();var e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=k(t)).before(this),this},insertAfter:function(t){return(t=k(t)).after(this),this}});let q=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,I=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,L=/rgb\((\d+),(\d+),(\d+)\)/,P=/(#[a-z0-9\-_]+)/i,X=/\)\s*,?\s*/,Y=/\s/g,B=/^#[a-f0-9]{3,6}$/i,H=/^rgb\(/,G=/^(\s+)?$/,W=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,V=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,U=/[\s,]+/,$=/([^e])-/gi,Q=/[MLHVCSQTAZ]/gi,Z=/[MLHVCSQTAZ]/i,J=/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,K=/\./g;l("Dom",{classes:function(){var t=this.attr("class");return null==t?[]:t.trim().split(U)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){var 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)}}),l("Dom",{css:function(t,e){let r={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter(function(t){return!!t.length}).forEach(function(t){let e=t.split(/\s*:\s*/);r[e[0]]=e[1]}),r;if(arguments.length<2){if(Array.isArray(t)){for(let e of t){let t=m(e);r[t]=this.node.style[t]}return r}if("string"==typeof t)return this.node.style[m(t)];if("object"==typeof t)for(let e in t)this.node.style[m(e)]=null==t[e]||G.test(t[e])?"":t[e]}return 2===arguments.length&&(this.node.style[m(t)]=null==e||G.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),l("Dom",{data:function(t,e,r){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(e){return this.attr("data-"+t)}else this.attr("data-"+t,null===e?null:!0===r||"string"==typeof e||"number"==typeof e?e:JSON.stringify(e));return this}}),l("Dom",{remember:function(t,e){if("object"==typeof arguments[0])for(var r in t)this.remember(r,t[r]);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(var t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});let tt=0,et={};function rt(t){let e=t.getEventHolder();return e===S.window&&(e=et),e.events||(e.events={}),e.events}function it(t){return t.getEventTarget()}function nt(t,e,r,i,n){var s=r.bind(i||t),h=k(t),o=rt(h),a=it(h);e=Array.isArray(e)?e:e.split(U),r._svgjsListenerId||(r._svgjsListenerId=++tt),e.forEach(function(t){var e=t.split(".")[0],i=t.split(".")[1]||"*";o[e]=o[e]||{},o[e][i]=o[e][i]||{},o[e][i][r._svgjsListenerId]=s,a.addEventListener(e,s,n||!1)})}function st(t,e,r,i){var n=k(t),s=rt(n),h=it(n);("function"!=typeof r||(r=r._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(U)).forEach(function(t){var e,o,a=t&&t.split(".")[0],u=t&&t.split(".")[1];if(r)s[a]&&s[a][u||"*"]&&(h.removeEventListener(a,s[a][u||"*"][r],i||!1),delete s[a][u||"*"][r]);else if(a&&u){if(s[a]&&s[a][u]){for(o in s[a][u])st(h,[a,u].join("."),o);delete s[a][u]}}else if(u)for(t in s)for(e in s[t])u===e&&st(h,[t,u].join("."));else if(a){if(s[a]){for(e in s[a])st(h,[a,e].join("."));delete s[a]}}else{for(t in s)st(h,t);!function(t){const e=t.getEventHolder();e.events&&(e.events={})}(n)}})}function ht(t){const e=Math.round(t),r=Math.max(0,Math.min(255,e)).toString(16);return 1===r.length?"0"+r:r}function ot(t,e){for(let r=e.length;r--;)if(null==t[e[r]])return!1;return!0}function at(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}class ut{constructor(...t){this.init(...t)}init(t=0,e=0,r=0,i=0,n="rgb"){if(t=t||0,this.space)for(let t in this.space)delete this[this.space[t]];if("number"==typeof t)n="string"==typeof i?i:n,i="string"==typeof i?0:i,Object.assign(this,{_a:t,_b:e,_c:r,_d:i,space:n});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 r=function(t,e){const r=ot(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,space:"rgb"}:ot(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:ot(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:ot(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:ot(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:ot(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 r.space=e||r.space,r}(t,e);Object.assign(this,r)}else if("string"==typeof t)if(H.test(t)){const e=t.replace(Y,""),[r,i,n]=L.exec(e).slice(1,4).map(t=>parseInt(t));Object.assign(this,{_a:r,_b:i,_c:n,_d:0,space:"rgb"})}else{if(!B.test(t))throw Error("Unsupported string format, can't construct Color");{const e=t=>parseInt(t,16),[,r,i,n]=I.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(e);Object.assign(this,{_a:r,_b:i,_c:n,_d:0,space:"rgb"})}}const{_a:s,_b:h,_c:o,_d:a}=this,u="rgb"===this.space?{r:s,g:h,b:o}:"xyz"===this.space?{x:s,y:h,z:o}:"hsl"===this.space?{h:s,s:h,l:o}:"lab"===this.space?{l:s,a:h,b:o}:"lch"===this.space?{l:s,c:h,h:o}:"cmyk"===this.space?{c:s,m:h,y:o,k:a}:{};Object.assign(this,u)}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:e,z:r}=this;if("lab"===this.space||"lch"===this.space){let{l:i,a:n,b:s}=this;if("lch"===this.space){let{c:t,h:e}=this;const r=Math.PI/180;n=t*Math.cos(r*e),s=t*Math.sin(r*e)}const h=(i+16)/116,o=n/500+h,a=h-s/200,u=16/116,l=.008856,c=7.787;t=.95047*(o**3>l?o**3:(o-u)/c),e=1*(h**3>l?h**3:(h-u)/c),r=1.08883*(a**3>l?a**3:(a-u)/c)}const i=3.2406*t+-1.5372*e+-.4986*r,n=-.9689*t+1.8758*e+.0415*r,s=.0557*t+-.204*e+1.057*r;let h=Math.pow,o=.0031308;const a=i>o?1.055*h(i,1/2.4)-.055:12.92*i,u=n>o?1.055*h(n,1/2.4)-.055:12.92*n,l=s>o?1.055*h(s,1/2.4)-.055:12.92*s;return new ut(255*a,255*u,255*l)}if("hsl"===this.space){let{h:t,s:e,l:r}=this;if(t/=360,r/=100,0===(e/=100)){return new ut(r*=255,r,r)}const i=r<.5?r*(1+e):r+e-r*e,n=2*r-i,s=255*at(n,i,t+1/3),h=255*at(n,i,t),o=255*at(n,i,t-1/3);return new ut(s,h,o)}if("cmyk"===this.space){const{c:t,m:e,y:r,k:i}=this,n=255*(1-Math.min(1,t*(1-i)+i)),s=255*(1-Math.min(1,e*(1-i)+i)),h=255*(1-Math.min(1,r*(1-i)+i));return new ut(n,s,h)}return this;var t}lab(){const{x:t,y:e,z:r}=this.xyz();return new ut(116*e-16,500*(t-e),200*(e-r),"lab")}xyz(){const{_a:t,_b:e,_c:r}=this.rgb(),[i,n,s]=[t,e,r].map(t=>t/255),h=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,o=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,a=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92,u=(.4124*h+.3576*o+.1805*a)/.95047,l=(.2126*h+.7152*o+.0722*a)/1,c=(.0193*h+.1192*o+.9505*a)/1.08883,f=u>.008856?Math.pow(u,1/3):7.787*u+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 ut(f,d,p,"xyz")}lch(){const{l:t,a:e,b:r}=this.lab(),i=Math.sqrt(e**2+r**2);let n=180*Math.atan2(r,e)/Math.PI;return n<0&&(n=360-(n*=-1)),new ut(t,i,n,"lch")}hsl(){const{_a:t,_b:e,_c:r}=this.rgb(),[i,n,s]=[t,e,r].map(t=>t/255),h=Math.max(i,n,s),o=Math.min(i,n,s),a=(h+o)/2,u=h===o,l=h-o;return new ut(360*(u?0:h===i?((n-s)/l+(n<s?6:0))/6:h===n?((s-i)/l+2)/6:h===s?((i-n)/l+4)/6:0),100*(u?0:a>.5?l/(2-h-o):l/(h+o)),100*a,"hsl")}cmyk(){const{_a:t,_b:e,_c:r}=this.rgb(),[i,n,s]=[t,e,r].map(t=>t/255),h=Math.min(1-i,1-n,1-s);return 1===h?new ut(0,0,0,1,"cmyk"):new ut((1-i-h)/(1-h),(1-n-h)/(1-h),(1-s-h)/(1-h),h,"cmyk")}_clamped(){let{_a:t,_b:e,_c:r}=this.rgb(),{max:i,min:n,round:s}=Math;return[t,e,r].map(t=>i(0,n(s(t),255)))}toHex(){let[t,e,r]=this._clamped().map(ht);return`#${t}${e}${r}`}toString(){return this.toHex()}toRgb(){let[t,e,r]=this._clamped();return`rgb(${t},${e},${r})`}toArray(){let{_a:t,_b:e,_c:r,_d:i,space:n}=this;return[t,e,r,i,n]}static random(t="vibrant",e,r){const{random:i,round:n,sin:s,PI:h}=Math;if("vibrant"===t){const t=24*i()+57,e=38*i()+45,r=360*i();return new ut(t,e,r,"lch")}if("sine"===t){const t=n(80*s(2*h*(e=null==e?i():e)/.5+.01)+150),r=n(50*s(2*h*e/.5+4.6)+200),o=n(100*s(2*h*e/.5+2.3)+150);return new ut(t,r,o)}if("pastel"===t){const t=8*i()+86,e=17*i()+9,r=360*i();return new ut(t,e,r,"lch")}if("dark"===t){const t=10+10*i(),e=50*i()+86,r=360*i();return new ut(t,e,r,"lch")}if("rgb"===t){const t=255*i(),e=255*i(),r=255*i();return new ut(t,e,r)}if("lab"===t){const t=100*i(),e=256*i()-128,r=256*i()-128;return new ut(t,e,r,"lab")}if("grey"===t){const t=255*i();return new ut(t,t,t)}}static test(t){return"string"==typeof t&&(B.test(t)||H.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static isColor(t){return t&&(t instanceof ut||this.isRgb(t)||this.test(t))}}class lt{constructor(...t){this.init(...t)}init(t,e){let r,i=0,n=0;return r=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:e},this.x=null==r.x?i:r.x,this.y=null==r.y?n:r.y,this}clone(){return new lt(this)}transform(t){return this.clone().transformO(t)}transformO(t){ft.isMatrixLike(t)||(t=new ft(t));let{x:e,y:r}=this;return this.x=t.a*e+t.c*r+t.e,this.y=t.b*e+t.d*r+t.f,this}toArray(){return[this.x,this.y]}}function ct(t,e,r){return Math.abs(e-t)<(r||1e-6)}class ft{constructor(...t){this.init(...t)}init(t){var e=ft.fromArray([1,0,0,1,0,0]);return t=t instanceof jt?t.matrixify():"string"==typeof t?ft.fromArray(t.split(U).map(parseFloat)):Array.isArray(t)?ft.fromArray(t):"object"==typeof t&&ft.isMatrixLike(t)?t:"object"==typeof t?(new ft).transform(t):6===arguments.length?ft.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}clone(){return new ft(this)}transform(t){if(ft.isMatrixLike(t))return new ft(t).multiplyO(this);var e=ft.formatTransforms(t);let{x:r,y:i}=new lt(e.ox,e.oy).transform(this);var n=(new ft).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-r,-i).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(r,i);if(isFinite(e.px)||isFinite(e.py)){const t=new lt(r,i).transform(n),s=e.px?e.px-t.x:0,h=e.py?e.py-t.y:0;n.translateO(s,h)}return n.translateO(e.tx,e.ty),n}compose(t){t.origin&&(t.originX=t.origin[0],t.originY=t.origin[1]);var e=t.originX||0,r=t.originY||0,i=t.scaleX||1,n=t.scaleY||1,s=t.shear||0,h=t.rotate||0,o=t.translateX||0,a=t.translateY||0;return(new ft).translateO(-e,-r).scaleO(i,n).shearO(s).rotateO(h).translateO(o,a).lmultiplyO(this).translateO(e,r)}decompose(t=0,e=0){var r=this.a,i=this.b,n=this.c,s=this.d,h=this.e,o=this.f,a=r*s-i*n,u=a>0?1:-1,l=u*Math.sqrt(r*r+i*i),c=Math.atan2(u*i,u*r),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(r*n+i*s)/a,y=n*l/(m*r-i)||s*l/(m*i+r);return{scaleX:l,scaleY:y,shear:m,rotate:f,translateX:h-t+t*d*l+e*(m*d*l-p*y),translateY:o-e+t*p*l+e*(m*p*l+d*y),originX:t,originY:e,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){var e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(this,e,this)}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){var e=t instanceof ft?t:new ft(t);return ft.matrixMultiply(e,this,this)}inverseO(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.e,s=this.f,h=t*i-e*r;if(!h)throw new Error("Cannot invert "+this);var o=i/h,a=-e/h,u=-r/h,l=t/h,c=-(o*n+u*s),f=-(a*n+l*s);return this.a=o,this.b=a,this.c=u,this.d=l,this.e=c,this.f=f,this}inverse(){return this.clone().inverseO()}translate(t,e){return this.clone().translateO(t,e)}translateO(t,e){return this.e+=t||0,this.f+=e||0,this}scale(t,e,r,i){return this.clone().scaleO(...arguments)}scaleO(t,e=t,r=0,i=0){3===arguments.length&&(i=r,r=e,e=t);let{a:n,b:s,c:h,d:o,e:a,f:u}=this;return this.a=n*t,this.b=s*e,this.c=h*t,this.d=o*e,this.e=a*t-r*t+r,this.f=u*e-i*e+i,this}rotate(t,e,r){return this.clone().rotateO(t,e,r)}rotateO(t,e=0,r=0){t=p(t);let i=Math.cos(t),n=Math.sin(t),{a:s,b:h,c:o,d:a,e:u,f:l}=this;return this.a=s*i-h*n,this.b=h*i+s*n,this.c=o*i-a*n,this.d=a*i+o*n,this.e=u*i-l*n+r*n-e*i+e,this.f=l*i+u*n-e*n-r*i+r,this}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)}shear(t,e,r){return this.clone().shearO(t,e,r)}shearO(t,e=0,r=0){let{a:i,b:n,c:s,d:h,e:o,f:a}=this;return this.a=i+n*t,this.c=s+h*t,this.e=o+a*t-r*t,this}skew(t,e,r,i){return this.clone().skewO(...arguments)}skewO(t,e=t,r=0,i=0){3===arguments.length&&(i=r,r=e,e=t),t=p(t),e=p(e);let n=Math.tan(t),s=Math.tan(e),{a:h,b:o,c:a,d:u,e:l,f:c}=this;return this.a=h+o*n,this.b=o+h*s,this.c=a+u*n,this.d=u+a*s,this.e=l+c*n-i*n,this.f=c+l*s-r*s,this}skewX(t,e,r){return this.skew(t,0,e,r)}skewXO(t,e,r){return this.skewO(t,0,e,r)}skewY(t,e,r){return this.skew(0,t,e,r)}skewYO(t,e,r){return this.skewO(0,t,e,r)}aroundO(t,e,r){var i=t||0,n=e||0;return this.translateO(-i,-n).lmultiplyO(r).translateO(i,n)}around(t,e,r){return this.clone().aroundO(t,e,r)}equals(t){var e=new ft(t);return ct(this.a,e.a)&&ct(this.b,e.b)&&ct(this.c,e.c)&&ct(this.d,e.d)&&ct(this.e,e.e)&&ct(this.f,e.f)}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}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 formatTransforms(t){var e="both"===t.flip||!0===t.flip,r=t.flip&&(e||"x"===t.flip)?-1:1,i=t.flip&&(e||"y"===t.flip)?-1:1,n=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,h=t.scale&&t.scale.length?t.scale[0]*r:isFinite(t.scale)?t.scale*r:isFinite(t.scaleX)?t.scaleX*r:r,o=t.scale&&t.scale.length?t.scale[1]*i:isFinite(t.scale)?t.scale*i:isFinite(t.scaleY)?t.scaleY*i:i,a=t.shear||0,u=t.rotate||t.theta||0,l=new lt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),c=l.x,f=l.y,d=new lt(t.position||t.px||t.positionX,t.py||t.positionY),p=d.x,m=d.y,y=new lt(t.translate||t.tx||t.translateX,t.ty||t.translateY),g=y.x,x=y.y,w=new lt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:h,scaleY:o,skewX:n,skewY:s,shear:a,theta:u,rx:w.x,ry:w.y,tx:g,ty:x,ox:c,oy:f,px:p,py:m}}static matrixMultiply(t,e,r){var i=t.a*e.a+t.c*e.b,n=t.b*e.a+t.d*e.b,s=t.a*e.c+t.c*e.d,h=t.b*e.c+t.d*e.d,o=t.e+t.a*e.e+t.c*e.f,a=t.f+t.b*e.e+t.d*e.f;return r.a=i,r.b=n,r.c=s,r.d=h,r.e=o,r.f=a,r}}function dt(){if(!dt.nodes){let t=k().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false");let e=t.path().node;dt.nodes={svg:t,path:e}}if(!dt.nodes.svg.node.parentNode){let t=S.document.body||S.document.documentElement;dt.nodes.svg.addTo(t)}return dt.nodes}function pt(t){return!(t.width||t.height||t.x||t.y)}N(ft);class mt{constructor(...t){this.init(...t)}init(t){return t="string"==typeof t?t.split(U).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}merge(t){let e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width)-e,n=Math.max(this.y+this.height,t.y+t.height)-r;return new mt(e,r,i,n)}transform(t){t instanceof ft||(t=new ft(t));let e=1/0,r=-1/0,i=1/0,n=-1/0;return[new lt(this.x,this.y),new lt(this.x2,this.y),new lt(this.x,this.y2),new lt(this.x2,this.y2)].forEach(function(s){s=s.transform(t),e=Math.min(e,s.x),r=Math.max(r,s.x),i=Math.min(i,s.y),n=Math.max(n,s.y)}),new mt(e,i,r-e,n-i)}addOffset(){return this.x+=S.window.pageXOffset,this.y+=S.window.pageYOffset,this}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}toArray(){return[this.x,this.y,this.width,this.height]}isNulled(){return pt(this)}}function yt(t,e){let r;try{if(pt(r=t(this.node))&&((i=this.node)!==S.document&&!(S.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===S.document}).call(S.document.documentElement,i)))throw new Error("Element not in the dom")}catch(t){r=e(this)}var i;return r}l({viewbox:{viewbox(t,e,r,i){return null==t?new mt(this.attr("viewBox")):this.attr("viewBox",new mt(t,e,r,i))},zoom(t,e){let r=this.node.clientWidth,i=this.node.clientHeight;const n=this.viewbox();if(!r&&!i){var s=window.getComputedStyle(this.node);r=parseFloat(s.getPropertyValue("width")),i=parseFloat(s.getPropertyValue("height"))}const h=r/n.width,o=i/n.height,a=Math.min(h,o);if(null==t)return a;let u=a/t;u===1/0&&(u=Number.MIN_VALUE),e=e||new lt(r/2/h+n.x,i/2/o+n.y);const l=new mt(n).transform(new ft({scale:u,origin:e}));return this.viewbox(l)}}}),N(mt);const gt=function(){try{return Function("name","baseClass","_constructor",["baseClass = baseClass || Array","return {","  [name]: class extends baseClass {","    constructor (...args) {","      super(...args)","      _constructor && _constructor.apply(this, args)","    }","  }","}[name]"].join("\n"))}catch(t){return(t,e=Array,r)=>{const i=function(){e.apply(this,arguments),r&&r.apply(this,arguments)};return(i.prototype=Object.create(e.prototype)).constructor=i,i.prototype.map=function(t){const e=new i;return e.push.apply(e,Array.prototype.map.call(this,t)),e},i}}}(),xt=gt("List",Array,function(t=[]){if("number"==typeof t)return this;this.length=0,this.push(...t)});var wt=xt;z(xt,{each(t,...e){return"function"==typeof t?this.map(e=>t.call(e,e)):this.map(r=>r[t](...e))},toArray(){return Array.prototype.concat.apply([],this)}});const vt=["toArray","constructor","each"];function _t(t,e){return new wt(d((e||S.document).querySelectorAll(t),function(t){return E(t)}))}xt.extend=function(t){t=t.reduce((t,e)=>vt.includes(e)?t:"_"===e[0]?t:(t[e]=function(...t){return this.each(e,...t)},t),{}),z(xt,t)};class bt extends M{constructor({events:t={}}={}){super(),this.events=t}addEventListener(){}dispatch(t,e){return function(t,e,r){var i=it(t);return e instanceof S.window.Event?i.dispatchEvent(e):(e=new S.window.CustomEvent(e,{detail:r,cancelable:!0}),i.dispatchEvent(e)),e}(this,t,e)}dispatchEvent(t){const e=this.getEventHolder().events;if(!e)return!0;const r=e[t.type];for(let e in r)for(let i in r[e])r[e][i](t);return!t.defaultPrevented}fire(t,e){return this.dispatch(t,e),this}getEventHolder(){return this}getEventTarget(){return this}off(t,e){return st(this,t,e),this}on(t,e,r,i){return nt(this,t,e,r,i),this}removeEventListener(){}}function St(){}N(bt);let Mt={duration:400,ease:">",delay:0},At={"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"};const Ot=gt("SVGArray",Array,function(t){this.init(t)});var Ct=Ot;z(Ot,{init(t){return"number"==typeof t?this:(this.length=0,this.push(...this.parse(t)),this)},toArray(){return Array.prototype.concat.apply([],this)},toString(){return this.join(" ")},valueOf(){const t=[];return t.push(...this),t},parse:(t=[])=>t instanceof Array?t:t.trim().split(U).map(parseFloat),clone(){return new this.constructor(this)},toSet(){return new Set(this)}});class kt{constructor(...t){this.init(...t)}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?-3.4e38:3.4e38:"string"==typeof t?(e=t.match(q))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof kt&&(this.value=t.valueOf(),this.unit=t.unit),this}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}toJSON(){return this.toString()}toArray(){return[this.value,this.unit]}valueOf(){return this.value}plus(t){return t=new kt(t),new kt(this+t,this.unit||t.unit)}minus(t){return t=new kt(t),new kt(this-t,this.unit||t.unit)}times(t){return t=new kt(t),new kt(this*t,this.unit||t.unit)}divide(t){return t=new kt(t),new kt(this/t,this.unit||t.unit)}convert(t){return new kt(this.value,t)}}const Tt=[];class Et extends bt{constructor(t,e){super(t),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return t=k(t),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){return k(t).put(this)}children(){return new wt(d(this.node.children,function(t){return E(t)}))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(){return this.writeDataToDom(),function t(e){for(var r=e.children.length-1;r>=0;r--)t(e.children[r]);return e.id?E(e).id(F(e.nodeName)):E(e)}(this.node.cloneNode(!0))}each(t,e){var r,i,n=this.children();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){return this.put(new Et(C(t)))}first(){return E(this.node.firstChild)}get(t){return E(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}id(t){return void 0!==t||this.node.id||(this.node.id=F(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return E(this.node.lastChild)}matches(t){const e=this.node;return(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,t)}parent(t){var e=this;if(!e.node.parentNode)return null;if(e=E(e.node.parentNode),!t)return e;for(;e;){if("string"==typeof t?e.matches(t):e instanceof t)return e;if(!e.node.parentNode||"#document"===e.node.parentNode.nodeName||"#document-fragment"===e.node.parentNode.nodeName)return null;e=E(e.node.parentNode)}}put(t,e){return this.add(t,e),t}putIn(t){return k(t).add(this)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=k(t),this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,e){const r=10**t,i=this.attr();e||(e=Object.keys(i));const n={};return e.forEach(t=>{n[t]=Math.round(i[t]*r)/r}),this.attr(n),this}toString(){return this.id()}svg(t,e){var r,i,n;if(!1===t&&(e=!1,t=null),null==t||"function"==typeof t){e=null==e||e,this.writeDataToDom();let r=this;if(null!=t){if(r=E(r.node.cloneNode(!0)),e){let e=t(r);if(r=e||r,!1===e)return""}r.each(function(){let e=t(this),r=e||this;!1===e?this.remove():e&&this!==r&&this.replace(r)},!0)}return e?r.node.outerHTML:r.node.innerHTML}for(e=null!=e&&e,r=S.document.createElementNS(w,"svg"),n=S.document.createDocumentFragment(),r.innerHTML=t,i=r.children.length;i--;)n.appendChild(r.firstElementChild);let s=this.parent();return e?this.replace(n)&&s:this.add(n)}words(t){return this.node.textContent=t,this}writeDataToDom(){return this.each(function(){this.writeDataToDom()}),this}}z(Et,{attr:function(t,e,r){if(null==t){t={},e=this.node.attributes;for(let r of e)t[r.nodeName]=W.test(r.nodeValue)?parseFloat(r.nodeValue):r.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))?At[t]:W.test(e)?parseFloat(e):e;"number"==typeof(e=Tt.reduce((e,r)=>r(t,e,this),e))?e=new kt(e):ut.isColor(e)?e=new ut(e):e.constructor===Array&&(e=new Ct(e)),"leading"===t?this.leading&&this.leading(e):"string"==typeof r?this.node.setAttributeNS(r,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return _t(t,this.node)},findOne:function(t){return E(this.node.querySelector(t))}}),N(Et);class jt extends Et{constructor(t,e){super(t,e),this.dom={},this.node.instance=this,t.hasAttribute("svgjs:data")&&this.setData(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(){return this.root().defs()}dmove(t,e){return this.dx(t).dy(e)}dx(t){return this.x(new kt(t).plus(this.x()))}dy(t){return this.y(new kt(t).plus(this.y()))}root(){let t=this.parent(A[O]);return t&&t.root()}getEventHolder(){return this}height(t){return this.attr("height",t)}inside(t,e){let r=this.bbox();return t>r.x&&e>r.y&&t<r.x+r.width&&e<r.y+r.height}move(t,e){return this.x(t).y(e)}parents(t=S.document){t=k(t);let e=new wt,r=this;for(;(r=r.parent())&&r.node!==t.node&&r.node!==S.document;)e.push(r);return e}reference(t){if(!(t=this.attr(t)))return null;const e=t.match(P);return e?k(e[1]):null}setData(t){return this.dom=t,this}size(t,e){let r=g(this,t,e);return this.width(new kt(r.width)).height(new kt(r.height))}width(t){return this.attr("width",t)}writeDataToDom(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}z(jt,{bbox:function(){return new mt(yt.call(this,t=>t.getBBox(),t=>{try{let e=t.clone().addTo(dt().svg).show(),r=e.node.getBBox();return e.remove(),r}catch(e){throw new Error('Getting bbox of element "'+t.node.nodeName+'" is not possible. '+e.toString())}}))},rbox:function(t){let e=new mt(yt.call(this,t=>t.getBoundingClientRect(),t=>{throw new Error('Getting rbox of element "'+t.node.nodeName+'" is not possible')}));return t?e.transform(t.screenCTM().inverse()):e.addOffset()},point:function(t,e){return new lt(t,e).transform(this.screenCTM().inverse())},ctm:function(){return new ft(this.node.getCTM())},screenCTM:function(){if("function"==typeof this.isRoot&&!this.isRoot()){var t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new ft(e)}return new ft(this.node.getScreenCTM())}}),N(jt);var Nt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};function Dt(t){return this.attr("rx",t)}function Ft(t){return this.attr("ry",t)}function zt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Rt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function qt(t){return null==t?this.attr("cx"):this.attr("cx",t)}function It(t){return null==t?this.attr("cy"):this.attr("cy",t)}function Lt(t){return null==t?2*this.rx():this.rx(new kt(t).divide(2))}function Pt(t){return null==t?2*this.ry():this.ry(new kt(t).divide(2))}["fill","stroke"].forEach(function(t){var e,r={};r[t]=function(r){if(void 0===r)return this.attr(t);if("string"==typeof r||r instanceof ut||ut.isRgb(r)||r instanceof jt)this.attr(t,r);else for(e=Nt[t].length-1;e>=0;e--)null!=r[Nt[t][e]]&&this.attr(Nt.prefix(t,Nt[t][e]),r[Nt[t][e]]);return this},l(["Element","Runner"],r)}),l(["Element","Runner"],{matrix:function(t,e,r,i,n,s){return null==t?new ft(this):this.attr("transform",new ft(t,e,r,i,n,s))},rotate:function(t,e,r){return this.transform({rotate:t,ox:e,oy:r},!0)},skew:function(t,e,r,i){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:r},!0):this.transform({skew:[t,e],ox:r,oy:i},!0)},shear:function(t,e,r){return this.transform({shear:t,ox:e,oy:r},!0)},scale:function(t,e,r,i){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:r},!0):this.transform({scale:[t,e],ox:r,oy:i},!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,e){var r="string"==typeof t?t:(isFinite(t),"both"),i="both"===t&&isFinite(e)?[e,e]:"x"===t?[e,0]:"y"===t?[0,e]:isFinite(t)?[t,t]:[0,0];return this.transform({flip:r,origin:i},!0)},opacity:function(t){return this.attr("opacity",t)}}),l("radius",{radius:function(t,e){var r=(this._element||this).type;return"radialGradient"===r||"radialGradient"===r?this.attr("r",new kt(t)):this.rx(t).ry(null==e?t:e)}}),l("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new lt(this.node.getPointAtLength(t))}}),l(["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)}}),l("Text",{ax(t){return this.attr("x",t)},ay(t){return this.attr("y",t)},amove(t,e){return this.ax(t).ay(e)}}),l("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce(function(t,e){return t[e]=function(t){return null===t?st(this,e):nt(this,e,t),this},t},{})),l("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(X).slice(0,-1).map(function(t){var e=t.trim().split("(");return[e[0],e[1].split(U).map(function(t){return parseFloat(t)})]}).reverse().reduce(function(t,e){return"matrix"===e[0]?t.lmultiply(ft.fromArray(e[1])):t[e[0]].apply(t,e[1])},new ft)},toParent:function(t){if(this===t)return this;var e=this.screenCTM(),r=t.screenCTM().inverse();return this.addTo(t).untransform().transform(r.multiply(e)),this},toRoot:function(){return this.toParent(this.root())},transform:function(t,e){if(null==t||"string"==typeof t){var r=new ft(this).decompose();return r[t]||r}ft.isMatrixLike(t)||(t={...t,origin:x(t,this)});var i=new ft(!0===e?this:e||!1).transform(t);return this.attr("transform",i)}});class Xt extends jt{}N(Xt);class Yt extends Xt{constructor(t){super(T("circle",t),t)}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 kt(t).divide(2))}}z(Yt,{x:zt,y:Rt,cx:qt,cy:It,width:Lt,height:Pt}),l({Container:{circle:R(function(t){return this.put(new Yt).size(t).move(0,0)})}}),N(Yt);class Bt extends jt{flatten(t){return this.each(function(){return this instanceof Bt?this.flatten(t).ungroup(t):this.toParent(t)}),this.node.firstElementChild||this.remove(),this}ungroup(t){return t=t||this.parent(),this.each(function(){return this.toParent(t)}),this.remove(),this}}N(Bt);class Ht extends Bt{constructor(t){super(T("defs",t),t)}flatten(){return this}ungroup(){return this}}N(Ht);class Gt extends Xt{constructor(t){super(T("ellipse",t),t)}size(t,e){var r=g(this,t,e);return this.rx(new kt(r.width).divide(2)).ry(new kt(r.height).divide(2))}}z(Gt,i),l("Container",{ellipse:R(function(t=0,e=t){return this.put(new Gt).size(t,e).move(0,0)})}),N(Gt);class Wt extends jt{constructor(t){super(T("stop",t),t)}update(t){return("number"==typeof t||t instanceof kt)&&(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 kt(t.offset)),this}}function Vt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new kt(t),fy:new kt(e)}):this.attr({x1:new kt(t),y1:new kt(e)})}function Ut(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new kt(t),cy:new kt(e)}):this.attr({x2:new kt(t),y2:new kt(e)})}N(Wt);class $t extends Bt{constructor(t,e){super(T(t+"Gradient","string"==typeof t?null:t),e)}stop(t,e,r){return this.put(new Wt).update(t,e,r)}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}toString(){return this.url()}attr(t,e,r){return"transform"===t&&(t="gradientTransform"),super.attr(t,e,r)}targets(){return _t('svg [fill*="'+this.id()+'"]')}bbox(){return new mt}}z($t,n),l({Container:{gradient:R(function(t,e){return this.defs().gradient(t,e)})},Defs:{gradient:R(function(t,e){return this.put(new $t(t)).update(e)})}}),N($t);class Qt extends Bt{constructor(t){super(T("pattern",t),t)}url(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}toString(){return this.url()}attr(t,e,r){return"transform"===t&&(t="patternTransform"),super.attr(t,e,r)}targets(){return _t('svg [fill*="'+this.id()+'"]')}bbox(){return new mt}}l({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:R(function(t,e,r){return this.put(new Qt).update(r).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})})}}),N(Qt);class Zt extends Xt{constructor(t){super(T("image",t),t)}load(t,e){if(!t)return this;var r=new S.window.Image;return nt(r,"load",function(t){var i=this.parent(Qt);0===this.width()&&0===this.height()&&this.size(r.width,r.height),i instanceof Qt&&0===i.width()&&0===i.height()&&i.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)},this),nt(r,"load error",function(){st(r)}),this.attr("href",r.src=t,_)}}var Jt;Jt=function(t,e,r){return"fill"!==t&&"stroke"!==t||V.test(e)&&(e=r.root().defs().image(e)),e instanceof Zt&&(e=r.root().defs().pattern(0,0,t=>{t.add(e)})),e},Tt.push(Jt),l({Container:{image:R(function(t,e){return this.put(new Zt).size(0,0).load(t,e)})}}),N(Zt);const Kt=gt("PointArray",Ct);var te=Kt;z(Kt,{toString(){for(var t=0,e=this.length,r=[];t<e;t++)r.push(this[t].join(","));return r.join(" ")},toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}},at(t){if(!this.destination)return this;for(var e=0,r=this.length,i=[];e<r;e++)i.push([this[e][0]+(this.destination[e][0]-this[e][0])*t,this[e][1]+(this.destination[e][1]-this[e][1])*t]);return new Kt(i)},parse(t=[[0,0]]){var e=[];if(t instanceof Array){if(t[0]instanceof Array)return t}else t=t.trim().split(U).map(parseFloat);t.length%2!=0&&t.pop();for(var r=0,i=t.length;r<i;r+=2)e.push([t[r],t[r+1]]);return e},transform(t){const e=[];for(let r=0;r<this.length;r++){const i=this[r];e.push([t.a*i[0]+t.c*i[1]+t.e,t.b*i[0]+t.d*i[1]+t.f])}return new Kt(e)},move(t,e){var r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(var i=this.length-1;i>=0;i--)this[i]=[this[i][0]+t,this[i][1]+e];return this},size(t,e){var r,i=this.bbox();for(r=this.length-1;r>=0;r--)i.width&&(this[r][0]=(this[r][0]-i.x)*t/i.width+i.x),i.height&&(this[r][1]=(this[r][1]-i.y)*e/i.height+i.y);return this},bbox(){var t=-1/0,e=-1/0,r=1/0,i=1/0;return this.forEach(function(n){t=Math.max(n[0],t),e=Math.max(n[1],e),r=Math.min(n[0],r),i=Math.min(n[1],i)}),{x:r,y:i,width:t-r,height:e-i}}});let ee=te;function re(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function ie(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function ne(t){let e=this.bbox();return null==t?e.width:this.size(t,e.height)}function se(t){let e=this.bbox();return null==t?e.height:this.size(e.width,t)}class he extends Xt{constructor(t){super(T("line",t),t)}array(){return new te([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}plot(t,e,r,i){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:r,y2:i}:new te(t).toLine(),this.attr(t))}move(t,e){return this.attr(this.array().move(t,e).toLine())}size(t,e){var r=g(this,t,e);return this.attr(this.array().size(r.width,r.height).toLine())}}z(he,s),l({Container:{line:R(function(...t){return he.prototype.plot.apply(this.put(new he),null!=t[0]?t:[0,0,0,0])})}}),N(he);class oe extends Bt{constructor(t){super(T("marker",t),t)}width(t){return this.attr("markerWidth",t)}height(t){return this.attr("markerHeight",t)}ref(t,e){return this.attr("refX",t).attr("refY",e)}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}toString(){return"url(#"+this.id()+")"}}function ae(t,e){return function(r){return null==r?this[r]:(this[t]=r,e&&e.call(this),this)}}l({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:R(function(t,e,r){return this.put(new oe).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(r)})},marker:{marker(t,e,r,i){var n=["marker"];return"all"!==t&&n.push(t),n=n.join("-"),t=arguments[1]instanceof oe?arguments[1]:this.defs().marker(e,r,i),this.attr(n,t)}}}),N(oe);let ue={"-":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,r,i){return function(n){return n<0?t>0?e/t*n:r>0?i/r*n:0:n>1?r<1?(1-i)/(1-r)*n+(i-r)/(1-r):t<1?(1-e)/(1-t)*n+(e-t)/(1-t):1:3*n*(1-n)**2*e+3*n**2*(1-n)*i+n**3}},steps:function(t,e="end"){e=e.split("-").reverse()[0];let r=t;return"none"===e?--r:"both"===e&&++r,(i,n=!1)=>{let s=Math.floor(i*t);const h=i*s%1==0;return"start"!==e&&"both"!==e||++s,n&&h&&--s,i>=0&&s<0&&(s=0),i<=1&&s>r&&(s=r),s/r}}};class le{done(){return!1}}class ce extends le{constructor(t){super(),this.ease=ue[t||Mt.ease]||t}step(t,e,r){return"number"!=typeof t?r<1?t:e:t+(e-t)*this.ease(r)}}class fe extends le{constructor(t){super(),this.stepper=t}step(t,e,r,i){return this.stepper(t,e,r,i)}done(t){return t.done}}function de(){var t=(this._duration||500)/1e3,e=this._overshoot||0,r=Math.PI,i=Math.log(e/100+1e-10),n=-i/Math.sqrt(r*r+i*i),s=3.9/(n*t);this.d=2*n*s,this.k=s*s}z(class extends fe{constructor(t,e){super(),this.duration(t||500).overshoot(e||0)}step(t,e,r,i){if("string"==typeof t)return t;if(i.done=r===1/0,r===1/0)return e;if(0===r)return t;r>100&&(r=16),r/=1e3;var n=i.velocity||0,s=-this.d*n-this.k*(t-e),h=t+n*r+s*r*r/2;return i.velocity=n+s*r,i.done=Math.abs(e-h)+Math.abs(n)<.002,i.done?e:h}},{duration:ae("_duration",de),overshoot:ae("_overshoot",de)});z(class extends fe{constructor(t,e,r,i){super(),t=null==t?.1:t,e=null==e?.01:e,r=null==r?0:r,i=null==i?1e3:i,this.p(t).i(e).d(r).windup(i)}step(t,e,r,i){if("string"==typeof t)return t;if(i.done=r===1/0,r===1/0)return e;if(0===r)return t;var n=e-t,s=(i.integral||0)+n*r,h=(n-(i.error||0))/r,o=this.windup;return!1!==o&&(s=Math.max(-o,Math.min(s,o))),i.error=n,i.integral=s,i.done=Math.abs(n)<.001,i.done?e:t+(this.P*n+this.I*s+this.D*h)}},{windup:ae("windup"),p:ae("P"),i:ae("I"),d:ae("D")});const pe=gt("PathArray",Ct);var me=pe;function ye(t,e,r,i){return r+i.replace(K," .")}const ge={M:function(t,e,r){return e.x=r.x=t[0],e.y=r.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,r){return e.x=r.x,e.y=r.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]]}};let xe="mlhvqtcsaz".split("");for(var we=0,ve=xe.length;we<ve;++we)ge[xe[we]]=function(t){return function(e,r,i){if("H"===t)e[0]=e[0]+r.x;else if("V"===t)e[0]=e[0]+r.y;else if("A"===t)e[5]=e[5]+r.x,e[6]=e[6]+r.y;else for(var n=0,s=e.length;n<s;++n)e[n]=e[n]+(n%2?r.y:r.x);return ge[t](e,r,i)}}(xe[we].toUpperCase());z(pe,{toString(){return function(t){for(var e=0,r=t.length,i="";e<r;e++)i+=t[e][0],null!=t[e][1]&&(i+=t[e][1],null!=t[e][2]&&(i+=" ",i+=t[e][2],null!=t[e][3]&&(i+=" ",i+=t[e][3],i+=" ",i+=t[e][4],null!=t[e][5]&&(i+=" ",i+=t[e][5],i+=" ",i+=t[e][6],null!=t[e][7]&&(i+=" ",i+=t[e][7])))));return i+" "}(this)},move(t,e){var r=this.bbox();if(t-=r.x,e-=r.y,!isNaN(t)&&!isNaN(e))for(var i,n=this.length-1;n>=0;n--)"M"===(i=this[n][0])||"L"===i||"T"===i?(this[n][1]+=t,this[n][2]+=e):"H"===i?this[n][1]+=t:"V"===i?this[n][1]+=e:"C"===i||"S"===i||"Q"===i?(this[n][1]+=t,this[n][2]+=e,this[n][3]+=t,this[n][4]+=e,"C"===i&&(this[n][5]+=t,this[n][6]+=e)):"A"===i&&(this[n][6]+=t,this[n][7]+=e);return this},size(t,e){var r,i,n=this.bbox();for(r=this.length-1;r>=0;r--)"M"===(i=this[r][0])||"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},equalCommands(t){var e,r,i;for(t=new pe(t),i=this.length===t.length,e=0,r=this.length;i&&e<r;e++)i=this[e][0]===t[e][0];return i},morph(t){return t=new pe(t),this.equalCommands(t)?this.destination=t:this.destination=null,this},at(t){if(!this.destination)return this;var e,r,i,n,s=this.destination.value,h=[],o=new pe;for(e=0,r=this.length;e<r;e++){for(h[e]=[this[e][0]],i=1,n=this[e].length;i<n;i++)h[e][i]=this[e][i]+(s[e][i]-this[e][i])*t;"A"===h[e][0]&&(h[e][4]=+(0!==h[e][4]),h[e][5]=+(0!==h[e][5]))}return o.value=h,o},parse(t=[["M",0,0]]){if(t instanceof pe)return t;var e,r={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};t="string"==typeof t?t.replace(J,ye).replace(Q," $& ").replace($,"$1 -").trim().split(U):t.reduce(function(t,e){return[].concat.call(t,e)},[]);var i=[],n=new lt,s=new lt,h=0,o=t.length;do{Z.test(t[h])?(e=t[h],++h):"M"===e?e="L":"m"===e&&(e="l"),i.push(ge[e].call(null,t.slice(h,h+=r[e.toUpperCase()]).map(parseFloat),n,s))}while(o>h);return i},bbox(){return dt().path.setAttribute("d",this.toString()),dt.nodes.path.getBBox()}});class _e{constructor(t){this._stepper=t||new ce("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}from(t){return null==t?this._from:(this._from=this._set(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){if(!this._type){var e=typeof t;"number"===e?this.type(kt):"string"===e?ut.isColor(t)?this.type(ut):U.test(t)?this.type(Q.test(t)?me:Ct):q.test(t)?this.type(kt):this.type(be):Ae.indexOf(t.constructor)>-1?this.type(t.constructor):Array.isArray(t)?this.type(Ct):"object"===e?this.type(Me):this.type(be)}var r=new this._type(t);return this._type===ut&&(r=this._to?r[this._to[4]]():this._from?r[this._from[4]]():r),r=r.toArray(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(r.length)).map(Object).map(function(t){return t.done=!0,t}),r}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}done(){return this._context.map(this._stepper.done).reduce(function(t,e){return t&&e},!0)}at(t){var e=this;return this._morphObj.fromArray(this._from.map(function(r,i){return e._stepper.step(r,e._to[i],t,e._context[i],e._context)}))}}class be{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}valueOf(){return this.value}toArray(){return[this.value]}}class Se{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,Se.defaults,t),this}toArray(){var t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}Se.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};class Me{constructor(...t){this.init(...t)}init(t){if(this.values=[],!Array.isArray(t)){t=t||{};var e=[];for(let r in t)e.push([r,t[r]]);return e.sort((t,e)=>t[0]-e[0]),this.values=e.reduce((t,e)=>t.concat(e),[]),this}this.values=t}valueOf(){for(var t={},e=this.values,r=0,i=e.length;r<i;r+=2)t[e[r]]=e[r+1];return t}toArray(){return this.values}}const Ae=[be,Se,Me];class Oe extends Xt{constructor(t){super(T("path",t),t)}array(){return this._array||(this._array=new me(this.attr("d")))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new me(t))}clear(){return delete this._array,this}move(t,e){return this.attr("d",this.array().move(t,e))}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)}size(t,e){var r=g(this,t,e);return this.attr("d",this.array().size(r.width,r.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}targets(){return _t('svg textpath [href*="'+this.id()+'"]')}}function Ce(){return this._array||(this._array=new te(this.attr("points")))}function ke(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new te(t))}function Te(){return delete this._array,this}function Ee(t,e){return this.attr("points",this.array().move(t,e))}function je(t,e){let r=g(this,t,e);return this.attr("points",this.array().size(r.width,r.height))}Oe.prototype.MorphArray=me,l({Container:{path:R(function(t){return this.put(new Oe).plot(t||new me)})}}),N(Oe);class Ne extends Xt{constructor(t){super(T("polygon",t),t)}}l({Container:{polygon:R(function(t){return this.put(new Ne).plot(t||new te)})}}),z(Ne,s),z(Ne,h),N(Ne);class De extends Xt{constructor(t){super(T("polyline",t),t)}}l({Container:{polyline:R(function(t){return this.put(new De).plot(t||new te)})}}),z(De,s),z(De,h),N(De);class Fe extends Xt{constructor(t){super(T("rect",t),t)}}z(Fe,{rx:Dt,ry:Ft}),l({Container:{rect:R(function(t,e){return this.put(new Fe).size(t,e)})}}),N(Fe);class ze{constructor(){this._first=null,this._last=null}push(t){var e=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}shift(){var 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}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}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}}const Re={nextDraw:null,frames:new ze,timeouts:new ze,immediates:new ze,timer:()=>S.window.performance||S.window.Date,transforms:[],frame(t){var e=Re.frames.push({run:t});return null===Re.nextDraw&&(Re.nextDraw=S.window.requestAnimationFrame(Re._draw)),e},timeout(t,e){e=e||0;var r=Re.timer().now()+e,i=Re.timeouts.push({run:t,time:r});return null===Re.nextDraw&&(Re.nextDraw=S.window.requestAnimationFrame(Re._draw)),i},immediate(t){var e=Re.immediates.push(t);return null===Re.nextDraw&&(Re.nextDraw=S.window.requestAnimationFrame(Re._draw)),e},cancelFrame(t){null!=t&&Re.frames.remove(t)},clearTimeout(t){null!=t&&Re.timeouts.remove(t)},cancelImmediate(t){null!=t&&Re.immediates.remove(t)},_draw(t){for(var e=null,r=Re.timeouts.last();(e=Re.timeouts.shift())&&(t>=e.time?e.run():Re.timeouts.push(e),e!==r););for(var i=null,n=Re.frames.last();i!==n&&(i=Re.frames.shift());)i.run(t);for(var s=null;s=Re.immediates.shift();)s();Re.nextDraw=Re.timeouts.first()||Re.frames.first()?S.window.requestAnimationFrame(Re._draw):null}};var qe=Re,Ie=function(t){var e=t.start,r=t.runner.duration();return{start:e,duration:r,end:e+r,runner:t.runner}};const Le=function(){let t=S.window;return(t.performance||t.Date).now()};class Pe extends bt{constructor(t=Le){super(),this._timeSource=t,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)}schedule(t,e,r){if(null==t)return this._runners.map(Ie);var i=0,n=this.getEndTime();if(e=e||0,null==r||"last"===r||"after"===r)i=n;else if("absolute"===r||"start"===r)i=e,e=0;else if("now"===r)i=this._time;else{if("relative"!==r)throw new Error('Invalid value for the "when" parameter');{let r=this._runners[t.id];r&&(i=r.start+e,e=0)}}t.unschedule(),t.timeline(this);const s=t.persist(),h={persist:null===s?this._persist:s,start:i+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(h),this._runners.sort((t,e)=>t.start-e.start),this._runnerIds=this._runners.map(t=>t.runner.id),this.updateTime()._continue(),this}unschedule(t){var e=this._runnerIds.indexOf(t.id);return e<0?this:(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null),this)}getEndTime(){var t=this._runners[this._runnerIds.indexOf(this._lastRunnerId)],e=t?t.runner.duration():0;return(t?t.start:0)+e}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}play(){return this._paused=!1,this.updateTime()._continue()}pause(){return this._paused=!0,this._continue()}stop(){return this.time(0),this.pause()}finish(){return this.time(this.getEndTime()+1),this.pause()}speed(t){return null==t?this._speed:(this._speed=t,this)}reverse(t){var e=this.speed();if(null==t)return this.speed(-e);var r=Math.abs(e);return this.speed(t?r:-r)}seek(t){return this.time(this._time+t)}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}persist(t){return null==t?this._persist:(this._persist=t,this)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}_stepFn(t=!1){var e=this._timeSource(),r=e-this._lastSourceTime;t&&(r=0);var i=this._speed*r+(this._time-this._lastStepTime);this._lastSourceTime=e,t||(this._time+=i,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(var n=this._runners.length;n--;){let t=this._runners[n],e=t.runner;this._time-t.start<=0&&e.reset()}for(var s=!1,h=0,o=this._runners.length;h<o;h++){let t=this._runners[h],e=t.runner,r=i,n=this._time-t.start;if(n<=0)s=!0;else if(n<r&&(r=n),e.active())if(e.step(r).done){if(!0!==t.persist){e.duration()-e.time()+this._time+t.persist<this._time&&(e.unschedule(),--h,--o)}}else s=!0}return s&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}_continue(t=!1){return qe.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():this._paused?this:(this._nextFrame=qe.frame(this._step),this)}active(){return!!this._nextFrame}}l({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new Pe,this._timeline):(this._timeline=t,this)}}});class Xe extends bt{constructor(t){super(),this.id=Xe.id++,t="function"==typeof(t=null==t?Mt.duration:t)?new fe(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof fe,this._stepper=this._isDeclarative?t:new ce,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ft,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}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}animate(t,e,r){var i=Xe.sanitise(t,e,r),n=new Xe(i.duration);return this._timeline&&n.timeline(this._timeline),this._element&&n.element(this._element),n.loop(i).schedule(e,r)}schedule(t,e,r){if(t instanceof Pe||(r=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,r),this}unschedule(){var t=this.timeline();return t&&t.unschedule(this),this}loop(t,e,r){return"object"==typeof t&&(e=t.swing,r=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=r||0,!0===this._times&&(this._times=1/0),this}delay(t){return this.animate(0,t)}queue(t,e,r,i){return this._queue.push({initialiser:t||St,runner:e||St,retarget:r,isTransform:i,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}during(t){return this.queue(null,t)}after(t){return this.on("finished",t)}time(t){if(null==t)return this._time;let e=t-this._time;return this.step(e),this}duration(){return this._times*(this._wait+this._duration)-this._wait}loops(t){var e=this._duration+this._wait;if(null==t){var r=Math.floor(this._time/e),i=(this._time-r*e)/this._duration;return Math.min(r+i,this._times)}var n=t%1,s=e*Math.floor(t)+this._duration*n;return this.time(s)}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){var e,r=this._time,i=this._duration,n=this._wait,s=this._times,h=this._swing,o=this._reverse;if(null==t){const t=function(t){var e=h*Math.floor(t%(2*(n+i))/(n+i)),r=e&&!o||!e&&o,s=Math.pow(-1,r)*(t%(n+i))/i+r;return Math.max(Math.min(s,1),0)};var a=s*(n+i)-n;return e=r<=0?Math.round(t(1e-5)):r<a?t(r):Math.round(t(a-1e-5))}var u=Math.floor(this.loops()),l=h&&u%2==0;return e=u+(l&&!o||o&&l?t:1-t),this.loops(e)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}step(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;var e=this.position(),r=this._lastPosition!==e&&this._time>=0;this._lastPosition=e;var i=this.duration(),n=this._lastTime<=0&&this._time>0,s=this._lastTime<i&&this._time>=i;this._lastTime=this._time,n&&this.fire("start",this);var h=this._isDeclarative;if(this.done=!h&&!s&&this._time>=i,this._reseted=!1,r||h){this._initialise(r),this.transforms=new ft;var o=this._run(h?t:e);this.fire("step",this)}return this.done=this.done||o&&h,s&&this.fire("finished",this),this}reset(){return this._reseted?this:(this.time(0),this._reseted=!0,this)}finish(){return this.step(1/0)}reverse(t){return this._reverse=null==t?!this._reverse:t,this}ease(t){return this._stepper=new ce(t),this}active(t){return null==t?this.enabled:(this.enabled=t,this)}_rememberMorpher(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){var r=this.timeline();r&&r.play()}}_tryRetarget(t,e,r){if(this._history[t]){if(!this._history[t].caller.initialised){let 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(e,r):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;var i=this.timeline();return i&&i.play(),!0}return!1}_initialise(t){if(t||this._isDeclarative)for(var e=0,r=this._queue.length;e<r;++e){var i=this._queue[e],n=this._isDeclarative||!i.initialised&&t;t=!i.finished,n&&t&&(i.initialiser.call(this),i.initialised=!0)}}_run(t){for(var e=!0,r=0,i=this._queue.length;r<i;++r){var n=this._queue[r],s=n.runner.call(this,t);n.finished=n.finished||!0===s,e=e&&n.finished}return e}addTransform(t,e){return this.transforms.lmultiplyO(t),this}clearTransform(){return this.transforms=new ft,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter(t=>!t.isTransform))}static sanitise(t,e,r){var i=1,n=!1,s=0;return t=t||Mt.duration,e=e||Mt.delay,r=r||"last","object"!=typeof t||t instanceof le||(e=t.delay||e,r=t.when||r,n=t.swing||n,i=t.times||i,s=t.wait||s,t=t.duration||Mt.duration),{duration:t,delay:e,swing:n,times:i,wait:s,when:r}}}Xe.id=0;class Ye{constructor(t=new ft,e=-1,r=!0){this.transforms=t,this.id=e,this.done=r}clearTransformsFromQueue(){}}z([Xe,Ye],{mergeWith(t){return new Ye(t.transforms.lmultiply(this.transforms),t.id)}});const Be=(t,e)=>t.lmultiplyO(e),He=t=>t.transforms;class Ge{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;let e=t.id+1;return this.runners.push(t),this.ids.push(e),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}remove(t){let e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}merge(){let t=null;return this.runners.forEach((e,r)=>{t&&e.done&&t.done&&(!e._timeline||!e._timeline._runnerIds.includes(e.id))&&(!t._timeline||!t._timeline._runnerIds.includes(t.id))&&(this.remove(e.id),this.edit(t.id,e.mergeWith(t))),t=e}),this}edit(t,e){let r=this.ids.indexOf(t+1);return this.ids.splice(r,1,t+1),this.runners.splice(r,1,e),this}length(){return this.ids.length}clearBefore(t){let e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Ye).forEach(t=>t.clearTransformsFromQueue()),this}}l({Element:{animate(t,e,r){var i=Xe.sanitise(t,e,r),n=this.timeline();return new Xe(i.duration).loop(i).element(this).timeline(n.play()).schedule(e,r)},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(He).reduce(Be,new ft)},_addRunner(t){this._transformationRunners.add(t),qe.cancelImmediate(this._frameId),this._frameId=qe.immediate(function(){let t=this._transformationRunners.runners.map(He).reduce(Be,new ft);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ge).add(new Ye(new ft(this))))}}}),z(Xe,{attr(t,e){return this.styleAttr("attr",t,e)},css(t,e){return this.styleAttr("css",t,e)},styleAttr(t,e,r){if("object"==typeof e){for(var i in e)this.styleAttr(t,i,e[i]);return this}var n=new _e(this._stepper).to(r);return this.queue(function(){n=n.from(this.element()[t](e))},function(r){return this.element()[t](e,n.at(r)),n.done()}),this},zoom(t,e){if(this._tryRetarget("zoom",Ut,e))return this;var r=new _e(this._stepper).to(new kt(t));return this.queue(function(){r=r.from(this.element().zoom())},function(t){return this.element().zoom(r.at(t),e),r.done()},function(t,i){e=i,r.to(t)}),this._rememberMorpher("zoom",r),this},transform(t,e,r){if(e=t.relative||e,this._isDeclarative&&!e&&this._tryRetarget("transform",t))return this;var i=ft.isMatrixLike(t);r=null!=t.affine?t.affine:null!=r?r:!i;const n=new _e(this._stepper).type(r?Se:ft);let s,h,o,a,u;return this.queue(function(){h=h||this.element(),s=s||x(t,h),u=new ft(e?void 0:h),h._addRunner(this),e||h._clearTransformRunnersBefore(this)},function(l){e||this.clearTransform();let{x:c,y:f}=new lt(s).transform(h._currentTransform(this)),d=new ft({...t,origin:[c,f]}),p=this._isDeclarative&&o?o:u;if(r){d=d.decompose(c,f),p=p.decompose(c,f);const t=d.rotate,e=p.rotate,r=[t-360,t,t+360],i=r.map(t=>Math.abs(t-e)),n=Math.min(...i),s=i.indexOf(n);d.rotate=r[s]}e&&(i||(d.rotate=t.rotate||0),this._isDeclarative&&a&&(p.rotate=a)),n.from(p),n.to(d);let m=n.at(l);return a=m.rotate,o=new ft(m),this.addTransform(o),h._addRunner(this),n.done()},function(e){(e.origin||"center").toString()!==(t.origin||"center").toString()&&(s=x(t,h)),t={...e,origin:s}},!0),this._isDeclarative&&this._rememberMorpher("transform",n),this},x(t,e){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},dx(t){return this._queueNumberDelta("x",t)},dy(t){return this._queueNumberDelta("y",t)},_queueNumberDelta(t,e){if(e=new kt(e),this._tryRetarget(t,e))return this;var r=new _e(this._stepper).to(e),i=null;return this.queue(function(){i=this.element()[t](),r.from(i),r.to(i+e)},function(e){return this.element()[t](r.at(e)),r.done()},function(t){r.to(i+new kt(t))}),this._rememberMorpher(t,r),this},_queueObject(t,e){if(this._tryRetarget(t,e))return this;var r=new _e(this._stepper).to(e);return this.queue(function(){r.from(this.element()[t]())},function(e){return this.element()[t](r.at(e)),r.done()}),this._rememberMorpher(t,r),this},_queueNumber(t,e){return this._queueObject(t,new kt(e))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,e){return this.x(t).y(e)},center(t,e){return this.cx(t).cy(e)},size(t,e){var r;return t&&e||(r=this._element.bbox()),t||(t=r.width/r.height*e),e||(e=r.height/r.width*t),this.width(t).height(e)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,e,r,i){if(4===arguments.length)return this.plot([t,e,r,i]);if(this._tryRetarget("plot",t))return this;var n=new _e(this._stepper).type(this._element.MorphArray).to(t);return this.queue(function(){n.from(this._element.array())},function(t){return this._element.plot(n.at(t)),n.done()}),this._rememberMorpher("plot",n),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,e,r,i){return this._queueObject("viewbox",new mt(t,e,r,i))},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(Xe,{rx:Dt,ry:Ft,from:Vt,to:Ut}),N(Xe);class We extends Bt{constructor(t){super(T("svg",t),t),this.namespace()}isRoot(){return!(this.node.parentNode&&this.node.parentNode instanceof S.window.SVGElement&&"#document"!==this.node.parentNode.nodeName)}root(){return this.isRoot()?this:super.root()}namespace(){return this.isRoot()?this.attr({xmlns:w,version:"1.1"}).attr("xmlns:xlink",_,v).attr("xmlns:svgjs",b,v):this.root().namespace()}defs(){return this.isRoot()?E(this.node.querySelector("defs"))||this.put(new Ht):this.root().defs()}parent(t){return this.isRoot()?"#document"===this.node.parentNode.nodeName?null:E(this.node.parentNode):super.parent(t)}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this}}l({Container:{nested:R(function(){return this.put(new We)})}}),N(We,"Svg",!0);class Ve extends Bt{constructor(t){super(T("symbol",t),t)}}function Ue(t){return!1===this._build&&this.clear(),this.node.appendChild(S.document.createTextNode(t)),this}function $e(){return this.node.getComputedTextLength()}l({Container:{symbol:R(function(){return this.put(new Ve)})}}),N(Ve);class Qe extends Xt{constructor(t){super(T("text",t),t),this.dom.leading=new kt(1.3),this._rebuild=!0,this._build=!1}x(t,e=this.bbox()){return null==t?e.x:this.attr("x",this.attr("x")+t-e.x)}y(t,e=this.bbox()){return null==t?e.y:this.attr("y",this.attr("y")+t-e.y)}move(t,e,r=this.bbox()){return this.x(t,r).y(e,r)}cx(t,e=this.bbox()){return null==t?e.cx:this.attr("x",this.attr("x")+t-e.cx)}cy(t,e=this.bbox()){return null==t?e.cy:this.attr("y",this.attr("y")+t-e.cy)}center(t,e,r=this.bbox()){return this.cx(t,r).cy(e,r)}text(t){if(void 0===t){var e=this.node.childNodes,r=0;t="";for(var i=0,n=e.length;i<n;++i)"textPath"!==e[i].nodeName?(i!==r&&3!==e[i].nodeType&&!0===E(e[i]).dom.newLined&&(t+="\n"),t+=e[i].textContent):0===i&&(r=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(var s=0,h=(t=t.split("\n")).length;s<h;s++)this.tspan(t[s]).newLine();return this.build(!1).rebuild()}leading(t){return null==t?this.dom.leading:(this.dom.leading=new kt(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){var e=this,r=0,i=this.dom.leading;this.each(function(){var t=S.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=i*new kt(t);this.dom.newLined&&(this.attr("x",e.attr("x")),"\n"===this.text()?r+=n:(this.attr("dy",n+r),r=0))}),this.fire("rebuild")}return this}build(t){return this._build=!!t,this}setData(t){return this.dom=t,this.dom.leading=new kt(t.leading||1.3),this}}z(Qe,o),l({Container:{text:R(function(t){return this.put(new Qe).text(t)}),plain:R(function(t){return this.put(new Qe).plain(t)})}}),N(Qe);class Ze extends Qe{constructor(t){super(T("tspan",t),t)}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?t.call(this,this):this.plain(t),this)}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}x(t){return this.attr("x",t)}y(t){return this.attr("x",t)}move(t,e){return this.x(t).y(e)}newLine(){var t=this.parent(Qe);this.dom.newLined=!0;var e=S.window.getComputedStyle(this.node).getPropertyValue("font-size"),r=t.dom.leading*new kt(e);return this.dy(r).attr("x",t.x())}}z(Ze,o),l({Tspan:{tspan:R(function(t){var e=new Ze;return this._build||this.clear(),this.node.appendChild(e.node),e.text(t)})}}),N(Ze);class Je extends Bt{constructor(t){super(T("clipPath",t),t)}remove(){return this.targets().forEach(function(t){t.unclip()}),super.remove()}targets(){return _t('svg [clip-path*="'+this.id()+'"]')}}l({Container:{clip:R(function(){return this.defs().put(new Je)})},Element:{clipWith(t){let e=t instanceof Je?t:this.parent().clip().add(t);return this.attr("clip-path",'url("#'+e.id()+'")')},unclip(){return this.attr("clip-path",null)},clipper(){return this.reference("clip-path")}}}),N(Je);class Ke extends jt{constructor(t){super(T("foreignObject",t),t)}}l({Container:{foreignObject:R(function(t,e){return this.put(new Ke).size(t,e)})}}),N(Ke);class tr extends Bt{constructor(t){super(T("g",t),t)}x(t,e=this.bbox()){return null==t?e.x:this.move(t,e.y,e)}y(t,e=this.bbox()){return null==t?e.y:this.move(e.x,t,e)}move(t=0,e=0,r=this.bbox()){const i=t-r.x,n=e-r.y;return this.dmove(i,n)}dx(t){return this.dmove(t,0)}dy(t){return this.dmove(0,t)}dmove(t,e){return this.children().forEach((r,i)=>{const n=r.bbox(),s=new ft(r),h=s.translate(t,e).transform(s.inverse()),o=new lt(n.x,n.y).transform(h);r.move(o.x,o.y)}),this}width(t,e=this.bbox()){return null==t?e.width:this.size(t,e.height,e)}height(t,e=this.bbox()){return null==t?e.height:this.size(e.width,t,e)}size(t,e,r=this.bbox()){const i=g(this,t,e,r),n=i.width/r.width,s=i.height/r.height;return this.children().forEach((t,e)=>{const i=new lt(r).transform(new ft(t).inverse());t.scale(n,s,i.x,i.y)}),this}}l({Container:{group:R(function(){return this.put(new tr)})}}),N(tr);class er extends Bt{constructor(t){super(T("a",t),t)}to(t){return this.attr("href",t,_)}target(t){return this.attr("target",t)}}l({Container:{link:R(function(t){return this.put(new er).to(t)})},Element:{linkTo:function(t){var e=new er;return"function"==typeof t?t.call(e,e):e.to(t),this.parent().put(e).put(this)}}}),N(er);class rr extends Bt{constructor(t){super(T("mask",t),t)}remove(){return this.targets().forEach(function(t){t.unmask()}),super.remove()}targets(){return _t('svg [mask*="'+this.id()+'"]')}}l({Container:{mask:R(function(){return this.defs().put(new rr)})},Element:{maskWith(t){var e=t instanceof rr?t:this.parent().mask().add(t);return this.attr("mask",'url("#'+e.id()+'")')},unmask(){return this.attr("mask",null)},masker(){return this.reference("mask")}}}),N(rr);class ir extends jt{constructor(t){super(T("style",t),t)}addText(t=""){return this.node.textContent+=t,this}font(t,e,r={}){return this.rule("@font-face",{fontFamily:t,src:e,...r})}rule(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;var r=t+"{";for(var i in e)r+=i.replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()})+":"+e[i]+";";return r+="}"}(t,e))}}l("Dom",{style:R(function(t,e){return this.put(new ir).rule(t,e)}),fontface:R(function(t,e,r){return this.put(new ir).font(t,e,r)})}),N(ir);class nr extends Qe{constructor(t){super(T("textPath",t),t)}array(){var t=this.track();return t?t.array():null}plot(t){var e=this.track(),r=null;return e&&(r=e.plot(t)),null==t?r:this}track(){return this.reference("href")}}l({Container:{textPath:R(function(t,e){return t instanceof Qe||(t=this.text(t)),t.path(e)})},Text:{path:R(function(t,e=!0){var r=new nr;let i;if(t instanceof Oe||(t=this.defs().path(t)),r.attr("href","#"+t,_),e)for(;i=this.node.firstChild;)r.node.appendChild(i);return this.put(r)}),textPath(){return this.findOne("textPath")}},Path:{text:R(function(t){return t instanceof Qe||(t=(new Qe).addTo(this.parent()).text(t)),t.path(this)}),targets(){return _t('svg [href*="'+this.id()+'"]')}}}),nr.prototype.MorphArray=me,N(nr);class sr extends Xt{constructor(t){super(T("use",t),t)}element(t,e){return this.attr("href",(e||"")+"#"+t,_)}}l({Container:{use:R(function(t,e){return this.put(new sr).element(t,e)})}}),N(sr);const hr=k;function or(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),i.forEach(function(e){ar(t,e,r[e])})}return t}function ar(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ur(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}z([We,Ve,Zt,Qt,oe],c("viewbox")),z([he,De,Ne,Oe],c("marker")),z(Qe,c("Text")),z(Oe,c("Path")),z(Ht,c("Defs")),z([Qe,Ze],c("Tspan")),z([Fe,Gt,Yt,$t],c("radius")),z(bt,c("EventTarget")),z(Et,c("Dom")),z(jt,c("Element")),z(Xt,c("Shape")),z(Bt,c("Container")),z(Xe,c("Runner")),wt.extend([...new Set(u)]),function(t=[]){Ae.push(...[].concat(t))}([kt,ut,mt,ft,Ct,te,me]),z(Ae,{to(t){return(new _e).type(this.constructor).from(this.valueOf()).to(t)},fromArray(t){return this.init(t),this}});var lr=function(){function t(e,r){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sel=e,this.params=or({},{numStrings:6,numFrets:5,x:0,y:0,width:100,height:120,strokeWidth:1,showTuning:!0,defaultColor:"#666",bgColor:"#fff",labelColor:"#fff",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:void 0,fontStyle:"light",fontWeight:"100",labelWeight:"100"},r),["bridgeColor","stringColor","fretColor","strokeColor","textColor"].forEach(function(t){i.params[t]=i.params[t]||i.params.defaultColor}),["stringWidth","fretWidth"].forEach(function(t){i.params[t]=i.params[t]||i.params.strokeWidth}),this.canvas=hr().addTo(e).size(this.params.width,this.params.height),this.width=.75*this.params.width,this.height=.75*this.params.height,this.x=this.params.x+.15*this.params.width,this.y=this.params.y+.15*this.params.height,this.numStrings=this.params.numStrings,this.numFrets=this.params.numFrets,this.spacing=this.width/this.numStrings,this.fretSpacing=this.height/(this.numFrets+2),this.x+=this.spacing/2,this.y+=this.fretSpacing,this.metrics={circleRadius:this.width/20,barreRadius:this.width/25,fontSize:this.params.fontSize||Math.ceil(this.width/8),barShiftX:this.width/28,bridgeStrokeWidth:Math.ceil(this.height/36)},this.position=0,this.positionText=0,this.chord=[],this.bars=[],this.tuning=["E","A","D","G","B","E"]}var e,r,i;return e=t,(r=[{key:"setNumFrets",value:function(t){return this.numFrets=t,this.fretSpacing=this.height/(this.numFrets+1),this}},{key:"setPositionText",value:function(t){return this.positionText=t,this}},{key:"drawText",value:function(t,e,r,i){var n=or({},{family:this.params.fontFamily,size:this.metrics.fontSize,style:this.params.fontStyle,weight:this.params.fontWeight},i),s=this.canvas.text("".concat(r)).stroke(this.params.textColor).fill(this.params.textColor).font(n);return s.move(t-s.length()/2,e)}},{key:"drawLine",value:function(t,e,r,i){return this.canvas.line(0,0,r-t,i-e).move(t,e)}},{key:"draw",value:function(t){var e=t.chord,r=t.position,i=t.barres,n=t.positionText,s=t.tuning;this.chord=e,this.position=r||0,this.positionText=n||0,this.barres=i||[],this.tuning=s||["E","A","D","G","B","E"],0===this.tuning.length&&(this.fretSpacing=this.height/(this.numFrets+1));var h=this.spacing,o=this.fretSpacing;if(this.position<=1){var a=this.x,u=this.y-this.metrics.bridgeStrokeWidth;this.canvas.rect(this.x+h*(this.numStrings-1)-a,this.y-u).move(a,u).stroke({width:0}).fill(this.params.bridgeColor)}else this.drawText(this.x-this.spacing/2-.1*this.spacing,this.y+this.fretSpacing*this.positionText,this.position);for(var l=0;l<this.numStrings;l+=1)this.drawLine(this.x+h*l,this.y,this.x+h*l,this.y+o*this.numFrets).stroke({width:this.params.stringWidth,color:this.params.stringColor});for(var c=0;c<this.numFrets+1;c+=1)this.drawLine(this.x,this.y+o*c,this.x+h*(this.numStrings-1),this.y+o*c).stroke({width:this.params.fretWidth,color:this.params.fretColor});if(this.params.showTuning&&0!==this.tuning.length)for(var f=0;f<Math.min(this.numStrings,this.tuning.length);f+=1)this.drawText(this.x+this.spacing*f,this.y+this.numFrets*this.fretSpacing+this.fretSpacing/12,this.tuning[f]);for(var d=0;d<this.chord.length;d+=1)this.lightUp({string:this.chord[d][0],fret:this.chord[d][1],label:this.chord.length>2?this.chord[d][2]:void 0});for(var p=0;p<this.barres.length;p+=1)this.lightBar(this.barres[p].fromString,this.barres[p].toString,this.barres[p].fret)}},{key:"lightUp",value:function(t){var e=t.string,r=t.fret,i=t.label,n=this.numStrings-e,s=1===this.position&&1===this.positionText?this.positionText:0,h="x"===r,o="x"===r?0:r-s,a=this.x+this.spacing*n,u=this.y+this.fretSpacing*o;if(0===o&&(u-=this.metrics.bridgeStrokeWidth),h?this.drawText(a,u-this.fretSpacing,"X"):this.canvas.circle().move(a,u-this.fretSpacing/2).radius(this.metrics.circleRadius).stroke({color:this.params.strokeColor,width:this.params.strokeWidth}).fill(o>0?this.params.strokeColor:this.params.bgColor),i){var l=.55*this.metrics.fontSize,c=.66*l;this.drawText(a,u-this.fretSpacing/2-c,i,{weight:this.params.labelWeight,size:l}).stroke({width:.7,color:0!==o?this.params.labelColor:this.params.strokeColor}).fill(0!==o?this.params.labelColor:this.params.strokeColor)}return this}},{key:"lightBar",value:function(t,e,r){var i=r;1===this.position&&1===this.positionText&&(i-=this.positionText);var n=this.numStrings-t,s=this.numStrings-e,h=this.x+this.spacing*n-this.metrics.barShiftX,o=this.x+this.spacing*s+this.metrics.barShiftX,a=this.y+this.fretSpacing*(i-1)+this.fretSpacing/4,u=this.y+this.fretSpacing*(i-1)+this.fretSpacing/4*3;return this.canvas.rect(o-h,u-a).move(h,a).radius(this.metrics.barreRadius).fill(this.params.strokeColor),this}}])&&ur(e.prototype,r),i&&ur(e,i),t}(),cr={"M E":{name:"Maj",chord:[[3,2],[4,3],[5,3]],barres:[{fromString:6,toString:1,fret:1}]},"m E":{name:"m",chord:[[4,3],[5,3]],barres:[{fromString:6,toString:1,fret:1}]},"7 E":{name:"7",chord:[[2,4],[3,2],[5,3]],barres:[{fromString:6,toString:1,fret:1}]},"m7 E":{name:"m7",chord:[[2,4],[5,3]],barres:[{fromString:6,toString:1,fret:1}]},"M7 E":{name:"Maj7",chord:[[1,"x"],[2,1],[3,2],[4,2],[5,"x"],[6,1]]},"dim E":{name:"dim",chord:[[1,"x"],[3,2],[5,"x"],[6,2]],positionText:1,barres:[{fromString:4,toString:2,fret:1}]},"m7b5 E":{name:"m7b5",chord:[[1,"x"],[2,1],[3,2],[4,2],[5,"x"],[6,2]],positionText:1},"sus4 E":{name:"sus4",chord:[],barres:[{fromString:6,toString:1,fret:1},{fromString:5,toString:3,fret:3}]},"7sus4 E":{name:"7sus4",chord:[[3,3],[5,3]],barres:[{fromString:6,toString:1,fret:1}]},"13 E":{name:"13",chord:[[1,"x"],[2,4],[3,3],[4,2],[5,"x"],[6,2]],positionText:1},"M A":{name:"Maj",chord:[[2,3],[3,3],[4,3],[6,"x"]],barres:[{fromString:5,toString:1,fret:1}]},"m A":{name:"m",chord:[[2,2],[3,3],[4,3],[6,"x"]],barres:[{fromString:5,toString:1,fret:1}]},"7 A":{name:"7",chord:[[2,3],[4,3],[6,"x"]],barres:[{fromString:5,toString:1,fret:1}]},"m7 A":{name:"m7",chord:[[2,2],[4,3],[6,"x"]],barres:[{fromString:5,toString:1,fret:1}]},"m7b5 A":{name:"m7b5",chord:[[2,2],[4,2],[6,"x"]],barres:[{fromString:5,toString:3,fret:1}]},"dim A":{name:"dim",chord:[[1,"x"],[2,3],[3,1],[4,3],[5,2],[6,"x"]],positionText:1},"M7 A":{name:"Maj7",chord:[[2,3],[3,2],[4,3],[6,"x"]],barres:[{fromString:5,toString:1,fret:1}]},"sus2 A":{name:"sus2",chord:[[3,3],[4,3],[6,"x"]],barres:[{fromString:5,toString:1,fret:1}]},"sus4 A":{name:"sus4",chord:[[2,4],[3,3],[4,3],[6,"x"]],barres:[{fromString:5,toString:1,fret:1}]},"7sus4 A":{name:"7sus4",chord:[[2,4],[4,3],[6,"x"]],barres:[{fromString:5,toString:1,fret:1}]},"9 A":{name:"9",chord:[[1,"x"],[2,2],[3,2],[4,1],[5,2],[6,"x"]],positionText:1},"7b9 A":{name:"7b9",chord:[[1,"x"],[2,1],[3,2],[4,1],[5,2],[6,"x"]],positionText:1},"7#9 A":{name:"7#9",chord:[[1,"x"],[2,3],[3,2],[4,1],[5,2],[6,"x"]],positionText:1},"13 A":{name:"13",chord:[[1,4],[2,4],[3,2],[4,4],[5,2],[6,"x"]],positionText:1}},fr={E:{A:5,"A#":6,Bb:6,B:7,C:8,"C#":9,Db:9,D:10,"D#":11,Eb:11,E:12,F:1,"F#":2,Gb:2,G:3,"G#":4,Ab:4},A:{A:12,"A#":1,Bb:1,B:2,C:3,"C#":4,Db:4,D:5,"D#":6,Eb:6,E:7,F:8,"F#":9,Gb:9,G:10,"G#":11,Ab:11}};function dr(t,e,r){var i=e.toUpperCase(),n=fr[i][t],s=cr[r];return{name:t+s.name,chord:s.chord,position:n,positionText:s.positionText,barres:s.barres}}function pr(t,e,r){return new lr(t,r).draw(e)}r.d(e,"draw",function(){return pr}),r.d(e,"POSITIONS",function(){return fr}),r.d(e,"SHAPES",function(){return cr}),r.d(e,"ChordBox",function(){return lr}),r.d(e,"build",function(){return dr})}]);