"use strict";
(self["webpackChunkGenesysCloudWebrtcSdk"] = self["webpackChunkGenesysCloudWebrtcSdk"] || []).push([["node_modules_gnaudio_jabra-js_browser-esm_web-hid-transport-DspR8eR9_js"],{

/***/ "./node_modules/@gnaudio/jabra-js/browser-esm/web-hid-transport-DspR8eR9.js"
/*!**********************************************************************************!*\
  !*** ./node_modules/@gnaudio/jabra-js/browser-esm/web-hid-transport-DspR8eR9.js ***!
  \**********************************************************************************/
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   WebHidTransport: () => (/* binding */ o)
/* harmony export */ });
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_promise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/promise */ "./node_modules/@babel/runtime-corejs3/core-js-stable/promise.js");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/dist/esm5/internal/Subject.js");
/* harmony import */ var _index_t1Gt7dja_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index-t1Gt7dja.js */ "./node_modules/@gnaudio/jabra-js/browser-esm/index-t1Gt7dja.js");




class o {
  constructor(r, s, i) {
    this.webHidHandler = r, this.logger = s, this.recorder = i, this.events = new rxjs__WEBPACK_IMPORTED_MODULE_1__.Subject(), this.consoleAppEvent = this.events, this.webHidConnected = !1, this.context = _index_t1Gt7dja_js__WEBPACK_IMPORTED_MODULE_2__.T.WEB_HID;
  }
  connect() {
    return this.webHidConnected ? _babel_runtime_corejs3_core_js_stable_promise__WEBPACK_IMPORTED_MODULE_0__.reject(new _index_t1Gt7dja_js__WEBPACK_IMPORTED_MODULE_2__.J("Already connected", _index_t1Gt7dja_js__WEBPACK_IMPORTED_MODULE_2__.E.UNEXPECTED_ERROR)) : (this.webHidHandler.events.subscribe(e => {
      var t;
      let r = e;
      this.recorder && (r = null === (t = this.recorder) || void 0 === t ? void 0 : t.recordInput(r)), this.events.next(r);
    }), this.webHidHandler.start(), this.webHidConnected = !0, _babel_runtime_corejs3_core_js_stable_promise__WEBPACK_IMPORTED_MODULE_0__.resolve());
  }
  writeAction(e) {
    var t;
    if (!this.webHidConnected) {
      const e = "WebHID is uninitialized.";
      throw (0,_index_t1Gt7dja_js__WEBPACK_IMPORTED_MODULE_2__.l)(e, this.logger, _index_t1Gt7dja_js__WEBPACK_IMPORTED_MODULE_2__.L.ERROR), new _index_t1Gt7dja_js__WEBPACK_IMPORTED_MODULE_2__.J(e, _index_t1Gt7dja_js__WEBPACK_IMPORTED_MODULE_2__.E.INIT_ERROR);
    }
    return null === (t = this.recorder) || void 0 === t || t.recordOutput(e), this.webHidHandler.sendMessage(e);
  }
}


/***/ }

}]);
//# sourceMappingURL=node_modules_gnaudio_jabra-js_browser-esm_web-hid-transport-DspR8eR9_js.genesys-cloud-webrtc-sdk.bundle.js.map