var F12;!function(t){!function(t){!function(e){"use strict";class o{constructor(){this._sessionIdMap=new Map;this._port=toolUI.createPort("etwPort");toolUI.connect(this._port);this._onDetach=this.onDetach.bind(this);toolUI.addEventListener("detach",this._onDetach);this._rpc=new t.RPC.JsonRPCEndpoint("ETW_SERVER_0",(t,e,o)=>this.jsonRpcMethodReceive(t,e,o),(t,e)=>this.jsonRpcNotificationReceive(t,e),t=>{this._port.postMessage(t)},t=>{this._port.addEventListener("message",e=>{t(e)})});this._etwDispatch=toolUI;this._etwDispatch.addEventListener("etwmessage",t=>{const e=this._sessionIdMap.get(t.session);void 0!==e&&this.notify("etwmessage",[t.result,e])})}onDetach(){toolUI.removeEventListener("detach",this._onDetach);this.stopCollection("0")}methodCall(t,e,o,s){this._rpc.jsonRpcMethodCall(t,e,o,s)}notify(t,e){this._rpc.jsonRpcNotification(t,e)}jsonRpcMethodReceive(t,e,o){(e=e||[]).push(o);var s=this[t].apply(this,e);void 0!==s&&o(s,void 0)}jsonRpcNotificationReceive(t,e){}startSession(t,e,o,s,i){this._etwDispatch.startSession(t,e,o,(t,e)=>{this._sessionIdMap.set(t,s);var o=e?new Error(e):void 0;i&&i(t,o)})}stopSession(t,e){this._etwDispatch.stopSession(t,(t,o)=>{var s=o?new Error(o):void 0;e&&e(t,s)})}stopCollection(t,e){this._etwDispatch.stopCollection(t,(t,o)=>{var s=o?new Error(o):void 0;e&&e(t,s)})}getGraphDataUpdate(t,e,o){this._etwDispatch.getGraphDataUpdate(t,e,(t,e)=>{var s=e?new Error(e):void 0;o&&o(t,s)})}sendStringToCollectionAgent(t,e,o){this._etwDispatch.sendStringToCollectionAgent(t,e,(t,e)=>{var s=e?new Error(e):void 0;o&&o(t,s)})}}e.RemoteEtw=o}(t.ETW||(t.ETW={}))}(t.Tools||(t.Tools={}))}(F12||(F12={}));var remoteEtw=new F12.Tools.ETW.RemoteEtw;
