@antv/g-svg
Version:
A renderer implemented by SVG
33 lines • 54.1 kB
JavaScript
/*!
* @antv/g-svg
* @description A renderer implemented by SVG
* @version 2.0.38
* @date 5/9/2025, 8:22:08 AM
* @author AntVis
* @docs https://g.antv.antgroup.com/
*/
!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";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:e+""}function i(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,r(i.key),i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function u(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(u=function(){return!!t})()}function s(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function l(t,e,n){return e=c(e),s(t,u()?Reflect.construct(e,n||[],c(t).constructor):e.apply(t,n))}function f(t,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},f(t,e)}function d(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}
/*!
* @antv/g-plugin-dom-interaction
* @description A G plugin
* @version 2.1.24
* @date 5/9/2025, 8:20:12 AM
* @author AntVis
* @docs https://g.antv.antgroup.com/
*/var h=function(){function t(){a(this,t)}return o(t,[{key:"apply",value:function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var c=o.root.ownerDocument.defaultView,u=function(t){i.hooks.pointerMove.call(t)},s=function(t){i.hooks.pointerUp.call(t)},l=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},d=function(t){i.hooks.pointerOut.call(t)},h=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},v=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",u,!0),t.addEventListener("pointerdown",l,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",s,!0),n.globalThis.addEventListener("pointercancel",h,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",u,!0),t.addEventListener("mousedown",l,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",s,!0)}(t),c.supportsTouchEvents&&function(t){t.addEventListener("touchstart",l,!0),t.addEventListener("touchend",s,!0),t.addEventListener("touchmove",u,!0),t.addEventListener("touchcancel",h,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",v,!0),t.addEventListener("wheel",p,{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",u,!0),t.removeEventListener("pointerdown",l,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",s,!0),n.globalThis.removeEventListener("pointercancel",h,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",u,!0),t.removeEventListener("mousedown",l,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",s,!0)}(t),c.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",l,!0),t.removeEventListener("touchend",s,!0),t.removeEventListener("touchmove",u,!0),t.removeEventListener("touchcancel",h,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",v,!0),t.removeEventListener("wheel",p,!0)}))}}])}();h.tag="DOMInteraction";var p=function(t){function e(){var t;a(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=l(this,e,[].concat(r))).name="dom-interaction",t}return d(e,t),o(e,[{key:"init",value:function(){this.addRenderingPlugin(new h)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(e.AbstractRendererPlugin),v=Object.freeze({__proto__:null,Plugin:p});function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function g(t,e){if(t){if("string"==typeof t)return m(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(t,e):void 0}}function y(){y=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function s(t,e,n,r){return Object.defineProperty(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r})}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(e,n,r,i){var o=Object.create((n&&n.prototype instanceof h?n:h).prototype);return s(o,"_invoke",function(e,n,r){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var c=r.delegate;if(c){var u=w(c,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(1===i)throw i=4,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=3;var s=f(e,n,r);if("normal"===s.type){if(i=r.done?4:2,s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(i=4,r.method="throw",r.arg=s.arg)}}}(e,r,new k(i||[])),!0),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d={};function h(){}function p(){}function v(){}var m={};s(m,a,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(C([])));b&&b!==r&&i.call(b,a)&&(m=b);var E=v.prototype=h.prototype=Object.create(m);function A(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,a,c,u){var s=f(t[o],t,a);if("throw"!==s.type){var l=s.arg,d=l.value;return d&&"object"==n(d)&&i.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(d).then((function(t){l.value=t,c(l)}),(function(t){return r("throw",t,c,u)}))}u(s.arg)}var o;s(this,"_invoke",(function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}),!0)}function w(e,n){var r=n.method,i=e.i[r];if(i===t)return n.delegate=null,"throw"===r&&e.i.return&&(n.method="return",n.arg=t,w(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(i,e.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var a=o.arg;return a?a.done?(n[e.r]=a.value,n.next=e.n,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,d):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function x(t){this.tryEntries.push(t)}function O(e){var n=e[4]||{};n.type="normal",n.arg=t,e[4]=n}function k(t){this.tryEntries=[[-1]],t.forEach(x,this),this.reset(!0)}function C(e){if(null!=e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,c=function n(){for(;++o<e.length;)if(i.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return c.next=c}}throw new TypeError(n(e)+" is not iterable")}return p.prototype=v,s(E,"constructor",v),s(v,"constructor",p),p.displayName=s(v,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},A(S.prototype),s(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new S(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(E),s(E,u,"Generator"),s(E,a,(function(){return this})),s(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}},e.values=C,k.prototype={constructor:k,reset:function(e){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(t){a.type="throw",a.arg=e,n.next=t}for(var i=n.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],c=this.prev,u=o[1],s=o[2];if(-1===o[0])return r("end"),!1;if(!u&&!s)throw Error("try statement without catch or finally");if(null!=o[0]&&c>=o[0]){if(u>c)return this.method="next",this.arg=t,r(u),!0;if(s>c)return r(s),!1}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r[0]>-1&&this.prev>=r[0]&&r[2]>this.prev){var i=r;break}}i&&("break"===t||"continue"===t)&&e>=i[0]&&i[2]>=e&&(i=null);var o=i?i[4]:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i[2],d):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[2]===t)return this.complete(n[4],n[3]),O(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[0]===t){var r=n[4];if("throw"===r.type){var i=r.arg;O(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={i:C(e),r:n,n:r},"next"===this.method&&(this.arg=t),d}},e}function b(t,e,n,r,i,o,a){try{var c=t[o](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,i)}function E(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){b(o,r,i,a,c,"next",t)}function c(t){b(o,r,i,a,c,"throw",t)}a(void 0)}))}}
/*!
* @antv/g-plugin-svg-picker
* @description A G plugin for picking in SVG
* @version 2.0.38
* @date 5/9/2025, 8:21:37 AM
* @author AntVis
* @docs https://g.antv.antgroup.com/
*/var A=function(){function t(){a(this,t)}return o(t,[{key:"apply",value:function(e,n){var r=this,i=e.config.document,o=e.renderingService,a=e.svgElementMap;o.hooks.pick.tapPromise(t.tag,function(){var t=E(y().mark((function t(e){return y().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.pick(a,i,e));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o.hooks.pickSync.tap(t.tag,(function(t){return r.pick(a,i,t)}))}},{key:"pick",value:function(t,e,n){var r=n.topmost,i=n.position,o=i.clientX,a=i.clientY;try{var c,u=[],s=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=g(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}((e||document).elementsFromPoint(o,a));try{for(s.s();!(c=s.n()).done;){var l=c.value;if(l.shadowRoot&&l.shadowRoot!==e)return this.pick(t,l.shadowRoot,n);var f=t.get(l);if(f&&f.isInteractive()&&(u.push(f),r))return n.picked=u,n}}catch(t){s.e(t)}finally{s.f()}n.picked=u}catch(t){n.picked=[]}return n}}])}();A.tag="SVGPicker";var S=function(t){function e(){var t;a(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=l(this,e,[].concat(r))).name="svg-picker",t}return d(e,t),o(e,[{key:"init",value:function(){this.addRenderingPlugin(new A)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(e.AbstractRendererPlugin),w=Object.freeze({__proto__:null,Plugin:S});function x(t){return null==t}function O(t){return"string"==typeof t}var k=function(t,e,n){return e>t?e:t>n?n:t},C="undefined"!=typeof Float32Array?Float32Array:Array;function T(){var t=new C(16);return C!=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 P(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],s=e[7],l=e[8],f=e[9],d=e[10],h=e[11],p=e[12],v=e[13],m=e[14],g=e[15],y=n*c-r*a,b=n*u-i*a,E=n*s-o*a,A=r*u-i*c,S=r*s-o*c,w=i*s-o*u,x=l*v-f*p,O=l*m-d*p,k=l*g-h*p,C=f*m-d*v,T=f*g-h*v,P=d*g-h*m,G=y*P-b*T+E*C+A*k-S*O+w*x;return G?(t[0]=(c*P-u*T+s*C)*(G=1/G),t[1]=(i*T-r*P-o*C)*G,t[2]=(v*w-m*S+g*A)*G,t[3]=(d*S-f*w-h*A)*G,t[4]=(u*k-a*P-s*O)*G,t[5]=(n*P-i*k+o*O)*G,t[6]=(m*E-p*w-g*b)*G,t[7]=(l*w-d*E+h*b)*G,t[8]=(a*T-c*k+s*x)*G,t[9]=(r*k-n*T-o*x)*G,t[10]=(p*S-v*E+g*y)*G,t[11]=(f*E-l*S-h*y)*G,t[12]=(c*O-a*C-u*x)*G,t[13]=(n*C-r*O+i*x)*G,t[14]=(v*b-p*A-m*y)*G,t[15]=(l*A-f*b+d*y)*G,t):null}function G(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,c=[],u=!0,s=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){s=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw i}}return c}}(t,e)||g(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function D(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?M(Object(n),!0).forEach((function(e){G(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}
/*!
* @antv/g-plugin-svg-renderer
* @description A G plugin of renderer implementation with SVG
* @version 2.2.20
* @date 5/9/2025, 8:20:42 AM
* @author AntVis
* @docs https://g.antv.antgroup.com/
*/Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var j=o((function t(){a(this,t)}));function R(t,e){var n=e.src,r=void 0===n?"":n,i=e.x,o=e.y,a=void 0===o?0:o,c=e.width,u=e.height;if(t.setAttribute("x","".concat(void 0===i?0:i)),t.setAttribute("y","".concat(a)),O(r))t.setAttribute("href",r);else if(r instanceof Image)c||t.setAttribute("width","".concat(r.width)),u||t.setAttribute("height","".concat(r.height)),t.setAttribute("href",r.src);else if(r instanceof HTMLElement&&O(r.nodeName)&&"CANVAS"===r.nodeName.toUpperCase())t.setAttribute("href",r.toDataURL());else if(r instanceof ImageData){var s=document.createElement("canvas");s.setAttribute("width","".concat(r.width)),s.setAttribute("height","".concat(r.height));var l=s.getContext("2d");l&&(l.putImageData(r,0,0),c||t.setAttribute("width","".concat(r.width)),u||t.setAttribute("height","".concat(r.height)),t.setAttribute("href",s.toDataURL()))}}function N(t,n){var r=n.x1,i=n.y1,o=n.x2,a=n.y2,c=n.markerStart,u=n.markerEnd,s=n.markerStartOffset,l=n.markerEndOffset,f=0,d=0,h=0,p=0,v=0;c&&e.isDisplayObject(c)&&s&&(f=Math.cos(v=Math.atan2(a-i,o-r))*(s||0),d=Math.sin(v)*(s||0)),u&&e.isDisplayObject(u)&&l&&(h=Math.cos(v=Math.atan2(i-a,r-o))*(l||0),p=Math.sin(v)*(l||0)),t.setAttribute("x1","".concat(r+f)),t.setAttribute("y1","".concat(i+d)),t.setAttribute("x2","".concat(o+h)),t.setAttribute("y2","".concat(a+p))}function V(t,n){var r=n.d,i=n.markerStart,o=n.markerEnd,a=n.markerStartOffset,c=n.markerEndOffset,u=0,s=0,l=0,f=0,d=0;if(i&&e.isDisplayObject(i)&&a){var h=L(i.parentNode.getStartTangent(),2),p=h[0],v=h[1];u=Math.cos(d=Math.atan2(p[1]-v[1],p[0]-v[0]))*(a||0),s=Math.sin(d)*(a||0)}if(o&&e.isDisplayObject(o)&&c){var m=L(o.parentNode.getEndTangent(),2),g=m[0],y=m[1];l=Math.cos(d=Math.atan2(g[1]-y[1],g[0]-y[0]))*(c||0),f=Math.sin(d)*(c||0)}t.setAttribute("d",e.translatePathToString(r.absolutePath,u,s,l,f))}function $(t,n){var r=n.points.points,i=n.markerStart,o=n.markerStartOffset,a=n.markerEnd,c=n.markerEndOffset,u=r.length;if(r&&u>=2){var s=0,l=0,f=0,d=0,h=0;i&&e.isDisplayObject(i)&&o&&(s=Math.cos(h=Math.atan2(r[1][1]-r[0][1],r[1][0]-r[0][0]))*(o||0),l=Math.sin(h)*(o||0)),a&&e.isDisplayObject(a)&&c&&(f=Math.cos(h=Math.atan2(r[u-2][1]-r[u-1][1],r[u-2][0]-r[u-1][0]))*(c||0),d=Math.sin(h)*(c||0)),t.setAttribute("points",r.map((function(t,e){var n=0,r=0;return 0===e?(n=s,r=l):e===u-1&&(n=f,r=d),"".concat(t[0]+n,",").concat(t[1]+r)})).join(" "))}}function U(t,e){var n=e.radius,r=e.x,i=void 0===r?0:r,o=e.y,a=void 0===o?0:o,c=e.width,u=e.height;if(isFinite(c)&&isFinite(u)){var s="";if(n&&n.some((function(t){return 0!==t}))){var l=L(n.map((function(t){return k(t,0,Math.min(Math.abs(c)/2,Math.abs(u)/2))})),4),f=l[0],d=l[1],h=l[2],p=l[3],v=c>0?1:-1,m=u>0?1:-1,g=v+m!==0?1:0;s=[["M ".concat(v*f+i,",").concat(a)],["l ".concat(c-v*(f+d),",0")],["a ".concat(d,",").concat(d,",0,0,").concat(g,",").concat(v*d,",").concat(m*d)],["l 0,".concat(u-m*(d+h))],["a ".concat(h,",").concat(h,",0,0,").concat(g,",").concat(-v*h,",").concat(m*h)],["l ".concat(v*(h+p)-c,",0")],["a ".concat(p,",").concat(p,",0,0,").concat(g,",").concat(-v*p,",").concat(-m*p)],["l 0,".concat(m*(p+f)-u)],["a ".concat(f,",").concat(f,",0,0,").concat(g,",").concat(v*f,",").concat(-m*f)],["z"]].join(" ")}else s="M ".concat(i,",").concat(a," l ").concat(c,",0 l 0,").concat(u," l").concat(-c," 0 z");t.setAttribute("d",s)}}function I(t,e){return(e||document).createElementNS("http://www.w3.org/2000/svg",t)}j.tag="c-svg-element";var _="g-filter-";function H(t,e,n,r,i){var o=_+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=I("filter",t);return c.setAttribute("filterUnits","userSpaceOnUse"),"blur"===i?function(t,e,n){var r=I("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=F(n[0]);B(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=I("feGaussianBlur",t);c.setAttribute("in","SourceAlpha"),c.setAttribute("stdDeviation","".concat(o)),e.appendChild(c);var u=I("feOffset",t);u.setAttribute("dx","".concat(r)),u.setAttribute("dy","".concat(i)),u.setAttribute("result","offsetblur"),e.appendChild(u);var s=I("feFlood",t);s.setAttribute("flood-color",a),e.appendChild(s);var l=I("feComposite",t);l.setAttribute("in2","offsetblur"),l.setAttribute("operator","in"),e.appendChild(l);var f=I("feMerge",t);e.appendChild(f);var d=I("feMergeNode",t),h=I("feMergeNode",t);h.setAttribute("in","SourceGraphic"),f.appendChild(d),f.appendChild(h)}(t,c,a):"contrast"===i?function(t,e,n){var r=F(n[0]);B(t,e,{type:"linear",slope:r,intercept:-.5*r+.5})}(t,c,a):"grayscale"===i?function(t,e,n){var r=F(n[0]);W(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=F(n[0]);W(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=F(n[0]),i=I("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=I("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=F(n[0]);B(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 F(t){return t.unit===e.UnitType.kPercentage?t.value/100:t.value}function B(t,e,n){var r=n.type,i=n.slope,o=n.intercept,a=n.tableValues,c=I("feComponentTransfer",t);[I("feFuncR",t),I("feFuncG",t),I("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 W(t,e,n){var r=I("feColorMatrix",t);r.setAttribute("type","matrix"),r.setAttribute("values",n.join(" ")),e.appendChild(r)}var z={},X=0;function Y(t,n,r,i,o,a,c,u){if(!o)return"";if(!e.isCSSRGB(o)){if(e.isPattern(o)){var s=function(t,n,r,i,o,a){var c=q(i),u=n.querySelector("#".concat(c));if(!u){var s=i.image,l="";if(O(s)?l=s:e.isBrowser&&(s instanceof HTMLImageElement?l=s.src:s instanceof HTMLCanvasElement&&(l=s.toDataURL())),l){var f=I("image",t);f.setAttribute("href",l);var d=o();l.match(/^data:/i)||(d.crossOrigin="Anonymous",f.setAttribute("crossorigin","anonymous")),d.src=l;var h=function(){var e=Q(t,n,r,i,c,d.width,d.height);n.appendChild(e),e.appendChild(f),f.setAttribute("x","0"),f.setAttribute("y","0"),f.setAttribute("width","".concat(d.width)),f.setAttribute("height","".concat(d.height))};d.complete?h():d.onload=h}if("rect"===s.nodeName){var p=s.parsedStyle,v=Q(t,n,s,i,c,p.width,p.height);s.forEach((function(e){a.createSVGDom(t,e,null);var n=e.elementSVG,r=e.getLocalTransform();a.applyTransform(n.$groupEl,r)})),v.appendChild(s.elementSVG.$groupEl)}}return c}(t,n,r,o,c,u);return i.style[a]="url(#".concat(s,")"),s}if(1===o.length){var l=Z(t,r,n,i,o[0]);return null==i||i.setAttribute(a,"url(#".concat(l,")")),l}var f=function(t,e,n,r,i){var o="".concat(_+e.entity,"-gradient"),a=n.querySelector("#".concat(o));a||((a=I("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,u){var s=Z(t,e,n,r,i),l="".concat(s,"_rect"),f=I("rect",t);f.setAttribute("x","0"),f.setAttribute("y","0"),f.setAttribute("width","100%"),f.setAttribute("height","100%"),f.setAttribute("fill","url(#".concat(s,")")),f.id=l,n.appendChild(f);var d=I("feImage",t);if(d.setAttribute("href","#".concat(l)),d.setAttribute("result","".concat(o,"-").concat(u)),a.appendChild(d),u>0){var h=I("feBlend",t);h.setAttribute("in",1===u?"".concat(o,"-").concat(u-1):"".concat(o,"-blended-").concat(c-1)),h.setAttribute("in2","".concat(o,"-").concat(u)),h.setAttribute("result","".concat(o,"-blended-").concat(c++)),h.setAttribute("mode","multiply"),a.appendChild(h)}}));var u=I("feComposite",t);return u.setAttribute("in","".concat(o,"-blended-").concat(c)),u.setAttribute("in2","SourceGraphic"),u.setAttribute("operator","in"),a.appendChild(u),o}(t,r,n,i,o);return null==i||i.setAttribute("filter","url(#".concat(f,")")),null==i||i.setAttribute("fill","black"),f}return"currentColor"===r.style[a]?null==i||i.setAttribute(a,"currentColor"):null==i||i.setAttribute(a,o.isNone?"none":""+o),""}function q(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="";if(e.isCSSGradientValue(t)){var i=t.type;if(i===e.GradientType.LinearGradient||i===e.GradientType.RadialGradient){var o=D(D({},t.value),n),a=o.x,c=o.y,u=o.width,s=o.height,l=o.steps,f=o.angle,d=o.cx,h=o.cy,p=o.size;r="gradient-".concat(o.type,"-").concat((null==a?void 0:""+a)||0,"-").concat((null==c?void 0:""+c)||0,"-").concat((null==f?void 0:""+f)||0,"-").concat((null==d?void 0:""+d)||0,"-").concat((null==h?void 0:""+h)||0,"-").concat((null==p?void 0:""+p)||0,"-").concat(u,"-").concat(s,"-").concat(l.map((function(t){var e=t.color;return"".concat(t.offset).concat(e)})).join("-"))}}else e.isPattern(t)&&(r=O(t.image)?"pattern-".concat(t.image,"-").concat(t.repetition):"rect"===t.image.nodeName?"pattern-rect-".concat(t.image.entity):"pattern-".concat(X));return r&&(z[r]||(z[r]="".concat("g-pattern-").concat(X++))),z[r]}function Q(t,n,r,i,o,a,c){var u=i.repetition,s=i.transform,l=I("pattern",t);s&&l.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){var i=(null==n?void 0:n.map((function(t){return t.value})))||[1];return"scale(".concat(i[0],", 1)")}if("scaleY"===e){var o=(null==n?void 0:n.map((function(t){return t.value})))||[1];return"scale(1, ".concat(o[0],")")}if("skew"===e){var a=(null==n?void 0:n.map((function(t){return t.value})))||[0,0];return"skewX(".concat(a[0],") skewY(").concat(a[1],")")}if("skewZ"===e){var c=(null==n?void 0:n.map((function(t){return t.value})))||[0];return"skewX(".concat(c[0],")")}if("skewY"===e){var u=(null==n?void 0:n.map((function(t){return t.value})))||[0];return"skewY(".concat(u[0],")")}if("matrix"===e){var s=L(n.map((function(t){return t.value})),6),l=s[1],f=s[2],d=s[3],h=s[4],p=s[5];return"matrix(".concat(s[0]," ").concat(l," ").concat(f," ").concat(d," ").concat(h," ").concat(p,")")}return null})).filter((function(t){return null!==t})).join(" ")}(s)),l.setAttribute("patternUnits","userSpaceOnUse"),l.id=o,n.appendChild(l);var f=r.getGeometryBounds(),d=f.halfExtents,h=f.min;l.setAttribute("x","".concat(h[0])),l.setAttribute("y","".concat(h[1]));var p=a,v=c;return"repeat-x"===u?v=2*d[1]:"repeat-y"===u?p=2*d[0]:"no-repeat"===u&&(p=2*d[0],v=2*d[1]),l.setAttribute("width","".concat(p)),l.setAttribute("height","".concat(v)),l}function Z(t,n,r,i,o){var a=n.getGeometryBounds(),c=a&&2*a.halfExtents[0]||0,u=a&&2*a.halfExtents[1]||0,s=a&&a.min||[0,0],l=q(o,{x:s[0],y:s[1],width:c,height:u}),f=r.querySelector("#".concat(l));if(!f){(f=I(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>')})),f.innerHTML=d,f.id=l,r.appendChild(f)}if(o.type===e.GradientType.LinearGradient){var h=e.computeLinearGradient([s[0],s[1]],c,u,o.value.angle),p=h.y1,v=h.x2,m=h.y2;f.setAttribute("x1","".concat(h.x1)),f.setAttribute("y1","".concat(p)),f.setAttribute("x2","".concat(v)),f.setAttribute("y2","".concat(m))}else{var g=o.value,y=e.computeRadialGradient([s[0],s[1]],c,u,g.cx,g.cy,g.size),b=y.y,E=y.r;f.setAttribute("cx","".concat(y.x)),f.setAttribute("cy","".concat(b)),f.setAttribute("r","".concat(E))}return l}var J=/url\("?#(.*)\)/,K=function(){return o((function t(e){a(this,t),this.gradientCache={},this.context=e}),[{key:"getDefElement",value:function(){return this.$def}},{key:"init",value:function(){var t=this.context.config.document,e=this.context.contextService.getContext();this.$def=I("defs",t),e.appendChild(this.$def)}},{key:"clear",value:function(t){var e=this;Object.keys(this.gradientCache).forEach((function(n){e.clearUnusedDefElement(e.gradientCache,n,t)}))}},{key:"clearUnusedDefElement",value: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)}}},{key:"createOrUpdateGradientAndPattern",value:function(t,n,r,i,o){var a=this.context.config,c=a.document,u=a.createImage;if(n){var s=(e.isPattern(r)?n.style[i]:n.getAttribute(i)||"").match(J);s&&s.length>1&&this.clearUnusedDefElement(this.gradientCache,s[1].replace('"',""),t.entity);var l=Y(c||document,this.$def,t,n,r,i,u,o);l&&(this.gradientCache[l]||(this.gradientCache[l]=new Set),this.gradientCache[l].add(t.entity))}}},{key:"createOrUpdateShadow",value:function(t,e,n){!function(t,e,n,r,i){var o=n.parsedStyle,a=o.shadowType,c=void 0===a?"outer":a,u=o.shadowBlur,s=o.shadowColor,l=o.shadowOffsetX,f=o.shadowOffsetY,d=!x(s)&&u>0,h="g-filter-dropshadow-"+n.entity,p=e.querySelector("#".concat(h));if(p&&(p.getAttribute("data-type")===c&&d||(p.remove(),p=null)),d){if(null==r||r.setAttribute("filter","url(#".concat(h,")")),!p){if((p=I("filter",t)).setAttribute("data-type",c),"outer"===c){var v=I("feDropShadow",t);v.setAttribute("dx","".concat((l||0)/2)),v.setAttribute("dy","".concat((f||0)/2)),v.setAttribute("stdDeviation","".concat((u||0)/4)),v.setAttribute("flood-color",""+s),p.appendChild(v)}else if("inner"===c){var m=I("feComponentTransfer",t);m.setAttribute("in","SourceAlpha");var g=I("feFuncA",t);g.setAttribute("type","table"),g.setAttribute("tableValues","1 0"),m.appendChild(g),p.appendChild(m);var y=I("feGaussianBlur",t);y.setAttribute("stdDeviation","".concat((u||0)/4)),p.appendChild(y);var b=I("feOffset",t);b.setAttribute("dx","".concat((l||0)/2)),b.setAttribute("dy","".concat((f||0)/2)),b.setAttribute("result","offsetblur"),p.appendChild(b);var E=I("feFlood",t);E.setAttribute("flood-color",""+s),E.setAttribute("result","color"),p.appendChild(E);var A=I("feComposite",t);A.setAttribute("in2","offsetblur"),A.setAttribute("operator","in"),p.appendChild(A);var S=I("feComposite",t);S.setAttribute("in2","SourceAlpha"),S.setAttribute("operator","in"),p.appendChild(S);var w=I("feMerge",t);p.appendChild(w);var O=I("feMergeNode",t);O.setAttribute("in","SourceGraphic");var k=I("feMergeNode",t);w.appendChild(O),w.appendChild(k)}return p.id=h,p.setAttribute("filterUnits","userSpaceOnUse"),void e.appendChild(p)}if("inner"===c){var C=p.children[1],T=p.children[2];"shadowColor"===i?p.children[3].setAttribute("flood-color",""+s):"shadowBlur"===i?C.setAttribute("stdDeviation","".concat((u||0)/4)):"shadowOffsetX"===i?T.setAttribute("dx","".concat((l||0)/2)):"shadowOffsetY"===i&&T.setAttribute("dy","".concat((f||0)/2))}else if("outer"===c){var P=p.children[0];"shadowColor"===i?P.setAttribute("flood-color",""+s):"shadowBlur"===i?P.setAttribute("stdDeviation","".concat((u||0)/4)):"shadowOffsetX"===i?P.setAttribute("dx","".concat((l||0)/2)):"shadowOffsetY"===i&&P.setAttribute("dy","".concat((f||0)/2))}}else null==r||r.removeAttribute("filter")}(this.context.config.document||document,this.$def,t,e,n)}},{key:"createOrUpdateFilter",value:function(t,e,n){H(this.context.config.document||document,this.$def,t,e,n)}}])}();function tt(t){return t.toFixed(6).replace(".000000","")}function et(t){return t.replace(/[&|<|>|"|']/g,(function(t){return"&"===t?"&":"<"===t?"<":">"===t?">":'"'===t?""":"'"}))}var nt={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"},rt={textAlign:{inherit:"inherit",left:"left",start:"left",center:"middle",right:"end",end:"end"}},it={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",transform:"matrix(1,0,0,1,0,0)"},ot="g-svg",at="clip-path-",ct="text-path-",ut=function(){function t(e,n,r){a(this,t),this.svgElementMap=new WeakMap,this.renderQueue=[],this.dirtyAttributes=new WeakMap,this.pendingReorderQueue=new Set,this.clipPathUseMap=new WeakMap,this.pluginOptions=e,this.defElementManager=n,this.context=r}return o(t,[{key:"apply",value: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,u=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)},s=function(t){var e=t.target;r.defElementManager.clear(e.entity),r.clipPathUseMap.delete(e),r.removeSVGDom(e)},l=function(t){var e,n=t.parentNode,i=null===(e=t.parentNode)||void 0===e||null===(e=e.elementSVG)||void 0===e?void 0:e.$groupEl,o=((null==n?void 0:n.children)||[]).slice();i&&r.reorderChildren(c,i,o)},f=function(t){l(t.target)},d=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)}},h=function(t){var n=t.target;(n.nodeName===e.Shape.FRAGMENT?n.childNodes:[n]).forEach((function(t){var n,i=null===(n=t.elementSVG)||void 0===n?void 0:n.$el,o=t.parsedStyle,a=o.fill,c=o.stroke,u=o.clipPath;if(a&&!e.isCSSRGB(a)&&r.defElementManager.createOrUpdateGradientAndPattern(t,i,a,"fill",r),c&&!e.isCSSRGB(c)&&r.defElementManager.createOrUpdateGradientAndPattern(t,i,c,"stroke",r),u){var s=P(T(),t.getWorldTransform()),l="".concat(at+u.entity,"-").concat(t.entity),f=r.defElementManager.getDefElement().querySelector("#".concat(l));f&&r.applyTransform(f,s)}}))};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=I("g",i),r.$camera.id="".concat(ot,"-camera"),r.applyTransform(r.$camera,r.context.camera.getOrthoMatrix()),o.appendChild(r.$camera),a.addEventListener(e.ElementEvent.MOUNTED,u),a.addEventListener(e.ElementEvent.UNMOUNTED,s),a.addEventListener(e.ElementEvent.REPARENT,f),a.addEventListener(e.ElementEvent.ATTR_MODIFIED,d),a.addEventListener(e.ElementEvent.BOUNDS_CHANGED,h)})),i.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(e.ElementEvent.MOUNTED,u),a.removeEventListener(e.ElementEvent.UNMOUNTED,s),a.removeEventListener(e.ElementEvent.REPARENT,f),a.removeEventListener(e.ElementEvent.ATTR_MODIFIED,d),a.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,h),X=0,z={}})),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==e||null===(n=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 u=r.dirtyAttributes.get(t);u&&(u.forEach((function(e){"zIndex"===e?l(t):"increasedLineWidthForHitTesting"===e&&r.createOrUpdateHitArea(t,i,o),r.updateAttribute(t,[e])})),r.dirtyAttributes.delete(t))})),r.renderQueue=[]}))}},{key:"getId",value:function(t){return t.id||"".concat(ot,"-").concat(t.entity)}},{key:"reorderChildren",value: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)}}},{key:"applyTransform",value:function(t,e){var n="matrix(".concat(tt(e[0]),",").concat(tt(e[1]),",").concat(tt(e[4]),",").concat(tt(e[5]),",").concat(tt(e[12]),",").concat(tt(e[13]),")");n!==t.getAttribute("transform")&&t.setAttribute("transform",n),n===it.transform&&t.removeAttribute("transform")}},{key:"applyAttributes",value: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))}}},{key:"updateAttribute",value:function(t,n){var r=this,i=this.context.config.document,o=t.elementSVG,a=o.$el,c=o.$hitTestingEl,u=t.parsedStyle,s=t.nodeName;n.some((function(e){return r.context.SVGElementLifeCycleContribution.shouldUpdateElementAttribute(t,e)}))&&a&&[a,c].forEach((function(e){e&&r.context.SVGElementLifeCycleContribution.updateElementAttribute(t,e,r.svgElementMap)})),n.forEach((function(n){var o,l,f=nt[n],d=u[n],h=!x(d)&&""+d,p=(null===(o=rt[n])||void 0===o?void 0:o[h])||h,v=u[n],m=f&&!(null===(l=e.propertyMetadataCache[n])||void 0===l||!l.inh);if(s===e.Shape.HTML)"fill"===n?a.style.background=""+v:"stroke"===n?(a.style["border-color"]=""+v,a.style["border-style"]="solid"):"lineWidth"===n?a.style["border-width"]="".concat(v||0,"px"):"lineDash"===n?a.style["border-style"]="dashed":"innerHTML"===n?r.createOrUpdateInnerHTML(i,a,v):"width"===n||"height"===n||"class"===n?a.setAttribute(n,""+v):x(t.style[n])||""===t.style[n]||(a.style[n]=t.style[n]);else{if(!f||(s===e.Shape.GROUP||t.isCustomElement)&&(m||"fill"===f||"stroke"===f))return;"fill"===n||"stroke"===n?r.defElementManager.createOrUpdateGradientAndPattern(t,a,v,f,r):"clipPath"===n?r.createOrUpdateClipOrTextPath(i,v,t):"textPath"===n?r.createOrUpdateClipOrTextPath(i,v,t,!0):"shadowType"===n||"shadowColor"===n||"shadowBlur"===n||"shadowOffsetX"===n||"shadowOffsetY"===n?r.defElementManager.createOrUpdateShadow(t,a,n):"filter"===n?r.defElementManager.createOrUpdateFilter(t,a,v):x(d)||[a,c].forEach((function(t){t&&f&&("unset"!==h&&h!==it[n]?t.setAttribute(f,p):t.removeAttribute(f))}))}}))}},{key:"createSVGDom",value:function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];n.elementSVG=new j;var o=n.elementSVG,a=this.context.SVGElementLifeCycleContribution.createElement(n,this.svgElementMap);if(a){var c,u;n.nodeName===e.Shape.HTML&&(n.parsedStyle.$el=a),this.pluginOptions.outputSVGElementId&&(a.id=this.getId(n)),this.pluginOptions.outputSVGElementName&&n.name&&a.setAttribute("name",n.name),!a.hasAttribute("data-wrapgroup")&&"g"===a.nodeName||i?u=a:(u=I("g",t)).appendChild(a),o.$el=a,o.$groupEl=u,this.applyAttributes(n),this.createOrUpdateHitArea(n,a,u);var s=r||n.parentNode&&(null===(c=n.parentNode.elementSVG)||void 0===c?void 0:c.$groupEl);s&&(s.appendChild(u),this.pendingReorderQueue.add(n.parentNode))}}},{key:"removeSVGDom",value: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))}},{key:"createOrUpdateHitArea",value: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)}},{key:"createOrUpdateInnerHTML",value:function(t,e,n){var r=(t||document).createElement("div");"string"==typeof n?r.innerHTML=n:r.appendChild(n),e.innerHTML="",e.appendChild(r)}},{key:"createOrUpdateClipOrTextPath",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=n.elementSVG.$groupEl,o=r?"g":"clipPath",a=r?"text-path":"clip-path";if(e){var c="".concat((r?ct:at)+e.entity,"-").concat(n.entity),u=this.defElementManager.getDefElement();if(!u.querySelector("#".concat(c))){var s;if(r)this.createSVGDom(t,e,null,!0),s=e.elementSVG.$el;else{if(!e.isConnected)u.querySelector("#".concat(this.getId(e)))||this.createSVGDom(t,e,u,!0);s=I(o,t);var l=I("use",t);l.setAttribute("href","#".concat(e.elementSVG.$el.id)),s.appendChild(l);var f=this.clipPathUseMap.get(e);f||(this.clipPathUseMap.set(e,[]),f=this.clipPathUseMap.get(e)),f.push(l),this.applyTransform(l,e.getWorldTransform());var d=P(T(),n.getWorldTransform());this.applyTransform(s,d)}this.pluginOptions.outputSVGElementId&&(s.id=c),u.appendChild(s)}this.applyAttributes(e),r||i.setAttribute(a,"url(#".concat(c,")"))}else r||i.removeAttribute(a)}}])}();ut.tag="SVGRenderer";var st,lt={top:"hanging",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",ideographic:"ideographic",hanging:"hanging"};function ft(t,e,n,r){n.getBounds();var i=e.lineWidth,o=void 0===i?1:i,a=e.x,c=void 0===a?0:a,u=e.y,s=void 0===u?0:u,l=e.dx,f=void 0===l?0:l,d=e.dy,h=void 0===d?0:d,p=e.textPath,v=e.textPathSide,m=void 0===v?"left":v,g=e.textPathStartOffset,y=void 0===g?0:g,b=e.textDecorationLine,E=void 0===b?"":b,A=e.textDecorationColor,S=void 0===A?"":A,w=e.textDecorationStyle,x=void 0===w?"":w,O=e.metrics,k=e.textBaseline,C=void 0===k?"alphabetic":k;"alphabetic"===C&&(C="bottom"),t.setAttribute("dominant-baseline",lt[C]),t.setAttribute("paint-order","stroke");var T=O.lines,P=O.lineHeight,G=O.height,L=T.length,M="transform:translate(".concat(f,"px, ").concat(h,"px);");if(E&&"none"!==E&&(M+="text-decoration:".concat(E," ").concat(x," ").concat(S,";")),M&&t.setAttribute("style",M),0!==c&&t.setAttribute("x","".concat(c)),0!==s&&t.setAttribute("y","".concat(s)),1===L){var D=et(T[0]);if(t.setAttribute("dx","".concat(o/2)),"bottom"===C||"top"===C?(t.setAttribute("dominant-baseline",lt.middle),t.setAttribute("dy","bottom"===C?"-".concat(G/2,"px"):"".concat(G/2,"px"))):t.setAttribute("dy","0px"),p){t.innerHTML="";var j=I("textPath",t.ownerDocument);j.setAttribute("href","#".concat(ct+p.entity)),"left"!==m&&j.setAttribute("side",m),0!==y&&j.setAttribute("startOffset","".concat(y)),j.innerHTML=D,t.appendChild(j)}else t.innerHTML=D}else t.innerHTML=T.map((function(t,e){var n=o/2,r=0;return 0===e?"middle"===C?r=P/2-G/2:"top"===C||"hanging"===C?r=0:"bottom"!==C&&"ideographic"!==C||(r=-P*(L-1)):r=P,"<tspan x=".concat(c,' dx="').concat(n,'" dy="').concat(r,'">').concat(et(t),"</tspan>")})).join("")}var dt=(G(G(G(G(G(G(G(G(G(G(st={},e.Shape.RECT,"path"),e.Shape.CIRCLE,"circle"),e.Shape.ELLIPSE,"ellipse"),e.Shape.IMAGE,"image"),e.Shape.GROUP,"g"),e.Shape.LINE,"line"),e.Shape.POLYLINE,"polyline"),e.Shape.POLYGON,"polygon"),e.Shape.TEXT,"text"),e.Shape.PATH,"path"),G(st,e.Shape.HTML,"foreignObject")),ht=G(G(G(G(G(G(G(G(G({},e.Shape.CIRCLE,["cx","cy","r"]),e.Shape.ELLIPSE,["cx","cy","rx","ry"]),e.Shape.RECT,["x","y","width","height","radius"]),e.Shape.IMAGE,["x","y","src","width","height"]),e.Shape.LINE,["x1","y1","x2","y2","markerStart","markerEnd","markerStartOffset","markerEndOffset"]),e.Shape.POLYLINE,["points","markerStart","markerEnd","markerMid","markerStartOffset","markerEndOffset"]),e.Shape.POLYGON,["points","markerStart","markerEnd","markerMid","markerStartOffset","markerEndOffset"]),e.Shape.PATH,["d","markerStart","markerEnd","markerMid","markerStartOffset","markerEndOffset"]),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"]),pt=function(){return o((function t(e,n){a(this,t),this.context=e,this.runtime=n}),[{key:"createElement",value:function(t,e){var n=I(dt[t.nodeName]||"g",this.context.config.document||document);return e.set(n,t),n}},{key:"destroyElement",value:function(t,e){}},{key:"shouldUpdateElementAttribute",value:function(t,e){return(ht[t.nodeName]||[]).indexOf(e)>-1}},{key:"updateElementAttribute",value:function(t){var n=t.elementSVG.$el,r=t.parsedStyle;switch(t.nodeName){case e.Shape.IMAGE:R(n,r);break;case e.Shape.RECT:U(n,r);break;case e.Shape.LINE:N(n,r);break;case e.Shape.POLYGON:case e.Shape.POLYLINE:$(n,r);break;case e.Shape.PATH:V(n,r);break;case e.Shape.TEXT:ft(n,r,t)}}}])}(),vt=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,e),(t=l(this,e)).name="svg-renderer",t.options=n,t}return d(e,t),o(e,[{key:"init",value:function(t){var e=this.options,n=e.outputSVGElementId,r=e.outputSVGElementName,i=new K(this.context),o=new pt(this.context,t);this.context.defaultElementLifeCycleContribution=o,this.context.SVGElementLifeCycleContribution=o;var a={outputSVGElementId:!!x(n)||!!n,outputSVGElementName:!!x(r)||!!r};this.addRenderingPlugin(new ut(a,i,this.context))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultElementLifeCycleContribution,delete this.context.SVGElementLifeCycleContribution}}])}(e.AbstractRendererPlugin),mt=Object.freeze({__proto__:null,CLIP_PATH_PREFIX:at,DEFAULT_VALUE_MAP:it,DefaultElementLifeCycleContribution:pt,ElementSVG:j,G_SVG_PREFIX:ot,Plugin:vt,SHAPE2TAGS:dt,SHAPE_UPDATE_DEPS:ht,SVGRendererPlugin:ut,SVG_ATTR_MAP:nt,TEXT_PATH_PREFIX:ct,createSVGElement:I,updateImageElementAttribute:R,updateLineElementAttribute:N,updatePathElementAttribute:V,updatePolylineElementAttribute:$,updateRectElementAttribute:U,updateTextElementAttribute:ft});function gt(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;o.length>r;r++)-1===e.indexOf(n=o[r])&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}var yt=["offset","composite","computedOffset","easing"],bt=["offset","composite","computedOffset","easing","transformOrigin"],Et=["offset","composite","computedOffset","easing","transformOrigin"],At=["offset","composite","computedOffset","easing","transformOrigin"],St=function(){return o((function t(e){a(this,t),this.context=e,this.canvasConfig=e.config}),[{key:"init",value:function(){var t=this.canvasConfig,e=t.container,n=t.document,r=t.devicePixelRatio;if(this.$container=O(e)?(n||document).getElementById(e):e,this.$container){this.$container.style.position||(this.$container.style.position="relative");var i=I("svg",n);i.setAttribute("width","".concat(this.c