sync: 鍚屾灞€鍩熺綉鏈€鏂颁唬鐮?(source master @ b69568e4)
This commit is contained in:
1 parent
4f7f07504a
commit
8bc8b0e082
1651 files changed
+278599
-11416
No files matched your search
+68
@@ -0,0 +1,68 @@
|
||||
!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";function e(t){return e="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},e(t)}function n(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n);if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function r(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(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 o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function a(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(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 l(t,e){if(t){if("string"==typeof t)return c(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)?c(t,e):void 0}}function u(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(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 h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function d(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(d=function(){return!!t})()}function f(t,n){if(n&&("object"==e(n)||"function"==typeof n))return n;if(void 0!==n)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 g(t,e,n){return e=h(e),f(t,d()?Reflect.construct(e,n||[],h(t).constructor):e.apply(t,n))}function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}function v(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&&p(t,e)}function m(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=[],a=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);a=!0);}catch(t){c=!0,i=t}finally{try{if(!a&&null!=n.return&&(A=n.return(),Object(A)!==A))return}finally{if(c)throw i}}return s}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var w={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,A){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,A),a=n?n+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],s]:t._events[a].push(s):(t._events[a]=s,t._eventsCount++),t}function A(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.Line truncated
|
||||
/*!
|
||||
* @antv/g-math
|
||||
* @description Geometry util
|
||||
* @version 3.1.0
|
||||
* @date 12/22/2025, 3:02:36 AM
|
||||
* @author AntVis
|
||||
* @docs https://g.antv.antgroup.com/
|
||||
*/function Nn(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Tn(t,e){var n=Math.min.apply(Math,u(t)),r=Math.min.apply(Math,u(e));return{x:n,y:r,width:Math.max.apply(Math,u(t))-n,height:Math.max.apply(Math,u(e))-r}}function On(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function In(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function Ln(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),a=1/0,c=-1/0,l=[o,A],u=2*-Math.PI;u<=2*Math.PI;u+=Math.PI){var h=s+u;o<A?o<h&&h<A&&l.push(h):A<h&&h<o&&l.push(h)}for(var d=0;d<l.length;d++){var f=On(t,0,n,r,i,l[d]);f<a&&(a=f),f>c&&(c=f)}for(var g=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),p=1/0,v=-1/0,m=[o,A],y=2*-Math.PI;y<=2*Math.PI;y+=Math.PI){var w=g+y;o<A?o<w&&w<A&&m.push(w):A<w&&w<o&&m.push(w)}for(var b=0;b<m.length;b++){var B=In(0,e,n,r,i,m[b]);B<p&&(p=B),B>v&&(v=B)}return{x:a,y:p,width:c-a,height:v-p}}function Pn(t,e,n,r,i,o){var A=-1,s=1/0,a=[n,r],c=20;o&&o>200&&(c=o/10);for(var l=1/c,h=l/10,d=0;d<=c;d++){var f=d*l,g=[i.apply(void 0,u(t.concat([f]))),i.apply(void 0,u(e.concat([f])))],p=Nn(a[0],a[1],g[0],g[1]);p<s&&(A=f,s=p)}if(0===A)return{x:t[0],y:e[0]};if(1===A){var v=t.length;return{x:t[v-1],y:e[v-1]}}s=1/0;for(var m=0;m<32&&!(h<1e-4);m++){var y=A-h,w=A+h,b=[i.apply(void 0,u(t.concat([y]))),i.apply(void 0,u(e.concat([y])))],B=Nn(a[0],a[1],b[0],b[1]);if(y>=0&&B<s)A=y,s=B;else{var E=[i.apply(void 0,u(t.concat([w]))),i.apply(void 0,u(e.concat([w])))],x=Nn(a[0],a[1],E[0],E[1]);w<=1&&x<s?(A=w,s=x):h*=.5}}return{x:i.apply(void 0,u(t.concat([A]))),y:i.apply(void 0,u(e.concat([A])))}}function Dn(t,e,n,r){return Nn(t,e,n,r)}function Rn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Hn(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 a=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(a,s))}function _n(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 Gn(t,e,n,r){var i,o,A,s=-3*t+9*e-9*n+3*r,a=6*t-12*e+6*n,c=3*e-3*t,l=[];if(ie(s,0))ie(a,0)||(i=-c/a)>=0&&i<=1&&l.push(i);else{var u=a*a-4*s*c;ie(u,0)?l.push(-a/(2*s)):u>0&&(o=(-a-(A=Math.sqrt(u)))/(2*s),(i=(-a+A)/(2*s))>=0&&i<=1&&l.push(i),o>=0&&o<=1&&l.push(o))}return l}function Kn(t,e,n,r,i,o,A,s){for(var a=[t,A],c=[e,s],l=Gn(t,n,i,A),u=Gn(e,r,o,s),h=0;h<l.length;h++)a.push(_n(t,n,i,A,l[h]));for(var d=0;d<u.length;d++)c.push(_n(e,r,o,s,u[d]));return Tn(a,c)}function jn(t,e,n,r,i,o,A,s,a,c,l){var u=function(t,e,n,r,i,o,A,s,a,c,l){return Pn([t,n,i,A],[e,r,o,s],a,c,_n,l)}(t,e,n,r,i,o,A,s,a,c,l);return Nn(u.x,u.y,a,c)}function zn(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+=Nn(r[0],r[1],i[0],i[1])}return e}(t)}function Vn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Wn(t,e,n){var r=t+n-2*e;if(ie(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function Yn(t,e,n,r,i,o){var A=Wn(t,n,i)[0],s=Wn(e,r,o)[0],a=[t,i],c=[e,o];return void 0!==A&&a.push(Vn(t,n,i,A)),void 0!==s&&c.push(Vn(e,r,o,s)),Tn(a,c)}function Xn(t,e,n,r,i,o,A,s){var a=function(t,e,n,r,i,o,A,s){return Pn([t,n,i],[e,r,o],A,s,Vn)}(t,e,n,r,i,o,A,s);return Nn(a.x,a.y,A,s)}function qn(t,e){this.v=t,this.k=e}function $n(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}$n=function(t,e,n,r){function o(e,n){$n(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))},$n(t,e,n,r)}function Zn(){
|
||||
/*! 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 a=r&&r.prototype instanceof s?r:s,c=Object.create(a.prototype);return $n(c,"_invoke",function(n,r,i){var o,s,a,c=0,l=i||[],u=!1,h={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return o=e,s=0,a=t,h.n=n,A}};function d(n,r){for(s=n,a=r,e=0;!u&&c&&!i&&e<l.length;e++){var i,o=l[e],d=h.p,f=o[2];n>3?(i=f===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=t):o[0]<=d&&((i=n<2&&d<o[1])?(s=0,h.v=r,h.n=o[1]):d<f&&(i=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,h.n=f,s=0))}if(i||n>1)return A;throw u=!0,r}return function(i,l,f){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&d(l,f),s=l,a=f;(e=s<2?t:a)||!u;){o||(s?s<3?(s>1&&(h.n=-1),d(s,a)):h.n=a:h.v=a);try{if(c=2,o){if(s||(i="next"),e=o[i]){if(!(e=e.call(o,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,s<2&&(s=0)}else 1===s&&(e=o.return)&&e.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=t}else if((e=(u=h.n<0)?a:n.call(r,h))!==A)break}catch(e){o=t,s=1,a=e}finally{c=1}}return{value:e,done:u}}}(n,i,o),!0),c}var A={};function s(){}function a(){}function c(){}e=Object.getPrototypeOf;var l=[][r]?e(e([][r]())):($n(e={},r,function(){return this}),e),u=c.prototype=s.prototype=Object.create(l);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,$n(t,i,"GeneratorFunction")),t.prototype=Object.create(u),t}return a.prototype=c,$n(u,"constructor",c),$n(c,"constructor",a),a.displayName="GeneratorFunction",$n(c,i,"GeneratorFunction"),$n(u),$n(u,i,"Generator"),$n(u,r,function(){return this}),$n(u,"toString",function(){return"[object Generator]"}),(Zn=function(){return{w:o,m:h}})()}function Jn(t,e){function n(r,i,o,A){try{var s=t[r](i),a=s.value;return a instanceof qn?e.resolve(a.v).then(function(t){n("next",t,o,A)},function(t){n("throw",t,o,A)}):e.resolve(a).then(function(t){s.value=t,o(s)},function(t){return n("throw",t,o,A)})}catch(t){A(t)}}var r;this.next||($n(Jn.prototype),$n(Jn.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),$n(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 tr(t,e,n,r,i){return new Jn(Zn().w(t,e,n,r),i||Promise)}function er(t,e,n,r,i){var o=tr(t,e,n,r,i);return o.next().then(function(t){return t.done?t.value:o.next()})}function nr(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 rr(t){if(null!=t){var n=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(n)return n.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(e(t)+" is not iterable")}function ir(){var t=Zn(),e=t.m(ir),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,rr(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(ir=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 qn(t,e)},AsyncIterator:Jn,async:function(t,e,n,i,A){return(r(e)?tr:er)(o(t),e,n,i,A)},keys:nr,values:rr}})()}function or(t,e,n,r,i,o,A){try{var s=t[o](A),a=s.value}catch(t){return void n(t)}s.done?e(a):Promise.resolve(a).then(r,i)}function Ar(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function A(t){or(o,r,i,A,s,"next",t)}function s(t){or(o,r,i,A,s,"throw",t)}A(void 0)})}}function sr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=l(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,A=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return A=t.done,t},e:function(t){s=!0,o=t},f:function(){try{A||null==n.return||n.return()}finally{if(s)throw o}}}}function ar(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnLine truncated
|
||||
/*!
|
||||
* @antv/g-lite
|
||||
* @description A core module for rendering engine implements DOM API.
|
||||
* @version 2.7.0
|
||||
* @date 12/24/2025, 11:55:20 AM
|
||||
* @author AntVis
|
||||
* @docs https://g.antv.antgroup.com/
|
||||
*/var cr=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),lr=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),ur=function(){return a(function t(){A(this,t),this.plugins=[]},[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach(function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)})}}])}(),hr=function(){return a(function t(e){A(this,t),this.clipSpaceNearZ=lr.NEGATIVE_ONE,this.plugins=[],this.config=o({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)},[{key:"registerPlugin",value:function(t){var e=this.plugins.findIndex(function(e){return e===t});-1===e&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex(function(e){return e===t});e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find(function(e){return e.name===t})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),dr=ft,fr=ht,gr=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},pr=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},vr=pt,mr=Et,yr=function(){function t(){A(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return a(t,[{key:"update",value:function(t,e){fr(this.center,t),fr(this.halfExtents,e),mr(this.min,this.center,this.halfExtents),dr(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){dr(this.center,e,t),vr(this.center,this.center,.5),mr(this.halfExtents,e,t),vr(this.halfExtents,this.halfExtents,.5),fr(this.min,t),fr(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],A=this.halfExtents,s=A[0],a=A[1],c=A[2],l=r-s,u=r+s,h=i-a,d=i+a,f=o-c,g=o+c,p=e.center,v=p[0],m=p[1],y=p[2],w=e.halfExtents,b=w[0],B=w[1],E=w[2],x=v-b,C=v+b,M=m-B,F=m+B,k=y-E,S=y+E;x<l&&(l=x),C>u&&(u=C),M<h&&(h=M),F>d&&(d=F),k<f&&(f=k),S>g&&(g=S),n[0]=.5*(l+u),n[1]=.5*(h+d),n[2]=.5*(f+g),A[0]=.5*(u-l),A[1]=.5*(d-h),A[2]=.5*(g-f),this.min[0]=l,this.min[1]=h,this.min[2]=f,this.max[0]=u,this.max[1]=d,this.max[2]=g}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,A=e[0],s=e[4],a=e[8],c=e[1],l=e[5],u=e[9],h=e[2],d=e[6],f=e[10],g=Math.abs(A),p=Math.abs(s),v=Math.abs(a),m=Math.abs(c),y=Math.abs(l),w=Math.abs(u),b=Math.abs(h),B=Math.abs(d),E=Math.abs(f);n[0]=e[12]+A*i[0]+s*i[1]+a*i[2],n[1]=e[13]+c*i[0]+l*i[1]+u*i[2],n[2]=e[14]+h*i[0]+d*i[1]+f*i[2],r[0]=g*o[0]+p*o[1]+v*o[2],r[1]=m*o[0]+y*o[1]+w*o[2],r[2]=b*o[0]+B*o[1]+E*o[2],mr(this.min,n,r),dr(this.max,n,r)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=gr([0,0,0],this.getMin(),e.getMin()),i=pr([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?fr([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?fr([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),wr=function(){return a(function t(e,n){A(this,t),this.distance=e||0,this.normal=n||ut(0,1,0),this.updatePNVertexFlag()},[{kLine truncated
|
||||
/*!
|
||||
* html2canvas 1.4.1 <https://html2canvas.hertzen.com>
|
||||
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
||||
* Released under MIT License
|
||||
*/
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
***************************************************************************** */
|
||||
var _c=function(t,e){return _c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},_c(t,e)};function Gc(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}_c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Kc(t,e,n,r){return new(n||(n=Promise))(function(e,i){function o(t){try{s(r.next(t))}catch(t){i(t)}}function A(t){try{s(r.throw(t))}catch(t){i(t)}}function s(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n(function(t){t(r)})).then(o,A)}s((r=r.apply(t,[])).next())})}function jc(t,e){var n,r,i,o,A={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;A;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return A.label++,{value:o[1],done:!1};case 5:A.label++,r=o[1],o=[0];continue;case 7:o=A.ops.pop(),A.trys.pop();continue;default:if(!(i=A.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){A=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){A.label=o[1];break}if(6===o[0]&&A.label<i[1]){A.label=i[1],i=o;break}if(i&&A.label<i[2]){A.label=i[2],A.ops.push(o);break}i[2]&&A.ops.pop(),A.trys.pop();continue}o=e.call(t,A)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}for(var zc=function(){function t(t,e,n,r){this.left=t,this.top=e,this.width=n,this.height=r}return t.prototype.add=function(e,n,r,i){return new t(this.left+e,this.top+n,this.width+r,this.height+i)},t.fromClientRect=function(e,n){return new t(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height)},t.fromDOMRectList=function(e,n){var r=Array.from(n).find(function(t){return 0!==t.width});return r?new t(r.left+e.windowBounds.left,r.top+e.windowBounds.top,r.width,r.height):t.EMPTY},t.EMPTY=new t(0,0,0,0),t}(),Vc=function(t,e){return zc.fromClientRect(t,e.getBoundingClientRect())},Wc=function(t){for(var e=[],n=0,r=t.length;n<r;){var i=t.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=t.charCodeAt(n++);56320==(64512&o)?e.push(((1023&i)<<10)+(1023&o)+65536):(e.push(i),n--)}else e.push(i)}return e},Yc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,t);var n=t.length;if(!n)return"";for(var r=[],i=-1,o="";++i<n;){var A=t[i];A<=65535?r.push(A):(A-=65536,r.push(55296+(A>>10),A%1024+56320)),(i+1===n||r.length>16384)&&(o+=String.fromCharCode.apply(String,r),r.length=0)}return o},Xc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),$c=0;$c<64;$c++)qc[Xc.charCodeAt($c)]=$c;for(var Zc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),tl=0;tl<64;tl++)Jc[Zc.charCodeAt(tl)]=tl;for(var el=function(t,e,n){return t.slice?t.slice(e,n):new Uint16Array(Array.prototype.slice.call(t,e,n))},nl=function(){function t(t,e,n,r,i,o){this.initialValue=t,this.errorValue=e,this.highStart=n,this.highValueIndex=r,this.index=i,this.data=o}return t.prototype.get=function(t){var e;if(t>=0){if(t<55296||t>56319&&t<=65535)return e=((e=this.index[t>>5])<<2)+(31&t),this.data[e];if(t<=65535)return e=((e=this.index[2048+(t-55296>>5)])<<2)+(31&t),this.data[e];if(t<this.highStart)return e=2080+(t>>11),e=this.index[e],e+=t>>5&63,e=((e=this.index[e])<<2)+(31&t),this.data[e];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},t}(),rl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",il="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ol=0;ol<64;ol++)il[rl.charCodeAt(ol)]=ol;var Al=10,sl=13,al=15,cl=17,ll=18,ul=19,hl=20,dl=21,fl=22,gl=24,pl=25,vl=26,ml=27,yl=28,wl=30,bl=32,Bl=33,El=34,xl=35,Cl=37,Ml=38,Fl=39,kl=40,Sl=42,Ql=[9001,65288],Ul="×",Nl="÷",Tl=function(t){var e,n,r,i=function(t){var e,n,r,i,o,A=.75*t.length,s=t.length,a=0;"="===t[t.length-1]&&(A--,"="===t[t.length-2]&&A--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(A):new Array(A),l=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<s;e+=4)n=Jc[t.charCodeAt(e)],r=Jc[t.charCodeAt(e+1)],i=Jc[t.charCodeAt(e+2)],o=Jc[t.charCodeAt(e+3)],l[a++]=n<<2|r>>4,l[a++]=(15&r)<<4|i>>2,l[a++]=(3&i)<<6|63&o;return c}(t),o=Array.isArray(i)?function(t){for(var e=t.length,n=[],r=0;r<e;r+=4)n.push(t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r]);return n}(i):new Uint32Array(i),A=Array.isArray(iLine truncated
|
||||
/*!
|
||||
* @antv/g
|
||||
* @description A core module for rendering engine implements DOM API.
|
||||
* @version 6.3.1
|
||||
* @date 12/24/2025, 11:55:39 AM
|
||||
* @author AntVis
|
||||
* @docs https://g.antv.antgroup.com/
|
||||
*/var mp=function(t){function e(t,n,r,i){var o;return A(this,e),(o=g(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 v(e,t),a(e)}(Gs),yp=0,wp=function(){return a(function t(e,n){var r;A(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(yp++),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(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=thisLine truncated
|
||||
/*!
|
||||
* @antv/g-canvas
|
||||
* @description A renderer implemented by Canvas 2D API
|
||||
* @version 2.2.0
|
||||
* @date 12/24/2025, 11:55:53 AM
|
||||
* @author AntVis
|
||||
* @docs https://g.antv.antgroup.com/
|
||||
*/var jw=Kw("renderState"),zw=function(){function t(e){A(this,t),this.renderQueue=[],Object.defineProperty(this,jw,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=C(),this.dprMatrix=C(),this.tmpMat4=C(),this.vec3a=at(),this.vec3b=at(),this.vec3c=at(),this.vec3d=at(),this.canvasRendererPluginOptions=e}return a(t,[{key:"apply",value:function(e,n){var r=this;this.context=e;var i=this.context,o=i.config,A=i.camera,s=i.renderingService,a=i.renderingContext,c=i.pathGeneratorFactory,l=o.renderer.getConfig().enableRenderingOptimization;o.renderer.getConfig().enableDirtyCheck=!1,o.renderer.getConfig().enableDirtyRectangleRendering=!1,this.pathGeneratorFactory=c;var u=e.contextService,h=a.root.ownerDocument.defaultView;s.hooks.init.tap(t.tag,function(){var t=u.getDPR(),e=o.width,n=o.height,i=u.getContext();r.clearRect(i,0,0,e*t,n*t,o.background)}),s.hooks.destroy.tap(t.tag,function(){r.renderQueue=[],_w(r,jw)[jw]={restoreStack:[],prevObject:null,currentContext:null}});var d=function(t,e){for(var i=[t];i.length>0;){var o,A=i.pop();A.isVisible()&&!A.isCulled()&&(l?r.renderDisplayObjectOptimized(A,e,r.context,_w(r,jw)[jw],n):r.renderDisplayObject(A,e,r.context,_w(r,jw)[jw],n));for(var s=(null===(o=A.sortable)||void 0===o||null===(o=o.sorted)||void 0===o?void 0:o.length)>0?A.sortable.sorted:A.childNodes,a=s.length-1;a>=0;a--)i.push(s[a])}};s.hooks.endFrame.tap(t.tag,function(){if(function(){var t,e=u.getContext(),n=u.getDPR(),i=o.width,A=o.height,a=r.canvasRendererPluginOptions,c=a.dirtyObjectNumThreshold,l=a.dirtyObjectRatioThreshold,d=s.getStats(),f=d.total,g=d.rendered,p=g/f;r.clearFullScreen=r.clearFullScreenLastFrame||!(null!==(t=h.context.renderingPlugins[1])&&void 0!==t&&t.isFirstTimeRenderingFinished)||s.disableDirtyRectangleRendering()||g>c&&p>l,e&&("function"==typeof e.resetTransform?e.resetTransform():e.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(e,0,0,i*n,A*n,o.background))}(),0!==a.root.childNodes.length){l=o.renderer.getConfig().enableRenderingOptimization,_w(r,jw)[jw]={restoreStack:[],prevObject:null,currentContext:_w(r,jw)[jw].currentContext},_w(r,jw)[jw].currentContext.clear(),r.clearFullScreenLastFrame=!1;var t=u.getContext(),e=u.getDPR();if(H(r.dprMatrix,[e,e,1]),O(r.vpMatrix,r.dprMatrix,A.getOrthoMatrix()),r.clearFullScreen)l?(t.save(),d(a.root,t),t.restore()):d(a.root,t);else{var i=r.safeMergeAABB(r.mergeDirtyAABBs(r.renderQueue));if(yr.isEmpty(i))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(i),f=c.x,g=c.y,p=c.width,v=c.height,y=bt(r.vec3a,[f,g,0],r.vpMatrix),w=bt(r.vec3b,[f+p,g,0],r.vpMatrix),b=bt(r.vec3c,[f,g+v,0],r.vpMatrix),B=bt(r.vec3d,[f+p,g+v,0],r.vpMatrix),E=Math.min(y[0],w[0],B[0],b[0]),x=Math.min(y[1],w[1],B[1],b[1]),C=Math.max(y[0],w[0],B[0],b[0]),M=Math.max(y[1],w[1],B[1],b[1]),F=Math.floor(E),k=Math.floor(x),S=Math.ceil(C-E),Q=Math.ceil(M-x);t.save(),r.clearRect(t,F,k,S,Q,o.background),t.beginPath(),t.rect(F,k,S,Q),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),o.renderer.getConfig().enableDirtyRectangleRenderingDebug&&h.dispatchEvent(new Vs(mc.DIRTY_RECTANGLE,{dirtyRect:{x:F,y:k,width:S,height:Q}}));var U=m(i.getMin(),2),N=U[0],T=U[1],I=m(i.getMax(),2),L=I[0],P=I[1];a.root.ownerDocument.elementsFromBBox(N,T,L,P).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,_w(r,jw)[jw],n)}),t.restore(),r.renderQueue.forEach(function(t){r.saveDirtyAABB(t)}),r.renderQueue=[]}_w(r,jw)[jw].restoreStack.forEach(function(){t.restore()}),_w(r,jw)[jw].restoreStack=[]}else r.clearFullScreenLastFrame=!0}),s.hooks.render.tap(t.tag,function(t){r.clearFullScreen||r.renderQueue.push(t)})}},{key:"clearRect",value:function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))}},{key:"renderDisplayObjectOptimized",value:function(t,e,n,r,i){var o=t.nodeName,A=!1,s=this.context.styleRendererFactory[o],a=this.pathGeneratorFactory[o],c=t.parsedStyle.clipPath;if(c){(!r.prevObject||!it(c.getWorldTransform(),r.prevObject.getWorldTransform()))&&(this.applyWorldTransform(e,c),r.prevObject=null);var l=this.pathGeneratorFactory[c.nodeName];l&&(e.save(),A=!0,e.beginPath(),l(e,c.parsedStyle),e.closePath(),e.clip())}if(s){(!r.prevObject||!it(t.getWorldTransform(),r.prevObject.getWorldTransform()))&&this.applyWorldTransform(e,t);var u=!r.prevObject;if(!u){var h=r.prevObject.nodeName;u=o===cr.TEXT?h!==cr.TEXT:o===cr.IMAGE?h!==cr.IMAGE:h===cr.TEXT||h===cr.IMAGE}s.applyStyleToContext(e,t,u,r),r.prevObject=t}a&&(e.beginPath(),a(e,t.parsedStyle),o!==cr.LINE&&o!==cr.PATH&&o!==cr.POLYLINE&&e.closePath()),s&&s.drawToContext(e,t,_w(this,jw)[jw],this,i),A&&e.restore(),t.dirty(!1)}},{key:"renderDisplayObject",value:function(t,e,n,r,i){var o=t.nodeName,A=r.restoreStack[r.restoreStack.length-1];!A||t.compareDocumentPosition(Line truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/const nC=Symbol("Comlink.proxy"),rC=Symbol("Comlink.endpoint"),iC=Symbol("Comlink.releaseProxy"),oC=Symbol("Comlink.finalizer"),AC=Symbol("Comlink.thrown"),sC=t=>"object"==typeof t&&null!==t||"function"==typeof t,aC=new Map([["proxy",{canHandle:t=>sC(t)&&t[nC],serialize(t){const{port1:e,port2:n}=new MessageChannel;return cC(t,e),[n,[n]]},deserialize:t=>(t.start(),uC(t))}],["throw",{canHandle:t=>sC(t)&&AC 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 cC(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),a=(i.data.argumentList||[]).map(wC);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]]=wC(i.data.value),c=!0;break;case"APPLY":c=n.apply(e,a);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[nC]:!0})}(new n(...a));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;cC(t,n),c=function(t,e){return mC.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(t){c={value:t,[AC]:0}}Promise.resolve(c).catch(t=>({value:t,[AC]:0})).then(n=>{const[i,s]=yC(n);e.postMessage(Object.assign(Object.assign({},i),{id:o}),s),"RELEASE"===A&&(e.removeEventListener("message",r),lC(e),oC in t&&"function"==typeof t[oC]&&t[oC]())}).catch(t=>{const[n,r]=yC({value:new TypeError("Unserializable return value"),[AC]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)})}),e.start&&e.start()}function lC(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function uC(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)}}),pC(t,n,[],e)}function hC(t){if(t)throw new Error("Proxy has been released and is not useable")}function dC(t){return bC(t,new Map,{type:"RELEASE"}).then(()=>{lC(t)})}const fC=new WeakMap,gC="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{const e=(fC.get(t)||0)-1;fC.set(t,e),0===e&&dC(t)});function pC(t,e,n=[],r=function(){}){let i=!1;const o=new Proxy(r,{get(r,A){if(hC(i),A===iC)return()=>{!function(t){gC&&gC.unregister(t)}(o),dC(t),e.clear(),i=!0};if("then"===A){if(0===n.length)return{then:()=>o};const r=bC(t,e,{type:"GET",path:n.map(t=>t.toString())}).then(wC);return r.then.bind(r)}return pC(t,e,[...n,A])},set(r,o,A){hC(i);const[s,a]=yC(A);return bC(t,e,{type:"SET",path:[...n,o].map(t=>t.toString()),value:s},a).then(wC)},apply(r,o,A){hC(i);const s=n[n.length-1];if(s===rC)return bC(t,e,{type:"ENDPOINT"}).then(wC);if("bind"===s)return pC(t,e,n.slice(0,-1));const[a,c]=vC(A);return bC(t,e,{type:"APPLY",path:n.map(t=>t.toString()),argumentList:a},c).then(wC)},construct(r,o){hC(i);const[A,s]=vC(o);return bC(t,e,{type:"CONSTRUCT",path:n.map(t=>t.toString()),argumentList:A},s).then(wC)}});return function(t,e){const n=(fC.get(e)||0)+1;fC.set(e,n),gC&&gC.register(t,e,t)}(o,t),o}function vC(t){const e=t.map(yC);return[e.map(t=>t[0]),(n=e.map(t=>t[1]),Array.prototype.concat.apply([],n))];var n}const mC=new WeakMap;function yC(t){for(const[e,n]of aC)if(n.canHandle(t)){const[r,i]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},i]}return[{type:"RAW",value:t},mC.get(t)||[]]}function wC(t){switch(t.type){case"HANDLER":return aC.get(t.name).deserialize(t.value);case"RAW":return t.value}}function bC(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 BC{constructor(){this.worker=null,this.workerApi=null}execute(t,e,n){return mx(this,0,void 0,function*(){if(this.worker||(yield this.initWorker()),!this.workerApi)throw new Error("Worker API not initialized");return yield this.workerApi.execute(t,e,n)})}destroy(){this.workerApi&&this.workerApi.destroy(),this.worker&&(this.worker.terminate(),this.worker=null,this.workerApi=null)}initWorker(){return mx(this,0,void 0,function*(){const t=this.resolveWorkerPath(),e=t.includes("/lib/")||t.endsWith(".mjs")?"module":"classic";this.worker=new Worker(t,{type:e}),this.workerApi=uC(this.worker)})}resolveWorkerPath(){const t=(()=>{if("undefined"==typeof document)return null;const t=document.currentScript;if(null==t?void 0:t.src)return t.src;const e=document.getElementsByTagName("script");for(let t=e.length-1;t>=0;t--){const n=e[t].src;if(n&&(n.includes("index.js")||n.includes("index.min.js")))return n}return null})();if(t){if(t.includesLine truncated
|
||||
/*!
|
||||
* @antv/g-plugin-dragndrop
|
||||
* @description A G plugin for Drag n Drop implemented with PointerEvents
|
||||
* @version 2.1.1
|
||||
* @date 12/24/2025, 11:56:44 AM
|
||||
* @author AntVis
|
||||
* @docs https://g.antv.antgroup.com/
|
||||
*/var DZ=function(){function t(e){A(this,t),this.dragndropPluginOptions=e}return a(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,a=t.timeStamp,c=[t.clientX,t.clientY],l=null,u=[t.clientX,t.clientY],h=function(){var t=Ar(ir().mark(function t(o){var h,d,f,g,p,v;return ir().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(s){t.next=2;break}if(h=o.timeStamp-a,d=gn([o.clientX,o.clientY],c),!(h<=n.dragndropPluginOptions.dragstartTimeThreshold||d<=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-u[0],o.dy=o.clientY-u[1],A.dispatchEvent(o),u=[o.clientX,o.clientY],r){t.next=4;break}return f="pointer"===n.dragndropPluginOptions.overlap?[o.canvasX,o.canvasY]:e.getBounds().center,t.next=3,i.elementsFromPoint(f[0],f[1]);case 3:g=t.sent,p=g[g.indexOf(e)+1],v=(null==p?void 0:p.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?i:null),l!==v&&(l&&(o.type="dragleave",o.target=l,l.dispatchEvent(o)),v&&(o.type="dragenter",o.target=v,v.dispatchEvent(o)),(l=v)&&(o.type="dragover",o.target=l,l.dispatchEvent(o)));case 4:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}();o.addEventListener("pointermove",h);var d=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();l&&(e.type="drop",e.target=l,l.dispatchEvent(e)),e.type="dragend",A.dispatchEvent(e),s=!1}o.removeEventListener("pointermove",h)};e.addEventListener("pointerup",d,{once:!0}),e.addEventListener("pointerupoutside",d,{once:!0})}};r.hooks.init.tap(t.tag,function(){o.addEventListener("pointerdown",A)}),r.hooks.destroy.tap(t.tag,function(){o.removeEventListener("pointerdown",A)})}}])}();DZ.tag="Dragndrop";var RZ=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return A(this,e),(t=g(this,e)).name="dragndrop",t.options=n,t}return v(e,t),a(e,[{key:"init",value:function(){this.addRenderingPlugin(new DZ(o({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)}}])}(ur);const HZ=["main"],_Z=["background","main","label","transient"];class GZ{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=Pe(e,["renderer","background","cursor","enableMultiLayer"]),s=o?_Z:HZ,a=KZ(n,s),c=Object.fromEntries(s.map(t=>[t,new xc(Object.assign(Object.assign({},A),{supportsMutipleCanvasesInOneContainer:o,renderer:a[t],background:o?"background"===t?r:void 0:r}))]));jZ(c),this.extends={config:this.config,renderer:n,renderers:a,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 xm(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.childNodes.length)>0).map(t=>t.getBounds()))}getContainer(){const t=this.extends.config.container;return"string"==typeof t?document.getElementById(t):t}getSize(){return[this.extends.config.width||0,this.extends.config.height||0]}appendChild(t,e){var n;const r=(null===(n=t.style)||void 0===n?void 0:n.$layer)||"main";return this.getLayer(r).appendChild(t,e)}setRenderer(t){if(t===this.extends.renderer)return;const e=KZ(t,this.config.enableMultiLayer?_Z:HZ);this.extends.renderers=e,Object.entries(e).forEach(([t,e])=>this.getLayer(t).setRenderer(e)),jZ(this.getLayers())}getCanvasByViewport(t){return Sy(this.getLayer().viewport2Canvas(Qy(t)))}getViewportByCanvas(t){return Sy(this.getLayer().canvas2Viewport(Qy(t)))}getViewportByClient(t){return Sy(this.getLayer().client2Viewport(Qy(t)))}getClientByViewport(t){return Sy(this.getLayer().viewport2Client(Qy(t)))}getClientByCanvas(t){return this.getClieLine truncated
|
||||
Reference in new issue
Block a user