/** * Minified by jsDelivr using Terser v5.15.1. * Original file: /npm/cytoscape-cxtmenu@3.5.0/cytoscape-cxtmenu.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.cytoscapeCxtmenu=e():t.cytoscapeCxtmenu=e()}(this,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=4)}([function(t,e,i){"use strict";var n=i(2),o=i(1),a=i(3),d=a.removeEles,r=a.setStyles,l=a.createElement,s=a.getPixelRatio,c=a.getOffset;t.exports=function(t){var e=o({},n,t),i=this,a=i.container(),u=void 0,p={options:e,handlers:[],container:l({class:"cxtmenu"})},h=p.container,g=l(),f=l({tag:"canvas"}),m=[],v=f.getContext("2d"),x=100,P=2*(x+e.activePadding),b=void 0,y=void 0;function S(t,e){E.drawBg=[t,e]}function M(t,i){v.globalCompositeOperation="source-over",v.clearRect(0,0,P,P),v.fillStyle=e.fillColor;for(var n=2*Math.PI/m.length,o=Math.PI/2,a=o+n,d=0;da+e.spotlightPadding?a+e.spotlightPadding:e.indicatorSize;v.beginPath(),v.fillRect(-p/2,-p/2,p,p),v.closePath(),v.fill(),v.rotate(-u),v.translate(-s,-c),v.beginPath(),v.arc(n+e.activePadding,n+e.activePadding,a+e.spotlightPadding,0,2*Math.PI,!0),v.closePath(),v.fill(),v.globalCompositeOperation="source-over"}function C(){var t=s(),e=P,i=P;f.width=e*t,f.height=i*t,f.style.width=e+"px",f.style.height=i+"px",v.setTransform(1,0,0,1,0,0),v.scale(t,t)}a.insertBefore(h,a.firstChild),h.appendChild(g),g.appendChild(f),r(h,{position:"absolute",zIndex:e.zIndex,userSelect:"none",pointerEvents:"none"}),["mousedown","mousemove","mouseup","contextmenu"].forEach((function(t){h.addEventListener(t,(function(t){return t.preventDefault(),!1}))})),r(g,{display:"none",width:P+"px",height:P+"px",position:"absolute",zIndex:1,marginLeft:-e.activePadding+"px",marginTop:-e.activePadding+"px",userSelect:"none"}),f.width=P,f.height=P;var R=!0,E={},I=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)};C(),function t(){E.drawBg&&M.apply(null,E.drawBg),E.drawCommands&&w.apply(null,E.drawCommands),E={},R&&I(t)}();var O,T,F,z,N,j,k,L,A,q=void 0,W=void 0,B=void 0,H={on:function(t,e,n){var o=n;return"core"===e&&(o=function(t){if(t.cyTarget===i||t.target===i)return n.apply(this,[t])}),p.handlers.push({events:t,selector:e,fn:o}),"core"===e?i.on(t,o):i.on(t,e,o),this}};function X(){R=!1,function(){for(var t=p.handlers,e=0;e0,o=(n?i.touches[0].pageX:i.pageX)-window.pageXOffset,a=(n?i.touches[0].pageY:i.pageY)-window.pageYOffset;b=void 0;var d=o-y.left-q,r=a-y.top-W;0===d&&(d=.01);var l=Math.sqrt(d*d+r*r),s=(r*r-l*l-d*d)/(-2*l*d),c=Math.acos(s),p=void 0;if(u&&u.isNode instanceof Function&&u.isNode()&&!u.isParent()&&!e.atMouse?(p=u.renderedOuterWidth(),B=p/2,B=!e.adaptativeNodeSpotlightRadius&&e.minSpotlightRadius?Math.max(B,e.minSpotlightRadius):B,B=!e.adaptativeNodeSpotlightRadius&&e.maxSpotlightRadius?Math.min(B,e.maxSpotlightRadius):B):(B=(p=1)/2,B=e.minSpotlightRadius?Math.max(B,e.minSpotlightRadius):B,B=e.maxSpotlightRadius?Math.min(B,e.maxSpotlightRadius):B),x=p/2+(e.menuRadius instanceof Function?e.menuRadius(u):Number(e.menuRadius)),lx+e.activePadding+e.outsideMenuCancel)S(x,B);else{S(x,B);var h=d*x/l,g=r*x/l;r>0&&(c=Math.PI+Math.abs(c-Math.PI));for(var f=2*Math.PI/m.length,v=Math.PI/2,P=v+f,M=0;M1?e-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:document,i=e.querySelectorAll(t),n=0;n