!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@lumino/algorithm")):"function"==typeof define&&define.amd?define(["exports","@lumino/algorithm"],e):e((n=n||self).lumino_signaling={},n.lumino_algorithm)}(this,(function(n,e){"use strict";var t,i;n.Signal=function(){function n(n){this.sender=n}return n.prototype.connect=function(n,e){return i.connect(this,n,e)},n.prototype.disconnect=function(n,e){return i.disconnect(this,n,e)},n.prototype.emit=function(n){i.emit(this,n)},n}(),(t=n.Signal||(n.Signal={})).disconnectBetween=function(n,e){i.disconnectBetween(n,e)},t.disconnectSender=function(n){i.disconnectSender(n)},t.disconnectReceiver=function(n){i.disconnectReceiver(n)},t.disconnectAll=function(n){i.disconnectAll(n)},t.clearData=function(n){i.disconnectAll(n)},t.getExceptionHandler=function(){return i.exceptionHandler},t.setExceptionHandler=function(n){var e=i.exceptionHandler;return i.exceptionHandler=n,e},function(n){function t(n){var t=r.get(n);t&&0!==t.length&&(e.each(t,(function(n){if(n.signal){var e=n.thisArg||n.slot;n.signal=null,u(o.get(e))}})),u(t))}function i(n){var t=o.get(n);t&&0!==t.length&&(e.each(t,(function(n){if(n.signal){var e=n.signal.sender;n.signal=null,u(r.get(e))}})),u(t))}n.exceptionHandler=function(n){console.error(n)},n.connect=function(n,e,t){t=t||void 0;var i=r.get(n.sender);if(i||(i=[],r.set(n.sender,i)),a(i,n,e,t))return!1;var c=t||e,l=o.get(c);l||(l=[],o.set(c,l));var s={signal:n,slot:e,thisArg:t};return i.push(s),l.push(s),!0},n.disconnect=function(n,e,t){t=t||void 0;var i=r.get(n.sender);if(!i||0===i.length)return!1;var c=a(i,n,e,t);if(!c)return!1;var l=t||e,s=o.get(l);return c.signal=null,u(i),u(s),!0},n.disconnectBetween=function(n,t){var i=r.get(n);if(i&&0!==i.length){var c=o.get(t);c&&0!==c.length&&(e.each(c,(function(e){e.signal&&e.signal.sender===n&&(e.signal=null)})),u(i),u(c))}},n.disconnectSender=t,n.disconnectReceiver=i,n.disconnectAll=function(n){t(n),i(n)},n.emit=function(n,e){var t=r.get(n.sender);if(t&&0!==t.length)for(var i=0,o=t.length;i<o;++i){var c=t[i];c.signal===n&&s(c,e)}};var r=new WeakMap,o=new WeakMap,c=new Set,l="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;function a(n,t,i,r){return e.find(n,(function(n){return n.signal===t&&n.slot===i&&n.thisArg===r}))}function s(e,t){var i=e.signal,r=e.slot,o=e.thisArg;try{r.call(o,i.sender,t)}catch(e){n.exceptionHandler(e)}}function u(n){0===c.size&&l(f),c.add(n)}function f(){c.forEach(d),c.clear()}function d(n){e.ArrayExt.removeAllWhere(n,g)}function g(n){return null===n.signal}}(i||(i={})),Object.defineProperty(n,"__esModule",{value:!0})}));
//# sourceMappingURL=index.min.js.map