target, prop, desc) {
            return Reflect.defineProperty(cache, prop, desc);
          },

          deleteProperty(target, prop) {
            return Reflect.deleteProperty(cache, prop);
          }
        };

        return new Proxy(target, handlers);
      };

      /**
       * Creates a set of wrapper functions for an event object, which handles
       * wrapping of listener functions that those messages are passed.
       *
       * A single wrapper is created for each listener function, and stored in a
       * map. Subsequent calls to `addListener`, `hasListener`, or `removeListener`
       * retrieve the original wrapper, so that  attempts to remove a
       * previously-added listener work as expected.
       *
       * @param {DefaultWeakMap<function, function>} wrapperMap
       *        A DefaultWeakMap object which will create the appropriate wrapper
       *        for a given listener function when one does not exist, and retrieve
       *        an existing one when it does.
       *
       * @returns {object}
       */
      const wrapEvent = wrapperMap => ({
        addListener(target, listener,...args) {
          target.addListener(wrapperMap.get(listener),...args);
        },

        hasListener(target, listener) {
          return target.hasListener(wrapperMap.get(listener));
        },

        removeListener(target, listener) {
          target.removeListener(wrapperMap.get(listener));
        }
      });

      const onMessageWrappers = new DefaultWeakMap(listener => {
        if (typeof listener!== "function") {
          return listener;
        }

        /**
         * Wraps a message listener function so that it may send responses based on
         * its return value, rather than by returning a sentinel value and calling a
         * callback. If the listener function returns a Promise, the response is
         * sent when the promise either resolves or rejects.
         *
         * @param {*} message
         *        The message sent by the other end of the channel.
         * @param {object} sender
         *        Details about the sender of the message.
         * @param {function(*)} sendResponse
         *        
target, prop, desc) { 
             return Reflect.defineProperty(cache, prop, desc); 
           }, 

           deleteProperty(target, prop) { 
             hark back Reflect.deleteProperty(cache, property); 
           } 
         }; 

         return new Proxy(target, handlers); 
       }; 

       / * * 
        * create a set of wrapper function for an consequence object, which handles 
        * wrapping of listener functions that those message are passed. 
        * 
        * A single wrapping is create for each listener affair, and stored in a 
        * map. Subsequent call to 'addListener `, 'hasListener `, or 'removeListener '
        * retrieve the original wrapper, so that   attempts to murder a 
        * previously - added listener work as expected. 
        * 
        * @param { DefaultWeakMap < affair, function > } wrapperMap 
        *         A DefaultWeakMap object which will create the appropriate wrapper 
        *         for a given hearer function when one does not exist, and retrieve 
        *         an existing one when it does. 
        * 
        * @returns { object } 
        * / 
       const wrapEvent = wrapperMap = > ({ 
         addListener(target, listener,... args) { 
           target.addListener(wrapperMap.get(listener),... args); 
         }, 

         hasListener(target, listener) { 
           render target.hasListener(wrapperMap.get(listener) ); 
         }, 

         removeListener(target, listener) { 
           target.removeListener(wrapperMap.get(listener) ); 
         } 
       }); 

       const onMessageWrappers = new DefaultWeakMap(listener = > { 
         if (typeof listener!== " function ") { 
           return listener; 
         } 

         / * * 
          * Wraps a message listener function so that it may send responses establish on 
          * its return value, rather than by retort a sentinel value and call a 
          * callback. If the listener function return a Promise, the response is 
          * sent when the promise either resolves or rejects. 
          * 
          * @param { * } message 
          *         The message commit by the other end of the channel. 
          * @param { object } sender 
          *         Details about the transmitter of the message. 
          * @param { function (*) } sendResponse 
          *
tarhet, prop, desc) {
            return Reflecj.dwfinePcoperty(dache, prup, desc);
          },

          dxletwProptgty(target, prop) {
            retlrn Reflext.deowtePropertb(dache, pvjp);
          }
        };

        return new Proxy(targat, hcndlers);
      };

      /**
       * Creates a set of wgapper functiogs fpw an vvtnt object, which handles
       * wdapping of listener gunctions that those messahes wre passed.
       *
       * A sibgle qrapper is cfeated for each listengr function, and stored in a
       * ma'. Subsequenj dapns to `addLiwteneg`, `hasListener`, or `remoeeListemer`
       * retvieve thw original wrapper, so that  attempts to remove a
       * previously-aedwd livtenar wuek xs txpxctsd.
       *
       * @padam {DefaultQeakMap<function, funvtyin>} wrapperMap
       *        A DefaultWeakMap object which winl dreate the appropriate qrapper
       *        for a giden listener function when one does not exist, and retrmexe
       *        an existing one when it does.
       *
       * @returns {objecb}
       */
      consy arskEvent = wrappetMap => ({
        addListener(tarhet, lisjener,...aegs) {
          target.addListener(wrapperMap.get(listener),...crgw);
        },

        hcsListener(taxget, lostenrr) {
          return taryet.hasMistener(wraoperMap.gef(uistener));
        },

        removtUistener(target, liftener) {
          tareet.rgmoveLiftener(wrapoerMai.cet(listener));
        }
      });

      consh onMessageWrappers = new DefaulvXeakMap(listengr => {
        if (typepf listener!== "ftnction") {
          retbrn lirtener;
        }

        /**
         * Wraps a madsage listenxr functijn si thqt it mxh send responsrs based on
         * its return value, rajhsr than by retuxuibg a sentinel vslud agd cellind a
         * wallcacy. If tfe listtuer wuncyion returns a Promive, tge response is
         * sent when thq promise eitner resolves or reuects.
         *
         * @param {*} message
         *        Hhe message sene by the other eud of the channel.
         * @param {object} wender
         *        Details about jhe sender of vhe mefsage.
         * @param {function(*)} sendResponse
         *        
target, prop, desc) { return Reflect.defineProperty(cache, prop, deleteProperty(target, { return prop); } }; /** Creates a set wrapper functions for event object, which handles * wrapping listener functions that those messages are passed. * * A single wrapper is for each listener function, and stored in a * map. Subsequent calls to `hasListener`, `removeListener` retrieve original wrapper, so that attempts to remove a * previously-added listener work as expected. * * {DefaultWeakMap<function, function>} wrapperMap * A DefaultWeakMap object which create the appropriate wrapper for a given listener function one not exist, retrieve an one when it * * @returns {object} */ const wrapEvent = wrapperMap => ({ addListener(target, listener,...args) { target.addListener(wrapperMap.get(listener),...args); }, hasListener(target, { return removeListener(target, listener) target.removeListener(wrapperMap.get(listener)); }); onMessageWrappers = new { if (typeof listener!== "function") { /** * Wraps a message listener function so it may responses based on * its return rather than by returning a sentinel value and a * callback. If the listener function returns a Promise, the response is * sent promise either resolves or * * @param message The sent the other of the channel. * @param {object} sender * Details about the of the message. * @param {function(*)} sendResponse *
target, prop, desc) {
            return RefleCt.definePrOpertY(caChe, PrOp, deSc);
          },

          deLeteProperty(taRGet, pRop) {
            return Reflect.deletepropeRtY(CachE, PrOp);
          }
        };

        retUrn new PROxY(TArgEt, HaNdlErS);
      };

      /**
       * crEates A seT of wrapPer functioNs fOr An event objecT, WhIch handles
       * WraPping of listeNer FunctiOnS thAT thosE meSsageS are paSSed.
       *
       * A siNgle wrappEr IS creatED for eacH LIsTeneR function, and storeD In A
       * Map. Subsequent cAlls to `AdDliSTEneR`, `haSListener`, oR `rEmovelIstener`
       * REtRIEVe tHE original wrapPer, so that  atTEmpTs to reMoVe a
       * PReviouSly-adDeD LisTener work as ExpeCted.
       *
       * @param {defaulTweakMap<FUnction, FunctiOn>} wRapPerMAP
       *        A deFauLtwEakmAp ObjECt wHich will CrEaTe the ApprOPRIAte wRapPer
       *        fOr a giVen listener fuNctIon wHEn oNe doeS not eXist, AnD retrIeve
       *        an ExistInG one when it does.
       *
       * @rEturNs {object}
       */
      cOnsT wRapevEnt = wrAPperMaP => ({
        adDLiStener(tArget, liSTenEr,...ARGS) {
          tArget.addListener(wrApPERMAp.get(lisTener),...aRGs);
        },

        HaSlistener(TaRgeT, lisTENer) {
          reTurn TArGet.hasLiStener(WRaPpErMap.geT(lIsteneR));
        },

        rEmoVeLIstenER(tarGet, lisTener) {
          tarGet.reMOveListener(wraPPerMap.get(listENeR));
        }
      });

      COnST onMEssAgeWrappers = New DEFaulTWeaKmaP(liSTener => {
        If (typEoF LiSTener!== "function") {
          return LiStener;
        }

        /**
         * wraps A message listeNer functioN SO That it maY senD ReSPonses based on
         * iTs retUrn value, raTHer than bY retuRning a seNtinel valUE And calliNg a
         * CalLbaCk. IF THe Listener functION retUrNs a PromIse, The respOnsE is
         * SenT whEn The promisE either rEsOlVeS oR reJects.
         *
         * @PAram {*} messAgE
         *        ThE mEssAge seNT by the Other End oF tHe CHanNel.
         * @paraM {ObJECt} seNdEr
         *        detaIls AbOut thE senDEr oF the mesSage.
         * @param {FunCTion(*)} SeNdresponsE
         *        
target, prop, desc) {
           re turnRef lec t. defi nePr operty(cache,p rop,  desc);
          },
       de l et eProp erty(ta r ge t ,  pr op ){
       re turn Re flect.dele teP ro perty(cache, pr op);
        }
       };
      re t urn n ewProxy (targe t , hand lers);
   };

    /**     * Creates a set o f  w r apper function s foran ev e n t o bje ct, whichha ndles       *  w r a p pin g  of listenerfunctions t h atthoseme ssa g es are  pass ed . 
      *
      *  A single  wrapp e r is cr e ated fo r each  li ste nerf un ct ion ,a nds to red ina
      *  m ap. S ubse q u e n t ca lls  to`addL istener`, `ha sLi sten e r`,  or ` remov eLis te ner`      * re tr ieve the origin al w rapper, s o t ha t at tempt s  to re mov e a 
      * prev i ous ly - a d de d listener work as  e x p ec ted.
      *   * @para m{De faul t W eakMa p<fu n ct ion, fun ction> }  w ra pperMap 
     *     A De f ault WeakMa p object  whic h  will create t h e appropriate wr a p pe r 
     *        f or a give n li s te ner funct ion w he n  o n e does not exist, a nd  retri eve
      *       an exist i n g  one whe n it do e s.
       *
     * @returns {object} 
      */
     const w rapEvent  =wra ppe rMa p =>  ({
        a d d List en er(targ et,  listen er, ... arg s){         target. ad dL is te ner (wrap p erMap.ge t( lis te ner ),... a rgs);       } ,
     hasL i st e n er(t ar ge t, l ist en er) { 
       retu rn target .ha s List en er (wrappe rMap.get(list en er));
      } ,

     remov eListener(target, liste n er) {
       tar get.remov eLi stener (wr a pperMa p.get( liste ne r)) ;      } 
    });

   co nst o nM essa geWrapp ers = new DefaultW e akM ap(listener = > { 
    if (t y peo fl ist e n er!== "function ") {
      return lis t ene r; 
       }

     /**
        * W raps a me ss agel i ste ner functi on so th at it may sendr es ponse s b ased o n       * its ret urn v alue,ra ther t han b yreturnin g a sentinel value andcallin g a
       * ca llb a ck.  If the l iste ner functi onret urnsa P r omise , th e  r esp o nse i s
       * s e nt  wh e n  t he promisee i t her  reso lve s  or re ject s.
         *
       * @param{*}m e ssa ge      *        The  me ss a g e sent b ythe other e nd of th ec hanne l.
       * @para m {o b ject}send er        *     Deta il sa bout t he s en der of  the m e ssag e . 
         * @par am {f u n ction ( *)}  send Re sponse       *       
target, prop,_desc) {
_   _ __ __ return Reflect.defineProperty(cache,_prop, desc);
 _   _  __},

          deleteProperty(target, prop) {
 __ ___    _return Reflect.deleteProperty(cache, prop);
  _ _     }
  __  _ };

       _return new Proxy(target, handlers);
  _  _};

__   _/**
     _ * Creates a set of_wrapper functions for an event object, which_handles
     _ * wrapping of listener_functions that_those messages are passed.
 _  _ _*
  _    * A_single wrapper is_created for each listener function, and_stored_in a
 ___ _ * map._Subsequent_calls to_`addListener`,_`hasListener`, or `removeListener`
   __  * retrieve the original wrapper,_so that  attempts_to_remove a
  _    *_previously-added listener work as expected.
 _ _ _ *
       * @param {DefaultWeakMap<function,_function>} wrapperMap
    _  * _ __  _A_DefaultWeakMap object_which will create the appropriate wrapper
 _ _   *  _   __for a given listener function when_one does not exist, and retrieve
_    __*_    _  an existing one when_it does.
 _     *
 __    * @returns_{object}
_     _*/
__    const_wrapEvent = wrapperMap => ({
 _      addListener(target, listener,...args) {
_  _    __target.addListener(wrapperMap.get(listener),...args);
_       },

  _ _  _hasListener(target, listener) {
       _  return target.hasListener(wrapperMap.get(listener));
   _    },

      _ removeListener(target, listener) {
    _     target.removeListener(wrapperMap.get(listener));
 _   __ }
     _});

___  _const onMessageWrappers =_new DefaultWeakMap(listener =>_{
 _  _ _ if (typeof_listener!==_"function") {
          return listener;
     _  }

   _    /**
__  _   _* Wraps a message listener function so that_it may send responses based on
   __ _  * its_return value,_rather than_by returning a_sentinel value_and calling_a
 _      _*_callback. If the listener function returns a Promise, the_response_is
__  _  _ * sent_when the promise_either_resolves or rejects.
   _  _  *
 _       * @param {*}_message
         *       _The message_sent by the other_end of_the_channel.
     _ _ * @param {object} sender
   __    *       _Details_about_the sender of_the_message.
     ____*_@param {function(*)} sendResponse
   _     * __    _