var Microsoft;
(function (Microsoft) {
    (function (VisualStudio) {
        (function (DiagnosticsHub) {
            "use strict";
            var Logger = (function () {
                function Logger() {
                    this._loggerProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.LoggerPortMarshaler", {
                    }, true);
                    var that = this;
                    try  {
                        var apex = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.Test.Apex.DiagnosticsHub.ApexJSExtension", {
                        }, true);
                        if(apex != null) {
                            apex._call("getApexJavaScript").done(function (result) {
                                if(result) {
                                    that.debug("got apex javascript files");
                                    var scriptObj = document.createElement("script");
                                    scriptObj.setAttribute("type", "text/javascript");
                                    scriptObj.setAttribute("src", result);
                                    var head = document.getElementsByTagName("head");
                                    if(!head) {
                                        that.debug("Unable to add apex script to document");
                                    } else {
                                        head[0].appendChild(scriptObj);
                                        that.debug("Added ApexJSExtension '" + result + "' to document");
                                    }
                                } else {
                                    that.debug("no file was returned by getApexJavaScript, cannot inject TestExtension.ts for ApexJS framework");
                                }
                            }, function (error) {
                                that.debug("Error when calling getApexJavaScript function:" + String(error));
                            });
                        } else {
                            that.debug("Unable to connect to port marshaler 'Microsoft.Test.Apex.DiagnosticsHub.ApexJSExtension'");
                        }
                    } catch (e) {
                        that.error(e.toString());
                    }
                }
                Logger.prototype.info = function (message) {
                    this._loggerProxy._call("logInfo", message);
                };
                Logger.prototype.debug = function (message) {
                    this._loggerProxy._call("logDebug", message);
                };
                Logger.prototype.warning = function (message) {
                    this._loggerProxy._call("logWarning", message);
                };
                Logger.prototype.error = function (message) {
                    this._loggerProxy._call("logError", message);
                };
                return Logger;
            })();            
            var _logger = null;
            function getLogger() {
                if(_logger == null) {
                    _logger = new Logger();
                }
                return _logger;
            }
            DiagnosticsHub.getLogger = getLogger;
            Plugin.addEventListener("pluginready", function () {
                getLogger();
            });
        })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {}));
        var DiagnosticsHub = VisualStudio.DiagnosticsHub;
    })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {}));
    var VisualStudio = Microsoft.VisualStudio;
})(Microsoft || (Microsoft = {}));
var Microsoft;
(function (Microsoft) {
    (function (VisualStudio) {
        (function (DiagnosticsHub) {
            "use strict";
            var RequestProgress = (function () {
                function RequestProgress() { }
                return RequestProgress;
            })();
            DiagnosticsHub.RequestProgress = RequestProgress;            
            var DiagnosticsHubNativeHost = (function () {
                function DiagnosticsHubNativeHost(logger) {
                    this._logger = logger;
                    this._externalObject = Plugin.VS.Utilities.createExternalObject("DiagnosticsHub.DataWarehouseHost", "{339B3787-FC17-4BF5-A0DC-CBEF24DB2EDE}");
                }
                DiagnosticsHubNativeHost.prototype.request = function (controllerId, actionId, sessionId, request) {
                    var that = this;
                    var completePromise;
                    var errorPromise;
                    var progressPromise;
                    var promiseInitialization = function (completed, error, progress) {
                        completePromise = completed;
                        errorPromise = error;
                        progressPromise = progress;
                    };
                    var safeInvoke = function (callback, response) {
                        try  {
                            callback(response);
                        } catch (e) {
                            that._logger.error(e.toString());
                        }
                    };
                    var result = 1;
                    if(this._externalObject != null) {
                        result = this._externalObject.request(controllerId, actionId, sessionId, (typeof request == "object") ? JSON.stringify(request) : (typeof request == "undefined") ? "" : request, function (jsonResponse) {
                            if(completePromise != null) {
                                var result = null;
                                if(jsonResponse != null) {
                                    try  {
                                        result = jsonResponse == null || jsonResponse == "" ? null : JSON.parse(jsonResponse);
                                    } catch (e) {
                                        that._logger.error("Could not parse complete response: " + jsonResponse);
                                        that._logger.error(e.toString());
                                    }
                                }
                                safeInvoke(completePromise, result);
                            } else {
                                that._logger.warning("DiagnosticsHubNativeHost: completed callback is null.");
                            }
                        }, function (jsonResponse) {
                            if(errorPromise != null) {
                                var result = null;
                                if(jsonResponse != null) {
                                    try  {
                                        result = JSON.parse(jsonResponse);
                                    } catch (e) {
                                        that._logger.error("Could not parse failed response: " + jsonResponse);
                                        that._logger.error(e.toString());
                                    }
                                }
                                safeInvoke(errorPromise, result);
                            } else {
                                that._logger.warning("DiagnosticsHubNativeHost: failed callback is null.");
                            }
                        }, function (jsonResponse) {
                            if(progressPromise != null) {
                                var result = null;
                                if(jsonResponse != null) {
                                    try  {
                                        result = JSON.parse(jsonResponse);
                                    } catch (e) {
                                        that._logger.error("Could not progress parse response: " + jsonResponse);
                                        that._logger.error(e.toString());
                                    }
                                }
                                safeInvoke(progressPromise, result);
                            } else {
                                that._logger.warning("DiagnosticsHubNativeHost: progress callback is null.");
                            }
                        });
                    } else {
                        that._logger.warning("External object is null. Verify that DiagnosticsHub.ScriptedSandboxPlugin.dll was loaded into ScriptedSandbox.");
                    }
                    if(result != 0) {
                        this._logger.error("Could not invoke request method of native host");
                        var error = new Error();
                        error.message = error.name = result.toString(16);
                        return Plugin.Promise.wrapError(error);
                    }
                    return new Plugin.Promise(promiseInitialization);
                };
                return DiagnosticsHubNativeHost;
            })();
            DiagnosticsHub.DiagnosticsHubNativeHost = DiagnosticsHubNativeHost;            
            var NativeHostController = (function () {
                function NativeHostController(sessionId, controllerId) {
                    this._sessionId = sessionId;
                    this._controllerId = controllerId;
                    this._nativeHost = getNativeHost();
                }
                NativeHostController.prototype.request = function (actionId, requestData) {
                    return this._nativeHost.request(this._controllerId, actionId, this._sessionId, requestData);
                };
                return NativeHostController;
            })();
            DiagnosticsHub.NativeHostController = NativeHostController;            
            var _host = null;
            function getNativeHost() {
                if(_host == null) {
                    _host = new DiagnosticsHubNativeHost(DiagnosticsHub.getLogger());
                }
                return _host;
            }
            DiagnosticsHub.getNativeHost = getNativeHost;
        })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {}));
        var DiagnosticsHub = VisualStudio.DiagnosticsHub;
    })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {}));
    var VisualStudio = Microsoft.VisualStudio;
})(Microsoft || (Microsoft = {}));
var Microsoft;
(function (Microsoft) {
    (function (VisualStudio) {
        (function (DiagnosticsHub) {
            "use strict";
            (function (SessionState) {
                SessionState._map = [];
                SessionState.Unknown = 0;
                SessionState.Created = 100;
                SessionState.SetupTargets = 150;
                SessionState.CollectionStarting = 200;
                SessionState.CollectionStarted = 300;
                SessionState.CollectionPausing = 325;
                SessionState.CollectionPauseCanceling = 330;
                SessionState.CollectionPaused = 350;
                SessionState.CollectionResuming = 375;
                SessionState.CollectionResumeCanceling = 380;
                SessionState.CollectionFinishing = 400;
                SessionState.CollectionFinished = 500;
                SessionState.Analyzing = 530;
                SessionState.AnalyzingFinished = 560;
                SessionState.CollectionTerminating = 600;
                SessionState.CollectionTerminated = 700;
                SessionState.CollectionStartFailed = 10000;
                SessionState.CollectionStartCanceling = 10100;
                SessionState.CollectionFinishFailed = 20000;
                SessionState.CollectionFinishCanceling = 20100;
            })(DiagnosticsHub.SessionState || (DiagnosticsHub.SessionState = {}));
            var SessionState = DiagnosticsHub.SessionState;
            var EventDeferral = (function () {
                function EventDeferral(onHandlerCompleted) {
                    this._onHandlerCompleted = onHandlerCompleted;
                }
                EventDeferral.prototype.complete = function () {
                    this._onHandlerCompleted();
                };
                return EventDeferral;
            })();            
            var StateChangedEventArgs = (function () {
                function StateChangedEventArgs(eventArgs, onHandlerCompleted) {
                    this._eventArgs = eventArgs;
                    this._waitHandler = false;
                    this._onHandlerCompleted = onHandlerCompleted;
                    this._eventDeferral = null;
                }
                Object.defineProperty(StateChangedEventArgs.prototype, "currentState", {
                    get: function () {
                        return this._eventArgs.CurrentState;
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(StateChangedEventArgs.prototype, "previousState", {
                    get: function () {
                        return this._eventArgs.PreviousState;
                    },
                    enumerable: true,
                    configurable: true
                });
                StateChangedEventArgs.prototype.getDeferral = function () {
                    if(this._eventDeferral == null) {
                        this._eventDeferral = new EventDeferral(this._onHandlerCompleted);
                    }
                    return this._eventDeferral;
                };
                Object.defineProperty(StateChangedEventArgs.prototype, "waitHandler", {
                    get: function () {
                        return this._eventDeferral != null;
                    },
                    enumerable: true,
                    configurable: true
                });
                return StateChangedEventArgs;
            })();            
            var Session = (function () {
                function Session(logger) {
                    var that = this;
                    this._eventsListeners = new Array();
                    this._logger = logger;
                    this._sessionProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.SessionPortMarshaler", {
                    }, true);
                    this._sessionProxy._call("initialize").done(function () {
                        that._logger.debug("JavaScript session object connected to host. Ready to get session state notification events.");
                    }, function (error) {
                        that._logger.error("Cannot initialize session, error name: '" + error.name + "', error message: '" + error.message + "'");
                    });
                    this._sessionProxy.addEventListener("sessionStateChanged", function (eventArgs) {
                        that.stateChangedHandler(eventArgs);
                    });
                }
                Session.prototype.getState = function (callback, onError) {
                    var that = this;
                    this._logger.debug("Calling get state");
                    return this._sessionProxy._call("getState").done(function (result) {
                        that._logger.debug("On getstate done, state value: " + result);
                        if(callback != null) {
                            callback(result);
                        }
                    }, function (error) {
                        that._logger.error("Cannot get state, error name: '" + error.name + "', error message: '" + error.message + "'");
                        if(onError != null) {
                            onError(error);
                        }
                    });
                };
                Session.prototype.addStateChangedEventListener = function (listener) {
                    this._eventsListeners.push(listener);
                    this._logger.debug('State changed event handler added.');
                };
                Session.prototype.removeStateChangedEventListener = function (listener) {
                    for(var i = 0; i < this._eventsListeners.length; i++) {
                        if(this._eventsListeners[i] == listener) {
                            this._logger.debug('State changed event handler removed.');
                            this._eventsListeners.splice(i, 1);
                            break;
                        }
                    }
                };
                Session.prototype.stateChangedHandler = function (eventArgs) {
                    var that = this;
                    this._logger.debug('Invoking JavaScript handlers for State Change Event.');
                    var handlersCount = 0;
                    var onCompleted = function () {
                        handlersCount--;
                        if(handlersCount <= 0) {
                            that._sessionProxy._call("sessionStateChangedCompleted", eventArgs.Token);
                        } else {
                            that._logger.debug("Still waiting when all event state change handlers will complete their work. Handlers count: " + handlersCount);
                        }
                    };
                    for(var propertyName in this._eventsListeners) {
                        var handler = this._eventsListeners[propertyName];
                        if(this._eventsListeners.hasOwnProperty(propertyName)) {
                            if(typeof handler == 'function') {
                                try  {
                                    var jsEventArgs = new StateChangedEventArgs(eventArgs, onCompleted);
                                    handler(jsEventArgs);
                                    if(jsEventArgs.waitHandler) {
                                        handlersCount++;
                                        that._logger.debug("JavaScipt handlers for event state changed asked to wait while they will finish. Handlers count: " + handlersCount);
                                    }
                                } catch (e) {
                                    this._logger.error(e.toString());
                                }
                            } else {
                                this._logger.warning('One of the listeners not a "function", it has type ' + (typeof handler));
                            }
                        }
                    }
                    if(handlersCount == 0) {
                        onCompleted();
                    }
                };
                return Session;
            })();            
            var _currentSession = null;
            function getCurrentSession() {
                if(_currentSession == null) {
                    _currentSession = new Session(DiagnosticsHub.getLogger());
                }
                return _currentSession;
            }
            DiagnosticsHub.getCurrentSession = getCurrentSession;
            Plugin.addEventListener("pluginready", function () {
                getCurrentSession();
            });
        })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {}));
        var DiagnosticsHub = VisualStudio.DiagnosticsHub;
    })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {}));
    var VisualStudio = Microsoft.VisualStudio;
})(Microsoft || (Microsoft = {}));
var Microsoft;
(function (Microsoft) {
    (function (VisualStudio) {
        (function (DiagnosticsHub) {
            (function (DataWarehouse) {
                "use strict";
                var DataSourceIdentity = (function () {
                    function DataSourceIdentity() { }
                    DataSourceIdentity.EtlFile = "DiagnosticsHub.Resource.EtlFile";
                    DataSourceIdentity.DiagnosticsPackage = "DiagnosticsHub.FileDataSource.DiagnosticsPackage";
                    DataSourceIdentity.Directory = "DiagnosticsHub.FileDataSource.Directory";
                    DataSourceIdentity.UnknownFile = "DiagnosticsHub.FileDataSource.UnknownFile";
                    return DataSourceIdentity;
                })();
                DataWarehouse.DataSourceIdentity = DataSourceIdentity;                
                (function (DataSourceInfoType) {
                    DataSourceInfoType._map = [];
                    DataSourceInfoType.Unknown = 0;
                    DataSourceInfoType.File = 1;
                    DataSourceInfoType.Directory = 2;
                    DataSourceInfoType.Package = 3;
                })(DataWarehouse.DataSourceInfoType || (DataWarehouse.DataSourceInfoType = {}));
                var DataSourceInfoType = DataWarehouse.DataSourceInfoType;
                var DataSourceInfo = (function () {
                    function DataSourceInfo(id, type, identity, path) {
                        this.id = id;
                        this.type = type;
                        this.identity = identity;
                        this.path = path;
                    }
                    return DataSourceInfo;
                })();
                DataWarehouse.DataSourceInfo = DataSourceInfo;                
                var DataWarehouseService = (function () {
                    function DataWarehouseService() {
                        this._serviceProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.DataWarehouseServiceMarshaler", {
                        }, true);
                        this._logger = DiagnosticsHub.getLogger();
                    }
                    DataWarehouseService.prototype.getAllDataSourceInfos = function (callback) {
                        var that = this;
                        this._serviceProxy._call("getAllDataSourceInfos").done(function (result) {
                            var infos = new Array();
                            for(var i = 0; i < result.length; i++) {
                                var dataSource = result[i];
                                if(dataSource.Type == DataSourceInfoType.File || dataSource.Type == DataSourceInfoType.Directory || dataSource.Type == DataSourceInfoType.Package) {
                                    infos.push(new DataSourceInfo(dataSource.Id, dataSource.Type, dataSource.Identity, dataSource.Path));
                                } else {
                                    that._logger.error("Unknown type of data source info type: " + dataSource.Type);
                                }
                            }
                            callback(infos);
                        });
                    };
                    return DataWarehouseService;
                })();                
                var _service = null;
                function getDataWarehouseService() {
                    if(_service == null) {
                        _service = new DataWarehouseService();
                    }
                    return _service;
                }
                DataWarehouse.getDataWarehouseService = getDataWarehouseService;
                Plugin.addEventListener("pluginready", function () {
                    getDataWarehouseService();
                });
            })(DiagnosticsHub.DataWarehouse || (DiagnosticsHub.DataWarehouse = {}));
            var DataWarehouse = DiagnosticsHub.DataWarehouse;
        })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {}));
        var DiagnosticsHub = VisualStudio.DiagnosticsHub;
    })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {}));
    var VisualStudio = Microsoft.VisualStudio;
})(Microsoft || (Microsoft = {}));
var Microsoft;
(function (Microsoft) {
    (function (VisualStudio) {
        (function (DiagnosticsHub) {
            "use strict";
            var EventAggregator = (function () {
                function EventAggregator(logger) {
                    this._eventsListeners = {
                    };
                    var that = this;
                    this._logger = logger;
                    this._eventAggregatorProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.EventAggregatorMarshaler", {
                    }, true);
                    this._eventAggregatorProxy.addEventListener("globalEventHandler", function (eventArgs) {
                        that.globalEventHandler(eventArgs);
                    });
                }
                EventAggregator.prototype.addEventListener = function (eventType, listener) {
                    if(typeof this._eventsListeners[eventType] == 'undefined') {
                        this._eventsListeners[eventType] = new Array();
                    }
                    this._eventsListeners[eventType].push(listener);
                    this._logger.debug('Event listener added.');
                };
                EventAggregator.prototype.removeEventListener = function (eventType, listener) {
                    if(typeof this._eventsListeners[eventType] != 'undefined') {
                        var subscribers = this._eventsListeners[eventType];
                        for(var i = 0; i < subscribers.length; i++) {
                            if(subscribers[i] == listener) {
                                this._logger.debug('Event listener removed.');
                                subscribers.splice(i, 1);
                                break;
                            }
                        }
                        if(subscribers.length == 0) {
                            delete this._eventsListeners[eventType];
                        }
                    }
                };
                EventAggregator.prototype.globalEventHandler = function (eventArgs) {
                    var eventType = eventArgs.EventType;
                    this._logger.debug('Handling event type ' + eventType + '.');
                    var listeners = this._eventsListeners[eventType];
                    if(typeof listeners != 'undefined') {
                        for(var propertyName in listeners) {
                            var handler = listeners[propertyName];
                            if(listeners.hasOwnProperty(propertyName)) {
                                if(typeof handler == 'function') {
                                    var dataString = eventArgs.HubEventArgs.Data;
                                    this._logger.debug('Raise handler for event type ' + eventType + ' with data ' + dataString + '.');
                                    try  {
                                        var data = null;
                                        if(dataString != null) {
                                            data = JSON.parse(dataString);
                                        }
                                        handler(data);
                                    } catch (e) {
                                        this._logger.error(e.toString());
                                    }
                                } else {
                                    this._logger.warning('One of the listeners not a "function", it has type ' + (typeof handler));
                                }
                            }
                        }
                    } else {
                        this._logger.debug('Does not have listeners for event type ' + eventType + '.');
                    }
                };
                EventAggregator.prototype.raiseEvent = function (eventType, data) {
                    var dataString = null;
                    if(data != null) {
                        dataString = JSON.stringify(data);
                    }
                    this._logger.debug('Raising event type ' + eventType + ' with data ' + dataString + '.');
                    this._eventAggregatorProxy._call("raiseEvent", eventType, dataString);
                };
                return EventAggregator;
            })();            
            var _eventAggregator = null;
            function getEventAggregator() {
                if(_eventAggregator == null) {
                    _eventAggregator = new EventAggregator(DiagnosticsHub.getLogger());
                }
                return _eventAggregator;
            }
            DiagnosticsHub.getEventAggregator = getEventAggregator;
            Plugin.addEventListener("pluginready", function () {
                getEventAggregator();
            });
        })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {}));
        var DiagnosticsHub = VisualStudio.DiagnosticsHub;
    })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {}));
    var VisualStudio = Microsoft.VisualStudio;
})(Microsoft || (Microsoft = {}));
var Microsoft;
(function (Microsoft) {
    (function (VisualStudio) {
        (function (DiagnosticsHub) {
            "use strict";
            var GraphDataUpdateService = (function () {
                function GraphDataUpdateService(logger) {
                    this._logger = logger;
                    this._serviceProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.GraphDataUpdateServiceMarshaler", {
                    }, true);
                }
                GraphDataUpdateService.prototype.addNewPoints = function (counterId, points) {
                    var that = this;
                    this._serviceProxy._call("addNewPoints", counterId, points).done(function () {
                    }, function (error) {
                        that._logger.error(error.message);
                    });
                };
                return GraphDataUpdateService;
            })();            
            var _graphDataUpdateService = null;
            function getGraphDataUpdateService() {
                if(_graphDataUpdateService == null) {
                    _graphDataUpdateService = new GraphDataUpdateService(DiagnosticsHub.getLogger());
                }
                return _graphDataUpdateService;
            }
            DiagnosticsHub.getGraphDataUpdateService = getGraphDataUpdateService;
            Plugin.addEventListener("pluginready", function () {
                getGraphDataUpdateService();
            });
        })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {}));
        var DiagnosticsHub = VisualStudio.DiagnosticsHub;
    })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {}));
    var VisualStudio = Microsoft.VisualStudio;
})(Microsoft || (Microsoft = {}));
var Microsoft;
(function (Microsoft) {
    (function (VisualStudio) {
        (function (DiagnosticsHub) {
            "use strict";
            var OutputWindowsService = (function () {
                function OutputWindowsService() {
                    this._loggerProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.OutputWindowServiceMarshaler", {
                    }, true);
                }
                OutputWindowsService.prototype.outputLine = function (message) {
                    this._loggerProxy._call("outputLine", message);
                };
                OutputWindowsService.prototype.outputLineAndShow = function (message) {
                    this._loggerProxy._call("outputLineAndShow", message);
                };
                OutputWindowsService.prototype.outputString = function (message) {
                    this._loggerProxy._call("outputString", message);
                };
                OutputWindowsService.prototype.outputStringAndShow = function (message) {
                    this._loggerProxy._call("outputStringAndShow", message);
                };
                return OutputWindowsService;
            })();            
            var _outputWindowService = null;
            function getOutputWindowsService() {
                if(_outputWindowService == null) {
                    _outputWindowService = new OutputWindowsService();
                }
                return _outputWindowService;
            }
            DiagnosticsHub.getOutputWindowsService = getOutputWindowsService;
            Plugin.addEventListener("pluginready", function () {
                getOutputWindowsService();
            });
        })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {}));
        var DiagnosticsHub = VisualStudio.DiagnosticsHub;
    })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {}));
    var VisualStudio = Microsoft.VisualStudio;
})(Microsoft || (Microsoft = {}));
var Microsoft;
(function (Microsoft) {
    (function (VisualStudio) {
        (function (DiagnosticsHub) {
            (function (Collectors) {
                "use strict";
                var StandardTransportService = (function () {
                    function StandardTransportService(logger) {
                        var that = this;
                        this._messageListeners = {
                        };
                        this._logger = logger;
                        this._proxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.StandardTransportServicePortMarshaller", {
                        }, true);
                        this._proxy.addEventListener("stringMessageReceived", function (eventArgs) {
                            that._logger.debug("StandardTransportService.stringMessageReceived");
                            that.onStringMessageReceived(eventArgs);
                        });
                    }
                    StandardTransportService.prototype.getIsRemoteConnection = function () {
                        return this._proxy._call("getIsRemoteConnection");
                    };
                    StandardTransportService.prototype.sendStringToCollectionAgent = function (agentClassId, request) {
                        this._logger.debug("StandardTransportService.sendStringToCollectionAgent");
                        return this._proxy._call("sendStringToCollectionAgent", agentClassId, request);
                    };
                    StandardTransportService.prototype.downloadFile = function (targetFilePath, localFilePath) {
                        this._logger.debug("StandardTransportService.downloadFile");
                        return this._proxy._call("downloadFile", targetFilePath, localFilePath);
                    };
                    StandardTransportService.prototype.addMessageListener = function (listenerGuid, listener) {
                        var _this = this;
                        this._logger.debug("StandardTransportService.addMessageListener(" + listenerGuid + ")");
                        if(typeof listenerGuid != "string" || (listenerGuid.length != 38 && listenerGuid.length != 36)) {
                            throw new Error("'listenerGuid' must be a Guid string");
                        }
                        if(listenerGuid.length == 38 && listenerGuid[0] == '{' && listenerGuid[37] == '}') {
                            listenerGuid = listenerGuid.substr(1, 36);
                        }
                        listenerGuid = listenerGuid.toLowerCase();
                        var lowerCaseGuidRegEx = new RegExp("^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$");
                        if(!lowerCaseGuidRegEx.test(listenerGuid)) {
                            throw new Error("'listenerGuid' must be a Guid string");
                        }
                        if(this._messageListeners[listenerGuid]) {
                            throw new Error("Listener already exists with guid = " + listenerGuid);
                        }
                        this._messageListeners[listenerGuid] = listener;
                        return this._proxy._call("enableEventsForListenerId", listenerGuid).then(null, function (value) {
                            _this._messageListeners[listenerGuid] = null;
                        });
                    };
                    StandardTransportService.prototype.onStringMessageReceived = function (eventArgs) {
                        this._logger.debug('StandardTransportService.onStringMessageReceived');
                        var listenerGuid = eventArgs.ListenerId;
                        var message = eventArgs.Message;
                        if(this._messageListeners[listenerGuid]) {
                            var listener = this._messageListeners[listenerGuid];
                            listener(message);
                        } else {
                            this._logger.warning('Unexpected message recieved without a message listener. listenerGuid=' + listenerGuid);
                        }
                    };
                    return StandardTransportService;
                })();                
                var _standardTransportService = null;
                function getStandardTransportService() {
                    if(_standardTransportService == null) {
                        _standardTransportService = new StandardTransportService(DiagnosticsHub.getLogger());
                    }
                    return _standardTransportService;
                }
                Collectors.getStandardTransportService = getStandardTransportService;
            })(DiagnosticsHub.Collectors || (DiagnosticsHub.Collectors = {}));
            var Collectors = DiagnosticsHub.Collectors;
        })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {}));
        var DiagnosticsHub = VisualStudio.DiagnosticsHub;
    })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {}));
    var VisualStudio = Microsoft.VisualStudio;
})(Microsoft || (Microsoft = {}));
var Microsoft;
(function (Microsoft) {
    (function (VisualStudio) {
        (function (DiagnosticsHub) {
            "use strict";
            var JsonTimestamp = (function () {
                function JsonTimestamp(high, low) {
                    this.isHighNegative = false;
                    this.isLowNegative = false;
                    if(!Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validate(high) || !Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validate(low)) {
                        throw new Error(Plugin.Resources.getErrorString("JSProfiler.1000"));
                    }
                    if(high < 0) {
                        high = (high >>> 0);
                        this.isHighNegative = true;
                    }
                    if(low < 0) {
                        low = (low >>> 0);
                        this.isLowNegative = true;
                    }
                    this.value = {
                        h: high,
                        l: low
                    };
                }
                JsonTimestamp._oldest = {
                    h: 0,
                    l: 0
                };
                JsonTimestamp._latest = {
                    h: 0xffffffff,
                    l: 0xffffffff
                };
                Object.defineProperty(JsonTimestamp, "Oldest", {
                    get: function () {
                        return Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp._oldest;
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(JsonTimestamp, "Latest", {
                    get: function () {
                        return Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp._latest;
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(JsonTimestamp.prototype, "JsonValue", {
                    get: function () {
                        var high = this.value.h;
                        if(this.isHighNegative || high > 0x7fffffff) {
                            high = high << 0;
                        }
                        var low = this.value.l;
                        if(this.isLowNegative || low > 0x7fffffff) {
                            low = low << 0;
                        }
                        return {
                            h: high,
                            l: low
                        };
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(JsonTimestamp.prototype, "Value", {
                    get: function () {
                        return "0x" + Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.padLeadingZeros(this.value.h.toString(16), 8) + Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.padLeadingZeros(this.value.l.toString(16), 8);
                    },
                    enumerable: true,
                    configurable: true
                });
                JsonTimestamp.prototype.equals = function (other) {
                    var isEqual = false;
                    if(Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validateTimestamp(other)) {
                        var otherTime = Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.convertToManagedTimeFormat(other.JsonValue);
                        isEqual = (this.value.h === otherTime.h && this.value.l === otherTime.l);
                    }
                    return isEqual;
                };
                JsonTimestamp.prototype.greater = function (other) {
                    var isGreater = false;
                    if(Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validateTimestamp(other)) {
                        var otherTime = Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.convertToManagedTimeFormat(other.JsonValue);
                        if(this.value.h > otherTime.h) {
                            isGreater = true;
                        } else if(this.value.h === otherTime.h) {
                            if(this.value.l > otherTime.l) {
                                isGreater = true;
                            }
                        }
                    }
                    return isGreater;
                };
                JsonTimestamp.add = function add(first, second) {
                    return Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.addition(first, second);
                };
                JsonTimestamp.subtract = function subtract(first, second) {
                    if(!Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validateTimestamp(first) || !Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validateTimestamp(second) || second.greater(first)) {
                        throw new Error(Plugin.Resources.getErrorString("JSProfiler.1000"));
                    }
                    var otherTime = Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.convertToManagedTimeFormat(second.JsonValue);
                    var negateHigh = ~(otherTime.h);
                    var negateLow = ~(otherTime.l);
                    var twosComplement = Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.addition(new Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp(negateHigh, negateLow), new Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp(0, 1), true);
                    return Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.addition(first, twosComplement, true);
                };
                JsonTimestamp.convertToManagedTimeFormat = function convertToManagedTimeFormat(time) {
                    var high = time.h < 0 ? time.h >>> 0 : time.h;
                    var low = time.l < 0 ? time.l >>> 0 : time.l;
                    return {
                        h: high,
                        l: low
                    };
                };
                JsonTimestamp.addition = function addition(first, second, ignoreOverflow) {
                    if (typeof ignoreOverflow === "undefined") { ignoreOverflow = false; }
                    if(!Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validateTimestamp(first) || !Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validateTimestamp(second)) {
                        throw new Error(Plugin.Resources.getErrorString("JSProfiler.1000"));
                    }
                    var firstTime = Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.convertToManagedTimeFormat(first.JsonValue);
                    var secondTime = Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.convertToManagedTimeFormat(second.JsonValue);
                    var low = 0;
                    var high = 0;
                    var low0 = (firstTime.l & 0xff) + (secondTime.l & 0xff);
                    var low8 = (low0 >>> 8) + ((firstTime.l >>> 8) & 0xff) + ((secondTime.l >>> 8) & 0xff);
                    low0 = low0 & 0xff;
                    var low16 = (low8 >>> 8) + ((firstTime.l >>> 16) & 0xff) + ((secondTime.l >>> 16) & 0xff);
                    low8 = low8 & 0xff;
                    var low24 = (low16 >>> 8) + ((firstTime.l >>> 24) & 0xff) + ((secondTime.l >>> 24) & 0xff);
                    low16 = low16 & 0xff;
                    var high0 = (low24 >>> 8) + (firstTime.h & 0xff) + (secondTime.h & 0xff);
                    low24 = low24 & 0xff;
                    var high8 = (high0 >>> 8) + ((firstTime.h >>> 8) & 0xff) + ((secondTime.h >>> 8) & 0xff);
                    high0 = high0 & 0xff;
                    var high16 = (high8 >>> 8) + ((firstTime.h >>> 16) & 0xff) + ((secondTime.h >>> 16) & 0xff);
                    high8 = high8 & 0xff;
                    var high24 = (high16 >>> 8) + ((firstTime.h >>> 24) & 0xff) + ((secondTime.h >>> 24) & 0xff);
                    high16 = high16 & 0xff;
                    if(!ignoreOverflow && (high24 >>> 8) > 0) {
                        return new JsonTimestamp(0xffffffff, 0xffffffff);
                    }
                    high24 = high24 & 0xff;
                    var finalLow16 = low24 << 8 | low16;
                    var finalLow0 = low8 << 8 | low0;
                    var finalHigh16 = high24 << 8 | high16;
                    var finalHigh0 = high8 << 8 | high0;
                    low = Number("0x" + Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.padLeadingZeros(finalLow16.toString(16), 4) + Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.padLeadingZeros(finalLow0.toString(16), 4));
                    high = Number("0x" + Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.padLeadingZeros(finalHigh16.toString(16), 4) + Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.padLeadingZeros(finalHigh0.toString(16), 4));
                    return new JsonTimestamp(high, low);
                };
                JsonTimestamp.padLeadingZeros = function padLeadingZeros(value, totalLength) {
                    var hex = value;
                    var zeros = "00000000";
                    if(hex && typeof totalLength !== "undefined" && totalLength !== null && totalLength > 0 && totalLength <= 8) {
                        hex = zeros.substr(0, totalLength - hex.length) + hex;
                    }
                    return hex;
                };
                JsonTimestamp.validateTimestamp = function validateTimestamp(value) {
                    return value && Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validate(value.JsonValue.h) && Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.validate(value.JsonValue.l);
                };
                JsonTimestamp.validate = function validate(value) {
                    return typeof value !== "undefined" && value !== null && value < Math.pow(2, 32) && value > -1 * Math.pow(2, 31);
                };
                return JsonTimestamp;
            })();
            DiagnosticsHub.JsonTimestamp = JsonTimestamp;            
            var JsonTimespan = (function () {
                function JsonTimespan(begin, end) {
                    if(begin.greater(end)) {
                        throw new Error(Plugin.Resources.getErrorString("JSProfiler.1000"));
                    }
                    this.begin = begin;
                    this.end = end;
                }
                Object.defineProperty(JsonTimespan.prototype, "elapsed", {
                    get: function () {
                        return Microsoft.VisualStudio.DiagnosticsHub.JsonTimestamp.subtract(this.end, this.begin);
                    },
                    enumerable: true,
                    configurable: true
                });
                return JsonTimespan;
            })();
            DiagnosticsHub.JsonTimespan = JsonTimespan;            
        })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {}));
        var DiagnosticsHub = VisualStudio.DiagnosticsHub;
    })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {}));
    var VisualStudio = Microsoft.VisualStudio;
})(Microsoft || (Microsoft = {}));
var Microsoft;
(function (Microsoft) {
    (function (VisualStudio) {
        (function (DiagnosticsHub) {
            (function (DataWarehouse) {
                "use strict";
                var Constants = (function () {
                    function Constants() { }
                    Constants.CONTROLLER_ID_DATAWAREHOUSE = 1;
                    Constants.CONTROLLER_ID_DATAWAREHOUSECONTEXTSERVICE = 2;
                    Constants.CONTROLLER_ID_DATAWAREHOUSECONTEXT = 3;
                    Constants.ACTION_DATAWAREHOUSE_INITIALIZATION = 1;
                    Constants.ACTION_DATAWAREHOUSE_GETDATA = 2;
                    Constants.ACTION_DATAWAREHOUSE_GETRESULT = 3;
                    Constants.ACTION_DATAWAREHOUSE_DISPOSERESULT = 4;
                    Constants.ACTION_DATAWAREHOUSE_CLOSE = 400;
                    Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_CREATECONTEXT = 1;
                    Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_DELETECONTEXT = 2;
                    Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_COPYCONTEXT = 3;
                    Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_GETCONTEXT = 4;
                    Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_GETGLOBALCONTEXT = 5;
                    Constants.ACTION_DATAWAREHOUSECONTEXT_GETTIMEDOMAIN = 1;
                    Constants.ACTION_DATAWAREHOUSECONTEXT_SETTIMEDOMAIN = 2;
                    Constants.ACTION_DATAWAREHOUSECONTEXT_GETMACHINEDOMAIN = 3;
                    Constants.ACTION_DATAWAREHOUSECONTEXT_ADDTOMACHINEDOMAIN = 4;
                    Constants.ACTION_DATAWAREHOUSECONTEXT_CLEARMACHINEDOMAIN = 5;
                    Constants.ACTION_DATAWAREHOUSECONTEXT_GETPROCESSDOMAIN = 6;
                    Constants.ACTION_DATAWAREHOUSECONTEXT_ADDTOPROCESSDOMAIN = 7;
                    Constants.ACTION_DATAWAREHOUSECONTEXT_CLEARPROCESSDOMAIN = 8;
                    Constants.ACTION_DATAWAREHOUSECONTEXT_GETCUSTOMDOMAIN = 9;
                    Constants.ACTION_DATAWAREHOUSECONTEXT_SETCUSTOMDOMAIN = 10;
                    return Constants;
                })();                
                var DhJsonResult = (function () {
                    function DhJsonResult(resultId, sessionId, controller) {
                        this._resultId = resultId;
                        this._sessionId = sessionId;
                        this._controller = controller;
                    }
                    DhJsonResult.prototype.getResult = function (customData) {
                        var that = this;
                        var requestObject = null;
                        if(customData !== null) {
                            requestObject = {
                                resultId: that._resultId,
                                customData: JSON.stringify(customData)
                            };
                        } else {
                            requestObject = {
                                resultId: that._resultId
                            };
                        }
                        return that._controller.request(Constants.ACTION_DATAWAREHOUSE_GETRESULT, requestObject);
                    };
                    DhJsonResult.prototype.dispose = function () {
                        var that = this;
                        return that._controller.request(Constants.ACTION_DATAWAREHOUSE_DISPOSERESULT, {
                            resultId: that._resultId
                        });
                    };
                    return DhJsonResult;
                })();                
                var DataWarehouseFactory = (function () {
                    function DataWarehouseFactory() {
                        this._serviceProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.DataWarehouseServiceMarshaler", {
                        }, true);
                        this._logger = DiagnosticsHub.getLogger();
                    }
                    DataWarehouseFactory.prototype.getDataWarehouse = function () {
                        var that = this;
                        return this._serviceProxy._call("getDataWarehouseConfiguration").then(function (configuration) {
                            that._logger.debug("Got the sessionId '" + configuration.sessionId + "'. Creating datawarehouse...");
                            return new DataWarehouseInstance(configuration);
                        });
                    };
                    return DataWarehouseFactory;
                })();                
                var DataWarehouseInstance = (function () {
                    function DataWarehouseInstance(dwConfiguration) {
                        this._logger = DiagnosticsHub.getLogger();
                        this._dwConfiguration = dwConfiguration;
                        this._controller = new DiagnosticsHub.NativeHostController(this._dwConfiguration.sessionId, Constants.CONTROLLER_ID_DATAWAREHOUSE);
                    }
                    DataWarehouseInstance.prototype.getData = function (contextId, analyzerId) {
                        var that = this;
                        var jsonRequest = null;
                        if(contextId == null) {
                            jsonRequest = {
                                analyzerId: analyzerId
                            };
                        } else {
                            jsonRequest = {
                                contextId: contextId,
                                analyzerId: analyzerId
                            };
                        }
                        return that._controller.request(Constants.ACTION_DATAWAREHOUSE_GETDATA, jsonRequest).then(function (jsonObject) {
                            return new DhJsonResult(jsonObject.resultId, that._dwConfiguration.sessionId, that._controller);
                        });
                    };
                    DataWarehouseInstance.prototype.getContextService = function () {
                        if(this._contextService == null) {
                            this._contextService = new DhContextService(this._dwConfiguration.sessionId);
                        }
                        return this._contextService;
                    };
                    DataWarehouseInstance.prototype.close = function () {
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSE_CLOSE);
                    };
                    DataWarehouseInstance.prototype.initialize = function () {
                        this._logger.debug("Initializing DataWarehouse...");
                        var jsonConfiguration = {
                            analyzers: this._dwConfiguration.analyzers,
                            dataSources: this._dwConfiguration.dataSources,
                            symbolStorePath: this._dwConfiguration.symbolStorePath,
                            symbolCachePath: this._dwConfiguration.symbolCachePath
                        };
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSE_INITIALIZATION, jsonConfiguration);
                    };
                    return DataWarehouseInstance;
                })();                
                var DhContextService = (function () {
                    function DhContextService(sessionId) {
                        this._controller = new DiagnosticsHub.NativeHostController(sessionId, Constants.CONTROLLER_ID_DATAWAREHOUSECONTEXTSERVICE);
                        this._sessionId = sessionId;
                    }
                    DhContextService.prototype.createContext = function () {
                        var that = this;
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_CREATECONTEXT).then(function (contextInfo) {
                            return new DhContext(contextInfo, that._sessionId);
                        });
                    };
                    DhContextService.prototype.deleteContext = function (contextId) {
                        var that = this;
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_DELETECONTEXT, {
                            contextId: contextId
                        });
                    };
                    DhContextService.prototype.copyContext = function (contextId) {
                        var that = this;
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_COPYCONTEXT, {
                            contextId: contextId
                        }).then(function (contextInfo) {
                            return new DhContext(contextInfo, that._sessionId);
                        });
                    };
                    DhContextService.prototype.getContext = function (contextId) {
                        var that = this;
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_GETCONTEXT, {
                            contextId: contextId
                        }).then(function (contextInfo) {
                            return new DhContext(contextInfo, that._sessionId);
                        });
                    };
                    DhContextService.prototype.getGlobalContext = function () {
                        var that = this;
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXTSERVICE_GETGLOBALCONTEXT).then(function (contextInfo) {
                            return new DhContext(contextInfo, that._sessionId);
                        });
                    };
                    return DhContextService;
                })();                
                var DhContext = (function () {
                    function DhContext(contextInfo, sessionId) {
                        this._info = contextInfo;
                        this._sessionId = sessionId;
                        this._controller = new DiagnosticsHub.NativeHostController(this._sessionId, Constants.CONTROLLER_ID_DATAWAREHOUSECONTEXT);
                    }
                    DhContext.prototype.getContextId = function () {
                        return this._info.contextId;
                    };
                    DhContext.prototype.getParentContextId = function () {
                        return this._info.parentContextId;
                    };
                    DhContext.prototype.getTimeDomain = function () {
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_GETTIMEDOMAIN, {
                            contextId: this._info.contextId
                        });
                    };
                    DhContext.prototype.setTimeDomain = function (timeDomain) {
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_SETTIMEDOMAIN, {
                            contextId: this._info.contextId,
                            timeDomain: {
                                begin: timeDomain.begin.JsonValue,
                                end: timeDomain.end.JsonValue
                            }
                        });
                    };
                    DhContext.prototype.getMachineDomain = function () {
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_GETMACHINEDOMAIN, {
                            contextId: this._info.contextId
                        });
                    };
                    DhContext.prototype.addToMachineDomain = function (machineName) {
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_ADDTOMACHINEDOMAIN, {
                            contextId: this._info.contextId,
                            machineName: machineName
                        });
                    };
                    DhContext.prototype.clearMachineDomain = function () {
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_CLEARMACHINEDOMAIN, {
                            contextId: this._info.contextId
                        });
                    };
                    DhContext.prototype.getProcessDomain = function () {
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_GETPROCESSDOMAIN, {
                            contextId: this._info.contextId
                        });
                    };
                    DhContext.prototype.addToProcessDomain = function (processId) {
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_ADDTOPROCESSDOMAIN, {
                            contextId: this._info.contextId,
                            processId: processId
                        });
                    };
                    DhContext.prototype.clearProcessDomain = function () {
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_CLEARPROCESSDOMAIN, {
                            contextId: this._info.contextId
                        });
                    };
                    DhContext.prototype.getCustomDomain = function (name) {
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_GETCUSTOMDOMAIN, {
                            contextId: this._info.contextId,
                            name: name
                        }).then(function (result) {
                            return result.value;
                        });
                    };
                    DhContext.prototype.setCustomDomain = function (name, value) {
                        return this._controller.request(Constants.ACTION_DATAWAREHOUSECONTEXT_SETCUSTOMDOMAIN, {
                            contextId: this._info.contextId,
                            name: name,
                            value: value
                        });
                    };
                    return DhContext;
                })();                
                var _dwFactory = null;
                var _dataWarehousePromise = null;
                function loadDataWarehouse() {
                    if(_dataWarehousePromise == null) {
                        if(_dwFactory == null) {
                            _dwFactory = new DataWarehouseFactory();
                        }
                        return _dataWarehousePromise = _dwFactory.getDataWarehouse();
                    }
                    return _dataWarehousePromise;
                }
                DataWarehouse.loadDataWarehouse = loadDataWarehouse;
            })(DiagnosticsHub.DataWarehouse || (DiagnosticsHub.DataWarehouse = {}));
            var DataWarehouse = DiagnosticsHub.DataWarehouse;
        })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {}));
        var DiagnosticsHub = VisualStudio.DiagnosticsHub;
    })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {}));
    var VisualStudio = Microsoft.VisualStudio;
})(Microsoft || (Microsoft = {}));
var Microsoft;
(function (Microsoft) {
    (function (VisualStudio) {
        (function (DiagnosticsHub) {
            "use strict";
            var DocumentClosingEventDeferral = (function () {
                function DocumentClosingEventDeferral(onHandlerCompleted) {
                    this._onHandlerCompleted = onHandlerCompleted;
                }
                DocumentClosingEventDeferral.prototype.complete = function (result) {
                    this._onHandlerCompleted(result);
                };
                return DocumentClosingEventDeferral;
            })();
            DiagnosticsHub.DocumentClosingEventDeferral = DocumentClosingEventDeferral;            
            var DocumentClosingEventArgs = (function () {
                function DocumentClosingEventArgs(onHandlerCompleted) {
                    this._waitHandler = false;
                    this._onHandlerCompleted = onHandlerCompleted;
                    this._eventDeferral = null;
                }
                DocumentClosingEventArgs.prototype.getDeferral = function () {
                    if(this._eventDeferral === null) {
                        this._eventDeferral = new DocumentClosingEventDeferral(this._onHandlerCompleted);
                    }
                    return this._eventDeferral;
                };
                Object.defineProperty(DocumentClosingEventArgs.prototype, "waitHandler", {
                    get: function () {
                        return this._eventDeferral != null;
                    },
                    enumerable: true,
                    configurable: true
                });
                return DocumentClosingEventArgs;
            })();
            DiagnosticsHub.DocumentClosingEventArgs = DocumentClosingEventArgs;            
            var Document = (function () {
                function Document() {
                    this._onCloseHandlers = [];
                    this._documentProxy = Plugin.Utilities.JSONMarshaler.attachToPublishedObject("Microsoft.DiagnosticsHub.VisualStudio.Presentation.JavaScriptModels.DocumentPortMarshaler", {
                    }, true);
                    this._logger = DiagnosticsHub.getLogger();
                    this._documentProxy._call("connected").then(function () {
                        this._logger.debug("JavaScript Document object connected to host. Ready to get onClosingEvent.");
                    }.bind(this), function (error) {
                        this._logger.error("Cannot connect DocumentPortMarshaler, error name: '" + error.name + "', error message: '" + error.message + "'");
                    }.bind(this)).then(function () {
                        this._documentProxy.addEventListener("onClosing", function (eventArgs) {
                            this.onClosingHandler();
                        }.bind(this));
                    }.bind(this));
                }
                Document.prototype.addOnClosingHandler = function (handler) {
                    this._onCloseHandlers.push(handler);
                    this._logger.debug('New on closing handler was added.');
                };
                Document.prototype.onClosingHandler = function () {
                    this._logger.debug('Invoking JavaScript handlers for document on closing event.');
                    var finalResult = true;
                    var handlersCount = 0;
                    var onCompleted = function (handlerResult) {
                        finalResult = finalResult && handlerResult;
                        handlersCount--;
                        if(handlersCount <= 0) {
                            this._documentProxy._call("onClosingCompleted", finalResult);
                        } else {
                            this._logger.debug("Still waiting when all on closing handlers will complete their work. Handlers count: " + handlersCount);
                        }
                    }.bind(this);
                    for(var propertyName in this._onCloseHandlers) {
                        var handler = this._onCloseHandlers[propertyName];
                        if(this._onCloseHandlers.hasOwnProperty(propertyName)) {
                            if(typeof handler === 'function') {
                                try  {
                                    var jsEventArgs = new DocumentClosingEventArgs(onCompleted);
                                    handler(jsEventArgs);
                                    if(jsEventArgs.waitHandler) {
                                        handlersCount++;
                                        this._logger.debug("JavaScipt handlers for on closing asked to wait while they will finish. Handlers count: " + handlersCount);
                                    }
                                } catch (e) {
                                    this._logger.error(e.toString());
                                }
                            } else {
                                this._logger.warning('One of the listeners not a "function", it has type ' + (typeof handler));
                            }
                        }
                    }
                    if(handlersCount == 0) {
                        onCompleted(finalResult);
                    }
                };
                return Document;
            })();            
            var _currentDocument = null;
            function getCurrentDocument() {
                if(_currentDocument == null) {
                    _currentDocument = new Document();
                }
                return _currentDocument;
            }
            DiagnosticsHub.getCurrentDocument = getCurrentDocument;
        })(VisualStudio.DiagnosticsHub || (VisualStudio.DiagnosticsHub = {}));
        var DiagnosticsHub = VisualStudio.DiagnosticsHub;
    })(Microsoft.VisualStudio || (Microsoft.VisualStudio = {}));
    var VisualStudio = Microsoft.VisualStudio;
})(Microsoft || (Microsoft = {}));

// SIG // Begin signature block
// SIG // MIIaqwYJKoZIhvcNAQcCoIIanDCCGpgCAQExCzAJBgUr
// SIG // DgMCGgUAMGcGCisGAQQBgjcCAQSgWTBXMDIGCisGAQQB
// SIG // gjcCAR4wJAIBAQQQEODJBs441BGiowAQS9NQkAIBAAIB
// SIG // AAIBAAIBAAIBADAhMAkGBSsOAwIaBQAEFC+E4IjHvlUH
// SIG // KgTuJgDOENV4s3PaoIIVgjCCBMMwggOroAMCAQICEzMA
// SIG // AAAz5SeGow5KKoAAAAAAADMwDQYJKoZIhvcNAQEFBQAw
// SIG // dzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0
// SIG // b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1p
// SIG // Y3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWlj
// SIG // cm9zb2Z0IFRpbWUtU3RhbXAgUENBMB4XDTEzMDMyNzIw
// SIG // MDgyM1oXDTE0MDYyNzIwMDgyM1owgbMxCzAJBgNVBAYT
// SIG // AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQH
// SIG // EwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29y
// SIG // cG9yYXRpb24xDTALBgNVBAsTBE1PUFIxJzAlBgNVBAsT
// SIG // Hm5DaXBoZXIgRFNFIEVTTjpGNTI4LTM3NzctOEE3NjEl
// SIG // MCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2Vy
// SIG // dmljZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
// SIG // ggEBAMreyhkPH5ZWgl/YQjLUCG22ncDC7Xw4q1gzrWuB
// SIG // ULiIIQpdr5ctkFrHwy6yTNRjdFj938WJVNALzP2chBF5
// SIG // rKMhIm0z4K7eJUBFkk4NYwgrizfdTwdq3CrPEFqPV12d
// SIG // PfoXYwLGcD67Iu1bsfcyuuRxvHn/+MvpVz90e+byfXxX
// SIG // WC+s0g6o2YjZQB86IkHiCSYCoMzlJc6MZ4PfRviFTcPa
// SIG // Zh7Hc347tHYXpqWgoHRVqOVgGEFiOMdlRqsEFmZW6vmm
// SIG // y0LPXVRkL4H4zzgADxBr4YMujT5I7ElWSuyaafTLDxD7
// SIG // BzRKYmwBjW7HIITKXNFjmR6OXewPpRZIqmveIS8CAwEA
// SIG // AaOCAQkwggEFMB0GA1UdDgQWBBQAWBs+7cXxBpO+MT02
// SIG // tKwLXTLwgTAfBgNVHSMEGDAWgBQjNPjZUkZwCu1A+3b7
// SIG // syuwwzWzDzBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8v
// SIG // Y3JsLm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0
// SIG // cy9NaWNyb3NvZnRUaW1lU3RhbXBQQ0EuY3JsMFgGCCsG
// SIG // AQUFBwEBBEwwSjBIBggrBgEFBQcwAoY8aHR0cDovL3d3
// SIG // dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNyb3Nv
// SIG // ZnRUaW1lU3RhbXBQQ0EuY3J0MBMGA1UdJQQMMAoGCCsG
// SIG // AQUFBwMIMA0GCSqGSIb3DQEBBQUAA4IBAQAC/+OMA+rv
// SIG // fji5uXyfO1KDpPojONQDuGpZtergb4gD9G9RapU6dYXo
// SIG // HNwHxU6dG6jOJEcUJE81d7GcvCd7j11P/AaLl5f5KZv3
// SIG // QB1SgY52SAN+8psXt67ZWyKRYzsyXzX7xpE8zO8OmYA+
// SIG // BpE4E3oMTL4z27/trUHGfBskfBPcCvxLiiAFHQmJkTkH
// SIG // TiFO3mx8cLur8SCO+Jh4YNyLlM9lvpaQD6CchO1ctXxB
// SIG // oGEtvUNnZRoqgtSniln3MuOj58WNsiK7kijYsIxTj2hH
// SIG // R6HYAbDxYRXEF6Et4zpsT2+vPe7eKbBEy8OSZ7oAzg+O
// SIG // Ee/RAoIxSZSYnVFIeK0d1kC2MIIE7DCCA9SgAwIBAgIT
// SIG // MwAAALARrwqL0Duf3QABAAAAsDANBgkqhkiG9w0BAQUF
// SIG // ADB5MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu
// SIG // Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMV
// SIG // TWljcm9zb2Z0IENvcnBvcmF0aW9uMSMwIQYDVQQDExpN
// SIG // aWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQTAeFw0xMzAx
// SIG // MjQyMjMzMzlaFw0xNDA0MjQyMjMzMzlaMIGDMQswCQYD
// SIG // VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G
// SIG // A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0
// SIG // IENvcnBvcmF0aW9uMQ0wCwYDVQQLEwRNT1BSMR4wHAYD
// SIG // VQQDExVNaWNyb3NvZnQgQ29ycG9yYXRpb24wggEiMA0G
// SIG // CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDor1yiIA34
// SIG // KHy8BXt/re7rdqwoUz8620B9s44z5lc/pVEVNFSlz7SL
// SIG // qT+oN+EtUO01Fk7vTXrbE3aIsCzwWVyp6+HXKXXkG4Un
// SIG // m/P4LZ5BNisLQPu+O7q5XHWTFlJLyjPFN7Dz636o9UEV
// SIG // XAhlHSE38Cy6IgsQsRCddyKFhHxPuRuQsPWj/ov0DJpO
// SIG // oPXJCiHiquMBNkf9L4JqgQP1qTXclFed+0vUDoLbOI8S
// SIG // /uPWenSIZOFixCUuKq6dGB8OHrbCryS0DlC83hyTXEmm
// SIG // ebW22875cHsoAYS4KinPv6kFBeHgD3FN/a1cI4Mp68fF
// SIG // SsjoJ4TTfsZDC5UABbFPZXHFAgMBAAGjggFgMIIBXDAT
// SIG // BgNVHSUEDDAKBggrBgEFBQcDAzAdBgNVHQ4EFgQUWXGm
// SIG // WjNN2pgHgP+EHr6H+XIyQfIwUQYDVR0RBEowSKRGMEQx
// SIG // DTALBgNVBAsTBE1PUFIxMzAxBgNVBAUTKjMxNTk1KzRm
// SIG // YWYwYjcxLWFkMzctNGFhMy1hNjcxLTc2YmMwNTIzNDRh
// SIG // ZDAfBgNVHSMEGDAWgBTLEejK0rQWWAHJNy4zFha5TJoK
// SIG // HzBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1p
// SIG // Y3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWND
// SIG // b2RTaWdQQ0FfMDgtMzEtMjAxMC5jcmwwWgYIKwYBBQUH
// SIG // AQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1p
// SIG // Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY0NvZFNpZ1BD
// SIG // QV8wOC0zMS0yMDEwLmNydDANBgkqhkiG9w0BAQUFAAOC
// SIG // AQEAMdduKhJXM4HVncbr+TrURE0Inu5e32pbt3nPApy8
// SIG // dmiekKGcC8N/oozxTbqVOfsN4OGb9F0kDxuNiBU6fNut
// SIG // zrPJbLo5LEV9JBFUJjANDf9H6gMH5eRmXSx7nR2pEPoc
// SIG // sHTyT2lrnqkkhNrtlqDfc6TvahqsS2Ke8XzAFH9IzU2y
// SIG // RPnwPJNtQtjofOYXoJtoaAko+QKX7xEDumdSrcHps3Om
// SIG // 0mPNSuI+5PNO/f+h4LsCEztdIN5VP6OukEAxOHUoXgSp
// SIG // Rm3m9Xp5QL0fzehF1a7iXT71dcfmZmNgzNWahIeNJDD3
// SIG // 7zTQYx2xQmdKDku/Og7vtpU6pzjkJZIIpohmgjCCBbww
// SIG // ggOkoAMCAQICCmEzJhoAAAAAADEwDQYJKoZIhvcNAQEF
// SIG // BQAwXzETMBEGCgmSJomT8ixkARkWA2NvbTEZMBcGCgmS
// SIG // JomT8ixkARkWCW1pY3Jvc29mdDEtMCsGA1UEAxMkTWlj
// SIG // cm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5
// SIG // MB4XDTEwMDgzMTIyMTkzMloXDTIwMDgzMTIyMjkzMlow
// SIG // eTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0
// SIG // b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1p
// SIG // Y3Jvc29mdCBDb3Jwb3JhdGlvbjEjMCEGA1UEAxMaTWlj
// SIG // cm9zb2Z0IENvZGUgU2lnbmluZyBQQ0EwggEiMA0GCSqG
// SIG // SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCycllcGTBkvx2a
// SIG // YCAgQpl2U2w+G9ZvzMvx6mv+lxYQ4N86dIMaty+gMuz/
// SIG // 3sJCTiPVcgDbNVcKicquIEn08GisTUuNpb15S3GbRwfa
// SIG // /SXfnXWIz6pzRH/XgdvzvfI2pMlcRdyvrT3gKGiXGqel
// SIG // cnNW8ReU5P01lHKg1nZfHndFg4U4FtBzWwW6Z1KNpbJp
// SIG // L9oZC/6SdCnidi9U3RQwWfjSjWL9y8lfRjFQuScT5EAw
// SIG // z3IpECgixzdOPaAyPZDNoTgGhVxOVoIoKgUyt0vXT2Pn
// SIG // 0i1i8UU956wIAPZGoZ7RW4wmU+h6qkryRs83PDietHdc
// SIG // pReejcsRj1Y8wawJXwPTAgMBAAGjggFeMIIBWjAPBgNV
// SIG // HRMBAf8EBTADAQH/MB0GA1UdDgQWBBTLEejK0rQWWAHJ
// SIG // Ny4zFha5TJoKHzALBgNVHQ8EBAMCAYYwEgYJKwYBBAGC
// SIG // NxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQU/dExTtMm
// SIG // ipXhmGA7qDFvpjy82C0wGQYJKwYBBAGCNxQCBAweCgBT
// SIG // AHUAYgBDAEEwHwYDVR0jBBgwFoAUDqyCYEBWJ5flJRP8
// SIG // KuEKU5VZ5KQwUAYDVR0fBEkwRzBFoEOgQYY/aHR0cDov
// SIG // L2NybC5taWNyb3NvZnQuY29tL3BraS9jcmwvcHJvZHVj
// SIG // dHMvbWljcm9zb2Z0cm9vdGNlcnQuY3JsMFQGCCsGAQUF
// SIG // BwEBBEgwRjBEBggrBgEFBQcwAoY4aHR0cDovL3d3dy5t
// SIG // aWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNyb3NvZnRS
// SIG // b290Q2VydC5jcnQwDQYJKoZIhvcNAQEFBQADggIBAFk5
// SIG // Pn8mRq/rb0CxMrVq6w4vbqhJ9+tfde1MOy3XQ60L/svp
// SIG // LTGjI8x8UJiAIV2sPS9MuqKoVpzjcLu4tPh5tUly9z7q
// SIG // QX/K4QwXaculnCAt+gtQxFbNLeNK0rxw56gNogOlVuC4
// SIG // iktX8pVCnPHz7+7jhh80PLhWmvBTI4UqpIIck+KUBx3y
// SIG // 4k74jKHK6BOlkU7IG9KPcpUqcW2bGvgc8FPWZ8wi/1wd
// SIG // zaKMvSeyeWNWRKJRzfnpo1hW3ZsCRUQvX/TartSCMm78
// SIG // pJUT5Otp56miLL7IKxAOZY6Z2/Wi+hImCWU4lPF6H0q7
// SIG // 0eFW6NB4lhhcyTUWX92THUmOLb6tNEQc7hAVGgBd3TVb
// SIG // Ic6YxwnuhQ6MT20OE049fClInHLR82zKwexwo1eSV32U
// SIG // jaAbSANa98+jZwp0pTbtLS8XyOZyNxL0b7E8Z4L5UrKN
// SIG // MxZlHg6K3RDeZPRvzkbU0xfpecQEtNP7LN8fip6sCvsT
// SIG // J0Ct5PnhqX9GuwdgR2VgQE6wQuxO7bN2edgKNAltHIAx
// SIG // H+IOVN3lofvlRxCtZJj/UBYufL8FIXrilUEnacOTj5XJ
// SIG // jdibIa4NXJzwoq6GaIMMai27dmsAHZat8hZ79haDJLmI
// SIG // z2qoRzEvmtzjcT3XAH5iR9HOiMm4GPoOco3Boz2vAkBq
// SIG // /2mbluIQqBC0N1AI1sM9MIIGBzCCA++gAwIBAgIKYRZo
// SIG // NAAAAAAAHDANBgkqhkiG9w0BAQUFADBfMRMwEQYKCZIm
// SIG // iZPyLGQBGRYDY29tMRkwFwYKCZImiZPyLGQBGRYJbWlj
// SIG // cm9zb2Z0MS0wKwYDVQQDEyRNaWNyb3NvZnQgUm9vdCBD
// SIG // ZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDcwNDAzMTI1
// SIG // MzA5WhcNMjEwNDAzMTMwMzA5WjB3MQswCQYDVQQGEwJV
// SIG // UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH
// SIG // UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv
// SIG // cmF0aW9uMSEwHwYDVQQDExhNaWNyb3NvZnQgVGltZS1T
// SIG // dGFtcCBQQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
// SIG // ggEKAoIBAQCfoWyx39tIkip8ay4Z4b3i48WZUSNQrc7d
// SIG // GE4kD+7Rp9FMrXQwIBHrB9VUlRVJlBtCkq6YXDAm2gBr
// SIG // 6Hu97IkHD/cOBJjwicwfyzMkh53y9GccLPx754gd6udO
// SIG // o6HBI1PKjfpFzwnQXq/QsEIEovmmbJNn1yjcRlOwhtDl
// SIG // KEYuJ6yGT1VSDOQDLPtqkJAwbofzWTCd+n7Wl7PoIZd+
// SIG // +NIT8wi3U21StEWQn0gASkdmEScpZqiX5NMGgUqi+YSn
// SIG // EUcUCYKfhO1VeP4Bmh1QCIUAEDBG7bfeI0a7xC1Un68e
// SIG // eEExd8yb3zuDk6FhArUdDbH895uyAc4iS1T/+QXDwiAL
// SIG // AgMBAAGjggGrMIIBpzAPBgNVHRMBAf8EBTADAQH/MB0G
// SIG // A1UdDgQWBBQjNPjZUkZwCu1A+3b7syuwwzWzDzALBgNV
// SIG // HQ8EBAMCAYYwEAYJKwYBBAGCNxUBBAMCAQAwgZgGA1Ud
// SIG // IwSBkDCBjYAUDqyCYEBWJ5flJRP8KuEKU5VZ5KShY6Rh
// SIG // MF8xEzARBgoJkiaJk/IsZAEZFgNjb20xGTAXBgoJkiaJ
// SIG // k/IsZAEZFgltaWNyb3NvZnQxLTArBgNVBAMTJE1pY3Jv
// SIG // c29mdCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eYIQ
// SIG // ea0WoUqgpa1Mc1j0BxMuZTBQBgNVHR8ESTBHMEWgQ6BB
// SIG // hj9odHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpL2Ny
// SIG // bC9wcm9kdWN0cy9taWNyb3NvZnRyb290Y2VydC5jcmww
// SIG // VAYIKwYBBQUHAQEESDBGMEQGCCsGAQUFBzAChjhodHRw
// SIG // Oi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpL2NlcnRzL01p
// SIG // Y3Jvc29mdFJvb3RDZXJ0LmNydDATBgNVHSUEDDAKBggr
// SIG // BgEFBQcDCDANBgkqhkiG9w0BAQUFAAOCAgEAEJeKw1wD
// SIG // RDbd6bStd9vOeVFNAbEudHFbbQwTq86+e4+4LtQSooxt
// SIG // YrhXAstOIBNQmd16QOJXu69YmhzhHQGGrLt48ovQ7DsB
// SIG // 7uK+jwoFyI1I4vBTFd1Pq5Lk541q1YDB5pTyBi+FA+mR
// SIG // KiQicPv2/OR4mS4N9wficLwYTp2OawpylbihOZxnLcVR
// SIG // DupiXD8WmIsgP+IHGjL5zDFKdjE9K3ILyOpwPf+FChPf
// SIG // wgphjvDXuBfrTot/xTUrXqO/67x9C0J71FNyIe4wyrt4
// SIG // ZVxbARcKFA7S2hSY9Ty5ZlizLS/n+YWGzFFW6J1wlGys
// SIG // OUzU9nm/qhh6YinvopspNAZ3GmLJPR5tH4LwC8csu89D
// SIG // s+X57H2146SodDW4TsVxIxImdgs8UoxxWkZDFLyzs7BN
// SIG // Z8ifQv+AeSGAnhUwZuhCEl4ayJ4iIdBD6Svpu/RIzCzU
// SIG // 2DKATCYqSCRfWupW76bemZ3KOm+9gSd0BhHudiG/m4LB
// SIG // J1S2sWo9iaF2YbRuoROmv6pH8BJv/YoybLL+31HIjCPJ
// SIG // Zr2dHYcSZAI9La9Zj7jkIeW1sMpjtHhUBdRBLlCslLCl
// SIG // eKuzoJZ1GtmShxN1Ii8yqAhuoFuMJb+g74TKIdbrHk/J
// SIG // mu5J4PcBZW+JC33Iacjmbuqnl84xKf8OxVtc2E0bodj6
// SIG // L54/LlUWa8kTo/0xggSVMIIEkQIBATCBkDB5MQswCQYD
// SIG // VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G
// SIG // A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0
// SIG // IENvcnBvcmF0aW9uMSMwIQYDVQQDExpNaWNyb3NvZnQg
// SIG // Q29kZSBTaWduaW5nIFBDQQITMwAAALARrwqL0Duf3QAB
// SIG // AAAAsDAJBgUrDgMCGgUAoIGuMBkGCSqGSIb3DQEJAzEM
// SIG // BgorBgEEAYI3AgEEMBwGCisGAQQBgjcCAQsxDjAMBgor
// SIG // BgEEAYI3AgEVMCMGCSqGSIb3DQEJBDEWBBQcYPxDA9rz
// SIG // HAsrYljVJq1wWu/RUDBOBgorBgEEAYI3AgEMMUAwPqAk
// SIG // gCIARABpAGEAZwBuAG8AcwB0AGkAYwBzAEgAdQBiAC4A
// SIG // agBzoRaAFGh0dHA6Ly9taWNyb3NvZnQuY29tMA0GCSqG
// SIG // SIb3DQEBAQUABIIBAHhyQvIX+tanztA8N/QnPOX87uAN
// SIG // 5Cr5+7Z8WlJdVu8+RhWbK4HeBWm5w5QkJ3MydfgHSNDu
// SIG // q/R4tC7iMdnJEQ79yWAstsUDVV487Hba6U5hqvoZGAGH
// SIG // fAtfzKd/l4OMqj/AjRLSxvES4V8JdS77Yz8xLorvWDfA
// SIG // DQ43wh/2nT/mKdGLzB0wp7GCvAkavcfbmvo9DeouygQh
// SIG // vMaceHq3N+djZhX3KY4HzgyXiu9tAHtAQ0BlIMAo1t1n
// SIG // 5jEbFJ6vFSVQQ9KcWdPzwlvbLmMF4CZGUOaTq9n9W8HY
// SIG // 8yY21kJylga2qecXmJGLYjd/tiJkQZNLUYKGWp7AYaTk
// SIG // S8zkKCihggIoMIICJAYJKoZIhvcNAQkGMYICFTCCAhEC
// SIG // AQEwgY4wdzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldh
// SIG // c2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNV
// SIG // BAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UE
// SIG // AxMYTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBAhMzAAAA
// SIG // M+UnhqMOSiqAAAAAAAAzMAkGBSsOAwIaBQCgXTAYBgkq
// SIG // hkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJ
// SIG // BTEPFw0xMzEwMDUwODUxMTZaMCMGCSqGSIb3DQEJBDEW
// SIG // BBSXW0c4uP6BDywwGYmZrIq7oW37QDANBgkqhkiG9w0B
// SIG // AQUFAASCAQADB3nCi/V1rVYGXrQ2xskYNZKIry90ZUrH
// SIG // u8WXmB0mpxaM9/W8765ZCM8CGehaMCo3NJpZewTOz/YW
// SIG // QZ3cqulTrdt0FwJasQ1eXBZKwRUij+bHXpTjoMsXyr84
// SIG // 4v8h3l5wp6RnDlgoymXS1Abrs07f0EwGNo4iGIKPqFn7
// SIG // 5bs9eO/LRiIEpHHbuIVV9+Y0Fy7OE8J0cXoOiFDO+N1r
// SIG // Na5VVN0FRQKPv9YtGzeBIgDKPWnimdQlXrECSCTXUSEc
// SIG // EoGd0aOgHTlr9duchA8L2NCH+i/EVdP16HCg+UJcCF5E
// SIG // TGYa7R2HoyIRpzs2YYmxMNrGbXJhcaN1AisBzujdFrkw
// SIG // End signature block
