@antv/g-canvas 2.0.18 → 2.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * @antv/g-canvas
3
3
  * @description A renderer implemented by Canvas 2D API
4
- * @version 2.0.18
5
- * @date 10/23/2024, 11:17:15 AM
4
+ * @version 2.0.20
5
+ * @date 11/1/2024, 5:16:48 AM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * @antv/g-canvas
3
3
  * @description A renderer implemented by Canvas 2D API
4
- * @version 2.0.18
5
- * @date 10/23/2024, 11:17:15 AM
4
+ * @version 2.0.20
5
+ * @date 11/1/2024, 5:16:48 AM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * @antv/g-canvas
3
3
  * @description A renderer implemented by Canvas 2D API
4
- * @version 2.0.18
5
- * @date 10/23/2024, 11:17:15 AM
4
+ * @version 2.0.20
5
+ * @date 11/1/2024, 5:16:48 AM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
@@ -10,32 +10,32 @@
10
10
  /*!
11
11
  * @antv/g-plugin-canvas-path-generator
12
12
  * @description A G plugin of path generator with Canvas2D API
13
- * @version 2.0.13
14
- * @date 10/23/2024, 11:14:32 AM
13
+ * @version 2.0.15
14
+ * @date 11/1/2024, 5:13:56 AM
15
15
  * @author AntVis
16
16
  * @docs https://g.antv.antgroup.com/
17
- */function R(e,t){var r=t.cx,n=t.cy;e.arc(void 0===r?0:r,void 0===n?0:n,t.r,0,2*Math.PI,!1)}function I(e,t){var r=t.cx,n=void 0===r?0:r,a=t.cy,i=void 0===a?0:a,o=t.rx,c=t.ry;if(e.ellipse)e.ellipse(n,i,o,c,0,0,2*Math.PI,!1);else{var s=o>c?o:c,l=o>c?1:o/c,u=o>c?c/o:1;e.save(),e.scale(l,u),e.arc(n,i,s,0,2*Math.PI)}}function N(e,r){var n=r.x1,a=r.y1,i=r.x2,o=r.y2,c=r.markerStart,s=r.markerEnd,l=r.markerStartOffset,u=r.markerEndOffset,h=0,f=0,d=0,v=0,p=0;c&&t.isDisplayObject(c)&&l&&(h=Math.cos(p=Math.atan2(o-a,i-n))*(l||0),f=Math.sin(p)*(l||0)),s&&t.isDisplayObject(s)&&u&&(d=Math.cos(p=Math.atan2(a-o,n-i))*(u||0),v=Math.sin(p)*(u||0)),e.moveTo(n+h,a+f),e.lineTo(i+d,o+v)}function D(e,r){var n=r.markerStart,a=r.markerEnd,i=r.markerStartOffset,o=r.markerEndOffset,c=r.d,s=c.absolutePath,l=c.segments,u=0,h=0,f=0,d=0,v=0;if(n&&t.isDisplayObject(n)&&i){var p=y(n.parentNode.getStartTangent(),2),m=p[0],g=p[1];u=Math.cos(v=Math.atan2(m[1]-g[1],m[0]-g[0]))*(i||0),h=Math.sin(v)*(i||0)}if(a&&t.isDisplayObject(a)&&o){var b=y(a.parentNode.getEndTangent(),2),E=b[0],x=b[1];f=Math.cos(v=Math.atan2(E[1]-x[1],E[0]-x[0]))*(o||0),d=Math.sin(v)*(o||0)}for(var w=0;s.length>w;w++){var M=s[w],S=s[w+1],k=0===w&&(0!==u||0!==h),P=(w===s.length-1||S&&("M"===S[0]||"Z"===S[0]))&&0!==f&&0!==d;switch(M[0]){case"M":k?e.moveTo(M[1]+u,M[2]+h):e.moveTo(M[1],M[2]);break;case"L":P?e.lineTo(M[1]+f,M[2]+d):e.lineTo(M[1],M[2]);break;case"Q":e.quadraticCurveTo(M[1],M[2],M[3],M[4]),P&&e.lineTo(M[3]+f,M[4]+d);break;case"C":e.bezierCurveTo(M[1],M[2],M[3],M[4],M[5],M[6]),P&&e.lineTo(M[5]+f,M[6]+d);break;case"A":var O=l[w].arcParams,T=O.cx,A=O.cy,L=O.rx,C=O.ry,R=O.startAngle,I=O.endAngle,N=O.xRotation,D=O.sweepFlag;if(e.ellipse)e.ellipse(T,A,L,C,N,R,I,!!(1-D));else{var j=L>C?L:C,B=L>C?1:L/C,F=L>C?C/L:1;e.translate(T,A),e.rotate(N),e.scale(B,F),e.arc(0,0,j,R,I,!!(1-D)),e.scale(1/B,1/F),e.rotate(-N),e.translate(-T,-A)}P&&e.lineTo(M[6]+f,M[7]+d);break;case"Z":e.closePath()}}}function j(e,r){var n=r.markerStart,a=r.markerEnd,i=r.markerStartOffset,o=r.markerEndOffset,c=r.points.points,s=c.length,l=c[0][0],u=c[0][1],h=c[s-1][0],f=c[s-1][1],d=0,v=0,p=0,y=0,m=0;n&&t.isDisplayObject(n)&&i&&(d=Math.cos(m=Math.atan2(c[1][1]-c[0][1],c[1][0]-c[0][0]))*(i||0),v=Math.sin(m)*(i||0)),a&&t.isDisplayObject(a)&&o&&(p=Math.cos(m=Math.atan2(c[s-1][1]-c[0][1],c[s-1][0]-c[0][0]))*(o||0),y=Math.sin(m)*(o||0)),e.moveTo(l+(d||p),u+(v||y));for(var g=1;s-1>g;g++){var b=c[g];e.lineTo(b[0],b[1])}e.lineTo(h,f)}function B(e,r){var n=r.markerStart,a=r.markerEnd,i=r.markerStartOffset,o=r.markerEndOffset,c=r.points.points,s=c.length,l=c[0][0],u=c[0][1],h=c[s-1][0],f=c[s-1][1],d=0,v=0,p=0,y=0,m=0;n&&t.isDisplayObject(n)&&i&&(d=Math.cos(m=Math.atan2(c[1][1]-c[0][1],c[1][0]-c[0][0]))*(i||0),v=Math.sin(m)*(i||0)),a&&t.isDisplayObject(a)&&o&&(p=Math.cos(m=Math.atan2(c[s-2][1]-c[s-1][1],c[s-2][0]-c[s-1][0]))*(o||0),y=Math.sin(m)*(o||0)),e.moveTo(l+d,u+v);for(var g=1;s-1>g;g++){var b=c[g];e.lineTo(b[0],b[1])}e.lineTo(h+p,f+y)}function F(e,t){var r=t.x,n=void 0===r?0:r,a=t.y,i=void 0===a?0:a,o=t.radius,c=t.width,s=t.height,l=c,u=s;if(o&&o.some((function(e){return 0!==e}))){var h=c>0?1:-1,f=s>0?1:-1,d=h+f===0,v=y(o.map((function(e){return x(e,0,Math.min(Math.abs(l)/2,Math.abs(u)/2))})),4),p=v[0],m=v[1],g=v[2],b=v[3];e.moveTo(h*p+n,i),e.lineTo(l-h*m+n,i),0!==m&&e.arc(l-h*m+n,f*m+i,m,-f*Math.PI/2,h>0?0:Math.PI,d),e.lineTo(l+n,u-f*g+i),0!==g&&e.arc(l-h*g+n,u-f*g+i,g,h>0?0:Math.PI,f>0?Math.PI/2:1.5*Math.PI,d),e.lineTo(h*b+n,u+i),0!==b&&e.arc(h*b+n,u-f*b+i,b,f>0?Math.PI/2:-Math.PI/2,h>0?Math.PI:0,d),e.lineTo(n,f*p+i),0!==p&&e.arc(h*p+n,f*p+i,p,h>0?Math.PI:0,f>0?1.5*Math.PI:Math.PI/2,d)}else e.rect(n,i,l,u)}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)}),O(),function(){var e,t=(e=new M(2),M!=Float32Array&&(e[0]=0,e[1]=0),e)}();var _=function(e){function r(){var e;o(this,r);for(var t=arguments.length,n=Array(t),a=0;t>a;a++)n[a]=arguments[a];return(e=u(this,r,[].concat(n))).name="canvas-path-generator",e}return f(r,e),i(r,[{key:"init",value:function(){var e,r=(d(d(d(d(d(d(d(d(d(d(e={},t.Shape.CIRCLE,R),t.Shape.ELLIPSE,I),t.Shape.RECT,F),t.Shape.LINE,N),t.Shape.POLYLINE,B),t.Shape.POLYGON,j),t.Shape.PATH,D),t.Shape.TEXT,void 0),t.Shape.GROUP,void 0),t.Shape.IMAGE,void 0),d(d(e,t.Shape.HTML,void 0),t.Shape.MESH,void 0));this.context.pathGeneratorFactory=r}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(t.AbstractRendererPlugin),G=Object.freeze({__proto__:null,Plugin:_});function H(){H=function(){return t};var e,t={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},c=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=Object.create((t&&t.prototype instanceof g?t:g).prototype),o=new C(n||[]);return i(a,"_invoke",{value:O(e,r,o)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var d="suspendedStart",v="suspendedYield",p="executing",y="completed",m={};function g(){}function b(){}function E(){}var x={};u(x,c,(function(){return this}));var w=Object.getPrototypeOf,M=w&&w(w(R([])));M&&M!==n&&a.call(M,c)&&(x=M);var S=E.prototype=g.prototype=Object.create(x);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,c,s){var l=f(e[i],e,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==r(h)&&a.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,c,s)}),(function(e){n("throw",e,c,s)})):t.resolve(h).then((function(e){u.value=e,c(u)}),(function(e){return n("throw",e,c,s)}))}s(l.arg)}var o;i(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,a){n(e,r,t,a)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var a=d;return function(i,o){if(a===p)throw Error("Generator is already running");if(a===y){if("throw"===i)throw o;return{value:e,done:!0}}for(n.method=i,n.arg=o;;){var c=n.delegate;if(c){var s=T(c,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===d)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=f(t,r,n);if("normal"===l.type){if(a=n.done?y:v,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=y,n.method="throw",n.arg=l.arg)}}}function T(t,r){var n=r.method,a=t.iterator[n];if(a===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(a,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function R(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(a.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}return b.prototype=E,i(S,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:b,configurable:!0}),b.displayName=u(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,u(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(P.prototype),u(P.prototype,s,(function(){return this})),t.AsyncIterator=P,t.async=function(e,r,n,a,i){void 0===i&&(i=Promise);var o=new P(h(e,r,n,a),i);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},k(S),u(S,l,"Generator"),u(S,c,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=R,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,a){return c.type="throw",c.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],c=o.completion;if("root"===o.tryLoc)return n("end");if(this.prev>=o.tryLoc){var s=a.call(o,"catchLoc"),l=a.call(o,"finallyLoc");if(s&&l){if(o.catchLoc>this.prev)return n(o.catchLoc,!0);if(o.finallyLoc>this.prev)return n(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return n(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(this.prev>=n.tryLoc&&a.call(n,"finallyLoc")&&n.finallyLoc>this.prev){var i=n;break}}i&&("break"===e||"continue"===e)&&t>=i.tryLoc&&i.finallyLoc>=t&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;L(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function z(e,t,r,n,a,i,o){try{var c=e[i](o),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,a)}function $(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){z(i,n,a,o,c,"next",e)}function c(e){z(i,n,a,o,c,"throw",e)}o(void 0)}))}}function W(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}
17
+ */function R(e,t){var r=t.cx,n=t.cy;e.arc(void 0===r?0:r,void 0===n?0:n,t.r,0,2*Math.PI,!1)}function I(e,t){var r=t.cx,n=void 0===r?0:r,a=t.cy,i=void 0===a?0:a,o=t.rx,c=t.ry;if(e.ellipse)e.ellipse(n,i,o,c,0,0,2*Math.PI,!1);else{var s=o>c?o:c,l=o>c?1:o/c,u=o>c?c/o:1;e.save(),e.scale(l,u),e.arc(n,i,s,0,2*Math.PI)}}function N(e,r){var n=r.x1,a=r.y1,i=r.x2,o=r.y2,c=r.markerStart,s=r.markerEnd,l=r.markerStartOffset,u=r.markerEndOffset,h=0,f=0,d=0,v=0,p=0;c&&t.isDisplayObject(c)&&l&&(h=Math.cos(p=Math.atan2(o-a,i-n))*(l||0),f=Math.sin(p)*(l||0)),s&&t.isDisplayObject(s)&&u&&(d=Math.cos(p=Math.atan2(a-o,n-i))*(u||0),v=Math.sin(p)*(u||0)),e.moveTo(n+h,a+f),e.lineTo(i+d,o+v)}function D(e,r){var n=r.markerStart,a=r.markerEnd,i=r.markerStartOffset,o=r.markerEndOffset,c=r.d,s=c.absolutePath,l=c.segments,u=0,h=0,f=0,d=0,v=0;if(n&&t.isDisplayObject(n)&&i){var p=y(n.parentNode.getStartTangent(),2),m=p[0],g=p[1];u=Math.cos(v=Math.atan2(m[1]-g[1],m[0]-g[0]))*(i||0),h=Math.sin(v)*(i||0)}if(a&&t.isDisplayObject(a)&&o){var b=y(a.parentNode.getEndTangent(),2),E=b[0],x=b[1];f=Math.cos(v=Math.atan2(E[1]-x[1],E[0]-x[0]))*(o||0),d=Math.sin(v)*(o||0)}for(var w=0;s.length>w;w++){var M=s[w],S=M[0],k=s[w+1],P=(w===s.length-1||k&&("M"===k[0]||"Z"===k[0]))&&0!==f&&0!==d,O=y(0===w&&(0!==u||0!==h)?[u,h]:[0,0],2),T=O[0],A=O[1],L=y(P?[f,d]:[0,0],2),C=L[0],R=L[1];switch(S){case"M":e.moveTo(M[1]+T,M[2]+A);break;case"L":e.lineTo(M[1]+C,M[2]+R);break;case"Q":e.quadraticCurveTo(M[1],M[2],M[3]+C,M[4]+R);break;case"C":e.bezierCurveTo(M[1],M[2],M[3],M[4],M[5]+C,M[6]+R);break;case"A":var I=l[w].arcParams,N=I.cx,D=I.cy,j=I.rx,B=I.ry,F=I.startAngle,_=I.endAngle,G=I.xRotation,H=I.sweepFlag;if(e.ellipse)e.ellipse(N,D,j,B,G,F,_,!!(1-H));else{var z=j>B?j:B,$=j>B?1:j/B,W=j>B?B/j:1;e.translate(N,D),e.rotate(G),e.scale($,W),e.arc(0,0,z,F,_,!!(1-H)),e.scale(1/$,1/W),e.rotate(-G),e.translate(-N,-D)}P&&e.lineTo(M[6]+f,M[7]+d);break;case"Z":e.closePath()}}}function j(e,r){var n=r.markerStart,a=r.markerEnd,i=r.markerStartOffset,o=r.markerEndOffset,c=r.points.points,s=c.length,l=c[0][0],u=c[0][1],h=c[s-1][0],f=c[s-1][1],d=0,v=0,p=0,y=0,m=0;n&&t.isDisplayObject(n)&&i&&(d=Math.cos(m=Math.atan2(c[1][1]-c[0][1],c[1][0]-c[0][0]))*(i||0),v=Math.sin(m)*(i||0)),a&&t.isDisplayObject(a)&&o&&(p=Math.cos(m=Math.atan2(c[s-1][1]-c[0][1],c[s-1][0]-c[0][0]))*(o||0),y=Math.sin(m)*(o||0)),e.moveTo(l+(d||p),u+(v||y));for(var g=1;s-1>g;g++){var b=c[g];e.lineTo(b[0],b[1])}e.lineTo(h,f)}function B(e,r){var n=r.markerStart,a=r.markerEnd,i=r.markerStartOffset,o=r.markerEndOffset,c=r.points.points,s=c.length,l=c[0][0],u=c[0][1],h=c[s-1][0],f=c[s-1][1],d=0,v=0,p=0,y=0,m=0;n&&t.isDisplayObject(n)&&i&&(d=Math.cos(m=Math.atan2(c[1][1]-c[0][1],c[1][0]-c[0][0]))*(i||0),v=Math.sin(m)*(i||0)),a&&t.isDisplayObject(a)&&o&&(p=Math.cos(m=Math.atan2(c[s-2][1]-c[s-1][1],c[s-2][0]-c[s-1][0]))*(o||0),y=Math.sin(m)*(o||0)),e.moveTo(l+d,u+v);for(var g=1;s-1>g;g++){var b=c[g];e.lineTo(b[0],b[1])}e.lineTo(h+p,f+y)}function F(e,t){var r=t.x,n=void 0===r?0:r,a=t.y,i=void 0===a?0:a,o=t.radius,c=t.width,s=t.height,l=c,u=s;if(o&&o.some((function(e){return 0!==e}))){var h=c>0?1:-1,f=s>0?1:-1,d=h+f===0,v=y(o.map((function(e){return x(e,0,Math.min(Math.abs(l)/2,Math.abs(u)/2))})),4),p=v[0],m=v[1],g=v[2],b=v[3];e.moveTo(h*p+n,i),e.lineTo(l-h*m+n,i),0!==m&&e.arc(l-h*m+n,f*m+i,m,-f*Math.PI/2,h>0?0:Math.PI,d),e.lineTo(l+n,u-f*g+i),0!==g&&e.arc(l-h*g+n,u-f*g+i,g,h>0?0:Math.PI,f>0?Math.PI/2:1.5*Math.PI,d),e.lineTo(h*b+n,u+i),0!==b&&e.arc(h*b+n,u-f*b+i,b,f>0?Math.PI/2:-Math.PI/2,h>0?Math.PI:0,d),e.lineTo(n,f*p+i),0!==p&&e.arc(h*p+n,f*p+i,p,h>0?Math.PI:0,f>0?1.5*Math.PI:Math.PI/2,d)}else e.rect(n,i,l,u)}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)}),O(),function(){var e,t=(e=new M(2),M!=Float32Array&&(e[0]=0,e[1]=0),e)}();var _=function(e){function r(){var e;o(this,r);for(var t=arguments.length,n=Array(t),a=0;t>a;a++)n[a]=arguments[a];return(e=u(this,r,[].concat(n))).name="canvas-path-generator",e}return f(r,e),i(r,[{key:"init",value:function(){var e,r=(d(d(d(d(d(d(d(d(d(d(e={},t.Shape.CIRCLE,R),t.Shape.ELLIPSE,I),t.Shape.RECT,F),t.Shape.LINE,N),t.Shape.POLYLINE,B),t.Shape.POLYGON,j),t.Shape.PATH,D),t.Shape.TEXT,void 0),t.Shape.GROUP,void 0),t.Shape.IMAGE,void 0),d(d(e,t.Shape.HTML,void 0),t.Shape.MESH,void 0));this.context.pathGeneratorFactory=r}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(t.AbstractRendererPlugin),G=Object.freeze({__proto__:null,Plugin:_});function H(){H=function(){return t};var e,t={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},c=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=Object.create((t&&t.prototype instanceof g?t:g).prototype),o=new C(n||[]);return i(a,"_invoke",{value:O(e,r,o)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var d="suspendedStart",v="suspendedYield",p="executing",y="completed",m={};function g(){}function b(){}function E(){}var x={};u(x,c,(function(){return this}));var w=Object.getPrototypeOf,M=w&&w(w(R([])));M&&M!==n&&a.call(M,c)&&(x=M);var S=E.prototype=g.prototype=Object.create(x);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function n(i,o,c,s){var l=f(e[i],e,o);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==r(h)&&a.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,c,s)}),(function(e){n("throw",e,c,s)})):t.resolve(h).then((function(e){u.value=e,c(u)}),(function(e){return n("throw",e,c,s)}))}s(l.arg)}var o;i(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,a){n(e,r,t,a)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var a=d;return function(i,o){if(a===p)throw Error("Generator is already running");if(a===y){if("throw"===i)throw o;return{value:e,done:!0}}for(n.method=i,n.arg=o;;){var c=n.delegate;if(c){var s=T(c,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===d)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var l=f(t,r,n);if("normal"===l.type){if(a=n.done?y:v,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=y,n.method="throw",n.arg=l.arg)}}}function T(t,r){var n=r.method,a=t.iterator[n];if(a===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(a,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function R(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(a.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(r(t)+" is not iterable")}return b.prototype=E,i(S,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:b,configurable:!0}),b.displayName=u(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,u(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(P.prototype),u(P.prototype,s,(function(){return this})),t.AsyncIterator=P,t.async=function(e,r,n,a,i){void 0===i&&(i=Promise);var o=new P(h(e,r,n,a),i);return t.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},k(S),u(S,l,"Generator"),u(S,c,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=R,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,a){return c.type="throw",c.arg=t,r.next=n,a&&(r.method="next",r.arg=e),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],c=o.completion;if("root"===o.tryLoc)return n("end");if(this.prev>=o.tryLoc){var s=a.call(o,"catchLoc"),l=a.call(o,"finallyLoc");if(s&&l){if(o.catchLoc>this.prev)return n(o.catchLoc,!0);if(o.finallyLoc>this.prev)return n(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return n(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(this.prev>=n.tryLoc&&a.call(n,"finallyLoc")&&n.finallyLoc>this.prev){var i=n;break}}i&&("break"===e||"continue"===e)&&t>=i.tryLoc&&i.finallyLoc>=t&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;L(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:R(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function z(e,t,r,n,a,i,o){try{var c=e[i](o),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,a)}function $(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){z(i,n,a,o,c,"next",e)}function c(e){z(i,n,a,o,c,"throw",e)}o(void 0)}))}}function W(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}
18
18
  /*!
19
19
  * @antv/g-math
20
20
  * @description Geometry util
21
21
  * @version 3.0.0
22
- * @date 10/23/2024, 11:13:25 AM
22
+ * @date 11/1/2024, 5:12:47 AM
23
23
  * @author AntVis
24
24
  * @docs https://g.antv.antgroup.com/
25
25
  */function U(e,t,r,n){var a=e-r,i=t-n;return Math.sqrt(a*a+i*i)}var Y=1e-4;function q(e,t,r,n,a,i){var o=-1,c=1/0,s=[r,n],l=20;i&&i>200&&(l=i/10);for(var u=1/l,h=u/10,f=0;l>=f;f++){var d=f*u,v=[a.apply(void 0,W(e.concat([d]))),a.apply(void 0,W(t.concat([d])))],p=U(s[0],s[1],v[0],v[1]);c>p&&(o=d,c=p)}if(0===o)return{x:e[0],y:t[0]};if(1===o){var y=e.length;return{x:e[y-1],y:t[y-1]}}c=1/0;for(var m=0;32>m&&Y<=h;m++){var g=o-h,b=o+h,E=[a.apply(void 0,W(e.concat([g]))),a.apply(void 0,W(t.concat([g])))],x=U(s[0],s[1],E[0],E[1]);if(g>=0&&c>x)o=g,c=x;else{var w=[a.apply(void 0,W(e.concat([b]))),a.apply(void 0,W(t.concat([b])))],M=U(s[0],s[1],w[0],w[1]);1>=b&&c>M?(o=b,c=M):h*=.5}}return{x:a.apply(void 0,W(e.concat([o]))),y:a.apply(void 0,W(t.concat([o])))}}function V(e,t,r,n,a,i){var o=[r-e,n-t];if(function(e,t){return e[0]===t[0]&&e[1]===t[1]}(o,[0,0]))return Math.sqrt((a-e)*(a-e)+(i-t)*(i-t));var c=[-o[1],o[0]];return function(e,t){var r=t[0],n=t[1],a=r*r+n*n;a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a}(c,c),Math.abs(function(e,t){return e[0]*t[0]+e[1]*t[1]}([a-e,i-t],c))}function X(e,t,r,n,a){var i=1-a;return i*i*i*e+3*t*a*i*i+3*r*a*a*i+n*a*a*a}function Q(e,t,r,n,a,i,o,c,s,l,u){var h=function(e,t,r,n,a,i,o,c,s,l,u){return q([e,r,a,o],[t,n,i,c],s,l,X,u)}(e,t,r,n,a,i,o,c,s,l,u);return U(h.x,h.y,s,l)}function Z(e,t,r,n){var a=1-n;return a*a*e+2*n*a*t+n*n*r}function K(e,t,r,n,a,i,o,c){var s=function(e,t,r,n,a,i,o,c){return q([e,r,a],[t,n,i],o,c,Z)}(e,t,r,n,a,i,o,c);return U(s.x,s.y,o,c)}function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ee(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}
26
26
  /*!
27
27
  * @antv/g-plugin-canvas-picker
28
28
  * @description A G plugin for picking in canvas
29
- * @version 2.0.15
30
- * @date 10/23/2024, 11:16:32 AM
29
+ * @version 2.0.17
30
+ * @date 11/1/2024, 5:16:01 AM
31
31
  * @author AntVis
32
32
  * @docs https://g.antv.antgroup.com/
33
33
  */var te=O(),re=O(),ne=O(),ae=S(),ie=function(){function e(){var r=this;o(this,e),this.isHit=function(e,n,a,i){var o,c,s,l,u,h,f,d,v,p,y,m,g,b,E,x,w,M,S,k,P,O,L,C,R,I,N,D,j,B,F,_=r.context.pointInPathPickerFactory[e.nodeName];if(_){var G=(o=ae,(F=(S=(s=(c=a)[0])*(d=c[5])-(l=c[1])*(f=c[4]))*(B=(g=c[10])*(M=c[15])-(b=c[11])*(w=c[14]))-(k=s*(v=c[6])-(u=c[2])*f)*(j=(m=c[9])*M-b*(x=c[13]))+(P=s*(p=c[7])-(h=c[3])*f)*(D=m*w-g*x)+(O=l*v-u*d)*(N=(y=c[8])*M-b*(E=c[12]))-(L=l*p-h*d)*(I=y*w-g*E)+(C=u*p-h*v)*(R=y*x-m*E))?(o[0]=(d*B-v*j+p*D)*(F=1/F),o[1]=(u*j-l*B-h*D)*F,o[2]=(x*C-w*L+M*O)*F,o[3]=(g*L-m*C-b*O)*F,o[4]=(v*N-f*B-p*I)*F,o[5]=(s*B-u*N+h*I)*F,o[6]=(w*P-E*C-M*k)*F,o[7]=(y*C-g*P+b*k)*F,o[8]=(f*j-d*N+p*R)*F,o[9]=(l*N-s*j-h*R)*F,o[10]=(E*L-x*P+M*S)*F,o[11]=(m*P-y*L-b*S)*F,o[12]=(d*I-f*D-v*R)*F,o[13]=(s*D-l*I+u*R)*F,o[14]=(x*k-E*O-w*S)*F,o[15]=(y*O-m*k+g*S)*F,o):null),H=A(re,T(ne,n[0],n[1],0),G);if(_(e,new t.Point(H[0],H[1]),i,r.isPointInPath,r.context,r.runtime))return!0}return!1},this.isPointInPath=function(e,t){var n=r.runtime.offscreenCanvasCreator.getOrCreateContext(r.context.config.offscreenCanvas),a=r.context.pathGeneratorFactory[e.nodeName];return a&&(n.beginPath(),a(n,e.parsedStyle),n.closePath()),n.isPointInPath(t.x,t.y)}}return i(e,[{key:"apply",value:function(t,r){var n,a=this,i=t.renderingService,o=t.renderingContext;this.context=t,this.runtime=r;var c=null===(n=o.root)||void 0===n?void 0:n.ownerDocument;i.hooks.pick.tapPromise(e.tag,function(){var e=$(H().mark((function e(t){return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.pick(c,t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),i.hooks.pickSync.tap(e.tag,(function(e){return a.pick(c,e)}))}},{key:"pick",value:function(e,r){var n,a=r.topmost,i=r.position,o=T(te,i.x,i.y,0),c=[],s=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=p(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return e.length>n?{done:!1,value:e[n++]}:{done:!0}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){c=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(c)throw i}}}}(e.elementsFromBBox(o[0],o[1],o[0],o[1]));try{for(s.s();!(n=s.n()).done;){var l=n.value,u=l.getWorldTransform();if(this.isHit(l,o,u,!1)){var h=t.findClosestClipPathTarget(l);if(h){var f=h.parsedStyle.clipPath;if(this.isHit(f,o,f.getWorldTransform(),!0)){if(a)return r.picked=[l],r;c.push(l)}}else{if(a)return r.picked=[l],r;c.push(l)}}}}catch(e){s.e(e)}finally{s.f()}return r.picked=c,r}}])}();function oe(e,r,n){var a=e.parsedStyle,i=a.cx,o=a.cy,c=a.r,s=a.fill,l=a.stroke,u=a.lineWidth,h=a.increasedLineWidthForHitTesting,f=a.pointerEvents,d=void 0===f?"auto":f,v=((void 0===u?1:u)+(void 0===h?0:h))/2,p=U(void 0===i?0:i,void 0===o?0:o,r.x,r.y),m=y(t.isFillOrStrokeAffected(d,s,l),2),g=m[0],b=m[1];return g&&b||n?c+v>=p:g?c>=p:!!b&&(p>=c-v&&c+v>=p)}function ce(e,t,r,n){return e/(r*r)+t/(n*n)}function se(e,r,n){var a=e.parsedStyle,i=a.cx,o=void 0===i?0:i,c=a.cy,s=void 0===c?0:c,l=a.rx,u=a.ry,h=a.lineWidth,f=void 0===h?1:h,d=a.increasedLineWidthForHitTesting,v=void 0===d?0:d,p=a.pointerEvents,m=r.x,g=r.y,b=y(t.isFillOrStrokeAffected(void 0===p?"auto":p,a.fill,a.stroke),2),E=b[0],x=b[1],w=(f+v)/2,M=(m-o)*(m-o),S=(g-s)*(g-s);return E&&x||n?1>=ce(M,S,l+w,u+w):E?1>=ce(M,S,l,u):!!x&&(ce(M,S,l-w,u-w)>=1&&1>=ce(M,S,l+w,u+w))}function le(e,t,r,n,a,i){return!(e>a||a>e+r||t>i||i>t+n)}function ue(e,t,r,n,a,i,o,c){var s=(Math.atan2(c-t,o-e)+2*Math.PI)%(2*Math.PI),l={x:e+r*Math.cos(s),y:t+r*Math.sin(s)};return U(l.x,l.y,o,c)<=i/2}function he(e,t,r,n,a,i,o){var c=a/2;return!(Math.min(e,r)-c>i||i>Math.max(e,r)+c||Math.min(t,n)-c>o||o>Math.max(t,n)+c)&&V(e,t,r,n,i,o)<=a/2}function fe(e,t,r,n,a){var i=e.length;if(2>i)return!1;for(var o=0;i-1>o;o++){if(he(e[o][0],e[o][1],e[o+1][0],e[o+1][1],t,r,n))return!0}if(a){var c=e[0],s=e[i-1];if(he(c[0],c[1],s[0],s[1],t,r,n))return!0}return!1}ie.tag="CanvasPicker";var de=1e-6;function ve(e){return de>Math.abs(e)?0:0>e?-1:1}function pe(e,t,r){return!((r[0]-e[0])*(t[1]-e[1])!=(t[0]-e[0])*(r[1]-e[1])||Math.min(e[0],t[0])>r[0]||r[0]>Math.max(e[0],t[0])||Math.min(e[1],t[1])>r[1]||r[1]>Math.max(e[1],t[1]))}function ye(e,t,r){var n=!1,a=e.length;if(2>=a)return!1;for(var i=0;a>i;i++){var o=e[i],c=e[(i+1)%a];if(pe(o,c,[t,r]))return!0;ve(o[1]-r)>0!=ve(c[1]-r)>0&&0>ve(t-(r-o[1])*(o[0]-c[0])/(o[1]-c[1])-o[0])&&(n=!n)}return n}function me(e,t,r){for(var n=!1,a=0;e.length>a;a++){if(n=ye(e[a],t,r))break}return n}function ge(e,r,n){var a=e.parsedStyle,i=a.x1,o=a.y1,c=a.x2,s=a.y2,l=a.lineWidth,u=void 0===l?1:l,h=a.increasedLineWidthForHitTesting,f=void 0===h?0:h,d=a.pointerEvents;return!(!y(t.isFillOrStrokeAffected(void 0===d?"auto":d,a.fill,a.stroke),2)[1]&&!n||!u)&&he(i,o,c,s,u+f,r.x,r.y)}function be(e,r,n,a,i,o){var c=e.parsedStyle,s=c.lineWidth,l=void 0===s?1:s,u=c.increasedLineWidthForHitTesting,h=void 0===u?0:u,f=c.d,d=c.pointerEvents,v=f.segments,p=f.hasArc,m=f.polylines,g=f.polygons,b=y(t.isFillOrStrokeAffected(void 0===d?"auto":d,(null==g?void 0:g.length)&&c.fill,c.stroke),2),E=b[0],x=b[1],w=t.getOrCalculatePathTotalLength(e),M=!1;return E||n?M=p?a(e,r):me(g,r.x,r.y)||me(m,r.x,r.y):((x||n)&&(M=function(e,t,r,n,a){for(var i=!1,o=t/2,c=0;e.length>c;c++){var s=e[c],l=s.currentPoint,u=s.params,h=s.prePoint,f=s.box;if(!f||le(f.x-o,f.y-o,f.width+t,f.height+t,r,n))switch(s.command){case"L":case"Z":if(i=he(h[0],h[1],l[0],l[1],t,r,n))return!0;break;case"Q":if(i=t/2>=K(h[0],h[1],u[1],u[2],u[3],u[4],r,n))return!0;break;case"C":if(i=t/2>=Q(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],r,n,a))return!0;break;case"A":s.cubicParams||(s.cubicParams=C(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=s.cubicParams,v=h,p=0;d.length>p;p+=6){var y=Q(v[0],v[1],d[p],d[p+1],d[p+2],d[p+3],d[p+4],d[p+5],r,n,a);if(v=[d[p+4],d[p+5]],i=t/2>=y)return!0}}}return i}(v,l+h,r.x,r.y,w)),M)}function Ee(e,r,n){var a=e.parsedStyle,i=a.lineWidth,o=void 0===i?1:i,c=a.increasedLineWidthForHitTesting,s=void 0===c?0:c,l=a.points,u=a.pointerEvents,h=y(t.isFillOrStrokeAffected(void 0===u?"auto":u,a.fill,a.stroke),2),f=h[0],d=!1;return(h[1]||n)&&(d=fe(l.points,o+s,r.x,r.y,!0)),d||!f&&!n||(d=ye(l.points,r.x,r.y)),d}function xe(e,r,n){var a=e.parsedStyle,i=a.lineWidth,o=void 0===i?1:i,c=a.increasedLineWidthForHitTesting,s=void 0===c?0:c,l=a.points,u=a.pointerEvents;return!(!y(t.isFillOrStrokeAffected(void 0===u?"auto":u,a.fill,a.stroke),2)[1]&&!n||!o)&&fe(l.points,o+s,r.x,r.y,!1)}function we(e,r,n,a,i){var o=e.parsedStyle,c=o.radius,s=o.lineWidth,l=void 0===s?1:s,u=o.increasedLineWidthForHitTesting,h=void 0===u?0:u,f=o.x,d=void 0===f?0:f,v=o.y,p=void 0===v?0:v,m=o.width,g=o.height,b=o.pointerEvents,E=y(t.isFillOrStrokeAffected(void 0===b?"auto":b,o.fill,o.stroke),2),w=E[0],M=E[1],S=l+h;if(c&&c.some((function(e){return 0!==e}))){var k=!1;return(M||n)&&(k=function(e,t,r,n,a,i,o,c){var s=y(a,4),l=s[0],u=s[1],h=s[2],f=s[3];return he(e+l,t,e+r-u,t,i,o,c)||he(e+r,t+u,e+r,t+n-h,i,o,c)||he(e+r-h,t+n,e+f,t+n,i,o,c)||he(e,t+n-f,e,t+l,i,o,c)||ue(e+r-u,t+u,u,0,0,i,o,c)||ue(e+r-h,t+n-h,h,0,0,i,o,c)||ue(e+f,t+n-f,f,0,0,i,o,c)||ue(e+l,t+l,l,0,0,i,o,c)}(d,p,m,g,c.map((function(e){return x(e,0,Math.min(Math.abs(m)/2,Math.abs(g)/2))})),S,r.x,r.y)),k||!w&&!n||(k=a(e,r)),k}var P=S/2;return w&&M||n?le(d-P,p-P,m+P,g+P,r.x,r.y):w?le(d,p,m,g,r.x,r.y):!!M&&function(e,t,r,n,a,i,o){var c=a/2;return le(e-c,t-c,r,a,i,o)||le(e+r-c,t-c,a,n,i,o)||le(e+c,t+n-c,r,a,i,o)||le(e-c,t+c,a,n,i,o)}(d,p,m,g,S,r.x,r.y)}function Me(e,r,n,a,i,o){var c=e.parsedStyle,s=c.pointerEvents,l=c.x,u=void 0===l?0:l,h=c.y,f=void 0===h?0:h,d=c.width,v=c.height;if("non-transparent-pixel"===(void 0===s?"auto":s)){var p=i.config.offscreenCanvas,y=o.offscreenCanvasCreator.getOrCreateCanvas(p),m=o.offscreenCanvasCreator.getOrCreateContext(p,{willReadFrequently:!0});return y.width=d,y.height=v,i.defaultStyleRendererFactory[t.Shape.IMAGE].render(m,ee(ee({},e.parsedStyle),{},{x:0,y:0}),e,void 0,void 0,void 0),m.getImageData(r.x-u,r.y-f,1,1).data.every((function(e){return 0!==e}))}return!0}function Se(e,t,r,n){var a=e.getGeometryBounds();return!(a.min[0]>t.x||a.min[1]>t.y||t.x>a.max[0]||t.y>a.max[1])}var ke=function(e){function r(){var e;o(this,r);for(var t=arguments.length,n=Array(t),a=0;t>a;a++)n[a]=arguments[a];return(e=u(this,r,[].concat(n))).name="canvas-picker",e}return f(r,e),i(r,[{key:"init",value:function(){var e,r=(d(d(d(d(d(d(d(d(d(d(e={},t.Shape.CIRCLE,oe),t.Shape.ELLIPSE,se),t.Shape.RECT,we),t.Shape.LINE,ge),t.Shape.POLYLINE,xe),t.Shape.POLYGON,Ee),t.Shape.PATH,be),t.Shape.TEXT,Se),t.Shape.GROUP,null),t.Shape.IMAGE,Me),d(d(e,t.Shape.HTML,null),t.Shape.MESH,null));this.context.pointInPathPickerFactory=r,this.addRenderingPlugin(new ie)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(t.AbstractRendererPlugin),Pe=Object.freeze({__proto__:null,Plugin:ke});function Oe(e,t){if(!{}.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Te=0;function Ae(e){return"__private_"+Te+++"_"+e}
34
34
  /*!
35
35
  * @antv/g-plugin-image-loader
36
36
  * @description A G plugin for loading image
37
- * @version 2.0.13
38
- * @date 10/23/2024, 11:14:57 AM
37
+ * @version 2.0.15
38
+ * @date 11/1/2024, 5:14:22 AM
39
39
  * @author AntVis
40
40
  * @docs https://g.antv.antgroup.com/
41
41
  */var Le=Ae("cacheStore"),Ce=function(){return i((function e(){o(this,e),Object.defineProperty(this,Le,{writable:!0,value:new Map})}),[{key:"has",value:function(e){return Oe(this,Le)[Le].has(e)}},{key:"put",value:function(e,t,r){return!Oe(this,Le)[Le].has(e)&&(Oe(this,Le)[Le].set(e,{value:t,counter:new Set([r])}),!0)}},{key:"get",value:function(e,t){var r=Oe(this,Le)[Le].get(e);return r?(r.counter.add(t),r.value):null}},{key:"update",value:function(e,t,r){var n=Oe(this,Le)[Le].get(e);return!!n&&(n.value=ee(ee({},n.value),t),n.counter.add(r),!0)}},{key:"release",value:function(e,t){var r=Oe(this,Le)[Le].get(e);return!!r&&(r.counter.delete(t),r.counter.size>0||Oe(this,Le)[Le].delete(e),!0)}},{key:"releaseRef",value:function(e){var t=this;Oe(this,Le)[Le].keys().forEach((function(r){t.release(r,e)}))}},{key:"getSize",value:function(){return Oe(this,Le)[Le].size}},{key:"clear",value:function(){Oe(this,Le)[Le].clear()}}])}(),Re=[],Ie=[],Ne=function(){function e(){o(this,e)}return i(e,null,[{key:"stop",value:function(){e.rafId&&((arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.api).cancelAnimationFrame(e.rafId),e.rafId=null)}},{key:"executeTask",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.api;(Re.length>0||Ie.length>0)&&(Ie.forEach((function(e){return e()})),Ie=Re.splice(0,e.TASK_NUM_PER_FRAME),e.rafId=t.requestAnimationFrame((function(){e.executeTask(t)})))}},{key:"sliceImage",value:function(t,r,n){for(var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.api,o=t.naturalWidth||t.width,c=t.naturalHeight||t.height,s=r-a,l=n-a,u=Math.ceil(o/s),h=Math.ceil(c/l),f={tileSize:[r,n],gridSize:[h,u],tiles:Array(h).fill(null).map((function(){return Array(u).fill(null)}))},d=function(e){for(var a=function(a){Re.push((function(){var u=a*s,h=e*l,d=[Math.min(r,o-u),Math.min(n,c-h)],v=d[0],p=d[1],y=i.createCanvas();y.width=r,y.height=n,y.getContext("2d").drawImage(t,u,h,v,p,0,0,v,p),f.tiles[e][a]={x:u,y:h,tileX:a,tileY:e,data:y}}))},h=0;u>h;h++)a(h)},v=0;h>v;v++)d(v);return e.stop(),e.executeTask(),f}}])}();Ne.TASK_NUM_PER_FRAME=10;var De=new Ce,je=function(){return i((function e(t,r){o(this,e),this.imageCache={},this.gradientCache={},this.patternCache={},this.context=t,this.runtime=r}),[{key:"getImageSync",value:function(e,t,r){var n=E(e)?e:e.src;if(De.has(n)){var a=De.get(n,t);if(a.img.complete)return null==r||r(a),a}return this.getOrCreateImage(e,t).then((function(e){null==r||r(e)})).catch((function(){})),null}},{key:"getOrCreateImage",value:function(e,r){var n=E(e)?e:e.src;if(!E(e)&&!De.has(n)){var a={img:e,size:[e.naturalWidth||e.width,e.naturalHeight||e.height],tileSize:Be(e)};De.put(n,a,r)}if(De.has(n)){var i=De.get(n,r);return i.img.complete?Promise.resolve(i):new Promise((function(e,t){i.img.addEventListener("load",(function(){i.tileSize=Be(i.img),e(i)})),i.img.addEventListener("error",(function(e){t(e)}))}))}var o=this.context.config.createImage;return new Promise((function(e,a){var i;if(o?i=o(n):t.isBrowser&&(i=new window.Image),i){var c={img:i,size:[0,0],tileSize:Be(i)};De.put(n,c,r),i.onload=function(){c.size=[i.naturalWidth||i.width,i.naturalHeight||i.height],c.tileSize=Be(c.img),e(c)},i.onerror=function(e){a(e)},i.crossOrigin="Anonymous",i.src=n}}))}},{key:"createDownSampledImage",value:(r=$(H().mark((function e(t,r){var n,a,i,o,c,s,l,u,h,f,d,v,p,m;return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getOrCreateImage(t,r);case 2:if(void 0===(n=e.sent).downSamplingRate){e.next=5;break}return e.abrupt("return",n);case 5:if(c=void 0===(o=(i="boolean"==typeof(a=this.context.config.enableLargeImageOptimization)?{}:a).maxDownSampledImageSize)?2048:o,l=void 0===(s=i.downSamplingRateThreshold)?.5:s,u=this.runtime.globalThis.createImageBitmap,h=y(n.size,2),v=n.img,p=Math.min((c+c)/((f=h[0])+(d=h[1])),Math.max(.01,Math.min(l,.5))),m=ee(ee({},n),{},{downSamplingRate:p}),De.update(n.img.src,m,r),!u){e.next=25;break}return e.prev=14,e.next=17,u(n.img,{resizeWidth:f*p,resizeHeight:d*p});case 17:v=e.sent,e.next=23;break;case 20:e.prev=20,e.t0=e.catch(14),p=1;case 23:e.next=26;break;case 25:p=1;case 26:return m=ee(ee({},this.getImageSync(t,r)),{},{downSampled:v,downSamplingRate:p}),De.update(n.img.src,m,r),e.abrupt("return",m);case 29:case"end":return e.stop()}}),e,this,[[14,20]])}))),function(e,t){return r.apply(this,arguments)})},{key:"createImageTiles",value:(e=$(H().mark((function e(r,n,a){var i,o,c;return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getOrCreateImage(r,a);case 2:return i=e.sent,Ne.api={requestAnimationFrame:(o=a.ownerDocument.defaultView).requestAnimationFrame,cancelAnimationFrame:o.cancelAnimationFrame,createCanvas:function(){return t.OffscreenCanvasCreator.createCanvas()}},c=ee(ee({},i),Ne.sliceImage(i.img,i.tileSize[0],i.tileSize[0])),De.update(i.img.src,c,a),e.abrupt("return",c);case 8:case"end":return e.stop()}}),e,this)}))),function(t,r,n){return e.apply(this,arguments)})},{key:"releaseImage",value:function(e,t){De.release(E(e)?e:e.src,t)}},{key:"releaseImageRef",value:function(e){De.releaseRef(e)}},{key:"getOrCreatePatternSync",value:function(e,r,n,a,i,o,c){var s=this.generatePatternKey(r);if(s&&this.patternCache[s])return this.patternCache[s];var l,u=r.image,h=r.repetition,f=r.transform,d=!1;if(E(u)){var v=this.getImageSync(u,e,c);l=null==v?void 0:v.img}else a?(l=a,d=!0):l=u;var p,y,m=l&&n.createPattern(l,h);m&&(f?p=t.parsedTransformToMat4(t.parseTransform(f),new t.DisplayObject({})):((y=S())[0]=1,y[1]=0,y[2]=0,y[3]=0,y[4]=0,y[5]=1,y[6]=0,y[7]=0,y[8]=0,y[9]=0,y[10]=1,y[11]=0,y[12]=0,y[13]=0,y[14]=0,y[15]=1,p=y),d&&function(e,t,r){var n=r[0],a=r[1],i=r[2];e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*a,e[5]=t[5]*a,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]}(p,p,[1/i,1/i,1]),m.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12]+o[0],f:p[13]+o[1]}));return s&&m&&(this.patternCache[s]=m),m}},{key:"getOrCreateGradient",value:function(e,r){var n=this.generateGradientKey(e),a=e.type,i=e.steps,o=e.min,c=e.width,s=e.height,l=e.cx,u=e.cy,h=e.size;if(this.gradientCache[n])return this.gradientCache[n];var f=null;if(a===t.GradientType.LinearGradient){var d=t.computeLinearGradient(o,c,s,e.angle);f=r.createLinearGradient(d.x1,d.y1,d.x2,d.y2)}else if(a===t.GradientType.RadialGradient){var v=t.computeRadialGradient(o,c,s,l,u,h),p=v.x,y=v.y;f=r.createRadialGradient(p,y,0,p,y,v.r)}return f&&(i.forEach((function(e){var r,n=e.offset;n.unit===t.UnitType.kPercentage&&(null===(r=f)||void 0===r||r.addColorStop(n.value/100,""+e.color))})),this.gradientCache[n]=f),this.gradientCache[n]}},{key:"generateGradientKey",value:function(e){var t=e.min,r=e.width,n=e.height,a=e.steps,i=e.angle,o=e.cx,c=e.cy,s=e.size;return"gradient-".concat(e.type,"-").concat((null==i?void 0:""+i)||0,"-").concat((null==o?void 0:""+o)||0,"-").concat((null==c?void 0:""+c)||0,"-").concat((null==s?void 0:""+s)||0,"-").concat(t[0],"-").concat(t[1],"-").concat(r,"-").concat(n,"-").concat(a.map((function(e){var t=e.color;return"".concat(e.offset).concat(t)})).join("-"))}},{key:"generatePatternKey",value:function(e){var t=e.image,r=e.repetition;return E(t)?"pattern-".concat(t,"-").concat(r):"rect"===t.nodeName?"pattern-".concat(t.entity,"-").concat(r):void 0}}]);var e,r}();function Be(e){if(!e.complete)return[0,0];var t=e.naturalWidth||e.width,r=e.naturalHeight||e.height,n=256;return[256,512].forEach((function(e){1e3>Math.ceil(r/e)*Math.ceil(t/e)&&(n=e)})),[n,n]}je.isSupportTile=!!t.OffscreenCanvasCreator.createCanvas();var Fe=function(){function e(){o(this,e)}return i(e,[{key:"apply",value:function(r){var n=r.renderingService,a=r.imagePool,i=r.renderingContext.root.ownerDocument.defaultView,o=function(e,t,r){var n=e.parsedStyle,a=n.width,i=n.height;a&&!i?e.setAttribute("height",r/t*a):!a&&i&&e.setAttribute("width",t/r*i)},c=function(e){var r=e.target,i=r.attributes;if(r.nodeName===t.Shape.IMAGE){var c=i.src,s=i.keepAspectRatio;E(c)&&a.getImageSync(c,r,(function(e){var t=e.img;s&&o(r,t.width,t.height),r.renderable.dirty=!0,n.dirtify()}))}},s=function(e){var r=e.target,i=e.prevValue,c=e.newValue;r.nodeName===t.Shape.IMAGE&&"src"===e.attrName&&(i!==c&&a.releaseImage(i,r),E(c)&&a.getOrCreateImage(c,r).then((function(e){var t=e.img;r.attributes.keepAspectRatio&&o(r,t.width,t.height),r.renderable.dirty=!0,n.dirtify()})).catch((function(){})))};function l(e){var r=e.target;r.nodeName===t.Shape.IMAGE&&a.releaseImageRef(r)}n.hooks.init.tap(e.tag,(function(){i.addEventListener(t.ElementEvent.MOUNTED,c),i.addEventListener(t.ElementEvent.ATTR_MODIFIED,s),i.addEventListener(t.ElementEvent.DESTROY,l)})),n.hooks.destroy.tap(e.tag,(function(){i.removeEventListener(t.ElementEvent.MOUNTED,c),i.removeEventListener(t.ElementEvent.ATTR_MODIFIED,s),i.removeEventListener(t.ElementEvent.DESTROY,l)}))}}])}();Fe.tag="LoadImage";var _e=function(e){function t(){var e;o(this,t);for(var r=arguments.length,n=Array(r),a=0;r>a;a++)n[a]=arguments[a];return(e=u(this,t,[].concat(n))).name="image-loader",e}return f(t,e),i(t,[{key:"init",value:function(e){this.context.imagePool=new je(this.context,e),this.addRenderingPlugin(new Fe)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(t.AbstractRendererPlugin),Ge=Object.freeze({__proto__:null,ImagePool:je,Plugin:_e}),He=function(){function e(t){o(this,e),this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=S(),this.dprMatrix=S(),this.tmpMat4=S(),this.vec3a=O(),this.vec3b=O(),this.vec3c=O(),this.vec3d=O(),this.canvasRendererPluginOptions=t}return i(e,[{key:"apply",value:function(r,n){var a=this;this.context=r;var i=r.config,o=r.camera,c=r.renderingService,s=r.renderingContext,l=r.pathGeneratorFactory;this.rBush=r.rBushRoot,this.pathGeneratorFactory=l;var u=r.contextService,h=s.root.ownerDocument.defaultView,f=function(e){var t=e.target.rBushNode;t.aabb&&a.removedRBushNodeAABBs.push(t.aabb)},d=function(e){var t=e.target.rBushNode;t.aabb&&a.removedRBushNodeAABBs.push(t.aabb)};c.hooks.init.tap(e.tag,(function(){h.addEventListener(t.ElementEvent.UNMOUNTED,f),h.addEventListener(t.ElementEvent.CULLED,d);var e=u.getDPR(),r=i.width,n=i.height,o=u.getContext();a.clearRect(o,0,0,r*e,n*e,i.background)})),c.hooks.destroy.tap(e.tag,(function(){h.removeEventListener(t.ElementEvent.UNMOUNTED,f),h.removeEventListener(t.ElementEvent.CULLED,d),a.renderQueue=[],a.removedRBushNodeAABBs=[],a.restoreStack=[]})),c.hooks.beginFrame.tap(e.tag,(function(){var e,t=u.getContext(),r=u.getDPR(),n=i.width,o=i.height,s=a.canvasRendererPluginOptions,l=s.dirtyObjectNumThreshold,f=s.dirtyObjectRatioThreshold,d=c.getStats(),v=d.rendered,p=v/d.total;a.clearFullScreen=a.clearFullScreenLastFrame||!(null!==(e=h.context.renderingPlugins[1])&&void 0!==e&&e.isFirstTimeRenderingFinished)||c.disableDirtyRectangleRendering()||v>l&&p>f,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),a.clearFullScreen&&a.clearRect(t,0,0,n*r,o*r,i.background))}));var v=function(e,t){e.isVisible()&&!e.isCulled()&&a.renderDisplayObject(e,t,a.context,a.restoreStack,n),(e.sortable.sorted||e.childNodes).forEach((function(e){v(e,t)}))};c.hooks.endFrame.tap(e.tag,(function(){if(0!==s.root.childNodes.length){a.clearFullScreenLastFrame=!1;var e,r,c=u.getContext(),l=u.getDPR();if((e=a.dprMatrix)[0]=(r=[l,l,1])[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=r[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,P(a.vpMatrix,a.dprMatrix,o.getOrthoMatrix()),a.clearFullScreen)v(s.root,c);else{var f=a.safeMergeAABB.apply(a,[a.mergeDirtyAABBs(a.renderQueue)].concat(W(a.removedRBushNodeAABBs.map((function(e){var r=e.minX,n=e.minY,a=e.maxX,i=e.maxY,o=new t.AABB;return o.setMinMax([r,n,0],[a,i,0]),o})))));if(a.removedRBushNodeAABBs=[],t.AABB.isEmpty(f))return void(a.renderQueue=[]);var d=a.convertAABB2Rect(f),p=d.x,y=d.y,m=d.width,g=d.height,b=A(a.vec3a,[p,y,0],a.vpMatrix),E=A(a.vec3b,[p+m,y,0],a.vpMatrix),x=A(a.vec3c,[p,y+g,0],a.vpMatrix),w=A(a.vec3d,[p+m,y+g,0],a.vpMatrix),M=Math.min(b[0],E[0],w[0],x[0]),S=Math.min(b[1],E[1],w[1],x[1]),k=Math.max(b[0],E[0],w[0],x[0]),O=Math.max(b[1],E[1],w[1],x[1]),T=Math.floor(M),L=Math.floor(S),C=Math.ceil(k-M),R=Math.ceil(O-S);c.save(),a.clearRect(c,T,L,C,R,i.background),c.beginPath(),c.rect(T,L,C,R),c.clip(),c.setTransform(a.vpMatrix[0],a.vpMatrix[1],a.vpMatrix[4],a.vpMatrix[5],a.vpMatrix[12],a.vpMatrix[13]),i.renderer.getConfig().enableDirtyRectangleRenderingDebug&&h.dispatchEvent(new t.CustomEvent(t.CanvasEvent.DIRTY_RECTANGLE,{dirtyRect:{x:T,y:L,width:C,height:R}})),a.searchDirtyObjects(f).sort((function(e,t){return e.sortable.renderOrder-t.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&a.renderDisplayObject(e,c,a.context,a.restoreStack,n)})),c.restore(),a.renderQueue.forEach((function(e){a.saveDirtyAABB(e)})),a.renderQueue=[]}a.restoreStack.forEach((function(){c.restore()})),a.restoreStack=[]}else a.clearFullScreenLastFrame=!0})),c.hooks.render.tap(e.tag,(function(e){a.clearFullScreen||a.renderQueue.push(e)}))}},{key:"clearRect",value:function(e,t,r,n,a,i){e.clearRect(t,r,n,a),i&&(e.fillStyle=i,e.fillRect(t,r,n,a))}},{key:"renderDisplayObject",value:function(e,r,n,a,i){var o=e.nodeName,c=a[a.length-1];!c||e.compareDocumentPosition(c)&t.Node.DOCUMENT_POSITION_CONTAINS||(r.restore(),a.pop());var s=this.context.styleRendererFactory[o],l=this.pathGeneratorFactory[o],u=e.parsedStyle.clipPath;if(u){this.applyWorldTransform(r,u);var h=this.pathGeneratorFactory[u.nodeName];h&&(r.save(),a.push(e),r.beginPath(),h(r,u.parsedStyle),r.closePath(),r.clip())}s&&(this.applyWorldTransform(r,e),r.save(),this.applyAttributesToContext(r,e)),l&&(r.beginPath(),l(r,e.parsedStyle),e.nodeName!==t.Shape.LINE&&e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&r.closePath()),s&&(s.render(r,e.parsedStyle,e,n,this,i),r.restore()),e.renderable.dirty=!1}},{key:"convertAABB2Rect",value:function(e){var t=e.getMin(),r=e.getMax(),n=Math.floor(t[0]),a=Math.floor(t[1]);return{x:n,y:a,width:Math.ceil(r[0])-n,height:Math.ceil(r[1])-a}}},{key:"mergeDirtyAABBs",value:function(e){var r=new t.AABB;return e.forEach((function(e){var t=e.getRenderBounds();r.add(t);var n=e.renderable.dirtyRenderBounds;n&&r.add(n)})),r}},{key:"searchDirtyObjects",value:function(e){var t=y(e.getMin(),2),r=t[0],n=t[1],a=y(e.getMax(),2);return this.rBush.search({minX:r,minY:n,maxX:a[0],maxY:a[1]}).map((function(e){return e.displayObject}))}},{key:"saveDirtyAABB",value:function(e){var r=e.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new t.AABB);var n=e.getRenderBounds();n&&r.dirtyRenderBounds.update(n.center,n.halfExtents)}},{key:"applyAttributesToContext",value:function(e,t){var r=t.parsedStyle,n=r.stroke,a=r.fill,i=r.opacity,o=r.lineDash,c=r.lineDashOffset;o&&e.setLineDash(o),m(c)||(e.lineDashOffset=c),m(i)||(e.globalAlpha*=i),m(n)||Array.isArray(n)||n.isNone||(e.strokeStyle=t.attributes.stroke),m(a)||Array.isArray(a)||a.isNone||(e.fillStyle=t.attributes.fill)}},{key:"applyWorldTransform",value:function(e,t,r){r?(k(this.tmpMat4,t.getLocalTransform()),P(this.tmpMat4,r,this.tmpMat4),P(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(k(this.tmpMat4,t.getWorldTransform()),P(this.tmpMat4,this.vpMatrix,this.tmpMat4)),e.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var e=new t.AABB,r=arguments.length,n=Array(r),a=0;r>a;a++)n[a]=arguments[a];return n.forEach((function(t){e.add(t)})),e}}])}();He.tag="CanvasRenderer";var ze=function(){return i((function e(t){o(this,e),this.imagePool=t}),[{key:"render",value:function(e,r,n,a,i,o){var c=r.fill,s=r.fillRule,l=r.opacity,u=void 0===l?1:l,h=r.fillOpacity,f=void 0===h?1:h,d=r.stroke,v=r.strokeOpacity,p=void 0===v?1:v,y=r.lineWidth,g=void 0===y?1:y,b=r.lineCap,E=r.lineJoin,x=r.shadowType,w=r.shadowBlur,M=r.filter,S=r.miterLimit,k=c&&!c.isNone,P=d&&!d.isNone&&g>0,O=0===(null==c?void 0:c.alpha),T=!(!M||!M.length),A=!m(r.shadowColor)&&w>0,L=n.nodeName,C="inner"===x,R=P&&A&&(L===t.Shape.PATH||L===t.Shape.LINE||L===t.Shape.POLYLINE||O||C);k&&(e.globalAlpha=u*f,R||$e(n,e,A),Ye(e,n,c,s,a,i,o,this.imagePool),R||this.clearShadowAndFilter(e,T,A)),P&&(e.globalAlpha=u*p,e.lineWidth=g,m(S)||(e.miterLimit=S),m(b)||(e.lineCap=b),m(E)||(e.lineJoin=E),R&&(C&&(e.globalCompositeOperation="source-atop"),$e(n,e,!0),C&&(qe(e,n,d,a,i,o,this.imagePool),e.globalCompositeOperation="source-over",this.clearShadowAndFilter(e,T,!0))),qe(e,n,d,a,i,o,this.imagePool))}},{key:"clearShadowAndFilter",value:function(e,t,r){if(r&&(e.shadowColor="transparent",e.shadowBlur=0),t){var n=e.filter;!m(n)&&n.indexOf("drop-shadow")>-1&&(e.filter=n.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}();function $e(e,t,r){var n=e.parsedStyle,a=n.filter,i=n.shadowColor,o=n.shadowBlur,c=n.shadowOffsetX,s=n.shadowOffsetY;a&&a.length&&(t.filter=e.style.filter),r&&(t.shadowColor=""+i,t.shadowBlur=o||0,t.shadowOffsetX=c||0,t.shadowOffsetY=s||0)}function We(e,t,r,n,a,i,o){var c,s;if("rect"===e.image.nodeName){var l=e.image.parsedStyle,u=l.width,h=l.height;s=n.contextService.getDPR();var f=n.config.offscreenCanvas;(c=i.offscreenCanvasCreator.getOrCreateCanvas(f)).width=u*s,c.height=h*s;var d=i.offscreenCanvasCreator.getOrCreateContext(f),v=[];e.image.forEach((function(e){a.renderDisplayObject(e,d,n,v,i)})),v.forEach((function(){d.restore()}))}return o.getOrCreatePatternSync(t,e,r,c,s,t.getGeometryBounds().min,(function(){t.renderable.dirty=!0,n.renderingService.dirtify()}))}function Ue(e,r,n,a){var i;if(e.type===t.GradientType.LinearGradient||e.type===t.GradientType.RadialGradient){var o=r.getGeometryBounds(),c=o&&2*o.halfExtents[0]||1,s=o&&2*o.halfExtents[1]||1,l=o&&o.min||[0,0];i=a.getOrCreateGradient(ee(ee({type:e.type},e.value),{},{min:l,width:c,height:s}),n)}return i}function Ye(e,r,n,a,i,o,c,s){var l=arguments.length>8&&void 0!==arguments[8]&&arguments[8];Array.isArray(n)?n.forEach((function(t){e.fillStyle=Ue(t,r,e,s),l||(a?e.fill(a):e.fill())})):(t.isPattern(n)&&(e.fillStyle=We(n,r,e,i,o,c,s)),l||(a?e.fill(a):e.fill()))}function qe(e,r,n,a,i,o,c){var s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];Array.isArray(n)?n.forEach((function(t){e.strokeStyle=Ue(t,r,e,c),s||e.stroke()})):(t.isPattern(n)&&(e.strokeStyle=We(n,r,e,a,i,o,c)),s||e.stroke())}var Ve=Ae("renderDownSampled"),Xe=Ae("renderTile"),Qe=function(){function e(t){o(this,e),Object.defineProperty(this,Xe,{value:Ke}),Object.defineProperty(this,Ve,{value:Ze}),this.imagePool=t}return i(e,[{key:"render",value:function(t,r,n){var a=r.x,i=void 0===a?0:a,o=r.y,c=void 0===o?0:o,s=r.width,l=r.height,u=r.src,h=r.shadowColor,f=r.shadowBlur,d=this.imagePool.getImageSync(u,n),v=null==d?void 0:d.img,p=s,g=l;if(v){var b,E,x,w,S,k,P,T,L,C,R,I,N,D,j,B,F,_,G,H,z,$,W,U,Y,q,V,X,Q,Z,K,J,ee,te,re,ne,ae,ie;p||(p=v.width),g||(g=v.height),$e(n,t,!m(h)&&f>0);try{var oe=n.ownerDocument.defaultView.getContextService().getDomElement(),ce=oe.width,se=oe.height,le=t.getTransform(),ue=($=le.a,W=le.c,U=0,Y=0,q=le.b,V=le.d,X=0,Q=0,Z=0,K=0,J=1,ee=0,te=le.e,re=le.f,ne=0,ae=1,(ie=new M(16))[0]=$,ie[1]=W,ie[2]=U,ie[3]=Y,ie[4]=q,ie[5]=V,ie[6]=X,ie[7]=Q,ie[8]=Z,ie[9]=K,ie[10]=J,ie[11]=ee,ie[12]=te,ie[13]=re,ie[14]=ne,ie[15]=ae,ie),he=(B=[i,c,p,g],F=ue,_=A(O(),[B[0],B[1],0],F),G=A(O(),[B[0]+B[2],B[1],0],F),H=A(O(),[B[0],B[1]+B[3],0],F),z=A(O(),[B[0]+B[2],B[1]+B[3],0],F),[Math.min(_[0],G[0],H[0],z[0]),Math.min(_[1],G[1],H[1],z[1]),Math.max(_[0],G[0],H[0],z[0])-Math.min(_[0],G[0],H[0],z[0]),Math.max(_[1],G[1],H[1],z[1])-Math.min(_[1],G[1],H[1],z[1])]),fe=(b=he,E=y([0,0,ce,se],4),x=E[0],w=E[1],S=E[2],k=E[3],P=y(b,4),L=P[1],C=P[2],R=P[3],I=Math.max(x,T=P[0]),N=Math.max(w,L),D=Math.min(x+S,T+C),j=Math.min(w+k,L+R),D>I&&j>N?[I,N,D-I,j-N]:null);if(!fe)return;if(!n.ownerDocument.defaultView.getConfig().enableLargeImageOptimization)return void e.renderFull(t,r,n,{image:v,drawRect:[i,c,p,g]});if((d.downSamplingRate||.5)>he[2]/d.size[0])return void Oe(this,Ve)[Ve](t,r,n,{src:u,imageCache:d,drawRect:[i,c,p,g]});if(!je.isSupportTile)return void e.renderFull(t,r,n,{image:v,drawRect:[i,c,p,g]});Oe(this,Xe)[Xe](t,r,n,{src:u,imageCache:d,imageRect:he,drawRect:fe})}catch(e){}}}}],[{key:"renderFull",value:function(e,t,r,n){e.drawImage(n.image,Math.floor(n.drawRect[0]),Math.floor(n.drawRect[1]),Math.ceil(n.drawRect[2]),Math.ceil(n.drawRect[3]))}}])}();function Ze(e,t,r,n){var a=n.src,i=n.imageCache;i.downSampled?e.drawImage(i.downSampled,Math.floor(n.drawRect[0]),Math.floor(n.drawRect[1]),Math.ceil(n.drawRect[2]),Math.ceil(n.drawRect[3])):this.imagePool.createDownSampledImage(a,r).then((function(e){r.renderable.dirty=!0,r.ownerDocument.defaultView.context.renderingService.dirtify()})).catch((function(){}))}function Ke(e,t,r,n){var a=n.src,i=n.imageCache,o=n.imageRect,c=n.drawRect,s=i.size,l=e.getTransform(),u=l.a,h=l.b,f=l.c,d=l.d,v=l.e,p=l.f;if(e.resetTransform(),null!=i&&i.gridSize){for(var y=[s[0]/o[2],s[1]/o[3]],m=[i.tileSize[0]/y[0],i.tileSize[1]/y[1]],g=[Math.floor((c[0]-o[0])/m[0]),Math.ceil((c[0]+c[2]-o[0])/m[0])],b=g[0],E=g[1],x=[Math.floor((c[1]-o[1])/m[1]),Math.ceil((c[1]+c[3]-o[1])/m[1])],w=x[1],M=x[0];w>=M;M++)for(var S=b;E>=S;S++){var k=i.tiles[M][S];if(k){var P=[Math.floor(o[0]+k.tileX*m[0]),Math.floor(o[1]+k.tileY*m[1]),Math.ceil(m[0]),Math.ceil(m[1])];e.drawImage(k.data,P[0],P[1],P[2],P[3])}}e.setTransform(u,h,f,d,v,p)}else this.imagePool.createImageTiles(a,[],r).then((function(){r.renderable.dirty=!0,r.ownerDocument.defaultView.context.renderingService.dirtify()})).catch((function(){}))}var Je=function(){return i((function e(t){o(this,e),this.imagePool=t}),[{key:"render",value:function(e,t,r,n,a,i){r.getBounds();var o=t.lineWidth,c=void 0===o?1:o,s=t.textAlign,l=void 0===s?"start":s,u=t.textBaseline,h=void 0===u?"alphabetic":u,f=t.lineJoin,d=void 0===f?"miter":f,v=t.miterLimit,p=void 0===v?10:v,y=t.letterSpacing,g=void 0===y?0:y,b=t.stroke,E=t.fill,x=t.fillRule,w=t.fillOpacity,M=void 0===w?1:w,S=t.strokeOpacity,k=void 0===S?1:S,P=t.opacity,O=void 0===P?1:P,T=t.metrics,A=t.x,L=void 0===A?0:A,C=t.y,R=void 0===C?0:C,I=t.dx,N=t.dy,D=t.shadowColor,j=t.shadowBlur,B=T.lines,F=T.height,_=T.lineHeight,G=T.lineMetrics;e.font=T.font,e.lineWidth=c,e.textAlign="middle"===l?"center":l;var H=h;"alphabetic"===H&&(H="bottom"),e.lineJoin=d,m(p)||(e.miterLimit=p);var z=R;"middle"===h?z+=-F/2-_/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?z+=-F:"top"!==h&&"hanging"!==h||(z+=-_);var $=L+(I||0);z+=N||0,1===B.length&&("bottom"===H?(H="middle",z-=.5*F):"top"===H&&(H="middle",z+=.5*F)),e.textBaseline=H,$e(r,e,!m(D)&&j>0);for(var W=0;B.length>W;W++){var U=c/2+$;z+=_,m(b)||b.isNone||!c||this.drawLetterSpacing(e,r,B[W],G[W],l,U,z,g,E,x,M,b,k,O,!0,n,a,i),m(E)||this.drawLetterSpacing(e,r,B[W],G[W],l,U,z,g,E,x,M,b,k,O,!1,n,a,i)}}},{key:"drawLetterSpacing",value:function(e,t,r,n,a,i,o,c,s,l,u,h,f,d,v,p,y,m){if(0!==c){var g=e.textAlign;e.textAlign="left";var b=i;"center"===a||"middle"===a?b=i-n.width/2:"right"!==a&&"end"!==a||(b=i-n.width);for(var E=Array.from(r),x=e.measureText(r).width,w=0,M=0;E.length>M;++M){var S=E[M];v?this.strokeText(e,t,S,b,o,h,f,p,y,m):this.fillText(e,t,S,b,o,s,l,u,d,p,y,m),b+=x-(w=e.measureText(r.substring(M+1)).width)+c,x=w}e.textAlign=g}else v?this.strokeText(e,t,r,i,o,h,f,p,y,m):this.fillText(e,t,r,i,o,s,l,u,d,p,y,m)}},{key:"fillText",value:function(e,t,r,n,a,i,o,c,s,l,u,h){var f;Ye(e,t,i,o,l,u,h,this.imagePool,!0);var d=!m(c)&&1!==c;d&&(f=e.globalAlpha,e.globalAlpha=c*s),e.fillText(r,n,a),d&&(e.globalAlpha=f)}},{key:"strokeText",value:function(e,t,r,n,a,i,o,c,s,l){var u;qe(e,t,i,c,s,l,this.imagePool,!0);var h=!m(o)&&1!==o;h&&(u=e.globalAlpha,e.globalAlpha=o),e.strokeText(r,n,a),h&&(e.globalAlpha=u)}}])}(),et=function(e){function t(){return o(this,t),u(this,t,arguments)}return f(t,e),i(t)}(ze),tt=function(e){function t(){return o(this,t),u(this,t,arguments)}return f(t,e),i(t)}(ze),rt=function(e){function t(){return o(this,t),u(this,t,arguments)}return f(t,e),i(t)}(ze),nt=function(e){function t(){return o(this,t),u(this,t,arguments)}return f(t,e),i(t)}(ze),at=function(e){function t(){return o(this,t),u(this,t,arguments)}return f(t,e),i(t)}(ze),it=function(e){function t(){return o(this,t),u(this,t,arguments)}return f(t,e),i(t)}(ze),ot=function(e){function t(){return o(this,t),u(this,t,arguments)}return f(t,e),i(t)}(ze),ct=function(e){function r(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,r),(e=u(this,r)).name="canvas-renderer",e.options=t,e}return f(r,e),i(r,[{key:"init",value:function(){var e,r=ee({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,a=new ze(n),i=(d(d(d(d(d(d(d(d(d(d(e={},t.Shape.CIRCLE,a),t.Shape.ELLIPSE,a),t.Shape.RECT,a),t.Shape.IMAGE,new Qe(n)),t.Shape.TEXT,new Je(n)),t.Shape.LINE,a),t.Shape.POLYLINE,a),t.Shape.POLYGON,a),t.Shape.PATH,a),t.Shape.GROUP,void 0),d(d(e,t.Shape.HTML,void 0),t.Shape.MESH,void 0));this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new He(r))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(t.AbstractRendererPlugin),st=Object.freeze({__proto__:null,CircleRenderer:tt,EllipseRenderer:rt,ImageRenderer:Qe,LineRenderer:nt,PathRenderer:ot,Plugin:ct,PolygonRenderer:it,PolylineRenderer:at,RectRenderer:et,TextRenderer:Je}),lt=function(){function e(){o(this,e)}return i(e,[{key:"apply",value:function(t,r){var n=this,a=t.renderingService,i=t.renderingContext,o=t.config;this.context=t;var c=i.root.ownerDocument.defaultView,s=function(e){a.hooks.pointerMove.call(e)},l=function(e){a.hooks.pointerUp.call(e)},u=function(e){a.hooks.pointerDown.call(e)},h=function(e){a.hooks.pointerOver.call(e)},f=function(e){a.hooks.pointerOut.call(e)},d=function(e){a.hooks.pointerCancel.call(e)},v=function(e){a.hooks.pointerWheel.call(e)},p=function(e){a.hooks.click.call(e)};a.hooks.init.tap(e.tag,(function(){var e=n.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(e.style.msContentZooming="none",e.style.msTouchAction="none"):c.supportsPointerEvents&&(e.style.touchAction="none"),c.supportsPointerEvents?function(e){r.globalThis.document.addEventListener("pointermove",s,!0),e.addEventListener("pointerdown",u,!0),e.addEventListener("pointerleave",f,!0),e.addEventListener("pointerover",h,!0),r.globalThis.addEventListener("pointerup",l,!0),r.globalThis.addEventListener("pointercancel",d,!0)}(e):function(e){r.globalThis.document.addEventListener("mousemove",s,!0),e.addEventListener("mousedown",u,!0),e.addEventListener("mouseout",f,!0),e.addEventListener("mouseover",h,!0),r.globalThis.addEventListener("mouseup",l,!0)}(e),c.supportsTouchEvents&&function(e){e.addEventListener("touchstart",u,!0),e.addEventListener("touchend",l,!0),e.addEventListener("touchmove",s,!0),e.addEventListener("touchcancel",d,!0)}(e),o.useNativeClickEvent&&e.addEventListener("click",p,!0),e.addEventListener("wheel",v,{passive:!0,capture:!0})})),a.hooks.destroy.tap(e.tag,(function(){var e=n.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(e.style.msContentZooming="",e.style.msTouchAction=""):c.supportsPointerEvents&&(e.style.touchAction=""),c.supportsPointerEvents?function(e){r.globalThis.document.removeEventListener("pointermove",s,!0),e.removeEventListener("pointerdown",u,!0),e.removeEventListener("pointerleave",f,!0),e.removeEventListener("pointerover",h,!0),r.globalThis.removeEventListener("pointerup",l,!0),r.globalThis.removeEventListener("pointercancel",d,!0)}(e):function(e){r.globalThis.document.removeEventListener("mousemove",s,!0),e.removeEventListener("mousedown",u,!0),e.removeEventListener("mouseout",f,!0),e.removeEventListener("mouseover",h,!0),r.globalThis.removeEventListener("mouseup",l,!0)}(e),c.supportsTouchEvents&&function(e){e.removeEventListener("touchstart",u,!0),e.removeEventListener("touchend",l,!0),e.removeEventListener("touchmove",s,!0),e.removeEventListener("touchcancel",d,!0)}(e),o.useNativeClickEvent&&e.removeEventListener("click",p,!0),e.removeEventListener("wheel",v,!0)}))}}])}();lt.tag="DOMInteraction";var ut=function(e){function t(){var e;o(this,t);for(var r=arguments.length,n=Array(r),a=0;r>a;a++)n[a]=arguments[a];return(e=u(this,t,[].concat(n))).name="dom-interaction",e}return f(t,e),i(t,[{key:"init",value:function(){this.addRenderingPlugin(new lt)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(t.AbstractRendererPlugin),ht=Object.freeze({__proto__:null,Plugin:ut}),ft=function(){function e(){o(this,e),this.displayObjectHTMLElementMap=new WeakMap}return i(e,[{key:"joinTransformMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([e[0],e[1],e[4],e[5],e[12]+t[0],e[13]+t[1]].join(","),")")}},{key:"apply",value:function(r,n){var a=this,i=r.camera,o=r.renderingContext,c=r.renderingService;this.context=r;var s=o.root.ownerDocument.defaultView,l=s.context.eventService.nativeHTMLMap,u=function(e,t){t.style.transform=a.joinTransformMatrix(e.getWorldTransform(),e.getOrigin())},h=function(e){var r=e.target;if(r.nodeName===t.Shape.HTML){a.$camera||(a.$camera=a.createCamera(i));var n=a.getOrCreateEl(r);a.$camera.appendChild(n),Object.keys(r.attributes).forEach((function(e){a.updateAttribute(e,r)})),u(r,n),l.set(n,r)}},f=function(e){var r=e.target;if(r.nodeName===t.Shape.HTML&&a.$camera){var n=a.getOrCreateEl(r);n&&(n.remove(),l.delete(n))}},d=function(e){var r=e.target;r.nodeName===t.Shape.HTML&&a.updateAttribute(e.attrName,r)},v=function(e){var r=e.target;(r.nodeName===t.Shape.FRAGMENT?r.childNodes:[r]).forEach((function(e){if(e.nodeName===t.Shape.HTML){var r=a.getOrCreateEl(e);u(e,r)}}))},p=function(){if(a.$camera){var e=a.context.config,t=e.height;a.$camera.parentElement.style.width="".concat(e.width||0,"px"),a.$camera.parentElement.style.height="".concat(t||0,"px")}};c.hooks.init.tap(e.tag,(function(){s.addEventListener(t.CanvasEvent.RESIZE,p),s.addEventListener(t.ElementEvent.MOUNTED,h),s.addEventListener(t.ElementEvent.UNMOUNTED,f),s.addEventListener(t.ElementEvent.ATTR_MODIFIED,d),s.addEventListener(t.ElementEvent.BOUNDS_CHANGED,v)})),c.hooks.endFrame.tap(e.tag,(function(){a.$camera&&o.renderReasons.has(t.RenderReason.CAMERA_CHANGED)&&(a.$camera.style.transform=a.joinTransformMatrix(i.getOrthoMatrix()))})),c.hooks.destroy.tap(e.tag,(function(){a.$camera&&a.$camera.remove(),s.removeEventListener(t.CanvasEvent.RESIZE,p),s.removeEventListener(t.ElementEvent.MOUNTED,h),s.removeEventListener(t.ElementEvent.UNMOUNTED,f),s.removeEventListener(t.ElementEvent.ATTR_MODIFIED,d),s.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,v)}))}},{key:"createCamera",value:function(e){var t=this.context.config,r=t.document,n=t.width,a=t.height,i=this.context.contextService.getDomElement(),o=i.parentNode;if(o){var c="g-canvas-camera",s=o.querySelector("#".concat(c));if(!s){var l=(r||document).createElement("div");l.style.overflow="hidden",l.style.pointerEvents="none",l.style.position="absolute",l.style.left="0px",l.style.top="0px",l.style.width="".concat(n||0,"px"),l.style.height="".concat(a||0,"px");var u=(r||document).createElement("div");s=u,u.id=c,u.style.position="absolute",u.style.left="".concat(i.offsetLeft||0,"px"),u.style.top="".concat(i.offsetTop||0,"px"),u.style.transformOrigin="left top",u.style.transform=this.joinTransformMatrix(e.getOrthoMatrix()),u.style.pointerEvents="none",u.style.width="100%",u.style.height="100%",l.appendChild(u),o.appendChild(l)}return s}return null}},{key:"getOrCreateEl",value:function(e){var t=this.context.config.document,r=this.displayObjectHTMLElementMap.get(e);return r||(r=(t||document).createElement("div"),e.parsedStyle.$el=r,this.displayObjectHTMLElementMap.set(e,r),e.id&&(r.id=e.id),e.name&&r.setAttribute("name",e.name),e.className&&(r.className=e.className),r.style.position="absolute",r.style["will-change"]="transform",r.style.transform=this.joinTransformMatrix(e.getWorldTransform(),e.getOrigin())),r}},{key:"updateAttribute",value:function(e,r){var n=this.getOrCreateEl(r);switch(e){case"innerHTML":var a=r.parsedStyle.innerHTML;E(a)?n.innerHTML=a:(n.innerHTML="",n.appendChild(a));break;case"x":n.style.left="".concat(r.parsedStyle.x,"px");break;case"y":n.style.top="".concat(r.parsedStyle.y,"px");break;case"transformOrigin":var i=r.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].buildCSSText(null,null,"")," ").concat(i[1].buildCSSText(null,null,""));break;case"width":var o=r.parsedStyle.width;n.style.width=w(o)?"".concat(o,"px"):""+o;break;case"height":var c=r.parsedStyle.height;n.style.height=w(c)?"".concat(c,"px"):""+c;break;case"zIndex":n.style["z-index"]="".concat(r.parsedStyle.zIndex);break;case"visibility":n.style.visibility=r.parsedStyle.visibility;break;case"pointerEvents":var s=r.parsedStyle.pointerEvents;n.style.pointerEvents=void 0===s?"auto":s;break;case"opacity":n.style.opacity="".concat(r.parsedStyle.opacity);break;case"fill":var l=r.parsedStyle.fill,u="";t.isCSSRGB(l)?u=l.isNone?"transparent":r.getAttribute("fill"):Array.isArray(l)?u=r.getAttribute("fill"):t.isPattern(l),n.style.background=u;break;case"stroke":var h=r.parsedStyle.stroke,f="";t.isCSSRGB(h)?f=h.isNone?"transparent":r.getAttribute("stroke"):Array.isArray(h)?f=r.getAttribute("stroke"):t.isPattern(h),n.style["border-color"]=f,n.style["border-style"]="solid";break;case"lineWidth":n.style["border-width"]="".concat(r.parsedStyle.lineWidth||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":n.style.filter=r.style.filter;break;default:m(r.style[e])||""===r.style[e]||(n.style[e]=r.style[e])}}}])}();ft.tag="HTMLRendering";var dt=function(e){function t(){var e;o(this,t);for(var r=arguments.length,n=Array(r),a=0;r>a;a++)n[a]=arguments[a];return(e=u(this,t,[].concat(n))).name="html-renderer",e}return f(t,e),i(t,[{key:"init",value:function(){this.addRenderingPlugin(new ft)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(t.AbstractRendererPlugin),vt=Object.freeze({__proto__:null,Plugin:dt}),pt=function(){return i((function e(t){o(this,e),this.renderingContext=t.renderingContext,this.canvasConfig=t.config}),[{key:"init",value:function(){var e=this.canvasConfig,t=e.container,r=e.canvas;if(r)this.$canvas=r,t&&r.parentElement!==t&&t.appendChild(r),this.$container=r.parentElement,this.canvasConfig.container=this.$container;else if(t&&(this.$container=E(t)?document.getElementById(t):t,this.$container)){var n=document.createElement("canvas");this.$container.appendChild(n),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=n}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(e,r){var n=this.canvasConfig.devicePixelRatio||t.isBrowser&&window.devicePixelRatio||1;this.dpr=n=1>n?1:Math.ceil(n),this.$canvas&&(this.$canvas.width=this.dpr*e,this.$canvas.height=this.dpr*r,t.setDOMSize(this.$canvas,e,r)),this.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(e){this.$container&&this.$container.style&&(this.$container.style.cursor=e)}},{key:"toDataURL",value:(e=$(H().mark((function e(){var t,r=arguments;return H().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.context.canvas.toDataURL((t=r.length>0&&void 0!==r[0]?r[0]:{}).type,t.encoderOptions));case 3:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})}]);var e}(),yt=function(e){function t(){var e;o(this,t);for(var r=arguments.length,n=Array(r),a=0;r>a;a++)n[a]=arguments[a];return(e=u(this,t,[].concat(n))).name="canvas-context-register",e}return f(t,e),i(t,[{key:"init",value:function(){this.context.ContextService=pt}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(t.AbstractRendererPlugin),mt=function(e){function t(e){var r;return o(this,t),(r=u(this,t,[e])).registerPlugin(new yt),r.registerPlugin(new _e),r.registerPlugin(new _),r.registerPlugin(new ct),r.registerPlugin(new ut),r.registerPlugin(new ke),r.registerPlugin(new dt),r}return f(t,e),i(t)}(t.AbstractRenderer);e.CanvasPathGenerator=G,e.CanvasPicker=Pe,e.CanvasRenderer=st,e.DomInteraction=ht,e.HTMLRenderer=vt,e.ImageLoader=Ge,e.Renderer=mt}));