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.26-next.0 to 1.10.26-next.1

2

dist/index.umd.min.js

@@ -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}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.y,o=e.width,a=e.height;if(t.setAttribute("x","".concat(e.x)),t.setAttribute("y","".concat(i)),S(r))t.setAttribute("href",r);else if(r instanceof Image)o||t.setAttribute("width","".concat(r.width)),a||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 c=document.createElement("canvas");c.setAttribute("width","".concat(r.width)),c.setAttribute("height","".concat(r.height));var s=c.getContext("2d");s&&(s.putImageData(r,0,0),o||t.setAttribute("width","".concat(r.width)),a||t.setAttribute("height","".concat(r.height)),t.setAttribute("href",c.toDataURL()))}}function O(t,n){var r=n.x1,i=n.y1,o=n.x2,a=n.y2,c=n.markerStart,s=n.markerEnd,l=n.markerStartOffset,u=n.markerEndOffset,d=0,p=0,f=0,h=0,m=0;c&&e.isDisplayObject(c)&&l&&(d=Math.cos(m=Math.atan2(a-i,o-r))*(l||0),p=Math.sin(m)*(l||0)),s&&e.isDisplayObject(s)&&u&&(f=Math.cos(m=Math.atan2(i-a,r-o))*(u||0),h=Math.sin(m)*(u||0)),t.setAttribute("x1","".concat(r+d)),t.setAttribute("y1","".concat(i+p)),t.setAttribute("x2","".concat(o+f)),t.setAttribute("y2","".concat(a+h))}function T(t,n){var r=n.path,i=n.markerStart,o=n.markerEnd,a=n.markerStartOffset,c=n.markerEndOffset,l=0,u=0,d=0,p=0,f=0;if(i&&e.isDisplayObject(i)&&a){var h=s(i.parentNode.getStartTangent(),2);l=Math.cos(f=Math.atan2((m=h[0])[1]-(v=h[1])[1],m[0]-v[0]))*(a||0),u=Math.sin(f)*(a||0)}if(o&&e.isDisplayObject(o)&&c){var m,v,g=s(o.parentNode.getEndTangent(),2);d=Math.cos(f=Math.atan2((m=g[0])[1]-(v=g[1])[1],m[0]-v[0]))*(c||0),p=Math.sin(f)*(c||0)}t.setAttribute("d",e.translatePathToString(r.absolutePath,l,u,d,p))}function k(t,n){var r=n.points.points,i=n.markerStart,o=n.markerStartOffset,a=n.markerEnd,c=n.markerEndOffset,s=r.length;if(r&&s>=2){var l=0,u=0,d=0,p=0,f=0;i&&e.isDisplayObject(i)&&o&&(l=Math.cos(f=Math.atan2(r[1][1]-r[0][1],r[1][0]-r[0][0]))*(o||0),u=Math.sin(f)*(o||0)),a&&e.isDisplayObject(a)&&c&&(d=Math.cos(f=Math.atan2(r[s-2][1]-r[s-1][1],r[s-2][0]-r[s-1][0]))*(c||0),p=Math.sin(f)*(c||0)),t.setAttribute("points",r.map((function(t,e){var n=0,r=0;return 0===e?(n=l,r=u):e===s-1&&(n=d,r=p),"".concat(t[0]+n,",").concat(t[1]+r)})).join(" "))}}function L(t,e){var n=e.radius,r=e.x,i=e.y,o=e.width,a=e.height;if(isFinite(o)&&isFinite(a)){var c="";if(n&&n.some((function(t){return 0!==t}))){var l=s(n.map((function(t){return x(t,0,Math.min(Math.abs(o)/2,Math.abs(a)/2))})),4),u=l[0],d=l[1],p=l[2],f=l[3],h=o>0?1:-1,m=a>0?1:-1,v=h+m!==0?1:0;c=[["M ".concat(h*u+r,",").concat(i)],["l ".concat(o-h*(u+d),",0")],["a ".concat(d,",").concat(d,",0,0,").concat(v,",").concat(h*d,",").concat(m*d)],["l 0,".concat(a-m*(d+p))],["a ".concat(p,",").concat(p,",0,0,").concat(v,",").concat(-h*p,",").concat(m*p)],["l ".concat(h*(p+f)-o,",0")],["a ".concat(f,",").concat(f,",0,0,").concat(v,",").concat(-h*f,",").concat(-m*f)],["l 0,".concat(m*(f+u)-a)],["a ".concat(u,",").concat(u,",0,0,").concat(v,",").concat(h*u,",").concat(-m*u)],["z"]].join(" ")}else c="M ".concat(r,",").concat(i," l ").concat(o,",0 l 0,").concat(a," l").concat(-o," 0 z");t.setAttribute("d",c)}}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);var p=r.getGeometryBounds(),f=p.halfExtents,h=p.min;d.setAttribute("x","".concat(h[0])),d.setAttribute("y","".concat(h[1]));var m=a,v=c;return"repeat-x"===l?v=2*f[1]:"repeat-y"===l?m=2*f[0]:"no-repeat"===l&&(m=2*f[0],v=2*f[1]),d.setAttribute("width","".concat(m)),d.setAttribute("height","".concat(v)),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=a&&a.min||[0,0],u=j(o,{width:c,height:s}),d=r.querySelector("#".concat(u));if(!d){(d=G(o.type===e.GradientType.LinearGradient?"linearGradient":"radialGradient",t)).setAttribute("gradientUnits","userSpaceOnUse");var p="";o.value.steps.sort((function(t,e){return t.offset.value-e.offset.value})).forEach((function(t){var e=t.color;p+='<stop offset="'.concat(t.offset.value/100,'" stop-color="').concat(e,'"></stop>')})),d.innerHTML=p,d.id=u,r.appendChild(d)}if(o.type===e.GradientType.LinearGradient){var f=e.computeLinearGradient([l[0],l[1]],c,s,o.value.angle),h=f.y1,m=f.x2,v=f.y2;d.setAttribute("x1","".concat(f.x1)),d.setAttribute("y1","".concat(h)),d.setAttribute("x2","".concat(m)),d.setAttribute("y2","".concat(v))}else{var g=o.value,y=e.computeRadialGradient([l[0],l[1]],c,s,g.cx,g.cy,g.size),b=y.y,E=y.r;d.setAttribute("cx","".concat(y.x)),d.setAttribute("cy","".concat(b)),d.setAttribute("r","".concat(E))}return u}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 z(t){return t.replace(/[&|<|>|"|']/g,(function(t){return"&"===t?"&amp;":"<"===t?"&lt;":">"===t?"&gt;":'"'===t?"&quot;":"&apos;"}))}var X,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",cx:"cx",cy:"cy",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):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 e,n,r=t.getGeometryBounds(),i=r&&2*r.halfExtents[0]||0,o=r&&2*r.halfExtents[1]||0,a=(t.parsedStyle||{}).anchor;[null===(e=t.elementSVG)||void 0===e?void 0:e.$el,null===(n=t.elementSVG)||void 0===n?void 0:n.$hitTestingEl].forEach((function(t){if(t){var e=-a[0]*i,n=-a[1]*o;0===e&&0===n||t.setAttribute("transform","translate(".concat(e,",").concat(n,")"))}}))},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.x,a=void 0===o?0:o,c=e.y,s=void 0===c?0:c,l=e.dx,u=e.dy,d=e.textPath,p=e.textPathSide,f=void 0===p?"left":p,h=e.textPathStartOffset,m=void 0===h?0:h,v=e.textDecorationLine,g=void 0===v?"":v,y=e.textDecorationColor,b=void 0===y?"":y,E=e.textDecorationStyle,A=void 0===E?"":E,S=e.metrics,x=e.textBaseline;r.enableCSSParsing||"alphabetic"!==x||(x="bottom"),t.setAttribute("dominant-baseline",nt[x]),t.setAttribute("paint-order","stroke");var C=S.lines,w=S.lineHeight,O=S.height,T=C.length,k="";if(0===l&&0===u||(k+="transform:translate(".concat(l,"px, ").concat(u,"px);")),g&&"none"!==g&&(k+="text-decoration:".concat(g," ").concat(A," ").concat(b,";")),k&&t.setAttribute("style",k),0!==a&&t.setAttribute("x","".concat(a)),0!==s&&t.setAttribute("y","".concat(s)),1===T){var L=z(C[0]);if(t.setAttribute("dx","".concat(i/2)),"bottom"!==x&&"top"!==x||(t.setAttribute("dominant-baseline",nt.middle),t.setAttribute("dy","bottom"===x?"-".concat(O/2,"px"):"".concat(O/2,"px"))),d){t.innerHTML="";var M=G("textPath",t.ownerDocument);M.setAttribute("href","#".concat(tt+d.entity)),"left"!==f&&M.setAttribute("side",f),0!==m&&M.setAttribute("startOffset","".concat(m)),M.innerHTML=L,t.appendChild(M)}else t.innerHTML=L}else t.innerHTML=C.map((function(t,e){var n=i/2,r=0;return 0===e?"middle"===x?r=w/2-O/2:"top"===x||"hanging"===x?r=0:"bottom"!==x&&"alphabetic"!==x&&"ideographic"!==x||(r=-w*(T-1)):r=w,"<tspan x=".concat(a,' dx="').concat(n,'" dy="').concat(r,'">').concat(z(t),"</tspan>")})).join("")}var it=((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),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}));
!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,k=d*v-p*m,T=d*g-f*m,L=p*g-f*v,M=y*L-b*T+E*k+A*O-S*w+x*C;return M?(t[0]=(c*L-s*T+l*k)*(M=1/M),t[1]=(i*T-r*L-o*k)*M,t[2]=(m*x-v*S+g*A)*M,t[3]=(p*S-d*x-f*A)*M,t[4]=(s*O-a*L-l*w)*M,t[5]=(n*L-i*O+o*w)*M,t[6]=(v*E-h*x-g*b)*M,t[7]=(u*x-p*E+f*b)*M,t[8]=(a*T-c*O+l*C)*M,t[9]=(r*O-n*T-o*C)*M,t[10]=(h*S-m*E+g*y)*M,t[11]=(d*E-u*S-f*y)*M,t[12]=(c*w-a*k-s*C)*M,t[13]=(n*k-r*w+i*C)*M,t[14]=(m*b-h*A-v*y)*M,t[15]=(u*A-d*b+p*y)*M,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.x,o=e.y,a=void 0===o?0:o,c=e.width,s=e.height;if(t.setAttribute("x","".concat(void 0===i?0:i)),t.setAttribute("y","".concat(a)),S(r))t.setAttribute("href",r);else if(r instanceof Image)c||t.setAttribute("width","".concat(r.width)),s||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 l=document.createElement("canvas");l.setAttribute("width","".concat(r.width)),l.setAttribute("height","".concat(r.height));var u=l.getContext("2d");u&&(u.putImageData(r,0,0),c||t.setAttribute("width","".concat(r.width)),s||t.setAttribute("height","".concat(r.height)),t.setAttribute("href",l.toDataURL()))}}function O(t,n){var r=n.x1,i=n.y1,o=n.x2,a=n.y2,c=n.markerStart,s=n.markerEnd,l=n.markerStartOffset,u=n.markerEndOffset,d=0,p=0,f=0,h=0,m=0;c&&e.isDisplayObject(c)&&l&&(d=Math.cos(m=Math.atan2(a-i,o-r))*(l||0),p=Math.sin(m)*(l||0)),s&&e.isDisplayObject(s)&&u&&(f=Math.cos(m=Math.atan2(i-a,r-o))*(u||0),h=Math.sin(m)*(u||0)),t.setAttribute("x1","".concat(r+d)),t.setAttribute("y1","".concat(i+p)),t.setAttribute("x2","".concat(o+f)),t.setAttribute("y2","".concat(a+h))}function k(t,n){var r=n.path,i=n.markerStart,o=n.markerEnd,a=n.markerStartOffset,c=n.markerEndOffset,l=0,u=0,d=0,p=0,f=0;if(i&&e.isDisplayObject(i)&&a){var h=s(i.parentNode.getStartTangent(),2);l=Math.cos(f=Math.atan2((m=h[0])[1]-(v=h[1])[1],m[0]-v[0]))*(a||0),u=Math.sin(f)*(a||0)}if(o&&e.isDisplayObject(o)&&c){var m,v,g=s(o.parentNode.getEndTangent(),2);d=Math.cos(f=Math.atan2((m=g[0])[1]-(v=g[1])[1],m[0]-v[0]))*(c||0),p=Math.sin(f)*(c||0)}t.setAttribute("d",e.translatePathToString(r.absolutePath,l,u,d,p))}function T(t,n){var r=n.points.points,i=n.markerStart,o=n.markerStartOffset,a=n.markerEnd,c=n.markerEndOffset,s=r.length;if(r&&s>=2){var l=0,u=0,d=0,p=0,f=0;i&&e.isDisplayObject(i)&&o&&(l=Math.cos(f=Math.atan2(r[1][1]-r[0][1],r[1][0]-r[0][0]))*(o||0),u=Math.sin(f)*(o||0)),a&&e.isDisplayObject(a)&&c&&(d=Math.cos(f=Math.atan2(r[s-2][1]-r[s-1][1],r[s-2][0]-r[s-1][0]))*(c||0),p=Math.sin(f)*(c||0)),t.setAttribute("points",r.map((function(t,e){var n=0,r=0;return 0===e?(n=l,r=u):e===s-1&&(n=d,r=p),"".concat(t[0]+n,",").concat(t[1]+r)})).join(" "))}}function L(t,e){var n=e.radius,r=e.x,i=e.y,o=e.width,a=e.height;if(isFinite(o)&&isFinite(a)){var c="";if(n&&n.some((function(t){return 0!==t}))){var l=s(n.map((function(t){return x(t,0,Math.min(Math.abs(o)/2,Math.abs(a)/2))})),4),u=l[0],d=l[1],p=l[2],f=l[3],h=o>0?1:-1,m=a>0?1:-1,v=h+m!==0?1:0;c=[["M ".concat(h*u+r,",").concat(i)],["l ".concat(o-h*(u+d),",0")],["a ".concat(d,",").concat(d,",0,0,").concat(v,",").concat(h*d,",").concat(m*d)],["l 0,".concat(a-m*(d+p))],["a ".concat(p,",").concat(p,",0,0,").concat(v,",").concat(-h*p,",").concat(m*p)],["l ".concat(h*(p+f)-o,",0")],["a ".concat(f,",").concat(f,",0,0,").concat(v,",").concat(-h*f,",").concat(-m*f)],["l 0,".concat(m*(f+u)-a)],["a ".concat(u,",").concat(u,",0,0,").concat(v,",").concat(h*u,",").concat(-m*u)],["z"]].join(" ")}else c="M ".concat(r,",").concat(i," l ").concat(o,",0 l 0,").concat(a," l").concat(-o," 0 z");t.setAttribute("d",c)}}function M(t,e){return(e||document).createElementNS("http://www.w3.org/2000/svg",t)}var G="g-filter-";function P(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=M("filter",t);return c.setAttribute("filterUnits","userSpaceOnUse"),"blur"===i?function(t,e,n){var r=M("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=M("feGaussianBlur",t);c.setAttribute("in","SourceAlpha"),c.setAttribute("stdDeviation","".concat(o)),e.appendChild(c);var s=M("feOffset",t);s.setAttribute("dx","".concat(r)),s.setAttribute("dy","".concat(i)),s.setAttribute("result","offsetblur"),e.appendChild(s);var l=M("feFlood",t);l.setAttribute("flood-color",a),e.appendChild(l);var u=M("feComposite",t);u.setAttribute("in2","offsetblur"),u.setAttribute("operator","in"),e.appendChild(u);var d=M("feMerge",t);e.appendChild(d);var p=M("feMergeNode",t),f=M("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=M("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=M("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=M("feComponentTransfer",t);[M("feFuncR",t),M("feFuncG",t),M("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=M("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=M("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=G+e.entity+"-gradient",a=n.querySelector("#".concat(o));a||((a=M("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=M("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=M("feImage",t);if(p.setAttribute("href","#".concat(u)),p.setAttribute("result","".concat(o,"-").concat(s)),a.appendChild(p),s>0){var f=M("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=M("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=M("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);var p=r.getGeometryBounds(),f=p.halfExtents,h=p.min;d.setAttribute("x","".concat(h[0])),d.setAttribute("y","".concat(h[1]));var m=a,v=c;return"repeat-x"===l?v=2*f[1]:"repeat-y"===l?m=2*f[0]:"no-repeat"===l&&(m=2*f[0],v=2*f[1]),d.setAttribute("width","".concat(m)),d.setAttribute("height","".concat(v)),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=a&&a.min||[0,0],u=j(o,{width:c,height:s}),d=r.querySelector("#".concat(u));if(!d){(d=M(o.type===e.GradientType.LinearGradient?"linearGradient":"radialGradient",t)).setAttribute("gradientUnits","userSpaceOnUse");var p="";o.value.steps.sort((function(t,e){return t.offset.value-e.offset.value})).forEach((function(t){var e=t.color;p+='<stop offset="'.concat(t.offset.value/100,'" stop-color="').concat(e,'"></stop>')})),d.innerHTML=p,d.id=u,r.appendChild(d)}if(o.type===e.GradientType.LinearGradient){var f=e.computeLinearGradient([l[0],l[1]],c,s,o.value.angle),h=f.y1,m=f.x2,v=f.y2;d.setAttribute("x1","".concat(f.x1)),d.setAttribute("y1","".concat(h)),d.setAttribute("x2","".concat(m)),d.setAttribute("y2","".concat(v))}else{var g=o.value,y=e.computeRadialGradient([l[0],l[1]],c,s,g.cx,g.cy,g.size),b=y.y,E=y.r;d.setAttribute("cx","".concat(y.x)),d.setAttribute("cy","".concat(b)),d.setAttribute("r","".concat(E))}return u}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=M("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=M("filter",t)).setAttribute("data-type",a),"outer"===a)(w=M("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=M("feComponentTransfer",t);h.setAttribute("in","SourceAlpha");var m=M("feFuncA",t);m.setAttribute("type","table"),m.setAttribute("tableValues","1 0"),h.appendChild(m),f.appendChild(h),(S=M("feGaussianBlur",t)).setAttribute("stdDeviation","".concat((c||0)/4)),f.appendChild(S),(x=M("feOffset",t)).setAttribute("dx","".concat((l||0)/2)),x.setAttribute("dy","".concat((u||0)/2)),x.setAttribute("result","offsetblur"),f.appendChild(x),(C=M("feFlood",t)).setAttribute("flood-color",""+s),C.setAttribute("result","color"),f.appendChild(C);var v=M("feComposite",t);v.setAttribute("in2","offsetblur"),v.setAttribute("operator","in"),f.appendChild(v);var g=M("feComposite",t);g.setAttribute("in2","SourceAlpha"),g.setAttribute("operator","in"),f.appendChild(g);var y=M("feMerge",t);f.appendChild(y);var E=M("feMergeNode",t);E.setAttribute("in","SourceGraphic");var A=M("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 z(t){return t.replace(/[&|<|>|"|']/g,(function(t){return"&"===t?"&amp;":"<"===t?"&lt;":">"===t?"&gt;":'"'===t?"&quot;":"&apos;"}))}var X,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",cx:"cx",cy:"cy",rx:"rx",ry:"ry",x:"x",y:"y",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",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=M("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(e){e&&r.context.SVGElementLifeCycleContribution.updateElementAttribute(t,e,r.svgElementMap)})),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):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):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=M("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=M(o,t);var u=M("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.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.x,a=void 0===o?0:o,c=e.y,s=void 0===c?0:c,l=e.dx,u=e.dy,d=e.textPath,p=e.textPathSide,f=void 0===p?"left":p,h=e.textPathStartOffset,m=void 0===h?0:h,v=e.textDecorationLine,g=void 0===v?"":v,y=e.textDecorationColor,b=void 0===y?"":y,E=e.textDecorationStyle,A=void 0===E?"":E,S=e.metrics,x=e.textBaseline;r.enableCSSParsing||"alphabetic"!==x||(x="bottom"),t.setAttribute("dominant-baseline",nt[x]),t.setAttribute("paint-order","stroke");var C=S.lines,w=S.lineHeight,O=S.height,k=C.length,T="";if(0===l&&0===u||(T+="transform:translate(".concat(l,"px, ").concat(u,"px);")),g&&"none"!==g&&(T+="text-decoration:".concat(g," ").concat(A," ").concat(b,";")),T&&t.setAttribute("style",T),0!==a&&t.setAttribute("x","".concat(a)),0!==s&&t.setAttribute("y","".concat(s)),1===k){var L=z(C[0]);if(t.setAttribute("dx","".concat(i/2)),"bottom"!==x&&"top"!==x||(t.setAttribute("dominant-baseline",nt.middle),t.setAttribute("dy","bottom"===x?"-".concat(O/2,"px"):"".concat(O/2,"px"))),d){t.innerHTML="";var G=M("textPath",t.ownerDocument);G.setAttribute("href","#".concat(tt+d.entity)),"left"!==f&&G.setAttribute("side",f),0!==m&&G.setAttribute("startOffset","".concat(m)),G.innerHTML=L,t.appendChild(G)}else t.innerHTML=L}else t.innerHTML=C.map((function(t,e){var n=i/2,r=0;return 0===e?"middle"===x?r=w/2-O/2:"top"===x||"hanging"===x?r=0:"bottom"!==x&&"alphabetic"!==x&&"ideographic"!==x||(r=-w*(k-1)):r=w,"<tspan x=".concat(a,' dx="').concat(n,'" dy="').concat(r,'">').concat(z(t),"</tspan>")})).join("")}var it=((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),ot=((Y={})[e.Shape.CIRCLE]=["cx","cy","r"],Y[e.Shape.ELLIPSE]=["cx","cy","rx","ry"],Y[e.Shape.RECT]=["x","y","width","height","radius"],Y[e.Shape.IMAGE]=["x","y","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=M(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:T(n,r);break;case e.Shape.PATH:k(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:M,updateImageElementAttribute:w,updateLineElementAttribute:O,updatePathElementAttribute:k,updatePolylineElementAttribute:T,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=M("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.26-next.0",
"version": "1.10.26-next.1",
"description": "A renderer implemented by SVG",

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

"tslib": "^2.5.3",
"@antv/g-plugin-dom-interaction": "1.9.22-next.0",
"@antv/g-lite": "1.3.0-next.0",
"@antv/g-plugin-svg-picker": "1.9.26-next.0",
"@antv/g-plugin-svg-renderer": "1.11.0-next.0"
"@antv/g-lite": "1.3.0-next.1",
"@antv/g-plugin-dom-interaction": "1.9.22-next.1",
"@antv/g-plugin-svg-renderer": "1.11.0-next.1",
"@antv/g-plugin-svg-picker": "1.9.26-next.1"
},

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

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