/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../chunks/_rollupPluginBabelHelpers","../chunks/tslib.es6","./Accessor","./handleUtils","./accessorSupport/decorators/subclass"],(function(t,e,n,i,r){"use strict";let s=function(){function t(){this._emitter=new t.EventEmitter(this)}var e=t.prototype;return e.emit=function(t,e){return this._emitter.emit(t,e)},e.on=function(t,e){return this._emitter.on(t,e)},e.once=function(t,e){return this._emitter.once(t,e)},e.hasEventListener=function(t){return this._emitter.hasEventListener(t)},t}();!function(o){let u=function(){function t(t=null){this.target=t,this._listenersMap=null}var e=t.prototype;return e.clear=function(){this._listenersMap&&this._listenersMap.clear(),this._listenersMap=null},e.emit=function(t,e){const n=this._listenersMap&&this._listenersMap.get(t);if(!n)return!1;const i=this.target||this;return[...n].forEach((t=>{t.call(i,e)})),n.length>0},e.on=function(t,e){if(Array.isArray(t)){const n=t.map((t=>this.on(t,e)));return i.handlesGroup(n)}if(t.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap||(this._listenersMap=new Map);const n=this._listenersMap.get(t)||[];return n.push(e),this._listenersMap.set(t,n),{remove:()=>{const n=this._listenersMap&&this._listenersMap.get(t)||[],i=n.indexOf(e);i>=0&&n.splice(i,1)}}},e.once=function(t,e){const n=this.on(t,(t=>{n.remove(),e.call(null,t)}));return n},e.hasEventListener=function(t){const e=this._listenersMap&&this._listenersMap.get(t);return null!=e&&e.length>0},t}();o.EventEmitter=u,o.EventedMixin=n=>{let i=function(e){function n(){var t;return(t=e.apply(this,arguments)||this)._emitter=new u,t}t._inheritsLoose(n,e);var i=n.prototype;return i.destroy=function(){this._emitter.clear()},i.emit=function(t,e){return this._emitter.emit(t,e)},i.on=function(t,e){return this._emitter.on(t,e)},i.once=function(t,e){return this._emitter.once(t,e)},i.hasEventListener=function(t){return this._emitter.hasEventListener(t)},n}(n);return i=e.__decorate([r.subclass("esri.core.Evented")],i),i};let c=function(e){function n(){var n;return(n=e.apply(this,arguments)||this)._emitter=new s.EventEmitter(t._assertThisInitialized(n)),n}t._inheritsLoose(n,e);var i=n.prototype;return i.destroy=function(){this._emitter.clear()},i.emit=function(t,e){return this._emitter.emit(t,e)},i.on=function(t,e){return this._emitter.on(t,e)},i.once=function(t,e){return this._emitter.once(t,e)},i.hasEventListener=function(t){return this._emitter.hasEventListener(t)},n}(n);c=e.__decorate([r.subclass("esri.core.Evented")],c),o.EventedAccessor=c}(s||(s={}));return s}));
