Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antv/g-plugin-canvas-picker

Package Overview
Dependencies
Maintainers
64
Versions
245
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/g-plugin-canvas-picker - npm Package Compare versions

Comparing version 1.10.24-next.18 to 1.10.24-next.19

14

dist/index.esm.js

@@ -123,3 +123,3 @@ import { __awaiter, __generator, __values, __read, __assign, __extends, __spreadArray } from 'tslib';

function isPointInPath$7(displayObject, position, isClipPath) {
var _a = displayObject.parsedStyle, _b = _a.cx, cx = _b === void 0 ? 0 : _b, _c = _a.cy, cy = _c === void 0 ? 0 : _c, r = _a.r, fill = _a.fill, stroke = _a.stroke, _d = _a.lineWidth, lineWidth = _d === void 0 ? 0 : _d, _e = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _e === void 0 ? 0 : _e, _f = _a.pointerEvents, pointerEvents = _f === void 0 ? 'auto' : _f;
var _a = displayObject.parsedStyle, _b = _a.cx, cx = _b === void 0 ? 0 : _b, _c = _a.cy, cy = _c === void 0 ? 0 : _c, r = _a.r, fill = _a.fill, stroke = _a.stroke, _d = _a.lineWidth, lineWidth = _d === void 0 ? 1 : _d, _e = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _e === void 0 ? 0 : _e, _f = _a.pointerEvents, pointerEvents = _f === void 0 ? 'auto' : _f;
var halfLineWidth = (lineWidth + increasedLineWidthForHitTesting) / 2;

@@ -144,3 +144,3 @@ var absDistance = distance(cx, cy, position.x, position.y);

function isPointInPath$6(displayObject, position, isClipPath) {
var _a = displayObject.parsedStyle, _b = _a.cx, cx = _b === void 0 ? 0 : _b, _c = _a.cy, cy = _c === void 0 ? 0 : _c, rx = _a.rx, ry = _a.ry, fill = _a.fill, stroke = _a.stroke, _d = _a.lineWidth, lineWidth = _d === void 0 ? 0 : _d, _e = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _e === void 0 ? 0 : _e, _f = _a.pointerEvents, pointerEvents = _f === void 0 ? 'auto' : _f;
var _a = displayObject.parsedStyle, _b = _a.cx, cx = _b === void 0 ? 0 : _b, _c = _a.cy, cy = _c === void 0 ? 0 : _c, rx = _a.rx, ry = _a.ry, fill = _a.fill, stroke = _a.stroke, _d = _a.lineWidth, lineWidth = _d === void 0 ? 1 : _d, _e = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _e === void 0 ? 0 : _e, _f = _a.pointerEvents, pointerEvents = _f === void 0 ? 'auto' : _f;
var x = position.x, y = position.y;

@@ -288,3 +288,3 @@ var _g = __read(isFillOrStrokeAffected(pointerEvents, fill, stroke), 2), hasFill = _g[0], hasStroke = _g[1];

function isPointInPath$5(displayObject, position, isClipPath) {
var _a = displayObject.parsedStyle, x1 = _a.x1, y1 = _a.y1, x2 = _a.x2, y2 = _a.y2, _b = _a.lineWidth, lineWidth = _b === void 0 ? 0 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d, fill = _a.fill, stroke = _a.stroke;
var _a = displayObject.parsedStyle, x1 = _a.x1, y1 = _a.y1, x2 = _a.x2, y2 = _a.y2, _b = _a.lineWidth, lineWidth = _b === void 0 ? 1 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d, fill = _a.fill, stroke = _a.stroke;
var _e = __read(isFillOrStrokeAffected(pointerEvents, fill, stroke), 2), hasStroke = _e[1];

@@ -357,3 +357,3 @@ if ((!hasStroke && !isClipPath) || !lineWidth) {

function isPointInPath$4(displayObject, position, isClipPath, isPointInPath, renderingPluginContext, runtime) {
var _a = displayObject.parsedStyle, _b = _a.lineWidth, lineWidth = _b === void 0 ? 0 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, stroke = _a.stroke, fill = _a.fill, d = _a.d, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d;
var _a = displayObject.parsedStyle, _b = _a.lineWidth, lineWidth = _b === void 0 ? 1 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, stroke = _a.stroke, fill = _a.fill, d = _a.d, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d;
var segments = d.segments, hasArc = d.hasArc, polylines = d.polylines, polygons = d.polygons;

@@ -385,3 +385,3 @@ var _e = __read(isFillOrStrokeAffected(pointerEvents,

function isPointInPath$3(displayObject, position, isClipPath) {
var _a = displayObject.parsedStyle, stroke = _a.stroke, fill = _a.fill, _b = _a.lineWidth, lineWidth = _b === void 0 ? 0 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, points = _a.points, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d;
var _a = displayObject.parsedStyle, stroke = _a.stroke, fill = _a.fill, _b = _a.lineWidth, lineWidth = _b === void 0 ? 1 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, points = _a.points, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d;
var _e = __read(isFillOrStrokeAffected(pointerEvents, fill, stroke), 2), hasFill = _e[0], hasStroke = _e[1];

@@ -399,3 +399,3 @@ var isHit = false;

function isPointInPath$2(displayObject, position, isClipPath) {
var _a = displayObject.parsedStyle, _b = _a.lineWidth, lineWidth = _b === void 0 ? 0 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, points = _a.points, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d, fill = _a.fill, stroke = _a.stroke;
var _a = displayObject.parsedStyle, _b = _a.lineWidth, lineWidth = _b === void 0 ? 1 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, points = _a.points, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d, fill = _a.fill, stroke = _a.stroke;
var _e = __read(isFillOrStrokeAffected(pointerEvents, fill, stroke), 2), hasStroke = _e[1];

@@ -409,3 +409,3 @@ if ((!hasStroke && !isClipPath) || !lineWidth) {

function isPointInPath$1(displayObject, position, isClipPath, isPointInPath, runtime) {
var _a = displayObject.parsedStyle, radius = _a.radius, fill = _a.fill, stroke = _a.stroke, _b = _a.lineWidth, lineWidth = _b === void 0 ? 0 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, _d = _a.x, x = _d === void 0 ? 0 : _d, _e = _a.y, y = _e === void 0 ? 0 : _e, width = _a.width, height = _a.height, _f = _a.pointerEvents, pointerEvents = _f === void 0 ? 'auto' : _f;
var _a = displayObject.parsedStyle, radius = _a.radius, fill = _a.fill, stroke = _a.stroke, _b = _a.lineWidth, lineWidth = _b === void 0 ? 1 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, _d = _a.x, x = _d === void 0 ? 0 : _d, _e = _a.y, y = _e === void 0 ? 0 : _e, width = _a.width, height = _a.height, _f = _a.pointerEvents, pointerEvents = _f === void 0 ? 'auto' : _f;
var _g = __read(isFillOrStrokeAffected(pointerEvents, fill, stroke), 2), hasFill = _g[0], hasStroke = _g[1];

@@ -412,0 +412,0 @@ var hasRadius = radius && radius.some(function (r) { return r !== 0; });

@@ -125,3 +125,3 @@ 'use strict';

function isPointInPath$7(displayObject, position, isClipPath) {
var _a = displayObject.parsedStyle, _b = _a.cx, cx = _b === void 0 ? 0 : _b, _c = _a.cy, cy = _c === void 0 ? 0 : _c, r = _a.r, fill = _a.fill, stroke = _a.stroke, _d = _a.lineWidth, lineWidth = _d === void 0 ? 0 : _d, _e = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _e === void 0 ? 0 : _e, _f = _a.pointerEvents, pointerEvents = _f === void 0 ? 'auto' : _f;
var _a = displayObject.parsedStyle, _b = _a.cx, cx = _b === void 0 ? 0 : _b, _c = _a.cy, cy = _c === void 0 ? 0 : _c, r = _a.r, fill = _a.fill, stroke = _a.stroke, _d = _a.lineWidth, lineWidth = _d === void 0 ? 1 : _d, _e = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _e === void 0 ? 0 : _e, _f = _a.pointerEvents, pointerEvents = _f === void 0 ? 'auto' : _f;
var halfLineWidth = (lineWidth + increasedLineWidthForHitTesting) / 2;

@@ -146,3 +146,3 @@ var absDistance = gMath.distance(cx, cy, position.x, position.y);

function isPointInPath$6(displayObject, position, isClipPath) {
var _a = displayObject.parsedStyle, _b = _a.cx, cx = _b === void 0 ? 0 : _b, _c = _a.cy, cy = _c === void 0 ? 0 : _c, rx = _a.rx, ry = _a.ry, fill = _a.fill, stroke = _a.stroke, _d = _a.lineWidth, lineWidth = _d === void 0 ? 0 : _d, _e = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _e === void 0 ? 0 : _e, _f = _a.pointerEvents, pointerEvents = _f === void 0 ? 'auto' : _f;
var _a = displayObject.parsedStyle, _b = _a.cx, cx = _b === void 0 ? 0 : _b, _c = _a.cy, cy = _c === void 0 ? 0 : _c, rx = _a.rx, ry = _a.ry, fill = _a.fill, stroke = _a.stroke, _d = _a.lineWidth, lineWidth = _d === void 0 ? 1 : _d, _e = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _e === void 0 ? 0 : _e, _f = _a.pointerEvents, pointerEvents = _f === void 0 ? 'auto' : _f;
var x = position.x, y = position.y;

@@ -290,3 +290,3 @@ var _g = tslib.__read(gLite.isFillOrStrokeAffected(pointerEvents, fill, stroke), 2), hasFill = _g[0], hasStroke = _g[1];

function isPointInPath$5(displayObject, position, isClipPath) {
var _a = displayObject.parsedStyle, x1 = _a.x1, y1 = _a.y1, x2 = _a.x2, y2 = _a.y2, _b = _a.lineWidth, lineWidth = _b === void 0 ? 0 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d, fill = _a.fill, stroke = _a.stroke;
var _a = displayObject.parsedStyle, x1 = _a.x1, y1 = _a.y1, x2 = _a.x2, y2 = _a.y2, _b = _a.lineWidth, lineWidth = _b === void 0 ? 1 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d, fill = _a.fill, stroke = _a.stroke;
var _e = tslib.__read(gLite.isFillOrStrokeAffected(pointerEvents, fill, stroke), 2), hasStroke = _e[1];

@@ -359,3 +359,3 @@ if ((!hasStroke && !isClipPath) || !lineWidth) {

function isPointInPath$4(displayObject, position, isClipPath, isPointInPath, renderingPluginContext, runtime) {
var _a = displayObject.parsedStyle, _b = _a.lineWidth, lineWidth = _b === void 0 ? 0 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, stroke = _a.stroke, fill = _a.fill, d = _a.d, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d;
var _a = displayObject.parsedStyle, _b = _a.lineWidth, lineWidth = _b === void 0 ? 1 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, stroke = _a.stroke, fill = _a.fill, d = _a.d, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d;
var segments = d.segments, hasArc = d.hasArc, polylines = d.polylines, polygons = d.polygons;

@@ -387,3 +387,3 @@ var _e = tslib.__read(gLite.isFillOrStrokeAffected(pointerEvents,

function isPointInPath$3(displayObject, position, isClipPath) {
var _a = displayObject.parsedStyle, stroke = _a.stroke, fill = _a.fill, _b = _a.lineWidth, lineWidth = _b === void 0 ? 0 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, points = _a.points, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d;
var _a = displayObject.parsedStyle, stroke = _a.stroke, fill = _a.fill, _b = _a.lineWidth, lineWidth = _b === void 0 ? 1 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, points = _a.points, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d;
var _e = tslib.__read(gLite.isFillOrStrokeAffected(pointerEvents, fill, stroke), 2), hasFill = _e[0], hasStroke = _e[1];

@@ -401,3 +401,3 @@ var isHit = false;

function isPointInPath$2(displayObject, position, isClipPath) {
var _a = displayObject.parsedStyle, _b = _a.lineWidth, lineWidth = _b === void 0 ? 0 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, points = _a.points, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d, fill = _a.fill, stroke = _a.stroke;
var _a = displayObject.parsedStyle, _b = _a.lineWidth, lineWidth = _b === void 0 ? 1 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, points = _a.points, _d = _a.pointerEvents, pointerEvents = _d === void 0 ? 'auto' : _d, fill = _a.fill, stroke = _a.stroke;
var _e = tslib.__read(gLite.isFillOrStrokeAffected(pointerEvents, fill, stroke), 2), hasStroke = _e[1];

@@ -411,3 +411,3 @@ if ((!hasStroke && !isClipPath) || !lineWidth) {

function isPointInPath$1(displayObject, position, isClipPath, isPointInPath, runtime) {
var _a = displayObject.parsedStyle, radius = _a.radius, fill = _a.fill, stroke = _a.stroke, _b = _a.lineWidth, lineWidth = _b === void 0 ? 0 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, _d = _a.x, x = _d === void 0 ? 0 : _d, _e = _a.y, y = _e === void 0 ? 0 : _e, width = _a.width, height = _a.height, _f = _a.pointerEvents, pointerEvents = _f === void 0 ? 'auto' : _f;
var _a = displayObject.parsedStyle, radius = _a.radius, fill = _a.fill, stroke = _a.stroke, _b = _a.lineWidth, lineWidth = _b === void 0 ? 1 : _b, _c = _a.increasedLineWidthForHitTesting, increasedLineWidthForHitTesting = _c === void 0 ? 0 : _c, _d = _a.x, x = _d === void 0 ? 0 : _d, _e = _a.y, y = _e === void 0 ? 0 : _e, width = _a.width, height = _a.height, _f = _a.pointerEvents, pointerEvents = _f === void 0 ? 'auto' : _f;
var _g = tslib.__read(gLite.isFillOrStrokeAffected(pointerEvents, fill, stroke), 2), hasFill = _g[0], hasStroke = _g[1];

@@ -414,0 +414,0 @@ var hasRadius = radius && radius.some(function (r) { return r !== 0; });

@@ -1,2 +0,2 @@

!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],r):r(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.CanvasPicker={}),t.window.G)}(this,(function(t,r){"use strict";var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},n(t,r)};var e=function(){return e=Object.assign||function(t){for(var r,n=1,e=arguments.length;e>n;n++)for(var i in r=arguments[n])Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);return t},e.apply(this,arguments)};function i(t,r,n,e){return new(n||(n=Promise))((function(i,o){function a(t){try{c(e.next(t))}catch(t){o(t)}}function u(t){try{c(e.throw(t))}catch(t){o(t)}}function c(t){var r;t.done?i(t.value):(r=t.value,r instanceof n?r:new n((function(t){t(r)}))).then(a,u)}c((e=e.apply(t,r||[])).next())}))}function o(t,r){var n,e,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,e&&(i=2&u[0]?e.return:u[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,u[1])).done)return i;switch(e=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,e=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&i[3]>u[1])){a.label=u[1];break}if(6===u[0]&&i[1]>a.label){a.label=i[1],i=u;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=r.call(t,a)}catch(t){u=[6,t],e=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function a(t,r){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,i,o=n.call(t),a=[];try{for(;(void 0===r||r-- >0)&&!(e=o.next()).done;)a.push(e.value)}catch(t){i={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function u(t,r,n){if(n||2===arguments.length)for(var e,i=0,o=r.length;o>i;i++)!e&&i in r||(e||(e=Array.prototype.slice.call(r,0,i)),e[i]=r[i]);return t.concat(e||Array.prototype.slice.call(r))}var c="undefined"!=typeof Float32Array?Float32Array:Array;function f(){var t=new c(3);return c!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function l(t,r,n,e){return t[0]=r,t[1]=n,t[2]=e,t}Math.hypot||(Math.hypot=function(){for(var t=0,r=arguments.length;r--;)t+=arguments[r]*arguments[r];return Math.sqrt(t)}),f(),function(){var t,r=(t=new c(2),c!=Float32Array&&(t[0]=0,t[1]=0),t)}();var s,h=f(),v=f(),p=f(),d=(s=new c(16),c!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=0,s[12]=0,s[13]=0,s[14]=0),s[0]=1,s[5]=1,s[10]=1,s[15]=1,s),y=function(){function t(){var t=this;this.isHit=function(n,e,i,o){var a=t.context.pointInPathPickerFactory[n.nodeName];if(a){var u=function(t,r){var n=r[0],e=r[1],i=r[2],o=r[3],a=r[4],u=r[5],c=r[6],f=r[7],l=r[8],s=r[9],h=r[10],v=r[11],p=r[12],d=r[13],y=r[14],x=r[15],g=n*u-e*a,M=n*c-i*a,P=n*f-o*a,b=e*c-i*u,m=e*f-o*u,S=i*f-o*c,k=l*d-s*p,w=l*y-h*p,F=l*x-v*p,C=s*y-h*d,O=s*x-v*d,A=h*x-v*y,I=g*A-M*O+P*C+b*F-m*w+S*k;return I?(t[0]=(u*A-c*O+f*C)*(I=1/I),t[1]=(i*O-e*A-o*C)*I,t[2]=(d*S-y*m+x*b)*I,t[3]=(h*m-s*S-v*b)*I,t[4]=(c*F-a*A-f*w)*I,t[5]=(n*A-i*F+o*w)*I,t[6]=(y*P-p*S-x*M)*I,t[7]=(l*S-h*P+v*M)*I,t[8]=(a*O-u*F+f*k)*I,t[9]=(e*F-n*O-o*k)*I,t[10]=(p*m-d*P+x*g)*I,t[11]=(s*P-l*m-v*g)*I,t[12]=(u*w-a*C-c*k)*I,t[13]=(n*C-e*w+i*k)*I,t[14]=(d*M-p*b-y*g)*I,t[15]=(l*b-s*M+h*g)*I,t):null}(d,i),c=function(t,r,n){var e=r[0],i=r[1],o=r[2],a=n[3]*e+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*e+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*e+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*e+n[6]*i+n[10]*o+n[14])/a,t}(v,l(p,e[0],e[1],0),u);if(a(n,new r.Point(c[0],c[1]),o,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(r,n){var e=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),i=t.context.pathGeneratorFactory[r.nodeName];return i&&(e.beginPath(),i(e,r.parsedStyle),e.closePath()),e.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(r,n){var e,a=this,u=r.renderingService,c=r.renderingContext;this.context=r,this.runtime=n;var f=null===(e=c.root)||void 0===e?void 0:e.ownerDocument;u.hooks.pick.tapPromise(t.tag,(function(t){return i(a,void 0,void 0,(function(){return o(this,(function(r){return[2,this.pick(f,t)]}))}))})),u.hooks.pickSync.tap(t.tag,(function(t){return a.pick(f,t)}))},t.prototype.pick=function(t,n){var e,i,o=n.topmost,a=n.position,u=l(h,a.x,a.y,0),c=t.elementsFromBBox(u[0],u[1],u[0],u[1]),f=[];try{for(var s=function(t){var r="function"==typeof Symbol&&Symbol.iterator,n=r&&t[r],e=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),v=s.next();!v.done;v=s.next()){var p=v.value,d=p.getWorldTransform();if(this.isHit(p,u,d,!1)){var y=r.findClosestClipPathTarget(p);if(y){var x=y.parsedStyle.clipPath;if(this.isHit(x,u,x.getWorldTransform(),!0)){if(o)return n.picked=[p],n;f.push(p)}}else{if(o)return n.picked=[p],n;f.push(p)}}}}catch(t){e={error:t}}finally{try{v&&!v.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}return n.picked=f,n},t.tag="CanvasPicker",t}(),x=function(t,r,n){return r>t?r:t>n?n:t};function g(t,r,n){return{x:t*Math.cos(n)-r*Math.sin(n),y:t*Math.sin(n)+r*Math.cos(n)}}function M(t,r,n,e,i,o,a,u,c,f){var l,s,h,v,p,d=t,y=r,x=n,P=e,b=u,m=c,S=120*Math.PI/180,k=Math.PI/180*(+i||0),w=[];if(f)s=f[0],h=f[1],v=f[2],p=f[3];else{y=(l=g(d,y,-k)).y;var F=((d=l.x)-(b=(l=g(b,m,-k)).x))/2,C=(y-(m=l.y))/2,O=F*F/(x*x)+C*C/(P*P);O>1&&(x*=O=Math.sqrt(O),P*=O);var A=x*x,I=P*P,E=(o===a?-1:1)*Math.sqrt(Math.abs((A*I-A*C*C-I*F*F)/(A*C*C+I*F*F)));v=E*x*C/P+(d+b)/2,s=Math.asin(((y-(p=E*-P*F/x+(y+m)/2))/P*1e9>>0)/1e9),h=Math.asin(((m-p)/P*1e9>>0)/1e9),0>(s=v>d?Math.PI-s:s)&&(s=2*Math.PI+s),0>(h=v>b?Math.PI-h:h)&&(h=2*Math.PI+h),a&&s>h&&(s-=2*Math.PI),!a&&h>s&&(h-=2*Math.PI)}var T=h-s;if(Math.abs(T)>S){var L=h,W=b,H=m;w=M(b=v+x*Math.cos(h=s+S*(a&&h>s?1:-1)),m=p+P*Math.sin(h),x,P,i,0,a,W,H,[h,L,v,p])}T=h-s;var G=Math.cos(s),q=Math.sin(s),R=Math.cos(h),_=Math.sin(h),j=Math.tan(T/4),N=4/3*x*j,B=4/3*P*j,D=[d,y],Y=[d+N*q,y-B*G],Q=[b+N*_,m-B*R],U=[b,m];if(Y[0]=2*D[0]-Y[0],Y[1]=2*D[1]-Y[1],f)return Y.concat(Q,U,w);for(var X=[],Z=0,z=(w=Y.concat(Q,U,w)).length;z>Z;Z+=1)X[Z]=Z%2?g(w[Z-1],w[Z],k).y:g(w[Z],w[Z+1],k).x;return X}function P(t,r,n,e){var i=t-n,o=r-e;return Math.sqrt(i*i+o*o)}var b=1e-4;function m(t,r,n,e,i,o){var c=-1,f=1/0,l=[n,e],s=20;o&&o>200&&(s=o/10);for(var h=1/s,v=h/10,p=0;s>=p;p++){var d=p*h,y=[i.apply(void 0,u([],a(t.concat([d])),!1)),i.apply(void 0,u([],a(r.concat([d])),!1))];f>(m=P(l[0],l[1],y[0],y[1]))&&(c=d,f=m)}if(0===c)return{x:t[0],y:r[0]};if(1===c){var x=t.length;return{x:t[x-1],y:r[x-1]}}f=1/0;for(p=0;32>p&&b<=v;p++){var g=c-v,M=c+v,m=(y=[i.apply(void 0,u([],a(t.concat([g])),!1)),i.apply(void 0,u([],a(r.concat([g])),!1))],P(l[0],l[1],y[0],y[1]));if(g>=0&&f>m)c=g,f=m;else{var S=[i.apply(void 0,u([],a(t.concat([M])),!1)),i.apply(void 0,u([],a(r.concat([M])),!1))],k=P(l[0],l[1],S[0],S[1]);1>=M&&f>k?(c=M,f=k):v*=.5}}return{x:i.apply(void 0,u([],a(t.concat([c])),!1)),y:i.apply(void 0,u([],a(r.concat([c])),!1))}}function S(t,r,n,e,i,o){var a=[n-t,e-r];if(function(t,r){return t[0]===r[0]&&t[1]===r[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-r)*(o-r));var u=[-a[1],a[0]];return function(t,r){var n=r[0],e=r[1],i=n*n+e*e;i>0&&(i=1/Math.sqrt(i)),t[0]=r[0]*i,t[1]=r[1]*i}(u,u),Math.abs(function(t,r){return t[0]*r[0]+t[1]*r[1]}([i-t,o-r],u))}function k(t,r,n,e,i){var o=1-i;return o*o*o*t+3*r*i*o*o+3*n*i*i*o+e*i*i*i}function w(t,r,n,e,i,o,a,u,c,f,l){var s=function(t,r,n,e,i,o,a,u,c,f,l){return m([t,n,i,a],[r,e,o,u],c,f,k,l)}(t,r,n,e,i,o,a,u,c,f,l);return P(s.x,s.y,c,f)}function F(t,r,n,e){var i=1-e;return i*i*t+2*e*i*r+e*e*n}function C(t,r,n,e,i,o,a,u){var c=function(t,r,n,e,i,o,a,u){return m([t,n,i],[r,e,o],a,u,F)}(t,r,n,e,i,o,a,u);return P(c.x,c.y,a,u)}function O(t,n,e){var i=t.parsedStyle,o=i.cx,u=i.cy,c=i.r,f=i.fill,l=i.stroke,s=i.lineWidth,h=i.increasedLineWidthForHitTesting,v=i.pointerEvents,p=void 0===v?"auto":v,d=((void 0===s?0:s)+(void 0===h?0:h))/2,y=P(void 0===o?0:o,void 0===u?0:u,n.x,n.y),x=a(r.isFillOrStrokeAffected(p,f,l),2),g=x[0],M=x[1];return g&&M||e?c+d>=y:g?c>=y:!!M&&(y>=c-d&&c+d>=y)}function A(t,r,n,e){return t/(n*n)+r/(e*e)}function I(t,n,e){var i=t.parsedStyle,o=i.cx,u=void 0===o?0:o,c=i.cy,f=void 0===c?0:c,l=i.rx,s=i.ry,h=i.lineWidth,v=void 0===h?0:h,p=i.increasedLineWidthForHitTesting,d=void 0===p?0:p,y=i.pointerEvents,x=n.x,g=n.y,M=a(r.isFillOrStrokeAffected(void 0===y?"auto":y,i.fill,i.stroke),2),P=M[0],b=M[1],m=(v+d)/2,S=(x-u)*(x-u),k=(g-f)*(g-f);return P&&b||e?1>=A(S,k,l+m,s+m):P?1>=A(S,k,l,s):!!b&&(A(S,k,l-m,s-m)>=1&&1>=A(S,k,l+m,s+m))}function E(t,r,n,e,i,o){return!(t>i||i>t+n||r>o||o>r+e)}function T(t,r,n,e,i,o,a,u){var c=(Math.atan2(u-r,a-t)+2*Math.PI)%(2*Math.PI),f={x:t+n*Math.cos(c),y:r+n*Math.sin(c)};return P(f.x,f.y,a,u)<=o/2}function L(t,r,n,e,i,o,a){var u=i/2;return!(Math.min(t,n)-u>o||o>Math.max(t,n)+u||Math.min(r,e)-u>a||a>Math.max(r,e)+u)&&S(t,r,n,e,o,a)<=i/2}function W(t,r,n,e,i){var o=t.length;if(2>o)return!1;for(var a=0;o-1>a;a++){if(L(t[a][0],t[a][1],t[a+1][0],t[a+1][1],r,n,e))return!0}if(i){var u=t[0],c=t[o-1];if(L(u[0],u[1],c[0],c[1],r,n,e))return!0}return!1}var H=1e-6;function G(t){return H>Math.abs(t)?0:0>t?-1:1}function q(t,r,n){return!((n[0]-t[0])*(r[1]-t[1])!=(r[0]-t[0])*(n[1]-t[1])||Math.min(t[0],r[0])>n[0]||n[0]>Math.max(t[0],r[0])||Math.min(t[1],r[1])>n[1]||n[1]>Math.max(t[1],r[1]))}function R(t,r,n){var e=!1,i=t.length;if(2>=i)return!1;for(var o=0;i>o;o++){var a=t[o],u=t[(o+1)%i];if(q(a,u,[r,n]))return!0;G(a[1]-n)>0!=G(u[1]-n)>0&&0>G(r-(n-a[1])*(a[0]-u[0])/(a[1]-u[1])-a[0])&&(e=!e)}return e}function _(t,r,n){for(var e=!1,i=0;t.length>i;i++){if(e=R(t[i],r,n))break}return e}function j(t,n,e){var i=t.parsedStyle,o=i.x1,u=i.y1,c=i.x2,f=i.y2,l=i.lineWidth,s=void 0===l?0:l,h=i.increasedLineWidthForHitTesting,v=void 0===h?0:h,p=i.pointerEvents;return!(!a(r.isFillOrStrokeAffected(void 0===p?"auto":p,i.fill,i.stroke),2)[1]&&!e||!s)&&L(o,u,c,f,s+v,n.x,n.y)}function N(t,n,e,i,o,u){var c=t.parsedStyle,f=c.lineWidth,l=void 0===f?0:f,s=c.increasedLineWidthForHitTesting,h=void 0===s?0:s,v=c.d,p=c.pointerEvents,d=v.segments,y=v.hasArc,x=v.polylines,g=v.polygons,P=a(r.isFillOrStrokeAffected(void 0===p?"auto":p,(null==g?void 0:g.length)&&c.fill,c.stroke),2),b=P[0],m=P[1],S=r.getOrCalculatePathTotalLength(t),k=!1;return b||e?k=y?i(t,n):_(g,n.x,n.y)||_(x,n.x,n.y):((m||e)&&(k=function(t,r,n,e,i){for(var o=!1,a=r/2,u=0;t.length>u;u++){var c=t[u],f=c.currentPoint,l=c.params,s=c.prePoint,h=c.box;if(!h||E(h.x-a,h.y-a,h.width+r,h.height+r,n,e))switch(c.command){case"L":case"Z":if(o=L(s[0],s[1],f[0],f[1],r,n,e))return!0;break;case"Q":if(o=r/2>=C(s[0],s[1],l[1],l[2],l[3],l[4],n,e))return!0;break;case"C":if(o=r/2>=w(s[0],s[1],l[1],l[2],l[3],l[4],l[5],l[6],n,e,i))return!0;break;case"A":c.cubicParams||(c.cubicParams=M(s[0],s[1],l[1],l[2],l[3],l[4],l[5],l[6],l[7],void 0));for(var v=c.cubicParams,p=s,d=0;v.length>d;d+=6){var y=w(p[0],p[1],v[d],v[d+1],v[d+2],v[d+3],v[d+4],v[d+5],n,e,i);if(p=[v[d+4],v[d+5]],o=r/2>=y)return!0}}}return o}(d,l+h,n.x,n.y,S)),k)}function B(t,n,e){var i=t.parsedStyle,o=i.lineWidth,u=void 0===o?0:o,c=i.increasedLineWidthForHitTesting,f=void 0===c?0:c,l=i.points,s=i.pointerEvents,h=a(r.isFillOrStrokeAffected(void 0===s?"auto":s,i.fill,i.stroke),2),v=h[0],p=!1;return(h[1]||e)&&(p=W(l.points,u+f,n.x,n.y,!0)),p||!v&&!e||(p=R(l.points,n.x,n.y)),p}function D(t,n,e){var i=t.parsedStyle,o=i.lineWidth,u=void 0===o?0:o,c=i.increasedLineWidthForHitTesting,f=void 0===c?0:c,l=i.points,s=i.pointerEvents;return!(!a(r.isFillOrStrokeAffected(void 0===s?"auto":s,i.fill,i.stroke),2)[1]&&!e||!u)&&W(l.points,u+f,n.x,n.y,!1)}function Y(t,n,e,i,o){var u=t.parsedStyle,c=u.radius,f=u.lineWidth,l=void 0===f?0:f,s=u.increasedLineWidthForHitTesting,h=void 0===s?0:s,v=u.x,p=void 0===v?0:v,d=u.y,y=void 0===d?0:d,g=u.width,M=u.height,P=u.pointerEvents,b=a(r.isFillOrStrokeAffected(void 0===P?"auto":P,u.fill,u.stroke),2),m=b[0],S=b[1],k=l+h;if(c&&c.some((function(t){return 0!==t}))){var w=!1;return(S||e)&&(w=function(t,r,n,e,i,o,u,c){var f=a(i,4),l=f[0],s=f[1],h=f[2],v=f[3];return L(t+l,r,t+n-s,r,o,u,c)||L(t+n,r+s,t+n,r+e-h,o,u,c)||L(t+n-h,r+e,t+v,r+e,o,u,c)||L(t,r+e-v,t,r+l,o,u,c)||T(t+n-s,r+s,s,0,0,o,u,c)||T(t+n-h,r+e-h,h,0,0,o,u,c)||T(t+v,r+e-v,v,0,0,o,u,c)||T(t+l,r+l,l,0,0,o,u,c)}(p,y,g,M,c.map((function(t){return x(t,0,Math.min(Math.abs(g)/2,Math.abs(M)/2))})),k,n.x,n.y)),w||!m&&!e||(w=i(t,n)),w}var F=k/2;return m&&S||e?E(p-F,y-F,g+F,M+F,n.x,n.y):m?E(p,y,g,M,n.x,n.y):!!S&&function(t,r,n,e,i,o,a){var u=i/2;return E(t-u,r-u,n,i,o,a)||E(t+n-u,r-u,i,e,o,a)||E(t+u,r+e-u,n,i,o,a)||E(t-u,r+u,i,e,o,a)}(p,y,g,M,k,n.x,n.y)}function Q(t,n,i,o,a,u){var c=t.parsedStyle,f=c.pointerEvents,l=c.x,s=void 0===l?0:l,h=c.y,v=void 0===h?0:h,p=c.width,d=c.height;if("non-transparent-pixel"===(void 0===f?"auto":f)){var y=a.config.offscreenCanvas,x=u.offscreenCanvasCreator.getOrCreateCanvas(y),g=u.offscreenCanvasCreator.getOrCreateContext(y,{willReadFrequently:!0});return x.width=p,x.height=d,a.defaultStyleRendererFactory[r.Shape.IMAGE].render(g,e(e({},t.parsedStyle),{x:0,y:0}),t,void 0,void 0,void 0),g.getImageData(n.x-s,n.y-v,1,1).data.every((function(t){return 0!==t}))}return!0}var U=function(t){function e(){var r=t.apply(this,u([],a(arguments),!1))||this;return r.name="canvas-picker",r}return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+r+" is not a constructor or null");function e(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}(e,t),e.prototype.init=function(){var t,n=((t={})[r.Shape.CIRCLE]=O,t[r.Shape.ELLIPSE]=I,t[r.Shape.RECT]=Y,t[r.Shape.LINE]=j,t[r.Shape.POLYLINE]=D,t[r.Shape.POLYGON]=B,t[r.Shape.PATH]=N,t[r.Shape.TEXT]=function(){return!0},t[r.Shape.GROUP]=null,t[r.Shape.IMAGE]=Q,t[r.Shape.HTML]=null,t[r.Shape.MESH]=null,t);this.context.pointInPathPickerFactory=n,this.addRenderingPlugin(new y)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(r.AbstractRendererPlugin);t.Plugin=U}));
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("@antv/g-lite")):"function"==typeof define&&define.amd?define(["exports","@antv/g-lite"],r):r(((t="undefined"!=typeof globalThis?globalThis:t||self).G=t.G||{},t.G.CanvasPicker={}),t.window.G)}(this,(function(t,r){"use strict";var n=function(t,r){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])},n(t,r)};var e=function(){return e=Object.assign||function(t){for(var r,n=1,e=arguments.length;e>n;n++)for(var i in r=arguments[n])Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i]);return t},e.apply(this,arguments)};function i(t,r,n,e){return new(n||(n=Promise))((function(i,o){function a(t){try{c(e.next(t))}catch(t){o(t)}}function u(t){try{c(e.throw(t))}catch(t){o(t)}}function c(t){var r;t.done?i(t.value):(r=t.value,r instanceof n?r:new n((function(t){t(r)}))).then(a,u)}c((e=e.apply(t,r||[])).next())}))}function o(t,r){var n,e,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,e&&(i=2&u[0]?e.return:u[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,u[1])).done)return i;switch(e=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,e=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&i[3]>u[1])){a.label=u[1];break}if(6===u[0]&&i[1]>a.label){a.label=i[1],i=u;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=r.call(t,a)}catch(t){u=[6,t],e=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function a(t,r){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var e,i,o=n.call(t),a=[];try{for(;(void 0===r||r-- >0)&&!(e=o.next()).done;)a.push(e.value)}catch(t){i={error:t}}finally{try{e&&!e.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function u(t,r,n){if(n||2===arguments.length)for(var e,i=0,o=r.length;o>i;i++)!e&&i in r||(e||(e=Array.prototype.slice.call(r,0,i)),e[i]=r[i]);return t.concat(e||Array.prototype.slice.call(r))}var c="undefined"!=typeof Float32Array?Float32Array:Array;function f(){var t=new c(3);return c!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function l(t,r,n,e){return t[0]=r,t[1]=n,t[2]=e,t}Math.hypot||(Math.hypot=function(){for(var t=0,r=arguments.length;r--;)t+=arguments[r]*arguments[r];return Math.sqrt(t)}),f(),function(){var t,r=(t=new c(2),c!=Float32Array&&(t[0]=0,t[1]=0),t)}();var s,h=f(),v=f(),p=f(),d=(s=new c(16),c!=Float32Array&&(s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[11]=0,s[12]=0,s[13]=0,s[14]=0),s[0]=1,s[5]=1,s[10]=1,s[15]=1,s),y=function(){function t(){var t=this;this.isHit=function(n,e,i,o){var a=t.context.pointInPathPickerFactory[n.nodeName];if(a){var u=function(t,r){var n=r[0],e=r[1],i=r[2],o=r[3],a=r[4],u=r[5],c=r[6],f=r[7],l=r[8],s=r[9],h=r[10],v=r[11],p=r[12],d=r[13],y=r[14],x=r[15],g=n*u-e*a,M=n*c-i*a,P=n*f-o*a,b=e*c-i*u,m=e*f-o*u,S=i*f-o*c,k=l*d-s*p,w=l*y-h*p,F=l*x-v*p,C=s*y-h*d,O=s*x-v*d,A=h*x-v*y,I=g*A-M*O+P*C+b*F-m*w+S*k;return I?(t[0]=(u*A-c*O+f*C)*(I=1/I),t[1]=(i*O-e*A-o*C)*I,t[2]=(d*S-y*m+x*b)*I,t[3]=(h*m-s*S-v*b)*I,t[4]=(c*F-a*A-f*w)*I,t[5]=(n*A-i*F+o*w)*I,t[6]=(y*P-p*S-x*M)*I,t[7]=(l*S-h*P+v*M)*I,t[8]=(a*O-u*F+f*k)*I,t[9]=(e*F-n*O-o*k)*I,t[10]=(p*m-d*P+x*g)*I,t[11]=(s*P-l*m-v*g)*I,t[12]=(u*w-a*C-c*k)*I,t[13]=(n*C-e*w+i*k)*I,t[14]=(d*M-p*b-y*g)*I,t[15]=(l*b-s*M+h*g)*I,t):null}(d,i),c=function(t,r,n){var e=r[0],i=r[1],o=r[2],a=n[3]*e+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*e+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*e+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*e+n[6]*i+n[10]*o+n[14])/a,t}(v,l(p,e[0],e[1],0),u);if(a(n,new r.Point(c[0],c[1]),o,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(r,n){var e=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),i=t.context.pathGeneratorFactory[r.nodeName];return i&&(e.beginPath(),i(e,r.parsedStyle),e.closePath()),e.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(r,n){var e,a=this,u=r.renderingService,c=r.renderingContext;this.context=r,this.runtime=n;var f=null===(e=c.root)||void 0===e?void 0:e.ownerDocument;u.hooks.pick.tapPromise(t.tag,(function(t){return i(a,void 0,void 0,(function(){return o(this,(function(r){return[2,this.pick(f,t)]}))}))})),u.hooks.pickSync.tap(t.tag,(function(t){return a.pick(f,t)}))},t.prototype.pick=function(t,n){var e,i,o=n.topmost,a=n.position,u=l(h,a.x,a.y,0),c=t.elementsFromBBox(u[0],u[1],u[0],u[1]),f=[];try{for(var s=function(t){var r="function"==typeof Symbol&&Symbol.iterator,n=r&&t[r],e=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}(c),v=s.next();!v.done;v=s.next()){var p=v.value,d=p.getWorldTransform();if(this.isHit(p,u,d,!1)){var y=r.findClosestClipPathTarget(p);if(y){var x=y.parsedStyle.clipPath;if(this.isHit(x,u,x.getWorldTransform(),!0)){if(o)return n.picked=[p],n;f.push(p)}}else{if(o)return n.picked=[p],n;f.push(p)}}}}catch(t){e={error:t}}finally{try{v&&!v.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}return n.picked=f,n},t.tag="CanvasPicker",t}(),x=function(t,r,n){return r>t?r:t>n?n:t};function g(t,r,n){return{x:t*Math.cos(n)-r*Math.sin(n),y:t*Math.sin(n)+r*Math.cos(n)}}function M(t,r,n,e,i,o,a,u,c,f){var l,s,h,v,p,d=t,y=r,x=n,P=e,b=u,m=c,S=120*Math.PI/180,k=Math.PI/180*(+i||0),w=[];if(f)s=f[0],h=f[1],v=f[2],p=f[3];else{y=(l=g(d,y,-k)).y;var F=((d=l.x)-(b=(l=g(b,m,-k)).x))/2,C=(y-(m=l.y))/2,O=F*F/(x*x)+C*C/(P*P);O>1&&(x*=O=Math.sqrt(O),P*=O);var A=x*x,I=P*P,E=(o===a?-1:1)*Math.sqrt(Math.abs((A*I-A*C*C-I*F*F)/(A*C*C+I*F*F)));v=E*x*C/P+(d+b)/2,s=Math.asin(((y-(p=E*-P*F/x+(y+m)/2))/P*1e9>>0)/1e9),h=Math.asin(((m-p)/P*1e9>>0)/1e9),0>(s=v>d?Math.PI-s:s)&&(s=2*Math.PI+s),0>(h=v>b?Math.PI-h:h)&&(h=2*Math.PI+h),a&&s>h&&(s-=2*Math.PI),!a&&h>s&&(h-=2*Math.PI)}var T=h-s;if(Math.abs(T)>S){var L=h,W=b,H=m;w=M(b=v+x*Math.cos(h=s+S*(a&&h>s?1:-1)),m=p+P*Math.sin(h),x,P,i,0,a,W,H,[h,L,v,p])}T=h-s;var G=Math.cos(s),q=Math.sin(s),R=Math.cos(h),_=Math.sin(h),j=Math.tan(T/4),N=4/3*x*j,B=4/3*P*j,D=[d,y],Y=[d+N*q,y-B*G],Q=[b+N*_,m-B*R],U=[b,m];if(Y[0]=2*D[0]-Y[0],Y[1]=2*D[1]-Y[1],f)return Y.concat(Q,U,w);for(var X=[],Z=0,z=(w=Y.concat(Q,U,w)).length;z>Z;Z+=1)X[Z]=Z%2?g(w[Z-1],w[Z],k).y:g(w[Z],w[Z+1],k).x;return X}function P(t,r,n,e){var i=t-n,o=r-e;return Math.sqrt(i*i+o*o)}var b=1e-4;function m(t,r,n,e,i,o){var c=-1,f=1/0,l=[n,e],s=20;o&&o>200&&(s=o/10);for(var h=1/s,v=h/10,p=0;s>=p;p++){var d=p*h,y=[i.apply(void 0,u([],a(t.concat([d])),!1)),i.apply(void 0,u([],a(r.concat([d])),!1))];f>(m=P(l[0],l[1],y[0],y[1]))&&(c=d,f=m)}if(0===c)return{x:t[0],y:r[0]};if(1===c){var x=t.length;return{x:t[x-1],y:r[x-1]}}f=1/0;for(p=0;32>p&&b<=v;p++){var g=c-v,M=c+v,m=(y=[i.apply(void 0,u([],a(t.concat([g])),!1)),i.apply(void 0,u([],a(r.concat([g])),!1))],P(l[0],l[1],y[0],y[1]));if(g>=0&&f>m)c=g,f=m;else{var S=[i.apply(void 0,u([],a(t.concat([M])),!1)),i.apply(void 0,u([],a(r.concat([M])),!1))],k=P(l[0],l[1],S[0],S[1]);1>=M&&f>k?(c=M,f=k):v*=.5}}return{x:i.apply(void 0,u([],a(t.concat([c])),!1)),y:i.apply(void 0,u([],a(r.concat([c])),!1))}}function S(t,r,n,e,i,o){var a=[n-t,e-r];if(function(t,r){return t[0]===r[0]&&t[1]===r[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-r)*(o-r));var u=[-a[1],a[0]];return function(t,r){var n=r[0],e=r[1],i=n*n+e*e;i>0&&(i=1/Math.sqrt(i)),t[0]=r[0]*i,t[1]=r[1]*i}(u,u),Math.abs(function(t,r){return t[0]*r[0]+t[1]*r[1]}([i-t,o-r],u))}function k(t,r,n,e,i){var o=1-i;return o*o*o*t+3*r*i*o*o+3*n*i*i*o+e*i*i*i}function w(t,r,n,e,i,o,a,u,c,f,l){var s=function(t,r,n,e,i,o,a,u,c,f,l){return m([t,n,i,a],[r,e,o,u],c,f,k,l)}(t,r,n,e,i,o,a,u,c,f,l);return P(s.x,s.y,c,f)}function F(t,r,n,e){var i=1-e;return i*i*t+2*e*i*r+e*e*n}function C(t,r,n,e,i,o,a,u){var c=function(t,r,n,e,i,o,a,u){return m([t,n,i],[r,e,o],a,u,F)}(t,r,n,e,i,o,a,u);return P(c.x,c.y,a,u)}function O(t,n,e){var i=t.parsedStyle,o=i.cx,u=i.cy,c=i.r,f=i.fill,l=i.stroke,s=i.lineWidth,h=i.increasedLineWidthForHitTesting,v=i.pointerEvents,p=void 0===v?"auto":v,d=((void 0===s?1:s)+(void 0===h?0:h))/2,y=P(void 0===o?0:o,void 0===u?0:u,n.x,n.y),x=a(r.isFillOrStrokeAffected(p,f,l),2),g=x[0],M=x[1];return g&&M||e?c+d>=y:g?c>=y:!!M&&(y>=c-d&&c+d>=y)}function A(t,r,n,e){return t/(n*n)+r/(e*e)}function I(t,n,e){var i=t.parsedStyle,o=i.cx,u=void 0===o?0:o,c=i.cy,f=void 0===c?0:c,l=i.rx,s=i.ry,h=i.lineWidth,v=void 0===h?1:h,p=i.increasedLineWidthForHitTesting,d=void 0===p?0:p,y=i.pointerEvents,x=n.x,g=n.y,M=a(r.isFillOrStrokeAffected(void 0===y?"auto":y,i.fill,i.stroke),2),P=M[0],b=M[1],m=(v+d)/2,S=(x-u)*(x-u),k=(g-f)*(g-f);return P&&b||e?1>=A(S,k,l+m,s+m):P?1>=A(S,k,l,s):!!b&&(A(S,k,l-m,s-m)>=1&&1>=A(S,k,l+m,s+m))}function E(t,r,n,e,i,o){return!(t>i||i>t+n||r>o||o>r+e)}function T(t,r,n,e,i,o,a,u){var c=(Math.atan2(u-r,a-t)+2*Math.PI)%(2*Math.PI),f={x:t+n*Math.cos(c),y:r+n*Math.sin(c)};return P(f.x,f.y,a,u)<=o/2}function L(t,r,n,e,i,o,a){var u=i/2;return!(Math.min(t,n)-u>o||o>Math.max(t,n)+u||Math.min(r,e)-u>a||a>Math.max(r,e)+u)&&S(t,r,n,e,o,a)<=i/2}function W(t,r,n,e,i){var o=t.length;if(2>o)return!1;for(var a=0;o-1>a;a++){if(L(t[a][0],t[a][1],t[a+1][0],t[a+1][1],r,n,e))return!0}if(i){var u=t[0],c=t[o-1];if(L(u[0],u[1],c[0],c[1],r,n,e))return!0}return!1}var H=1e-6;function G(t){return H>Math.abs(t)?0:0>t?-1:1}function q(t,r,n){return!((n[0]-t[0])*(r[1]-t[1])!=(r[0]-t[0])*(n[1]-t[1])||Math.min(t[0],r[0])>n[0]||n[0]>Math.max(t[0],r[0])||Math.min(t[1],r[1])>n[1]||n[1]>Math.max(t[1],r[1]))}function R(t,r,n){var e=!1,i=t.length;if(2>=i)return!1;for(var o=0;i>o;o++){var a=t[o],u=t[(o+1)%i];if(q(a,u,[r,n]))return!0;G(a[1]-n)>0!=G(u[1]-n)>0&&0>G(r-(n-a[1])*(a[0]-u[0])/(a[1]-u[1])-a[0])&&(e=!e)}return e}function _(t,r,n){for(var e=!1,i=0;t.length>i;i++){if(e=R(t[i],r,n))break}return e}function j(t,n,e){var i=t.parsedStyle,o=i.x1,u=i.y1,c=i.x2,f=i.y2,l=i.lineWidth,s=void 0===l?1:l,h=i.increasedLineWidthForHitTesting,v=void 0===h?0:h,p=i.pointerEvents;return!(!a(r.isFillOrStrokeAffected(void 0===p?"auto":p,i.fill,i.stroke),2)[1]&&!e||!s)&&L(o,u,c,f,s+v,n.x,n.y)}function N(t,n,e,i,o,u){var c=t.parsedStyle,f=c.lineWidth,l=void 0===f?1:f,s=c.increasedLineWidthForHitTesting,h=void 0===s?0:s,v=c.d,p=c.pointerEvents,d=v.segments,y=v.hasArc,x=v.polylines,g=v.polygons,P=a(r.isFillOrStrokeAffected(void 0===p?"auto":p,(null==g?void 0:g.length)&&c.fill,c.stroke),2),b=P[0],m=P[1],S=r.getOrCalculatePathTotalLength(t),k=!1;return b||e?k=y?i(t,n):_(g,n.x,n.y)||_(x,n.x,n.y):((m||e)&&(k=function(t,r,n,e,i){for(var o=!1,a=r/2,u=0;t.length>u;u++){var c=t[u],f=c.currentPoint,l=c.params,s=c.prePoint,h=c.box;if(!h||E(h.x-a,h.y-a,h.width+r,h.height+r,n,e))switch(c.command){case"L":case"Z":if(o=L(s[0],s[1],f[0],f[1],r,n,e))return!0;break;case"Q":if(o=r/2>=C(s[0],s[1],l[1],l[2],l[3],l[4],n,e))return!0;break;case"C":if(o=r/2>=w(s[0],s[1],l[1],l[2],l[3],l[4],l[5],l[6],n,e,i))return!0;break;case"A":c.cubicParams||(c.cubicParams=M(s[0],s[1],l[1],l[2],l[3],l[4],l[5],l[6],l[7],void 0));for(var v=c.cubicParams,p=s,d=0;v.length>d;d+=6){var y=w(p[0],p[1],v[d],v[d+1],v[d+2],v[d+3],v[d+4],v[d+5],n,e,i);if(p=[v[d+4],v[d+5]],o=r/2>=y)return!0}}}return o}(d,l+h,n.x,n.y,S)),k)}function B(t,n,e){var i=t.parsedStyle,o=i.lineWidth,u=void 0===o?1:o,c=i.increasedLineWidthForHitTesting,f=void 0===c?0:c,l=i.points,s=i.pointerEvents,h=a(r.isFillOrStrokeAffected(void 0===s?"auto":s,i.fill,i.stroke),2),v=h[0],p=!1;return(h[1]||e)&&(p=W(l.points,u+f,n.x,n.y,!0)),p||!v&&!e||(p=R(l.points,n.x,n.y)),p}function D(t,n,e){var i=t.parsedStyle,o=i.lineWidth,u=void 0===o?1:o,c=i.increasedLineWidthForHitTesting,f=void 0===c?0:c,l=i.points,s=i.pointerEvents;return!(!a(r.isFillOrStrokeAffected(void 0===s?"auto":s,i.fill,i.stroke),2)[1]&&!e||!u)&&W(l.points,u+f,n.x,n.y,!1)}function Y(t,n,e,i,o){var u=t.parsedStyle,c=u.radius,f=u.lineWidth,l=void 0===f?1:f,s=u.increasedLineWidthForHitTesting,h=void 0===s?0:s,v=u.x,p=void 0===v?0:v,d=u.y,y=void 0===d?0:d,g=u.width,M=u.height,P=u.pointerEvents,b=a(r.isFillOrStrokeAffected(void 0===P?"auto":P,u.fill,u.stroke),2),m=b[0],S=b[1],k=l+h;if(c&&c.some((function(t){return 0!==t}))){var w=!1;return(S||e)&&(w=function(t,r,n,e,i,o,u,c){var f=a(i,4),l=f[0],s=f[1],h=f[2],v=f[3];return L(t+l,r,t+n-s,r,o,u,c)||L(t+n,r+s,t+n,r+e-h,o,u,c)||L(t+n-h,r+e,t+v,r+e,o,u,c)||L(t,r+e-v,t,r+l,o,u,c)||T(t+n-s,r+s,s,0,0,o,u,c)||T(t+n-h,r+e-h,h,0,0,o,u,c)||T(t+v,r+e-v,v,0,0,o,u,c)||T(t+l,r+l,l,0,0,o,u,c)}(p,y,g,M,c.map((function(t){return x(t,0,Math.min(Math.abs(g)/2,Math.abs(M)/2))})),k,n.x,n.y)),w||!m&&!e||(w=i(t,n)),w}var F=k/2;return m&&S||e?E(p-F,y-F,g+F,M+F,n.x,n.y):m?E(p,y,g,M,n.x,n.y):!!S&&function(t,r,n,e,i,o,a){var u=i/2;return E(t-u,r-u,n,i,o,a)||E(t+n-u,r-u,i,e,o,a)||E(t+u,r+e-u,n,i,o,a)||E(t-u,r+u,i,e,o,a)}(p,y,g,M,k,n.x,n.y)}function Q(t,n,i,o,a,u){var c=t.parsedStyle,f=c.pointerEvents,l=c.x,s=void 0===l?0:l,h=c.y,v=void 0===h?0:h,p=c.width,d=c.height;if("non-transparent-pixel"===(void 0===f?"auto":f)){var y=a.config.offscreenCanvas,x=u.offscreenCanvasCreator.getOrCreateCanvas(y),g=u.offscreenCanvasCreator.getOrCreateContext(y,{willReadFrequently:!0});return x.width=p,x.height=d,a.defaultStyleRendererFactory[r.Shape.IMAGE].render(g,e(e({},t.parsedStyle),{x:0,y:0}),t,void 0,void 0,void 0),g.getImageData(n.x-s,n.y-v,1,1).data.every((function(t){return 0!==t}))}return!0}var U=function(t){function e(){var r=t.apply(this,u([],a(arguments),!1))||this;return r.name="canvas-picker",r}return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+r+" is not a constructor or null");function e(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}(e,t),e.prototype.init=function(){var t,n=((t={})[r.Shape.CIRCLE]=O,t[r.Shape.ELLIPSE]=I,t[r.Shape.RECT]=Y,t[r.Shape.LINE]=j,t[r.Shape.POLYLINE]=D,t[r.Shape.POLYGON]=B,t[r.Shape.PATH]=N,t[r.Shape.TEXT]=function(){return!0},t[r.Shape.GROUP]=null,t[r.Shape.IMAGE]=Q,t[r.Shape.HTML]=null,t[r.Shape.MESH]=null,t);this.context.pointInPathPickerFactory=n,this.addRenderingPlugin(new y)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(r.AbstractRendererPlugin);t.Plugin=U}));
//# sourceMappingURL=index.umd.min.js.map
{
"name": "@antv/g-plugin-canvas-picker",
"version": "1.10.24-next.18",
"version": "1.10.24-next.19",
"description": "A G plugin for picking in canvas",

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

"tslib": "^2.5.3",
"@antv/g-lite": "1.3.0-next.18",
"@antv/g-plugin-canvas-renderer": "1.10.0-next.18",
"@antv/g-plugin-canvas-path-generator": "1.3.22-next.18",
"@antv/g-math": "2.0.3-next.4"
"@antv/g-plugin-canvas-path-generator": "1.3.22-next.19",
"@antv/g-plugin-canvas-renderer": "1.10.0-next.19",
"@antv/g-math": "2.0.3-next.5",
"@antv/g-lite": "1.3.0-next.19"
},

@@ -44,0 +44,0 @@ "publishConfig": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc