/*! For license information please see 63.a1c3f78f.chunk.js.LICENSE.txt */ (this["webpackJsonpsimpro-web"]=this["webpackJsonpsimpro-web"]||[]).push([[63],{1123:function(t,e){function r(t,e,r,n,i,a,s){try{var o=t[a](s),u=o.value}catch(h){return void r(h)}o.done?e(u):Promise.resolve(u).then(n,i)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(i,a){var s=t.apply(e,n);function o(t){r(s,i,a,o,u,"next",t)}function u(t){r(s,i,a,o,u,"throw",t)}o(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},2137:function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(655);function i(t){if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=Object(n.a)(t))){var e=0,r=function(){};return{s:r,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a,s=!0,o=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return s=t.done,t},e:function(t){o=!0,a=t},f:function(){try{s||null==i.return||i.return()}finally{if(o)throw a}}}}},2286:function(t,e,r){"use strict";r.r(e),function(t){r.d(e,"AElement",(function(){return te})),r.d(e,"AnimateColorElement",(function(){return Wt})),r.d(e,"AnimateElement",(function(){return Qt})),r.d(e,"AnimateTransformElement",(function(){return Gt})),r.d(e,"BoundingBox",(function(){return St})),r.d(e,"CB1",(function(){return Q})),r.d(e,"CB2",(function(){return W})),r.d(e,"CB3",(function(){return G})),r.d(e,"CB4",(function(){return $})),r.d(e,"Canvg",(function(){return Ne})),r.d(e,"CircleElement",(function(){return _t})),r.d(e,"ClipPathElement",(function(){return ve})),r.d(e,"DefsElement",(function(){return Ft})),r.d(e,"DescElement",(function(){return Se})),r.d(e,"Document",(function(){return Pe})),r.d(e,"Element",(function(){return mt})),r.d(e,"EllipseElement",(function(){return Rt})),r.d(e,"FeColorMatrixElement",(function(){return de})),r.d(e,"FeCompositeElement",(function(){return Oe})),r.d(e,"FeDropShadowElement",(function(){return be})),r.d(e,"FeGaussianBlurElement",(function(){return ke})),r.d(e,"FeMorphologyElement",(function(){return xe})),r.d(e,"FilterElement",(function(){return me})),r.d(e,"Font",(function(){return wt})),r.d(e,"FontElement",(function(){return $t})),r.d(e,"FontFaceElement",(function(){return Zt})),r.d(e,"GElement",(function(){return Ht})),r.d(e,"GlyphElement",(function(){return Pt})),r.d(e,"GradientElement",(function(){return Ut})),r.d(e,"ImageElement",(function(){return ae})),r.d(e,"LineElement",(function(){return It})),r.d(e,"LinearGradientElement",(function(){return Xt})),r.d(e,"MarkerElement",(function(){return zt})),r.d(e,"MaskElement",(function(){return ye})),r.d(e,"Matrix",(function(){return gt})),r.d(e,"MissingGlyphElement",(function(){return Jt})),r.d(e,"Mouse",(function(){return nt})),r.d(e,"PSEUDO_ZERO",(function(){return U})),r.d(e,"Parser",(function(){return ht})),r.d(e,"PathElement",(function(){return Ct})),r.d(e,"PathParser",(function(){return Tt})),r.d(e,"PatternElement",(function(){return Bt})),r.d(e,"Point",(function(){return rt})),r.d(e,"PolygonElement",(function(){return Dt})),r.d(e,"PolylineElement",(function(){return Lt})),r.d(e,"Property",(function(){return tt})),r.d(e,"QB1",(function(){return Z})),r.d(e,"QB2",(function(){return J})),r.d(e,"QB3",(function(){return K})),r.d(e,"RadialGradientElement",(function(){return Yt})),r.d(e,"RectElement",(function(){return Vt})),r.d(e,"RenderedElement",(function(){return At})),r.d(e,"Rotate",(function(){return lt})),r.d(e,"SVGElement",(function(){return Mt})),r.d(e,"SVGFontLoader",(function(){return oe})),r.d(e,"Scale",(function(){return ft})),r.d(e,"Screen",(function(){return st})),r.d(e,"Skew",(function(){return dt})),r.d(e,"SkewX",(function(){return yt})),r.d(e,"SkewY",(function(){return pt})),r.d(e,"StopElement",(function(){return qt})),r.d(e,"StyleElement",(function(){return ue})),r.d(e,"SymbolElement",(function(){return se})),r.d(e,"TRefElement",(function(){return Kt})),r.d(e,"TSpanElement",(function(){return jt})),r.d(e,"TextElement",(function(){return Et})),r.d(e,"TextPathElement",(function(){return ne})),r.d(e,"TitleElement",(function(){return we})),r.d(e,"Transform",(function(){return vt})),r.d(e,"Translate",(function(){return ct})),r.d(e,"UnknownElement",(function(){return bt})),r.d(e,"UseElement",(function(){return he})),r.d(e,"ViewPort",(function(){return et})),r.d(e,"compressSpaces",(function(){return A})),r.d(e,"default",(function(){return Ne})),r.d(e,"getSelectorSpecificity",(function(){return H})),r.d(e,"normalizeAttributeName",(function(){return N})),r.d(e,"normalizeColor",(function(){return V})),r.d(e,"parseExternalUrl",(function(){return M})),r.d(e,"presets",(function(){return T})),r.d(e,"toNumbers",(function(){return E})),r.d(e,"trimLeft",(function(){return C})),r.d(e,"trimRight",(function(){return P})),r.d(e,"vectorMagnitude",(function(){return X})),r.d(e,"vectorsAngle",(function(){return q})),r.d(e,"vectorsRatio",(function(){return Y}));r(192),r(68),r(193),r(194),r(195),r(196),r(197),r(198),r(199),r(200),r(201),r(202),r(102);var n=r(427),i=r(2137),a=r(188),s=r(2293),o=r(129),u=r(733),h=r(186),c=r(187),l=r(184),f=r(185),g=r(618),d=r(1123),y=r.n(d),p=r(677),v=r.n(p),m=r(433),b=r.n(m),x=r(2287),O=r.n(x),k=r(2288),w=r(2289);function S(){S=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function o(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{o({},"")}catch(C){o=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof l?e:l,a=Object.create(i.prototype),s=new w(n||[]);return a._invoke=function(t,e,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return A()}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var o=x(s,r);if(o){if(o===c)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=h(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,s),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(C){return{type:"throw",arg:C}}}t.wrap=u;var c={};function l(){}function f(){}function g(){}var d={};o(d,i,(function(){return this}));var y=Object.getPrototypeOf,p=y&&y(y(T([])));p&&p!==e&&r.call(p,i)&&(d=p);var v=g.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){o(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(i,a){function s(){return new e((function(n,s){!function n(i,a,s,o){var u=h(t[i],t,a);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,s,o)}),(function(t){n("throw",t,s,o)})):e.resolve(l).then((function(t){c.value=t,s(c)}),(function(t){return n("throw",t,s,o)}))}o(u.arg)}(i,a,n,s)}))}return n=n?n.then(s,s):s()}}function x(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=h(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,c;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var o=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(o&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;k(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}var T=Object.freeze({__proto__:null,offscreen:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.DOMParser,r={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,createCanvas:function(t,e){return new OffscreenCanvas(t,e)},createImage:function(t){return y()(S().mark((function e(){var r,n,i;return S().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return r=e.sent,e.next=5,r.blob();case 5:return n=e.sent,e.next=8,createImageBitmap(n);case 8:return i=e.sent,e.abrupt("return",i);case 10:case"end":return e.stop()}}),e)})))()}};return"undefined"===typeof DOMParser&&"undefined"!==typeof e||Reflect.deleteProperty(r,"DOMParser"),r},node:function(t){var e=t.DOMParser,r=t.canvas;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,fetch:t.fetch,createCanvas:r.createCanvas,createImage:r.loadImage}}});function A(t){return t.replace(/(?!\u3000)\s+/gm," ")}function C(t){return t.replace(/^[\n \t]+/,"")}function P(t){return t.replace(/[\n \t]+$/,"")}function E(t){return((t||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[]).map(parseFloat)}var j=/^[A-Z-]+$/;function N(t){return j.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,(function(t,r){return e--&&r?String(Math.round(parseFloat(t))):t}))}var _=/(\[[^\]]+\])/g,R=/(#[^\s+>~.[:]+)/g,I=/(\.[^\s+>~.[:]+)/g,L=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,D=/(:[\w-]+\([^)]*\))/gi,B=/(:[^\s+>~.[:]+)/g,z=/([^\s+>~.[:]+)/g;function F(t,e){var r=e.exec(t);return r?[t.replace(e," "),r.length]:[t,0]}function H(t){var e=[0,0,0],r=t.replace(/:not\(([^)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),n=0,i=F(r,_),a=Object(g.a)(i,2);r=a[0],n=a[1],e[1]+=n;var s=F(r,R),o=Object(g.a)(s,2);r=o[0],n=o[1],e[0]+=n;var u=F(r,I),h=Object(g.a)(u,2);r=h[0],n=h[1],e[1]+=n;var c=F(r,L),l=Object(g.a)(c,2);r=l[0],n=l[1],e[2]+=n;var f=F(r,D),d=Object(g.a)(f,2);r=d[0],n=d[1],e[1]+=n;var y=F(r,B),p=Object(g.a)(y,2);r=p[0],n=p[1],e[1]+=n;var v=F(r=r.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),z),m=Object(g.a)(v,2);return r=m[0],n=m[1],e[2]+=n,e.join("")}var U=1e-8;function X(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))}function Y(t,e){return(t[0]*e[0]+t[1]*e[1])/(X(t)*X(e))}function q(t,e){return(t[0]*e[1]0&&void 0!==arguments[0]?arguments[0]:" ",r=this.document,n=this.name;return A(this.getString()).trim().split(e).map((function(e){return new t(r,n,e)}))}},{key:"hasValue",value:function(t){var e=this.value;return null!==e&&""!==e&&(t||0!==e)&&"undefined"!==typeof e}},{key:"isString",value:function(t){var e=this.value,r="string"===typeof e;return r&&t?t.test(e):r}},{key:"isUrlDefinition",value:function(){return this.isString(/^url\(/)}},{key:"isPixels",value:function(){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}}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"getValue",value:function(t){return"undefined"===typeof t||this.hasValue()?this.value:t}},{key:"getNumber",value:function(t){if(!this.hasValue())return"undefined"===typeof t?0:parseFloat(t);var e=this.value,r=parseFloat(e);return this.isString(/%$/)&&(r/=100),r}},{key:"getString",value:function(t){return"undefined"===typeof t||this.hasValue()?"undefined"===typeof this.value?"":String(this.value):String(t)}},{key:"getColor",value:function(t){var e=this.getString(t);return this.isNormalizedColor||(this.isNormalizedColor=!0,e=V(e),this.value=e),e}},{key:"getDpi",value:function(){return 96}},{key:"getRem",value:function(){return this.document.rootEmSize}},{key:"getEm",value:function(){return this.document.emSize}},{key:"getUnits",value:function(){return this.getString().replace(/[0-9.-]/g,"")}},{key:"getPixels",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var r="boolean"===typeof t?[void 0,t]:[t],n=Object(g.a)(r,2),i=n[0],a=n[1],s=this.document.screen.viewPort;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(/%$/)&&a:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*s.computeSize(i);default:var o=this.getNumber();return e&&o<1?o*s.computeSize(i):o}}},{key:"getMilliseconds",value:function(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}},{key:"getRadians",value:function(){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)}}},{key:"getDefinition",value:function(){var t=this.getString(),e=/#([^)'"]+)/.exec(t);return e&&(e=e[1]),e||(e=t),this.document.definitions[e]}},{key:"getFillStyleDefinition",value:function(t,e){var r=this.getDefinition();if(!r)return null;if("function"===typeof r.createGradient)return r.createGradient(this.document.ctx,t,e);if("function"===typeof r.createPattern){if(r.getHrefAttribute().hasValue()){var n=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),n.hasValue()&&r.getAttribute("patternTransform",!0).setValue(n.value)}return r.createPattern(this.document.ctx,t,e)}return null}},{key:"getTextBaseline",value:function(){return this.hasValue()?t.textBaselineMapping[this.getString()]:null}},{key:"addOpacity",value:function(e){for(var r=this.getColor(),n=r.length,i=0,a=0;a1&&void 0!==arguments[1]?arguments[1]:0,n=E(e),i=Object(g.a)(n,2),a=i[0],s=void 0===a?r:a,o=i[1],u=void 0===o?r:o;return new t(s,u)}},{key:"parseScale",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=E(e),i=Object(g.a)(n,2),a=i[0],s=void 0===a?r:a,o=i[1],u=void 0===o?s:o;return new t(s,u)}},{key:"parsePath",value:function(e){for(var r=E(e),n=r.length,i=[],a=0;a0}},{key:"runEvents",value:function(){if(this.working){var t=this.screen,e=this.events,r=this.eventElements,n=t.ctx.canvas.style;n&&(n.cursor=""),e.forEach((function(t,e){for(var n=t.run,i=r[e];i;)n(i),i=i.parent})),this.events=[],this.eventElements=[]}}},{key:"checkPath",value:function(t,e){if(this.working&&e){var r=this.events,n=this.eventElements;r.forEach((function(r,i){var a=r.x,s=r.y;!n[i]&&e.isPointInPath&&e.isPointInPath(a,s)&&(n[i]=t)}))}}},{key:"checkBoundingBox",value:function(t,e){if(this.working&&e){var r=this.events,n=this.eventElements;r.forEach((function(r,i){var a=r.x,s=r.y;!n[i]&&e.isPointInBox(a,s)&&(n[i]=t)}))}}},{key:"mapXY",value:function(t,e){for(var r=this.screen,n=r.window,i=r.ctx,a=new rt(t,e),s=i.canvas;s;)a.x-=s.offsetLeft,a.y-=s.offsetTop,s=s.offsetParent;return n.scrollX&&(a.x+=n.scrollX),n.scrollY&&(a.y+=n.scrollY),a}},{key:"onClick",value:function(t){var e=this.mapXY(t.clientX,t.clientY),r=e.x,n=e.y;this.events.push({type:"onclick",x:r,y:n,run:function(t){t.onClick&&t.onClick()}})}},{key:"onMouseMove",value:function(t){var e=this.mapXY(t.clientX,t.clientY),r=e.x,n=e.y;this.events.push({type:"onmousemove",x:r,y:n,run:function(t){t.onMouseMove&&t.onMouseMove()}})}}]),t}(),it="undefined"!==typeof window?window:null,at="undefined"!==typeof fetch?fetch.bind(void 0):null,st=function(){function t(e){Object(l.a)(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.fetch,i=void 0===n?at:n,a=r.window,s=void 0===a?it:a;this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new et,this.mouse=new nt(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=s,this.fetch=i}return Object(f.a)(t,[{key:"wait",value:function(t){this.waits.push(t)}},{key:"ready",value:function(){return this.readyPromise?this.readyPromise:Promise.resolve()}},{key:"isReady",value:function(){if(this.isReadyLock)return!0;var t=this.waits.every((function(t){return t()}));return t&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=t,t}},{key:"setDefaults",value:function(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4}},{key:"setViewBox",value:function(t){var e=t.document,r=t.ctx,n=t.aspectRatio,i=t.width,a=t.desiredWidth,s=t.height,o=t.desiredHeight,u=t.minX,h=void 0===u?0:u,c=t.minY,l=void 0===c?0:c,f=t.refX,d=t.refY,y=t.clip,p=void 0!==y&&y,v=t.clipX,m=void 0===v?0:v,b=t.clipY,x=void 0===b?0:b,O=A(n).replace(/^defer\s/,"").split(" "),k=Object(g.a)(O,2),w=k[0]||"xMidYMid",S=k[1]||"meet",T=i/a,C=s/o,P=Math.min(T,C),E=Math.max(T,C),j=a,N=o;"meet"===S&&(j*=P,N*=P),"slice"===S&&(j*=E,N*=E);var M=new tt(e,"refX",f),V=new tt(e,"refY",d),_=M.hasValue()&&V.hasValue();if(_&&r.translate(-P*M.getPixels("x"),-P*V.getPixels("y")),p){var R=P*m,I=P*x;r.beginPath(),r.moveTo(R,I),r.lineTo(i,I),r.lineTo(i,s),r.lineTo(R,s),r.closePath(),r.clip()}if(!_){var L="meet"===S&&P===C,D="slice"===S&&E===C,B="meet"===S&&P===T,z="slice"===S&&E===T;w.startsWith("xMid")&&(L||D)&&r.translate(i/2-j/2,0),w.endsWith("YMid")&&(B||z)&&r.translate(0,s/2-N/2),w.startsWith("xMax")&&(L||D)&&r.translate(i-j,0),w.endsWith("YMax")&&(B||z)&&r.translate(0,s-N)}switch(!0){case"none"===w:r.scale(T,C);break;case"meet"===S:r.scale(P,P);break;case"slice"===S:r.scale(E,E)}r.translate(-h,-l)}},{key:"start",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.enableRedraw,i=void 0!==n&&n,a=r.ignoreMouse,s=void 0!==a&&a,o=r.ignoreAnimation,u=void 0!==o&&o,h=r.ignoreDimensions,c=void 0!==h&&h,l=r.ignoreClear,f=void 0!==l&&l,g=r.forceRedraw,d=r.scaleWidth,y=r.scaleHeight,p=r.offsetX,v=r.offsetY,m=this.FRAMERATE,x=this.mouse,O=1e3/m;if(this.frameDuration=O,this.readyPromise=new Promise((function(t){e.resolveReady=t})),this.isReady()&&this.render(t,c,f,d,y,p,v),i){var k=Date.now(),w=k,S=0,T=function r(){k=Date.now(),(S=k-w)>=O&&(w=k-S%O,e.shouldUpdate(u,g)&&(e.render(t,c,f,d,y,p,v),x.runEvents())),e.intervalId=b()(r)};s||x.start(),this.intervalId=b()(T)}}},{key:"stop",value:function(){this.intervalId&&(b.a.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}},{key:"shouldUpdate",value:function(t,e){if(!t){var r=this.frameDuration,n=this.animations.reduce((function(t,e){return e.update(r)||t}),!1);if(n)return!0}return!("function"!==typeof e||!e())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}},{key:"render",value:function(t,e,r,n,i,a,s){var o=this.CLIENT_WIDTH,u=this.CLIENT_HEIGHT,h=this.viewPort,c=this.ctx,l=this.isFirstRender,f=c.canvas;h.clear(),f.width&&f.height?h.setCurrent(f.width,f.height):h.setCurrent(o,u);var g=t.getStyle("width"),d=t.getStyle("height");!e&&(l||"number"!==typeof n&&"number"!==typeof i)&&(g.hasValue()&&(f.width=g.getPixels("x"),f.style&&(f.style.width="".concat(f.width,"px"))),d.hasValue()&&(f.height=d.getPixels("y"),f.style&&(f.style.height="".concat(f.height,"px"))));var y=f.clientWidth||f.width,p=f.clientHeight||f.height;if(e&&g.hasValue()&&d.hasValue()&&(y=g.getPixels("x"),p=d.getPixels("y")),h.setCurrent(y,p),"number"===typeof a&&t.getAttribute("x",!0).setValue(a),"number"===typeof s&&t.getAttribute("y",!0).setValue(s),"number"===typeof n||"number"===typeof i){var v=E(t.getAttribute("viewBox").getString()),m=0,b=0;if("number"===typeof n){var x=t.getStyle("width");x.hasValue()?m=x.getPixels("x")/n:isNaN(v[2])||(m=v[2]/n)}if("number"===typeof i){var O=t.getStyle("height");O.hasValue()?b=O.getPixels("y")/i:isNaN(v[3])||(b=v[3]/i)}m||(m=b),b||(b=m),t.getAttribute("width",!0).setValue(n),t.getAttribute("height",!0).setValue(i);var k=t.getStyle("transform",!0,!0);k.setValue("".concat(k.getString()," scale(").concat(1/m,", ").concat(1/b,")"))}r||c.clearRect(0,0,y,p),t.render(c),l&&(this.isFirstRender=!1)}}]),t}();st.defaultWindow=it,st.defaultFetch=at;var ot=st.defaultFetch,ut="undefined"!==typeof DOMParser?DOMParser:null,ht=function(){function t(){Object(l.a)(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.fetch,n=void 0===r?ot:r,i=e.DOMParser,a=void 0===i?ut:i;this.fetch=n,this.DOMParser=a}return Object(f.a)(t,[{key:"parse",value:function(t){var e=this;return y()(S().mark((function r(){return S().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t.startsWith("<")){r.next=2;break}return r.abrupt("return",e.parseFromString(t));case 2:return r.abrupt("return",e.load(t));case 3:case"end":return r.stop()}}),r)})))()}},{key:"parseFromString",value:function(t){var e=new this.DOMParser;try{return this.checkDocument(e.parseFromString(t,"image/svg+xml"))}catch(r){return this.checkDocument(e.parseFromString(t,"text/xml"))}}},{key:"checkDocument",value:function(t){var e=t.getElementsByTagName("parsererror")[0];if(e)throw new Error(e.textContent);return t}},{key:"load",value:function(t){var e=this;return y()(S().mark((function r(){var n,i;return S().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.fetch(t);case 2:return n=r.sent,r.next=5,n.text();case 5:return i=r.sent,r.abrupt("return",e.parseFromString(i));case 7:case"end":return r.stop()}}),r)})))()}}]),t}(),ct=function(){function t(e,r){Object(l.a)(this,t),this.type="translate",this.point=null,this.point=rt.parse(r)}return Object(f.a)(t,[{key:"apply",value:function(t){var e=this.point,r=e.x,n=e.y;t.translate(r||0,n||0)}},{key:"unapply",value:function(t){var e=this.point,r=e.x,n=e.y;t.translate(-1*r||0,-1*n||0)}},{key:"applyToPoint",value:function(t){var e=this.point,r=e.x,n=e.y;t.applyTransform([1,0,0,1,r||0,n||0])}}]),t}(),lt=function(){function t(e,r,n){Object(l.a)(this,t),this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var i=E(r);this.angle=new tt(e,"angle",i[0]),this.originX=n[0],this.originY=n[1],this.cx=i[1]||0,this.cy=i[2]||0}return Object(f.a)(t,[{key:"apply",value:function(t){var e=this.cx,r=this.cy,n=this.originX,i=this.originY,a=this.angle,s=e+n.getPixels("x"),o=r+i.getPixels("y");t.translate(s,o),t.rotate(a.getRadians()),t.translate(-s,-o)}},{key:"unapply",value:function(t){var e=this.cx,r=this.cy,n=this.originX,i=this.originY,a=this.angle,s=e+n.getPixels("x"),o=r+i.getPixels("y");t.translate(s,o),t.rotate(-1*a.getRadians()),t.translate(-s,-o)}},{key:"applyToPoint",value:function(t){var e=this.cx,r=this.cy,n=this.angle.getRadians();t.applyTransform([1,0,0,1,e||0,r||0]),t.applyTransform([Math.cos(n),Math.sin(n),-Math.sin(n),Math.cos(n),0,0]),t.applyTransform([1,0,0,1,-e||0,-r||0])}}]),t}(),ft=function(){function t(e,r,n){Object(l.a)(this,t),this.type="scale",this.scale=null,this.originX=null,this.originY=null;var i=rt.parseScale(r);0!==i.x&&0!==i.y||(i.x=U,i.y=U),this.scale=i,this.originX=n[0],this.originY=n[1]}return Object(f.a)(t,[{key:"apply",value:function(t){var e=this.scale,r=e.x,n=e.y,i=this.originX,a=this.originY,s=i.getPixels("x"),o=a.getPixels("y");t.translate(s,o),t.scale(r,n||r),t.translate(-s,-o)}},{key:"unapply",value:function(t){var e=this.scale,r=e.x,n=e.y,i=this.originX,a=this.originY,s=i.getPixels("x"),o=a.getPixels("y");t.translate(s,o),t.scale(1/r,1/n||r),t.translate(-s,-o)}},{key:"applyToPoint",value:function(t){var e=this.scale,r=e.x,n=e.y;t.applyTransform([r||0,0,0,n||0,0,0])}}]),t}(),gt=function(){function t(e,r,n){Object(l.a)(this,t),this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=E(r),this.originX=n[0],this.originY=n[1]}return Object(f.a)(t,[{key:"apply",value:function(t){var e=this.originX,r=this.originY,n=this.matrix,i=e.getPixels("x"),a=r.getPixels("y");t.translate(i,a),t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),t.translate(-i,-a)}},{key:"unapply",value:function(t){var e=this.originX,r=this.originY,n=this.matrix,i=n[0],a=n[2],s=n[4],o=n[1],u=n[3],h=n[5],c=1/(i*(1*u-0*h)-a*(1*o-0*h)+s*(0*o-0*u)),l=e.getPixels("x"),f=r.getPixels("y");t.translate(l,f),t.transform(c*(1*u-0*h),c*(0*h-1*o),c*(0*s-1*a),c*(1*i-0*s),c*(a*h-s*u),c*(s*o-i*h)),t.translate(-l,-f)}},{key:"applyToPoint",value:function(t){t.applyTransform(this.matrix)}}]),t}(),dt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var a;return Object(l.a)(this,r),(a=e.call(this,t,n,i)).type="skew",a.angle=null,a.angle=new tt(t,"angle",n),a}return Object(f.a)(r)}(gt),yt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var a;return Object(l.a)(this,r),(a=e.call(this,t,n,i)).type="skewX",a.matrix=[1,0,Math.tan(a.angle.getRadians()),1,0,0],a}return Object(f.a)(r)}(dt),pt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var a;return Object(l.a)(this,r),(a=e.call(this,t,n,i)).type="skewY",a.matrix=[1,Math.tan(a.angle.getRadians()),0,1,0,0],a}return Object(f.a)(r)}(dt);var vt=function(){function t(e,r,n){var i=this;Object(l.a)(this,t),this.document=e,this.transforms=[],function(t){return A(t).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}(r).forEach((function(e){if("none"!==e){var r=function(t){var e=t.split("("),r=Object(g.a)(e,2),n=r[0],i=r[1];return[n.trim(),i.trim().replace(")","")]}(e),a=Object(g.a)(r,2),s=a[0],o=a[1],u=t.transformTypes[s];"undefined"!==typeof u&&i.transforms.push(new u(i.document,o,n))}}))}return Object(f.a)(t,[{key:"apply",value:function(t){for(var e=this.transforms,r=e.length,n=0;n=0;r--)e[r].unapply(t)}},{key:"applyToPoint",value:function(t){for(var e=this.transforms,r=e.length,n=0;n2&&void 0!==arguments[2]&&arguments[2];if(this.document=e,this.node=r,this.captureTextNodes=i,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],r&&1===r.nodeType){if(Array.from(r.attributes).forEach((function(t){var r=N(t.nodeName);n.attributes[r]=new tt(e,r,t.value)})),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var a=this.getAttribute("style").getString().split(";").map((function(t){return t.trim()}));a.forEach((function(t){if(t){var r=t.split(":").map((function(t){return t.trim()})),i=Object(g.a)(r,2),a=i[0],s=i[1];n.styles[a]=new tt(e,a,s)}}))}var s=e.definitions,o=this.getAttribute("id");o.hasValue()&&(s[o.getString()]||(s[o.getString()]=this)),Array.from(r.childNodes).forEach((function(t){if(1===t.nodeType)n.addChild(t);else if(i&&(3===t.nodeType||4===t.nodeType)){var r=e.createTextNode(t);r.getText().length>0&&n.addChild(r)}}))}}return Object(f.a)(t,[{key:"getAttribute",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.attributes[t];if(!r&&e){var n=new tt(this.document,t,"");return this.attributes[t]=n,n}return r||tt.empty(this.document)}},{key:"getHrefAttribute",value:function(){for(var t in this.attributes)if("href"===t||t.endsWith(":href"))return this.attributes[t];return tt.empty(this.document)}},{key:"getStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.styles[t];if(n)return n;var i=this.getAttribute(t);if(null!==i&&void 0!==i&&i.hasValue())return this.styles[t]=i,i;if(!r){var a=this.parent;if(a){var s=a.getStyle(t);if(null!==s&&void 0!==s&&s.hasValue())return s}}if(e){var o=new tt(this.document,t,"");return this.styles[t]=o,o}return n||tt.empty(this.document)}},{key:"render",value:function(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 r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(t),r.apply(t,this))}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}},{key:"setContext",value:function(t){}},{key:"applyEffects",value:function(t){var e=vt.fromElement(this.document,this);e&&e.apply(t);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var n=r.getDefinition();n&&n.apply(t)}}},{key:"clearContext",value:function(t){}},{key:"renderChildren",value:function(t){this.children.forEach((function(e){e.render(t)}))}},{key:"addChild",value:function(e){var r=e instanceof t?e:this.document.createElement(e);r.parent=this,t.ignoreChildTypes.includes(r.type)||this.children.push(r)}},{key:"matchesSelector",value:function(t){var e,r=this.node;if("function"===typeof r.matches)return r.matches(t);var n=null===(e=r.getAttribute)||void 0===e?void 0:e.call(r,"class");return!(!n||""===n)&&n.split(" ").some((function(e){return".".concat(e)===t}))}},{key:"addStylesFromStyleDefinition",value:function(){var t=this.document,e=t.styles,r=t.stylesSpecificity;for(var n in e)if(!n.startsWith("@")&&this.matchesSelector(n)){var i=e[n],a=r[n];if(i)for(var s in i){var o=this.stylesSpecificity[s];"undefined"===typeof o&&(o="000"),a>=o&&(this.styles[s]=i[s],this.stylesSpecificity[s]=a)}}}},{key:"removeStyles",value:function(t,e){return e.reduce((function(e,r){var n=t.getStyle(r);if(!n.hasValue())return e;var i=n.getString();return n.setValue(""),[].concat(Object(u.a)(e),[[r,i]])}),[])}},{key:"restoreStyles",value:function(t,e){e.forEach((function(e){var r=Object(g.a)(e,2),n=r[0],i=r[1];t.getStyle(n,!0).setValue(i)}))}},{key:"isFirstChild",value:function(){var t;return 0===(null===(t=this.parent)||void 0===t?void 0:t.children.indexOf(this))}}]),t}();mt.ignoreChildTypes=["title"];var bt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){return Object(l.a)(this,r),e.call(this,t,n,i)}return Object(f.a)(r)}(mt);function xt(t){var e=t.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function Ot(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 kt(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:""}}var wt=function(){function e(t,r,n,i,a,s){Object(l.a)(this,e);var o=s?"string"===typeof s?e.parse(s):s:{};this.fontFamily=a||o.fontFamily,this.fontSize=i||o.fontSize,this.fontStyle=t||o.fontStyle,this.fontWeight=n||o.fontWeight,this.fontVariant=r||o.fontVariant}return Object(f.a)(e,[{key:"toString",value:function(){return[Ot(this.fontStyle),this.fontVariant,kt(this.fontWeight),this.fontSize,(e=this.fontFamily,"undefined"===typeof t?e:e.trim().split(",").map(xt).join(","))].join(" ").trim();var e}}],[{key:"parse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0,n="",i="",a="",s="",o="",u=A(t).trim().split(" "),h={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return u.forEach((function(t){switch(!0){case!h.fontStyle&&e.styles.includes(t):"inherit"!==t&&(n=t),h.fontStyle=!0;break;case!h.fontVariant&&e.variants.includes(t):"inherit"!==t&&(i=t),h.fontStyle=!0,h.fontVariant=!0;break;case!h.fontWeight&&e.weights.includes(t):"inherit"!==t&&(a=t),h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0;break;case!h.fontSize:if("inherit"!==t){var r=t.split("/"),u=Object(g.a)(r,1);s=u[0]}h.fontStyle=!0,h.fontVariant=!0,h.fontWeight=!0,h.fontSize=!0;break;default:"inherit"!==t&&(o+=t)}})),new e(n,i,a,s,o,r)}}]),e}();wt.styles="normal|italic|oblique|inherit",wt.variants="normal|small-caps|inherit",wt.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";var St=function(){function t(){Object(l.a)(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;this.x1=e,this.y1=r,this.x2=n,this.y2=i,this.addPoint(e,r),this.addPoint(n,i)}return Object(f.a)(t,[{key:"x",get:function(){return this.x1}},{key:"y",get:function(){return this.y1}},{key:"width",get:function(){return this.x2-this.x1}},{key:"height",get:function(){return this.y2-this.y1}},{key:"addPoint",value:function(t,e){"undefined"!==typeof t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),tthis.x2&&(this.x2=t)),"undefined"!==typeof e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),ethis.y2&&(this.y2=e))}},{key:"addX",value:function(t){this.addPoint(t,null)}},{key:"addY",value:function(t){this.addPoint(null,t)}},{key:"addBoundingBox",value:function(t){if(t){var e=t.x1,r=t.y1,n=t.x2,i=t.y2;this.addPoint(e,r),this.addPoint(n,i)}}},{key:"sumCubic",value:function(t,e,r,n,i){return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*r+3*(1-t)*Math.pow(t,2)*n+Math.pow(t,3)*i}},{key:"bezierCurveAdd",value:function(t,e,r,n,i){var a=6*e-12*r+6*n,s=-3*e+9*r-9*n+3*i,o=3*r-3*e;if(0!==s){var u=Math.pow(a,2)-4*o*s;if(!(u<0)){var h=(-a+Math.sqrt(u))/(2*s);0=this.commands.length-1}},{key:"next",value:function(){var t=this.commands[++this.i];return this.previousCommand=this.command,this.command=t,t}},{key:"getPoint",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",r=new rt(this.command[t],this.command[e]);return this.makeAbsolute(r)}},{key:"getAsControlPoint",value:function(t,e){var r=this.getPoint(t,e);return this.control=r,r}},{key:"getAsCurrentPoint",value:function(t,e){var r=this.getPoint(t,e);return this.current=r,r}},{key:"getReflectedControlPoint",value:function(){var t=this.previousCommand.type;if(t!==k.a.CURVE_TO&&t!==k.a.SMOOTH_CURVE_TO&&t!==k.a.QUAD_TO&&t!==k.a.SMOOTH_QUAD_TO)return this.current;var e=this.current,r=e.x,n=e.y,i=this.control,a=i.x,s=i.y;return new rt(2*r-a,2*n-s)}},{key:"makeAbsolute",value:function(t){if(this.command.relative){var e=this.current,r=e.x,n=e.y;t.x+=r,t.y+=n}return t}},{key:"addMarker",value:function(t,e,r){var n=this.points,i=this.angles;r&&i.length>0&&!i[i.length-1]&&(i[i.length-1]=n[n.length-1].angleTo(r)),this.addMarkerAngle(t,e?e.angleTo(t):null)}},{key:"addMarkerAngle",value:function(t,e){this.points.push(t),this.angles.push(e)}},{key:"getMarkerPoints",value:function(){return this.points}},{key:"getMarkerAngles",value:function(){for(var t=this.angles,e=t.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];if(!e){var r=this.getStyle("fill"),n=this.getStyle("fill-opacity"),i=this.getStyle("stroke"),a=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,n);s&&(t.fillStyle=s)}else if(r.hasValue()){"currentColor"===r.getString()&&r.setValue(this.getStyle("color").getColor());var o=r.getColor();"inherit"!==o&&(t.fillStyle="none"===o?"rgba(0,0,0,0)":o)}if(n.hasValue()){var u=new tt(this.document,"fill",t.fillStyle).addOpacity(n).getColor();t.fillStyle=u}if(i.isUrlDefinition()){var h=i.getFillStyleDefinition(this,a);h&&(t.strokeStyle=h)}else if(i.hasValue()){"currentColor"===i.getString()&&i.setValue(this.getStyle("color").getColor());var c=i.getString();"inherit"!==c&&(t.strokeStyle="none"===c?"rgba(0,0,0,0)":c)}if(a.hasValue()){var l=new tt(this.document,"stroke",t.strokeStyle).addOpacity(a).getString();t.strokeStyle=l}var f=this.getStyle("stroke-width");if(f.hasValue()){var g=f.getPixels();t.lineWidth=g||U}var d=this.getStyle("stroke-linecap"),y=this.getStyle("stroke-linejoin"),p=this.getStyle("stroke-miterlimit"),v=this.getStyle("stroke-dasharray"),m=this.getStyle("stroke-dashoffset");if(d.hasValue()&&(t.lineCap=d.getString()),y.hasValue()&&(t.lineJoin=y.getString()),p.hasValue()&&(t.miterLimit=p.getNumber()),v.hasValue()&&"none"!==v.getString()){var b=E(v.getString());"undefined"!==typeof t.setLineDash?t.setLineDash(b):"undefined"!==typeof t.webkitLineDash?t.webkitLineDash=b:"undefined"===typeof t.mozDash||1===b.length&&0===b[0]||(t.mozDash=b);var x=m.getPixels();"undefined"!==typeof t.lineDashOffset?t.lineDashOffset=x:"undefined"!==typeof t.webkitLineDashOffset?t.webkitLineDashOffset=x:"undefined"!==typeof t.mozDashOffset&&(t.mozDashOffset=x)}}if(this.modifiedEmSizeStack=!1,"undefined"!==typeof t.font){var O=this.getStyle("font"),k=this.getStyle("font-style"),w=this.getStyle("font-variant"),S=this.getStyle("font-weight"),T=this.getStyle("font-size"),A=this.getStyle("font-family"),C=new wt(k.getString(),w.getString(),S.getString(),T.hasValue()?"".concat(T.getPixels(!0),"px"):"",A.getString(),wt.parse(O.getString(),t.font));k.setValue(C.fontStyle),w.setValue(C.fontVariant),S.setValue(C.fontWeight),T.setValue(C.fontSize),A.setValue(C.fontFamily),t.font=C.toString(),T.isPixels()&&(this.document.emSize=T.getPixels(),this.modifiedEmSizeStack=!0)}e||(this.applyEffects(t),t.globalAlpha=this.calculateOpacity())}},{key:"clearContext",value:function(t){Object(s.a)(Object(o.a)(r.prototype),"clearContext",this).call(this,t),this.modifiedEmSizeStack&&this.document.popEmSize()}}]),r}(mt),Ct=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var a;return Object(l.a)(this,r),(a=e.call(this,t,n,i)).type="path",a.pathParser=null,a.pathParser=new Tt(a.getAttribute("d").getString()),a}return Object(f.a)(r,[{key:"path",value:function(t){var e=this.pathParser,r=new St;for(e.reset(),t&&t.beginPath();!e.isEnd();)switch(e.next().type){case Tt.MOVE_TO:this.pathM(t,r);break;case Tt.LINE_TO:this.pathL(t,r);break;case Tt.HORIZ_LINE_TO:this.pathH(t,r);break;case Tt.VERT_LINE_TO:this.pathV(t,r);break;case Tt.CURVE_TO:this.pathC(t,r);break;case Tt.SMOOTH_CURVE_TO:this.pathS(t,r);break;case Tt.QUAD_TO:this.pathQ(t,r);break;case Tt.SMOOTH_QUAD_TO:this.pathT(t,r);break;case Tt.ARC:this.pathA(t,r);break;case Tt.CLOSE_PATH:this.pathZ(t,r)}return r}},{key:"getBoundingBox",value:function(t){return this.path()}},{key:"getMarkers",value:function(){var t=this.pathParser,e=t.getMarkerPoints(),r=t.getMarkerAngles();return e.map((function(t,e){return[t,r[e]]}))}},{key:"renderChildren",value:function(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 r=this.getMarkers();if(r){var n=r.length-1,i=this.getStyle("marker-start"),a=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(i.isUrlDefinition()){var o=i.getDefinition(),u=Object(g.a)(r[0],2),h=u[0],c=u[1];o.render(t,h,c)}if(a.isUrlDefinition())for(var l=a.getDefinition(),f=1;fo?s:o,v=s>o?1:s/o,m=s>o?o/s:1;t.translate(c.x,c.y),t.rotate(h),t.scale(v,m),t.arc(0,0,p,l,l+f,Boolean(1-u)),t.scale(1/v,1/m),t.rotate(-h),t.translate(-c.x,-c.y)}}},{key:"pathZ",value:function(t,e){r.pathZ(this.pathParser),t&&e.x1!==e.x2&&e.y1!==e.y2&&t.closePath()}}],[{key:"pathM",value:function(t){var e=t.getAsCurrentPoint();return t.start=t.current,{point:e}}},{key:"pathL",value:function(t){return{current:t.current,point:t.getAsCurrentPoint()}}},{key:"pathH",value:function(t){var e=t.current,r=t.command,n=new rt((r.relative?e.x:0)+r.x,e.y);return t.current=n,{current:e,point:n}}},{key:"pathV",value:function(t){var e=t.current,r=t.command,n=new rt(e.x,(r.relative?e.y:0)+r.y);return t.current=n,{current:e,point:n}}},{key:"pathC",value:function(t){return{current:t.current,point:t.getPoint("x1","y1"),controlPoint:t.getAsControlPoint("x2","y2"),currentPoint:t.getAsCurrentPoint()}}},{key:"pathS",value:function(t){return{current:t.current,point:t.getReflectedControlPoint(),controlPoint:t.getAsControlPoint("x2","y2"),currentPoint:t.getAsCurrentPoint()}}},{key:"pathQ",value:function(t){return{current:t.current,controlPoint:t.getAsControlPoint("x1","y1"),currentPoint:t.getAsCurrentPoint()}}},{key:"pathT",value:function(t){var e=t.current,r=t.getReflectedControlPoint();return t.control=r,{current:e,controlPoint:r,currentPoint:t.getAsCurrentPoint()}}},{key:"pathA",value:function(t){var e=t.current,r=t.command,n=r.rX,i=r.rY,a=r.xRot,s=r.lArcFlag,o=r.sweepFlag,u=a*(Math.PI/180),h=t.getAsCurrentPoint(),c=new rt(Math.cos(u)*(e.x-h.x)/2+Math.sin(u)*(e.y-h.y)/2,-Math.sin(u)*(e.x-h.x)/2+Math.cos(u)*(e.y-h.y)/2),l=Math.pow(c.x,2)/Math.pow(n,2)+Math.pow(c.y,2)/Math.pow(i,2);l>1&&(n*=Math.sqrt(l),i*=Math.sqrt(l));var f=(s===o?-1:1)*Math.sqrt((Math.pow(n,2)*Math.pow(i,2)-Math.pow(n,2)*Math.pow(c.y,2)-Math.pow(i,2)*Math.pow(c.x,2))/(Math.pow(n,2)*Math.pow(c.y,2)+Math.pow(i,2)*Math.pow(c.x,2)));isNaN(f)&&(f=0);var g=new rt(f*n*c.y/i,f*-i*c.x/n),d=new rt((e.x+h.x)/2+Math.cos(u)*g.x-Math.sin(u)*g.y,(e.y+h.y)/2+Math.sin(u)*g.x+Math.cos(u)*g.y),y=q([1,0],[(c.x-g.x)/n,(c.y-g.y)/i]),p=[(c.x-g.x)/n,(c.y-g.y)/i],v=[(-c.x-g.x)/n,(-c.y-g.y)/i],m=q(p,v);return Y(p,v)<=-1&&(m=Math.PI),Y(p,v)>=1&&(m=0),{currentPoint:h,rX:n,rY:i,sweepFlag:o,xAxisRotation:u,centp:d,a1:y,ad:m}}},{key:"pathZ",value:function(t){t.current=t.start}}]),r}(At),Pt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var a;return Object(l.a)(this,r),(a=e.call(this,t,n,i)).type="glyph",a.horizAdvX=a.getAttribute("horiz-adv-x").getNumber(),a.unicode=a.getAttribute("unicode").getString(),a.arabicForm=a.getAttribute("arabic-form").getString(),a}return Object(f.a)(r)}(Ct),Et=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var a;return Object(l.a)(this,r),(a=e.call(this,t,n,(this instanceof r?this.constructor:void 0)===r||i)).type="text",a.x=0,a.y=0,a.measureCache=-1,a}return Object(f.a)(r,[{key:"setContext",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(s.a)(Object(o.a)(r.prototype),"setContext",this).call(this,t,e);var n=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();n&&(t.textBaseline=n)}},{key:"initializeCoordinates",value:function(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}},{key:"getBoundingBox",value:function(t){var e=this;if("text"!==this.type)return this.getTElementBoundingBox(t);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t);var r=null;return this.children.forEach((function(n,i){var a=e.getChildBoundingBox(t,e,e,i);r?r.addBoundingBox(a):r=a})),r}},{key:"getFontSize",value:function(){var t=this.document,e=this.parent,r=wt.parse(t.ctx.font).fontSize;return e.getStyle("font-size").getNumber(r)}},{key:"getTElementBoundingBox",value:function(t){var e=this.getFontSize();return new St(this.x,this.y-e,this.x+this.measureText(t),this.y)}},{key:"getGlyph",value:function(t,e,r){var n=e[r],i=null;if(t.isArabic){var a=e.length,s=e[r-1],o=e[r+1],u="isolated";if((0===r||" "===s)&&r0&&" "!==s&&r0&&" "!==s&&(r===a-1||" "===o)&&(u="initial"),"undefined"!==typeof t.glyphs[n]){var h=t.glyphs[n];i=h instanceof Pt?h:h[u]}}else i=t.glyphs[n];return i||(i=t.missingGlyph),i}},{key:"getText",value:function(){return""}},{key:"getTextFromNode",value:function(t){var e=t||this.node,r=Array.from(e.parentNode.childNodes),n=r.indexOf(e),i=r.length-1,a=A(e.textContent||"");return 0===n&&(a=C(a)),n===i&&(a=P(a)),a}},{key:"renderChildren",value:function(t){var e=this;if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(t),this.children.forEach((function(r,n){e.renderChild(t,e,e,n)}));var r=this.document.screen.mouse;r.isWorking()&&r.checkBoundingBox(this,this.getBoundingBox(t))}else this.renderTElementChildren(t)}},{key:"renderTElementChildren",value:function(t){var e=this.document,r=this.parent,n=this.getText(),i=r.getStyle("font-family").getDefinition();if(i)for(var a=i.fontFace.unitsPerEm,s=wt.parse(e.ctx.font),o=r.getStyle("font-size").getNumber(s.fontSize),u=r.getStyle("font-style").getString(s.fontStyle),h=o/a,c=i.isRTL?n.split("").reverse().join(""):n,l=E(r.getAttribute("dx").getString()),f=c.length,g=0;g=this.leafTexts.length)){var t=this.leafTexts[this.textChunkStart],e=t.getStyle("text-anchor").getString("start"),r=0;r="start"===e?t.x-this.minX:"end"===e?t.x-this.maxX:t.x-(this.minX+this.maxX)/2;for(var n=this.textChunkStart;n0?i.children.forEach((function(r,n){e.adjustChildCoordinatesRecursiveCore(t,e,i,n)})):this.adjustChildCoordinates(t,e,r,n)}},{key:"adjustChildCoordinates",value:function(t,e,r,n){var i=r.children[n];if("function"!==typeof i.measureText)return i;t.save(),i.setContext(t,!0);var a=i.getAttribute("x"),s=i.getAttribute("y"),o=i.getAttribute("dx"),u=i.getAttribute("dy"),h=i.getStyle("font-family").getDefinition(),c=Boolean(h)&&h.isRTL;0===n&&(a.hasValue()||a.setValue(i.getInheritedAttribute("x")),s.hasValue()||s.setValue(i.getInheritedAttribute("y")),o.hasValue()||o.setValue(i.getInheritedAttribute("dx")),u.hasValue()||u.setValue(i.getInheritedAttribute("dy")));var l=i.measureText(t);return c&&(e.x-=l),a.hasValue()?(e.applyAnchoring(),i.x=a.getPixels("x"),o.hasValue()&&(i.x+=o.getPixels("x"))):(o.hasValue()&&(e.x+=o.getPixels("x")),i.x=e.x),e.x=i.x,c||(e.x+=l),s.hasValue()?(i.y=s.getPixels("y"),u.hasValue()&&(i.y+=u.getPixels("y"))):(u.hasValue()&&(e.y+=u.getPixels("y")),i.y=e.y),e.y=i.y,e.leafTexts.push(i),e.minX=Math.min(e.minX,i.x,i.x+l),e.maxX=Math.max(e.maxX,i.x,i.x+l),i.clearContext(t),t.restore(),i}},{key:"getChildBoundingBox",value:function(t,e,r,n){var i=r.children[n];if("function"!==typeof i.getBoundingBox)return null;var a=i.getBoundingBox(t);return a?(i.children.forEach((function(r,n){var s=e.getChildBoundingBox(t,e,i,n);a.addBoundingBox(s)})),a):null}},{key:"renderChild",value:function(t,e,r,n){var i=r.children[n];i.render(t),i.children.forEach((function(r,n){e.renderChild(t,e,i,n)}))}},{key:"measureText",value:function(t){var e=this.measureCache;if(~e)return e;var r=this.getText(),n=this.measureTargetText(t,r);return this.measureCache=n,n}},{key:"measureTargetText",value:function(t,e){if(!e.length)return 0;var r=this.parent,n=r.getStyle("font-family").getDefinition();if(n){for(var i=this.getFontSize(),a=n.isRTL?e.split("").reverse().join(""):e,s=E(r.getAttribute("dx").getString()),o=a.length,u=0,h=0;h0?"":a.getTextFromNode(),a}return Object(f.a)(r,[{key:"getText",value:function(){return this.text}}]),r}(Et),Nt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="textNode",t}return Object(f.a)(r)}(jt),Mt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="svg",t.root=!1,t}return Object(f.a)(r,[{key:"setContext",value:function(t){var e,n=this.document,i=n.screen,a=n.window,u=t.canvas;if(i.setDefaults(t),u.style&&"undefined"!==typeof t.font&&a&&"undefined"!==typeof a.getComputedStyle){t.font=a.getComputedStyle(u).getPropertyValue("font");var h=new tt(n,"fontSize",wt.parse(t.font).fontSize);h.hasValue()&&(n.rootEmSize=h.getPixels("y"),n.emSize=n.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var c=i.viewPort,l=c.width,f=c.height;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 g=this.getAttribute("refX"),d=this.getAttribute("refY"),y=this.getAttribute("viewBox"),p=y.hasValue()?E(y.getString()):null,v=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),m=0,b=0,x=0,O=0;p&&(m=p[0],b=p[1]),this.root||(l=this.getStyle("width").getPixels("x"),f=this.getStyle("height").getPixels("y"),"marker"===this.type&&(x=m,O=b,m=0,b=0)),i.viewPort.setCurrent(l,f),!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%"),Object(s.a)(Object(o.a)(r.prototype),"setContext",this).call(this,t),t.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),p&&(l=p[2],f=p[3]),n.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:l,height:i.viewPort.height,desiredHeight:f,minX:m,minY:b,refX:g.getValue(),refY:d.getValue(),clip:v,clipX:x,clipY:O}),p&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(l,f))}},{key:"clearContext",value:function(t){Object(s.a)(Object(o.a)(r.prototype),"clearContext",this).call(this,t),this.document.screen.viewPort.removeCurrent()}},{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.getAttribute("width",!0),i=this.getAttribute("height",!0),a=this.getAttribute("viewBox"),s=this.getAttribute("style"),o=n.getNumber(0),u=i.getNumber(0);if(r)if("string"===typeof r)this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var h=this.getAttribute("preserveAspectRatio");h.hasValue()&&h.setValue(h.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(n.setValue(t),i.setValue(e),a.hasValue()||a.setValue("0 0 ".concat(o||t," ").concat(u||e)),s.hasValue()){var c=this.getStyle("width"),l=this.getStyle("height");c.hasValue()&&c.setValue("".concat(t,"px")),l.hasValue()&&l.setValue("".concat(e,"px"))}}}]),r}(At),Vt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="rect",t}return Object(f.a)(r,[{key:"path",value:function(t){var e=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),n=this.getStyle("width",!1,!0).getPixels("x"),i=this.getStyle("height",!1,!0).getPixels("y"),a=this.getAttribute("rx"),s=this.getAttribute("ry"),o=a.getPixels("x"),u=s.getPixels("y");if(a.hasValue()&&!s.hasValue()&&(u=o),s.hasValue()&&!a.hasValue()&&(o=u),o=Math.min(o,n/2),u=Math.min(u,i/2),t){var h=(Math.sqrt(2)-1)/3*4;t.beginPath(),i>0&&n>0&&(t.moveTo(e+o,r),t.lineTo(e+n-o,r),t.bezierCurveTo(e+n-o+h*o,r,e+n,r+u-h*u,e+n,r+u),t.lineTo(e+n,r+i-u),t.bezierCurveTo(e+n,r+i-u+h*u,e+n-o+h*o,r+i,e+n-o,r+i),t.lineTo(e+o,r+i),t.bezierCurveTo(e+o-h*o,r+i,e,r+i-u+h*u,e,r+i-u),t.lineTo(e,r+u),t.bezierCurveTo(e,r+u-h*u,e+o-h*o,r,e+o,r),t.closePath())}return new St(e,r,e+n,r+i)}},{key:"getMarkers",value:function(){return null}}]),r}(Ct),_t=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="circle",t}return Object(f.a)(r,[{key:"path",value:function(t){var e=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),n=this.getAttribute("r").getPixels();return t&&n>0&&(t.beginPath(),t.arc(e,r,n,0,2*Math.PI,!1),t.closePath()),new St(e-n,r-n,e+n,r+n)}},{key:"getMarkers",value:function(){return null}}]),r}(Ct),Rt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="ellipse",t}return Object(f.a)(r,[{key:"path",value:function(t){var e=(Math.sqrt(2)-1)/3*4,r=this.getAttribute("rx").getPixels("x"),n=this.getAttribute("ry").getPixels("y"),i=this.getAttribute("cx").getPixels("x"),a=this.getAttribute("cy").getPixels("y");return t&&r>0&&n>0&&(t.beginPath(),t.moveTo(i+r,a),t.bezierCurveTo(i+r,a+e*n,i+e*r,a+n,i,a+n),t.bezierCurveTo(i-e*r,a+n,i-r,a+e*n,i-r,a),t.bezierCurveTo(i-r,a-e*n,i-e*r,a-n,i,a-n),t.bezierCurveTo(i+e*r,a-n,i+r,a-e*n,i+r,a),t.closePath()),new St(i-r,a-n,i+r,a+n)}},{key:"getMarkers",value:function(){return null}}]),r}(Ct),It=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="line",t}return Object(f.a)(r,[{key:"getPoints",value:function(){return[new rt(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new rt(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}},{key:"path",value:function(t){var e=this.getPoints(),r=Object(g.a)(e,2),n=r[0],i=n.x,a=n.y,s=r[1],o=s.x,u=s.y;return t&&(t.beginPath(),t.moveTo(i,a),t.lineTo(o,u)),new St(i,a,o,u)}},{key:"getMarkers",value:function(){var t=this.getPoints(),e=Object(g.a)(t,2),r=e[0],n=e[1],i=r.angleTo(n);return[[r,i],[n,i]]}}]),r}(Ct),Lt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var a;return Object(l.a)(this,r),(a=e.call(this,t,n,i)).type="polyline",a.points=[],a.points=rt.parsePath(a.getAttribute("points").getString()),a}return Object(f.a)(r,[{key:"path",value:function(t){var e=this.points,r=Object(g.a)(e,1)[0],n=r.x,i=r.y,a=new St(n,i);return t&&(t.beginPath(),t.moveTo(n,i)),e.forEach((function(e){var r=e.x,n=e.y;a.addPoint(r,n),t&&t.lineTo(r,n)})),a}},{key:"getMarkers",value:function(){var t=this.points,e=t.length-1,r=[];return t.forEach((function(n,i){i!==e&&r.push([n,n.angleTo(t[i+1])])})),r.length>0&&r.push([t[t.length-1],r[r.length-1][1]]),r}}]),r}(Ct),Dt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="polygon",t}return Object(f.a)(r,[{key:"path",value:function(t){var e=Object(s.a)(Object(o.a)(r.prototype),"path",this).call(this,t),n=Object(g.a)(this.points,1)[0],i=n.x,a=n.y;return t&&(t.lineTo(i,a),t.closePath()),e}}]),r}(Lt),Bt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="pattern",t}return Object(f.a)(r,[{key:"createPattern",value:function(t,e,r){var n=this.getStyle("width").getPixels("x",!0),i=this.getStyle("height").getPixels("y",!0),a=new Mt(this.document,null);a.attributes.viewBox=new tt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),a.attributes.width=new tt(this.document,"width","".concat(n,"px")),a.attributes.height=new tt(this.document,"height","".concat(i,"px")),a.attributes.transform=new tt(this.document,"transform",this.getAttribute("patternTransform").getValue()),a.children=this.children;var s=this.document.createCanvas(n,i),o=s.getContext("2d"),u=this.getAttribute("x"),h=this.getAttribute("y");u.hasValue()&&h.hasValue()&&o.translate(u.getPixels("x",!0),h.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var c=-1;c<=1;c++)for(var l=-1;l<=1;l++)o.save(),a.attributes.x=new tt(this.document,"x",c*s.width),a.attributes.y=new tt(this.document,"y",l*s.height),a.render(o),o.restore();return t.createPattern(s,"repeat")}}]),r}(mt),zt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="marker",t}return Object(f.a)(r,[{key:"render",value:function(t,e,r){if(e){var n=e.x,i=e.y,a=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");t.translate(n,i),"auto"===a&&t.rotate(r),"strokeWidth"===s&&t.scale(t.lineWidth,t.lineWidth),t.save();var o=new Mt(this.document,null);o.type=this.type,o.attributes.viewBox=new tt(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.refX=new tt(this.document,"refX",this.getAttribute("refX").getValue()),o.attributes.refY=new tt(this.document,"refY",this.getAttribute("refY").getValue()),o.attributes.width=new tt(this.document,"width",this.getAttribute("markerWidth").getValue()),o.attributes.height=new tt(this.document,"height",this.getAttribute("markerHeight").getValue()),o.attributes.overflow=new tt(this.document,"overflow",this.getAttribute("overflow").getValue()),o.attributes.fill=new tt(this.document,"fill",this.getAttribute("fill").getColor("black")),o.attributes.stroke=new tt(this.document,"stroke",this.getAttribute("stroke").getValue("none")),o.children=this.children,o.render(t),t.restore(),"strokeWidth"===s&&t.scale(1/t.lineWidth,1/t.lineWidth),"auto"===a&&t.rotate(-r),t.translate(-n,-i)}}}]),r}(mt),Ft=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="defs",t}return Object(f.a)(r,[{key:"render",value:function(){}}]),r}(mt),Ht=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="g",t}return Object(f.a)(r,[{key:"getBoundingBox",value:function(t){var e=new St;return this.children.forEach((function(r){e.addBoundingBox(r.getBoundingBox(t))})),e}}]),r}(At),Ut=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var s;Object(l.a)(this,r),(s=e.call(this,t,n,i)).attributesToInherit=["gradientUnits"],s.stops=[];var o=Object(a.a)(s),u=o.stops;return o.children.forEach((function(t){"stop"===t.type&&u.push(t)})),s}return Object(f.a)(r,[{key:"getGradientUnits",value:function(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}},{key:"createGradient",value:function(t,e,r){var n=this,i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var a=i.stops,s=this.getGradient(t,e);if(!s)return this.addParentOpacity(r,a[a.length-1].color);if(a.forEach((function(t){s.addColorStop(t.offset,n.addParentOpacity(r,t.color))})),this.getAttribute("gradientTransform").hasValue()){var o=this.document,u=o.screen,h=u.MAX_VIRTUAL_PIXELS,c=u.viewPort,l=Object(g.a)(c.viewPorts,1)[0],f=new Vt(o,null);f.attributes.x=new tt(o,"x",-h/3),f.attributes.y=new tt(o,"y",-h/3),f.attributes.width=new tt(o,"width",h),f.attributes.height=new tt(o,"height",h);var d=new Ht(o,null);d.attributes.transform=new tt(o,"transform",this.getAttribute("gradientTransform").getValue()),d.children=[f];var y=new Mt(o,null);y.attributes.x=new tt(o,"x",0),y.attributes.y=new tt(o,"y",0),y.attributes.width=new tt(o,"width",l.width),y.attributes.height=new tt(o,"height",l.height),y.children=[d];var p=o.createCanvas(l.width,l.height),v=p.getContext("2d");return v.fillStyle=s,y.render(v),v.createPattern(p,"no-repeat")}return s}},{key:"inheritStopContainer",value:function(t){var e=this;this.attributesToInherit.forEach((function(r){!e.getAttribute(r).hasValue()&&t.getAttribute(r).hasValue()&&e.getAttribute(r,!0).setValue(t.getAttribute(r).getValue())}))}},{key:"addParentOpacity",value:function(t,e){return t.hasValue()?new tt(this.document,"color",e).addOpacity(t).getColor():e}}]),r}(mt),Xt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var a;return Object(l.a)(this,r),(a=e.call(this,t,n,i)).type="linearGradient",a.attributesToInherit.push("x1","y1","x2","y2"),a}return Object(f.a)(r,[{key:"getGradient",value:function(t,e){var r="objectBoundingBox"===this.getGradientUnits(),n=r?e.getBoundingBox(t):null;if(r&&!n)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var i=r?n.x+n.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),a=r?n.y+n.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?n.x+n.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),o=r?n.y+n.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return i===s&&a===o?null:t.createLinearGradient(i,a,s,o)}}]),r}(Ut),Yt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var a;return Object(l.a)(this,r),(a=e.call(this,t,n,i)).type="radialGradient",a.attributesToInherit.push("cx","cy","r","fx","fy","fr"),a}return Object(f.a)(r,[{key:"getGradient",value:function(t,e){var r="objectBoundingBox"===this.getGradientUnits(),n=e.getBoundingBox(t);if(r&&!n)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var i=r?n.x+n.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),a=r?n.y+n.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=i,o=a;this.getAttribute("fx").hasValue()&&(s=r?n.x+n.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(o=r?n.y+n.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var u=r?(n.width+n.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),h=this.getAttribute("fr").getPixels();return t.createRadialGradient(s,o,h,i,a,u)}}]),r}(Ut),qt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var a;Object(l.a)(this,r),(a=e.call(this,t,n,i)).type="stop";var s=Math.max(0,Math.min(1,a.getAttribute("offset").getNumber())),o=a.getStyle("stop-opacity"),u=a.getStyle("stop-color",!0);return""===u.getString()&&u.setValue("#000"),o.hasValue()&&(u=u.addOpacity(o)),a.offset=s,a.color=u.getColor(),a}return Object(f.a)(r)}(mt),Qt=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var s;Object(l.a)(this,r),(s=e.call(this,t,n,i)).type="animate",s.duration=0,s.initialValue=null,s.initialUnits="",s.removed=!1,s.frozen=!1,t.screen.animations.push(Object(a.a)(s)),s.begin=s.getAttribute("begin").getMilliseconds(),s.maxDuration=s.begin+s.getAttribute("dur").getMilliseconds(),s.from=s.getAttribute("from"),s.to=s.getAttribute("to"),s.values=new tt(t,"values",null);var o=s.getAttribute("values");return o.hasValue()&&s.values.setValue(o.getString().split(";")),s}return Object(f.a)(r,[{key:"getProperty",value:function(){var t=this.getAttribute("attributeType").getString(),e=this.getAttribute("attributeName").getString();return"CSS"===t?this.parent.getStyle(e,!0):this.parent.getAttribute(e,!0)}},{key:"calcValue",value:function(){var t=this.initialUnits,e=this.getProgress(),r=e.progress,n=e.from,i=e.to,a=n.getNumber()+(i.getNumber()-n.getNumber())*r;return"%"===t&&(a*=100),"".concat(a).concat(t)}},{key:"update",value:function(t){var e=this.parent,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var n=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==n||this.frozen){if("remove"===n&&!this.removed)return this.removed=!0,r.setValue(e.animationFrozen?e.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,e.animationFrozen=!0,e.animationFrozenValue=r.getString();return!1}this.duration+=t;var i=!1;if(this.begin0&&Array.from(s).every((function(t){return 3===t.nodeType}));return a.hasText=u,a.text=u?a.getTextFromNode(o):"",a}return Object(f.a)(r,[{key:"getText",value:function(){return this.text}},{key:"renderChildren",value:function(t){if(this.hasText){Object(s.a)(Object(o.a)(r.prototype),"renderChildren",this).call(this,t);var e=this.document,n=this.x,i=this.y,a=e.screen.mouse,u=new tt(e,"fontSize",wt.parse(e.ctx.font).fontSize);a.isWorking()&&a.checkBoundingBox(this,new St(n,i-u.getPixels("y"),n+this.measureText(t),i))}else if(this.children.length>0){var h=new Ht(this.document,null);h.children=this.children,h.parent=this,h.render(t)}}},{key:"onClick",value:function(){var t=this.document.window;t&&t.open(this.getHrefAttribute().getString())}},{key:"onMouseMove",value:function(){this.document.ctx.canvas.style.cursor="pointer"}}]),r}(Et);function ee(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function re(t){for(var e=1;eu?o:u,y=o>u?1:o/u,p=o>u?u/o:1;t&&(t.translate(a,s),t.rotate(l),t.scale(y,p),t.arc(0,0,d,h,h+c,Boolean(1-f)),t.scale(1/y,1/p),t.rotate(-l),t.translate(-a,-s));break;case Tt.CLOSE_PATH:t&&t.closePath()}}))}},{key:"renderChildren",value:function(t){this.setTextData(t),t.save();var e=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),n=this.glyphInfo,i=t.fillStyle;"underline"===e&&t.beginPath(),n.forEach((function(n,i){var a=n.p0,s=n.p1,o=n.rotation,u=n.text;t.save(),t.translate(a.x,a.y),t.rotate(o),t.fillStyle&&t.fillText(u,0,0),t.strokeStyle&&t.strokeText(u,0,0),t.restore(),"underline"===e&&(0===i&&t.moveTo(a.x,a.y+r/8),t.lineTo(s.x,s.y+r/5))})),"underline"===e&&(t.lineWidth=r/20,t.strokeStyle=i,t.stroke(),t.closePath()),t.restore()}},{key:"getLetterSpacingAt",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[t]||0}},{key:"findSegmentToFitChar",value:function(t,e,r,n,i,a,s,o,u){var h=a,c=this.measureText(t,o);" "===o&&"justify"===e&&r-1&&(h+=this.getLetterSpacingAt(u));var l=this.textHeight/20,f=this.getEquidistantPointOnPath(h,l,0),g=this.getEquidistantPointOnPath(h+c,l,0),d={p0:f,p1:g},y=f&&g?Math.atan2(g.y-f.y,g.x-f.x):0;if(s){var p=Math.cos(Math.PI/2+y)*s,v=Math.cos(-y)*s;d.p0=re(re({},f),{},{x:f.x+p,y:f.y+v}),d.p1=re(re({},g),{},{x:g.x+p,y:g.y+v})}return{offset:h+=c,segment:d,rotation:y}}},{key:"measureText",value:function(t,e){var r=this.measuresCache,n=e||this.getText();if(r.has(n))return r.get(n);var i=this.measureTargetText(t,n);return r.set(n,i),i}},{key:"setTextData",value:function(t){var e=this;if(!this.glyphInfo){var r=this.getText(),n=r.split(""),i=r.split(" ").length-1,a=this.parent.getAttribute("dx").split().map((function(t){return t.getPixels("x")})),s=this.parent.getAttribute("dy").getPixels("y"),o=this.parent.getStyle("text-anchor").getString("start"),u=this.getStyle("letter-spacing"),h=this.parent.getStyle("letter-spacing"),c=0;u.hasValue()&&"inherit"!==u.getValue()?u.hasValue()&&"initial"!==u.getValue()&&"unset"!==u.getValue()&&(c=u.getPixels()):c=h.getPixels();var l=[],f=r.length;this.letterSpacingCache=l;for(var g=0;g0&&(u-=2*Math.PI),1===i&&u<0&&(u+=2*Math.PI),[s.x,s.y,r,n,o,u,a,i]}},{key:"calcLength",value:function(t,e,r,n){var i=0,a=null,s=null,o=0;switch(r){case Tt.LINE_TO:return this.getLineLength(t,e,n[0],n[1]);case Tt.CURVE_TO:for(i=0,a=this.getPointOnCubicBezier(0,t,e,n[0],n[1],n[2],n[3],n[4],n[5]),o=.01;o<=1;o+=.01)s=this.getPointOnCubicBezier(o,t,e,n[0],n[1],n[2],n[3],n[4],n[5]),i+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;return i;case Tt.QUAD_TO:for(i=0,a=this.getPointOnQuadraticBezier(0,t,e,n[0],n[1],n[2],n[3]),o=.01;o<=1;o+=.01)s=this.getPointOnQuadraticBezier(o,t,e,n[0],n[1],n[2],n[3]),i+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;return i;case Tt.ARC:i=0;var u=n[4],h=n[5],c=n[4]+h,l=Math.PI/180;if(Math.abs(u-c)c;o-=l)s=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],o,0),i+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(o=u+l;o5&&void 0!==arguments[5]?arguments[5]:e,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:r,o=(i-r)/(n-e+U),u=Math.sqrt(t*t/(1+o*o));ne)return null;var a,s=this.dataArray,o=Object(i.a)(s);try{for(o.s();!(a=o.n()).done;){var u=a.value;if(!u||!(u.pathLength<5e-5||r+u.pathLength+5e-5=0&&c>g)break;n=this.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],c,u.points[6]);break;case Tt.CURVE_TO:(c=h/u.pathLength)>1&&(c=1),n=this.getPointOnCubicBezier(c,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);break;case Tt.QUAD_TO:(c=h/u.pathLength)>1&&(c=1),n=this.getPointOnQuadraticBezier(c,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3])}if(n)return n;break}r+=u.pathLength}}catch(d){o.e(d)}finally{o.f()}return null}},{key:"getLineLength",value:function(t,e,r,n){return Math.sqrt((r-t)*(r-t)+(n-e)*(n-e))}},{key:"getPathLength",value:function(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce((function(t,e){return e.pathLength>0?t+e.pathLength:t}),0)),this.pathLength}},{key:"getPointOnCubicBezier",value:function(t,e,r,n,i,a,s,o,u){return{x:o*Q(t)+a*W(t)+n*G(t)+e*$(t),y:u*Q(t)+s*W(t)+i*G(t)+r*$(t)}}},{key:"getPointOnQuadraticBezier",value:function(t,e,r,n,i,a,s){return{x:a*Z(t)+n*J(t)+e*K(t),y:s*Z(t)+i*J(t)+r*K(t)}}},{key:"getPointOnEllipticalArc",value:function(t,e,r,n,i,a){var s=Math.cos(a),o=Math.sin(a),u=r*Math.cos(i),h=n*Math.sin(i);return{x:t+(u*s-h*o),y:e+(u*o+h*s)}}},{key:"buildEquidistantCache",value:function(t,e){var r=this.getPathLength(),n=e||.25,i=t||r/100;if(!this.equidistantCache||this.equidistantCache.step!==i||this.equidistantCache.precision!==n){this.equidistantCache={step:i,precision:n,points:[]};for(var a=0,s=0;s<=r;s+=n){var o=this.getPointOnPath(s),u=this.getPointOnPath(s+n);o&&u&&((a+=this.getLineLength(o.x,o.y,u.x,u.y))>=i&&(this.equidistantCache.points.push({x:o.x,y:o.y,distance:s}),a-=i))}}}},{key:"getEquidistantPointOnPath",value:function(t,e,r){if(this.buildEquidistantCache(e,r),t<0||t-this.getPathLength()>5e-5)return null;var n=Math.round(t/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[n]||null}}]),r}(Et),ie=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i,ae=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,i,s){var o;Object(l.a)(this,r),(o=e.call(this,t,i,s)).type="image",o.loaded=!1;var u=o.getHrefAttribute().getString();if(!u)return Object(n.a)(o);var h=u.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(u);return t.images.push(Object(a.a)(o)),h?o.loadSvg(u):o.loadImage(u),o.isSvg=h,o}return Object(f.a)(r,[{key:"loadImage",value:function(t){var e=this;return y()(S().mark((function r(){var n;return S().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,e.document.createImage(t);case 3:n=r.sent,e.image=n,r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),console.error('Error while loading image "'.concat(t,'":'),r.t0);case 10:e.loaded=!0;case 11:case"end":return r.stop()}}),r,null,[[0,7]])})))()}},{key:"loadSvg",value:function(t){var e=this;return y()(S().mark((function r(){var n,i,a,s;return S().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(n=ie.exec(t))){r.next=6;break}i=n[5],"base64"===n[4]?e.image=atob(i):e.image=decodeURIComponent(i),r.next=19;break;case 6:return r.prev=6,r.next=9,e.document.fetch(t);case 9:return a=r.sent,r.next=12,a.text();case 12:s=r.sent,e.image=s,r.next=19;break;case 16:r.prev=16,r.t0=r.catch(6),console.error('Error while loading image "'.concat(t,'":'),r.t0);case 19:e.loaded=!0;case 20:case"end":return r.stop()}}),r,null,[[6,16]])})))()}},{key:"renderChildren",value:function(t){var e=this.document,r=this.image,n=this.loaded,i=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");if(n&&r&&s&&o){if(t.save(),t.translate(i,a),this.isSvg){var u=e.canvg.forkString(t,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:o});u.document.documentElement.parent=this,u.render()}else{var h=this.image;e.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:h.width,height:o,desiredHeight:h.height}),this.loaded&&("undefined"===typeof h.complete||h.complete)&&t.drawImage(h,0,0)}t.restore()}}},{key:"getBoundingBox",value:function(){var t=this.getAttribute("x").getPixels("x"),e=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),n=this.getStyle("height").getPixels("y");return new St(t,e,t+r,e+n)}}]),r}(At),se=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="symbol",t}return Object(f.a)(r,[{key:"render",value:function(t){}}]),r}(At),oe=function(){function t(e){Object(l.a)(this,t),this.document=e,this.loaded=!1,e.fonts.push(this)}return Object(f.a)(t,[{key:"load",value:function(t,e){var r=this;return y()(S().mark((function n(){var i,a,s;return S().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,i=r.document,n.next=4,i.canvg.parser.load(e);case 4:a=n.sent,s=a.getElementsByTagName("font"),Array.from(s).forEach((function(e){var r=i.createElement(e);i.definitions[t]=r})),n.next=12;break;case 9:n.prev=9,n.t0=n.catch(0),console.error('Error while loading font "'.concat(e,'":'),n.t0);case 12:r.loaded=!0;case 13:case"end":return n.stop()}}),n,null,[[0,9]])})))()}}]),t}(),ue=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var a;return Object(l.a)(this,r),(a=e.call(this,t,n,i)).type="style",A(Array.from(n.childNodes).map((function(t){return t.textContent})).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")).split("}").forEach((function(e){var r=e.trim();if(r){var n=r.split("{"),i=n[0].split(","),a=n[1].split(";");i.forEach((function(e){var r=e.trim();if(r){var n=t.styles[r]||{};if(a.forEach((function(e){var r=e.indexOf(":"),i=e.substr(0,r).trim(),a=e.substr(r+1,e.length-r).trim();i&&a&&(n[i]=new tt(t,i,a))})),t.styles[r]=n,t.stylesSpecificity[r]=H(r),"@font-face"===r){var i=n["font-family"].getString().replace(/"|'/g,"");n.src.getString().split(",").forEach((function(e){if(e.indexOf('format("svg")')>0){var r=M(e);r&&new oe(t).load(i,r)}}))}}}))}})),a}return Object(f.a)(r)}(mt);ue.parseExternalUrl=M;var he=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(){var t;return Object(l.a)(this,r),(t=e.apply(this,arguments)).type="use",t}return Object(f.a)(r,[{key:"setContext",value:function(t){Object(s.a)(Object(o.a)(r.prototype),"setContext",this).call(this,t);var e=this.getAttribute("x"),n=this.getAttribute("y");e.hasValue()&&t.translate(e.getPixels("x"),0),n.hasValue()&&t.translate(0,n.getPixels("y"))}},{key:"path",value:function(t){var e=this.element;e&&e.path(t)}},{key:"renderChildren",value:function(t){var e=this.document,r=this.element;if(r){var n=r;if("symbol"===r.type&&((n=new Mt(e,null)).attributes.viewBox=new tt(e,"viewBox",r.getAttribute("viewBox").getString()),n.attributes.preserveAspectRatio=new tt(e,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),n.attributes.overflow=new tt(e,"overflow",r.getAttribute("overflow").getString()),n.children=r.children,r.styles.opacity=new tt(e,"opacity",this.calculateOpacity())),"svg"===n.type){var i=this.getStyle("width",!1,!0),a=this.getStyle("height",!1,!0);i.hasValue()&&(n.attributes.width=new tt(e,"width",i.getString())),a.hasValue()&&(n.attributes.height=new tt(e,"height",a.getString()))}var s=n.parent;n.parent=this,n.render(t),n.parent=s}}},{key:"getBoundingBox",value:function(t){var e=this.element;return e?e.getBoundingBox(t):null}},{key:"elementTransform",value:function(){var t=this.document,e=this.element;return vt.fromElement(t,e)}},{key:"element",get:function(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}}]),r}(At);function ce(t,e,r,n,i,a){return t[r*n*4+4*e+a]}function le(t,e,r,n,i,a,s){t[r*n*4+4*e+a]=s}function fe(t,e,r){return t[e]*r}function ge(t,e,r,n){return e+Math.cos(t)*r+Math.sin(t)*n}var de=function(t){Object(h.a)(r,t);var e=Object(c.a)(r);function r(t,n,i){var a;Object(l.a)(this,r),(a=e.call(this,t,n,i)).type="feColorMatrix";var s=E(a.getAttribute("values").getString());switch(a.getAttribute("type").getString("matrix")){case"saturate":var o=s[0];s=[.213+.787*o,.715-.715*o,.072-.072*o,0,0,.213-.213*o,.715+.285*o,.072-.072*o,0,0,.213-.213*o,.715-.715*o,.072+.928*o,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var u=s[0]*Math.PI/180;s=[ge(u,.213,.787,-.213),ge(u,.715,-.715,-.715),ge(u,.072,-.072,.928),0,0,ge(u,.213,-.213,.143),ge(u,.715,.285,.14),ge(u,.072,-.072,-.283),0,0,ge(u,.213,-.213,-.787),ge(u,.715,-.715,.715),ge(u,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}return a.matrix=s,a.includeOpacity=a.getAttribute("includeOpacity").hasValue(),a}return Object(f.a)(r,[{key:"apply",value:function(t,e,r,n,i){for(var a=this.includeOpacity,s=this.matrix,o=t.getImageData(0,0,n,i),u=0;u1&&void 0!==i[1]&&i[1],n=document.createElement("img"),r&&(n.crossOrigin="Anonymous"),t.abrupt("return",new Promise((function(t,r){n.onload=function(){t(n)},n.onerror=function(t,e,n,i,a){r(a)},n.src=e})));case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Pe=function(){function t(e){Object(l.a)(this,t);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.rootEmSize,i=void 0===n?12:n,a=r.emSize,s=void 0===a?12:a,o=r.createCanvas,u=void 0===o?t.createCanvas:o,h=r.createImage,c=void 0===h?t.createImage:h,f=r.anonymousCrossOrigin;this.canvg=e,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=e.screen,this.rootEmSize=i,this.emSize=s,this.createCanvas=u,this.createImage=this.bindCreateImage(c,f),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}return Object(f.a)(t,[{key:"bindCreateImage",value:function(t,e){return"boolean"===typeof e?function(r,n){return t(r,"boolean"===typeof n?n:e)}:t}},{key:"window",get:function(){return this.screen.window}},{key:"fetch",get:function(){return this.screen.fetch}},{key:"ctx",get:function(){return this.screen.ctx}},{key:"emSize",get:function(){var t=this.emSizeStack;return t[t.length-1]},set:function(t){this.emSizeStack.push(t)}},{key:"popEmSize",value:function(){this.emSizeStack.pop()}},{key:"getUniqueId",value:function(){return"canvg".concat(++this.uniqueId)}},{key:"isImagesLoaded",value:function(){return this.images.every((function(t){return t.loaded}))}},{key:"isFontsLoaded",value:function(){return this.fonts.every((function(t){return t.loaded}))}},{key:"createDocumentElement",value:function(t){var e=this.createElement(t.documentElement);return e.root=!0,e.addStylesFromStyleDefinition(),this.documentElement=e,e}},{key:"createElement",value:function(e){var r=e.nodeName.replace(/^[^:]+:/,""),n=t.elementTypes[r];return"undefined"!==typeof n?new n(this,e):new bt(this,e)}},{key:"createTextNode",value:function(t){return new Nt(this,t)}},{key:"setViewBox",value:function(t){this.screen.setViewBox(function(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};this.parser=new ht(n),this.screen=new st(e,n),this.options=n;var i=new Pe(this,n),a=i.createDocumentElement(r);this.document=i,this.documentElement=a}return Object(f.a)(t,[{key:"fork",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.from(e,r,je(je({},this.options),n))}},{key:"forkString",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.fromString(e,r,je(je({},this.options),n))}},{key:"ready",value:function(){return this.screen.ready()}},{key:"isReady",value:function(){return this.screen.isReady()}},{key:"render",value:function(){var t=arguments,e=this;return y()(S().mark((function r(){var n;return S().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=t.length>0&&void 0!==t[0]?t[0]:{},e.start(je({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},n)),r.next=4,e.ready();case 4:e.stop();case 5:case"end":return r.stop()}}),r)})))()}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.documentElement,r=this.screen,n=this.options;r.start(e,je(je({enableRedraw:!0},n),t))}},{key:"stop",value:function(){this.screen.stop()}},{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(t,e,r)}}],[{key:"from",value:function(e,r){var n=arguments;return y()(S().mark((function i(){var a,s,o;return S().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return a=n.length>2&&void 0!==n[2]?n[2]:{},s=new ht(a),i.next=4,s.parse(r);case 4:return o=i.sent,i.abrupt("return",new t(e,o,a));case 6:case"end":return i.stop()}}),i)})))()}},{key:"fromString",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new ht(n),a=i.parseFromString(r);return new t(e,a,n)}}]),t}()}.call(this,r(432))},2287:function(t,e){t.exports=function(t){this.ok=!1,this.alpha=1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t=(t=t.replace(/ /g,"")).toLowerCase();var e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};t=e[t]||t;for(var r=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),parseFloat(t[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],n=0;n3&&(this.alpha=o[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),r=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==r.length&&(r="0"+r),"#"+t+e+r},this.getHelpXML=function(){for(var t=new Array,n=0;n "+h.toRGB()+" -> "+h.toHex());u.appendChild(c),u.appendChild(l),o.appendChild(u)}catch(f){}return o}}},2288:function(t,e,r){"use strict";r.d(e,"a",(function(){return O}));var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function a(t,e){var r=t[0],n=t[1];return[r*Math.cos(e)-n*Math.sin(e),r*Math.sin(e)+n*Math.cos(e)]}function s(){for(var t=[],e=0;et.phi1&&(t.phi2-=2*o),1===t.sweepFlag&&t.phi2n)return[];if(0===n)return[[t*r/(t*t+e*e),e*r/(t*t+e*e)]];var i=Math.sqrt(n);return[[(t*r+e*i)/(t*t+e*e),(e*r-t*i)/(t*t+e*e)],[(t*r-e*i)/(t*t+e*e),(e*r+t*i)/(t*t+e*e)]]}var c,l=Math.PI/180;function f(t,e,r){return(1-r)*t+r*e}function g(t,e,r,n){return t+Math.cos(n/180*o)*e+Math.sin(n/180*o)*r}function d(t,e,r,n){var i=1e-6,a=e-t,s=r-e,o=3*a+3*(n-r)-6*s,u=6*(s-a),h=3*a;return Math.abs(o)p&&(i.sweepFlag=+!i.sweepFlag),i}))}t.ROUND=function(t){function e(e){return Math.round(e*t)/t}return void 0===t&&(t=1e13),s(t),function(t){return void 0!==t.x1&&(t.x1=e(t.x1)),void 0!==t.y1&&(t.y1=e(t.y1)),void 0!==t.x2&&(t.x2=e(t.x2)),void 0!==t.y2&&(t.y2=e(t.y2)),void 0!==t.x&&(t.x=e(t.x)),void 0!==t.y&&(t.y=e(t.y)),void 0!==t.rX&&(t.rX=e(t.rX)),void 0!==t.rY&&(t.rY=e(t.rY)),t}},t.TO_ABS=e,t.TO_REL=function(){return i((function(t,e,r){return t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=r),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=r),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=r),t.relative=!0),t}))},t.NORMALIZE_HVZ=function(t,e,r){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),i((function(n,i,a,s,o){if(isNaN(s)&&!(n.type&O.MOVE_TO))throw new Error("path must start with moveto");return e&&n.type&O.HORIZ_LINE_TO&&(n.type=O.LINE_TO,n.y=n.relative?0:a),r&&n.type&O.VERT_LINE_TO&&(n.type=O.LINE_TO,n.x=n.relative?0:i),t&&n.type&O.CLOSE_PATH&&(n.type=O.LINE_TO,n.x=n.relative?s-i:s,n.y=n.relative?o-a:o),n.type&O.ARC&&(0===n.rX||0===n.rY)&&(n.type=O.LINE_TO,delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag),n}))},t.NORMALIZE_ST=r,t.QT_TO_C=n,t.INFO=i,t.SANITIZE=function(t){void 0===t&&(t=0),s(t);var e=NaN,r=NaN,n=NaN,a=NaN;return i((function(i,s,o,u,h){var c=Math.abs,l=!1,f=0,g=0;if(i.type&O.SMOOTH_CURVE_TO&&(f=isNaN(e)?0:s-e,g=isNaN(r)?0:o-r),i.type&(O.CURVE_TO|O.SMOOTH_CURVE_TO)?(e=i.relative?s+i.x2:i.x2,r=i.relative?o+i.y2:i.y2):(e=NaN,r=NaN),i.type&O.SMOOTH_QUAD_TO?(n=isNaN(n)?s:2*s-n,a=isNaN(a)?o:2*o-a):i.type&O.QUAD_TO?(n=i.relative?s+i.x1:i.x1,a=i.relative?o+i.y1:i.y2):(n=NaN,a=NaN),i.type&O.LINE_COMMANDS||i.type&O.ARC&&(0===i.rX||0===i.rY||!i.lArcFlag)||i.type&O.CURVE_TO||i.type&O.SMOOTH_CURVE_TO||i.type&O.QUAD_TO||i.type&O.SMOOTH_QUAD_TO){var d=void 0===i.x?0:i.relative?i.x:i.x-s,y=void 0===i.y?0:i.relative?i.y:i.y-o;f=isNaN(n)?void 0===i.x1?f:i.relative?i.x:i.x1-s:n-s,g=isNaN(a)?void 0===i.y1?g:i.relative?i.y:i.y1-o:a-o;var p=void 0===i.x2?0:i.relative?i.x:i.x2-s,v=void 0===i.y2?0:i.relative?i.y:i.y2-o;c(d)<=t&&c(y)<=t&&c(f)<=t&&c(g)<=t&&c(p)<=t&&c(v)<=t&&(l=!0)}return i.type&O.CLOSE_PATH&&c(s-u)<=t&&c(o-h)<=t&&(l=!0),l?[]:i}))},t.MATRIX=o,t.ROTATE=function(t,e,r){void 0===e&&(e=0),void 0===r&&(r=0),s(t,e,r);var n=Math.sin(t),i=Math.cos(t);return o(i,n,-n,i,e-e*i+r*n,r-e*n-r*i)},t.TRANSLATE=function(t,e){return void 0===e&&(e=0),s(t,e),o(1,0,0,1,t,e)},t.SCALE=function(t,e){return void 0===e&&(e=t),s(t,e),o(t,0,0,e,0,0)},t.SKEW_X=function(t){return s(t),o(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return s(t),o(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),s(t),o(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),s(t),o(1,0,0,-1,0,t)},t.A_TO_C=function(){return i((function(t,e,r){return O.ARC===t.type?function(t,e,r){var n,i,s,o;t.cX||u(t,e,r);for(var h=Math.min(t.phi1,t.phi2),c=Math.max(t.phi1,t.phi2)-h,g=Math.ceil(c/90),d=new Array(g),y=e,p=r,v=0;vo.maxX&&(o.maxX=t),to.maxY&&(o.maxY=t),tV&&c(y(r,i.x1,i.x2,i.x,V));for(var v=0,m=d(n,i.y1,i.y2,i.y);vV&&l(y(n,i.y1,i.y2,i.y,V))}if(i.type&O.ARC){c(i.x),l(i.y),u(i,r,n);for(var b=i.xRot/180*Math.PI,x=Math.cos(b)*i.rX,k=Math.sin(b)*i.rX,w=-Math.sin(b)*i.rY,S=Math.cos(b)*i.rY,T=i.phi1i.phi2?[i.phi2+360,i.phi1+360]:[i.phi2,i.phi1],A=T[0],C=T[1],P=function(t){var e=t[0],r=t[1],n=180*Math.atan2(r,e)/Math.PI;return nA&&VA&&Vu)throw new SyntaxError('Expected positive number, got "'+u+'" at index "'+i+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+i+'"');this.curArgs.push(u),this.curArgs.length===k[this.curCommandType]&&(O.HORIZ_LINE_TO===this.curCommandType?n({type:O.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):O.VERT_LINE_TO===this.curCommandType?n({type:O.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===O.MOVE_TO||this.curCommandType===O.LINE_TO||this.curCommandType===O.SMOOTH_QUAD_TO?(n({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),O.MOVE_TO===this.curCommandType&&(this.curCommandType=O.LINE_TO)):this.curCommandType===O.CURVE_TO?n({type:O.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===O.SMOOTH_CURVE_TO?n({type:O.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===O.QUAD_TO?n({type:O.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===O.ARC&&n({type:O.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!m(a))if(","===a&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==a&&"-"!==a&&"."!==a)if(o)this.curNumber=a,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+i+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+a+'" at index '+i+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==a&&"Z"!==a)if("h"===a||"H"===a)this.curCommandType=O.HORIZ_LINE_TO,this.curCommandRelative="h"===a;else if("v"===a||"V"===a)this.curCommandType=O.VERT_LINE_TO,this.curCommandRelative="v"===a;else if("m"===a||"M"===a)this.curCommandType=O.MOVE_TO,this.curCommandRelative="m"===a;else if("l"===a||"L"===a)this.curCommandType=O.LINE_TO,this.curCommandRelative="l"===a;else if("c"===a||"C"===a)this.curCommandType=O.CURVE_TO,this.curCommandRelative="c"===a;else if("s"===a||"S"===a)this.curCommandType=O.SMOOTH_CURVE_TO,this.curCommandRelative="s"===a;else if("q"===a||"Q"===a)this.curCommandType=O.QUAD_TO,this.curCommandRelative="q"===a;else if("t"===a||"T"===a)this.curCommandType=O.SMOOTH_QUAD_TO,this.curCommandRelative="t"===a;else{if("a"!==a&&"A"!==a)throw new SyntaxError('Unexpected character "'+a+'" at index '+i+".");this.curCommandType=O.ARC,this.curCommandRelative="a"===a}else e.push({type:O.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=a,this.curNumberHasDecimal="."===a}else this.curNumber+=a,this.curNumberHasDecimal=!0;else this.curNumber+=a;else this.curNumber+=a,this.curNumberHasExp=!0;else this.curNumber+=a,this.curNumberHasExpDigits=this.curNumberHasExp}return e},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(e,r){void 0===r&&(r=[]);for(var n=0,i=Object.getPrototypeOf(this).parse.call(this,e);n>Y,0!==N?(N=255/N,_[d]=(p*X>>Y)*N,_[d+1]=(v*X>>Y)*N,_[d+2]=(m*X>>Y)*N):_[d]=_[d+1]=_[d+2]=0,p-=x,v-=O,m-=k,b-=w,x-=H.r,O-=H.g,k-=H.b,w-=H.a,f=y+((f=h+o+1)>Y,N>0?(N=255/N,_[f]=(p*X>>Y)*N,_[f+1]=(v*X>>Y)*N,_[f+2]=(m*X>>Y)*N):_[f]=_[f+1]=_[f+2]=0,p-=x,v-=O,m-=k,b-=w,x-=H.r,O-=H.g,k-=H.b,w-=H.a,f=h+((f=c+D)