UNPKG

@galaxyproject/galaxy-client

Version:

Galaxy client application build system

1 lines 81.8 kB
"use strict";(self.webpackChunk_galaxyproject_galaxy_client=self.webpackChunk_galaxyproject_galaxy_client||[]).push([[315],{7315:(t,e,i)=>{i.r(e),i.d(e,{AElement:()=>Ft,AnimateColorElement:()=>Dt,AnimateElement:()=>Nt,AnimateTransformElement:()=>zt,BoundingBox:()=>lt,CB1:()=>N,CB2:()=>D,CB3:()=>z,CB4:()=>B,Canvg:()=>fe,CircleElement:()=>xt,ClipPathElement:()=>ie,DefsElement:()=>Tt,DescElement:()=>le,Document:()=>de,Element:()=>rt,EllipseElement:()=>bt,FeColorMatrixElement:()=>Kt,FeCompositeElement:()=>ae,FeDropShadowElement:()=>se,FeGaussianBlurElement:()=>he,FeMorphologyElement:()=>ne,FilterElement:()=>re,Font:()=>ot,FontElement:()=>Bt,FontFaceElement:()=>Lt,GElement:()=>Vt,GlyphElement:()=>dt,GradientElement:()=>Et,ImageElement:()=>Ut,LineElement:()=>St,LinearGradientElement:()=>Mt,MarkerElement:()=>Ct,MaskElement:()=>te,Matrix:()=>J,MissingGlyphElement:()=>It,Mouse:()=>j,PSEUDO_ZERO:()=>E,Parser:()=>G,PathElement:()=>ct,PathParser:()=>ut,PatternElement:()=>At,Point:()=>X,PolygonElement:()=>wt,PolylineElement:()=>Pt,Property:()=>F,QB1:()=>L,QB2:()=>I,QB3:()=>R,RadialGradientElement:()=>kt,RectElement:()=>vt,RenderedElement:()=>gt,Rotate:()=>$,SVGElement:()=>mt,SVGFontLoader:()=>Wt,Scale:()=>Z,Screen:()=>H,Skew:()=>K,SkewX:()=>tt,SkewY:()=>et,StopElement:()=>Ot,StyleElement:()=>qt,SymbolElement:()=>Ht,TRefElement:()=>Rt,TSpanElement:()=>yt,TextElement:()=>pt,TextPathElement:()=>jt,TitleElement:()=>oe,Transform:()=>it,Translate:()=>Q,UnknownElement:()=>st,UseElement:()=>Gt,ViewPort:()=>_,compressSpaces:()=>g,default:()=>fe,getSelectorSpecificity:()=>V,normalizeAttributeName:()=>f,normalizeColor:()=>v,parseExternalUrl:()=>m,presets:()=>u,toNumbers:()=>p,trimLeft:()=>c,trimRight:()=>d,vectorMagnitude:()=>M,vectorsAngle:()=>O,vectorsRatio:()=>k});i(7905);var r=i(10467),s=(i(42765),i(71524),i(71380),i(18916),i(15045),i(64467)),n=(i(87420),i(77253),i(92452),i(93146)),a=(i(40654),i(82855)),h=(i(64624),i(9871),i(50854),i(99849)),o=(i(75433),i(52852)),l=i(65606);var u=Object.freeze({__proto__:null,offscreen:function(){var{DOMParser:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,createCanvas:(t,e)=>new OffscreenCanvas(t,e),createImage:t=>(0,r.A)((function*(){var e=yield fetch(t),i=yield e.blob();return yield createImageBitmap(i)}))()};return"undefined"==typeof DOMParser&&void 0!==t||Reflect.deleteProperty(e,"DOMParser"),e},node:function(t){var{DOMParser:e,canvas:i,fetch:r}=t;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:r,createCanvas:i.createCanvas,createImage:i.loadImage}}});function g(t){return t.replace(/(?!\u3000)\s+/gm," ")}function c(t){return t.replace(/^[\n \t]+/,"")}function d(t){return t.replace(/[\n \t]+$/,"")}function p(t){return((t||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[]).map(parseFloat)}var y=/^[A-Z-]+$/;function f(t){return y.test(t)?t.toLowerCase():t}function m(t){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(t)||[];return e[2]||e[3]||e[4]}function v(t){if(!t.startsWith("rgb"))return t;var e=3;return t.replace(/\d+(\.\d+)?/g,((t,i)=>e--&&i?String(Math.round(parseFloat(t))):t))}var x=/(\[[^\]]+\])/g,b=/(#[^\s+>~.[:]+)/g,S=/(\.[^\s+>~.[:]+)/g,P=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,w=/(:[\w-]+\([^)]*\))/gi,A=/(:[^\s+>~.[:]+)/g,C=/([^\s+>~.[:]+)/g;function T(t,e){var i=e.exec(t);return i?[t.replace(e," "),i.length]:[t,0]}function V(t){var e=[0,0,0],i=t.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),r=0;return[i,r]=T(i,x),e[1]+=r,[i,r]=T(i,b),e[0]+=r,[i,r]=T(i,S),e[1]+=r,[i,r]=T(i,P),e[2]+=r,[i,r]=T(i,w),e[1]+=r,[i,r]=T(i,A),e[1]+=r,i=i.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[i,r]=T(i,C),e[2]+=r,e.join("")}var E=1e-8;function M(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))}function k(t,e){return(t[0]*e[0]+t[1]*e[1])/(M(t)*M(e))}function O(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(k(t,e))}function N(t){return t*t*t}function D(t){return 3*t*t*(1-t)}function z(t){return 3*t*(1-t)*(1-t)}function B(t){return(1-t)*(1-t)*(1-t)}function L(t){return t*t}function I(t){return 2*t*(1-t)}function R(t){return(1-t)*(1-t)}class F{constructor(t,e,i){this.document=t,this.name=e,this.value=i,this.isNormalizedColor=!1}static empty(t){return new F(t,"EMPTY","")}split(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ",{document:e,name:i}=this;return g(this.getString()).trim().split(t).map((t=>new F(e,i,t)))}hasValue(t){var{value:e}=this;return null!==e&&""!==e&&(t||0!==e)&&void 0!==e}isString(t){var{value:e}=this,i="string"==typeof e;return i&&t?t.test(e):i}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var t=this.getString();switch(!0){case t.endsWith("px"):case/^[0-9]+$/.test(t):return!0;default:return!1}}setValue(t){return this.value=t,this}getValue(t){return void 0===t||this.hasValue()?this.value:t}getNumber(t){if(!this.hasValue())return void 0===t?0:parseFloat(t);var{value:e}=this,i=parseFloat(e);return this.isString(/%$/)&&(i/=100),i}getString(t){return void 0===t||this.hasValue()?void 0===this.value?"":String(this.value):String(t)}getColor(t){var e=this.getString(t);return this.isNormalizedColor||(this.isNormalizedColor=!0,e=v(e),this.value=e),e}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var[i,r]="boolean"==typeof t?[void 0,t]:[t],{viewPort:s}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(s.computeSize("x"),s.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(s.computeSize("x"),s.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*s.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*s.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&r:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*s.computeSize(i);default:var n=this.getNumber();return e&&n<1?n*s.computeSize(i):n}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var t=this.getString(),e=/#([^)'"]+)/.exec(t);return e&&(e=e[1]),e||(e=t),this.document.definitions[e]}getFillStyleDefinition(t,e){var i=this.getDefinition();if(!i)return null;if("function"==typeof i.createGradient)return i.createGradient(this.document.ctx,t,e);if("function"==typeof i.createPattern){if(i.getHrefAttribute().hasValue()){var r=i.getAttribute("patternTransform");i=i.getHrefAttribute().getDefinition(),r.hasValue()&&i.getAttribute("patternTransform",!0).setValue(r.value)}return i.createPattern(this.document.ctx,t,e)}return null}getTextBaseline(){return this.hasValue()?F.textBaselineMapping[this.getString()]:null}addOpacity(t){for(var e=this.getColor(),i=e.length,r=0,s=0;s<i&&(","===e[s]&&r++,3!==r);s++);if(t.hasValue()&&this.isString()&&3!==r){var n=new a(e);n.ok&&(n.alpha=t.getNumber(),e=n.toRGBA())}return new F(this.document,this.name,e)}}F.textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};class _{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(t,e){this.viewPorts.push({width:t,height:e})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:t}=this;return t[t.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(t){return"number"==typeof t?t:"x"===t?this.width:"y"===t?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}}class X{constructor(t,e){this.x=t,this.y=e}static parse(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[i=e,r=e]=p(t);return new X(i,r)}static parseScale(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,[i=e,r=i]=p(t);return new X(i,r)}static parsePath(t){for(var e=p(t),i=e.length,r=[],s=0;s<i;s+=2)r.push(new X(e[s],e[s+1]));return r}angleTo(t){return Math.atan2(t.y-this.y,t.x-this.x)}applyTransform(t){var{x:e,y:i}=this,r=e*t[0]+i*t[2]+t[4],s=e*t[1]+i*t[3]+t[5];this.x=r,this.y=s}}class j{constructor(t){this.screen=t,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:t,onClick:e,onMouseMove:i}=this,r=t.ctx.canvas;r.onclick=e,r.onmousemove=i,this.working=!0}}stop(){if(this.working){var t=this.screen.ctx.canvas;this.working=!1,t.onclick=null,t.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:t,events:e,eventElements:i}=this,{style:r}=t.ctx.canvas;r&&(r.cursor=""),e.forEach(((t,e)=>{for(var{run:r}=t,s=i[e];s;)r(s),s=s.parent})),this.events=[],this.eventElements=[]}}checkPath(t,e){if(this.working&&e){var{events:i,eventElements:r}=this;i.forEach(((i,s)=>{var{x:n,y:a}=i;!r[s]&&e.isPointInPath&&e.isPointInPath(n,a)&&(r[s]=t)}))}}checkBoundingBox(t,e){if(this.working&&e){var{events:i,eventElements:r}=this;i.forEach(((i,s)=>{var{x:n,y:a}=i;!r[s]&&e.isPointInBox(n,a)&&(r[s]=t)}))}}mapXY(t,e){for(var{window:i,ctx:r}=this.screen,s=new X(t,e),n=r.canvas;n;)s.x-=n.offsetLeft,s.y-=n.offsetTop,n=n.offsetParent;return i.scrollX&&(s.x+=i.scrollX),i.scrollY&&(s.y+=i.scrollY),s}onClick(t){var{x:e,y:i}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onclick",x:e,y:i,run(t){t.onClick&&t.onClick()}})}onMouseMove(t){var{x:e,y:i}=this.mapXY(t.clientX,t.clientY);this.events.push({type:"onmousemove",x:e,y:i,run(t){t.onMouseMove&&t.onMouseMove()}})}}var Y="undefined"!=typeof window?window:null,U="undefined"!=typeof fetch?fetch.bind(void 0):null;class H{constructor(t){var{fetch:e=U,window:i=Y}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.ctx=t,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new _,this.mouse=new j(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=i,this.fetch=e}wait(t){this.waits.push(t)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var t=this.waits.every((t=>t()));return t&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=t,t}setDefaults(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4}setViewBox(t){var{document:e,ctx:i,aspectRatio:r,width:s,desiredWidth:n,height:a,desiredHeight:h,minX:o=0,minY:l=0,refX:u,refY:c,clip:d=!1,clipX:p=0,clipY:y=0}=t,f=g(r).replace(/^defer\s/,""),[m,v]=f.split(" "),x=m||"xMidYMid",b=v||"meet",S=s/n,P=a/h,w=Math.min(S,P),A=Math.max(S,P),C=n,T=h;"meet"===b&&(C*=w,T*=w),"slice"===b&&(C*=A,T*=A);var V=new F(e,"refX",u),E=new F(e,"refY",c),M=V.hasValue()&&E.hasValue();if(M&&i.translate(-w*V.getPixels("x"),-w*E.getPixels("y")),d){var k=w*p,O=w*y;i.beginPath(),i.moveTo(k,O),i.lineTo(s,O),i.lineTo(s,a),i.lineTo(k,a),i.closePath(),i.clip()}if(!M){var N="meet"===b&&w===P,D="slice"===b&&A===P,z="meet"===b&&w===S,B="slice"===b&&A===S;x.startsWith("xMid")&&(N||D)&&i.translate(s/2-C/2,0),x.endsWith("YMid")&&(z||B)&&i.translate(0,a/2-T/2),x.startsWith("xMax")&&(N||D)&&i.translate(s-C,0),x.endsWith("YMax")&&(z||B)&&i.translate(0,a-T)}switch(!0){case"none"===x:i.scale(S,P);break;case"meet"===b:i.scale(w,w);break;case"slice"===b:i.scale(A,A)}i.translate(-o,-l)}start(t){var{enableRedraw:e=!1,ignoreMouse:i=!1,ignoreAnimation:r=!1,ignoreDimensions:s=!1,ignoreClear:a=!1,forceRedraw:h,scaleWidth:o,scaleHeight:l,offsetX:u,offsetY:g}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{FRAMERATE:c,mouse:d}=this,p=1e3/c;if(this.frameDuration=p,this.readyPromise=new Promise((t=>{this.resolveReady=t})),this.isReady()&&this.render(t,s,a,o,l,u,g),e){var y=Date.now(),f=y,m=0,v=()=>{y=Date.now(),(m=y-f)>=p&&(f=y-m%p,this.shouldUpdate(r,h)&&(this.render(t,s,a,o,l,u,g),d.runEvents())),this.intervalId=n(v)};i||d.start(),this.intervalId=n(v)}}stop(){this.intervalId&&(n.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(t,e){if(!t){var{frameDuration:i}=this;if(this.animations.reduce(((t,e)=>e.update(i)||t),!1))return!0}return!("function"!=typeof e||!e())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}render(t,e,i,r,s,n,a){var{CLIENT_WIDTH:h,CLIENT_HEIGHT:o,viewPort:l,ctx:u,isFirstRender:g}=this,c=u.canvas;l.clear(),c.width&&c.height?l.setCurrent(c.width,c.height):l.setCurrent(h,o);var d=t.getStyle("width"),y=t.getStyle("height");!e&&(g||"number"!=typeof r&&"number"!=typeof s)&&(d.hasValue()&&(c.width=d.getPixels("x"),c.style&&(c.style.width="".concat(c.width,"px"))),y.hasValue()&&(c.height=y.getPixels("y"),c.style&&(c.style.height="".concat(c.height,"px"))));var f=c.clientWidth||c.width,m=c.clientHeight||c.height;if(e&&d.hasValue()&&y.hasValue()&&(f=d.getPixels("x"),m=y.getPixels("y")),l.setCurrent(f,m),"number"==typeof n&&t.getAttribute("x",!0).setValue(n),"number"==typeof a&&t.getAttribute("y",!0).setValue(a),"number"==typeof r||"number"==typeof s){var v=p(t.getAttribute("viewBox").getString()),x=0,b=0;if("number"==typeof r){var S=t.getStyle("width");S.hasValue()?x=S.getPixels("x")/r:isNaN(v[2])||(x=v[2]/r)}if("number"==typeof s){var P=t.getStyle("height");P.hasValue()?b=P.getPixels("y")/s:isNaN(v[3])||(b=v[3]/s)}x||(x=b),b||(b=x),t.getAttribute("width",!0).setValue(r),t.getAttribute("height",!0).setValue(s);var w=t.getStyle("transform",!0,!0);w.setValue("".concat(w.getString()," scale(").concat(1/x,", ").concat(1/b,")"))}i||u.clearRect(0,0,f,m),t.render(u),g&&(this.isFirstRender=!1)}}H.defaultWindow=Y,H.defaultFetch=U;var{defaultFetch:W}=H,q="undefined"!=typeof DOMParser?DOMParser:null;class G{constructor(){var{fetch:t=W,DOMParser:e=q}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.fetch=t,this.DOMParser=e}parse(t){var e=this;return(0,r.A)((function*(){return t.startsWith("<")?e.parseFromString(t):e.load(t)}))()}parseFromString(t){var e=new this.DOMParser;try{return this.checkDocument(e.parseFromString(t,"image/svg+xml"))}catch(i){return this.checkDocument(e.parseFromString(t,"text/xml"))}}checkDocument(t){var e=t.getElementsByTagName("parsererror")[0];if(e)throw new Error(e.textContent);return t}load(t){var e=this;return(0,r.A)((function*(){var i=yield e.fetch(t),r=yield i.text();return e.parseFromString(r)}))()}}class Q{constructor(t,e){this.type="translate",this.point=null,this.point=X.parse(e)}apply(t){var{x:e,y:i}=this.point;t.translate(e||0,i||0)}unapply(t){var{x:e,y:i}=this.point;t.translate(-1*e||0,-1*i||0)}applyToPoint(t){var{x:e,y:i}=this.point;t.applyTransform([1,0,0,1,e||0,i||0])}}class ${constructor(t,e,i){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var r=p(e);this.angle=new F(t,"angle",r[0]),this.originX=i[0],this.originY=i[1],this.cx=r[1]||0,this.cy=r[2]||0}apply(t){var{cx:e,cy:i,originX:r,originY:s,angle:n}=this,a=e+r.getPixels("x"),h=i+s.getPixels("y");t.translate(a,h),t.rotate(n.getRadians()),t.translate(-a,-h)}unapply(t){var{cx:e,cy:i,originX:r,originY:s,angle:n}=this,a=e+r.getPixels("x"),h=i+s.getPixels("y");t.translate(a,h),t.rotate(-1*n.getRadians()),t.translate(-a,-h)}applyToPoint(t){var{cx:e,cy:i,angle:r}=this,s=r.getRadians();t.applyTransform([1,0,0,1,e||0,i||0]),t.applyTransform([Math.cos(s),Math.sin(s),-Math.sin(s),Math.cos(s),0,0]),t.applyTransform([1,0,0,1,-e||0,-i||0])}}class Z{constructor(t,e,i){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var r=X.parseScale(e);0!==r.x&&0!==r.y||(r.x=E,r.y=E),this.scale=r,this.originX=i[0],this.originY=i[1]}apply(t){var{scale:{x:e,y:i},originX:r,originY:s}=this,n=r.getPixels("x"),a=s.getPixels("y");t.translate(n,a),t.scale(e,i||e),t.translate(-n,-a)}unapply(t){var{scale:{x:e,y:i},originX:r,originY:s}=this,n=r.getPixels("x"),a=s.getPixels("y");t.translate(n,a),t.scale(1/e,1/i||e),t.translate(-n,-a)}applyToPoint(t){var{x:e,y:i}=this.scale;t.applyTransform([e||0,0,0,i||0,0,0])}}class J{constructor(t,e,i){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=p(e),this.originX=i[0],this.originY=i[1]}apply(t){var{originX:e,originY:i,matrix:r}=this,s=e.getPixels("x"),n=i.getPixels("y");t.translate(s,n),t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),t.translate(-s,-n)}unapply(t){var{originX:e,originY:i,matrix:r}=this,s=r[0],n=r[2],a=r[4],h=r[1],o=r[3],l=r[5],u=1/(s*(1*o-0*l)-n*(1*h-0*l)+a*(0*h-0*o)),g=e.getPixels("x"),c=i.getPixels("y");t.translate(g,c),t.transform(u*(1*o-0*l),u*(0*l-1*h),u*(0*a-1*n),u*(1*s-0*a),u*(n*l-a*o),u*(a*h-s*l)),t.translate(-g,-c)}applyToPoint(t){t.applyTransform(this.matrix)}}class K extends J{constructor(t,e,i){super(t,e,i),this.type="skew",this.angle=null,this.angle=new F(t,"angle",e)}}class tt extends K{constructor(t,e,i){super(t,e,i),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}}class et extends K{constructor(t,e,i){super(t,e,i),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}}class it{constructor(t,e,i){this.document=t,this.transforms=[];var r=function(t){return g(t).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}(e);r.forEach((t=>{if("none"!==t){var[e,r]=function(t){var[e,i]=t.split("(");return[e.trim(),i.trim().replace(")","")]}(t),s=it.transformTypes[e];void 0!==s&&this.transforms.push(new s(this.document,r,i))}}))}static fromElement(t,e){var i=e.getStyle("transform",!1,!0),[r,s=r]=e.getStyle("transform-origin",!1,!0).split(),n=[r,s];return i.hasValue()?new it(t,i.getString(),n):null}apply(t){for(var{transforms:e}=this,i=e.length,r=0;r<i;r++)e[r].apply(t)}unapply(t){for(var{transforms:e}=this,i=e.length-1;i>=0;i--)e[i].unapply(t)}applyToPoint(t){for(var{transforms:e}=this,i=e.length,r=0;r<i;r++)e[r].applyToPoint(t)}}it.transformTypes={translate:Q,rotate:$,scale:Z,matrix:J,skewX:tt,skewY:et};class rt{constructor(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.document=t,this.node=e,this.captureTextNodes=i,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],e&&1===e.nodeType){if(Array.from(e.attributes).forEach((e=>{var i=f(e.nodeName);this.attributes[i]=new F(t,i,e.value)})),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue())this.getAttribute("style").getString().split(";").map((t=>t.trim())).forEach((e=>{if(e){var[i,r]=e.split(":").map((t=>t.trim()));this.styles[i]=new F(t,i,r)}}));var{definitions:r}=t,s=this.getAttribute("id");s.hasValue()&&(r[s.getString()]||(r[s.getString()]=this)),Array.from(e.childNodes).forEach((e=>{if(1===e.nodeType)this.addChild(e);else if(i&&(3===e.nodeType||4===e.nodeType)){var r=t.createTextNode(e);r.getText().length>0&&this.addChild(r)}}))}}getAttribute(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.attributes[t];if(!i&&e){var r=new F(this.document,t,"");return this.attributes[t]=r,r}return i||F.empty(this.document)}getHrefAttribute(){for(var t in this.attributes)if("href"===t||t.endsWith(":href"))return this.attributes[t];return F.empty(this.document)}getStyle(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.styles[t];if(r)return r;var s=this.getAttribute(t);if(null!=s&&s.hasValue())return this.styles[t]=s,s;if(!i){var{parent:n}=this;if(n){var a=n.getStyle(t);if(null!=a&&a.hasValue())return a}}if(e){var h=new F(this.document,t,"");return this.styles[t]=h,h}return r||F.empty(this.document)}render(t){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(t.save(),this.getStyle("mask").hasValue()){var e=this.getStyle("mask").getDefinition();e&&(this.applyEffects(t),e.apply(t,this))}else if("none"!==this.getStyle("filter").getValue("none")){var i=this.getStyle("filter").getDefinition();i&&(this.applyEffects(t),i.apply(t,this))}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}setContext(t){}applyEffects(t){var e=it.fromElement(this.document,this);e&&e.apply(t);var i=this.getStyle("clip-path",!1,!0);if(i.hasValue()){var r=i.getDefinition();r&&r.apply(t)}}clearContext(t){}renderChildren(t){this.children.forEach((e=>{e.render(t)}))}addChild(t){var e=t instanceof rt?t:this.document.createElement(t);e.parent=this,rt.ignoreChildTypes.includes(e.type)||this.children.push(e)}matchesSelector(t){var e,{node:i}=this;if("function"==typeof i.matches)return i.matches(t);var r=null===(e=i.getAttribute)||void 0===e?void 0:e.call(i,"class");return!(!r||""===r)&&r.split(" ").some((e=>".".concat(e)===t))}addStylesFromStyleDefinition(){var{styles:t,stylesSpecificity:e}=this.document;for(var i in t)if(!i.startsWith("@")&&this.matchesSelector(i)){var r=t[i],s=e[i];if(r)for(var n in r){var a=this.stylesSpecificity[n];void 0===a&&(a="000"),s>=a&&(this.styles[n]=r[n],this.stylesSpecificity[n]=s)}}}removeStyles(t,e){return e.reduce(((e,i)=>{var r=t.getStyle(i);if(!r.hasValue())return e;var s=r.getString();return r.setValue(""),[...e,[i,s]]}),[])}restoreStyles(t,e){e.forEach((e=>{var[i,r]=e;t.getStyle(i,!0).setValue(r)}))}isFirstChild(){var t;return 0===(null===(t=this.parent)||void 0===t?void 0:t.children.indexOf(this))}}rt.ignoreChildTypes=["title"];class st extends rt{constructor(t,e,i){super(t,e,i)}}function nt(t){var e=t.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function at(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:return/^oblique\s+(-|)\d+deg$/.test(e)?e:""}}function ht(t){if(!t)return"";var e=t.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:return/^[\d.]+$/.test(e)?e:""}}class ot{constructor(t,e,i,r,s,n){var a=n?"string"==typeof n?ot.parse(n):n:{};this.fontFamily=s||a.fontFamily,this.fontSize=r||a.fontSize,this.fontStyle=t||a.fontStyle,this.fontWeight=i||a.fontWeight,this.fontVariant=e||a.fontVariant}static parse(){var t=arguments.length>1?arguments[1]:void 0,e="",i="",r="",s="",n="",a=g(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").trim().split(" "),h={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return a.forEach((t=>{switch(!0){case!h.fontStyle&&ot.styles.includes(t):"inherit"!==t&&(e=t),h.fontStyle=!0;break;case!h.fontVariant&&ot.variants.includes(t):"inherit"!==t&&(i=t),h.fontStyle=!0,h.fontVariant=!0;break;case!h.fontWeight&&ot.weights.includes(t):"inherit"!==t&&(r=t),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0;break;case!h.fontSize:"inherit"!==t&&([s]=t.split("/")),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0,h.fontSize=!0;break;default:"inherit"!==t&&(n+=t)}})),new ot(e,i,r,s,n,t)}toString(){return[at(this.fontStyle),this.fontVariant,ht(this.fontWeight),this.fontSize,(t=this.fontFamily,void 0===l?t:t.trim().split(",").map(nt).join(","))].join(" ").trim();var t}}ot.styles="normal|italic|oblique|inherit",ot.variants="normal|small-caps|inherit",ot.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";class lt{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;this.x1=t,this.y1=e,this.x2=i,this.y2=r,this.addPoint(t,e),this.addPoint(i,r)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(t,e){void 0!==t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),void 0!==e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))}addX(t){this.addPoint(t,null)}addY(t){this.addPoint(null,t)}addBoundingBox(t){if(t){var{x1:e,y1:i,x2:r,y2:s}=t;this.addPoint(e,i),this.addPoint(r,s)}}sumCubic(t,e,i,r,s){return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*i+3*(1-t)*Math.pow(t,2)*r+Math.pow(t,3)*s}bezierCurveAdd(t,e,i,r,s){var n=6*e-12*i+6*r,a=-3*e+9*i-9*r+3*s,h=3*i-3*e;if(0!==a){var o=Math.pow(n,2)-4*h*a;if(!(o<0)){var l=(-n+Math.sqrt(o))/(2*a);0<l&&l<1&&(t?this.addX(this.sumCubic(l,e,i,r,s)):this.addY(this.sumCubic(l,e,i,r,s)));var u=(-n-Math.sqrt(o))/(2*a);0<u&&u<1&&(t?this.addX(this.sumCubic(u,e,i,r,s)):this.addY(this.sumCubic(u,e,i,r,s)))}}else{if(0===n)return;var g=-h/n;0<g&&g<1&&(t?this.addX(this.sumCubic(g,e,i,r,s)):this.addY(this.sumCubic(g,e,i,r,s)))}}addBezierCurve(t,e,i,r,s,n,a,h){this.addPoint(t,e),this.addPoint(a,h),this.bezierCurveAdd(!0,t,i,s,a),this.bezierCurveAdd(!1,e,r,n,h)}addQuadraticCurve(t,e,i,r,s,n){var a=t+2/3*(i-t),h=e+2/3*(r-e),o=a+1/3*(s-t),l=h+1/3*(n-e);this.addBezierCurve(t,e,a,o,h,l,s,n)}isPointInBox(t,e){var{x1:i,y1:r,x2:s,y2:n}=this;return i<=t&&t<=s&&r<=e&&e<=n}}class ut extends h.LQ{constructor(t){super(t.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new X(0,0),this.control=new X(0,0),this.current=new X(0,0),this.points=[],this.angles=[]}isEnd(){var{i:t,commands:e}=this;return t>=e.length-1}next(){var t=this.commands[++this.i];return this.previousCommand=this.command,this.command=t,t}getPoint(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",i=new X(this.command[t],this.command[e]);return this.makeAbsolute(i)}getAsControlPoint(t,e){var i=this.getPoint(t,e);return this.control=i,i}getAsCurrentPoint(t,e){var i=this.getPoint(t,e);return this.current=i,i}getReflectedControlPoint(){var t=this.previousCommand.type;if(t!==h.LQ.CURVE_TO&&t!==h.LQ.SMOOTH_CURVE_TO&&t!==h.LQ.QUAD_TO&&t!==h.LQ.SMOOTH_QUAD_TO)return this.current;var{current:{x:e,y:i},control:{x:r,y:s}}=this;return new X(2*e-r,2*i-s)}makeAbsolute(t){if(this.command.relative){var{x:e,y:i}=this.current;t.x+=e,t.y+=i}return t}addMarker(t,e,i){var{points:r,angles:s}=this;i&&s.length>0&&!s[s.length-1]&&(s[s.length-1]=r[r.length-1].angleTo(i)),this.addMarkerAngle(t,e?e.angleTo(t):null)}addMarkerAngle(t,e){this.points.push(t),this.angles.push(e)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:t}=this,e=t.length,i=0;i<e;i++)if(!t[i])for(var r=i+1;r<e;r++)if(t[r]){t[i]=t[r];break}return t}}class gt extends rt{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var t=1,e=this;e;){var i=e.getStyle("opacity",!1,!0);i.hasValue(!0)&&(t*=i.getNumber()),e=e.parent}return t}setContext(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e){var i=this.getStyle("fill"),r=this.getStyle("fill-opacity"),s=this.getStyle("stroke"),n=this.getStyle("stroke-opacity");if(i.isUrlDefinition()){var a=i.getFillStyleDefinition(this,r);a&&(t.fillStyle=a)}else if(i.hasValue()){"currentColor"===i.getString()&&i.setValue(this.getStyle("color").getColor());var h=i.getColor();"inherit"!==h&&(t.fillStyle="none"===h?"rgba(0,0,0,0)":h)}if(r.hasValue()){var o=new F(this.document,"fill",t.fillStyle).addOpacity(r).getColor();t.fillStyle=o}if(s.isUrlDefinition()){var l=s.getFillStyleDefinition(this,n);l&&(t.strokeStyle=l)}else if(s.hasValue()){"currentColor"===s.getString()&&s.setValue(this.getStyle("color").getColor());var u=s.getString();"inherit"!==u&&(t.strokeStyle="none"===u?"rgba(0,0,0,0)":u)}if(n.hasValue()){var g=new F(this.document,"stroke",t.strokeStyle).addOpacity(n).getString();t.strokeStyle=g}var c=this.getStyle("stroke-width");if(c.hasValue()){var d=c.getPixels();t.lineWidth=d||E}var y=this.getStyle("stroke-linecap"),f=this.getStyle("stroke-linejoin"),m=this.getStyle("stroke-miterlimit"),v=this.getStyle("stroke-dasharray"),x=this.getStyle("stroke-dashoffset");if(y.hasValue()&&(t.lineCap=y.getString()),f.hasValue()&&(t.lineJoin=f.getString()),m.hasValue()&&(t.miterLimit=m.getNumber()),v.hasValue()&&"none"!==v.getString()){var b=p(v.getString());void 0!==t.setLineDash?t.setLineDash(b):void 0!==t.webkitLineDash?t.webkitLineDash=b:void 0===t.mozDash||1===b.length&&0===b[0]||(t.mozDash=b);var S=x.getPixels();void 0!==t.lineDashOffset?t.lineDashOffset=S:void 0!==t.webkitLineDashOffset?t.webkitLineDashOffset=S:void 0!==t.mozDashOffset&&(t.mozDashOffset=S)}}if(this.modifiedEmSizeStack=!1,void 0!==t.font){var P=this.getStyle("font"),w=this.getStyle("font-style"),A=this.getStyle("font-variant"),C=this.getStyle("font-weight"),T=this.getStyle("font-size"),V=this.getStyle("font-family"),M=new ot(w.getString(),A.getString(),C.getString(),T.hasValue()?"".concat(T.getPixels(!0),"px"):"",V.getString(),ot.parse(P.getString(),t.font));w.setValue(M.fontStyle),A.setValue(M.fontVariant),C.setValue(M.fontWeight),T.setValue(M.fontSize),V.setValue(M.fontFamily),t.font=M.toString(),T.isPixels()&&(this.document.emSize=T.getPixels(),this.modifiedEmSizeStack=!0)}e||(this.applyEffects(t),t.globalAlpha=this.calculateOpacity())}clearContext(t){super.clearContext(t),this.modifiedEmSizeStack&&this.document.popEmSize()}}class ct extends gt{constructor(t,e,i){super(t,e,i),this.type="path",this.pathParser=null,this.pathParser=new ut(this.getAttribute("d").getString())}path(t){var{pathParser:e}=this,i=new lt;for(e.reset(),t&&t.beginPath();!e.isEnd();)switch(e.next().type){case ut.MOVE_TO:this.pathM(t,i);break;case ut.LINE_TO:this.pathL(t,i);break;case ut.HORIZ_LINE_TO:this.pathH(t,i);break;case ut.VERT_LINE_TO:this.pathV(t,i);break;case ut.CURVE_TO:this.pathC(t,i);break;case ut.SMOOTH_CURVE_TO:this.pathS(t,i);break;case ut.QUAD_TO:this.pathQ(t,i);break;case ut.SMOOTH_QUAD_TO:this.pathT(t,i);break;case ut.ARC:this.pathA(t,i);break;case ut.CLOSE_PATH:this.pathZ(t,i)}return i}getBoundingBox(t){return this.path()}getMarkers(){var{pathParser:t}=this,e=t.getMarkerPoints(),i=t.getMarkerAngles();return e.map(((t,e)=>[t,i[e]]))}renderChildren(t){this.path(t),this.document.screen.mouse.checkPath(this,t);var e=this.getStyle("fill-rule");""!==t.fillStyle&&("inherit"!==e.getString("inherit")?t.fill(e.getString()):t.fill()),""!==t.strokeStyle&&("non-scaling-stroke"===this.getAttribute("vector-effect").getString()?(t.save(),t.setTransform(1,0,0,1,0,0),t.stroke(),t.restore()):t.stroke());var i=this.getMarkers();if(i){var r=i.length-1,s=this.getStyle("marker-start"),n=this.getStyle("marker-mid"),a=this.getStyle("marker-end");if(s.isUrlDefinition()){var h=s.getDefinition(),[o,l]=i[0];h.render(t,o,l)}if(n.isUrlDefinition())for(var u=n.getDefinition(),g=1;g<r;g++){var[c,d]=i[g];u.render(t,c,d)}if(a.isUrlDefinition()){var p=a.getDefinition(),[y,f]=i[r];p.render(t,y,f)}}}static pathM(t){var e=t.getAsCurrentPoint();return t.start=t.current,{point:e}}pathM(t,e){var{pathParser:i}=this,{point:r}=ct.pathM(i),{x:s,y:n}=r;i.addMarker(r),e.addPoint(s,n),t&&t.moveTo(s,n)}static pathL(t){var{current:e}=t;return{current:e,point:t.getAsCurrentPoint()}}pathL(t,e){var{pathParser:i}=this,{current:r,point:s}=ct.pathL(i),{x:n,y:a}=s;i.addMarker(s,r),e.addPoint(n,a),t&&t.lineTo(n,a)}static pathH(t){var{current:e,command:i}=t,r=new X((i.relative?e.x:0)+i.x,e.y);return t.current=r,{current:e,point:r}}pathH(t,e){var{pathParser:i}=this,{current:r,point:s}=ct.pathH(i),{x:n,y:a}=s;i.addMarker(s,r),e.addPoint(n,a),t&&t.lineTo(n,a)}static pathV(t){var{current:e,command:i}=t,r=new X(e.x,(i.relative?e.y:0)+i.y);return t.current=r,{current:e,point:r}}pathV(t,e){var{pathParser:i}=this,{current:r,point:s}=ct.pathV(i),{x:n,y:a}=s;i.addMarker(s,r),e.addPoint(n,a),t&&t.lineTo(n,a)}static pathC(t){var{current:e}=t;return{current:e,point:t.getPoint("x1","y1"),controlPoint:t.getAsControlPoint("x2","y2"),currentPoint:t.getAsCurrentPoint()}}pathC(t,e){var{pathParser:i}=this,{current:r,point:s,controlPoint:n,currentPoint:a}=ct.pathC(i);i.addMarker(a,n,s),e.addBezierCurve(r.x,r.y,s.x,s.y,n.x,n.y,a.x,a.y),t&&t.bezierCurveTo(s.x,s.y,n.x,n.y,a.x,a.y)}static pathS(t){var{current:e}=t;return{current:e,point:t.getReflectedControlPoint(),controlPoint:t.getAsControlPoint("x2","y2"),currentPoint:t.getAsCurrentPoint()}}pathS(t,e){var{pathParser:i}=this,{current:r,point:s,controlPoint:n,currentPoint:a}=ct.pathS(i);i.addMarker(a,n,s),e.addBezierCurve(r.x,r.y,s.x,s.y,n.x,n.y,a.x,a.y),t&&t.bezierCurveTo(s.x,s.y,n.x,n.y,a.x,a.y)}static pathQ(t){var{current:e}=t;return{current:e,controlPoint:t.getAsControlPoint("x1","y1"),currentPoint:t.getAsCurrentPoint()}}pathQ(t,e){var{pathParser:i}=this,{current:r,controlPoint:s,currentPoint:n}=ct.pathQ(i);i.addMarker(n,s,s),e.addQuadraticCurve(r.x,r.y,s.x,s.y,n.x,n.y),t&&t.quadraticCurveTo(s.x,s.y,n.x,n.y)}static pathT(t){var{current:e}=t,i=t.getReflectedControlPoint();return t.control=i,{current:e,controlPoint:i,currentPoint:t.getAsCurrentPoint()}}pathT(t,e){var{pathParser:i}=this,{current:r,controlPoint:s,currentPoint:n}=ct.pathT(i);i.addMarker(n,s,s),e.addQuadraticCurve(r.x,r.y,s.x,s.y,n.x,n.y),t&&t.quadraticCurveTo(s.x,s.y,n.x,n.y)}static pathA(t){var{current:e,command:i}=t,{rX:r,rY:s,xRot:n,lArcFlag:a,sweepFlag:h}=i,o=n*(Math.PI/180),l=t.getAsCurrentPoint(),u=new X(Math.cos(o)*(e.x-l.x)/2+Math.sin(o)*(e.y-l.y)/2,-Math.sin(o)*(e.x-l.x)/2+Math.cos(o)*(e.y-l.y)/2),g=Math.pow(u.x,2)/Math.pow(r,2)+Math.pow(u.y,2)/Math.pow(s,2);g>1&&(r*=Math.sqrt(g),s*=Math.sqrt(g));var c=(a===h?-1:1)*Math.sqrt((Math.pow(r,2)*Math.pow(s,2)-Math.pow(r,2)*Math.pow(u.y,2)-Math.pow(s,2)*Math.pow(u.x,2))/(Math.pow(r,2)*Math.pow(u.y,2)+Math.pow(s,2)*Math.pow(u.x,2)));isNaN(c)&&(c=0);var d=new X(c*r*u.y/s,c*-s*u.x/r),p=new X((e.x+l.x)/2+Math.cos(o)*d.x-Math.sin(o)*d.y,(e.y+l.y)/2+Math.sin(o)*d.x+Math.cos(o)*d.y),y=O([1,0],[(u.x-d.x)/r,(u.y-d.y)/s]),f=[(u.x-d.x)/r,(u.y-d.y)/s],m=[(-u.x-d.x)/r,(-u.y-d.y)/s],v=O(f,m);return k(f,m)<=-1&&(v=Math.PI),k(f,m)>=1&&(v=0),{currentPoint:l,rX:r,rY:s,sweepFlag:h,xAxisRotation:o,centp:p,a1:y,ad:v}}pathA(t,e){var{pathParser:i}=this,{currentPoint:r,rX:s,rY:n,sweepFlag:a,xAxisRotation:h,centp:o,a1:l,ad:u}=ct.pathA(i),g=1-a?1:-1,c=l+g*(u/2),d=new X(o.x+s*Math.cos(c),o.y+n*Math.sin(c));if(i.addMarkerAngle(d,c-g*Math.PI/2),i.addMarkerAngle(r,c-g*Math.PI),e.addPoint(r.x,r.y),t&&!isNaN(l)&&!isNaN(u)){var p=s>n?s:n,y=s>n?1:s/n,f=s>n?n/s:1;t.translate(o.x,o.y),t.rotate(h),t.scale(y,f),t.arc(0,0,p,l,l+u,Boolean(1-a)),t.scale(1/y,1/f),t.rotate(-h),t.translate(-o.x,-o.y)}}static pathZ(t){t.current=t.start}pathZ(t,e){ct.pathZ(this.pathParser),t&&e.x1!==e.x2&&e.y1!==e.y2&&t.closePath()}}class dt extends ct{constructor(t,e,i){super(t,e,i),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}}class pt extends gt{constructor(t,e,i){super(t,e,new.target===pt||i),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.setContext(t,e);var i=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();i&&(t.textBaseline=i)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(t){if("text"!==this.type)return this.getTElementBoundingBox(t);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t);var e=null;return this.children.forEach(((i,r)=>{var s=this.getChildBoundingBox(t,this,this,r);e?e.addBoundingBox(s):e=s})),e}getFontSize(){var{document:t,parent:e}=this,i=ot.parse(t.ctx.font).fontSize;return e.getStyle("font-size").getNumber(i)}getTElementBoundingBox(t){var e=this.getFontSize();return new lt(this.x,this.y-e,this.x+this.measureText(t),this.y)}getGlyph(t,e,i){var r=e[i],s=null;if(t.isArabic){var n=e.length,a=e[i-1],h=e[i+1],o="isolated";if((0===i||" "===a)&&i<n-1&&" "!==h&&(o="terminal"),i>0&&" "!==a&&i<n-1&&" "!==h&&(o="medial"),i>0&&" "!==a&&(i===n-1||" "===h)&&(o="initial"),void 0!==t.glyphs[r]){var l=t.glyphs[r];s=l instanceof dt?l:l[o]}}else s=t.glyphs[r];return s||(s=t.missingGlyph),s}getText(){return""}getTextFromNode(t){var e=t||this.node,i=Array.from(e.parentNode.childNodes),r=i.indexOf(e),s=i.length-1,n=g(e.textContent||"");return 0===r&&(n=c(n)),r===s&&(n=d(n)),n}renderChildren(t){if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t),this.children.forEach(((e,i)=>{this.renderChild(t,this,this,i)}));var{mouse:e}=this.document.screen;e.isWorking()&&e.checkBoundingBox(this,this.getBoundingBox(t))}else this.renderTElementChildren(t)}renderTElementChildren(t){var{document:e,parent:i}=this,r=this.getText(),s=i.getStyle("font-family").getDefinition();if(s)for(var{unitsPerEm:n}=s.fontFace,a=ot.parse(e.ctx.font),h=i.getStyle("font-size").getNumber(a.fontSize),o=i.getStyle("font-style").getString(a.fontStyle),l=h/n,u=s.isRTL?r.split("").reverse().join(""):r,g=p(i.getAttribute("dx").getString()),c=u.length,d=0;d<c;d++){var y=this.getGlyph(s,u,d);t.translate(this.x,this.y),t.scale(l,-l);var f=t.lineWidth;t.lineWidth=t.lineWidth*n/h,"italic"===o&&t.transform(1,0,.4,1,0,0),y.render(t),"italic"===o&&t.transform(1,0,-.4,1,0,0),t.lineWidth=f,t.scale(1/l,-1/l),t.translate(-this.x,-this.y),this.x+=h*(y.horizAdvX||s.horizAdvX)/n,void 0===g[d]||isNaN(g[d])||(this.x+=g[d])}else{var{x:m,y:v}=this;t.fillStyle&&t.fillText(r,m,v),t.strokeStyle&&t.strokeText(r,m,v)}}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var t=this.leafTexts[this.textChunkStart],e=t.getStyle("text-anchor").getString("start"),i=0;i="start"===e?t.x-this.minX:"end"===e?t.x-this.maxX:t.x-(this.minX+this.maxX)/2;for(var r=this.textChunkStart;r<this.leafTexts.length;r++)this.leafTexts[r].x+=i;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(t){this.children.forEach(((e,i)=>{this.adjustChildCoordinatesRecursiveCore(t,this,this,i)})),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(t,e,i,r){var s=i.children[r];s.children.length>0?s.children.forEach(((i,r)=>{e.adjustChildCoordinatesRecursiveCore(t,e,s,r)})):this.adjustChildCoordinates(t,e,i,r)}adjustChildCoordinates(t,e,i,r){var s=i.children[r];if("function"!=typeof s.measureText)return s;t.save(),s.setContext(t,!0);var n=s.getAttribute("x"),a=s.getAttribute("y"),h=s.getAttribute("dx"),o=s.getAttribute("dy"),l=s.getStyle("font-family").getDefinition(),u=Boolean(l)&&l.isRTL;0===r&&(n.hasValue()||n.setValue(s.getInheritedAttribute("x")),a.hasValue()||a.setValue(s.getInheritedAttribute("y")),h.hasValue()||h.setValue(s.getInheritedAttribute("dx")),o.hasValue()||o.setValue(s.getInheritedAttribute("dy")));var g=s.measureText(t);return u&&(e.x-=g),n.hasValue()?(e.applyAnchoring(),s.x=n.getPixels("x"),h.hasValue()&&(s.x+=h.getPixels("x"))):(h.hasValue()&&(e.x+=h.getPixels("x")),s.x=e.x),e.x=s.x,u||(e.x+=g),a.hasValue()?(s.y=a.getPixels("y"),o.hasValue()&&(s.y+=o.getPixels("y"))):(o.hasValue()&&(e.y+=o.getPixels("y")),s.y=e.y),e.y=s.y,e.leafTexts.push(s),e.minX=Math.min(e.minX,s.x,s.x+g),e.maxX=Math.max(e.maxX,s.x,s.x+g),s.clearContext(t),t.restore(),s}getChildBoundingBox(t,e,i,r){var s=i.children[r];if("function"!=typeof s.getBoundingBox)return null;var n=s.getBoundingBox(t);return n?(s.children.forEach(((i,r)=>{var a=e.getChildBoundingBox(t,e,s,r);n.addBoundingBox(a)})),n):null}renderChild(t,e,i,r){var s=i.children[r];s.render(t),s.children.forEach(((i,r)=>{e.renderChild(t,e,s,r)}))}measureText(t){var{measureCache:e}=this;if(~e)return e;var i=this.getText(),r=this.measureTargetText(t,i);return this.measureCache=r,r}measureTargetText(t,e){if(!e.length)return 0;var{parent:i}=this,r=i.getStyle("font-family").getDefinition();if(r){for(var s=this.getFontSize(),n=r.isRTL?e.split("").reverse().join(""):e,a=p(i.getAttribute("dx").getString()),h=n.length,o=0,l=0;l<h;l++){o+=(this.getGlyph(r,n,l).horizAdvX||r.horizAdvX)*s/r.fontFace.unitsPerEm,void 0===a[l]||isNaN(a[l])||(o+=a[l])}return o}if(!t.measureText)return 10*e.length;t.save(),this.setContext(t,!0);var{width:u}=t.measureText(e);return this.clearContext(t),t.restore(),u}getInheritedAttribute(t){for(var e=this;e instanceof pt&&e.isFirstChild();){var i=e.parent.getAttribute(t);if(i.hasValue(!0))return i.getValue("0");e=e.parent}return null}}class yt extends pt{constructor(t,e,i){super(t,e,new.target===yt||i),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}}class ft extends yt{constructor(){super(...arguments),this.type="textNode"}}class mt extends gt{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(t){var e,{document:i}=this,{screen:r,window:s}=i,n=t.canvas;if(r.setDefaults(t),n.style&&void 0!==t.font&&s&&void 0!==s.getComputedStyle){t.font=s.getComputedStyle(n).getPropertyValue("font");var a=new F(i,"fontSize",ot.parse(t.font).fontSize);a.hasValue()&&(i.rootEmSize=a.getPixels("y"),i.emSize=i.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:h,height:o}=r.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var l=this.getAttribute("refX"),u=this.getAttribute("refY"),g=this.getAttribute("viewBox"),c=g.hasValue()?p(g.getString()):null,d=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),y=0,f=0,m=0,v=0;c&&(y=c[0],f=c[1]),this.root||(h=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y"),"marker"===this.type&&(m=y,v=f,y=0,f=0)),r.viewPort.setCurrent(h,o),!this.node||this.parent&&"foreignObject"!==(null===(e=this.node.parentNode)||void 0===e?void 0:e.nodeName)||!this.getStyle("transform",!1,!0).hasValue()||this.getStyle("transform-origin",!1,!0).hasValue()||this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(t),t.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),c&&(h=c[2],o=c[3]),i.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:r.viewPort.width,desiredWidth:h,height:r.viewPort.height,desiredHeight:o,minX:y,minY:f,refX:l.getValue(),refY:u.getValue(),clip:d,clipX:m,clipY:v}),c&&(r.viewPort.removeCurrent(),r.viewPort.setCurrent(h,o))}clearContext(t){super.clearContext(t),this.document.screen.viewPort.removeCurrent()}resize(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getAttribute("width",!0),s=this.getAttribute("height",!0),n=this.getAttribute("viewBox"),a=this.getAttribute("style"),h=r.getNumber(0),o=s.getNumber(0);if(i)if("string"==typeof i)this.getAttribute("preserveAspectRatio",!0).setValue(i);else{var l=this.getAttribute("preserveAspectRatio");l.hasValue()&&l.setValue(l.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(r.setValue(t),s.setValue(e),n.hasValue()||n.setValue("0 0 ".concat(h||t," ").concat(o||e)),a.hasValue()){var u=this.getStyle("width"),g=this.getStyle("height");u.hasValue()&&u.setValue("".concat(t,"px")),g.hasValue()&&g.setValue("".concat(e,"px"))}}}class vt extends ct{constructor(){super(...arguments),this.type="rect"}path(t){var e=this.getAttribute("x").getPixels("x"),i=this.getAttribute("y").getPixels("y"),r=this.getStyle("width",!1,!0).getPixels("x"),s=this.getStyle("height",!1,!0).getPixels("y"),n=this.getAttribute("rx"),a=this.getAttribute("ry"),h=n.getPixels("x"),o=a.getPixels("y");if(n.hasValue()&&!a.hasValue()&&(o=h),a.hasValue()&&!n.hasValue()&&(h=o),h=Math.min(h,r/2),o=Math.min(o,s/2),t){var l=(Math.sqrt(2)-1)/3*4;t.beginPath(),s>0&&r>0&&(t.moveTo(e+h,i),t.lineTo(e+r-h,i),t.bezierCurveTo(e+r-h+l*h,i,e+r,i+o-l*o,e+r,i+o),t.lineTo(e+r,i+s-o),t.bezierCurveTo(e+r,i+s-o+l*o,e+r-h+l*h,i+s,e+r-h,i+s),t.lineTo(e+h,i+s),t.bezierCurveTo(e+h-l*h,i+s,e,i+s-o+l*o,e,i+s-o),t.lineTo(e,i+o),t.bezierCurveTo(e,i+o-l*o,e+h-l*h,i,e+h,i),t.closePath())}return new lt(e,i,e+r,i+s)}getMarkers(){return null}}class xt extends ct{constructor(){super(...arguments),this.type="circle"}path(t){var e=this.getAttribute("cx").getPixels("x"),i=this.getAttribute("cy").getPixels("y"),r=this.getAttribute("r").getPixels();return t&&r>0&&(t.beginPath(),t.arc(e,i,r,0,2*Math.PI,!1),t.closePath()),new lt(e-r,i-r,e+r,i+r)}getMarkers(){return null}}class bt extends ct{constructor(){super(...arguments),this.type="ellipse"}path(t){var e=(Math.sqrt(2)-1)/3*4,i=this.getAttribute("rx").getPixels("x"),r=this.getAttribute("ry").getPixels("y"),s=this.getAttribute("cx").getPixels("x"),n=this.getAttribute("cy").getPixels("y");return t&&i>0&&r>0&&(t.beginPath(),t.moveTo(s+i,n),t.bezierCurveTo(s+i,n+e*r,s+e*i,n+r,s,n+r),t.bezierCurveTo(s-e*i,n+r,s-i,n+e*r,s-i,n),t.bezierCurveTo(s-i,n-e*r,s-e*i,n-r,s,n-r),t.bezierCurveTo(s+e*i,n-r,s+i,n-e*r,s+i,n),t.closePath()),new lt(s-i,n-r,s+i,n+r)}getMarkers(){return null}}class St extends ct{constructor(){super(...arguments),this.type="line"}getPoints(){return[new X(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new X(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(t){var[{x:e,y:i},{x:r,y:s}]=this.getPoints();return t&&(t.beginPath(),t.moveTo(e,i),t.lineTo(r,s)),new lt(e,i,r,s)}getMarkers(){var[t,e]=this.getPoints(),i=t.angleTo(e);return[[t,i],[e,i]]}}class Pt extends ct{constructor(t,e,i){super(t,e,i),this.type="polyline",this.points=[],this.points=X.parsePath(this.getAttribute("points").getString())}path(t){var{points:e}=this,[{x:i,y:r}]=e,s=new lt(i,r);return t&&(t.beginPath(),t.moveTo(i,r)),e.forEach((e=>{var{x:i,y:r}=e;s.addPoint(i,r),t&&t.lineTo(i,r)})),s}getMarkers(){var{points:t}=this,e=t.length-1,i=[];return t.forEach(((r,s)=>{s!==e&&i.push([r,r.angleTo(t[s+1])])})),i.length>0&&i.push([t[t.length-1],i[i.length-1][1]]),i}}class wt extends Pt{constructor(){super(...arguments),this.type="polygon"}path(t){var e=super.path(t),[{x:i,y:r}]=this.points;return t&&(t.lineTo(i,r),t.closePath()),e}}class At extends rt{constructor(){super(...arguments),this.type="pattern"}createPattern(t,e,i){var r=this.getStyle("width").getPixels("x",!0),s=this.getStyle("height").getPixels("y",!0),n=new mt(this.document,null);n.attributes.viewBox=new F(this.document,"viewBox",this.getAttribute("viewBox").getValue()),n.attributes.width=new F(this.document,"width","".concat(r,"px")),n.attributes.height=new F(this.document,"height","".concat(s,"px")),n.attributes.transform=new F(this.document,"transform",this.getAttribute("patternTransform").getValue()),n.children=this.children;var a=this.document.createCanvas(r,s),h=a.getContext("2d"),o=this.getAttribute("x"),l=this.getAttribute("y");o.hasValue()&&l.hasValue()&&h.translate(o.getPixels("x",!0),l.getPixels("y",!0)),i.hasValue()?this.styles["fill-opacity"]=i:Reflect.deleteProperty(this.styles,"fill-opacity");for(var u=-1;u<=1;u++)for(var g=-1;g<=1;g++)h.save(),n.attributes.x=new F(this.document,"x",u*a.width),n.attributes.y=new F(this.document,"y",g*a.height),n.render(h),h.restore();return t.createPattern(a,"repeat")}}class Ct extends rt{constructor(){super(...arguments),this.type="marker"}render(t,e,i){if(e){var{x:r,y:s}=e,n=this.getAttribute("orient").getString("auto"),a=this.getAttribute("markerUnits").getString("strokeWidth");t.translate(r,s),"auto"===n&&t.rotate(i),"strokeWidth"===a&&t.scale(t.lineWidth,t.lineWidth),t.save();var h=new mt(this.document,null);h.type=this.type,h.attributes.viewBox=new F(this.document,"viewBox",this.getAttribute("viewBox").getValue()),h.attributes.refX=new F(this.document,"refX",this.getAttribute("refX").getValue()),h.attributes.refY=new F(this.document,"refY",this.getAttribute("refY").getValue()),h.attributes.width=new F(this.document,"width",this.getAttribute("markerWidth").getValue()),h.attributes.height=new F(this.document,"height",this.getAttribute("markerHeight").getValue()),h.attributes.overflow=new F(this.document,"overflow",this.getAttribute("overflow").getValue()),h.attributes.fill=new F(this.document,"fill",this.getAttribute("fill").getColor("black")),h.attributes.stroke=new F(this.document,"stroke",this.getAttribute("stroke").getValue("none")),h.children=this.children,h.render(t),t.restore(),"strokeWidth"===a&&t.scale(1/t.lineWidth,1/t.lineWidth),"auto"===n&&t.rotate(-i),t.translate(-r,-s)}}}class Tt extends rt{constructor(){super(...arguments),this.type="defs"}render(){}}class Vt extend