Socket
Socket
Sign inDemoInstall

@antv/g-svg

Package Overview
Dependencies
Maintainers
64
Versions
295
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-svg - npm Package Compare versions

Comparing version 1.10.23 to 1.10.24

4

dist/index.esm.js

@@ -1,2 +0,2 @@

import { __rest, __awaiter, __generator, __extends } from 'tslib';
import { __rest, __awaiter, __generator, __extends, __spreadArray, __read } from 'tslib';
import { propertyMetadataCache, isBrowser, AbstractRendererPlugin, AbstractRenderer } from '@antv/g-lite';

@@ -173,3 +173,3 @@ import * as DomInteraction from '@antv/g-plugin-dom-interaction';

function ContextRegisterPlugin() {
var _this = _super !== null && _super.apply(this, arguments) || this;
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
_this.name = 'svg-context-register';

@@ -176,0 +176,0 @@ return _this;

@@ -192,3 +192,3 @@ 'use strict';

function ContextRegisterPlugin() {
var _this = _super !== null && _super.apply(this, arguments) || this;
var _this = _super.apply(this, tslib.__spreadArray([], tslib.__read(arguments), false)) || this;
_this.name = 'svg-context-register';

@@ -195,0 +195,0 @@ return _this;

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.SVG={}),t.window.G)}(this,(function(t,e){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+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)}var i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},i.apply(this,arguments)};function o(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);r.length>i;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function a(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function c(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&i[3]>c[1])){a.label=c[1];break}if(6===c[0]&&i[1]>a.label){a.label=i[1],i=c;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}var l=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var c=o.root.ownerDocument.defaultView,s=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},d=function(t){i.hooks.pointerOver.call(t)},p=function(t){i.hooks.pointerOut.call(t)},f=function(t){i.hooks.pointerCancel.call(t)},h=function(t){i.hooks.pointerWheel.call(t)},m=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):c.supportsPointerEvents&&(t.style.touchAction="none"),c.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",s,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",p,!0),t.addEventListener("pointerover",d,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",f,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",s,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",p,!0),t.addEventListener("mouseover",d,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),c.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",s,!0),t.addEventListener("touchcancel",f,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",m,!0),t.addEventListener("wheel",h,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):c.supportsPointerEvents&&(t.style.touchAction=""),c.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",s,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",p,!0),t.removeEventListener("pointerover",d,!0),n.globalThis.removeEventListener("pointerup",l,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",s,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",p,!0),t.removeEventListener("mouseover",d,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),c.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",s,!0),t.removeEventListener("touchcancel",f,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",m,!0),t.removeEventListener("wheel",h,!0)}))},t.tag="DOMInteraction",t}(),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="dom-interaction",e}return r(e,t),e.prototype.init=function(){this.addRenderingPlugin(new l)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(e.AbstractRendererPlugin),d=Object.freeze({__proto__:null,Plugin:u}),p=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.config.document,o=e.renderingService,s=e.svgElementMap;o.hooks.pick.tapPromise(t.tag,(function(t){return a(r,void 0,void 0,(function(){return c(this,(function(e){return[2,this.pick(s,i,t)]}))}))})),o.hooks.pickSync.tap(t.tag,(function(t){return r.pick(s,i,t)}))},t.prototype.pick=function(t,e,n){var r,i,o=n.topmost,a=n.position,c=a.clientX,s=a.clientY;try{var l=[];try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}((e||document).elementsFromPoint(c,s)),d=u.next();!d.done;d=u.next()){var p=t.get(d.value);if(p&&p.isInteractive()&&(l.push(p),o))return n.picked=l,n}}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}n.picked=l}catch(t){n.picked=[]}return n},t.tag="SVGPicker",t}(),f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="svg-picker",e}return r(e,t),e.prototype.init=function(){this.addRenderingPlugin(new p)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(e.AbstractRendererPlugin),h=Object.freeze({__proto__:null,Plugin:f}),m="undefined"!=typeof Float32Array?Float32Array:Array;function v(){var t=new m(16);return m!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function g(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],s=e[6],l=e[7],u=e[8],d=e[9],p=e[10],f=e[11],h=e[12],m=e[13],v=e[14],g=e[15],y=n*c-r*a,b=n*s-i*a,E=n*l-o*a,A=r*s-i*c,S=r*l-o*c,x=i*l-o*s,C=u*m-d*h,w=u*v-p*h,O=u*g-f*h,T=d*v-p*m,k=d*g-f*m,L=p*g-f*v,G=y*L-b*k+E*T+A*O-S*w+x*C;return G?(t[0]=(c*L-s*k+l*T)*(G=1/G),t[1]=(i*k-r*L-o*T)*G,t[2]=(m*x-v*S+g*A)*G,t[3]=(p*S-d*x-f*A)*G,t[4]=(s*O-a*L-l*w)*G,t[5]=(n*L-i*O+o*w)*G,t[6]=(v*E-h*x-g*b)*G,t[7]=(u*x-p*E+f*b)*G,t[8]=(a*k-c*O+l*C)*G,t[9]=(r*O-n*k-o*C)*G,t[10]=(h*S-m*E+g*y)*G,t[11]=(d*E-u*S-f*y)*G,t[12]=(c*w-a*T-s*C)*G,t[13]=(n*T-r*w+i*C)*G,t[14]=(m*b-h*A-v*y)*G,t[15]=(u*A-d*b+p*y)*G,t):null}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var y=function(t){return null==t},b={}.toString,E=function(t,e){return b.call(t)==="[object "+e+"]"},A=function(t){return E(t,"String")},S=function(t,e,n){return e>t?e:t>n?n:t},x=function(){function t(){}return t.tag="c-svg-element",t}();function C(t,e){var n=e.img,r=void 0===n?"":n,i=e.width,o=e.height;if(t.setAttribute("x","0"),t.setAttribute("y","0"),A(r))t.setAttribute("href",r);else if(r instanceof Image)i||t.setAttribute("width","".concat(r.width)),o||t.setAttribute("height","".concat(r.height)),t.setAttribute("href",r.src);else if(r instanceof HTMLElement&&A(r.nodeName)&&"CANVAS"===r.nodeName.toUpperCase())t.setAttribute("href",r.toDataURL());else if(r instanceof ImageData){var a=document.createElement("canvas");a.setAttribute("width","".concat(r.width)),a.setAttribute("height","".concat(r.height));var c=a.getContext("2d");c&&(c.putImageData(r,0,0),i||t.setAttribute("width","".concat(r.width)),o||t.setAttribute("height","".concat(r.height)),t.setAttribute("href",a.toDataURL()))}}function w(t,n){var r=n.x1,i=n.y1,o=n.x2,a=n.y2,c=n.defX,s=void 0===c?0:c,l=n.defY,u=void 0===l?0:l,d=n.markerStart,p=n.markerEnd,f=n.markerStartOffset,h=n.markerEndOffset,m=0,v=0,g=0,y=0,b=0;d&&e.isDisplayObject(d)&&f&&(m=Math.cos(b=Math.atan2(a-i,o-r))*(f||0),v=Math.sin(b)*(f||0)),p&&e.isDisplayObject(p)&&h&&(g=Math.cos(b=Math.atan2(i-a,r-o))*(h||0),y=Math.sin(b)*(h||0)),t.setAttribute("x1","".concat(r-s+m)),t.setAttribute("y1","".concat(i-u+v)),t.setAttribute("x2","".concat(o-s+g)),t.setAttribute("y2","".concat(a-u+y))}function O(t,n){var r=n.path,i=n.defX,o=void 0===i?0:i,a=n.defY,c=void 0===a?0:a,l=n.markerStart,u=n.markerEnd,d=n.markerStartOffset,p=n.markerEndOffset,f=0,h=0,m=0,v=0,g=0;if(l&&e.isDisplayObject(l)&&d){var y=s(l.parentNode.getStartTangent(),2);f=Math.cos(g=Math.atan2((b=y[0])[1]-(E=y[1])[1],b[0]-E[0]))*(d||0),h=Math.sin(g)*(d||0)}if(u&&e.isDisplayObject(u)&&p){var b,E,A=s(u.parentNode.getEndTangent(),2);m=Math.cos(g=Math.atan2((b=A[0])[1]-(E=A[1])[1],b[0]-E[0]))*(p||0),v=Math.sin(g)*(p||0)}t.setAttribute("d",e.translatePathToString(r.absolutePath,o,c,f,h,m,v))}function T(t,n){var r=n.points.points,i=n.defX,o=void 0===i?0:i,a=n.defY,c=void 0===a?0:a,s=n.markerStart,l=n.markerStartOffset,u=n.markerEnd,d=n.markerEndOffset,p=r.length;if(r&&p>=2){var f=0,h=0,m=0,v=0,g=0;s&&e.isDisplayObject(s)&&l&&(f=Math.cos(g=Math.atan2(r[1][1]-r[0][1],r[1][0]-r[0][0]))*(l||0),h=Math.sin(g)*(l||0)),u&&e.isDisplayObject(u)&&d&&(m=Math.cos(g=Math.atan2(r[p-2][1]-r[p-1][1],r[p-2][0]-r[p-1][0]))*(d||0),v=Math.sin(g)*(d||0)),t.setAttribute("points",r.map((function(t,e){var n=0,r=0;return 0===e?(n=f,r=h):e===p-1&&(n=m,r=v),"".concat(t[0]-o+n,",").concat(t[1]-c+r)})).join(" "))}}function k(t,e){var n=e.radius,r=e.width,i=e.height;if(isFinite(r)&&isFinite(i)){var o="";if(n&&n.some((function(t){return 0!==t}))){var a=s(n.map((function(t){return S(t,0,Math.min(Math.abs(r)/2,Math.abs(i)/2))})),4),c=a[0],l=a[1],u=a[2],d=a[3],p=r>0?1:-1,f=i>0?1:-1,h=p+f!==0?1:0;o=[["M ".concat(p*c,",0")],["l ".concat(r-p*(c+l),",0")],["a ".concat(l,",").concat(l,",0,0,").concat(h,",").concat(p*l,",").concat(f*l)],["l 0,".concat(i-f*(l+u))],["a ".concat(u,",").concat(u,",0,0,").concat(h,",").concat(-p*u,",").concat(f*u)],["l ".concat(p*(u+d)-r,",0")],["a ".concat(d,",").concat(d,",0,0,").concat(h,",").concat(-p*d,",").concat(-f*d)],["l 0,".concat(f*(d+c)-i)],["a ".concat(c,",").concat(c,",0,0,").concat(h,",").concat(p*c,",").concat(-f*c)],["z"]].join(" ")}else o="M 0,0 l ".concat(r,",0 l 0,").concat(i," l").concat(-r," 0 z");t.setAttribute("d",o)}}function L(t,e){return(e||document).createElementNS("http://www.w3.org/2000/svg",t)}var G="g-filter-";function M(t,e,n,r,i){var o=G+n.entity,a=e.querySelectorAll("[name=".concat(o,"]"));if(a.length&&a.forEach((function(t){e.removeChild(t)})),0===i.length)null==r||r.removeAttribute("filter");else{var c=i.map((function(n,r){var i=n.name,a=n.params,c=L("filter",t);return c.setAttribute("filterUnits","userSpaceOnUse"),"blur"===i?function(t,e,n){var r=L("feGaussianBlur",t);r.setAttribute("in","SourceGraphic"),r.setAttribute("stdDeviation","".concat(n[0].value)),e.appendChild(r)}(t,c,a):"brightness"===i?function(t,e,n){var r=P(n[0]);D(t,e,{type:"linear",slope:r,intercept:0})}(t,c,a):"drop-shadow"===i?function(t,e,n){var r=n[0].value,i=n[1].value,o=n[2].value,a=n[3].formatted,c=L("feGaussianBlur",t);c.setAttribute("in","SourceAlpha"),c.setAttribute("stdDeviation","".concat(o)),e.appendChild(c);var s=L("feOffset",t);s.setAttribute("dx","".concat(r)),s.setAttribute("dy","".concat(i)),s.setAttribute("result","offsetblur"),e.appendChild(s);var l=L("feFlood",t);l.setAttribute("flood-color",a),e.appendChild(l);var u=L("feComposite",t);u.setAttribute("in2","offsetblur"),u.setAttribute("operator","in"),e.appendChild(u);var d=L("feMerge",t);e.appendChild(d);var p=L("feMergeNode",t),f=L("feMergeNode",t);f.setAttribute("in","SourceGraphic"),d.appendChild(p),d.appendChild(f)}(t,c,a):"contrast"===i?function(t,e,n){var r=P(n[0]);D(t,e,{type:"linear",slope:r,intercept:-.5*r+.5})}(t,c,a):"grayscale"===i?function(t,e,n){var r=P(n[0]);V(t,e,[.2126+.7874*(1-r),.7152-.7152*(1-r),.0722-.0722*(1-r),0,0,.2126-.2126*(1-r),.7152+.2848*(1-r),.0722-.0722*(1-r),0,0,.2126-.2126*(1-r),.7152-.7152*(1-r),.0722+.9278*(1-r),0,0,0,0,0,1,0])}(t,c,a):"sepia"===i?function(t,e,n){var r=P(n[0]);V(t,e,[.393+.607*(1-r),.769-.769*(1-r),.189-.189*(1-r),0,0,.349-.349*(1-r),.686+.314*(1-r),.168-.168*(1-r),0,0,.272-.272*(1-r),.534-.534*(1-r),.131+.869*(1-r),0,0,0,0,0,1,0])}(t,c,a):"saturate"===i?function(t,e,n){var r=P(n[0]),i=L("feColorMatrix",t);i.setAttribute("type","saturate"),i.setAttribute("values","".concat(r)),e.appendChild(i)}(t,c,a):"hue-rotate"===i?function(t,e,n){var r=L("feColorMatrix",t);r.setAttribute("type","hueRotate"),r.setAttribute("values","".concat(n[0].value)),e.appendChild(r)}(t,c,a):"invert"===i&&function(t,e,n){var r=P(n[0]);D(t,e,{type:"table",tableValues:"".concat(r," ").concat(1-r)})}(t,c,a),c.id="".concat(o,"-").concat(r),c.setAttribute("name",o),e.appendChild(c),c.id}));setTimeout((function(){null==r||r.setAttribute("filter",c.map((function(t){return"url(#".concat(t,")")})).join(" "))}))}}function P(t){return t.unit===e.UnitType.kPercentage?t.value/100:t.value}function D(t,e,n){var r=n.type,i=n.slope,o=n.intercept,a=n.tableValues,c=L("feComponentTransfer",t);[L("feFuncR",t),L("feFuncG",t),L("feFuncB",t)].forEach((function(t){t.setAttribute("type",r),"table"===r?t.setAttribute("tableValues","".concat(a)):(t.setAttribute("slope","".concat(i)),t.setAttribute("intercept","".concat(o))),c.appendChild(t)})),e.appendChild(c)}function V(t,e,n){var r=L("feColorMatrix",t);r.setAttribute("type","matrix"),r.setAttribute("values",n.join(" ")),e.appendChild(r)}var R="g-pattern-",$={},N=0;function U(t,n,r,i,o,a,c,s){if(!o)return"";if(!e.isCSSRGB(o)){if(e.isPattern(o)){var l=function(t,n,r,i,o,a){var c=I(i),s=n.querySelector("#".concat(c));if(!s){var l=i.image,u="";if(A(l)?u=l:e.isBrowser&&(l instanceof HTMLImageElement?u=l.src:l instanceof HTMLCanvasElement&&(u=l.toDataURL())),u){var d,p=L("image",t);p.setAttribute("href",u),o?d=o(u):e.isBrowser&&(d=new window.Image),u.match(/^data:/i)||(d.crossOrigin="Anonymous",p.setAttribute("crossorigin","anonymous")),d.src=u;var f=function(){var e=j(t,n,r,i,c,d.width,d.height);n.appendChild(e),e.appendChild(p),p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("width","".concat(d.width)),p.setAttribute("height","".concat(d.height))};d.complete?f():d.onload=f}if("rect"===l.nodeName){var h=l.parsedStyle,m=j(t,n,l,i,c,h.width,h.height);l.forEach((function(e){a.createSVGDom(t,e,null);var n=e.elementSVG,r=e.getLocalTransform();a.applyTransform(n.$groupEl,r)})),m.appendChild(l.elementSVG.$groupEl)}}return c}(t,n,r,o,c,s);return i.style[a]="url(#".concat(l,")"),l}if(1===o.length){var u=_(t,r,n,i,o[0]);return null==i||i.setAttribute(a,"url(#".concat(u,")")),u}var d=function(t,e,n,r,i){var o=G+e.entity+"-gradient",a=n.querySelector("#".concat(o));a||((a=L("filter",t)).setAttribute("filterUnits","userSpaceOnUse"),a.setAttribute("x","0%"),a.setAttribute("y","0%"),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.id=o,n.appendChild(a));var c=0;i.forEach((function(i,s){var l=_(t,e,n,r,i),u=l+"_rect",d=L("rect",t);d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width","100%"),d.setAttribute("height","100%"),d.setAttribute("fill","url(#".concat(l,")")),d.id=u,n.appendChild(d);var p=L("feImage",t);if(p.setAttribute("href","#".concat(u)),p.setAttribute("result","".concat(o,"-").concat(s)),a.appendChild(p),s>0){var f=L("feBlend",t);f.setAttribute("in",1===s?"".concat(o,"-").concat(s-1):"".concat(o,"-blended-").concat(c-1)),f.setAttribute("in2","".concat(o,"-").concat(s)),f.setAttribute("result","".concat(o,"-blended-").concat(c++)),f.setAttribute("mode","multiply"),a.appendChild(f)}}));var s=L("feComposite",t);return s.setAttribute("in","".concat(o,"-blended-").concat(c)),s.setAttribute("in2","SourceGraphic"),s.setAttribute("operator","in"),a.appendChild(s),o}(t,r,n,i,o);return null==i||i.setAttribute("filter","url(#".concat(d,")")),null==i||i.setAttribute("fill","black"),d}return"currentColor"===r.style[a]?null==i||i.setAttribute(a,"currentColor"):null==i||i.setAttribute(a,o.isNone?"none":""+o),""}function I(t,n){void 0===n&&(n={});var r="";if(e.isCSSGradientValue(t)){var o=t.type;if(o===e.GradientType.LinearGradient||o===e.GradientType.RadialGradient){var a=i(i({},t.value),n),c=a.width,s=a.height,l=a.steps,u=a.angle,d=a.cx,p=a.cy,f=a.size;r="gradient-".concat(a.type,"-").concat((null==u?void 0:""+u)||0,"-").concat((null==d?void 0:""+d)||0,"-").concat((null==p?void 0:""+p)||0,"-").concat((null==f?void 0:""+f)||0,"-").concat(c,"-").concat(s,"-").concat(l.map((function(t){var e=t.color;return"".concat(t.offset).concat(e)})).join("-"))}}else e.isPattern(t)&&(r=A(t.image)?"pattern-".concat(t.image,"-").concat(t.repetition):"rect"===t.image.nodeName?"pattern-rect-".concat(t.image.entity):"pattern-".concat(N));return r&&($[r]||($[r]=R+"".concat(N++))),$[r]}function j(t,n,r,i,o,a,c){var l=i.repetition,u=i.transform,d=L("pattern",t);u&&d.setAttribute("patternTransform",function(t){return e.parseTransform(t).map((function(t){var e=t.t,n=t.d;if("translate"===e)return"translate(".concat(n[0].value," ").concat(n[1].value,")");if("translatex"===e)return"translate(".concat(n[0].value," 0)");if("translatey"===e)return"translate(0 ".concat(n[0].value,")");if("rotate"===e)return"rotate(".concat(n[0].value,")");if("scale"===e){var r=(null==n?void 0:n.map((function(t){return t.value})))||[1,1];return"scale(".concat(r[0],", ").concat(r[1],")")}if("scalex"===e)return r=(null==n?void 0:n.map((function(t){return t.value})))||[1],"scale(".concat(r[0],", 1)");if("scaley"===e)return r=(null==n?void 0:n.map((function(t){return t.value})))||[1],"scale(1, ".concat(r[0],")");if("skew"===e){var i=(null==n?void 0:n.map((function(t){return t.value})))||[0,0];return"skewX(".concat(i[0],") skewY(").concat(i[1],")")}if("skewx"===e)return i=(null==n?void 0:n.map((function(t){return t.value})))||[0],"skewX(".concat(i[0],")");if("skewy"===e)return i=(null==n?void 0:n.map((function(t){return t.value})))||[0],"skewY(".concat(i[0],")");if("matrix"===e){var o=s(n.map((function(t){return t.value})),6),a=o[1],c=o[2],l=o[3],u=o[4],d=o[5];return"matrix(".concat(o[0]," ").concat(a," ").concat(c," ").concat(l," ").concat(u," ").concat(d,")")}})).join(" ")}(u)),d.setAttribute("patternUnits","userSpaceOnUse"),d.id=o,n.appendChild(d),d.setAttribute("x","0"),d.setAttribute("y","0");var p=r.getGeometryBounds().halfExtents,f=a,h=c;return"repeat-x"===l?h=2*p[1]:"repeat-y"===l?f=2*p[0]:"no-repeat"===l&&(f=2*p[0],h=2*p[1]),d.setAttribute("width","".concat(f)),d.setAttribute("height","".concat(h)),d}function _(t,n,r,i,o){var a=n.getGeometryBounds(),c=a&&2*a.halfExtents[0]||0,s=a&&2*a.halfExtents[1]||0,l=I(o,{width:c,height:s}),u=r.querySelector("#".concat(l));if(!u){(u=L(o.type===e.GradientType.LinearGradient?"linearGradient":"radialGradient",t)).setAttribute("gradientUnits","userSpaceOnUse");var d="";o.value.steps.sort((function(t,e){return t.offset.value-e.offset.value})).forEach((function(t){var e=t.color;d+='<stop offset="'.concat(t.offset.value/100,'" stop-color="').concat(e,'"></stop>')})),u.innerHTML=d,u.id=l,r.appendChild(u)}if(o.type===e.GradientType.LinearGradient){var p=e.computeLinearGradient(c,s,o.value.angle),f=p.y1,h=p.x2,m=p.y2;u.setAttribute("x1","".concat(p.x1)),u.setAttribute("y1","".concat(f)),u.setAttribute("x2","".concat(h)),u.setAttribute("y2","".concat(m))}else{var v=o.value,g=e.computeRadialGradient(c,s,v.cx,v.cy,v.size),y=g.y,b=g.r;u.setAttribute("cx","".concat(g.x)),u.setAttribute("cy","".concat(y)),u.setAttribute("r","".concat(b))}return l}var H=/url\("?#(.*)\)/,F=function(){function t(t){this.context=t,this.gradientCache={}}return t.prototype.getDefElement=function(){return this.$def},t.prototype.init=function(){var t=this.context.config.document,e=this.context.contextService.getContext();this.$def=L("defs",t),e.appendChild(this.$def)},t.prototype.clear=function(t){var e=this;Object.keys(this.gradientCache).forEach((function(n){e.clearUnusedDefElement(e.gradientCache,n,t)}))},t.prototype.clearUnusedDefElement=function(t,e,n){if(t[e]&&1===t[e].size&&t[e].has(n)){var r=this.$def.querySelector("#".concat(e));r&&this.$def.removeChild(r)}},t.prototype.createOrUpdateGradientAndPattern=function(t,n,r,i,o){var a=this.context.config,c=a.document,s=a.createImage;if(n){var l=(e.isPattern(r)?n.style[i]:n.getAttribute(i)||"").match(H);l&&l.length>1&&this.clearUnusedDefElement(this.gradientCache,l[1].replace('"',""),t.entity);var u=U(c||document,this.$def,t,n,r,i,s,o);u&&(this.gradientCache[u]||(this.gradientCache[u]=new Set),this.gradientCache[u].add(t.entity))}},t.prototype.createOrUpdateShadow=function(t,e,n){!function(t,e,n,r,i){var o=n.parsedStyle,a=o.shadowType,c=o.shadowBlur,s=o.shadowColor,l=o.shadowOffsetX,u=o.shadowOffsetY,d=!y(s)&&c>0,p="g-filter-dropshadow-"+n.entity,f=e.querySelector("#".concat(p));if(f&&(f.getAttribute("data-type")===a&&d||(f.remove(),f=null)),d){if(null==r||r.setAttribute("filter","url(#".concat(p,")")),!f){if((f=L("filter",t)).setAttribute("data-type",a),"outer"===a)(w=L("feDropShadow",t)).setAttribute("dx","".concat((l||0)/2)),w.setAttribute("dy","".concat((u||0)/2)),w.setAttribute("stdDeviation","".concat((c||0)/4)),w.setAttribute("flood-color",""+s),f.appendChild(w);else if("inner"===a){var h=L("feComponentTransfer",t);h.setAttribute("in","SourceAlpha");var m=L("feFuncA",t);m.setAttribute("type","table"),m.setAttribute("tableValues","1 0"),h.appendChild(m),f.appendChild(h),(S=L("feGaussianBlur",t)).setAttribute("stdDeviation","".concat((c||0)/4)),f.appendChild(S),(x=L("feOffset",t)).setAttribute("dx","".concat((l||0)/2)),x.setAttribute("dy","".concat((u||0)/2)),x.setAttribute("result","offsetblur"),f.appendChild(x),(C=L("feFlood",t)).setAttribute("flood-color",""+s),C.setAttribute("result","color"),f.appendChild(C);var v=L("feComposite",t);v.setAttribute("in2","offsetblur"),v.setAttribute("operator","in"),f.appendChild(v);var g=L("feComposite",t);g.setAttribute("in2","SourceAlpha"),g.setAttribute("operator","in"),f.appendChild(g);var b=L("feMerge",t);f.appendChild(b);var E=L("feMergeNode",t);E.setAttribute("in","SourceGraphic");var A=L("feMergeNode",t);b.appendChild(E),b.appendChild(A)}return f.id=p,f.setAttribute("filterUnits","userSpaceOnUse"),void e.appendChild(f)}if("inner"===a){var S=f.children[1],x=f.children[2],C=f.children[3];"shadowColor"===i?C.setAttribute("flood-color",""+s):"shadowBlur"===i?S.setAttribute("stdDeviation","".concat((c||0)/4)):"shadowOffsetX"===i?x.setAttribute("dx","".concat((l||0)/2)):"shadowOffsetY"===i&&x.setAttribute("dy","".concat((u||0)/2))}else if("outer"===a){var w=f.children[0];"shadowColor"===i?w.setAttribute("flood-color",""+s):"shadowBlur"===i?w.setAttribute("stdDeviation","".concat((c||0)/4)):"shadowOffsetX"===i?w.setAttribute("dx","".concat((l||0)/2)):"shadowOffsetY"===i&&w.setAttribute("dy","".concat((u||0)/2))}}else null==r||r.removeAttribute("filter")}(this.context.config.document||document,this.$def,t,e,n)},t.prototype.createOrUpdateFilter=function(t,e,n){M(this.context.config.document||document,this.$def,t,e,n)},t}();function B(t){return t.toFixed(6).replace(".000000","")}function W(t){return t.replace(/[&|<|>|"|']/g,(function(t){return"&"===t?"&amp;":"<"===t?"&lt;":">"===t?"&gt;":'"'===t?"&quot;":"&apos;"}))}var X,z,Y={opacity:"opacity",fillStyle:"fill",fill:"fill",fillRule:"fill-rule",fillOpacity:"fill-opacity",strokeStyle:"stroke",strokeOpacity:"stroke-opacity",stroke:"stroke",clipPath:"clip-path",textPath:"text-path",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",letterSpacing:"letter-spacing",startArrow:"marker-start",endArrow:"marker-end",class:"class",id:"id",preserveAspectRatio:"preserveAspectRatio",visibility:"visibility",anchor:"anchor",shadowColor:"flood-color",shadowBlur:"stdDeviation",shadowOffsetX:"dx",shadowOffsetY:"dy",filter:"filter",innerHTML:"innerHTML",textAlign:"text-anchor",pointerEvents:"pointer-events"},q={textAlign:{inherit:"inherit",left:"left",start:"left",center:"middle",right:"end",end:"end"}},Q={textAlign:"inherit",lineCap:"butt",lineJoin:"miter",lineWidth:"1px",opacity:"1",fillOpacity:"1",fillRule:"nonzero",strokeOpacity:"1",strokeWidth:"0",strokeMiterLimit:"4",letterSpacing:"0",fontSize:"inherit",fontFamily:"inherit",pointerEvents:"auto"},J="g-svg",Z="clip-path-",K="text-path-",tt=function(){function t(t,e,n){this.pluginOptions=t,this.defElementManager=e,this.context=n,this.svgElementMap=new WeakMap,this.renderQueue=[],this.dirtyAttributes=new WeakMap,this.pendingReorderQueue=new Set,this.clipPathUseMap=new WeakMap}return t.prototype.apply=function(n){var r=this,i=n.renderingService,o=n.renderingContext;this.context=n,this.context.svgElementMap=this.svgElementMap;var a=o.root.ownerDocument.defaultView,c=this.context.config.document,s=function(t){var e=t.target;if(r.clipPathUseMap.get(e)){var n=r.defElementManager.getDefElement().querySelector("#".concat(r.getId(e)));n&&n.remove()}r.createSVGDom(c,e,r.$camera)},l=function(t){var e=t.target;r.defElementManager.clear(e.entity),r.clipPathUseMap.delete(e),r.removeSVGDom(e)},u=function(t){var e,n,i=t.parentNode,o=null===(n=null===(e=t.parentNode)||void 0===e?void 0:e.elementSVG)||void 0===n?void 0:n.$groupEl,a=((null==i?void 0:i.children)||[]).slice();o&&r.reorderChildren(c,o,a)},d=function(t){u(t.target)},p=function(t){var e=t.target;if(e.elementSVG){var n=t.attrName,i=r.dirtyAttributes.get(e);i||(r.dirtyAttributes.set(e,[]),i=r.dirtyAttributes.get(e)),i.push(n)}},f=function(t){var n,i=t.target,o=null===(n=i.elementSVG)||void 0===n?void 0:n.$el,a=i.parsedStyle,c=a.fill,s=a.stroke,l=a.clipPath;if(c&&!e.isCSSRGB(c)&&r.defElementManager.createOrUpdateGradientAndPattern(i,o,c,"fill",r),s&&!e.isCSSRGB(s)&&r.defElementManager.createOrUpdateGradientAndPattern(i,o,s,"stroke",r),l){var u=g(v(),i.getWorldTransform()),d=Z+l.entity+"-"+i.entity,p=r.defElementManager.getDefElement().querySelector("#".concat(d));p&&r.applyTransform(p,u)}};i.hooks.init.tap(t.tag,(function(){var t=r.context.config,n=t.background,i=t.document;r.defElementManager.init();var o=r.context.contextService.getContext();n&&(o.style.background=n),o.setAttribute("color-interpolation-filters","sRGB"),r.$camera=L("g",i),r.$camera.id="".concat(J,"-camera"),r.applyTransform(r.$camera,r.context.camera.getOrthoMatrix()),o.appendChild(r.$camera),a.addEventListener(e.ElementEvent.MOUNTED,s),a.addEventListener(e.ElementEvent.UNMOUNTED,l),a.addEventListener(e.ElementEvent.REPARENT,d),a.addEventListener(e.ElementEvent.ATTR_MODIFIED,p),a.addEventListener(e.ElementEvent.BOUNDS_CHANGED,f)})),i.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(e.ElementEvent.MOUNTED,s),a.removeEventListener(e.ElementEvent.UNMOUNTED,l),a.removeEventListener(e.ElementEvent.REPARENT,d),a.removeEventListener(e.ElementEvent.ATTR_MODIFIED,p),a.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,f),N=0,$={}})),i.hooks.render.tap(t.tag,(function(t){r.renderQueue.push(t)})),i.hooks.beginFrame.tap(t.tag,(function(){var t=r.context.config.document;r.pendingReorderQueue.size&&(r.pendingReorderQueue.forEach((function(e){var n,i=((null==e?void 0:e.children)||[]).slice(),o=null===(n=null==e?void 0:e.elementSVG)||void 0===n?void 0:n.$groupEl;o&&r.reorderChildren(t||c,o,i||[])})),r.pendingReorderQueue.clear())})),i.hooks.endFrame.tap(t.tag,(function(){o.renderReasons.has(e.RenderReason.CAMERA_CHANGED)&&r.applyTransform(r.$camera,r.context.camera.getOrthoMatrix()),r.renderQueue.forEach((function(t){var e,n,i=null===(e=t.elementSVG)||void 0===e?void 0:e.$el,o=null===(n=t.elementSVG)||void 0===n?void 0:n.$groupEl;if(i&&o){var a=t.getLocalTransform();r.applyTransform(o,a);var c=r.clipPathUseMap.get(t);c&&c.length&&c.forEach((function(e){r.applyTransform(e,t.getWorldTransform())})),t.renderable.dirty=!1}var s=r.dirtyAttributes.get(t);s&&(s.forEach((function(e){"zIndex"===e?u(t):"increasedLineWidthForHitTesting"===e&&r.createOrUpdateHitArea(t,i,o),r.updateAttribute(t,[e])})),r.dirtyAttributes.delete(t))})),r.renderQueue=[]}))},t.prototype.getId=function(t){return t.id||"".concat(J,"-").concat(t.entity)},t.prototype.reorderChildren=function(t,e,n){if(n.sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})),n.length){var r=(t||document).createDocumentFragment();n.forEach((function(t){if(t.isConnected){var e=t.elementSVG.$groupEl;e&&r.appendChild(e)}})),e.appendChild(r)}},t.prototype.applyTransform=function(t,e){t.setAttribute("transform","matrix(".concat(B(e[0]),",").concat(B(e[1]),",").concat(B(e[4]),",").concat(B(e[5]),",").concat(B(e[12]),",").concat(B(e[13]),")"))},t.prototype.applyAttributes=function(t){var n=t.elementSVG,r=null==n?void 0:n.$el;if(r&&(null==n?void 0:n.$groupEl)){var i=t.nodeName,o=t.attributes;i!==e.Shape.HTML&&r.setAttribute("fill","none"),i===e.Shape.IMAGE&&r.setAttribute("preserveAspectRatio","none"),this.updateAttribute(t,Object.keys(o))}},t.prototype.updateAttribute=function(t,n){var r=this,i=this.context.enableCSSParsing,o=this.context.config.document,a=t.elementSVG,c=a.$el,s=a.$groupEl,l=a.$hitTestingEl,u=t.parsedStyle,d=t.computedStyle,p=t.nodeName;n.some((function(e){return r.context.SVGElementLifeCycleContribution.shouldUpdateElementAttribute(t,e)}))&&c&&[c,l].forEach((function(n){n&&(r.context.SVGElementLifeCycleContribution.updateElementAttribute(t,n,r.svgElementMap),t.nodeName!==e.Shape.TEXT&&r.updateAnchorWithTransform(t))})),n.forEach((function(n){var a,f,h=Y[n],m=i?d[n]:u[n],v=!y(m)&&""+m,g=(null===(a=q[n])||void 0===a?void 0:a[v])||v,b=u[n],E=h&&!!(null===(f=e.propertyMetadataCache[n])||void 0===f?void 0:f.inh);if(p===e.Shape.HTML)"fill"===n?c.style.background=""+b:"stroke"===n?(c.style["border-color"]=""+b,c.style["border-style"]="solid"):"lineWidth"===n?c.style["border-width"]="".concat(b||0,"px"):"lineDash"===n?c.style["border-style"]="dashed":"innerHTML"===n?r.createOrUpdateInnerHTML(o,c,b):"width"===n||"height"===n||"class"===n?c.setAttribute(n,""+b):"x"===n||"y"===n||y(t.style[n])||""===t.style[n]||(c.style[n]=t.style[n]);else{if(!h||(p===e.Shape.GROUP||t.isCustomElement)&&!i&&(E||"fill"===h||"stroke"===h))return;"fill"===n||"stroke"===n?r.defElementManager.createOrUpdateGradientAndPattern(t,c,b,h,r):i&&E?"unset"!==v&&v!==Q[n]?null==s||s.setAttribute(h,g):null==s||s.removeAttribute(h):"clipPath"===n?r.createOrUpdateClipOrTextPath(o,b,t):"textPath"===n?r.createOrUpdateClipOrTextPath(o,b,t,!0):"shadowType"===n||"shadowColor"===n||"shadowBlur"===n||"shadowOffsetX"===n||"shadowOffsetY"===n?r.defElementManager.createOrUpdateShadow(t,c,n):"filter"===n?r.defElementManager.createOrUpdateFilter(t,c,b):"anchor"===n?p!==e.Shape.TEXT&&r.updateAnchorWithTransform(t):y(m)||[c,l].forEach((function(t){t&&h&&("unset"!==v&&v!==Q[n]?t.setAttribute(h,g):t.removeAttribute(h))}))}}))},t.prototype.createSVGDom=function(t,n,r,i){var o;void 0===i&&(i=!1),n.elementSVG=new x;var a=n.elementSVG,c=this.context.SVGElementLifeCycleContribution.createElement(n,this.svgElementMap);if(c){var s=void 0;n.nodeName===e.Shape.HTML&&(n.parsedStyle.$el=c),this.pluginOptions.outputSVGElementId&&(c.id=this.getId(n)),this.pluginOptions.outputSVGElementName&&n.name&&c.setAttribute("name",n.name),!c.hasAttribute("data-wrapgroup")&&"g"===c.nodeName||i?s=c:(s=L("g",t)).appendChild(c),a.$el=c,a.$groupEl=s,this.applyAttributes(n),this.createOrUpdateHitArea(n,c,s);var l=r||n.parentNode&&(null===(o=n.parentNode.elementSVG)||void 0===o?void 0:o.$groupEl);l&&(l.appendChild(s),this.pendingReorderQueue.add(n.parentNode))}},t.prototype.removeSVGDom=function(t){var e,n=null===(e=t.elementSVG)||void 0===e?void 0:e.$groupEl;n&&n.parentNode&&(n.parentNode.removeChild(n),this.context.SVGElementLifeCycleContribution.destroyElement(t,n))},t.prototype.createOrUpdateHitArea=function(t,e,n){var r=t.elementSVG,i=r.$hitTestingEl,o=Number(t.parsedStyle.increasedLineWidthForHitTesting);if(o){if(!i){i=e.cloneNode(),["filter"].forEach((function(t){i.removeAttribute(t)}));var a="none"!==e.getAttribute("fill");i.setAttribute("fill",a?"transparent":"none"),i.setAttribute("stroke","transparent"),n.appendChild(i),r.$hitTestingEl=i,this.svgElementMap.set(i,t)}i.setAttribute("stroke-width","".concat(o+t.parsedStyle.lineWidth))}else i&&(n.removeChild(i),r.$hitTestingEl=null)},t.prototype.createOrUpdateInnerHTML=function(t,e,n){var r=(t||document).createElement("div");"string"==typeof n?r.innerHTML=n:r.appendChild(n),e.innerHTML="",e.appendChild(r)},t.prototype.createOrUpdateClipOrTextPath=function(t,e,n,r){void 0===r&&(r=!1);var i=n.elementSVG.$groupEl,o=r?"g":"clipPath",a=r?"text-path":"clip-path";if(e){var c=(r?K:Z)+e.entity+"-"+n.entity,s=this.defElementManager.getDefElement();if(!s.querySelector("#".concat(c))){var l=void 0;if(r)this.createSVGDom(t,e,null,!0),l=e.elementSVG.$el;else{if(!e.isConnected)s.querySelector("#".concat(this.getId(e)))||this.createSVGDom(t,e,s,!0);l=L(o,t);var u=L("use",t);u.setAttribute("href","#".concat(e.elementSVG.$el.id)),l.appendChild(u);var d=this.clipPathUseMap.get(e);d||(this.clipPathUseMap.set(e,[]),d=this.clipPathUseMap.get(e)),d.push(u),this.applyTransform(u,e.getWorldTransform());var p=g(v(),n.getWorldTransform());this.applyTransform(l,p)}this.pluginOptions.outputSVGElementId&&(l.id=c),s.appendChild(l)}this.applyAttributes(e),r||i.setAttribute(a,"url(#".concat(c,")"))}else r||i.removeAttribute(a)},t.prototype.updateAnchorWithTransform=function(t){var n,r,i=t.getGeometryBounds(),o=i&&2*i.halfExtents[0]||0,a=i&&2*i.halfExtents[1]||0,c=(t.parsedStyle||{}).anchor;[null===(n=t.elementSVG)||void 0===n?void 0:n.$el,null===(r=t.elementSVG)||void 0===r?void 0:r.$hitTestingEl].forEach((function(n){if(n){var r=-c[0]*o,i=-c[1]*a;0===r&&0===i||n.setAttribute("transform","translate(".concat(r,",").concat(i,")")),t.nodeName!==e.Shape.CIRCLE&&t.nodeName!==e.Shape.ELLIPSE||(n.setAttribute("cx","".concat(o/2)),n.setAttribute("cy","".concat(a/2)))}}))},t.tag="SVGRenderer",t}(),et={top:"hanging",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",ideographic:"ideographic",hanging:"hanging"};function nt(t,e,n,r){var i=e.lineWidth,o=e.dx,a=e.dy,c=e.textPath,s=e.textPathSide,l=void 0===s?"left":s,u=e.textPathStartOffset,d=void 0===u?0:u,p=e.textDecorationLine,f=void 0===p?"":p,h=e.textDecorationColor,m=void 0===h?"":h,v=e.textDecorationStyle,g=void 0===v?"":v,y=e.metrics,b=e.textBaseline;r.enableCSSParsing||"alphabetic"!==b||(b="bottom"),t.setAttribute("dominant-baseline",et[b]),t.setAttribute("paint-order","stroke");var E=y.lines,A=y.lineHeight,S=y.height,x=E.length,C="";if(0===o&&0===a||(C+="transform:translate(".concat(o,"px, ").concat(a,"px);")),f&&"none"!==f&&(C+="text-decoration:".concat(f," ").concat(g," ").concat(m,";")),C&&t.setAttribute("style",C),1===x){var w=W(E[0]);if(t.setAttribute("dx","".concat(i/2)),"bottom"!==b&&"top"!==b||(t.setAttribute("dominant-baseline",et.middle),t.setAttribute("dy","bottom"===b?"-".concat(S/2,"px"):"".concat(S/2,"px"))),c){t.innerHTML="";var O=L("textPath",t.ownerDocument);O.setAttribute("href","#".concat(K+c.entity)),"left"!==l&&O.setAttribute("side",l),0!==d&&O.setAttribute("startOffset","".concat(d)),O.innerHTML=w,t.appendChild(O)}else t.innerHTML=w}else t.innerHTML=E.map((function(t,e){var n=0;return 0===e?"middle"===b?n=A/2-S/2:"top"===b||"hanging"===b?n=0:"bottom"!==b&&"alphabetic"!==b&&"ideographic"!==b||(n=-A*(x-1)):n=A,'<tspan x="0" dx="'.concat(i/2,'" dy="').concat(n,'">').concat(W(t),"</tspan>")})).join("")}var rt=((X={})[e.Shape.RECT]="path",X[e.Shape.CIRCLE]="circle",X[e.Shape.ELLIPSE]="ellipse",X[e.Shape.IMAGE]="image",X[e.Shape.GROUP]="g",X[e.Shape.LINE]="line",X[e.Shape.POLYLINE]="polyline",X[e.Shape.POLYGON]="polygon",X[e.Shape.TEXT]="text",X[e.Shape.PATH]="path",X[e.Shape.HTML]="foreignObject",X),it=((z={})[e.Shape.CIRCLE]=["r"],z[e.Shape.ELLIPSE]=["rx","ry"],z[e.Shape.RECT]=["width","height","radius"],z[e.Shape.IMAGE]=["img","width","height"],z[e.Shape.LINE]=["x1","y1","x2","y2","markerStart","markerEnd","markerStartOffset","markerEndOffset"],z[e.Shape.POLYLINE]=["points","markerStart","markerEnd","markerMid","markerStartOffset","markerEndOffset"],z[e.Shape.POLYGON]=["points","markerStart","markerEnd","markerMid","markerStartOffset","markerEndOffset"],z[e.Shape.PATH]=["path","markerStart","markerEnd","markerMid","markerStartOffset","markerEndOffset"],z[e.Shape.TEXT]=["text","font","fontSize","fontFamily","fontStyle","fontWeight","fontVariant","lineHeight","letterSpacing","wordWrap","wordWrapWidth","maxLines","leading","textBaseline","textAlign","textTransform","textOverflow","textPath","textPathSide","textPathStartOffset","textDecorationLine","textDecorationColor","textDecorationStyle","dx","dy"],z),ot=function(){function t(t,e){this.context=t,this.runtime=e}return t.prototype.createElement=function(t,e){var n=L(rt[t.nodeName]||"g",this.context.config.document||document);return e.set(n,t),n},t.prototype.destroyElement=function(t,e){},t.prototype.shouldUpdateElementAttribute=function(t,e){return(it[t.nodeName]||[]).indexOf(e)>-1},t.prototype.updateElementAttribute=function(t){var n=t.elementSVG.$el,r=t.parsedStyle;switch(t.nodeName){case e.Shape.IMAGE:C(n,r);break;case e.Shape.RECT:k(n,r);break;case e.Shape.LINE:w(n,r);break;case e.Shape.POLYGON:case e.Shape.POLYLINE:T(n,r);break;case e.Shape.PATH:O(n,r);break;case e.Shape.TEXT:nt(n,r,0,this.runtime)}},t}(),at=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="svg-renderer",n}return r(e,t),e.prototype.init=function(t){var e=this.options,n=e.outputSVGElementId,r=e.outputSVGElementName,i=new F(this.context),o=new ot(this.context,t);this.context.defaultElementLifeCycleContribution=o,this.context.SVGElementLifeCycleContribution=o;var a={outputSVGElementId:!!y(n)||!!n,outputSVGElementName:!!y(r)||!!r};this.addRenderingPlugin(new tt(a,i,this.context))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultElementLifeCycleContribution,delete this.context.SVGElementLifeCycleContribution},e}(e.AbstractRendererPlugin),ct=Object.freeze({__proto__:null,CLIP_PATH_PREFIX:Z,DEFAULT_VALUE_MAP:Q,DefaultElementLifeCycleContribution:ot,ElementSVG:x,G_SVG_PREFIX:J,Plugin:at,SHAPE2TAGS:rt,SHAPE_UPDATE_DEPS:it,SVGRendererPlugin:tt,SVG_ATTR_MAP:Y,TEXT_PATH_PREFIX:K,createSVGElement:L,updateImageElementAttribute:C,updateLineElementAttribute:w,updatePathElementAttribute:O,updatePolylineElementAttribute:T,updateRectElementAttribute:k,updateTextElementAttribute:nt}),st=function(){function t(t){this.context=t,this.canvasConfig=t.config}return t.prototype.init=function(){var t=this.canvasConfig,n=t.container,r=t.document,i=t.devicePixelRatio;if(this.$container=A(n)?(r||document).getElementById(n):n,this.$container){this.$container.style.position||(this.$container.style.position="relative");var o=L("svg",r);o.setAttribute("width","".concat(this.canvasConfig.width)),o.setAttribute("height","".concat(this.canvasConfig.height)),this.$container.appendChild(o),this.$namespace=o}var a=i||e.isBrowser&&window.devicePixelRatio||1;this.dpr=a=1>a?1:Math.ceil(a)},t.prototype.getDomElement=function(){return this.$namespace},t.prototype.getContext=function(){return this.$namespace},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){var t;return null===(t=this.$namespace)||void 0===t?void 0:t.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$namespace&&this.$namespace.parentNode&&this.$container.removeChild(this.$namespace)},t.prototype.resize=function(t,e){this.$namespace&&(this.$namespace.setAttribute("width","".concat(t)),this.$namespace.setAttribute("height","".concat(e)))},t.prototype.applyCursorStyle=function(t){this.$container&&(this.$container.style.cursor=t)},t.prototype.generateCSSText=function(t,e,n,r,i){void 0===i&&(i={});var a=r.duration,c=r.easing,s=r.delay,l=r.direction,u=r.iterations,d=r.fill;return"@keyframes ".concat(t,"{").concat(n.map((function(t){var e=t.computedOffset,n=o(t,["offset","composite","computedOffset","easing"]),r=Object.keys(n).map((function(t){return"".concat(t,":").concat(i[t]||"").concat(n[t],";")})).join("");return"".concat(100*e,"%{").concat(r,"}")})).join(""),"}")+"".concat(e," {animation: ").concat(t," ").concat(a,"ms ").concat(c," ").concat(s,"ms ").concat(u===1/0?"infinite":u," ").concat(l," ").concat(d,";}")},t.prototype.toDataURL=function(t){return a(this,void 0,void 0,(function(){var t,n,r,i,a,s,l=this;return c(this,(function(c){return t=this.$namespace.cloneNode(!0),n=this.canvasConfig.document,r=0,i=null,this.context.renderingContext.root.forEach((function(a){var c=a.getAnimations();if(c.length){i||(i=(n||document).createElement("style"),t.appendChild(i));var s=a.elementSVG,u="#".concat(s.$el.id),d="#".concat(s.$groupEl.id),p="",f="";c.forEach((function(t){var n=t.effect.getKeyframes();if(n.length){var i=[],a=[],c=n[0],h=o(c,["offset","composite","computedOffset","easing","transformOrigin"]);if(Object.keys(h).forEach((function(t){var n;"transform"===t&&a.push(t),!!(null===(n=e.propertyMetadataCache[t])||void 0===n?void 0:n.inh)?a.push(t):"transform"!==t&&i.push(t)})),a.length){var m=n.map((function(t){var e=t.offset,n=t.composite,r=t.computedOffset,i=t.easing,c=o(t,["offset","composite","computedOffset","easing","transformOrigin"]),s={offset:e,composite:n,computedOffset:r,easing:i};return Object.keys(c).forEach((function(e){a.includes(e)&&(s[e]=t[e])})),s}));f+=l.generateCSSText("a".concat(r++),d,m,t.effect.getComputedTiming(),{transform:s.$groupEl.getAttribute("transform")})}if(i.length){var v=n.map((function(t){var e=t.offset,n=t.composite,r=t.computedOffset,a=t.easing,c=o(t,["offset","composite","computedOffset","easing","transformOrigin"]),s={offset:e,composite:n,computedOffset:r,easing:a};return Object.keys(c).forEach((function(e){i.includes(e)&&(s[e]=t[e])})),s}));p+=l.generateCSSText("a".concat(r++),u,v,t.effect.getComputedTiming())}}})),i.textContent+=p+f}})),a=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),(s=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",a)).replaceChild(t,s.documentElement),[2,"data:image/svg+xml;charset=utf8,".concat(encodeURIComponent((new XMLSerializer).serializeToString(s)))]}))}))},t}(),lt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="svg-context-register",e}return r(e,t),e.prototype.init=function(){this.context.ContextService=st},e.prototype.destroy=function(){delete this.context.ContextService},e}(e.AbstractRendererPlugin),ut=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.registerPlugin(new lt),n.registerPlugin(new at({outputSVGElementId:e.outputSVGElementId})),n.registerPlugin(new u),n.registerPlugin(new f),n}return r(e,t),e}(e.AbstractRenderer);t.DomInteraction=d,t.Renderer=ut,t.SVGPicker=h,t.SVGRenderer=ct}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.SVG={}),t.window.G)}(this,(function(t,e){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},n(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+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)}var i=function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},i.apply(this,arguments)};function o(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);r.length>i;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function a(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function c(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}s((r=r.apply(t,e||[])).next())}))}function c(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&i[3]>c[1])){a.label=c[1];break}if(6===c[0]&&i[1]>a.label){a.label=i[1],i=c;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=e.call(t,a)}catch(t){c=[6,t],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;o>i;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}var u=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var c=o.root.ownerDocument.defaultView,s=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},d=function(t){i.hooks.pointerOver.call(t)},p=function(t){i.hooks.pointerOut.call(t)},f=function(t){i.hooks.pointerCancel.call(t)},h=function(t){i.hooks.pointerWheel.call(t)},m=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):c.supportsPointerEvents&&(t.style.touchAction="none"),c.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",s,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",p,!0),t.addEventListener("pointerover",d,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",f,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",s,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",p,!0),t.addEventListener("mouseover",d,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),c.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",s,!0),t.addEventListener("touchcancel",f,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",m,!0),t.addEventListener("wheel",h,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):c.supportsPointerEvents&&(t.style.touchAction=""),c.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",s,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",p,!0),t.removeEventListener("pointerover",d,!0),n.globalThis.removeEventListener("pointerup",l,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",s,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",p,!0),t.removeEventListener("mouseover",d,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),c.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",s,!0),t.removeEventListener("touchcancel",f,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",m,!0),t.removeEventListener("wheel",h,!0)}))},t.tag="DOMInteraction",t}(),d=function(t){function e(){var e=t.apply(this,l([],s(arguments),!1))||this;return e.name="dom-interaction",e}return r(e,t),e.prototype.init=function(){this.addRenderingPlugin(new u)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(e.AbstractRendererPlugin),p=Object.freeze({__proto__:null,Plugin:d}),f=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.config.document,o=e.renderingService,s=e.svgElementMap;o.hooks.pick.tapPromise(t.tag,(function(t){return a(r,void 0,void 0,(function(){return c(this,(function(e){return[2,this.pick(s,i,t)]}))}))})),o.hooks.pickSync.tap(t.tag,(function(t){return r.pick(s,i,t)}))},t.prototype.pick=function(t,e,n){var r,i,o=n.topmost,a=n.position,c=a.clientX,s=a.clientY;try{var l=[];try{for(var u=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}((e||document).elementsFromPoint(c,s)),d=u.next();!d.done;d=u.next()){var p=t.get(d.value);if(p&&p.isInteractive()&&(l.push(p),o))return n.picked=l,n}}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}n.picked=l}catch(t){n.picked=[]}return n},t.tag="SVGPicker",t}(),h=function(t){function e(){var e=t.apply(this,l([],s(arguments),!1))||this;return e.name="svg-picker",e}return r(e,t),e.prototype.init=function(){this.addRenderingPlugin(new f)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(e.AbstractRendererPlugin),m=Object.freeze({__proto__:null,Plugin:h}),v="undefined"!=typeof Float32Array?Float32Array:Array;function g(){var t=new v(16);return v!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function y(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],s=e[6],l=e[7],u=e[8],d=e[9],p=e[10],f=e[11],h=e[12],m=e[13],v=e[14],g=e[15],y=n*c-r*a,b=n*s-i*a,E=n*l-o*a,A=r*s-i*c,S=r*l-o*c,x=i*l-o*s,C=u*m-d*h,w=u*v-p*h,O=u*g-f*h,T=d*v-p*m,k=d*g-f*m,L=p*g-f*v,G=y*L-b*k+E*T+A*O-S*w+x*C;return G?(t[0]=(c*L-s*k+l*T)*(G=1/G),t[1]=(i*k-r*L-o*T)*G,t[2]=(m*x-v*S+g*A)*G,t[3]=(p*S-d*x-f*A)*G,t[4]=(s*O-a*L-l*w)*G,t[5]=(n*L-i*O+o*w)*G,t[6]=(v*E-h*x-g*b)*G,t[7]=(u*x-p*E+f*b)*G,t[8]=(a*k-c*O+l*C)*G,t[9]=(r*O-n*k-o*C)*G,t[10]=(h*S-m*E+g*y)*G,t[11]=(d*E-u*S-f*y)*G,t[12]=(c*w-a*T-s*C)*G,t[13]=(n*T-r*w+i*C)*G,t[14]=(m*b-h*A-v*y)*G,t[15]=(u*A-d*b+p*y)*G,t):null}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var b=function(t){return null==t},E={}.toString,A=function(t,e){return E.call(t)==="[object "+e+"]"},S=function(t){return A(t,"String")},x=function(t,e,n){return e>t?e:t>n?n:t},C=function(){function t(){}return t.tag="c-svg-element",t}();function w(t,e){var n=e.img,r=void 0===n?"":n,i=e.width,o=e.height;if(t.setAttribute("x","0"),t.setAttribute("y","0"),S(r))t.setAttribute("href",r);else if(r instanceof Image)i||t.setAttribute("width","".concat(r.width)),o||t.setAttribute("height","".concat(r.height)),t.setAttribute("href",r.src);else if(r instanceof HTMLElement&&S(r.nodeName)&&"CANVAS"===r.nodeName.toUpperCase())t.setAttribute("href",r.toDataURL());else if(r instanceof ImageData){var a=document.createElement("canvas");a.setAttribute("width","".concat(r.width)),a.setAttribute("height","".concat(r.height));var c=a.getContext("2d");c&&(c.putImageData(r,0,0),i||t.setAttribute("width","".concat(r.width)),o||t.setAttribute("height","".concat(r.height)),t.setAttribute("href",a.toDataURL()))}}function O(t,n){var r=n.x1,i=n.y1,o=n.x2,a=n.y2,c=n.defX,s=void 0===c?0:c,l=n.defY,u=void 0===l?0:l,d=n.markerStart,p=n.markerEnd,f=n.markerStartOffset,h=n.markerEndOffset,m=0,v=0,g=0,y=0,b=0;d&&e.isDisplayObject(d)&&f&&(m=Math.cos(b=Math.atan2(a-i,o-r))*(f||0),v=Math.sin(b)*(f||0)),p&&e.isDisplayObject(p)&&h&&(g=Math.cos(b=Math.atan2(i-a,r-o))*(h||0),y=Math.sin(b)*(h||0)),t.setAttribute("x1","".concat(r-s+m)),t.setAttribute("y1","".concat(i-u+v)),t.setAttribute("x2","".concat(o-s+g)),t.setAttribute("y2","".concat(a-u+y))}function T(t,n){var r=n.path,i=n.defX,o=void 0===i?0:i,a=n.defY,c=void 0===a?0:a,l=n.markerStart,u=n.markerEnd,d=n.markerStartOffset,p=n.markerEndOffset,f=0,h=0,m=0,v=0,g=0;if(l&&e.isDisplayObject(l)&&d){var y=s(l.parentNode.getStartTangent(),2);f=Math.cos(g=Math.atan2((b=y[0])[1]-(E=y[1])[1],b[0]-E[0]))*(d||0),h=Math.sin(g)*(d||0)}if(u&&e.isDisplayObject(u)&&p){var b,E,A=s(u.parentNode.getEndTangent(),2);m=Math.cos(g=Math.atan2((b=A[0])[1]-(E=A[1])[1],b[0]-E[0]))*(p||0),v=Math.sin(g)*(p||0)}t.setAttribute("d",e.translatePathToString(r.absolutePath,o,c,f,h,m,v))}function k(t,n){var r=n.points.points,i=n.defX,o=void 0===i?0:i,a=n.defY,c=void 0===a?0:a,s=n.markerStart,l=n.markerStartOffset,u=n.markerEnd,d=n.markerEndOffset,p=r.length;if(r&&p>=2){var f=0,h=0,m=0,v=0,g=0;s&&e.isDisplayObject(s)&&l&&(f=Math.cos(g=Math.atan2(r[1][1]-r[0][1],r[1][0]-r[0][0]))*(l||0),h=Math.sin(g)*(l||0)),u&&e.isDisplayObject(u)&&d&&(m=Math.cos(g=Math.atan2(r[p-2][1]-r[p-1][1],r[p-2][0]-r[p-1][0]))*(d||0),v=Math.sin(g)*(d||0)),t.setAttribute("points",r.map((function(t,e){var n=0,r=0;return 0===e?(n=f,r=h):e===p-1&&(n=m,r=v),"".concat(t[0]-o+n,",").concat(t[1]-c+r)})).join(" "))}}function L(t,e){var n=e.radius,r=e.width,i=e.height;if(isFinite(r)&&isFinite(i)){var o="";if(n&&n.some((function(t){return 0!==t}))){var a=s(n.map((function(t){return x(t,0,Math.min(Math.abs(r)/2,Math.abs(i)/2))})),4),c=a[0],l=a[1],u=a[2],d=a[3],p=r>0?1:-1,f=i>0?1:-1,h=p+f!==0?1:0;o=[["M ".concat(p*c,",0")],["l ".concat(r-p*(c+l),",0")],["a ".concat(l,",").concat(l,",0,0,").concat(h,",").concat(p*l,",").concat(f*l)],["l 0,".concat(i-f*(l+u))],["a ".concat(u,",").concat(u,",0,0,").concat(h,",").concat(-p*u,",").concat(f*u)],["l ".concat(p*(u+d)-r,",0")],["a ".concat(d,",").concat(d,",0,0,").concat(h,",").concat(-p*d,",").concat(-f*d)],["l 0,".concat(f*(d+c)-i)],["a ".concat(c,",").concat(c,",0,0,").concat(h,",").concat(p*c,",").concat(-f*c)],["z"]].join(" ")}else o="M 0,0 l ".concat(r,",0 l 0,").concat(i," l").concat(-r," 0 z");t.setAttribute("d",o)}}function G(t,e){return(e||document).createElementNS("http://www.w3.org/2000/svg",t)}var M="g-filter-";function P(t,e,n,r,i){var o=M+n.entity,a=e.querySelectorAll("[name=".concat(o,"]"));if(a.length&&a.forEach((function(t){e.removeChild(t)})),0===i.length)null==r||r.removeAttribute("filter");else{var c=i.map((function(n,r){var i=n.name,a=n.params,c=G("filter",t);return c.setAttribute("filterUnits","userSpaceOnUse"),"blur"===i?function(t,e,n){var r=G("feGaussianBlur",t);r.setAttribute("in","SourceGraphic"),r.setAttribute("stdDeviation","".concat(n[0].value)),e.appendChild(r)}(t,c,a):"brightness"===i?function(t,e,n){var r=D(n[0]);V(t,e,{type:"linear",slope:r,intercept:0})}(t,c,a):"drop-shadow"===i?function(t,e,n){var r=n[0].value,i=n[1].value,o=n[2].value,a=n[3].formatted,c=G("feGaussianBlur",t);c.setAttribute("in","SourceAlpha"),c.setAttribute("stdDeviation","".concat(o)),e.appendChild(c);var s=G("feOffset",t);s.setAttribute("dx","".concat(r)),s.setAttribute("dy","".concat(i)),s.setAttribute("result","offsetblur"),e.appendChild(s);var l=G("feFlood",t);l.setAttribute("flood-color",a),e.appendChild(l);var u=G("feComposite",t);u.setAttribute("in2","offsetblur"),u.setAttribute("operator","in"),e.appendChild(u);var d=G("feMerge",t);e.appendChild(d);var p=G("feMergeNode",t),f=G("feMergeNode",t);f.setAttribute("in","SourceGraphic"),d.appendChild(p),d.appendChild(f)}(t,c,a):"contrast"===i?function(t,e,n){var r=D(n[0]);V(t,e,{type:"linear",slope:r,intercept:-.5*r+.5})}(t,c,a):"grayscale"===i?function(t,e,n){var r=D(n[0]);R(t,e,[.2126+.7874*(1-r),.7152-.7152*(1-r),.0722-.0722*(1-r),0,0,.2126-.2126*(1-r),.7152+.2848*(1-r),.0722-.0722*(1-r),0,0,.2126-.2126*(1-r),.7152-.7152*(1-r),.0722+.9278*(1-r),0,0,0,0,0,1,0])}(t,c,a):"sepia"===i?function(t,e,n){var r=D(n[0]);R(t,e,[.393+.607*(1-r),.769-.769*(1-r),.189-.189*(1-r),0,0,.349-.349*(1-r),.686+.314*(1-r),.168-.168*(1-r),0,0,.272-.272*(1-r),.534-.534*(1-r),.131+.869*(1-r),0,0,0,0,0,1,0])}(t,c,a):"saturate"===i?function(t,e,n){var r=D(n[0]),i=G("feColorMatrix",t);i.setAttribute("type","saturate"),i.setAttribute("values","".concat(r)),e.appendChild(i)}(t,c,a):"hue-rotate"===i?function(t,e,n){var r=G("feColorMatrix",t);r.setAttribute("type","hueRotate"),r.setAttribute("values","".concat(n[0].value)),e.appendChild(r)}(t,c,a):"invert"===i&&function(t,e,n){var r=D(n[0]);V(t,e,{type:"table",tableValues:"".concat(r," ").concat(1-r)})}(t,c,a),c.id="".concat(o,"-").concat(r),c.setAttribute("name",o),e.appendChild(c),c.id}));setTimeout((function(){null==r||r.setAttribute("filter",c.map((function(t){return"url(#".concat(t,")")})).join(" "))}))}}function D(t){return t.unit===e.UnitType.kPercentage?t.value/100:t.value}function V(t,e,n){var r=n.type,i=n.slope,o=n.intercept,a=n.tableValues,c=G("feComponentTransfer",t);[G("feFuncR",t),G("feFuncG",t),G("feFuncB",t)].forEach((function(t){t.setAttribute("type",r),"table"===r?t.setAttribute("tableValues","".concat(a)):(t.setAttribute("slope","".concat(i)),t.setAttribute("intercept","".concat(o))),c.appendChild(t)})),e.appendChild(c)}function R(t,e,n){var r=G("feColorMatrix",t);r.setAttribute("type","matrix"),r.setAttribute("values",n.join(" ")),e.appendChild(r)}var $="g-pattern-",N={},U=0;function I(t,n,r,i,o,a,c,s){if(!o)return"";if(!e.isCSSRGB(o)){if(e.isPattern(o)){var l=function(t,n,r,i,o,a){var c=j(i),s=n.querySelector("#".concat(c));if(!s){var l=i.image,u="";if(S(l)?u=l:e.isBrowser&&(l instanceof HTMLImageElement?u=l.src:l instanceof HTMLCanvasElement&&(u=l.toDataURL())),u){var d,p=G("image",t);p.setAttribute("href",u),o?d=o(u):e.isBrowser&&(d=new window.Image),u.match(/^data:/i)||(d.crossOrigin="Anonymous",p.setAttribute("crossorigin","anonymous")),d.src=u;var f=function(){var e=_(t,n,r,i,c,d.width,d.height);n.appendChild(e),e.appendChild(p),p.setAttribute("x","0"),p.setAttribute("y","0"),p.setAttribute("width","".concat(d.width)),p.setAttribute("height","".concat(d.height))};d.complete?f():d.onload=f}if("rect"===l.nodeName){var h=l.parsedStyle,m=_(t,n,l,i,c,h.width,h.height);l.forEach((function(e){a.createSVGDom(t,e,null);var n=e.elementSVG,r=e.getLocalTransform();a.applyTransform(n.$groupEl,r)})),m.appendChild(l.elementSVG.$groupEl)}}return c}(t,n,r,o,c,s);return i.style[a]="url(#".concat(l,")"),l}if(1===o.length){var u=H(t,r,n,i,o[0]);return null==i||i.setAttribute(a,"url(#".concat(u,")")),u}var d=function(t,e,n,r,i){var o=M+e.entity+"-gradient",a=n.querySelector("#".concat(o));a||((a=G("filter",t)).setAttribute("filterUnits","userSpaceOnUse"),a.setAttribute("x","0%"),a.setAttribute("y","0%"),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.id=o,n.appendChild(a));var c=0;i.forEach((function(i,s){var l=H(t,e,n,r,i),u=l+"_rect",d=G("rect",t);d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width","100%"),d.setAttribute("height","100%"),d.setAttribute("fill","url(#".concat(l,")")),d.id=u,n.appendChild(d);var p=G("feImage",t);if(p.setAttribute("href","#".concat(u)),p.setAttribute("result","".concat(o,"-").concat(s)),a.appendChild(p),s>0){var f=G("feBlend",t);f.setAttribute("in",1===s?"".concat(o,"-").concat(s-1):"".concat(o,"-blended-").concat(c-1)),f.setAttribute("in2","".concat(o,"-").concat(s)),f.setAttribute("result","".concat(o,"-blended-").concat(c++)),f.setAttribute("mode","multiply"),a.appendChild(f)}}));var s=G("feComposite",t);return s.setAttribute("in","".concat(o,"-blended-").concat(c)),s.setAttribute("in2","SourceGraphic"),s.setAttribute("operator","in"),a.appendChild(s),o}(t,r,n,i,o);return null==i||i.setAttribute("filter","url(#".concat(d,")")),null==i||i.setAttribute("fill","black"),d}return"currentColor"===r.style[a]?null==i||i.setAttribute(a,"currentColor"):null==i||i.setAttribute(a,o.isNone?"none":""+o),""}function j(t,n){void 0===n&&(n={});var r="";if(e.isCSSGradientValue(t)){var o=t.type;if(o===e.GradientType.LinearGradient||o===e.GradientType.RadialGradient){var a=i(i({},t.value),n),c=a.width,s=a.height,l=a.steps,u=a.angle,d=a.cx,p=a.cy,f=a.size;r="gradient-".concat(a.type,"-").concat((null==u?void 0:""+u)||0,"-").concat((null==d?void 0:""+d)||0,"-").concat((null==p?void 0:""+p)||0,"-").concat((null==f?void 0:""+f)||0,"-").concat(c,"-").concat(s,"-").concat(l.map((function(t){var e=t.color;return"".concat(t.offset).concat(e)})).join("-"))}}else e.isPattern(t)&&(r=S(t.image)?"pattern-".concat(t.image,"-").concat(t.repetition):"rect"===t.image.nodeName?"pattern-rect-".concat(t.image.entity):"pattern-".concat(U));return r&&(N[r]||(N[r]=$+"".concat(U++))),N[r]}function _(t,n,r,i,o,a,c){var l=i.repetition,u=i.transform,d=G("pattern",t);u&&d.setAttribute("patternTransform",function(t){return e.parseTransform(t).map((function(t){var e=t.t,n=t.d;if("translate"===e)return"translate(".concat(n[0].value," ").concat(n[1].value,")");if("translatex"===e)return"translate(".concat(n[0].value," 0)");if("translatey"===e)return"translate(0 ".concat(n[0].value,")");if("rotate"===e)return"rotate(".concat(n[0].value,")");if("scale"===e){var r=(null==n?void 0:n.map((function(t){return t.value})))||[1,1];return"scale(".concat(r[0],", ").concat(r[1],")")}if("scalex"===e)return r=(null==n?void 0:n.map((function(t){return t.value})))||[1],"scale(".concat(r[0],", 1)");if("scaley"===e)return r=(null==n?void 0:n.map((function(t){return t.value})))||[1],"scale(1, ".concat(r[0],")");if("skew"===e){var i=(null==n?void 0:n.map((function(t){return t.value})))||[0,0];return"skewX(".concat(i[0],") skewY(").concat(i[1],")")}if("skewx"===e)return i=(null==n?void 0:n.map((function(t){return t.value})))||[0],"skewX(".concat(i[0],")");if("skewy"===e)return i=(null==n?void 0:n.map((function(t){return t.value})))||[0],"skewY(".concat(i[0],")");if("matrix"===e){var o=s(n.map((function(t){return t.value})),6),a=o[1],c=o[2],l=o[3],u=o[4],d=o[5];return"matrix(".concat(o[0]," ").concat(a," ").concat(c," ").concat(l," ").concat(u," ").concat(d,")")}})).join(" ")}(u)),d.setAttribute("patternUnits","userSpaceOnUse"),d.id=o,n.appendChild(d),d.setAttribute("x","0"),d.setAttribute("y","0");var p=r.getGeometryBounds().halfExtents,f=a,h=c;return"repeat-x"===l?h=2*p[1]:"repeat-y"===l?f=2*p[0]:"no-repeat"===l&&(f=2*p[0],h=2*p[1]),d.setAttribute("width","".concat(f)),d.setAttribute("height","".concat(h)),d}function H(t,n,r,i,o){var a=n.getGeometryBounds(),c=a&&2*a.halfExtents[0]||0,s=a&&2*a.halfExtents[1]||0,l=j(o,{width:c,height:s}),u=r.querySelector("#".concat(l));if(!u){(u=G(o.type===e.GradientType.LinearGradient?"linearGradient":"radialGradient",t)).setAttribute("gradientUnits","userSpaceOnUse");var d="";o.value.steps.sort((function(t,e){return t.offset.value-e.offset.value})).forEach((function(t){var e=t.color;d+='<stop offset="'.concat(t.offset.value/100,'" stop-color="').concat(e,'"></stop>')})),u.innerHTML=d,u.id=l,r.appendChild(u)}if(o.type===e.GradientType.LinearGradient){var p=e.computeLinearGradient(c,s,o.value.angle),f=p.y1,h=p.x2,m=p.y2;u.setAttribute("x1","".concat(p.x1)),u.setAttribute("y1","".concat(f)),u.setAttribute("x2","".concat(h)),u.setAttribute("y2","".concat(m))}else{var v=o.value,g=e.computeRadialGradient(c,s,v.cx,v.cy,v.size),y=g.y,b=g.r;u.setAttribute("cx","".concat(g.x)),u.setAttribute("cy","".concat(y)),u.setAttribute("r","".concat(b))}return l}var F=/url\("?#(.*)\)/,B=function(){function t(t){this.context=t,this.gradientCache={}}return t.prototype.getDefElement=function(){return this.$def},t.prototype.init=function(){var t=this.context.config.document,e=this.context.contextService.getContext();this.$def=G("defs",t),e.appendChild(this.$def)},t.prototype.clear=function(t){var e=this;Object.keys(this.gradientCache).forEach((function(n){e.clearUnusedDefElement(e.gradientCache,n,t)}))},t.prototype.clearUnusedDefElement=function(t,e,n){if(t[e]&&1===t[e].size&&t[e].has(n)){var r=this.$def.querySelector("#".concat(e));r&&this.$def.removeChild(r)}},t.prototype.createOrUpdateGradientAndPattern=function(t,n,r,i,o){var a=this.context.config,c=a.document,s=a.createImage;if(n){var l=(e.isPattern(r)?n.style[i]:n.getAttribute(i)||"").match(F);l&&l.length>1&&this.clearUnusedDefElement(this.gradientCache,l[1].replace('"',""),t.entity);var u=I(c||document,this.$def,t,n,r,i,s,o);u&&(this.gradientCache[u]||(this.gradientCache[u]=new Set),this.gradientCache[u].add(t.entity))}},t.prototype.createOrUpdateShadow=function(t,e,n){!function(t,e,n,r,i){var o=n.parsedStyle,a=o.shadowType,c=o.shadowBlur,s=o.shadowColor,l=o.shadowOffsetX,u=o.shadowOffsetY,d=!b(s)&&c>0,p="g-filter-dropshadow-"+n.entity,f=e.querySelector("#".concat(p));if(f&&(f.getAttribute("data-type")===a&&d||(f.remove(),f=null)),d){if(null==r||r.setAttribute("filter","url(#".concat(p,")")),!f){if((f=G("filter",t)).setAttribute("data-type",a),"outer"===a)(w=G("feDropShadow",t)).setAttribute("dx","".concat((l||0)/2)),w.setAttribute("dy","".concat((u||0)/2)),w.setAttribute("stdDeviation","".concat((c||0)/4)),w.setAttribute("flood-color",""+s),f.appendChild(w);else if("inner"===a){var h=G("feComponentTransfer",t);h.setAttribute("in","SourceAlpha");var m=G("feFuncA",t);m.setAttribute("type","table"),m.setAttribute("tableValues","1 0"),h.appendChild(m),f.appendChild(h),(S=G("feGaussianBlur",t)).setAttribute("stdDeviation","".concat((c||0)/4)),f.appendChild(S),(x=G("feOffset",t)).setAttribute("dx","".concat((l||0)/2)),x.setAttribute("dy","".concat((u||0)/2)),x.setAttribute("result","offsetblur"),f.appendChild(x),(C=G("feFlood",t)).setAttribute("flood-color",""+s),C.setAttribute("result","color"),f.appendChild(C);var v=G("feComposite",t);v.setAttribute("in2","offsetblur"),v.setAttribute("operator","in"),f.appendChild(v);var g=G("feComposite",t);g.setAttribute("in2","SourceAlpha"),g.setAttribute("operator","in"),f.appendChild(g);var y=G("feMerge",t);f.appendChild(y);var E=G("feMergeNode",t);E.setAttribute("in","SourceGraphic");var A=G("feMergeNode",t);y.appendChild(E),y.appendChild(A)}return f.id=p,f.setAttribute("filterUnits","userSpaceOnUse"),void e.appendChild(f)}if("inner"===a){var S=f.children[1],x=f.children[2],C=f.children[3];"shadowColor"===i?C.setAttribute("flood-color",""+s):"shadowBlur"===i?S.setAttribute("stdDeviation","".concat((c||0)/4)):"shadowOffsetX"===i?x.setAttribute("dx","".concat((l||0)/2)):"shadowOffsetY"===i&&x.setAttribute("dy","".concat((u||0)/2))}else if("outer"===a){var w=f.children[0];"shadowColor"===i?w.setAttribute("flood-color",""+s):"shadowBlur"===i?w.setAttribute("stdDeviation","".concat((c||0)/4)):"shadowOffsetX"===i?w.setAttribute("dx","".concat((l||0)/2)):"shadowOffsetY"===i&&w.setAttribute("dy","".concat((u||0)/2))}}else null==r||r.removeAttribute("filter")}(this.context.config.document||document,this.$def,t,e,n)},t.prototype.createOrUpdateFilter=function(t,e,n){P(this.context.config.document||document,this.$def,t,e,n)},t}();function W(t){return t.toFixed(6).replace(".000000","")}function X(t){return t.replace(/[&|<|>|"|']/g,(function(t){return"&"===t?"&amp;":"<"===t?"&lt;":">"===t?"&gt;":'"'===t?"&quot;":"&apos;"}))}var z,Y,q={opacity:"opacity",fillStyle:"fill",fill:"fill",fillRule:"fill-rule",fillOpacity:"fill-opacity",strokeStyle:"stroke",strokeOpacity:"stroke-opacity",stroke:"stroke",clipPath:"clip-path",textPath:"text-path",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",letterSpacing:"letter-spacing",startArrow:"marker-start",endArrow:"marker-end",class:"class",id:"id",preserveAspectRatio:"preserveAspectRatio",visibility:"visibility",anchor:"anchor",shadowColor:"flood-color",shadowBlur:"stdDeviation",shadowOffsetX:"dx",shadowOffsetY:"dy",filter:"filter",innerHTML:"innerHTML",textAlign:"text-anchor",pointerEvents:"pointer-events"},Q={textAlign:{inherit:"inherit",left:"left",start:"left",center:"middle",right:"end",end:"end"}},J={textAlign:"inherit",lineCap:"butt",lineJoin:"miter",lineWidth:"1px",opacity:"1",fillOpacity:"1",fillRule:"nonzero",strokeOpacity:"1",strokeWidth:"0",strokeMiterLimit:"4",letterSpacing:"0",fontSize:"inherit",fontFamily:"inherit",pointerEvents:"auto"},Z="g-svg",K="clip-path-",tt="text-path-",et=function(){function t(t,e,n){this.pluginOptions=t,this.defElementManager=e,this.context=n,this.svgElementMap=new WeakMap,this.renderQueue=[],this.dirtyAttributes=new WeakMap,this.pendingReorderQueue=new Set,this.clipPathUseMap=new WeakMap}return t.prototype.apply=function(n){var r=this,i=n.renderingService,o=n.renderingContext;this.context=n,this.context.svgElementMap=this.svgElementMap;var a=o.root.ownerDocument.defaultView,c=this.context.config.document,s=function(t){var e=t.target;if(r.clipPathUseMap.get(e)){var n=r.defElementManager.getDefElement().querySelector("#".concat(r.getId(e)));n&&n.remove()}r.createSVGDom(c,e,r.$camera)},l=function(t){var e=t.target;r.defElementManager.clear(e.entity),r.clipPathUseMap.delete(e),r.removeSVGDom(e)},u=function(t){var e,n,i=t.parentNode,o=null===(n=null===(e=t.parentNode)||void 0===e?void 0:e.elementSVG)||void 0===n?void 0:n.$groupEl,a=((null==i?void 0:i.children)||[]).slice();o&&r.reorderChildren(c,o,a)},d=function(t){u(t.target)},p=function(t){var e=t.target;if(e.elementSVG){var n=t.attrName,i=r.dirtyAttributes.get(e);i||(r.dirtyAttributes.set(e,[]),i=r.dirtyAttributes.get(e)),i.push(n)}},f=function(t){var n,i=t.target,o=null===(n=i.elementSVG)||void 0===n?void 0:n.$el,a=i.parsedStyle,c=a.fill,s=a.stroke,l=a.clipPath;if(c&&!e.isCSSRGB(c)&&r.defElementManager.createOrUpdateGradientAndPattern(i,o,c,"fill",r),s&&!e.isCSSRGB(s)&&r.defElementManager.createOrUpdateGradientAndPattern(i,o,s,"stroke",r),l){var u=y(g(),i.getWorldTransform()),d=K+l.entity+"-"+i.entity,p=r.defElementManager.getDefElement().querySelector("#".concat(d));p&&r.applyTransform(p,u)}};i.hooks.init.tap(t.tag,(function(){var t=r.context.config,n=t.background,i=t.document;r.defElementManager.init();var o=r.context.contextService.getContext();n&&(o.style.background=n),o.setAttribute("color-interpolation-filters","sRGB"),r.$camera=G("g",i),r.$camera.id="".concat(Z,"-camera"),r.applyTransform(r.$camera,r.context.camera.getOrthoMatrix()),o.appendChild(r.$camera),a.addEventListener(e.ElementEvent.MOUNTED,s),a.addEventListener(e.ElementEvent.UNMOUNTED,l),a.addEventListener(e.ElementEvent.REPARENT,d),a.addEventListener(e.ElementEvent.ATTR_MODIFIED,p),a.addEventListener(e.ElementEvent.BOUNDS_CHANGED,f)})),i.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(e.ElementEvent.MOUNTED,s),a.removeEventListener(e.ElementEvent.UNMOUNTED,l),a.removeEventListener(e.ElementEvent.REPARENT,d),a.removeEventListener(e.ElementEvent.ATTR_MODIFIED,p),a.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,f),U=0,N={}})),i.hooks.render.tap(t.tag,(function(t){r.renderQueue.push(t)})),i.hooks.beginFrame.tap(t.tag,(function(){var t=r.context.config.document;r.pendingReorderQueue.size&&(r.pendingReorderQueue.forEach((function(e){var n,i=((null==e?void 0:e.children)||[]).slice(),o=null===(n=null==e?void 0:e.elementSVG)||void 0===n?void 0:n.$groupEl;o&&r.reorderChildren(t||c,o,i||[])})),r.pendingReorderQueue.clear())})),i.hooks.endFrame.tap(t.tag,(function(){o.renderReasons.has(e.RenderReason.CAMERA_CHANGED)&&r.applyTransform(r.$camera,r.context.camera.getOrthoMatrix()),r.renderQueue.forEach((function(t){var e,n,i=null===(e=t.elementSVG)||void 0===e?void 0:e.$el,o=null===(n=t.elementSVG)||void 0===n?void 0:n.$groupEl;if(i&&o){var a=t.getLocalTransform();r.applyTransform(o,a);var c=r.clipPathUseMap.get(t);c&&c.length&&c.forEach((function(e){r.applyTransform(e,t.getWorldTransform())})),t.renderable.dirty=!1}var s=r.dirtyAttributes.get(t);s&&(s.forEach((function(e){"zIndex"===e?u(t):"increasedLineWidthForHitTesting"===e&&r.createOrUpdateHitArea(t,i,o),r.updateAttribute(t,[e])})),r.dirtyAttributes.delete(t))})),r.renderQueue=[]}))},t.prototype.getId=function(t){return t.id||"".concat(Z,"-").concat(t.entity)},t.prototype.reorderChildren=function(t,e,n){if(n.sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})),n.length){var r=(t||document).createDocumentFragment();n.forEach((function(t){if(t.isConnected){var e=t.elementSVG.$groupEl;e&&r.appendChild(e)}})),e.appendChild(r)}},t.prototype.applyTransform=function(t,e){t.setAttribute("transform","matrix(".concat(W(e[0]),",").concat(W(e[1]),",").concat(W(e[4]),",").concat(W(e[5]),",").concat(W(e[12]),",").concat(W(e[13]),")"))},t.prototype.applyAttributes=function(t){var n=t.elementSVG,r=null==n?void 0:n.$el;if(r&&(null==n?void 0:n.$groupEl)){var i=t.nodeName,o=t.attributes;i!==e.Shape.HTML&&r.setAttribute("fill","none"),i===e.Shape.IMAGE&&r.setAttribute("preserveAspectRatio","none"),this.updateAttribute(t,Object.keys(o))}},t.prototype.updateAttribute=function(t,n){var r=this,i=this.context.enableCSSParsing,o=this.context.config.document,a=t.elementSVG,c=a.$el,s=a.$groupEl,l=a.$hitTestingEl,u=t.parsedStyle,d=t.computedStyle,p=t.nodeName;n.some((function(e){return r.context.SVGElementLifeCycleContribution.shouldUpdateElementAttribute(t,e)}))&&c&&[c,l].forEach((function(n){n&&(r.context.SVGElementLifeCycleContribution.updateElementAttribute(t,n,r.svgElementMap),t.nodeName!==e.Shape.TEXT&&r.updateAnchorWithTransform(t))})),n.forEach((function(n){var a,f,h=q[n],m=i?d[n]:u[n],v=!b(m)&&""+m,g=(null===(a=Q[n])||void 0===a?void 0:a[v])||v,y=u[n],E=h&&!!(null===(f=e.propertyMetadataCache[n])||void 0===f?void 0:f.inh);if(p===e.Shape.HTML)"fill"===n?c.style.background=""+y:"stroke"===n?(c.style["border-color"]=""+y,c.style["border-style"]="solid"):"lineWidth"===n?c.style["border-width"]="".concat(y||0,"px"):"lineDash"===n?c.style["border-style"]="dashed":"innerHTML"===n?r.createOrUpdateInnerHTML(o,c,y):"width"===n||"height"===n||"class"===n?c.setAttribute(n,""+y):"x"===n||"y"===n||b(t.style[n])||""===t.style[n]||(c.style[n]=t.style[n]);else{if(!h||(p===e.Shape.GROUP||t.isCustomElement)&&!i&&(E||"fill"===h||"stroke"===h))return;"fill"===n||"stroke"===n?r.defElementManager.createOrUpdateGradientAndPattern(t,c,y,h,r):i&&E?"unset"!==v&&v!==J[n]?null==s||s.setAttribute(h,g):null==s||s.removeAttribute(h):"clipPath"===n?r.createOrUpdateClipOrTextPath(o,y,t):"textPath"===n?r.createOrUpdateClipOrTextPath(o,y,t,!0):"shadowType"===n||"shadowColor"===n||"shadowBlur"===n||"shadowOffsetX"===n||"shadowOffsetY"===n?r.defElementManager.createOrUpdateShadow(t,c,n):"filter"===n?r.defElementManager.createOrUpdateFilter(t,c,y):"anchor"===n?p!==e.Shape.TEXT&&r.updateAnchorWithTransform(t):b(m)||[c,l].forEach((function(t){t&&h&&("unset"!==v&&v!==J[n]?t.setAttribute(h,g):t.removeAttribute(h))}))}}))},t.prototype.createSVGDom=function(t,n,r,i){var o;void 0===i&&(i=!1),n.elementSVG=new C;var a=n.elementSVG,c=this.context.SVGElementLifeCycleContribution.createElement(n,this.svgElementMap);if(c){var s=void 0;n.nodeName===e.Shape.HTML&&(n.parsedStyle.$el=c),this.pluginOptions.outputSVGElementId&&(c.id=this.getId(n)),this.pluginOptions.outputSVGElementName&&n.name&&c.setAttribute("name",n.name),!c.hasAttribute("data-wrapgroup")&&"g"===c.nodeName||i?s=c:(s=G("g",t)).appendChild(c),a.$el=c,a.$groupEl=s,this.applyAttributes(n),this.createOrUpdateHitArea(n,c,s);var l=r||n.parentNode&&(null===(o=n.parentNode.elementSVG)||void 0===o?void 0:o.$groupEl);l&&(l.appendChild(s),this.pendingReorderQueue.add(n.parentNode))}},t.prototype.removeSVGDom=function(t){var e,n=null===(e=t.elementSVG)||void 0===e?void 0:e.$groupEl;n&&n.parentNode&&(n.parentNode.removeChild(n),this.context.SVGElementLifeCycleContribution.destroyElement(t,n))},t.prototype.createOrUpdateHitArea=function(t,e,n){var r=t.elementSVG,i=r.$hitTestingEl,o=Number(t.parsedStyle.increasedLineWidthForHitTesting);if(o){if(!i){i=e.cloneNode(),["filter"].forEach((function(t){i.removeAttribute(t)}));var a="none"!==e.getAttribute("fill");i.setAttribute("fill",a?"transparent":"none"),i.setAttribute("stroke","transparent"),n.appendChild(i),r.$hitTestingEl=i,this.svgElementMap.set(i,t)}i.setAttribute("stroke-width","".concat(o+t.parsedStyle.lineWidth))}else i&&(n.removeChild(i),r.$hitTestingEl=null)},t.prototype.createOrUpdateInnerHTML=function(t,e,n){var r=(t||document).createElement("div");"string"==typeof n?r.innerHTML=n:r.appendChild(n),e.innerHTML="",e.appendChild(r)},t.prototype.createOrUpdateClipOrTextPath=function(t,e,n,r){void 0===r&&(r=!1);var i=n.elementSVG.$groupEl,o=r?"g":"clipPath",a=r?"text-path":"clip-path";if(e){var c=(r?tt:K)+e.entity+"-"+n.entity,s=this.defElementManager.getDefElement();if(!s.querySelector("#".concat(c))){var l=void 0;if(r)this.createSVGDom(t,e,null,!0),l=e.elementSVG.$el;else{if(!e.isConnected)s.querySelector("#".concat(this.getId(e)))||this.createSVGDom(t,e,s,!0);l=G(o,t);var u=G("use",t);u.setAttribute("href","#".concat(e.elementSVG.$el.id)),l.appendChild(u);var d=this.clipPathUseMap.get(e);d||(this.clipPathUseMap.set(e,[]),d=this.clipPathUseMap.get(e)),d.push(u),this.applyTransform(u,e.getWorldTransform());var p=y(g(),n.getWorldTransform());this.applyTransform(l,p)}this.pluginOptions.outputSVGElementId&&(l.id=c),s.appendChild(l)}this.applyAttributes(e),r||i.setAttribute(a,"url(#".concat(c,")"))}else r||i.removeAttribute(a)},t.prototype.updateAnchorWithTransform=function(t){var n,r,i=t.getGeometryBounds(),o=i&&2*i.halfExtents[0]||0,a=i&&2*i.halfExtents[1]||0,c=(t.parsedStyle||{}).anchor;[null===(n=t.elementSVG)||void 0===n?void 0:n.$el,null===(r=t.elementSVG)||void 0===r?void 0:r.$hitTestingEl].forEach((function(n){if(n){var r=-c[0]*o,i=-c[1]*a;0===r&&0===i||n.setAttribute("transform","translate(".concat(r,",").concat(i,")")),t.nodeName!==e.Shape.CIRCLE&&t.nodeName!==e.Shape.ELLIPSE||(n.setAttribute("cx","".concat(o/2)),n.setAttribute("cy","".concat(a/2)))}}))},t.tag="SVGRenderer",t}(),nt={top:"hanging",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",ideographic:"ideographic",hanging:"hanging"};function rt(t,e,n,r){var i=e.lineWidth,o=e.dx,a=e.dy,c=e.textPath,s=e.textPathSide,l=void 0===s?"left":s,u=e.textPathStartOffset,d=void 0===u?0:u,p=e.textDecorationLine,f=void 0===p?"":p,h=e.textDecorationColor,m=void 0===h?"":h,v=e.textDecorationStyle,g=void 0===v?"":v,y=e.metrics,b=e.textBaseline;r.enableCSSParsing||"alphabetic"!==b||(b="bottom"),t.setAttribute("dominant-baseline",nt[b]),t.setAttribute("paint-order","stroke");var E=y.lines,A=y.lineHeight,S=y.height,x=E.length,C="";if(0===o&&0===a||(C+="transform:translate(".concat(o,"px, ").concat(a,"px);")),f&&"none"!==f&&(C+="text-decoration:".concat(f," ").concat(g," ").concat(m,";")),C&&t.setAttribute("style",C),1===x){var w=X(E[0]);if(t.setAttribute("dx","".concat(i/2)),"bottom"!==b&&"top"!==b||(t.setAttribute("dominant-baseline",nt.middle),t.setAttribute("dy","bottom"===b?"-".concat(S/2,"px"):"".concat(S/2,"px"))),c){t.innerHTML="";var O=G("textPath",t.ownerDocument);O.setAttribute("href","#".concat(tt+c.entity)),"left"!==l&&O.setAttribute("side",l),0!==d&&O.setAttribute("startOffset","".concat(d)),O.innerHTML=w,t.appendChild(O)}else t.innerHTML=w}else t.innerHTML=E.map((function(t,e){var n=0;return 0===e?"middle"===b?n=A/2-S/2:"top"===b||"hanging"===b?n=0:"bottom"!==b&&"alphabetic"!==b&&"ideographic"!==b||(n=-A*(x-1)):n=A,'<tspan x="0" dx="'.concat(i/2,'" dy="').concat(n,'">').concat(X(t),"</tspan>")})).join("")}var it=((z={})[e.Shape.RECT]="path",z[e.Shape.CIRCLE]="circle",z[e.Shape.ELLIPSE]="ellipse",z[e.Shape.IMAGE]="image",z[e.Shape.GROUP]="g",z[e.Shape.LINE]="line",z[e.Shape.POLYLINE]="polyline",z[e.Shape.POLYGON]="polygon",z[e.Shape.TEXT]="text",z[e.Shape.PATH]="path",z[e.Shape.HTML]="foreignObject",z),ot=((Y={})[e.Shape.CIRCLE]=["r"],Y[e.Shape.ELLIPSE]=["rx","ry"],Y[e.Shape.RECT]=["width","height","radius"],Y[e.Shape.IMAGE]=["img","width","height"],Y[e.Shape.LINE]=["x1","y1","x2","y2","markerStart","markerEnd","markerStartOffset","markerEndOffset"],Y[e.Shape.POLYLINE]=["points","markerStart","markerEnd","markerMid","markerStartOffset","markerEndOffset"],Y[e.Shape.POLYGON]=["points","markerStart","markerEnd","markerMid","markerStartOffset","markerEndOffset"],Y[e.Shape.PATH]=["path","markerStart","markerEnd","markerMid","markerStartOffset","markerEndOffset"],Y[e.Shape.TEXT]=["text","font","fontSize","fontFamily","fontStyle","fontWeight","fontVariant","lineHeight","letterSpacing","wordWrap","wordWrapWidth","maxLines","leading","textBaseline","textAlign","textTransform","textOverflow","textPath","textPathSide","textPathStartOffset","textDecorationLine","textDecorationColor","textDecorationStyle","dx","dy"],Y),at=function(){function t(t,e){this.context=t,this.runtime=e}return t.prototype.createElement=function(t,e){var n=G(it[t.nodeName]||"g",this.context.config.document||document);return e.set(n,t),n},t.prototype.destroyElement=function(t,e){},t.prototype.shouldUpdateElementAttribute=function(t,e){return(ot[t.nodeName]||[]).indexOf(e)>-1},t.prototype.updateElementAttribute=function(t){var n=t.elementSVG.$el,r=t.parsedStyle;switch(t.nodeName){case e.Shape.IMAGE:w(n,r);break;case e.Shape.RECT:L(n,r);break;case e.Shape.LINE:O(n,r);break;case e.Shape.POLYGON:case e.Shape.POLYLINE:k(n,r);break;case e.Shape.PATH:T(n,r);break;case e.Shape.TEXT:rt(n,r,0,this.runtime)}},t}(),ct=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="svg-renderer",n}return r(e,t),e.prototype.init=function(t){var e=this.options,n=e.outputSVGElementId,r=e.outputSVGElementName,i=new B(this.context),o=new at(this.context,t);this.context.defaultElementLifeCycleContribution=o,this.context.SVGElementLifeCycleContribution=o;var a={outputSVGElementId:!!b(n)||!!n,outputSVGElementName:!!b(r)||!!r};this.addRenderingPlugin(new et(a,i,this.context))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultElementLifeCycleContribution,delete this.context.SVGElementLifeCycleContribution},e}(e.AbstractRendererPlugin),st=Object.freeze({__proto__:null,CLIP_PATH_PREFIX:K,DEFAULT_VALUE_MAP:J,DefaultElementLifeCycleContribution:at,ElementSVG:C,G_SVG_PREFIX:Z,Plugin:ct,SHAPE2TAGS:it,SHAPE_UPDATE_DEPS:ot,SVGRendererPlugin:et,SVG_ATTR_MAP:q,TEXT_PATH_PREFIX:tt,createSVGElement:G,updateImageElementAttribute:w,updateLineElementAttribute:O,updatePathElementAttribute:T,updatePolylineElementAttribute:k,updateRectElementAttribute:L,updateTextElementAttribute:rt}),lt=function(){function t(t){this.context=t,this.canvasConfig=t.config}return t.prototype.init=function(){var t=this.canvasConfig,n=t.container,r=t.document,i=t.devicePixelRatio;if(this.$container=S(n)?(r||document).getElementById(n):n,this.$container){this.$container.style.position||(this.$container.style.position="relative");var o=G("svg",r);o.setAttribute("width","".concat(this.canvasConfig.width)),o.setAttribute("height","".concat(this.canvasConfig.height)),this.$container.appendChild(o),this.$namespace=o}var a=i||e.isBrowser&&window.devicePixelRatio||1;this.dpr=a=1>a?1:Math.ceil(a)},t.prototype.getDomElement=function(){return this.$namespace},t.prototype.getContext=function(){return this.$namespace},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){var t;return null===(t=this.$namespace)||void 0===t?void 0:t.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$namespace&&this.$namespace.parentNode&&this.$container.removeChild(this.$namespace)},t.prototype.resize=function(t,e){this.$namespace&&(this.$namespace.setAttribute("width","".concat(t)),this.$namespace.setAttribute("height","".concat(e)))},t.prototype.applyCursorStyle=function(t){this.$container&&(this.$container.style.cursor=t)},t.prototype.generateCSSText=function(t,e,n,r,i){void 0===i&&(i={});var a=r.duration,c=r.easing,s=r.delay,l=r.direction,u=r.iterations,d=r.fill;return"@keyframes ".concat(t,"{").concat(n.map((function(t){var e=t.computedOffset,n=o(t,["offset","composite","computedOffset","easing"]),r=Object.keys(n).map((function(t){return"".concat(t,":").concat(i[t]||"").concat(n[t],";")})).join("");return"".concat(100*e,"%{").concat(r,"}")})).join(""),"}")+"".concat(e," {animation: ").concat(t," ").concat(a,"ms ").concat(c," ").concat(s,"ms ").concat(u===1/0?"infinite":u," ").concat(l," ").concat(d,";}")},t.prototype.toDataURL=function(t){return a(this,void 0,void 0,(function(){var t,n,r,i,a,s,l=this;return c(this,(function(c){return t=this.$namespace.cloneNode(!0),n=this.canvasConfig.document,r=0,i=null,this.context.renderingContext.root.forEach((function(a){var c=a.getAnimations();if(c.length){i||(i=(n||document).createElement("style"),t.appendChild(i));var s=a.elementSVG,u="#".concat(s.$el.id),d="#".concat(s.$groupEl.id),p="",f="";c.forEach((function(t){var n=t.effect.getKeyframes();if(n.length){var i=[],a=[],c=n[0],h=o(c,["offset","composite","computedOffset","easing","transformOrigin"]);if(Object.keys(h).forEach((function(t){var n;"transform"===t&&a.push(t),!!(null===(n=e.propertyMetadataCache[t])||void 0===n?void 0:n.inh)?a.push(t):"transform"!==t&&i.push(t)})),a.length){var m=n.map((function(t){var e=t.offset,n=t.composite,r=t.computedOffset,i=t.easing,c=o(t,["offset","composite","computedOffset","easing","transformOrigin"]),s={offset:e,composite:n,computedOffset:r,easing:i};return Object.keys(c).forEach((function(e){a.includes(e)&&(s[e]=t[e])})),s}));f+=l.generateCSSText("a".concat(r++),d,m,t.effect.getComputedTiming(),{transform:s.$groupEl.getAttribute("transform")})}if(i.length){var v=n.map((function(t){var e=t.offset,n=t.composite,r=t.computedOffset,a=t.easing,c=o(t,["offset","composite","computedOffset","easing","transformOrigin"]),s={offset:e,composite:n,computedOffset:r,easing:a};return Object.keys(c).forEach((function(e){i.includes(e)&&(s[e]=t[e])})),s}));p+=l.generateCSSText("a".concat(r++),u,v,t.effect.getComputedTiming())}}})),i.textContent+=p+f}})),a=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),(s=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",a)).replaceChild(t,s.documentElement),[2,"data:image/svg+xml;charset=utf8,".concat(encodeURIComponent((new XMLSerializer).serializeToString(s)))]}))}))},t}(),ut=function(t){function e(){var e=t.apply(this,l([],s(arguments),!1))||this;return e.name="svg-context-register",e}return r(e,t),e.prototype.init=function(){this.context.ContextService=lt},e.prototype.destroy=function(){delete this.context.ContextService},e}(e.AbstractRendererPlugin),dt=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;return n.registerPlugin(new ut),n.registerPlugin(new ct({outputSVGElementId:e.outputSVGElementId})),n.registerPlugin(new d),n.registerPlugin(new h),n}return r(e,t),e}(e.AbstractRenderer);t.DomInteraction=p,t.Renderer=dt,t.SVGPicker=m,t.SVGRenderer=st}));
//# sourceMappingURL=index.umd.min.js.map
{
"name": "@antv/g-svg",
"version": "1.10.23",
"version": "1.10.24",
"description": "A renderer implemented by SVG",

@@ -37,6 +37,6 @@ "keywords": [

"tslib": "^2.5.3",
"@antv/g-lite": "1.2.19",
"@antv/g-plugin-dom-interaction": "1.9.19",
"@antv/g-plugin-svg-picker": "1.9.23",
"@antv/g-plugin-svg-renderer": "1.10.23"
"@antv/g-lite": "1.2.20",
"@antv/g-plugin-dom-interaction": "1.9.20",
"@antv/g-plugin-svg-picker": "1.9.24",
"@antv/g-plugin-svg-renderer": "1.10.24"
},

@@ -43,0 +43,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc