You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
1.1 MiB
90 lines
1.1 MiB
|
4 months ago
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G6={})}(this,function(t){"use strict";var e="undefined"!=typeof document?document.currentScript:null;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);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,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(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 a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach(function(e){i(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;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 c(t,e,n){return e&&l(t.prototype,e),n&&l(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function h(t,e){if(t){if("string"==typeof t)return u(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)?u(t,e):void 0}}function d(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||h(t)||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.")}()}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(p=function(){return!!t})()}function g(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 v(t,e,n){return e=f(e),g(t,p()?Reflect.construct(e,n||[],f(t).constructor):e.apply(t,n))}function m(t,e){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},m(t,e)}function y(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&&m(t,e)}function b(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,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return
|
||
|
|
/*!
|
||
|
|
* @antv/g-math
|
||
|
|
* @description Geometry util
|
||
|
|
* @version 3.0.1
|
||
|
|
* @date 5/9/2025, 8:18:51 AM
|
||
|
|
* @author AntVis
|
||
|
|
* @docs https://g.antv.antgroup.com/
|
||
|
|
*/function _n(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function In(t,e){var n=Math.min.apply(Math,d(t)),r=Math.min.apply(Math,d(e));return{x:n,y:r,width:Math.max.apply(Math,d(t))-n,height:Math.max.apply(Math,d(e))-r}}function jn(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Bn(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function Fn(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),l=1/0,c=-1/0,u=[o,a],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var d=s+h;o<a?o<d&&d<a&&u.push(d):a<d&&d<o&&u.push(d)}for(var f=0;f<u.length;f++){var p=jn(t,0,n,r,i,u[f]);p<l&&(l=p),p>c&&(c=p)}for(var g=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),v=1/0,m=-1/0,y=[o,a],b=2*-Math.PI;b<=2*Math.PI;b+=Math.PI){var x=g+b;o<a?o<x&&x<a&&y.push(x):a<x&&x<o&&y.push(x)}for(var E=0;E<y.length;E++){var w=Bn(0,e,n,r,i,y[E]);w<v&&(v=w),w>m&&(m=w)}return{x:l,y:v,width:c-l,height:m-v}}function zn(t,e,n,r,i,o){var a=-1,s=1/0,l=[n,r],c=20;o&&o>200&&(c=o/10);for(var u=1/c,h=u/10,f=0;f<=c;f++){var p=f*u,g=[i.apply(void 0,d(t.concat([p]))),i.apply(void 0,d(e.concat([p])))],v=_n(l[0],l[1],g[0],g[1]);v<s&&(a=p,s=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var m=t.length;return{x:t[m-1],y:e[m-1]}}s=1/0;for(var y=0;y<32&&!(h<1e-4);y++){var b=a-h,x=a+h,E=[i.apply(void 0,d(t.concat([b]))),i.apply(void 0,d(e.concat([b])))],w=_n(l[0],l[1],E[0],E[1]);if(b>=0&&w<s)a=b,s=w;else{var k=[i.apply(void 0,d(t.concat([x]))),i.apply(void 0,d(e.concat([x])))],M=_n(l[0],l[1],k[0],k[1]);x<=1&&M<s?(a=x,s=M):h*=.5}}return{x:i.apply(void 0,d(t.concat([a]))),y:i.apply(void 0,d(e.concat([a])))}}function Gn(t,e,n,r){return _n(t,e,n,r)}function Vn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Wn(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var l=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(l,s))}function Hn(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function Un(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,l=6*t-12*e+6*n,c=3*e-3*t,u=[];if(se(s,0))se(l,0)||(i=-c/l)>=0&&i<=1&&u.push(i);else{var h=l*l-4*s*c;se(h,0)?u.push(-l/(2*s)):h>0&&(o=(-l-(a=Math.sqrt(h)))/(2*s),(i=(-l+a)/(2*s))>=0&&i<=1&&u.push(i),o>=0&&o<=1&&u.push(o))}return u}function $n(t,e,n,r,i,o,a,s){for(var l=[t,a],c=[e,s],u=Un(t,n,i,a),h=Un(e,r,o,s),d=0;d<u.length;d++)l.push(Hn(t,n,i,a,u[d]));for(var f=0;f<h.length;f++)c.push(Hn(e,r,o,s,h[f]));return In(l,c)}function Yn(t,e,n,r,i,o,a,s,l,c,u){var h=function(t,e,n,r,i,o,a,s,l,c,u){return zn([t,n,i,a],[e,r,o,s],l,c,Hn,u)}(t,e,n,r,i,o,a,s,l,c,u);return _n(h.x,h.y,l,c)}function qn(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=_n(r[0],r[1],i[0],i[1])}return e}(t)}function Xn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Kn(t,e,n){var r=t+n-2*e;if(se(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function Zn(t,e,n,r,i,o){var a=Kn(t,n,i)[0],s=Kn(e,r,o)[0],l=[t,i],c=[e,o];return void 0!==a&&l.push(Xn(t,n,i,a)),void 0!==s&&c.push(Xn(e,r,o,s)),In(l,c)}function Qn(t,e,n,r,i,o,a,s){var l=function(t,e,n,r,i,o,a,s){return zn([t,n,i],[e,r,o],a,s,Xn)}(t,e,n,r,i,o,a,s);return _n(l.x,l.y,a,s)}function Jn(t,e){this.v=t,this.k=e}function tr(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}tr=function(t,e,n,r){function o(e,n){tr(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))},tr(t,e,n,r)}function er(){
|
||
|
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||
|
|
var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return tr(c,"_invoke",function(n,r,i){var o,s,l,c=0,u=i||[],h=!1,d={p:0,n:0,v:t,a:f,f:f.bind(t,4),d:function(e,n){return o=e,s=0,l=t,d.n=n,a}};function f(n,r){for(s=n,l=r,e=0;!h&&c&&!i&&e<u.length;e++){var i,o=u[e],f=d.p,p=o[2];n>3?(i=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=t):o[0]<=f&&((i=n<2&&f<o[1])?(s=0,d.v=r,d.n=o[1]):f<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,d.n=p,s=0))}if(i||n>1)return a;throw h=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===u&&f(u,p),s=u,l=p;(e=s<2?t:l)||!h;){o||(s?s<3?(s>1&&(d.n=-1),f(s,l)):d.n=l:d.v=l);try{if(c=2,o){if(s||(i="next"),e=o[i]){if(!(e=e.call(o,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=o.return)&&e.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=t}else if((e=(h=d.n<0)?l:n.call(r,d))!==a)break}catch(e){o=t,s=1,l=e}finally{c=1}}return{value:e,done:h}}}(n,i,o),!0),c}var a={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][r]?e(e([][r]())):(tr(e={},r,function(){return this}),e),h=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,tr(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return l.prototype=c,tr(h,"constructor",c),tr(c,"constructor",l),l.displayName="GeneratorFunction",tr(c,i,"GeneratorFunction"),tr(h),tr(h,i,"Generator"),tr(h,r,function(){return this}),tr(h,"toString",function(){return"[object Generator]"}),(er=function(){return{w:o,m:d}})()}function nr(t,e){function n(r,i,o,a){try{var s=t[r](i),l=s.value;return l instanceof Jn?e.resolve(l.v).then(function(t){n("next",t,o,a)},function(t){n("throw",t,o,a)}):e.resolve(l).then(function(t){s.value=t,o(s)},function(t){return n("throw",t,o,a)})}catch(t){a(t)}}var r;this.next||(tr(nr.prototype),tr(nr.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),tr(this,"_invoke",function(t,i,o){function a(){return new e(function(e,r){n(t,o,e,r)})}return r=r?r.then(a,a):a()},!0)}function rr(t,e,n,r,i){return new nr(er().w(t,e,n,r),i||Promise)}function ir(t,e,n,r,i){var o=rr(t,e,n,r,i);return o.next().then(function(t){return t.done?t.value:o.next()})}function or(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}}function ar(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}throw new TypeError(n(t)+" is not iterable")}function sr(){var t=er(),e=t.m(sr),n=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function r(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===n||"GeneratorFunction"===(e.displayName||e.name))}var i={throw:1,return:2,break:3,continue:3};function o(t){var e,n;return function(r){e||(e={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(t,e){return n(r.a,i[t],e)},delegateYield:function(t,i,o){return e.resultName=i,n(r.d,ar(t),o)},finish:function(t){return n(r.f,t)}},n=function(t,n,i){r.p=e.prev,r.n=e.next;try{return t(n,i)}finally{e.next=r.n}}),e.resultName&&(e[e.resultName]=r.v,e.resultName=void 0),e.sent=r.v,e.next=r.n;try{return t.call(this,e)}finally{r.p=e.prev,r.n=e.next}}}return(sr=function(){return{wrap:function(e,n,r,i){return t.w(o(e),n,r,i&&i.reverse())},isGeneratorFunction:r,mark:t.m,awrap:function(t,e){return new Jn(t,e)},AsyncIterator:nr,async:function(t,e,n,i,a){return(r(e)?rr:ir)(o(t),e,n,i,a)},keys:or,values:ar}})()}function lr(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function cr(t){return
|
||
|
|
/*!
|
||
|
|
* @antv/g-lite
|
||
|
|
* @description A core module for rendering engine implements DOM API.
|
||
|
|
* @version 2.3.2
|
||
|
|
* @date 7/30/2025, 1:34:19 PM
|
||
|
|
* @author AntVis
|
||
|
|
* @docs https://g.antv.antgroup.com/
|
||
|
|
*/"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var dr={exports:{}};!function(t){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,l=r-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-l*u/s+h)),Math.min(o,Math.floor(r+(s-l)*u/s+h)),a)}var d=t[r],f=i,p=o;for(n(t,i,r),a(t[o],d)>0&&n(t,i,o);f<p;){for(n(t,f,p),f++,p--;a(t[f],d)<0;)f++;for(;a(t[p],d)>0;)p--}0===a(t[i],d)?n(t,i,p):n(t,++p,o),p<=r&&(i=p+1),r<=p&&(o=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];l(i,t.leaf?r(a):a)}return i}function l(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function c(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function v(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!v(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?r(a):a;v(t,s)&&(e.leaf?n.push(a):g(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!v(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(v(t,o)){if(e.leaf||g(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),l=[],c=[];a||l.length;){if(a||(a=l.pop(),r=l[l.length-1],n=c.pop(),i=!0),a.leaf){var u=o(t,a.children,e);if(-1!==u)return a.children.splice(u,1),l.push(a),this._condense(l),this}i||a.leaf||!g(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(l.push(a),c.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();retur
|
||
|
|
/*!
|
||
|
|
* @antv/g-web-animations-api
|
||
|
|
* @description A simple implementation of Web Animations API.
|
||
|
|
* @version 2.1.28
|
||
|
|
* @date 7/30/2025, 1:36:24 PM
|
||
|
|
* @author AntVis
|
||
|
|
* @docs https://g.antv.antgroup.com/
|
||
|
|
*/
|
||
|
|
var Pc=function(t){function e(t,n,r,i){var o;return s(this,e),(o=v(this,e,[t])).currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return y(e,t),c(e)}(Ys),Rc=0,Dc=function(){return c(function t(e,n){var r;s(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(Rc++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(r=this.effect)||void 0===r?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()},[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var t;if(null!==(t=this.effect.target)&&void 0!==t&&t.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var e=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==e&&("idle"===n?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===e?this.resolveReadyPromise():"pending"===n&&(this.readyPromise=void 0)),this.finishedPromise&&n!==e&&("idle"===n?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===n?this.resolveFinishedPromise():"finished"===e&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){t
|
||
|
|
/*!
|
||
|
|
* @antv/g-plugin-canvas-path-generator
|
||
|
|
* @description A G plugin of path generator with Canvas2D API
|
||
|
|
* @version 2.1.22
|
||
|
|
* @date 7/30/2025, 1:35:25 PM
|
||
|
|
* @author AntVis
|
||
|
|
* @docs https://g.antv.antgroup.com/
|
||
|
|
*/function Rf(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.r;t.arc(r,o,a,0,2*Math.PI,!1)}function Df(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.rx,s=e.ry;if(t.ellipse)t.ellipse(r,o,a,s,0,0,2*Math.PI,!1);else{var l=a>s?a:s,c=a>s?1:a/s,u=a>s?s/a:1;t.save(),t.scale(c,u),t.arc(r,o,l,0,2*Math.PI)}}function Lf(t,e){var n,r,i=e.x1,o=e.y1,a=e.x2,s=e.y2,l=e.markerStart,c=e.markerEnd,u=e.markerStartOffset,h=e.markerEndOffset,d=0,f=0,p=0,g=0,v=0;l&&Ul(l)&&u&&(n=a-i,r=s-o,v=Math.atan2(r,n),d=Math.cos(v)*(u||0),f=Math.sin(v)*(u||0)),c&&Ul(c)&&h&&(n=i-a,r=o-s,v=Math.atan2(r,n),p=Math.cos(v)*(h||0),g=Math.sin(v)*(h||0)),t.moveTo(i+d,o+f),t.lineTo(a+p,s+g)}function _f(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,l=e.d,c=l.absolutePath,u=l.segments,h=0,d=0,f=0,p=0,g=0;if(i&&Ul(i)&&a){var v=b(i.parentNode.getStartTangent(),2),m=v[0],y=v[1];n=m[0]-y[0],r=m[1]-y[1],g=Math.atan2(r,n),h=Math.cos(g)*(a||0),d=Math.sin(g)*(a||0)}if(o&&Ul(o)&&s){var x=b(o.parentNode.getEndTangent(),2),E=x[0],w=x[1];n=E[0]-w[0],r=E[1]-w[1],g=Math.atan2(r,n),f=Math.cos(g)*(s||0),p=Math.sin(g)*(s||0)}for(var k=0;k<c.length;k++){var M=c[k],S=M[0],N=c[k+1],T=0===k&&(0!==h||0!==d),O=(k===c.length-1||N&&("M"===N[0]||"Z"===N[0]))&&0!==f&&0!==p,C=b(T?[h,d]:[0,0],2),A=C[0],P=C[1],R=b(O?[f,p]:[0,0],2),D=R[0],L=R[1];switch(S){case"M":t.moveTo(M[1]+A,M[2]+P);break;case"L":t.lineTo(M[1]+D,M[2]+L);break;case"Q":t.quadraticCurveTo(M[1],M[2],M[3]+D,M[4]+L);break;case"C":t.bezierCurveTo(M[1],M[2],M[3],M[4],M[5]+D,M[6]+L);break;case"A":var _=u[k].arcParams,I=_.cx,j=_.cy,B=_.rx,F=_.ry,z=_.startAngle,G=_.endAngle,V=_.xRotation,W=_.sweepFlag;if(t.ellipse)t.ellipse(I,j,B,F,V,z,G,!!(1-W));else{var H=B>F?B:F,U=B>F?1:B/F,$=B>F?F/B:1;t.translate(I,j),t.rotate(V),t.scale(U,$),t.arc(0,0,H,z,G,!!(1-W)),t.scale(1/U,1/$),t.rotate(-V),t.translate(-I,-j)}O&&t.lineTo(M[6]+f,M[7]+p);break;case"Z":t.closePath()}}}function If(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,l=e.points.points,c=l.length,u=l[0][0],h=l[0][1],d=l[c-1][0],f=l[c-1][1],p=0,g=0,v=0,m=0,y=0;i&&Ul(i)&&a&&(n=l[1][0]-l[0][0],r=l[1][1]-l[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(a||0),g=Math.sin(y)*(a||0)),o&&Ul(o)&&s&&(n=l[c-1][0]-l[0][0],r=l[c-1][1]-l[0][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+(p||v),h+(g||m));for(var b=1;b<c-1;b++){var x=l[b];t.lineTo(x[0],x[1])}t.lineTo(d,f)}function jf(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,l=e.points.points,c=l.length,u=l[0][0],h=l[0][1],d=l[c-1][0],f=l[c-1][1],p=0,g=0,v=0,m=0,y=0;i&&Ul(i)&&a&&(n=l[1][0]-l[0][0],r=l[1][1]-l[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(a||0),g=Math.sin(y)*(a||0)),o&&Ul(o)&&s&&(n=l[c-2][0]-l[c-1][0],r=l[c-2][1]-l[c-1][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+p,h+g);for(var b=1;b<c-1;b++){var x=l[b];t.lineTo(x[0],x[1])}t.lineTo(d+v,f+m)}function Bf(t,e){var n=e.x,r=void 0===n?0:n,i=e.y,o=void 0===i?0:i,a=e.radius,s=e.width,l=e.height,c=s,u=l;if(a&&a.some(function(t){return 0!==t})){var h=s>0?1:-1,d=l>0?1:-1,f=h+d===0,p=b(a.map(function(t){return oe(t,0,Math.min(Math.abs(c)/2,Math.abs(u)/2))}),4),g=p[0],v=p[1],m=p[2],y=p[3];t.moveTo(h*g+r,o),t.lineTo(c-h*v+r,o),0!==v&&t.arc(c-h*v+r,d*v+o,v,-d*Math.PI/2,h>0?0:Math.PI,f),t.lineTo(c+r,u-d*m+o),0!==m&&t.arc(c-h*m+r,u-d*m+o,m,h>0?0:Math.PI,d>0?Math.PI/2:1.5*Math.PI,f),t.lineTo(h*y+r,u+o),0!==y&&t.arc(h*y+r,u-d*y+o,y,d>0?Math.PI/2:-Math.PI/2,h>0?Math.PI:0,f),t.lineTo(r,d*g+o),0!==g&&t.arc(h*g+r,d*g+o,g,h>0?Math.PI:0,d>0?1.5*Math.PI:Math.PI/2,f)}else t.rect(r,o,c,u)}var Ff=function(t){function e(){var t;s(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=v(this,e,[].concat(r))).name="canvas-path-generator",t}return y(e,t),c(e,[{key:"init",value:function(){var t,e=(i(i(i(i(i(i(i(i(i(i(t={},pr.CIRCLE,Rf),pr.ELLIPSE,Df),pr.RECT,Bf),pr.LINE,Lf),pr.POLYLINE,jf),pr.POLYGON,If),pr.PATH,_f),pr.TEXT,void 0),pr.GROUP,void 0),pr.IMAGE,void 0),i(i(i(t,pr.HTML,void 0),pr.MESH,
|
||
|
|
/*!
|
||
|
|
* @antv/g-plugin-canvas-picker
|
||
|
|
* @description A G plugin for picking in canvas
|
||
|
|
* @version 2.1.27
|
||
|
|
* @date 7/30/2025, 1:37:32 PM
|
||
|
|
* @author AntVis
|
||
|
|
* @docs https://g.antv.antgroup.com/
|
||
|
|
*/function Uf(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,l=r.r,c=r.fill,u=r.stroke,h=r.lineWidth,d=void 0===h?1:h,f=r.increasedLineWidthForHitTesting,p=void 0===f?0:f,g=r.pointerEvents,v=void 0===g?"auto":g,m=(d+p)/2,y=_n(o,s,e.x,e.y),x=b(as(v,c,u),2),E=x[0],w=x[1];return E&&w||n?y<=l+m:E?y<=l:!!w&&(y>=l-m&&y<=l+m)}function $f(t,e,n,r){return t/(n*n)+e/(r*r)}function Yf(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,l=r.rx,c=r.ry,u=r.fill,h=r.stroke,d=r.lineWidth,f=void 0===d?1:d,p=r.increasedLineWidthForHitTesting,g=void 0===p?0:p,v=r.pointerEvents,m=void 0===v?"auto":v,y=e.x,x=e.y,E=b(as(m,u,h),2),w=E[0],k=E[1],M=(f+g)/2,S=(y-o)*(y-o),N=(x-s)*(x-s);return w&&k||n?$f(S,N,l+M,c+M)<=1:w?$f(S,N,l,c)<=1:!!k&&($f(S,N,l-M,c-M)>=1&&$f(S,N,l+M,c+M)<=1)}function qf(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function Xf(t,e,n,r,i,o,a,s){var l=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),c={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return _n(c.x,c.y,a,s)<=o/2}function Kf(t,e,n,r,i,o,a){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),h=i/2;return o>=s-h&&o<=l+h&&a>=c-h&&a<=u+h&&Wn(t,e,n,r,o,a)<=i/2}function Zf(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(Kf(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],l=t[o-1];if(Kf(s[0],s[1],l[0],l[1],e,n,r))return!0}return!1}Hf.tag="CanvasPicker";function Qf(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function Jf(t,e,n){return(n[0]-t[0])*(e[1]-t[1])===(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function tp(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(Jf(a,s,[e,n]))return!0;Qf(a[1]-n)>0!=Qf(s[1]-n)>0&&Qf(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function ep(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=tp(t[i],e,n))break}return r}function np(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,l=r.lineWidth,c=void 0===l?1:l,u=r.increasedLineWidthForHitTesting,h=void 0===u?0:u,d=r.pointerEvents;return!(!b(as(void 0===d?"auto":d,r.fill,r.stroke),2)[1]&&!n||!c)&&Kf(i,o,a,s,c+h,e.x,e.y)}function rp(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,l=void 0===s?1:s,c=a.increasedLineWidthForHitTesting,u=void 0===c?0:c,h=a.stroke,d=a.fill,f=a.d,p=a.pointerEvents,g=void 0===p?"auto":p,v=f.segments,m=f.hasArc,y=f.polylines,x=f.polygons,E=b(as(g,(null==x?void 0:x.length)&&d,h),2),w=E[0],k=E[1],M=Yo(t),S=!1;return w||n?S=m?r(t,e):ep(x,e.x,e.y)||ep(y,e.x,e.y):((k||n)&&(S=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,h=l.prePoint,d=l.box;if(!d||qf(d.x-a,d.y-a,d.width+e,d.height+e,n,r))switch(l.command){case"L":case"Z":if(o=Kf(h[0],h[1],c[0],c[1],e,n,r))return!0;break;case"Q":if(o=Qn(h[0],h[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=Yn(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":l.cubicParams||(l.cubicParams=fn(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var f=l.cubicParams,p=h,g=0;g<f.length;g+=6){var v=Yn(p[0],p[1],f[g],f[g+1],f[g+2],f[g+3],f[g+4],f[g+5],n,r,i);if(p=[f[g+4],f[g+5]],o=v<=e/2)return!0}}}return o}(v,l+u,e.x,e.y,M)),S)}function ip(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=void 0===a?1:a,l=r.increasedLineWidthForHitTesting,c=void 0===l?0:l,u=r.points,h=r.pointerEvents,d=b(as(void 0===h?"auto":h,o,i),2),f=d[0],p=!1;return(d[1]||n)&&(p=Zf(u.points,s+c,e.x,e.y,!0)),p||!f&&!n||(p=tp(u.points,e.x,e.y)),p}function op(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=void 0===i?1:i,a=r.increasedLineWidthForHitTesting,s=void 0===a?0:a,l=r.points,c=r.pointerEvents;return!(!b(as(void 0===c?"auto":c,r.fill,r.stroke),2)[1]&&!n||!o)&&Zf(l.points,o+s,e.x,e.y,!1)}function ap(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,l=o.stroke,c=o.lineWidth,u=void 0===c?1:c,h=o.increasedLineWidthForHitTesting,d=void 0===h?0:h,f=o.x,p=void 0===f?0:f,g=o.y,v=void 0===g?0:g,m=o.width,y=o.height,x=o.pointerEvents,E=b(as(void 0==
|
||
|
|
/*!
|
||
|
|
* @antv/g-plugin-image-loader
|
||
|
|
* @description A G plugin for loading image
|
||
|
|
* @version 2.1.26
|
||
|
|
* @date 7/30/2025, 1:35:52 PM
|
||
|
|
* @author AntVis
|
||
|
|
* @docs https://g.antv.antgroup.com/
|
||
|
|
*/var fp=function(){return c(function t(){s(this,t),this.cacheStore=new Map},[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,e,n){return!this.cacheStore.has(t)&&(this.cacheStore.set(t,{value:e,counter:new Set([n.entity])}),this.onRefAdded(n),!0)}},{key:"get",value:function(t,e){var n=this.cacheStore.get(t);return n?(n.counter.has(e.entity)||(n.counter.add(e.entity),this.onRefAdded(e)),n.value):null}},{key:"update",value:function(t,e,n){var r=this.cacheStore.get(t);return!!r&&(r.value=a(a({},r.value),e),r.counter.has(n.entity)||(r.counter.add(n.entity),this.onRefAdded(n)),!0)}},{key:"release",value:function(t,e){var n=this.cacheStore.get(t);return!!n&&(n.counter.delete(e.entity),n.counter.size<=0&&this.cacheStore.delete(t),!0)}},{key:"releaseRef",value:function(t){var e=this;Array.from(this.cacheStore.keys()).forEach(function(n){e.release(n,t)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),pp=[],gp=[],vp=function(){function t(){s(this,t)}return c(t,null,[{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;t.rafId&&(e.cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;pp.length<=0&&gp.length<=0||(gp.forEach(function(t){return t()}),gp=pp.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame(function(){t.executeTask(e)}))}},{key:"sliceImage",value:function(e,n,r,i){for(var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,l=e.naturalHeight||e.height,c=n-o,u=r-o,h=Math.ceil(s/c),d=Math.ceil(l/u),f={tileSize:[n,r],gridSize:[d,h],tiles:Array(d).fill(null).map(function(){return Array(h).fill(null)})},p=function(t){for(var o=function(o){pp.push(function(){var h=o*c,d=t*u,p=[Math.min(n,s-h),Math.min(r,l-d)],g=p[0],v=p[1],m=a.createCanvas();m.width=n,m.height=r,m.getContext("2d").drawImage(e,h,d,g,v,0,0,g,v),f.tiles[t][o]={x:h,y:d,tileX:o,tileY:t,data:m},i()})},d=0;d<h;d++)o(d)},g=0;g<d;g++)p(g);return t.stop(),t.executeTask(),f}}])}();vp.TASK_NUM_PER_FRAME=10;var mp=new fp;mp.onRefAdded=function(t){var e=this;t.addEventListener(al.DESTROY,function(){e.releaseRef(t)},{once:!0})};var yp=function(){return c(function t(e,n){s(this,t),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=n},[{key:"getImageSync",value:function(t,e,n){var r=ne(t)?t:t.src;if(mp.has(r)){var i=mp.get(r,e);if(i.img.complete)return null==n||n(i),i}return this.getOrCreateImage(t,e).then(function(t){null==n||n(t)}).catch(function(t){console.error(t)}),null}},{key:"getOrCreateImage",value:function(t,e){var n=this,r=ne(t)?t:t.src;if(!ne(t)&&!mp.has(r)){var i={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:bp(t)};mp.put(r,i,e)}if(mp.has(r)){var o=mp.get(r,e);return o.img.complete?Promise.resolve(o):new Promise(function(t,e){o.img.addEventListener("load",function(){o.size=[o.img.naturalWidth||o.img.width,o.img.naturalHeight||o.img.height],o.tileSize=bp(o.img),t(o)}),o.img.addEventListener("error",function(t){e(t)})})}return new Promise(function(t,i){var o=n.context.config.createImage();if(o){var a={img:o,size:[0,0],tileSize:bp(o)};mp.put(r,a,e),o.onload=function(){a.size=[o.naturalWidth||o.width,o.naturalHeight||o.height],a.tileSize=bp(a.img),t(a)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=r}})}},{key:"createDownSampledImage",value:(e=cr(sr().mark(function t(e,n){var r,i,o,s,l,c,u,h,d,f,p,g,v,m;return sr().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,n);case 1:if(void 0===(r=t.sent).downSamplingRate){t.next=2;break}return t.abrupt("return",r);case 2:if(i=this.context.config.enableLargeImageOptimization,s=(o="boolean"==typeof i?{}:i).maxDownSampledImageSize,l=void 0===s?2048:s,c=o.downSamplingRateThreshold,u=void 0===c?.5:c,h=this.runtime.globalThis.cre
|
||
|
|
/*!
|
||
|
|
* @antv/g-plugin-canvas-renderer
|
||
|
|
* @description A G plugin of renderer implementation with Canvas2D API
|
||
|
|
* @version 2.3.3
|
||
|
|
* @date 7/30/2025, 1:36:40 PM
|
||
|
|
* @author AntVis
|
||
|
|
* @docs https://g.antv.antgroup.com/
|
||
|
|
*/function Mp(t,e,n,r,i,o,a){var s,l;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,u=c.width,h=c.height;l=r.contextService.getDPR();var d=r.config.offscreenCanvas;(s=o.offscreenCanvasCreator.getOrCreateCanvas(d)).width=u*l,s.height=h*l;var f=o.offscreenCanvasCreator.getOrCreateContext(d),p={restoreStack:[],prevObject:null,currentContext:new Map};t.image.forEach(function(t){i.renderDisplayObject(t,f,r,p,o)}),p.restoreStack.forEach(function(){f.restore()})}return a.getOrCreatePatternSync(e,t,n,s,l,e.getGeometryBounds().min,function(){e.dirty(),r.renderingService.dirtify()})}function Sp(t,e,n,r){var i;if(t.type===to.LinearGradient||t.type===to.RadialGradient){var o=e.getGeometryBounds(),s=o&&2*o.halfExtents[0]||1,l=o&&2*o.halfExtents[1]||1,c=o&&o.min||[0,0];i=r.getOrCreateGradient(a(a({type:t.type},t.value),{},{min:c,width:s,height:l}),n)}return i}kp.tag="CanvasRenderer";var Np=["shadowBlur","shadowOffsetX","shadowOffsetY"],Tp=["lineCap","lineJoin","miterLimit"],Op={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},Cp={};function Ap(t,e,n,r){var i=r.has(e)?r.get(e):Op[e];return i!==n&&("lineDash"===e?t.setLineDash(n):t[e]=n,r.set(e,n)),i}var Pp=function(){return c(function t(e){s(this,t),this.imagePool=e},[{key:"applyAttributesToContext",value:function(t,e){}},{key:"render",value:function(t,e,n,r,i,o){}},{key:"applyCommonStyleToContext",value:function(t,e,n,r){var i=n?Cp:r.prevObject.parsedStyle,o=e.parsedStyle;(n||o.opacity!==i.opacity)&&Ap(t,"globalAlpha",$t(o.opacity)?Op.globalAlpha:o.opacity,r.currentContext),(n||o.blend!==i.blend)&&Ap(t,"globalCompositeOperation",$t(o.blend)?Op.globalCompositeOperation:o.blend,r.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(t,e,n,r){var i=n?Cp:r.prevObject.parsedStyle,o=e.parsedStyle,a=o.lineWidth,s=void 0===a?Op.lineWidth:a,l=o.fill&&!o.fill.isNone;if(o.stroke&&!o.stroke.isNone&&s>0){if(n||e.attributes.stroke!==r.prevObject.attributes.stroke)Ap(t,"strokeStyle",$t(o.stroke)||Array.isArray(o.stroke)||o.stroke.isNone?Op.strokeStyle:e.attributes.stroke,r.currentContext);(n||o.lineWidth!==i.lineWidth)&&Ap(t,"lineWidth",$t(o.lineWidth)?Op.lineWidth:o.lineWidth,r.currentContext),(n||o.lineDash!==i.lineDash)&&Ap(t,"lineDash",o.lineDash||Op.lineDash,r.currentContext),(n||o.lineDashOffset!==i.lineDashOffset)&&Ap(t,"lineDashOffset",$t(o.lineDashOffset)?Op.lineDashOffset:o.lineDashOffset,r.currentContext);for(var c=0;c<Tp.length;c++){var u=Tp[c];(n||o[u]!==i[u])&&Ap(t,u,$t(o[u])?Op[u]:o[u],r.currentContext)}}l&&(n||e.attributes.fill!==r.prevObject.attributes.fill)&&Ap(t,"fillStyle",$t(o.fill)||Array.isArray(o.fill)||o.fill.isNone?Op.fillStyle:e.attributes.fill,r.currentContext)}},{key:"applyStyleToContext",value:function(t,e,n,r){var i=e.nodeName;this.applyCommonStyleToContext(t,e,n,r),i===pr.IMAGE||this.applyStrokeFillStyleToContext(t,e,n,r)}},{key:"applyShadowAndFilterStyleToContext",value:function(t,e,n,r){var i=e.parsedStyle;if(n){Ap(t,"shadowColor",i.shadowColor.toString(),r.currentContext);for(var o=0;o<Np.length;o++){var a=Np[o];Ap(t,a,i[a]||Op[a],r.currentContext)}}i.filter&&i.filter.length&&Ap(t,"filter",e.attributes.filter,r.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e){Ap(t,"shadowColor",Op.shadowColor,r.currentContext);for(var o=0;o<Np.length;o++){var a=Np[o];Ap(t,a,Op[a],r.currentContext)}}if(n)if(e&&i){var s=t.filter;!$t(s)&&s.indexOf("drop-shadow")>-1&&Ap(t,"filter",s.replace(/drop-shadow\([^)]*\)/,"").trim()||Op.filter,r.currentContext)}else Ap(t,"filter",Op.filter,r.currentContext)}},{key:"fillToContext",value:function(t,e,n,r,i){var o=this,a=e.parsedStyle,s=a.fill,l=a.fillRule,c=null;if(Array.isArray(s)&&s.length>0)s.forEach(function(r){var i=Ap(t,"fillStyle",Sp(r,e,t,o.imagePool),n.currentContext);c=null!
|
||
|
|
/*!
|
||
|
|
* @antv/g-plugin-html-renderer
|
||
|
|
* @description A G plugin for rendering HTML
|
||
|
|
* @version 2.1.27
|
||
|
|
* @date 7/30/2025, 1:35:48 PM
|
||
|
|
* @author AntVis
|
||
|
|
* @docs https://g.antv.antgroup.com/
|
||
|
|
*/Gp.tag="HTMLRendering";var Vp=function(t){function e(){var t;s(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=v(this,e,[].concat(r))).name="html-renderer",t}return y(e,t),c(e,[{key:"init",value:function(){this.addRenderingPlugin(new Gp)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(vr),Wp=function(){return c(function t(e){s(this,t),this.renderingContext=e.renderingContext,this.canvasConfig=e.config},[{key:"init",value:function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=ne(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}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(t,e){var n=this.canvasConfig.devicePixelRatio;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){Qa&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(nl.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:(t=cr(sr().mark(function t(){var e,n,r,i=arguments;return sr().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=(e=i.length>0&&void 0!==i[0]?i[0]:{}).type,r=e.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,r));case 1:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})}]);var t}(),Hp=function(t){function e(){var t;s(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=v(this,e,[].concat(r))).name="canvas-context-register",t}return y(e,t),c(e,[{key:"init",value:function(){this.context.ContextService=Wp}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(vr),Up=function(t){function e(t){var n;return s(this,e),(n=v(this,e,[t])).registerPlugin(new Hp),n.registerPlugin(new Ep),n.registerPlugin(new Ff),n.registerPlugin(new Bp),n.registerPlugin(new zp),n.registerPlugin(new cp),n.registerPlugin(new Vp),n}return y(e,t),c(e)}(mr);
|
||
|
|
/*!
|
||
|
|
* @antv/g-canvas
|
||
|
|
* @description A renderer implemented by Canvas 2D API
|
||
|
|
* @version 2.0.48
|
||
|
|
* @date 7/30/2025, 1:38:18 PM
|
||
|
|
* @author AntVis
|
||
|
|
* @docs https://g.antv.antgroup.com/
|
||
|
|
*/class $p extends kf{constructor(t){super(Object.assign(Object.assign({},t),{style:Object.assign({},$p.defaultStyleProps,t.style)})),this.rootPointerEvent=new Xs(null),this.forwardEvents=t=>{const e=this.context.canvas,n=e.context.renderingContext.root.ownerDocument.defaultView;this.normalizeToPointerEvent(t,n).forEach(r=>{const i=this.bootstrapEvent(this.rootPointerEvent,r,n,t);Ce(e.context.eventService,"mappingTable.pointerupoutside",[]),e.context.eventService.mapEvent(i)})}}get eventService(){return this.context.canvas.context.eventService}get events(){return[t.CommonEvent.CLICK,t.CommonEvent.POINTER_DOWN,t.CommonEvent.POINTER_MOVE,t.CommonEvent.POINTER_UP,t.CommonEvent.POINTER_OVER,t.CommonEvent.POINTER_LEAVE]}getDomElement(){return this.getShape("key").getDomElement()}render(t=this.parsedAttributes,e=this){this.drawKeyShape(t,e),this.drawPortShapes(t,e)}getKeyStyle(t){const e=Pe(t,["dx","dy","innerHTML","pointerEvents","cursor"]),{dx:n=0,dy:r=0}=e,i=ze(e,["dx","dy"]),[o,a]=this.getSize(t);return Object.assign(Object.assign({x:n,y:r},i),{width:o,height:a})}drawKeyShape(t,e){const n=this.getKeyStyle(t),{x:r,y:i,width:o=0,height:a=0}=n,s=this.upsert("key-container",fc,{x:r,y:i,width:o,height:a,opacity:0},e);return this.upsert("key",rc,n,s)}connectedCallback(){if(!(this.context.canvas.getRenderer("main")instanceof Up))return;const t=this.getDomElement();this.events.forEach(e=>{t.addEventListener(e,this.forwardEvents)})}attributeChangedCallback(t,e,n){"zIndex"===t&&e!==n&&(this.getDomElement().style.zIndex=n)}destroy(){const t=this.getDomElement();this.events.forEach(e=>{t.removeEventListener(e,this.forwardEvents)}),super.destroy()}normalizeToPointerEvent(t,e){const n=[];if(e.isTouchEvent(t))for(let e=0;e<t.changedTouches.length;e++){const r=t.changedTouches[e];ve(r.button)&&(r.button=0),ve(r.buttons)&&(r.buttons=1),ve(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),ve(r.width)&&(r.width=r.radiusX||1),ve(r.height)&&(r.height=r.radiusY||1),ve(r.tiltX)&&(r.tiltX=0),ve(r.tiltY)&&(r.tiltY=0),ve(r.pointerType)&&(r.pointerType="touch"),ve(r.pointerId)&&(r.pointerId=r.identifier||0),ve(r.pressure)&&(r.pressure=r.force||.5),ve(r.twist)&&(r.twist=0),ve(r.tangentialPressure)&&(r.tangentialPressure=0),r.isNormalized=!0,r.type=t.type,n.push(r)}else if(e.isMouseEvent(t)){const e=t;ve(e.isPrimary)&&(e.isPrimary=!0),ve(e.width)&&(e.width=1),ve(e.height)&&(e.height=1),ve(e.tiltX)&&(e.tiltX=0),ve(e.tiltY)&&(e.tiltY=0),ve(e.pointerType)&&(e.pointerType="mouse"),ve(e.pointerId)&&(e.pointerId=1),ve(e.pressure)&&(e.pressure=.5),ve(e.twist)&&(e.twist=0),ve(e.tangentialPressure)&&(e.tangentialPressure=0),e.isNormalized=!0,n.push(e)}else n.push(t);return n}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}bootstrapEvent(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:i,y:o}=this.getViewportXY(e);t.viewport.x=i,t.viewport.y=o;const[a,s]=this.context.canvas.getCanvasByViewport([i,o]);return t.canvas.x=a,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t}getViewportXY(t){let e,n;const{offsetX:r,offsetY:i,clientX:o,clientY:a}=t;if($t(r)||$t(i)){const t=this.eventService.client2Viewport({x:o,y:a});e=t.x,n=t.y}else e=r,n=i;return{x:e,y:n}}onframe(){super.onframe();const{opacity:t}=this.attributes;this.getDomElement().style.opacity=`${t}`}}$p.defaultStyleProps={size:[160,80],halo:!1,icon:!1,label:!1,pointer
|
||
|
|
/**
|
||
|
|
* @license
|
||
|
|
* Copyright 2019 Google LLC
|
||
|
|
* SPDX-License-Identifier: Apache-2.0
|
||
|
|
*/const Hj=Symbol("Comlink.proxy"),Uj=Symbol("Comlink.endpoint"),$j=Symbol("Comlink.releaseProxy"),Yj=Symbol("Comlink.finalizer"),qj=Symbol("Comlink.thrown"),Xj=t=>"object"==typeof t&&null!==t||"function"==typeof t,Kj=new Map([["proxy",{canHandle:t=>Xj(t)&&t[Hj],serialize(t){const{port1:e,port2:n}=new MessageChannel;return Zj(t,e),[n,[n]]},deserialize:t=>(t.start(),Jj(t))}],["throw",{canHandle:t=>Xj(t)&&qj in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function Zj(t,e=globalThis,n=["*"]){e.addEventListener("message",function r(i){if(!i||!i.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,i.origin))return void console.warn(`Invalid origin '${i.origin}' for comlink proxy`);const{id:o,type:a,path:s}=Object.assign({path:[]},i.data),l=(i.data.argumentList||[]).map(lB);let c;try{const e=s.slice(0,-1).reduce((t,e)=>t[e],t),n=s.reduce((t,e)=>t[e],t);switch(a){case"GET":c=n;break;case"SET":e[s.slice(-1)[0]]=lB(i.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[Hj]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;Zj(t,n),c=function(t,e){return aB.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(t){c={value:t,[qj]:0}}Promise.resolve(c).catch(t=>({value:t,[qj]:0})).then(n=>{const[i,s]=sB(n);e.postMessage(Object.assign(Object.assign({},i),{id:o}),s),"RELEASE"===a&&(e.removeEventListener("message",r),Qj(e),Yj in t&&"function"==typeof t[Yj]&&t[Yj]())}).catch(t=>{const[n,r]=sB({value:new TypeError("Unserializable return value"),[qj]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function Qj(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function Jj(t,e){const n=new Map;return t.addEventListener("message",function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}}),iB(t,n,[],e)}function tB(t){if(t)throw new Error("Proxy has been released and is not useable")}function eB(t){return cB(t,new Map,{type:"RELEASE"}).then(()=>{Qj(t)})}const nB=new WeakMap,rB="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(nB.get(t)||0)-1;nB.set(t,e),0===e&&eB(t)});function iB(t,e,n=[],r=function(){}){let i=!1;const o=new Proxy(r,{get(r,a){if(tB(i),a===$j)return()=>{!function(t){rB&&rB.unregister(t)}(o),eB(t),e.clear(),i=!0};if("then"===a){if(0===n.length)return{then:()=>o};const r=cB(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(lB);return r.then.bind(r)}return iB(t,e,[...n,a])},set(r,o,a){tB(i);const[s,l]=sB(a);return cB(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:s},l).then(lB)},apply(r,o,a){tB(i);const s=n[n.length-1];if(s===Uj)return cB(t,e,{type:"ENDPOINT"}).then(lB);if("bind"===s)return iB(t,e,n.slice(0,-1));const[l,c]=oB(a);return cB(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:l},c).then(lB)},construct(r,o){tB(i);const[a,s]=oB(o);return cB(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:a},s).then(lB)}});return function(t,e){const n=(nB.get(e)||0)+1;nB.set(e,n),rB&&rB.register(t,e,t)}(o,t),o}function oB(t){const e=t.map(sB);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const aB=new WeakMap;function sB(t){for(const[e,n]of Kj)if(n.canHandle(t)){const[r,i]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},i]}return[{type:"RAW",value:t},aB.get(t)||[]]}function lB(t){switch(t.type){case"HANDLER":return Kj.get(t.name).deserialize(t.value);case"RAW":return t.value}}function cB(t,e,n,r){return new Promise(i=>{const o=new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-");e.set(o,i),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)})}class uB extends cv{constructor(t,e,n){
|
||
|
|
/*!
|
||
|
|
* @antv/g-plugin-dragndrop
|
||
|
|
* @description A G plugin for Drag n Drop implemented with PointerEvents
|
||
|
|
* @version 2.0.38
|
||
|
|
* @date 7/30/2025, 1:35:41 PM
|
||
|
|
* @author AntVis
|
||
|
|
* @docs https://g.antv.antgroup.com/
|
||
|
|
*/var wU=function(){function t(e){s(this,t),this.dragndropPluginOptions=e}return c(t,[{key:"apply",value:function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView,a=function(t){var e=t.target,r=e===i,a=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(a){var s=!1,l=t.timeStamp,c=[t.clientX,t.clientY],u=null,h=[t.clientX,t.clientY],d=function(){var t=cr(sr().mark(function t(o){var d,f,p,g,v,m;return sr().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(s){t.next=2;break}if(d=o.timeStamp-l,f=yn([o.clientX,o.clientY],c),!(d<=n.dragndropPluginOptions.dragstartTimeThreshold||f<=n.dragndropPluginOptions.dragstartDistanceThreshold)){t.next=1;break}return t.abrupt("return");case 1:o.type="dragstart",a.dispatchEvent(o),s=!0;case 2:if(o.type="drag",o.dx=o.clientX-h[0],o.dy=o.clientY-h[1],a.dispatchEvent(o),h=[o.clientX,o.clientY],r){t.next=4;break}return p="pointer"===n.dragndropPluginOptions.overlap?[o.canvasX,o.canvasY]:e.getBounds().center,t.next=3,i.elementsFromPoint(p[0],p[1]);case 3:g=t.sent,v=g[g.indexOf(e)+1],m=(null==v?void 0:v.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?i:null),u!==m&&(u&&(o.type="dragleave",o.target=u,u.dispatchEvent(o)),m&&(o.type="dragenter",o.target=m,m.dispatchEvent(o)),(u=m)&&(o.type="dragover",o.target=u,u.dispatchEvent(o)));case 4:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}();o.addEventListener("pointermove",d);var f=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",a.dispatchEvent(e),s=!1}o.removeEventListener("pointermove",d)};e.addEventListener("pointerup",f,{once:!0}),e.addEventListener("pointerupoutside",f,{once:!0})}};r.hooks.init.tap(t.tag,function(){o.addEventListener("pointerdown",a)}),r.hooks.destroy.tap(t.tag,function(){o.removeEventListener("pointerdown",a)})}}])}();wU.tag="Dragndrop";var kU=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(this,e),(t=v(this,e)).name="dragndrop",t.options=n,t}return y(e,t),c(e,[{key:"init",value:function(){this.addRenderingPlugin(new wU(a({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(vr);const MU=["main"],SU=["background","main","label","transient"];class NU{getConfig(){return this.config}getLayer(t="main"){return this.extends.layers[t]||this.getLayers().main}getLayers(){return this.extends.layers}getRenderer(t){return this.extends.renderers[t]}getCamera(t="main"){return this.getLayer(t).getCamera()}getRoot(t="main"){return this.getLayer(t).getRoot()}getContextService(t="main"){return this.getLayer(t).getContextService()}setCursor(t){this.config.cursor=t,this.getLayer().setCursor(t)}get document(){return this.getLayer().document}get context(){return this.getLayer().context}constructor(t){this.config={enableMultiLayer:!0},Object.assign(this.config,t);const e=this.config,{renderer:n,background:r,cursor:i,enableMultiLayer:o}=e,a=ze(e,["renderer","background","cursor","enableMultiLayer"]),s=o?SU:MU,l=TU(n,s),c=Object.fromEntries(s.map(t=>[t,new Cc(Object.assign(Object.assign({},a),{supportsMutipleCanvasesInOneContainer:o,renderer:l[t],background:o?"background"===t?r:void 0:r}))]));OU(c),this.extends={config:this.config,renderer:n,renderers:l,layers:c}}get ready(){return Promise.all(Object.entries(this.getLayers()).map(([,t])=>t.ready))}resize(t,e){Object.assign(this.extends.config,{width:t,height:e}),Object.values(this.getLayers()).forEach(n=>{const r=n.getCamera(),i=r.getPosition(),o=r.getFocalPoint();n.resize(t,e),r.setPosition(i),r.setFocalPoint(o)})}getBounds(t){return mh(Object.values(this.getLayers()).map(e=>t?e.getRoot().childNodes.find(e=>e.classList.includes(t)):e.getRoot()).filter(t=>(null==t?void 0:t.
|