text: export default class LoudArray extends Array{constructor(listeners,...fromValues){super(...fromValues),this._private={listeners:listeners||[]};const mutatorMethods="copyWithin fill pop push reverse shift sort splice unshift".split(" ");for(let i=0;i<mutatorMethods.length;i++){let method=mutatorMethods[i];this._private[method]=this[method].bind(this),this[method]=(...args)=>{let listeners=this._private.listeners.filter(value=>{if("copyWithin"===method&&"copy-within"==value.event)return!0;let event=value.event.toLowerCase();return event==method||"any"==event||"all"==event}),returnValue=this._private[method](...args);return _dispatchEvents(this,listeners,"after",args),returnValue}}this._private.slice=this.slice.bind(this),this.slice=(...args)=>{let returnValue=this._private.slice(...args);return returnValue=new Array(...returnValue)}}addEventListener(event,handler){let listenerIndex=_array_findListener(this,listener.event,listener.handler);return listenerIndex>-1?this._private.listeners[listenerIndex]:(this._private.listeners.push({event:event,handler:handler}),listener)}removeEventListener(event,handler){let listenerIndex=_array_findListener(this,event,handler);-1!=listenerIndex&&this._private.listeners.splice(listenerIndex,1)}}function _array_findListener(target,event,handler){let index=-1;for(let i=0;i<target._private.listeners.length;i++){let listener=target._private.listeners[i],listenerEvent;if(listener.event.toLowerCase()==event&&listener.handler==handler){index=i;break}}return index}function _dispatchEvents(target,listeners,args){for(let i=0;i<listeners.length;i++){let listener;listeners[i].handler(target,...args)}}