UNPKG

soccer-jersey-fixed

Version:

Generate soccer jerseys in SVG format. Fork of the original soccer-jersey package, so that @svgdotjs/svg.js dependency is retrieved from npmjs rather than github

7 lines 84.6 kB
/*! * * Source: https://nadchif.github.io/soccer-jersey/ * The version of the package is: 1.0.15 * */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("SoccerJersey",[],e):"object"==typeof exports?exports.SoccerJersey=e():t.SoccerJersey=e()}(self,(()=>(()=>{"use strict";var t={494:(t,e,n)=>{const r=n(672),i=n(817);t.exports={atob:r,btoa:i}},672:t=>{const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function n(t){const n=e.indexOf(t);return n<0?void 0:n}t.exports=function(t){if((t=(t=`${t}`).replace(/[ \t\n\f\r]/g,"")).length%4==0&&(t=t.replace(/==?$/,"")),t.length%4==1||/[^+/0-9A-Za-z]/.test(t))return null;let e="",r=0,i=0;for(let s=0;s<t.length;s++)r<<=6,r|=n(t[s]),i+=6,24===i&&(e+=String.fromCharCode((16711680&r)>>16),e+=String.fromCharCode((65280&r)>>8),e+=String.fromCharCode(255&r),r=i=0);return 12===i?(r>>=4,e+=String.fromCharCode(r)):18===i&&(r>>=2,e+=String.fromCharCode((65280&r)>>8),e+=String.fromCharCode(255&r)),e}},817:t=>{const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function n(t){if(t>=0&&t<64)return e[t]}t.exports=function(t){let e;for(t=`${t}`,e=0;e<t.length;e++)if(t.charCodeAt(e)>255)return null;let r="";for(e=0;e<t.length;e+=3){const i=[void 0,void 0,void 0,void 0];i[0]=t.charCodeAt(e)>>2,i[1]=(3&t.charCodeAt(e))<<4,t.length>e+1&&(i[1]|=t.charCodeAt(e+1)>>4,i[2]=(15&t.charCodeAt(e+1))<<2),t.length>e+2&&(i[2]|=t.charCodeAt(e+2)>>6,i[3]=63&t.charCodeAt(e+2));for(let t=0;t<i.length;t++)void 0===i[t]?r+="=":r+=n(i[t])}return r}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{n.r(r),n.d(r,{draw:()=>Ln});var t={};n.r(t),n.d(t,{cx:()=>Ft,cy:()=>Xt,height:()=>Bt,rx:()=>Rt,ry:()=>Lt,width:()=>Yt,x:()=>qt,y:()=>Pt});var e={};n.r(e),n.d(e,{from:()=>Gt,to:()=>Ut});var i={};n.r(i),n.d(i,{MorphArray:()=>te,height:()=>ie,width:()=>re,x:()=>ee,y:()=>ne});var s={};n.r(s),n.d(s,{array:()=>je,clear:()=>ze,move:()=>De,plot:()=>Ie,size:()=>Re});var o={};n.r(o),n.d(o,{amove:()=>cn,ax:()=>un,ay:()=>ln,build:()=>fn,center:()=>an,cx:()=>on,cy:()=>hn,length:()=>en,move:()=>sn,plain:()=>tn,x:()=>nn,y:()=>rn});var h={};n.r(h),n.d(h,{dmove:()=>wn,dx:()=>xn,dy:()=>_n,height:()=>bn,move:()=>vn,size:()=>Mn,width:()=>On,x:()=>An,y:()=>kn});var a=n(494);const u={},l=[];function c(t,e){if(Array.isArray(t))for(const n of t)c(n,e);else if("object"!=typeof t)d(Object.getOwnPropertyNames(e)),u[t]=Object.assign(u[t]||{},e);else for(const e in t)c(e,t[e])}function f(t){return u[t]||{}}function d(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 y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(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 x=new Set(["desc","metadata","title"]),_=t=>x.has(t.nodeName),b=(t,e,n={})=>{const r={...e};for(const t in r)r[t].valueOf()===n[t]&&delete r[t];Object.keys(r).length?t.node.setAttribute("data-svgjs",JSON.stringify(r)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},v="http://www.w3.org/2000/svg",M="http://www.w3.org/2000/xmlns/",O="http://www.w3.org/1999/xlink",A={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class k{}const C={},S="___SYMBOL___ROOT___";function T(t,e=v){return A.document.createElementNS(e,t)}function N(t,e=!1){if(t instanceof k)return t;if("object"==typeof t)return z(t);if(null==t)return new C[S];if("string"==typeof t&&"<"!==t.charAt(0))return z(A.document.querySelector(t));const n=e?A.document.createElement("div"):T("svg");return n.innerHTML=t,t=z(n.firstChild),n.removeChild(n.firstChild),t}function E(t,e){return e&&(e instanceof A.window.Node||e.ownerDocument&&e instanceof e.ownerDocument.defaultView.Node)?e:T(t)}function j(t){if(!t)return null;if(t.instance instanceof k)return t.instance;if("#document-fragment"===t.nodeName)return new C.Fragment(t);let e=y(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":C[e]||(e="Dom"),new C[e](t)}let z=j;function D(t,e=t.name,n=!1){return C[e]=t,n&&(C[S]=t),d(Object.getOwnPropertyNames(t.prototype)),t}let I=1e3;function R(t){return"Svgjs"+y(t)+I++}function L(t){for(let e=t.children.length-1;e>=0;e--)L(t.children[e]);return t.id?(t.id=R(t.nodeName),t):t}function q(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 P(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=N(t)).remove();const e=this.position();return this.parent().add(t,e),this},after:function(t){(t=N(t)).remove();const e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=N(t)).before(this),this},insertAfter:function(t){return(t=N(t)).after(this),this}});const F=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,X=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Y=/rgb\((\d+),(\d+),(\d+)\)/,B=/(#[a-z_][a-z0-9\-_]*)/i,$=/\)\s*,?\s*/,H=/\s/g,V=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,G=/^rgb\(/,U=/^(\s+)?$/,J=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Q=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,W=/[\s,]+/,Z=/[MLHVCSQTAZ]/i;function K(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(W)},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]||U.test(t[e])?"":t[e])}return 2===arguments.length&&this.node.style.setProperty(t,null==e||U.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(e){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 e in t)this.remember(e,t[e]);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 nt{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof nt||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 nt(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 nt(t,o,h)}if("pastel"===t){const t=8*n()+86,e=17*n()+9,r=360*n();return new nt(t,e,r,"lch")}if("dark"===t){const t=10+10*n(),e=50*n()+86,r=360*n();return new nt(t,e,r,"lch")}if("rgb"===t){const t=255*n(),e=255*n(),r=255*n();return new nt(t,e,r)}if("lab"===t){const t=100*n(),e=256*n()-128,r=256*n()-128;return new nt(t,e,r,"lab")}if("grey"===t){const t=255*n();return new nt(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(V.test(t)||G.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 nt(0,0,0,1,"cmyk");return new nt((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 nt(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 t in this.space)delete this[this.space[t]];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(G.test(t)){const e=t.replace(H,""),[n,r,i]=Y.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]=X.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:n,_b:r,_c:i,_d:0,space:"rgb"})}}const{_a:s,_b:o,_c:h,_d:a}=this,u="rgb"===this.space?{r:s,g:o,b:h}:"xyz"===this.space?{x:s,y:o,z:h}:"hsl"===this.space?{h:s,s:o,l:h}:"lab"===this.space?{l:s,a:o,b:h}:"lch"===this.space?{l:s,c:o,h}:"cmyk"===this.space?{c:s,m:o,y:h,k:a}:{};Object.assign(this,u)}lab(){const{x:t,y:e,z:n}=this.xyz();return new nt(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 nt(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 nt(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 nt(n,n,n)}const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,s=255*et(i,r,t+1/3),o=255*et(i,r,t),h=255*et(i,r,t-1/3);return new nt(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 nt(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(K);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,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 nt(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 rt{constructor(...t){this.init(...t)}clone(){return new rt(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)<(n||1e-6)}class st{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,f=l.y,d=new rt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),p=d.x,m=d.y,y=new rt(t.translate||t.tx||t.translateX,t.ty||t.translateY),g=y.x,w=y.y,x=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:x.x,ry:x.y,tx:g,ty:w,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,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 st(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),f=180/Math.PI*c,d=Math.cos(c),p=Math.sin(c),m=(n*i+r*s)/a,y=i*l/(m*n-r)||s*l/(m*r+n);return{scaleX:l,scaleY:y,shear:m,rotate:f,translateX:o-t+t*d*l+e*(m*d*l-p*y),translateY:h-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}}equals(t){if(t===this)return!0;const e=new st(t);return it(this.a,e.a)&&it(this.b,e.b)&&it(this.c,e.c)&&it(this.d,e.d)&&it(this.e,e.e)&&it(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=st.fromArray([1,0,0,1,0,0]);return t=t instanceof Et?t.matrixify():"string"==typeof t?st.fromArray(t.split(W).map(parseFloat)):Array.isArray(t)?st.fromArray(t):"object"==typeof t&&st.isMatrixLike(t)?t:"object"==typeof t?(new st).transform(t):6===arguments.length?st.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),f=-(a*i+l*s);return this.a=h,this.b=a,this.c=u,this.d=l,this.e=c,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const e=t instanceof st?t:new st(t);return st.matrixMultiply(e,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const e=t instanceof st?t:new st(t);return st.matrixMultiply(this,e,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(t){if(st.isMatrixLike(t)){return new st(t).multiplyO(this)}const e=st.formatTransforms(t),{x:n,y:r}=new rt(e.ox,e.oy).transform(this),i=(new st).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 rt(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 ot(){if(!ot.nodes){const t=N().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=A.document.body||A.document.documentElement;ot.nodes.svg.addTo(t)}return ot.nodes}function ht(t){return!(t.width||t.height||t.x||t.y)}D(st,"Matrix");class at{constructor(...t){this.init(...t)}addOffset(){return this.x+=A.window.pageXOffset,this.y+=A.window.pageYOffset,new at(this)}init(t){return t="string"==typeof t?t.split(W).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(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 at(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 st||(t=new st(t));let e=1/0,n=-1/0,r=1/0,i=-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(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 at(e,r,n-e,i-r)}}function ut(t,e,n){let r;try{if(r=e(t.node),ht(r)&&((i=t.node)!==A.document&&!(A.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===A.document}).call(A.document.documentElement,i)))throw new Error("Element not in the dom")}catch(e){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)}}}),D(at,"Box");class lt extends Array{constructor(t=[],...e){if(super(t,...e),"number"==typeof t)return this;this.length=0,this.push(...t)}}const ct=lt;q([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 ft=["toArray","constructor","each"];function dt(t,e){return new ct(p((e||A.document).querySelectorAll(t),(function(t){return j(t)})))}lt.extend=function(t){t=t.reduce(((t,e)=>(ft.includes(e)||"_"===e[0]||(e in Array.prototype&&(t["$"+e]=Array.prototype[e]),t[e]=function(...t){return this.each(e,...t)}),t)),{}),q([lt],t)};let pt=0;const mt={};function yt(t){let e=t.getEventHolder();return e===A.window&&(e=mt),e.events||(e.events={}),e.events}function gt(t){return t.getEventTarget()}function wt(t,e,n,r,i){const s=n.bind(r||t),o=N(t),h=yt(o),a=gt(o);e=Array.isArray(e)?e:e.split(W),n._svgjsListenerId||(n._svgjsListenerId=++pt),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 xt(t,e,n,r){const i=N(t),s=yt(i),o=gt(i);("function"!=typeof n||(n=n._svgjsListenerId))&&(e=Array.isArray(e)?e:(e||"").split(W)).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])xt(o,[e,h].join("."),u);delete s[e][h]}}else if(h)for(t in s)for(a in s[t])h===a&&xt(o,[t,h].join("."));else if(e){if(s[e]){for(a in s[e])xt(o,[e,a].join("."));delete s[e]}}else{for(t in s)xt(o,t);!function(t){let e=t.getEventHolder();e===A.window&&(e=mt),e.events&&(e.events={})}(i)}}))}class _t extends k{addEventListener(){}dispatch(t,e,n){return function(t,e,n,r){const i=gt(t);return e instanceof A.window.Event||(e=new A.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 e in n)for(const r in n[e])n[e][r](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 xt(this,t,e,n),this}on(t,e,n,r){return wt(this,t,e,n,r),this}removeEventListener(){}}function bt(){}D(_t,"EventTarget");const vt=400,Mt=">",Ot=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"};class kt 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(W).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 Ct{constructor(...t){this.init(...t)}convert(t){return new Ct(this.value,t)}divide(t){return t=new Ct(t),new Ct(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(F))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof Ct&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new Ct(t),new Ct(this-t,this.unit||t.unit)}plus(t){return t=new Ct(t),new Ct(this+t,this.unit||t.unit)}times(t){return t=new Ct(t),new Ct(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 St=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Tt=[];class Nt extends _t{constructor(t,e){super(),this.node=t,this.type=t.nodeName,e&&t!==e&&this.attr(e)}add(t,e){return(t=N(t)).removeNamespace&&this.node instanceof A.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 N(t).put(this,e)}children(){return new ct(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=L(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 Nt(T(t),e))}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=R(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=N(t),this.add(t,e),t}putIn(t,e){return N(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=N(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 t in r)"number"==typeof r[t]&&(r[t]=Math.round(r[t]*n)/n);return this.attr(r),this}svg(t,e){return this.xml(t,e,v)}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=T("wrapper",n),i=A.document.createDocumentFragment();r.innerHTML=t;for(let t=r.children.length;t--;)i.appendChild(r.firstElementChild);const s=this.parent();return e?this.replace(i)&&s:this.add(i)}}q(Nt,{attr:function(t,e,n){if(null==t){t={},e=this.node.attributes;for(const n of e)t[n.nodeName]=J.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))?At[t]:J.test(e)?parseFloat(e):e;"number"==typeof(e=Tt.reduce(((e,n)=>n(t,e,this)),e))?e=new Ct(e):St.has(t)&&nt.isColor(e)?e=new nt(e):e.constructor===Array&&(e=new kt(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))}}),D(Nt,"Dom");class Et 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 Ct(t).plus(this.x()))}dy(t=0){return this.y(new Ct(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=N(t));const n=new ct;let r=this;for(;(r=r.parent())&&r.node!==A.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(B);return e?N(e[1]):null}root(){const t=this.parent(C[S]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,e){const n=g(this,t,e);return this.width(new Ct(n.width)).height(new Ct(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return b(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}q(Et,{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}}}),D(Et,"Element");const jt={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 Et)this.attr(t,e);else for(n=jt[t].length-1;n>=0;n--)null!=e[jt[t][n]]&&this.attr(jt.prefix(t,jt[t][n]),e[jt[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 Ct(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(){const t=(this.attr("transform")||"").split($).slice(0,-1).map((function(t){const e=t.trim().split("(");return[e[0],e[1].split(W).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);return t},toParent:function(t,e){if(this===t)return this;if(_(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)}});class zt extends Et{flatten(){return this.each((function(){if(this instanceof zt)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()}}D(zt,"Container");class Dt extends zt{constructor(t,e=t){super(E("defs",t),e)}flatten(){return this}ungroup(){return this}}D(Dt,"Defs");class It extends Et{}function Rt(t){return this.attr("rx",t)}function Lt(t){return this.attr("ry",t)}function qt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Pt(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Ft(t){return this.attr("cx",t)}function Xt(t){return this.attr("cy",t)}function Yt(t){return null==t?2*this.rx():this.rx(new Ct(t).divide(2))}function Bt(t){return null==t?2*this.ry():this.ry(new Ct(t).divide(2))}D(It,"Shape");class $t extends It{constructor(t,e=t){super(E("ellipse",t),e)}size(t,e){const n=g(this,t,e);return this.rx(new Ct(n.width).divide(2)).ry(new Ct(n.height).divide(2))}}q($t,t),c("Container",{ellipse:P((function(t=0,e=t){return this.put(new $t).size(t,e).move(0,0)}))}),D($t,"Ellipse");class Ht extends Nt{constructor(t=A.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(T("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}D(Ht,"Fragment");const Vt=Ht;function Gt(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new Ct(t),fy:new Ct(e)}):this.attr({x1:new Ct(t),y1:new Ct(e)})}function Ut(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new Ct(t),cy:new Ct(e)}):this.attr({x2:new Ct(t),y2:new Ct(e)})}class Jt extends zt{constructor(t,e){super(E(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()+")"}}q(Jt,e),c({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:P((function(t,e){return this.put(new Jt(t)).update(e)}))}}),D(Jt,"Gradient");class Qt extends zt{constructor(t,e=t){super(E("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:P((function(t,e,n){return this.put(new Qt).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}))}}),D(Qt,"Pattern");class Wt extends It{constructor(t,e=t){super(E("image",t),e)}load(t,e){if(!t)return this;const n=new A.window.Image;return wt(n,"load",(function(t){const r=this.parent(Qt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),r instanceof Qt&&0===r.width()&&0===r.height()&&r.size(this.width(),this.height()),"function"==typeof e&&e.call(this,t)}),this),wt(n,"load error",(function(){xt(n)})),this.attr("href",n.src=t,O)}}var Zt;Zt=function(t,e,n){return"fill"!==t&&"stroke"!==t||Q.test(e)&&(e=n.root().defs().image(e)),e instanceof Wt&&(e=n.root().defs().pattern(0,0,(t=>{t.add(e)}))),e},Tt.push(Zt),c({Container:{image:P((function(t,e){return this.put(new Wt).size(0,0).load(t,e)}))}}),D(Wt,"Image");class Kt extends kt{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 n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+e];return this}parse(t=[0,0]){const e=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(W).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=Kt;function ee(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}function ne(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}function re(t){const e=this.bbox();return null==t?e.width:this.size(t,e.height)}function ie(t){const e=this.bbox();return null==t?e.height:this.size(e.width,t)}class se extends It{constructor(t,e=t){super(E("line",t),e)}array(){return new Kt([[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 Kt(t).toLine(),this.attr(t))}size(t,e){const n=g(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}q(se,i),c({Container:{line:P((function(...t){return se.prototype.plot.apply(this.put(new se),null!=t[0]?t:[0,0,0,0])}))}}),D(se,"Line");class oe extends zt{constructor(t,e=t){super(E("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 he(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:P((function(t,e,n){return this.put(new oe).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 oe?arguments[1]:this.defs().marker(e,n,r),this.attr(i,t)}}}),D(oe,"Marker");const ae={"-":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 ue{done(){return!1}}class le extends ue{constructor(t=Mt){super(),this.ease=ae[t]||t}step(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}class ce extends ue{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,e,n,r){return this.stepper(t,e,n,r)}}function fe(){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}q(class extends ce{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:he("_duration",fe),overshoot:he("_overshoot",fe)});q(class extends ce{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:he("_windup"),p:he("P"),i:he("I"),d:he("D")});const de={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},pe={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]]}},me="mlhvqtcsaz".split("");for(let t=0,e=me.length;t<e;++t)pe[me[t]]=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,r=e.length;t<r;++t)e[t]=e[t]+(t%2?n.y:n.x);return pe[t](e,n,r)}}(me[t].toUpperCase());function ye(t){return t.segment.length&&t.segment.length-1===de[t.segment[0].toUpperCase()]}function ge(t,e){t.inNumber&&we(t,!1);const n=Z.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 we(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,ye(t)&&xe(t)}function xe(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){const e=t.segment[0];return pe[e](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function _e(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 be(t){return"E"===t.lastToken.toUpperCase()}const ve=new Set([" ",",","\t","\n","\r","\f"]);class Me extends kt{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 n,r=this.length-1;r>=0;r--)n=this[r][0],"M"===n||"L"===n||"T"===n?(this[r][1]+=t,this[r][2]+=e):"H"===n?this[r][1]+=t:"V"===n?this[r][1]+=e:"C"===n||"S"===n||"Q"===n?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===n&&(this[r][5]+=t,this[r][6]+=e)):"A"===n&&(this[r][6]+=t,this[r][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||!ge(i,r))if("."!==r)if(isNaN(parseInt(r)))if(ve.has(r))i.inNumber&&we(i,!1);else if("-"!==r&&"+"!==r)if("E"!==r.toUpperCase()){if(Z.test(r)){if(i.inNumber)we(i,!1);else{if(!ye(i))throw new Error("parser Error");xe(i)}--n}}else i.number+=r,i.hasExponent=!0;else{if(i.inNumber&&!be(i)){we(i,!1),--n;continue}i.number+=r,i.inNumber=!0}else{if("0"===i.number||_e(i)){i.inNumber=!0,i.number=r,we(i,!0);continue}i.inNumber=!0,i.number+=r}else{if(i.pointSeen||i.hasExponent){we(i,!1),--n;continue}i.inNumber=!0,i.pointSeen=!0,i.number+=r}return i.inNumber&&we(i,!1),i.inSegment&&ye(i)&&xe(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 Oe=t=>{const e=typeof t;return"number"===e?Ct:"string"===e?nt.isColor(t)?nt:W.test(t)?Z.test(t)?Me:kt:F.test(t)?Ct:ke:Ne.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?kt:"object"===e?Te:ke};class Ae{constructor(t){this._stepper=t||new le("-"),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(Oe(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===Te&&(e=this._to?e.align(this._to):this._from?e.align(this._from):e),e=e.toCons