define(["exports"],function(_exports){function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=_exports.AbortSignalPolyfill=void 0;var Emitter=function(){return babelHelpers.createClass(function Emitter(){babelHelpers.classCallCheck(this,Emitter),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})},[{key:"addEventListener",value:function(type,callback,options){type in this.listeners||(this.listeners[type]=[]),this.listeners[type].push({callback:callback,options:options})}},{key:"removeEventListener",value:function(type,callback){if(type in this.listeners)for(var stack=this.listeners[type],i=0,l=stack.length;i<l;i++)if(stack[i].callback===callback)return void stack.splice(i,1)}},{key:"dispatchEvent",value:function(event){var _this=this;if(event.type in this.listeners){for(var stackToCall=this.listeners[event.type].slice(),i=0,l=stackToCall.length;i<l;i++){listener=void 0;var listener=stackToCall[i];try{listener.callback.call(_this,event)}catch(e){Promise.resolve().then(function(){throw e})}listener.options&&listener.options.once&&_this.removeEventListener(event.type,listener.callback)}return!event.defaultPrevented}}}])}(),AbortSignalPolyfill=_exports.AbortSignalPolyfill=function(){function AbortSignalPolyfill(){var t,o,e;return babelHelpers.classCallCheck(this,AbortSignalPolyfill),t=this,o=AbortSignalPolyfill,o=babelHelpers.getPrototypeOf(o),(o=babelHelpers.possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],babelHelpers.getPrototypeOf(t).constructor):o.apply(t,e))).listeners||Emitter.call(o),Object.defineProperty(o,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(o,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(o,"reason",{value:void 0,writable:!0,configurable:!0}),o}return babelHelpers.inherits(AbortSignalPolyfill,Emitter),babelHelpers.createClass(AbortSignalPolyfill,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(event){"abort"===event.type&&(this.aborted=!0,"function"==typeof this.onabort)&&this.onabort.call(this,event),babelHelpers.get(babelHelpers.getPrototypeOf(AbortSignalPolyfill.prototype),"dispatchEvent",this).call(this,event)}}])}(),isMissingRequestSignalSupport="function"==typeof globalThis.Request&&!Object.prototype.hasOwnProperty.call(globalThis.Request.prototype,"signal");"undefined"!=typeof AbortSignal&&!isMissingRequestSignalSupport||Object.defineProperty(globalThis,"AbortSignal",{writable:!0,enumerable:!1,configurable:!0,value:AbortSignalPolyfill}),AbortSignal.timeout||(AbortSignal.timeout=function(duration){var controller=new AbortController;return setTimeout(function(){return controller.abort()},duration),controller.signal}),AbortSignal.prototype.throwIfAborted||(AbortSignal.prototype.throwIfAborted=function(){var reason;if(this.aborted)throw(reason=this.reason)||((reason=new Error("Aborted")).name="AbortError"),reason}),_exports.default=AbortSignalPolyfill});