{"version":3,"file":"webrtc.min.js","sources":["../../node_modules/.pnpm/webrtc-adapter@8.2.2/node_modules/webrtc-adapter/dist/utils.js","../../node_modules/.pnpm/webrtc-adapter@8.2.2/node_modules/webrtc-adapter/dist/chrome/getusermedia.js","../../node_modules/.pnpm/webrtc-adapter@8.2.2/node_modules/webrtc-adapter/dist/chrome/getdisplaymedia.js","../../node_modules/.pnpm/webrtc-adapter@8.2.2/node_modules/webrtc-adapter/dist/chrome/chrome_shim.js","../../node_modules/.pnpm/webrtc-adapter@8.2.2/node_modules/webrtc-adapter/dist/firefox/getusermedia.js","../../node_modules/.pnpm/webrtc-adapter@8.2.2/node_modules/webrtc-adapter/dist/firefox/getdisplaymedia.js","../../node_modules/.pnpm/webrtc-adapter@8.2.2/node_modules/webrtc-adapter/dist/firefox/firefox_shim.js","../../node_modules/.pnpm/webrtc-adapter@8.2.2/node_modules/webrtc-adapter/dist/safari/safari_shim.js","../../node_modules/.pnpm/sdp@3.2.0/node_modules/sdp/dist/sdp.js","../../node_modules/.pnpm/webrtc-adapter@8.2.2/node_modules/webrtc-adapter/dist/common_shim.js","../../node_modules/.pnpm/webrtc-adapter@8.2.2/node_modules/webrtc-adapter/dist/adapter_factory.js","../../node_modules/.pnpm/webrtc-adapter@8.2.2/node_modules/webrtc-adapter/dist/adapter_core.js","../src/enums.ts","../src/utils.ts","../src/logger.ts","../src/WebRTCConnection.ts","../src/SignalController/index.ts","../src/SignalController/GbsSignalController.ts","../src/preferCodecs.ts","../src/SignalController/TencentSignalController.ts","../src/index.ts","../src/webrtc.ts"],"sourcesContent":["/*\n *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n *\n *  Use of this source code is governed by a BSD-style license\n *  that can be found in the LICENSE file in the root of the source\n *  tree.\n */\n/* eslint-env node */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.compactObject = compactObject;\nexports.deprecated = deprecated;\nexports.detectBrowser = detectBrowser;\nexports.disableLog = disableLog;\nexports.disableWarnings = disableWarnings;\nexports.extractVersion = extractVersion;\nexports.filterStats = filterStats;\nexports.log = log;\nexports.walkStats = walkStats;\nexports.wrapPeerConnectionEvent = wrapPeerConnectionEvent;\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar logDisabled_ = true;\nvar deprecationWarnings_ = true;\n\n/**\n * Extract browser version out of the provided user agent string.\n *\n * @param {!string} uastring userAgent string.\n * @param {!string} expr Regular expression used as match criteria.\n * @param {!number} pos position in the version string to be returned.\n * @return {!number} browser version.\n */\nfunction extractVersion(uastring, expr, pos) {\n  var match = uastring.match(expr);\n  return match && match.length >= pos && parseInt(match[pos], 10);\n}\n\n// Wraps the peerconnection event eventNameToWrap in a function\n// which returns the modified event object (or false to prevent\n// the event).\nfunction wrapPeerConnectionEvent(window, eventNameToWrap, wrapper) {\n  if (!window.RTCPeerConnection) {\n    return;\n  }\n  var proto = window.RTCPeerConnection.prototype;\n  var nativeAddEventListener = proto.addEventListener;\n  proto.addEventListener = function (nativeEventName, cb) {\n    if (nativeEventName !== eventNameToWrap) {\n      return nativeAddEventListener.apply(this, arguments);\n    }\n    var wrappedCallback = function wrappedCallback(e) {\n      var modifiedEvent = wrapper(e);\n      if (modifiedEvent) {\n        if (cb.handleEvent) {\n          cb.handleEvent(modifiedEvent);\n        } else {\n          cb(modifiedEvent);\n        }\n      }\n    };\n    this._eventMap = this._eventMap || {};\n    if (!this._eventMap[eventNameToWrap]) {\n      this._eventMap[eventNameToWrap] = new Map();\n    }\n    this._eventMap[eventNameToWrap].set(cb, wrappedCallback);\n    return nativeAddEventListener.apply(this, [nativeEventName, wrappedCallback]);\n  };\n  var nativeRemoveEventListener = proto.removeEventListener;\n  proto.removeEventListener = function (nativeEventName, cb) {\n    if (nativeEventName !== eventNameToWrap || !this._eventMap || !this._eventMap[eventNameToWrap]) {\n      return nativeRemoveEventListener.apply(this, arguments);\n    }\n    if (!this._eventMap[eventNameToWrap].has(cb)) {\n      return nativeRemoveEventListener.apply(this, arguments);\n    }\n    var unwrappedCb = this._eventMap[eventNameToWrap].get(cb);\n    this._eventMap[eventNameToWrap][\"delete\"](cb);\n    if (this._eventMap[eventNameToWrap].size === 0) {\n      delete this._eventMap[eventNameToWrap];\n    }\n    if (Object.keys(this._eventMap).length === 0) {\n      delete this._eventMap;\n    }\n    return nativeRemoveEventListener.apply(this, [nativeEventName, unwrappedCb]);\n  };\n  Object.defineProperty(proto, 'on' + eventNameToWrap, {\n    get: function get() {\n      return this['_on' + eventNameToWrap];\n    },\n    set: function set(cb) {\n      if (this['_on' + eventNameToWrap]) {\n        this.removeEventListener(eventNameToWrap, this['_on' + eventNameToWrap]);\n        delete this['_on' + eventNameToWrap];\n      }\n      if (cb) {\n        this.addEventListener(eventNameToWrap, this['_on' + eventNameToWrap] = cb);\n      }\n    },\n    enumerable: true,\n    configurable: true\n  });\n}\nfunction disableLog(bool) {\n  if (typeof bool !== 'boolean') {\n    return new Error('Argument type: ' + _typeof(bool) + '. Please use a boolean.');\n  }\n  logDisabled_ = bool;\n  return bool ? 'adapter.js logging disabled' : 'adapter.js logging enabled';\n}\n\n/**\n * Disable or enable deprecation warnings\n * @param {!boolean} bool set to true to disable warnings.\n */\nfunction disableWarnings(bool) {\n  if (typeof bool !== 'boolean') {\n    return new Error('Argument type: ' + _typeof(bool) + '. Please use a boolean.');\n  }\n  deprecationWarnings_ = !bool;\n  return 'adapter.js deprecation warnings ' + (bool ? 'disabled' : 'enabled');\n}\nfunction log() {\n  if ((typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === 'object') {\n    if (logDisabled_) {\n      return;\n    }\n    if (typeof console !== 'undefined' && typeof console.log === 'function') {\n      console.log.apply(console, arguments);\n    }\n  }\n}\n\n/**\n * Shows a deprecation warning suggesting the modern and spec-compatible API.\n */\nfunction deprecated(oldMethod, newMethod) {\n  if (!deprecationWarnings_) {\n    return;\n  }\n  console.warn(oldMethod + ' is deprecated, please use ' + newMethod + ' instead.');\n}\n\n/**\n * Browser detector.\n *\n * @return {object} result containing browser and version\n *     properties.\n */\nfunction detectBrowser(window) {\n  // Returned result object.\n  var result = {\n    browser: null,\n    version: null\n  };\n\n  // Fail early if it's not a browser\n  if (typeof window === 'undefined' || !window.navigator) {\n    result.browser = 'Not a browser.';\n    return result;\n  }\n  var navigator = window.navigator;\n  if (navigator.mozGetUserMedia) {\n    // Firefox.\n    result.browser = 'firefox';\n    result.version = extractVersion(navigator.userAgent, /Firefox\\/(\\d+)\\./, 1);\n  } else if (navigator.webkitGetUserMedia || window.isSecureContext === false && window.webkitRTCPeerConnection) {\n    // Chrome, Chromium, Webview, Opera.\n    // Version matches Chrome/WebRTC version.\n    // Chrome 74 removed webkitGetUserMedia on http as well so we need the\n    // more complicated fallback to webkitRTCPeerConnection.\n    result.browser = 'chrome';\n    result.version = extractVersion(navigator.userAgent, /Chrom(e|ium)\\/(\\d+)\\./, 2);\n  } else if (window.RTCPeerConnection && navigator.userAgent.match(/AppleWebKit\\/(\\d+)\\./)) {\n    // Safari.\n    result.browser = 'safari';\n    result.version = extractVersion(navigator.userAgent, /AppleWebKit\\/(\\d+)\\./, 1);\n    result.supportsUnifiedPlan = window.RTCRtpTransceiver && 'currentDirection' in window.RTCRtpTransceiver.prototype;\n  } else {\n    // Default fallthrough: not supported.\n    result.browser = 'Not a supported browser.';\n    return result;\n  }\n  return result;\n}\n\n/**\n * Checks if something is an object.\n *\n * @param {*} val The something you want to check.\n * @return true if val is an object, false otherwise.\n */\nfunction isObject(val) {\n  return Object.prototype.toString.call(val) === '[object Object]';\n}\n\n/**\n * Remove all empty objects and undefined values\n * from a nested object -- an enhanced and vanilla version\n * of Lodash's `compact`.\n */\nfunction compactObject(data) {\n  if (!isObject(data)) {\n    return data;\n  }\n  return Object.keys(data).reduce(function (accumulator, key) {\n    var isObj = isObject(data[key]);\n    var value = isObj ? compactObject(data[key]) : data[key];\n    var isEmptyObject = isObj && !Object.keys(value).length;\n    if (value === undefined || isEmptyObject) {\n      return accumulator;\n    }\n    return Object.assign(accumulator, _defineProperty({}, key, value));\n  }, {});\n}\n\n/* iterates the stats graph recursively. */\nfunction walkStats(stats, base, resultSet) {\n  if (!base || resultSet.has(base.id)) {\n    return;\n  }\n  resultSet.set(base.id, base);\n  Object.keys(base).forEach(function (name) {\n    if (name.endsWith('Id')) {\n      walkStats(stats, stats.get(base[name]), resultSet);\n    } else if (name.endsWith('Ids')) {\n      base[name].forEach(function (id) {\n        walkStats(stats, stats.get(id), resultSet);\n      });\n    }\n  });\n}\n\n/* filter getStats for a sender/receiver track. */\nfunction filterStats(result, track, outbound) {\n  var streamStatsType = outbound ? 'outbound-rtp' : 'inbound-rtp';\n  var filteredResult = new Map();\n  if (track === null) {\n    return filteredResult;\n  }\n  var trackStats = [];\n  result.forEach(function (value) {\n    if (value.type === 'track' && value.trackIdentifier === track.id) {\n      trackStats.push(value);\n    }\n  });\n  trackStats.forEach(function (trackStat) {\n    result.forEach(function (stats) {\n      if (stats.type === streamStatsType && stats.trackId === trackStat.id) {\n        walkStats(result, stats, filteredResult);\n      }\n    });\n  });\n  return filteredResult;\n}\n","/*\n *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n *\n *  Use of this source code is governed by a BSD-style license\n *  that can be found in the LICENSE file in the root of the source\n *  tree.\n */\n/* eslint-env node */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.shimGetUserMedia = shimGetUserMedia;\nvar utils = _interopRequireWildcard(require(\"../utils.js\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar logging = utils.log;\nfunction shimGetUserMedia(window, browserDetails) {\n  var navigator = window && window.navigator;\n  if (!navigator.mediaDevices) {\n    return;\n  }\n  var constraintsToChrome_ = function constraintsToChrome_(c) {\n    if (_typeof(c) !== 'object' || c.mandatory || c.optional) {\n      return c;\n    }\n    var cc = {};\n    Object.keys(c).forEach(function (key) {\n      if (key === 'require' || key === 'advanced' || key === 'mediaSource') {\n        return;\n      }\n      var r = _typeof(c[key]) === 'object' ? c[key] : {\n        ideal: c[key]\n      };\n      if (r.exact !== undefined && typeof r.exact === 'number') {\n        r.min = r.max = r.exact;\n      }\n      var oldname_ = function oldname_(prefix, name) {\n        if (prefix) {\n          return prefix + name.charAt(0).toUpperCase() + name.slice(1);\n        }\n        return name === 'deviceId' ? 'sourceId' : name;\n      };\n      if (r.ideal !== undefined) {\n        cc.optional = cc.optional || [];\n        var oc = {};\n        if (typeof r.ideal === 'number') {\n          oc[oldname_('min', key)] = r.ideal;\n          cc.optional.push(oc);\n          oc = {};\n          oc[oldname_('max', key)] = r.ideal;\n          cc.optional.push(oc);\n        } else {\n          oc[oldname_('', key)] = r.ideal;\n          cc.optional.push(oc);\n        }\n      }\n      if (r.exact !== undefined && typeof r.exact !== 'number') {\n        cc.mandatory = cc.mandatory || {};\n        cc.mandatory[oldname_('', key)] = r.exact;\n      } else {\n        ['min', 'max'].forEach(function (mix) {\n          if (r[mix] !== undefined) {\n            cc.mandatory = cc.mandatory || {};\n            cc.mandatory[oldname_(mix, key)] = r[mix];\n          }\n        });\n      }\n    });\n    if (c.advanced) {\n      cc.optional = (cc.optional || []).concat(c.advanced);\n    }\n    return cc;\n  };\n  var shimConstraints_ = function shimConstraints_(constraints, func) {\n    if (browserDetails.version >= 61) {\n      return func(constraints);\n    }\n    constraints = JSON.parse(JSON.stringify(constraints));\n    if (constraints && _typeof(constraints.audio) === 'object') {\n      var remap = function remap(obj, a, b) {\n        if (a in obj && !(b in obj)) {\n          obj[b] = obj[a];\n          delete obj[a];\n        }\n      };\n      constraints = JSON.parse(JSON.stringify(constraints));\n      remap(constraints.audio, 'autoGainControl', 'googAutoGainControl');\n      remap(constraints.audio, 'noiseSuppression', 'googNoiseSuppression');\n      constraints.audio = constraintsToChrome_(constraints.audio);\n    }\n    if (constraints && _typeof(constraints.video) === 'object') {\n      // Shim facingMode for mobile & surface pro.\n      var face = constraints.video.facingMode;\n      face = face && (_typeof(face) === 'object' ? face : {\n        ideal: face\n      });\n      var getSupportedFacingModeLies = browserDetails.version < 66;\n      if (face && (face.exact === 'user' || face.exact === 'environment' || face.ideal === 'user' || face.ideal === 'environment') && !(navigator.mediaDevices.getSupportedConstraints && navigator.mediaDevices.getSupportedConstraints().facingMode && !getSupportedFacingModeLies)) {\n        delete constraints.video.facingMode;\n        var matches;\n        if (face.exact === 'environment' || face.ideal === 'environment') {\n          matches = ['back', 'rear'];\n        } else if (face.exact === 'user' || face.ideal === 'user') {\n          matches = ['front'];\n        }\n        if (matches) {\n          // Look for matches in label, or use last cam for back (typical).\n          return navigator.mediaDevices.enumerateDevices().then(function (devices) {\n            devices = devices.filter(function (d) {\n              return d.kind === 'videoinput';\n            });\n            var dev = devices.find(function (d) {\n              return matches.some(function (match) {\n                return d.label.toLowerCase().includes(match);\n              });\n            });\n            if (!dev && devices.length && matches.includes('back')) {\n              dev = devices[devices.length - 1]; // more likely the back cam\n            }\n\n            if (dev) {\n              constraints.video.deviceId = face.exact ? {\n                exact: dev.deviceId\n              } : {\n                ideal: dev.deviceId\n              };\n            }\n            constraints.video = constraintsToChrome_(constraints.video);\n            logging('chrome: ' + JSON.stringify(constraints));\n            return func(constraints);\n          });\n        }\n      }\n      constraints.video = constraintsToChrome_(constraints.video);\n    }\n    logging('chrome: ' + JSON.stringify(constraints));\n    return func(constraints);\n  };\n  var shimError_ = function shimError_(e) {\n    if (browserDetails.version >= 64) {\n      return e;\n    }\n    return {\n      name: {\n        PermissionDeniedError: 'NotAllowedError',\n        PermissionDismissedError: 'NotAllowedError',\n        InvalidStateError: 'NotAllowedError',\n        DevicesNotFoundError: 'NotFoundError',\n        ConstraintNotSatisfiedError: 'OverconstrainedError',\n        TrackStartError: 'NotReadableError',\n        MediaDeviceFailedDueToShutdown: 'NotAllowedError',\n        MediaDeviceKillSwitchOn: 'NotAllowedError',\n        TabCaptureError: 'AbortError',\n        ScreenCaptureError: 'AbortError',\n        DeviceCaptureError: 'AbortError'\n      }[e.name] || e.name,\n      message: e.message,\n      constraint: e.constraint || e.constraintName,\n      toString: function toString() {\n        return this.name + (this.message && ': ') + this.message;\n      }\n    };\n  };\n  var getUserMedia_ = function getUserMedia_(constraints, onSuccess, onError) {\n    shimConstraints_(constraints, function (c) {\n      navigator.webkitGetUserMedia(c, onSuccess, function (e) {\n        if (onError) {\n          onError(shimError_(e));\n        }\n      });\n    });\n  };\n  navigator.getUserMedia = getUserMedia_.bind(navigator);\n\n  // Even though Chrome 45 has navigator.mediaDevices and a getUserMedia\n  // function which returns a Promise, it does not accept spec-style\n  // constraints.\n  if (navigator.mediaDevices.getUserMedia) {\n    var origGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);\n    navigator.mediaDevices.getUserMedia = function (cs) {\n      return shimConstraints_(cs, function (c) {\n        return origGetUserMedia(c).then(function (stream) {\n          if (c.audio && !stream.getAudioTracks().length || c.video && !stream.getVideoTracks().length) {\n            stream.getTracks().forEach(function (track) {\n              track.stop();\n            });\n            throw new DOMException('', 'NotFoundError');\n          }\n          return stream;\n        }, function (e) {\n          return Promise.reject(shimError_(e));\n        });\n      });\n    };\n  }\n}\n","/*\n *  Copyright (c) 2018 The adapter.js project authors. All Rights Reserved.\n *\n *  Use of this source code is governed by a BSD-style license\n *  that can be found in the LICENSE file in the root of the source\n *  tree.\n */\n/* eslint-env node */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.shimGetDisplayMedia = shimGetDisplayMedia;\nfunction shimGetDisplayMedia(window, getSourceId) {\n  if (window.navigator.mediaDevices && 'getDisplayMedia' in window.navigator.mediaDevices) {\n    return;\n  }\n  if (!window.navigator.mediaDevices) {\n    return;\n  }\n  // getSourceId is a function that returns a promise resolving with\n  // the sourceId of the screen/window/tab to be shared.\n  if (typeof getSourceId !== 'function') {\n    console.error('shimGetDisplayMedia: getSourceId argument is not ' + 'a function');\n    return;\n  }\n  window.navigator.mediaDevices.getDisplayMedia = function getDisplayMedia(constraints) {\n    return getSourceId(constraints).then(function (sourceId) {\n      var widthSpecified = constraints.video && constraints.video.width;\n      var heightSpecified = constraints.video && constraints.video.height;\n      var frameRateSpecified = constraints.video && constraints.video.frameRate;\n      constraints.video = {\n        mandatory: {\n          chromeMediaSource: 'desktop',\n          chromeMediaSourceId: sourceId,\n          maxFrameRate: frameRateSpecified || 3\n        }\n      };\n      if (widthSpecified) {\n        constraints.video.mandatory.maxWidth = widthSpecified;\n      }\n      if (heightSpecified) {\n        constraints.video.mandatory.maxHeight = heightSpecified;\n      }\n      return window.navigator.mediaDevices.getUserMedia(constraints);\n    });\n  };\n}\n","/*\n *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n *\n *  Use of this source code is governed by a BSD-style license\n *  that can be found in the LICENSE file in the root of the source\n *  tree.\n */\n/* eslint-env node */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.fixNegotiationNeeded = fixNegotiationNeeded;\nexports.shimAddTrackRemoveTrack = shimAddTrackRemoveTrack;\nexports.shimAddTrackRemoveTrackWithNative = shimAddTrackRemoveTrackWithNative;\nObject.defineProperty(exports, \"shimGetDisplayMedia\", {\n  enumerable: true,\n  get: function get() {\n    return _getdisplaymedia.shimGetDisplayMedia;\n  }\n});\nexports.shimGetSendersWithDtmf = shimGetSendersWithDtmf;\nexports.shimGetStats = shimGetStats;\nObject.defineProperty(exports, \"shimGetUserMedia\", {\n  enumerable: true,\n  get: function get() {\n    return _getusermedia.shimGetUserMedia;\n  }\n});\nexports.shimMediaStream = shimMediaStream;\nexports.shimOnTrack = shimOnTrack;\nexports.shimPeerConnection = shimPeerConnection;\nexports.shimSenderReceiverGetStats = shimSenderReceiverGetStats;\nvar utils = _interopRequireWildcard(require(\"../utils.js\"));\nvar _getusermedia = require(\"./getusermedia\");\nvar _getdisplaymedia = require(\"./getdisplaymedia\");\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction shimMediaStream(window) {\n  window.MediaStream = window.MediaStream || window.webkitMediaStream;\n}\nfunction shimOnTrack(window) {\n  if (_typeof(window) === 'object' && window.RTCPeerConnection && !('ontrack' in window.RTCPeerConnection.prototype)) {\n    Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {\n      get: function get() {\n        return this._ontrack;\n      },\n      set: function set(f) {\n        if (this._ontrack) {\n          this.removeEventListener('track', this._ontrack);\n        }\n        this.addEventListener('track', this._ontrack = f);\n      },\n      enumerable: true,\n      configurable: true\n    });\n    var origSetRemoteDescription = window.RTCPeerConnection.prototype.setRemoteDescription;\n    window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() {\n      var _this = this;\n      if (!this._ontrackpoly) {\n        this._ontrackpoly = function (e) {\n          // onaddstream does not fire when a track is added to an existing\n          // stream. But stream.onaddtrack is implemented so we use that.\n          e.stream.addEventListener('addtrack', function (te) {\n            var receiver;\n            if (window.RTCPeerConnection.prototype.getReceivers) {\n              receiver = _this.getReceivers().find(function (r) {\n                return r.track && r.track.id === te.track.id;\n              });\n            } else {\n              receiver = {\n                track: te.track\n              };\n            }\n            var event = new Event('track');\n            event.track = te.track;\n            event.receiver = receiver;\n            event.transceiver = {\n              receiver: receiver\n            };\n            event.streams = [e.stream];\n            _this.dispatchEvent(event);\n          });\n          e.stream.getTracks().forEach(function (track) {\n            var receiver;\n            if (window.RTCPeerConnection.prototype.getReceivers) {\n              receiver = _this.getReceivers().find(function (r) {\n                return r.track && r.track.id === track.id;\n              });\n            } else {\n              receiver = {\n                track: track\n              };\n            }\n            var event = new Event('track');\n            event.track = track;\n            event.receiver = receiver;\n            event.transceiver = {\n              receiver: receiver\n            };\n            event.streams = [e.stream];\n            _this.dispatchEvent(event);\n          });\n        };\n        this.addEventListener('addstream', this._ontrackpoly);\n      }\n      return origSetRemoteDescription.apply(this, arguments);\n    };\n  } else {\n    // even if RTCRtpTransceiver is in window, it is only used and\n    // emitted in unified-plan. Unfortunately this means we need\n    // to unconditionally wrap the event.\n    utils.wrapPeerConnectionEvent(window, 'track', function (e) {\n      if (!e.transceiver) {\n        Object.defineProperty(e, 'transceiver', {\n          value: {\n            receiver: e.receiver\n          }\n        });\n      }\n      return e;\n    });\n  }\n}\nfunction shimGetSendersWithDtmf(window) {\n  // Overrides addTrack/removeTrack, depends on shimAddTrackRemoveTrack.\n  if (_typeof(window) === 'object' && window.RTCPeerConnection && !('getSenders' in window.RTCPeerConnection.prototype) && 'createDTMFSender' in window.RTCPeerConnection.prototype) {\n    var shimSenderWithDtmf = function shimSenderWithDtmf(pc, track) {\n      return {\n        track: track,\n        get dtmf() {\n          if (this._dtmf === undefined) {\n            if (track.kind === 'audio') {\n              this._dtmf = pc.createDTMFSender(track);\n            } else {\n              this._dtmf = null;\n            }\n          }\n          return this._dtmf;\n        },\n        _pc: pc\n      };\n    };\n\n    // augment addTrack when getSenders is not available.\n    if (!window.RTCPeerConnection.prototype.getSenders) {\n      window.RTCPeerConnection.prototype.getSenders = function getSenders() {\n        this._senders = this._senders || [];\n        return this._senders.slice(); // return a copy of the internal state.\n      };\n\n      var origAddTrack = window.RTCPeerConnection.prototype.addTrack;\n      window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) {\n        var sender = origAddTrack.apply(this, arguments);\n        if (!sender) {\n          sender = shimSenderWithDtmf(this, track);\n          this._senders.push(sender);\n        }\n        return sender;\n      };\n      var origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack;\n      window.RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) {\n        origRemoveTrack.apply(this, arguments);\n        var idx = this._senders.indexOf(sender);\n        if (idx !== -1) {\n          this._senders.splice(idx, 1);\n        }\n      };\n    }\n    var origAddStream = window.RTCPeerConnection.prototype.addStream;\n    window.RTCPeerConnection.prototype.addStream = function addStream(stream) {\n      var _this2 = this;\n      this._senders = this._senders || [];\n      origAddStream.apply(this, [stream]);\n      stream.getTracks().forEach(function (track) {\n        _this2._senders.push(shimSenderWithDtmf(_this2, track));\n      });\n    };\n    var origRemoveStream = window.RTCPeerConnection.prototype.removeStream;\n    window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) {\n      var _this3 = this;\n      this._senders = this._senders || [];\n      origRemoveStream.apply(this, [stream]);\n      stream.getTracks().forEach(function (track) {\n        var sender = _this3._senders.find(function (s) {\n          return s.track === track;\n        });\n        if (sender) {\n          // remove sender\n          _this3._senders.splice(_this3._senders.indexOf(sender), 1);\n        }\n      });\n    };\n  } else if (_typeof(window) === 'object' && window.RTCPeerConnection && 'getSenders' in window.RTCPeerConnection.prototype && 'createDTMFSender' in window.RTCPeerConnection.prototype && window.RTCRtpSender && !('dtmf' in window.RTCRtpSender.prototype)) {\n    var origGetSenders = window.RTCPeerConnection.prototype.getSenders;\n    window.RTCPeerConnection.prototype.getSenders = function getSenders() {\n      var _this4 = this;\n      var senders = origGetSenders.apply(this, []);\n      senders.forEach(function (sender) {\n        return sender._pc = _this4;\n      });\n      return senders;\n    };\n    Object.defineProperty(window.RTCRtpSender.prototype, 'dtmf', {\n      get: function get() {\n        if (this._dtmf === undefined) {\n          if (this.track.kind === 'audio') {\n            this._dtmf = this._pc.createDTMFSender(this.track);\n          } else {\n            this._dtmf = null;\n          }\n        }\n        return this._dtmf;\n      }\n    });\n  }\n}\nfunction shimGetStats(window) {\n  if (!window.RTCPeerConnection) {\n    return;\n  }\n  var origGetStats = window.RTCPeerConnection.prototype.getStats;\n  window.RTCPeerConnection.prototype.getStats = function getStats() {\n    var _this5 = this;\n    var _arguments = Array.prototype.slice.call(arguments),\n      selector = _arguments[0],\n      onSucc = _arguments[1],\n      onErr = _arguments[2];\n\n    // If selector is a function then we are in the old style stats so just\n    // pass back the original getStats format to avoid breaking old users.\n    if (arguments.length > 0 && typeof selector === 'function') {\n      return origGetStats.apply(this, arguments);\n    }\n\n    // When spec-style getStats is supported, return those when called with\n    // either no arguments or the selector argument is null.\n    if (origGetStats.length === 0 && (arguments.length === 0 || typeof selector !== 'function')) {\n      return origGetStats.apply(this, []);\n    }\n    var fixChromeStats_ = function fixChromeStats_(response) {\n      var standardReport = {};\n      var reports = response.result();\n      reports.forEach(function (report) {\n        var standardStats = {\n          id: report.id,\n          timestamp: report.timestamp,\n          type: {\n            localcandidate: 'local-candidate',\n            remotecandidate: 'remote-candidate'\n          }[report.type] || report.type\n        };\n        report.names().forEach(function (name) {\n          standardStats[name] = report.stat(name);\n        });\n        standardReport[standardStats.id] = standardStats;\n      });\n      return standardReport;\n    };\n\n    // shim getStats with maplike support\n    var makeMapStats = function makeMapStats(stats) {\n      return new Map(Object.keys(stats).map(function (key) {\n        return [key, stats[key]];\n      }));\n    };\n    if (arguments.length >= 2) {\n      var successCallbackWrapper_ = function successCallbackWrapper_(response) {\n        onSucc(makeMapStats(fixChromeStats_(response)));\n      };\n      return origGetStats.apply(this, [successCallbackWrapper_, selector]);\n    }\n\n    // promise-support\n    return new Promise(function (resolve, reject) {\n      origGetStats.apply(_this5, [function (response) {\n        resolve(makeMapStats(fixChromeStats_(response)));\n      }, reject]);\n    }).then(onSucc, onErr);\n  };\n}\nfunction shimSenderReceiverGetStats(window) {\n  if (!(_typeof(window) === 'object' && window.RTCPeerConnection && window.RTCRtpSender && window.RTCRtpReceiver)) {\n    return;\n  }\n\n  // shim sender stats.\n  if (!('getStats' in window.RTCRtpSender.prototype)) {\n    var origGetSenders = window.RTCPeerConnection.prototype.getSenders;\n    if (origGetSenders) {\n      window.RTCPeerConnection.prototype.getSenders = function getSenders() {\n        var _this6 = this;\n        var senders = origGetSenders.apply(this, []);\n        senders.forEach(function (sender) {\n          return sender._pc = _this6;\n        });\n        return senders;\n      };\n    }\n    var origAddTrack = window.RTCPeerConnection.prototype.addTrack;\n    if (origAddTrack) {\n      window.RTCPeerConnection.prototype.addTrack = function addTrack() {\n        var sender = origAddTrack.apply(this, arguments);\n        sender._pc = this;\n        return sender;\n      };\n    }\n    window.RTCRtpSender.prototype.getStats = function getStats() {\n      var sender = this;\n      return this._pc.getStats().then(function (result) {\n        return (\n          /* Note: this will include stats of all senders that\n           *   send a track with the same id as sender.track as\n           *   it is not possible to identify the RTCRtpSender.\n           */\n          utils.filterStats(result, sender.track, true)\n        );\n      });\n    };\n  }\n\n  // shim receiver stats.\n  if (!('getStats' in window.RTCRtpReceiver.prototype)) {\n    var origGetReceivers = window.RTCPeerConnection.prototype.getReceivers;\n    if (origGetReceivers) {\n      window.RTCPeerConnection.prototype.getReceivers = function getReceivers() {\n        var _this7 = this;\n        var receivers = origGetReceivers.apply(this, []);\n        receivers.forEach(function (receiver) {\n          return receiver._pc = _this7;\n        });\n        return receivers;\n      };\n    }\n    utils.wrapPeerConnectionEvent(window, 'track', function (e) {\n      e.receiver._pc = e.srcElement;\n      return e;\n    });\n    window.RTCRtpReceiver.prototype.getStats = function getStats() {\n      var receiver = this;\n      return this._pc.getStats().then(function (result) {\n        return utils.filterStats(result, receiver.track, false);\n      });\n    };\n  }\n  if (!('getStats' in window.RTCRtpSender.prototype && 'getStats' in window.RTCRtpReceiver.prototype)) {\n    return;\n  }\n\n  // shim RTCPeerConnection.getStats(track).\n  var origGetStats = window.RTCPeerConnection.prototype.getStats;\n  window.RTCPeerConnection.prototype.getStats = function getStats() {\n    if (arguments.length > 0 && arguments[0] instanceof window.MediaStreamTrack) {\n      var track = arguments[0];\n      var sender;\n      var receiver;\n      var err;\n      this.getSenders().forEach(function (s) {\n        if (s.track === track) {\n          if (sender) {\n            err = true;\n          } else {\n            sender = s;\n          }\n        }\n      });\n      this.getReceivers().forEach(function (r) {\n        if (r.track === track) {\n          if (receiver) {\n            err = true;\n          } else {\n            receiver = r;\n          }\n        }\n        return r.track === track;\n      });\n      if (err || sender && receiver) {\n        return Promise.reject(new DOMException('There are more than one sender or receiver for the track.', 'InvalidAccessError'));\n      } else if (sender) {\n        return sender.getStats();\n      } else if (receiver) {\n        return receiver.getStats();\n      }\n      return Promise.reject(new DOMException('There is no sender or receiver for the track.', 'InvalidAccessError'));\n    }\n    return origGetStats.apply(this, arguments);\n  };\n}\nfunction shimAddTrackRemoveTrackWithNative(window) {\n  // shim addTrack/removeTrack with native variants in order to make\n  // the interactions with legacy getLocalStreams behave as in other browsers.\n  // Keeps a mapping stream.id => [stream, rtpsenders...]\n  window.RTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() {\n    var _this8 = this;\n    this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n    return Object.keys(this._shimmedLocalStreams).map(function (streamId) {\n      return _this8._shimmedLocalStreams[streamId][0];\n    });\n  };\n  var origAddTrack = window.RTCPeerConnection.prototype.addTrack;\n  window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) {\n    if (!stream) {\n      return origAddTrack.apply(this, arguments);\n    }\n    this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n    var sender = origAddTrack.apply(this, arguments);\n    if (!this._shimmedLocalStreams[stream.id]) {\n      this._shimmedLocalStreams[stream.id] = [stream, sender];\n    } else if (this._shimmedLocalStreams[stream.id].indexOf(sender) === -1) {\n      this._shimmedLocalStreams[stream.id].push(sender);\n    }\n    return sender;\n  };\n  var origAddStream = window.RTCPeerConnection.prototype.addStream;\n  window.RTCPeerConnection.prototype.addStream = function addStream(stream) {\n    var _this9 = this;\n    this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n    stream.getTracks().forEach(function (track) {\n      var alreadyExists = _this9.getSenders().find(function (s) {\n        return s.track === track;\n      });\n      if (alreadyExists) {\n        throw new DOMException('Track already exists.', 'InvalidAccessError');\n      }\n    });\n    var existingSenders = this.getSenders();\n    origAddStream.apply(this, arguments);\n    var newSenders = this.getSenders().filter(function (newSender) {\n      return existingSenders.indexOf(newSender) === -1;\n    });\n    this._shimmedLocalStreams[stream.id] = [stream].concat(newSenders);\n  };\n  var origRemoveStream = window.RTCPeerConnection.prototype.removeStream;\n  window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) {\n    this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n    delete this._shimmedLocalStreams[stream.id];\n    return origRemoveStream.apply(this, arguments);\n  };\n  var origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack;\n  window.RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) {\n    var _this10 = this;\n    this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n    if (sender) {\n      Object.keys(this._shimmedLocalStreams).forEach(function (streamId) {\n        var idx = _this10._shimmedLocalStreams[streamId].indexOf(sender);\n        if (idx !== -1) {\n          _this10._shimmedLocalStreams[streamId].splice(idx, 1);\n        }\n        if (_this10._shimmedLocalStreams[streamId].length === 1) {\n          delete _this10._shimmedLocalStreams[streamId];\n        }\n      });\n    }\n    return origRemoveTrack.apply(this, arguments);\n  };\n}\nfunction shimAddTrackRemoveTrack(window, browserDetails) {\n  if (!window.RTCPeerConnection) {\n    return;\n  }\n  // shim addTrack and removeTrack.\n  if (window.RTCPeerConnection.prototype.addTrack && browserDetails.version >= 65) {\n    return shimAddTrackRemoveTrackWithNative(window);\n  }\n\n  // also shim pc.getLocalStreams when addTrack is shimmed\n  // to return the original streams.\n  var origGetLocalStreams = window.RTCPeerConnection.prototype.getLocalStreams;\n  window.RTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() {\n    var _this11 = this;\n    var nativeStreams = origGetLocalStreams.apply(this);\n    this._reverseStreams = this._reverseStreams || {};\n    return nativeStreams.map(function (stream) {\n      return _this11._reverseStreams[stream.id];\n    });\n  };\n  var origAddStream = window.RTCPeerConnection.prototype.addStream;\n  window.RTCPeerConnection.prototype.addStream = function addStream(stream) {\n    var _this12 = this;\n    this._streams = this._streams || {};\n    this._reverseStreams = this._reverseStreams || {};\n    stream.getTracks().forEach(function (track) {\n      var alreadyExists = _this12.getSenders().find(function (s) {\n        return s.track === track;\n      });\n      if (alreadyExists) {\n        throw new DOMException('Track already exists.', 'InvalidAccessError');\n      }\n    });\n    // Add identity mapping for consistency with addTrack.\n    // Unless this is being used with a stream from addTrack.\n    if (!this._reverseStreams[stream.id]) {\n      var newStream = new window.MediaStream(stream.getTracks());\n      this._streams[stream.id] = newStream;\n      this._reverseStreams[newStream.id] = stream;\n      stream = newStream;\n    }\n    origAddStream.apply(this, [stream]);\n  };\n  var origRemoveStream = window.RTCPeerConnection.prototype.removeStream;\n  window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) {\n    this._streams = this._streams || {};\n    this._reverseStreams = this._reverseStreams || {};\n    origRemoveStream.apply(this, [this._streams[stream.id] || stream]);\n    delete this._reverseStreams[this._streams[stream.id] ? this._streams[stream.id].id : stream.id];\n    delete this._streams[stream.id];\n  };\n  window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) {\n    var _this13 = this;\n    if (this.signalingState === 'closed') {\n      throw new DOMException('The RTCPeerConnection\\'s signalingState is \\'closed\\'.', 'InvalidStateError');\n    }\n    var streams = [].slice.call(arguments, 1);\n    if (streams.length !== 1 || !streams[0].getTracks().find(function (t) {\n      return t === track;\n    })) {\n      // this is not fully correct but all we can manage without\n      // [[associated MediaStreams]] internal slot.\n      throw new DOMException('The adapter.js addTrack polyfill only supports a single ' + ' stream which is associated with the specified track.', 'NotSupportedError');\n    }\n    var alreadyExists = this.getSenders().find(function (s) {\n      return s.track === track;\n    });\n    if (alreadyExists) {\n      throw new DOMException('Track already exists.', 'InvalidAccessError');\n    }\n    this._streams = this._streams || {};\n    this._reverseStreams = this._reverseStreams || {};\n    var oldStream = this._streams[stream.id];\n    if (oldStream) {\n      // this is using odd Chrome behaviour, use with caution:\n      // https://bugs.chromium.org/p/webrtc/issues/detail?id=7815\n      // Note: we rely on the high-level addTrack/dtmf shim to\n      // create the sender with a dtmf sender.\n      oldStream.addTrack(track);\n\n      // Trigger ONN async.\n      Promise.resolve().then(function () {\n        _this13.dispatchEvent(new Event('negotiationneeded'));\n      });\n    } else {\n      var newStream = new window.MediaStream([track]);\n      this._streams[stream.id] = newStream;\n      this._reverseStreams[newStream.id] = stream;\n      this.addStream(newStream);\n    }\n    return this.getSenders().find(function (s) {\n      return s.track === track;\n    });\n  };\n\n  // replace the internal stream id with the external one and\n  // vice versa.\n  function replaceInternalStreamId(pc, description) {\n    var sdp = description.sdp;\n    Object.keys(pc._reverseStreams || []).forEach(function (internalId) {\n      var externalStream = pc._reverseStreams[internalId];\n      var internalStream = pc._streams[externalStream.id];\n      sdp = sdp.replace(new RegExp(internalStream.id, 'g'), externalStream.id);\n    });\n    return new RTCSessionDescription({\n      type: description.type,\n      sdp: sdp\n    });\n  }\n  function replaceExternalStreamId(pc, description) {\n    var sdp = description.sdp;\n    Object.keys(pc._reverseStreams || []).forEach(function (internalId) {\n      var externalStream = pc._reverseStreams[internalId];\n      var internalStream = pc._streams[externalStream.id];\n      sdp = sdp.replace(new RegExp(externalStream.id, 'g'), internalStream.id);\n    });\n    return new RTCSessionDescription({\n      type: description.type,\n      sdp: sdp\n    });\n  }\n  ['createOffer', 'createAnswer'].forEach(function (method) {\n    var nativeMethod = window.RTCPeerConnection.prototype[method];\n    var methodObj = _defineProperty({}, method, function () {\n      var _this14 = this;\n      var args = arguments;\n      var isLegacyCall = arguments.length && typeof arguments[0] === 'function';\n      if (isLegacyCall) {\n        return nativeMethod.apply(this, [function (description) {\n          var desc = replaceInternalStreamId(_this14, description);\n          args[0].apply(null, [desc]);\n        }, function (err) {\n          if (args[1]) {\n            args[1].apply(null, err);\n          }\n        }, arguments[2]]);\n      }\n      return nativeMethod.apply(this, arguments).then(function (description) {\n        return replaceInternalStreamId(_this14, description);\n      });\n    });\n    window.RTCPeerConnection.prototype[method] = methodObj[method];\n  });\n  var origSetLocalDescription = window.RTCPeerConnection.prototype.setLocalDescription;\n  window.RTCPeerConnection.prototype.setLocalDescription = function setLocalDescription() {\n    if (!arguments.length || !arguments[0].type) {\n      return origSetLocalDescription.apply(this, arguments);\n    }\n    arguments[0] = replaceExternalStreamId(this, arguments[0]);\n    return origSetLocalDescription.apply(this, arguments);\n  };\n\n  // TODO: mangle getStats: https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamstats-streamidentifier\n\n  var origLocalDescription = Object.getOwnPropertyDescriptor(window.RTCPeerConnection.prototype, 'localDescription');\n  Object.defineProperty(window.RTCPeerConnection.prototype, 'localDescription', {\n    get: function get() {\n      var description = origLocalDescription.get.apply(this);\n      if (description.type === '') {\n        return description;\n      }\n      return replaceInternalStreamId(this, description);\n    }\n  });\n  window.RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) {\n    var _this15 = this;\n    if (this.signalingState === 'closed') {\n      throw new DOMException('The RTCPeerConnection\\'s signalingState is \\'closed\\'.', 'InvalidStateError');\n    }\n    // We can not yet check for sender instanceof RTCRtpSender\n    // since we shim RTPSender. So we check if sender._pc is set.\n    if (!sender._pc) {\n      throw new DOMException('Argument 1 of RTCPeerConnection.removeTrack ' + 'does not implement interface RTCRtpSender.', 'TypeError');\n    }\n    var isLocal = sender._pc === this;\n    if (!isLocal) {\n      throw new DOMException('Sender was not created by this connection.', 'InvalidAccessError');\n    }\n\n    // Search for the native stream the senders track belongs to.\n    this._streams = this._streams || {};\n    var stream;\n    Object.keys(this._streams).forEach(function (streamid) {\n      var hasTrack = _this15._streams[streamid].getTracks().find(function (track) {\n        return sender.track === track;\n      });\n      if (hasTrack) {\n        stream = _this15._streams[streamid];\n      }\n    });\n    if (stream) {\n      if (stream.getTracks().length === 1) {\n        // if this is the last track of the stream, remove the stream. This\n        // takes care of any shimmed _senders.\n        this.removeStream(this._reverseStreams[stream.id]);\n      } else {\n        // relying on the same odd chrome behaviour as above.\n        stream.removeTrack(sender.track);\n      }\n      this.dispatchEvent(new Event('negotiationneeded'));\n    }\n  };\n}\nfunction shimPeerConnection(window, browserDetails) {\n  if (!window.RTCPeerConnection && window.webkitRTCPeerConnection) {\n    // very basic support for old versions.\n    window.RTCPeerConnection = window.webkitRTCPeerConnection;\n  }\n  if (!window.RTCPeerConnection) {\n    return;\n  }\n\n  // shim implicit creation of RTCSessionDescription/RTCIceCandidate\n  if (browserDetails.version < 53) {\n    ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate'].forEach(function (method) {\n      var nativeMethod = window.RTCPeerConnection.prototype[method];\n      var methodObj = _defineProperty({}, method, function () {\n        arguments[0] = new (method === 'addIceCandidate' ? window.RTCIceCandidate : window.RTCSessionDescription)(arguments[0]);\n        return nativeMethod.apply(this, arguments);\n      });\n      window.RTCPeerConnection.prototype[method] = methodObj[method];\n    });\n  }\n}\n\n// Attempt to fix ONN in plan-b mode.\nfunction fixNegotiationNeeded(window, browserDetails) {\n  utils.wrapPeerConnectionEvent(window, 'negotiationneeded', function (e) {\n    var pc = e.target;\n    if (browserDetails.version < 72 || pc.getConfiguration && pc.getConfiguration().sdpSemantics === 'plan-b') {\n      if (pc.signalingState !== 'stable') {\n        return;\n      }\n    }\n    return e;\n  });\n}\n","/*\n *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n *\n *  Use of this source code is governed by a BSD-style license\n *  that can be found in the LICENSE file in the root of the source\n *  tree.\n */\n/* eslint-env node */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.shimGetUserMedia = shimGetUserMedia;\nvar utils = _interopRequireWildcard(require(\"../utils\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction shimGetUserMedia(window, browserDetails) {\n  var navigator = window && window.navigator;\n  var MediaStreamTrack = window && window.MediaStreamTrack;\n  navigator.getUserMedia = function (constraints, onSuccess, onError) {\n    // Replace Firefox 44+'s deprecation warning with unprefixed version.\n    utils.deprecated('navigator.getUserMedia', 'navigator.mediaDevices.getUserMedia');\n    navigator.mediaDevices.getUserMedia(constraints).then(onSuccess, onError);\n  };\n  if (!(browserDetails.version > 55 && 'autoGainControl' in navigator.mediaDevices.getSupportedConstraints())) {\n    var remap = function remap(obj, a, b) {\n      if (a in obj && !(b in obj)) {\n        obj[b] = obj[a];\n        delete obj[a];\n      }\n    };\n    var nativeGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);\n    navigator.mediaDevices.getUserMedia = function (c) {\n      if (_typeof(c) === 'object' && _typeof(c.audio) === 'object') {\n        c = JSON.parse(JSON.stringify(c));\n        remap(c.audio, 'autoGainControl', 'mozAutoGainControl');\n        remap(c.audio, 'noiseSuppression', 'mozNoiseSuppression');\n      }\n      return nativeGetUserMedia(c);\n    };\n    if (MediaStreamTrack && MediaStreamTrack.prototype.getSettings) {\n      var nativeGetSettings = MediaStreamTrack.prototype.getSettings;\n      MediaStreamTrack.prototype.getSettings = function () {\n        var obj = nativeGetSettings.apply(this, arguments);\n        remap(obj, 'mozAutoGainControl', 'autoGainControl');\n        remap(obj, 'mozNoiseSuppression', 'noiseSuppression');\n        return obj;\n      };\n    }\n    if (MediaStreamTrack && MediaStreamTrack.prototype.applyConstraints) {\n      var nativeApplyConstraints = MediaStreamTrack.prototype.applyConstraints;\n      MediaStreamTrack.prototype.applyConstraints = function (c) {\n        if (this.kind === 'audio' && _typeof(c) === 'object') {\n          c = JSON.parse(JSON.stringify(c));\n          remap(c, 'autoGainControl', 'mozAutoGainControl');\n          remap(c, 'noiseSuppression', 'mozNoiseSuppression');\n        }\n        return nativeApplyConstraints.apply(this, [c]);\n      };\n    }\n  }\n}\n","/*\n *  Copyright (c) 2018 The adapter.js project authors. All Rights Reserved.\n *\n *  Use of this source code is governed by a BSD-style license\n *  that can be found in the LICENSE file in the root of the source\n *  tree.\n */\n/* eslint-env node */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.shimGetDisplayMedia = shimGetDisplayMedia;\nfunction shimGetDisplayMedia(window, preferredMediaSource) {\n  if (window.navigator.mediaDevices && 'getDisplayMedia' in window.navigator.mediaDevices) {\n    return;\n  }\n  if (!window.navigator.mediaDevices) {\n    return;\n  }\n  window.navigator.mediaDevices.getDisplayMedia = function getDisplayMedia(constraints) {\n    if (!(constraints && constraints.video)) {\n      var err = new DOMException('getDisplayMedia without video ' + 'constraints is undefined');\n      err.name = 'NotFoundError';\n      // from https://heycam.github.io/webidl/#idl-DOMException-error-names\n      err.code = 8;\n      return Promise.reject(err);\n    }\n    if (constraints.video === true) {\n      constraints.video = {\n        mediaSource: preferredMediaSource\n      };\n    } else {\n      constraints.video.mediaSource = preferredMediaSource;\n    }\n    return window.navigator.mediaDevices.getUserMedia(constraints);\n  };\n}\n","/*\n *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n *\n *  Use of this source code is governed by a BSD-style license\n *  that can be found in the LICENSE file in the root of the source\n *  tree.\n */\n/* eslint-env node */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.shimAddTransceiver = shimAddTransceiver;\nexports.shimCreateAnswer = shimCreateAnswer;\nexports.shimCreateOffer = shimCreateOffer;\nObject.defineProperty(exports, \"shimGetDisplayMedia\", {\n  enumerable: true,\n  get: function get() {\n    return _getdisplaymedia.shimGetDisplayMedia;\n  }\n});\nexports.shimGetParameters = shimGetParameters;\nObject.defineProperty(exports, \"shimGetUserMedia\", {\n  enumerable: true,\n  get: function get() {\n    return _getusermedia.shimGetUserMedia;\n  }\n});\nexports.shimOnTrack = shimOnTrack;\nexports.shimPeerConnection = shimPeerConnection;\nexports.shimRTCDataChannel = shimRTCDataChannel;\nexports.shimReceiverGetStats = shimReceiverGetStats;\nexports.shimRemoveStream = shimRemoveStream;\nexports.shimSenderGetStats = shimSenderGetStats;\nvar utils = _interopRequireWildcard(require(\"../utils\"));\nvar _getusermedia = require(\"./getusermedia\");\nvar _getdisplaymedia = require(\"./getdisplaymedia\");\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction shimOnTrack(window) {\n  if (_typeof(window) === 'object' && window.RTCTrackEvent && 'receiver' in window.RTCTrackEvent.prototype && !('transceiver' in window.RTCTrackEvent.prototype)) {\n    Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', {\n      get: function get() {\n        return {\n          receiver: this.receiver\n        };\n      }\n    });\n  }\n}\nfunction shimPeerConnection(window, browserDetails) {\n  if (_typeof(window) !== 'object' || !(window.RTCPeerConnection || window.mozRTCPeerConnection)) {\n    return; // probably media.peerconnection.enabled=false in about:config\n  }\n\n  if (!window.RTCPeerConnection && window.mozRTCPeerConnection) {\n    // very basic support for old versions.\n    window.RTCPeerConnection = window.mozRTCPeerConnection;\n  }\n  if (browserDetails.version < 53) {\n    // shim away need for obsolete RTCIceCandidate/RTCSessionDescription.\n    ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate'].forEach(function (method) {\n      var nativeMethod = window.RTCPeerConnection.prototype[method];\n      var methodObj = _defineProperty({}, method, function () {\n        arguments[0] = new (method === 'addIceCandidate' ? window.RTCIceCandidate : window.RTCSessionDescription)(arguments[0]);\n        return nativeMethod.apply(this, arguments);\n      });\n      window.RTCPeerConnection.prototype[method] = methodObj[method];\n    });\n  }\n  var modernStatsTypes = {\n    inboundrtp: 'inbound-rtp',\n    outboundrtp: 'outbound-rtp',\n    candidatepair: 'candidate-pair',\n    localcandidate: 'local-candidate',\n    remotecandidate: 'remote-candidate'\n  };\n  var nativeGetStats = window.RTCPeerConnection.prototype.getStats;\n  window.RTCPeerConnection.prototype.getStats = function getStats() {\n    var _arguments = Array.prototype.slice.call(arguments),\n      selector = _arguments[0],\n      onSucc = _arguments[1],\n      onErr = _arguments[2];\n    return nativeGetStats.apply(this, [selector || null]).then(function (stats) {\n      if (browserDetails.version < 53 && !onSucc) {\n        // Shim only promise getStats with spec-hyphens in type names\n        // Leave callback version alone; misc old uses of forEach before Map\n        try {\n          stats.forEach(function (stat) {\n            stat.type = modernStatsTypes[stat.type] || stat.type;\n          });\n        } catch (e) {\n          if (e.name !== 'TypeError') {\n            throw e;\n          }\n          // Avoid TypeError: \"type\" is read-only, in old versions. 34-43ish\n          stats.forEach(function (stat, i) {\n            stats.set(i, Object.assign({}, stat, {\n              type: modernStatsTypes[stat.type] || stat.type\n            }));\n          });\n        }\n      }\n      return stats;\n    }).then(onSucc, onErr);\n  };\n}\nfunction shimSenderGetStats(window) {\n  if (!(_typeof(window) === 'object' && window.RTCPeerConnection && window.RTCRtpSender)) {\n    return;\n  }\n  if (window.RTCRtpSender && 'getStats' in window.RTCRtpSender.prototype) {\n    return;\n  }\n  var origGetSenders = window.RTCPeerConnection.prototype.getSenders;\n  if (origGetSenders) {\n    window.RTCPeerConnection.prototype.getSenders = function getSenders() {\n      var _this = this;\n      var senders = origGetSenders.apply(this, []);\n      senders.forEach(function (sender) {\n        return sender._pc = _this;\n      });\n      return senders;\n    };\n  }\n  var origAddTrack = window.RTCPeerConnection.prototype.addTrack;\n  if (origAddTrack) {\n    window.RTCPeerConnection.prototype.addTrack = function addTrack() {\n      var sender = origAddTrack.apply(this, arguments);\n      sender._pc = this;\n      return sender;\n    };\n  }\n  window.RTCRtpSender.prototype.getStats = function getStats() {\n    return this.track ? this._pc.getStats(this.track) : Promise.resolve(new Map());\n  };\n}\nfunction shimReceiverGetStats(window) {\n  if (!(_typeof(window) === 'object' && window.RTCPeerConnection && window.RTCRtpSender)) {\n    return;\n  }\n  if (window.RTCRtpSender && 'getStats' in window.RTCRtpReceiver.prototype) {\n    return;\n  }\n  var origGetReceivers = window.RTCPeerConnection.prototype.getReceivers;\n  if (origGetReceivers) {\n    window.RTCPeerConnection.prototype.getReceivers = function getReceivers() {\n      var _this2 = this;\n      var receivers = origGetReceivers.apply(this, []);\n      receivers.forEach(function (receiver) {\n        return receiver._pc = _this2;\n      });\n      return receivers;\n    };\n  }\n  utils.wrapPeerConnectionEvent(window, 'track', function (e) {\n    e.receiver._pc = e.srcElement;\n    return e;\n  });\n  window.RTCRtpReceiver.prototype.getStats = function getStats() {\n    return this._pc.getStats(this.track);\n  };\n}\nfunction shimRemoveStream(window) {\n  if (!window.RTCPeerConnection || 'removeStream' in window.RTCPeerConnection.prototype) {\n    return;\n  }\n  window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) {\n    var _this3 = this;\n    utils.deprecated('removeStream', 'removeTrack');\n    this.getSenders().forEach(function (sender) {\n      if (sender.track && stream.getTracks().includes(sender.track)) {\n        _this3.removeTrack(sender);\n      }\n    });\n  };\n}\nfunction shimRTCDataChannel(window) {\n  // rename DataChannel to RTCDataChannel (native fix in FF60):\n  // https://bugzilla.mozilla.org/show_bug.cgi?id=1173851\n  if (window.DataChannel && !window.RTCDataChannel) {\n    window.RTCDataChannel = window.DataChannel;\n  }\n}\nfunction shimAddTransceiver(window) {\n  // https://github.com/webrtcHacks/adapter/issues/998#issuecomment-516921647\n  // Firefox ignores the init sendEncodings options passed to addTransceiver\n  // https://bugzilla.mozilla.org/show_bug.cgi?id=1396918\n  if (!(_typeof(window) === 'object' && window.RTCPeerConnection)) {\n    return;\n  }\n  var origAddTransceiver = window.RTCPeerConnection.prototype.addTransceiver;\n  if (origAddTransceiver) {\n    window.RTCPeerConnection.prototype.addTransceiver = function addTransceiver() {\n      this.setParametersPromises = [];\n      // WebIDL input coercion and validation\n      var sendEncodings = arguments[1] && arguments[1].sendEncodings;\n      if (sendEncodings === undefined) {\n        sendEncodings = [];\n      }\n      sendEncodings = _toConsumableArray(sendEncodings);\n      var shouldPerformCheck = sendEncodings.length > 0;\n      if (shouldPerformCheck) {\n        // If sendEncodings params are provided, validate grammar\n        sendEncodings.forEach(function (encodingParam) {\n          if ('rid' in encodingParam) {\n            var ridRegex = /^[a-z0-9]{0,16}$/i;\n            if (!ridRegex.test(encodingParam.rid)) {\n              throw new TypeError('Invalid RID value provided.');\n            }\n          }\n          if ('scaleResolutionDownBy' in encodingParam) {\n            if (!(parseFloat(encodingParam.scaleResolutionDownBy) >= 1.0)) {\n              throw new RangeError('scale_resolution_down_by must be >= 1.0');\n            }\n          }\n          if ('maxFramerate' in encodingParam) {\n            if (!(parseFloat(encodingParam.maxFramerate) >= 0)) {\n              throw new RangeError('max_framerate must be >= 0.0');\n            }\n          }\n        });\n      }\n      var transceiver = origAddTransceiver.apply(this, arguments);\n      if (shouldPerformCheck) {\n        // Check if the init options were applied. If not we do this in an\n        // asynchronous way and save the promise reference in a global object.\n        // This is an ugly hack, but at the same time is way more robust than\n        // checking the sender parameters before and after the createOffer\n        // Also note that after the createoffer we are not 100% sure that\n        // the params were asynchronously applied so we might miss the\n        // opportunity to recreate offer.\n        var sender = transceiver.sender;\n        var params = sender.getParameters();\n        if (!('encodings' in params) ||\n        // Avoid being fooled by patched getParameters() below.\n        params.encodings.length === 1 && Object.keys(params.encodings[0]).length === 0) {\n          params.encodings = sendEncodings;\n          sender.sendEncodings = sendEncodings;\n          this.setParametersPromises.push(sender.setParameters(params).then(function () {\n            delete sender.sendEncodings;\n          })[\"catch\"](function () {\n            delete sender.sendEncodings;\n          }));\n        }\n      }\n      return transceiver;\n    };\n  }\n}\nfunction shimGetParameters(window) {\n  if (!(_typeof(window) === 'object' && window.RTCRtpSender)) {\n    return;\n  }\n  var origGetParameters = window.RTCRtpSender.prototype.getParameters;\n  if (origGetParameters) {\n    window.RTCRtpSender.prototype.getParameters = function getParameters() {\n      var params = origGetParameters.apply(this, arguments);\n      if (!('encodings' in params)) {\n        params.encodings = [].concat(this.sendEncodings || [{}]);\n      }\n      return params;\n    };\n  }\n}\nfunction shimCreateOffer(window) {\n  // https://github.com/webrtcHacks/adapter/issues/998#issuecomment-516921647\n  // Firefox ignores the init sendEncodings options passed to addTransceiver\n  // https://bugzilla.mozilla.org/show_bug.cgi?id=1396918\n  if (!(_typeof(window) === 'object' && window.RTCPeerConnection)) {\n    return;\n  }\n  var origCreateOffer = window.RTCPeerConnection.prototype.createOffer;\n  window.RTCPeerConnection.prototype.createOffer = function createOffer() {\n    var _arguments2 = arguments,\n      _this4 = this;\n    if (this.setParametersPromises && this.setParametersPromises.length) {\n      return Promise.all(this.setParametersPromises).then(function () {\n        return origCreateOffer.apply(_this4, _arguments2);\n      })[\"finally\"](function () {\n        _this4.setParametersPromises = [];\n      });\n    }\n    return origCreateOffer.apply(this, arguments);\n  };\n}\nfunction shimCreateAnswer(window) {\n  // https://github.com/webrtcHacks/adapter/issues/998#issuecomment-516921647\n  // Firefox ignores the init sendEncodings options passed to addTransceiver\n  // https://bugzilla.mozilla.org/show_bug.cgi?id=1396918\n  if (!(_typeof(window) === 'object' && window.RTCPeerConnection)) {\n    return;\n  }\n  var origCreateAnswer = window.RTCPeerConnection.prototype.createAnswer;\n  window.RTCPeerConnection.prototype.createAnswer = function createAnswer() {\n    var _arguments3 = arguments,\n      _this5 = this;\n    if (this.setParametersPromises && this.setParametersPromises.length) {\n      return Promise.all(this.setParametersPromises).then(function () {\n        return origCreateAnswer.apply(_this5, _arguments3);\n      })[\"finally\"](function () {\n        _this5.setParametersPromises = [];\n      });\n    }\n    return origCreateAnswer.apply(this, arguments);\n  };\n}\n","/*\n *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n *\n *  Use of this source code is governed by a BSD-style license\n *  that can be found in the LICENSE file in the root of the source\n *  tree.\n */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.shimAudioContext = shimAudioContext;\nexports.shimCallbacksAPI = shimCallbacksAPI;\nexports.shimConstraints = shimConstraints;\nexports.shimCreateOfferLegacy = shimCreateOfferLegacy;\nexports.shimGetUserMedia = shimGetUserMedia;\nexports.shimLocalStreamsAPI = shimLocalStreamsAPI;\nexports.shimRTCIceServerUrls = shimRTCIceServerUrls;\nexports.shimRemoteStreamsAPI = shimRemoteStreamsAPI;\nexports.shimTrackEventTransceiver = shimTrackEventTransceiver;\nvar utils = _interopRequireWildcard(require(\"../utils\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction shimLocalStreamsAPI(window) {\n  if (_typeof(window) !== 'object' || !window.RTCPeerConnection) {\n    return;\n  }\n  if (!('getLocalStreams' in window.RTCPeerConnection.prototype)) {\n    window.RTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() {\n      if (!this._localStreams) {\n        this._localStreams = [];\n      }\n      return this._localStreams;\n    };\n  }\n  if (!('addStream' in window.RTCPeerConnection.prototype)) {\n    var _addTrack = window.RTCPeerConnection.prototype.addTrack;\n    window.RTCPeerConnection.prototype.addStream = function addStream(stream) {\n      var _this = this;\n      if (!this._localStreams) {\n        this._localStreams = [];\n      }\n      if (!this._localStreams.includes(stream)) {\n        this._localStreams.push(stream);\n      }\n      // Try to emulate Chrome's behaviour of adding in audio-video order.\n      // Safari orders by track id.\n      stream.getAudioTracks().forEach(function (track) {\n        return _addTrack.call(_this, track, stream);\n      });\n      stream.getVideoTracks().forEach(function (track) {\n        return _addTrack.call(_this, track, stream);\n      });\n    };\n    window.RTCPeerConnection.prototype.addTrack = function addTrack(track) {\n      var _this2 = this;\n      for (var _len = arguments.length, streams = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        streams[_key - 1] = arguments[_key];\n      }\n      if (streams) {\n        streams.forEach(function (stream) {\n          if (!_this2._localStreams) {\n            _this2._localStreams = [stream];\n          } else if (!_this2._localStreams.includes(stream)) {\n            _this2._localStreams.push(stream);\n          }\n        });\n      }\n      return _addTrack.apply(this, arguments);\n    };\n  }\n  if (!('removeStream' in window.RTCPeerConnection.prototype)) {\n    window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) {\n      var _this3 = this;\n      if (!this._localStreams) {\n        this._localStreams = [];\n      }\n      var index = this._localStreams.indexOf(stream);\n      if (index === -1) {\n        return;\n      }\n      this._localStreams.splice(index, 1);\n      var tracks = stream.getTracks();\n      this.getSenders().forEach(function (sender) {\n        if (tracks.includes(sender.track)) {\n          _this3.removeTrack(sender);\n        }\n      });\n    };\n  }\n}\nfunction shimRemoteStreamsAPI(window) {\n  if (_typeof(window) !== 'object' || !window.RTCPeerConnection) {\n    return;\n  }\n  if (!('getRemoteStreams' in window.RTCPeerConnection.prototype)) {\n    window.RTCPeerConnection.prototype.getRemoteStreams = function getRemoteStreams() {\n      return this._remoteStreams ? this._remoteStreams : [];\n    };\n  }\n  if (!('onaddstream' in window.RTCPeerConnection.prototype)) {\n    Object.defineProperty(window.RTCPeerConnection.prototype, 'onaddstream', {\n      get: function get() {\n        return this._onaddstream;\n      },\n      set: function set(f) {\n        var _this4 = this;\n        if (this._onaddstream) {\n          this.removeEventListener('addstream', this._onaddstream);\n          this.removeEventListener('track', this._onaddstreampoly);\n        }\n        this.addEventListener('addstream', this._onaddstream = f);\n        this.addEventListener('track', this._onaddstreampoly = function (e) {\n          e.streams.forEach(function (stream) {\n            if (!_this4._remoteStreams) {\n              _this4._remoteStreams = [];\n            }\n            if (_this4._remoteStreams.includes(stream)) {\n              return;\n            }\n            _this4._remoteStreams.push(stream);\n            var event = new Event('addstream');\n            event.stream = stream;\n            _this4.dispatchEvent(event);\n          });\n        });\n      }\n    });\n    var origSetRemoteDescription = window.RTCPeerConnection.prototype.setRemoteDescription;\n    window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() {\n      var pc = this;\n      if (!this._onaddstreampoly) {\n        this.addEventListener('track', this._onaddstreampoly = function (e) {\n          e.streams.forEach(function (stream) {\n            if (!pc._remoteStreams) {\n              pc._remoteStreams = [];\n            }\n            if (pc._remoteStreams.indexOf(stream) >= 0) {\n              return;\n            }\n            pc._remoteStreams.push(stream);\n            var event = new Event('addstream');\n            event.stream = stream;\n            pc.dispatchEvent(event);\n          });\n        });\n      }\n      return origSetRemoteDescription.apply(pc, arguments);\n    };\n  }\n}\nfunction shimCallbacksAPI(window) {\n  if (_typeof(window) !== 'object' || !window.RTCPeerConnection) {\n    return;\n  }\n  var prototype = window.RTCPeerConnection.prototype;\n  var origCreateOffer = prototype.createOffer;\n  var origCreateAnswer = prototype.createAnswer;\n  var setLocalDescription = prototype.setLocalDescription;\n  var setRemoteDescription = prototype.setRemoteDescription;\n  var addIceCandidate = prototype.addIceCandidate;\n  prototype.createOffer = function createOffer(successCallback, failureCallback) {\n    var options = arguments.length >= 2 ? arguments[2] : arguments[0];\n    var promise = origCreateOffer.apply(this, [options]);\n    if (!failureCallback) {\n      return promise;\n    }\n    promise.then(successCallback, failureCallback);\n    return Promise.resolve();\n  };\n  prototype.createAnswer = function createAnswer(successCallback, failureCallback) {\n    var options = arguments.length >= 2 ? arguments[2] : arguments[0];\n    var promise = origCreateAnswer.apply(this, [options]);\n    if (!failureCallback) {\n      return promise;\n    }\n    promise.then(successCallback, failureCallback);\n    return Promise.resolve();\n  };\n  var withCallback = function withCallback(description, successCallback, failureCallback) {\n    var promise = setLocalDescription.apply(this, [description]);\n    if (!failureCallback) {\n      return promise;\n    }\n    promise.then(successCallback, failureCallback);\n    return Promise.resolve();\n  };\n  prototype.setLocalDescription = withCallback;\n  withCallback = function withCallback(description, successCallback, failureCallback) {\n    var promise = setRemoteDescription.apply(this, [description]);\n    if (!failureCallback) {\n      return promise;\n    }\n    promise.then(successCallback, failureCallback);\n    return Promise.resolve();\n  };\n  prototype.setRemoteDescription = withCallback;\n  withCallback = function withCallback(candidate, successCallback, failureCallback) {\n    var promise = addIceCandidate.apply(this, [candidate]);\n    if (!failureCallback) {\n      return promise;\n    }\n    promise.then(successCallback, failureCallback);\n    return Promise.resolve();\n  };\n  prototype.addIceCandidate = withCallback;\n}\nfunction shimGetUserMedia(window) {\n  var navigator = window && window.navigator;\n  if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n    // shim not needed in Safari 12.1\n    var mediaDevices = navigator.mediaDevices;\n    var _getUserMedia = mediaDevices.getUserMedia.bind(mediaDevices);\n    navigator.mediaDevices.getUserMedia = function (constraints) {\n      return _getUserMedia(shimConstraints(constraints));\n    };\n  }\n  if (!navigator.getUserMedia && navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n    navigator.getUserMedia = function getUserMedia(constraints, cb, errcb) {\n      navigator.mediaDevices.getUserMedia(constraints).then(cb, errcb);\n    }.bind(navigator);\n  }\n}\nfunction shimConstraints(constraints) {\n  if (constraints && constraints.video !== undefined) {\n    return Object.assign({}, constraints, {\n      video: utils.compactObject(constraints.video)\n    });\n  }\n  return constraints;\n}\nfunction shimRTCIceServerUrls(window) {\n  if (!window.RTCPeerConnection) {\n    return;\n  }\n  // migrate from non-spec RTCIceServer.url to RTCIceServer.urls\n  var OrigPeerConnection = window.RTCPeerConnection;\n  window.RTCPeerConnection = function RTCPeerConnection(pcConfig, pcConstraints) {\n    if (pcConfig && pcConfig.iceServers) {\n      var newIceServers = [];\n      for (var i = 0; i < pcConfig.iceServers.length; i++) {\n        var server = pcConfig.iceServers[i];\n        if (server.urls === undefined && server.url) {\n          utils.deprecated('RTCIceServer.url', 'RTCIceServer.urls');\n          server = JSON.parse(JSON.stringify(server));\n          server.urls = server.url;\n          delete server.url;\n          newIceServers.push(server);\n        } else {\n          newIceServers.push(pcConfig.iceServers[i]);\n        }\n      }\n      pcConfig.iceServers = newIceServers;\n    }\n    return new OrigPeerConnection(pcConfig, pcConstraints);\n  };\n  window.RTCPeerConnection.prototype = OrigPeerConnection.prototype;\n  // wrap static methods. Currently just generateCertificate.\n  if ('generateCertificate' in OrigPeerConnection) {\n    Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', {\n      get: function get() {\n        return OrigPeerConnection.generateCertificate;\n      }\n    });\n  }\n}\nfunction shimTrackEventTransceiver(window) {\n  // Add event.transceiver member over deprecated event.receiver\n  if (_typeof(window) === 'object' && window.RTCTrackEvent && 'receiver' in window.RTCTrackEvent.prototype && !('transceiver' in window.RTCTrackEvent.prototype)) {\n    Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', {\n      get: function get() {\n        return {\n          receiver: this.receiver\n        };\n      }\n    });\n  }\n}\nfunction shimCreateOfferLegacy(window) {\n  var origCreateOffer = window.RTCPeerConnection.prototype.createOffer;\n  window.RTCPeerConnection.prototype.createOffer = function createOffer(offerOptions) {\n    if (offerOptions) {\n      if (typeof offerOptions.offerToReceiveAudio !== 'undefined') {\n        // support bit values\n        offerOptions.offerToReceiveAudio = !!offerOptions.offerToReceiveAudio;\n      }\n      var audioTransceiver = this.getTransceivers().find(function (transceiver) {\n        return transceiver.receiver.track.kind === 'audio';\n      });\n      if (offerOptions.offerToReceiveAudio === false && audioTransceiver) {\n        if (audioTransceiver.direction === 'sendrecv') {\n          if (audioTransceiver.setDirection) {\n            audioTransceiver.setDirection('sendonly');\n          } else {\n            audioTransceiver.direction = 'sendonly';\n          }\n        } else if (audioTransceiver.direction === 'recvonly') {\n          if (audioTransceiver.setDirection) {\n            audioTransceiver.setDirection('inactive');\n          } else {\n            audioTransceiver.direction = 'inactive';\n          }\n        }\n      } else if (offerOptions.offerToReceiveAudio === true && !audioTransceiver) {\n        this.addTransceiver('audio', {\n          direction: 'recvonly'\n        });\n      }\n      if (typeof offerOptions.offerToReceiveVideo !== 'undefined') {\n        // support bit values\n        offerOptions.offerToReceiveVideo = !!offerOptions.offerToReceiveVideo;\n      }\n      var videoTransceiver = this.getTransceivers().find(function (transceiver) {\n        return transceiver.receiver.track.kind === 'video';\n      });\n      if (offerOptions.offerToReceiveVideo === false && videoTransceiver) {\n        if (videoTransceiver.direction === 'sendrecv') {\n          if (videoTransceiver.setDirection) {\n            videoTransceiver.setDirection('sendonly');\n          } else {\n            videoTransceiver.direction = 'sendonly';\n          }\n        } else if (videoTransceiver.direction === 'recvonly') {\n          if (videoTransceiver.setDirection) {\n            videoTransceiver.setDirection('inactive');\n          } else {\n            videoTransceiver.direction = 'inactive';\n          }\n        }\n      } else if (offerOptions.offerToReceiveVideo === true && !videoTransceiver) {\n        this.addTransceiver('video', {\n          direction: 'recvonly'\n        });\n      }\n    }\n    return origCreateOffer.apply(this, arguments);\n  };\n}\nfunction shimAudioContext(window) {\n  if (_typeof(window) !== 'object' || window.AudioContext) {\n    return;\n  }\n  window.AudioContext = window.webkitAudioContext;\n}\n","/* eslint-env node */\n'use strict';\n\n// SDP helpers.\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar SDPUtils = {};\n\n// Generate an alphanumeric identifier for cname or mids.\n// TODO: use UUIDs instead? https://gist.github.com/jed/982883\nSDPUtils.generateIdentifier = function () {\n  return Math.random().toString(36).substring(2, 12);\n};\n\n// The RTCP CNAME used by all peerconnections from the same JS.\nSDPUtils.localCName = SDPUtils.generateIdentifier();\n\n// Splits SDP into lines, dealing with both CRLF and LF.\nSDPUtils.splitLines = function (blob) {\n  return blob.trim().split('\\n').map(function (line) {\n    return line.trim();\n  });\n};\n// Splits SDP into sessionpart and mediasections. Ensures CRLF.\nSDPUtils.splitSections = function (blob) {\n  var parts = blob.split('\\nm=');\n  return parts.map(function (part, index) {\n    return (index > 0 ? 'm=' + part : part).trim() + '\\r\\n';\n  });\n};\n\n// Returns the session description.\nSDPUtils.getDescription = function (blob) {\n  var sections = SDPUtils.splitSections(blob);\n  return sections && sections[0];\n};\n\n// Returns the individual media sections.\nSDPUtils.getMediaSections = function (blob) {\n  var sections = SDPUtils.splitSections(blob);\n  sections.shift();\n  return sections;\n};\n\n// Returns lines that start with a certain prefix.\nSDPUtils.matchPrefix = function (blob, prefix) {\n  return SDPUtils.splitLines(blob).filter(function (line) {\n    return line.indexOf(prefix) === 0;\n  });\n};\n\n// Parses an ICE candidate line. Sample input:\n// candidate:702786350 2 udp 41819902 8.8.8.8 60769 typ relay raddr 8.8.8.8\n// rport 55996\"\n// Input can be prefixed with a=.\nSDPUtils.parseCandidate = function (line) {\n  var parts = void 0;\n  // Parse both variants.\n  if (line.indexOf('a=candidate:') === 0) {\n    parts = line.substring(12).split(' ');\n  } else {\n    parts = line.substring(10).split(' ');\n  }\n\n  var candidate = {\n    foundation: parts[0],\n    component: { 1: 'rtp', 2: 'rtcp' }[parts[1]] || parts[1],\n    protocol: parts[2].toLowerCase(),\n    priority: parseInt(parts[3], 10),\n    ip: parts[4],\n    address: parts[4], // address is an alias for ip.\n    port: parseInt(parts[5], 10),\n    // skip parts[6] == 'typ'\n    type: parts[7]\n  };\n\n  for (var i = 8; i < parts.length; i += 2) {\n    switch (parts[i]) {\n      case 'raddr':\n        candidate.relatedAddress = parts[i + 1];\n        break;\n      case 'rport':\n        candidate.relatedPort = parseInt(parts[i + 1], 10);\n        break;\n      case 'tcptype':\n        candidate.tcpType = parts[i + 1];\n        break;\n      case 'ufrag':\n        candidate.ufrag = parts[i + 1]; // for backward compatibility.\n        candidate.usernameFragment = parts[i + 1];\n        break;\n      default:\n        // extension handling, in particular ufrag. Don't overwrite.\n        if (candidate[parts[i]] === undefined) {\n          candidate[parts[i]] = parts[i + 1];\n        }\n        break;\n    }\n  }\n  return candidate;\n};\n\n// Translates a candidate object into SDP candidate attribute.\n// This does not include the a= prefix!\nSDPUtils.writeCandidate = function (candidate) {\n  var sdp = [];\n  sdp.push(candidate.foundation);\n\n  var component = candidate.component;\n  if (component === 'rtp') {\n    sdp.push(1);\n  } else if (component === 'rtcp') {\n    sdp.push(2);\n  } else {\n    sdp.push(component);\n  }\n  sdp.push(candidate.protocol.toUpperCase());\n  sdp.push(candidate.priority);\n  sdp.push(candidate.address || candidate.ip);\n  sdp.push(candidate.port);\n\n  var type = candidate.type;\n  sdp.push('typ');\n  sdp.push(type);\n  if (type !== 'host' && candidate.relatedAddress && candidate.relatedPort) {\n    sdp.push('raddr');\n    sdp.push(candidate.relatedAddress);\n    sdp.push('rport');\n    sdp.push(candidate.relatedPort);\n  }\n  if (candidate.tcpType && candidate.protocol.toLowerCase() === 'tcp') {\n    sdp.push('tcptype');\n    sdp.push(candidate.tcpType);\n  }\n  if (candidate.usernameFragment || candidate.ufrag) {\n    sdp.push('ufrag');\n    sdp.push(candidate.usernameFragment || candidate.ufrag);\n  }\n  return 'candidate:' + sdp.join(' ');\n};\n\n// Parses an ice-options line, returns an array of option tags.\n// Sample input:\n// a=ice-options:foo bar\nSDPUtils.parseIceOptions = function (line) {\n  return line.substring(14).split(' ');\n};\n\n// Parses a rtpmap line, returns RTCRtpCoddecParameters. Sample input:\n// a=rtpmap:111 opus/48000/2\nSDPUtils.parseRtpMap = function (line) {\n  var parts = line.substring(9).split(' ');\n  var parsed = {\n    payloadType: parseInt(parts.shift(), 10) // was: id\n  };\n\n  parts = parts[0].split('/');\n\n  parsed.name = parts[0];\n  parsed.clockRate = parseInt(parts[1], 10); // was: clockrate\n  parsed.channels = parts.length === 3 ? parseInt(parts[2], 10) : 1;\n  // legacy alias, got renamed back to channels in ORTC.\n  parsed.numChannels = parsed.channels;\n  return parsed;\n};\n\n// Generates a rtpmap line from RTCRtpCodecCapability or\n// RTCRtpCodecParameters.\nSDPUtils.writeRtpMap = function (codec) {\n  var pt = codec.payloadType;\n  if (codec.preferredPayloadType !== undefined) {\n    pt = codec.preferredPayloadType;\n  }\n  var channels = codec.channels || codec.numChannels || 1;\n  return 'a=rtpmap:' + pt + ' ' + codec.name + '/' + codec.clockRate + (channels !== 1 ? '/' + channels : '') + '\\r\\n';\n};\n\n// Parses a extmap line (headerextension from RFC 5285). Sample input:\n// a=extmap:2 urn:ietf:params:rtp-hdrext:toffset\n// a=extmap:2/sendonly urn:ietf:params:rtp-hdrext:toffset\nSDPUtils.parseExtmap = function (line) {\n  var parts = line.substring(9).split(' ');\n  return {\n    id: parseInt(parts[0], 10),\n    direction: parts[0].indexOf('/') > 0 ? parts[0].split('/')[1] : 'sendrecv',\n    uri: parts[1],\n    attributes: parts.slice(2).join(' ')\n  };\n};\n\n// Generates an extmap line from RTCRtpHeaderExtensionParameters or\n// RTCRtpHeaderExtension.\nSDPUtils.writeExtmap = function (headerExtension) {\n  return 'a=extmap:' + (headerExtension.id || headerExtension.preferredId) + (headerExtension.direction && headerExtension.direction !== 'sendrecv' ? '/' + headerExtension.direction : '') + ' ' + headerExtension.uri + (headerExtension.attributes ? ' ' + headerExtension.attributes : '') + '\\r\\n';\n};\n\n// Parses a fmtp line, returns dictionary. Sample input:\n// a=fmtp:96 vbr=on;cng=on\n// Also deals with vbr=on; cng=on\nSDPUtils.parseFmtp = function (line) {\n  var parsed = {};\n  var kv = void 0;\n  var parts = line.substring(line.indexOf(' ') + 1).split(';');\n  for (var j = 0; j < parts.length; j++) {\n    kv = parts[j].trim().split('=');\n    parsed[kv[0].trim()] = kv[1];\n  }\n  return parsed;\n};\n\n// Generates a fmtp line from RTCRtpCodecCapability or RTCRtpCodecParameters.\nSDPUtils.writeFmtp = function (codec) {\n  var line = '';\n  var pt = codec.payloadType;\n  if (codec.preferredPayloadType !== undefined) {\n    pt = codec.preferredPayloadType;\n  }\n  if (codec.parameters && Object.keys(codec.parameters).length) {\n    var params = [];\n    Object.keys(codec.parameters).forEach(function (param) {\n      if (codec.parameters[param] !== undefined) {\n        params.push(param + '=' + codec.parameters[param]);\n      } else {\n        params.push(param);\n      }\n    });\n    line += 'a=fmtp:' + pt + ' ' + params.join(';') + '\\r\\n';\n  }\n  return line;\n};\n\n// Parses a rtcp-fb line, returns RTCPRtcpFeedback object. Sample input:\n// a=rtcp-fb:98 nack rpsi\nSDPUtils.parseRtcpFb = function (line) {\n  var parts = line.substring(line.indexOf(' ') + 1).split(' ');\n  return {\n    type: parts.shift(),\n    parameter: parts.join(' ')\n  };\n};\n\n// Generate a=rtcp-fb lines from RTCRtpCodecCapability or RTCRtpCodecParameters.\nSDPUtils.writeRtcpFb = function (codec) {\n  var lines = '';\n  var pt = codec.payloadType;\n  if (codec.preferredPayloadType !== undefined) {\n    pt = codec.preferredPayloadType;\n  }\n  if (codec.rtcpFeedback && codec.rtcpFeedback.length) {\n    // FIXME: special handling for trr-int?\n    codec.rtcpFeedback.forEach(function (fb) {\n      lines += 'a=rtcp-fb:' + pt + ' ' + fb.type + (fb.parameter && fb.parameter.length ? ' ' + fb.parameter : '') + '\\r\\n';\n    });\n  }\n  return lines;\n};\n\n// Parses a RFC 5576 ssrc media attribute. Sample input:\n// a=ssrc:3735928559 cname:something\nSDPUtils.parseSsrcMedia = function (line) {\n  var sp = line.indexOf(' ');\n  var parts = {\n    ssrc: parseInt(line.substring(7, sp), 10)\n  };\n  var colon = line.indexOf(':', sp);\n  if (colon > -1) {\n    parts.attribute = line.substring(sp + 1, colon);\n    parts.value = line.substring(colon + 1);\n  } else {\n    parts.attribute = line.substring(sp + 1);\n  }\n  return parts;\n};\n\n// Parse a ssrc-group line (see RFC 5576). Sample input:\n// a=ssrc-group:semantics 12 34\nSDPUtils.parseSsrcGroup = function (line) {\n  var parts = line.substring(13).split(' ');\n  return {\n    semantics: parts.shift(),\n    ssrcs: parts.map(function (ssrc) {\n      return parseInt(ssrc, 10);\n    })\n  };\n};\n\n// Extracts the MID (RFC 5888) from a media section.\n// Returns the MID or undefined if no mid line was found.\nSDPUtils.getMid = function (mediaSection) {\n  var mid = SDPUtils.matchPrefix(mediaSection, 'a=mid:')[0];\n  if (mid) {\n    return mid.substring(6);\n  }\n};\n\n// Parses a fingerprint line for DTLS-SRTP.\nSDPUtils.parseFingerprint = function (line) {\n  var parts = line.substring(14).split(' ');\n  return {\n    algorithm: parts[0].toLowerCase(), // algorithm is case-sensitive in Edge.\n    value: parts[1].toUpperCase() // the definition is upper-case in RFC 4572.\n  };\n};\n\n// Extracts DTLS parameters from SDP media section or sessionpart.\n// FIXME: for consistency with other functions this should only\n//   get the fingerprint line as input. See also getIceParameters.\nSDPUtils.getDtlsParameters = function (mediaSection, sessionpart) {\n  var lines = SDPUtils.matchPrefix(mediaSection + sessionpart, 'a=fingerprint:');\n  // Note: a=setup line is ignored since we use the 'auto' role in Edge.\n  return {\n    role: 'auto',\n    fingerprints: lines.map(SDPUtils.parseFingerprint)\n  };\n};\n\n// Serializes DTLS parameters to SDP.\nSDPUtils.writeDtlsParameters = function (params, setupType) {\n  var sdp = 'a=setup:' + setupType + '\\r\\n';\n  params.fingerprints.forEach(function (fp) {\n    sdp += 'a=fingerprint:' + fp.algorithm + ' ' + fp.value + '\\r\\n';\n  });\n  return sdp;\n};\n\n// Parses a=crypto lines into\n//   https://rawgit.com/aboba/edgertc/master/msortc-rs4.html#dictionary-rtcsrtpsdesparameters-members\nSDPUtils.parseCryptoLine = function (line) {\n  var parts = line.substring(9).split(' ');\n  return {\n    tag: parseInt(parts[0], 10),\n    cryptoSuite: parts[1],\n    keyParams: parts[2],\n    sessionParams: parts.slice(3)\n  };\n};\n\nSDPUtils.writeCryptoLine = function (parameters) {\n  return 'a=crypto:' + parameters.tag + ' ' + parameters.cryptoSuite + ' ' + (_typeof(parameters.keyParams) === 'object' ? SDPUtils.writeCryptoKeyParams(parameters.keyParams) : parameters.keyParams) + (parameters.sessionParams ? ' ' + parameters.sessionParams.join(' ') : '') + '\\r\\n';\n};\n\n// Parses the crypto key parameters into\n//   https://rawgit.com/aboba/edgertc/master/msortc-rs4.html#rtcsrtpkeyparam*\nSDPUtils.parseCryptoKeyParams = function (keyParams) {\n  if (keyParams.indexOf('inline:') !== 0) {\n    return null;\n  }\n  var parts = keyParams.substring(7).split('|');\n  return {\n    keyMethod: 'inline',\n    keySalt: parts[0],\n    lifeTime: parts[1],\n    mkiValue: parts[2] ? parts[2].split(':')[0] : undefined,\n    mkiLength: parts[2] ? parts[2].split(':')[1] : undefined\n  };\n};\n\nSDPUtils.writeCryptoKeyParams = function (keyParams) {\n  return keyParams.keyMethod + ':' + keyParams.keySalt + (keyParams.lifeTime ? '|' + keyParams.lifeTime : '') + (keyParams.mkiValue && keyParams.mkiLength ? '|' + keyParams.mkiValue + ':' + keyParams.mkiLength : '');\n};\n\n// Extracts all SDES parameters.\nSDPUtils.getCryptoParameters = function (mediaSection, sessionpart) {\n  var lines = SDPUtils.matchPrefix(mediaSection + sessionpart, 'a=crypto:');\n  return lines.map(SDPUtils.parseCryptoLine);\n};\n\n// Parses ICE information from SDP media section or sessionpart.\n// FIXME: for consistency with other functions this should only\n//   get the ice-ufrag and ice-pwd lines as input.\nSDPUtils.getIceParameters = function (mediaSection, sessionpart) {\n  var ufrag = SDPUtils.matchPrefix(mediaSection + sessionpart, 'a=ice-ufrag:')[0];\n  var pwd = SDPUtils.matchPrefix(mediaSection + sessionpart, 'a=ice-pwd:')[0];\n  if (!(ufrag && pwd)) {\n    return null;\n  }\n  return {\n    usernameFragment: ufrag.substring(12),\n    password: pwd.substring(10)\n  };\n};\n\n// Serializes ICE parameters to SDP.\nSDPUtils.writeIceParameters = function (params) {\n  var sdp = 'a=ice-ufrag:' + params.usernameFragment + '\\r\\n' + 'a=ice-pwd:' + params.password + '\\r\\n';\n  if (params.iceLite) {\n    sdp += 'a=ice-lite\\r\\n';\n  }\n  return sdp;\n};\n\n// Parses the SDP media section and returns RTCRtpParameters.\nSDPUtils.parseRtpParameters = function (mediaSection) {\n  var description = {\n    codecs: [],\n    headerExtensions: [],\n    fecMechanisms: [],\n    rtcp: []\n  };\n  var lines = SDPUtils.splitLines(mediaSection);\n  var mline = lines[0].split(' ');\n  description.profile = mline[2];\n  for (var i = 3; i < mline.length; i++) {\n    // find all codecs from mline[3..]\n    var pt = mline[i];\n    var rtpmapline = SDPUtils.matchPrefix(mediaSection, 'a=rtpmap:' + pt + ' ')[0];\n    if (rtpmapline) {\n      var codec = SDPUtils.parseRtpMap(rtpmapline);\n      var fmtps = SDPUtils.matchPrefix(mediaSection, 'a=fmtp:' + pt + ' ');\n      // Only the first a=fmtp:<pt> is considered.\n      codec.parameters = fmtps.length ? SDPUtils.parseFmtp(fmtps[0]) : {};\n      codec.rtcpFeedback = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-fb:' + pt + ' ').map(SDPUtils.parseRtcpFb);\n      description.codecs.push(codec);\n      // parse FEC mechanisms from rtpmap lines.\n      switch (codec.name.toUpperCase()) {\n        case 'RED':\n        case 'ULPFEC':\n          description.fecMechanisms.push(codec.name.toUpperCase());\n          break;\n        default:\n          // only RED and ULPFEC are recognized as FEC mechanisms.\n          break;\n      }\n    }\n  }\n  SDPUtils.matchPrefix(mediaSection, 'a=extmap:').forEach(function (line) {\n    description.headerExtensions.push(SDPUtils.parseExtmap(line));\n  });\n  var wildcardRtcpFb = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-fb:* ').map(SDPUtils.parseRtcpFb);\n  description.codecs.forEach(function (codec) {\n    wildcardRtcpFb.forEach(function (fb) {\n      var duplicate = codec.rtcpFeedback.find(function (existingFeedback) {\n        return existingFeedback.type === fb.type && existingFeedback.parameter === fb.parameter;\n      });\n      if (!duplicate) {\n        codec.rtcpFeedback.push(fb);\n      }\n    });\n  });\n  // FIXME: parse rtcp.\n  return description;\n};\n\n// Generates parts of the SDP media section describing the capabilities /\n// parameters.\nSDPUtils.writeRtpDescription = function (kind, caps) {\n  var sdp = '';\n\n  // Build the mline.\n  sdp += 'm=' + kind + ' ';\n  sdp += caps.codecs.length > 0 ? '9' : '0'; // reject if no codecs.\n  sdp += ' ' + (caps.profile || 'UDP/TLS/RTP/SAVPF') + ' ';\n  sdp += caps.codecs.map(function (codec) {\n    if (codec.preferredPayloadType !== undefined) {\n      return codec.preferredPayloadType;\n    }\n    return codec.payloadType;\n  }).join(' ') + '\\r\\n';\n\n  sdp += 'c=IN IP4 0.0.0.0\\r\\n';\n  sdp += 'a=rtcp:9 IN IP4 0.0.0.0\\r\\n';\n\n  // Add a=rtpmap lines for each codec. Also fmtp and rtcp-fb.\n  caps.codecs.forEach(function (codec) {\n    sdp += SDPUtils.writeRtpMap(codec);\n    sdp += SDPUtils.writeFmtp(codec);\n    sdp += SDPUtils.writeRtcpFb(codec);\n  });\n  var maxptime = 0;\n  caps.codecs.forEach(function (codec) {\n    if (codec.maxptime > maxptime) {\n      maxptime = codec.maxptime;\n    }\n  });\n  if (maxptime > 0) {\n    sdp += 'a=maxptime:' + maxptime + '\\r\\n';\n  }\n\n  if (caps.headerExtensions) {\n    caps.headerExtensions.forEach(function (extension) {\n      sdp += SDPUtils.writeExtmap(extension);\n    });\n  }\n  // FIXME: write fecMechanisms.\n  return sdp;\n};\n\n// Parses the SDP media section and returns an array of\n// RTCRtpEncodingParameters.\nSDPUtils.parseRtpEncodingParameters = function (mediaSection) {\n  var encodingParameters = [];\n  var description = SDPUtils.parseRtpParameters(mediaSection);\n  var hasRed = description.fecMechanisms.indexOf('RED') !== -1;\n  var hasUlpfec = description.fecMechanisms.indexOf('ULPFEC') !== -1;\n\n  // filter a=ssrc:... cname:, ignore PlanB-msid\n  var ssrcs = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:').map(function (line) {\n    return SDPUtils.parseSsrcMedia(line);\n  }).filter(function (parts) {\n    return parts.attribute === 'cname';\n  });\n  var primarySsrc = ssrcs.length > 0 && ssrcs[0].ssrc;\n  var secondarySsrc = void 0;\n\n  var flows = SDPUtils.matchPrefix(mediaSection, 'a=ssrc-group:FID').map(function (line) {\n    var parts = line.substring(17).split(' ');\n    return parts.map(function (part) {\n      return parseInt(part, 10);\n    });\n  });\n  if (flows.length > 0 && flows[0].length > 1 && flows[0][0] === primarySsrc) {\n    secondarySsrc = flows[0][1];\n  }\n\n  description.codecs.forEach(function (codec) {\n    if (codec.name.toUpperCase() === 'RTX' && codec.parameters.apt) {\n      var encParam = {\n        ssrc: primarySsrc,\n        codecPayloadType: parseInt(codec.parameters.apt, 10)\n      };\n      if (primarySsrc && secondarySsrc) {\n        encParam.rtx = { ssrc: secondarySsrc };\n      }\n      encodingParameters.push(encParam);\n      if (hasRed) {\n        encParam = JSON.parse(JSON.stringify(encParam));\n        encParam.fec = {\n          ssrc: primarySsrc,\n          mechanism: hasUlpfec ? 'red+ulpfec' : 'red'\n        };\n        encodingParameters.push(encParam);\n      }\n    }\n  });\n  if (encodingParameters.length === 0 && primarySsrc) {\n    encodingParameters.push({\n      ssrc: primarySsrc\n    });\n  }\n\n  // we support both b=AS and b=TIAS but interpret AS as TIAS.\n  var bandwidth = SDPUtils.matchPrefix(mediaSection, 'b=');\n  if (bandwidth.length) {\n    if (bandwidth[0].indexOf('b=TIAS:') === 0) {\n      bandwidth = parseInt(bandwidth[0].substring(7), 10);\n    } else if (bandwidth[0].indexOf('b=AS:') === 0) {\n      // use formula from JSEP to convert b=AS to TIAS value.\n      bandwidth = parseInt(bandwidth[0].substring(5), 10) * 1000 * 0.95 - 50 * 40 * 8;\n    } else {\n      bandwidth = undefined;\n    }\n    encodingParameters.forEach(function (params) {\n      params.maxBitrate = bandwidth;\n    });\n  }\n  return encodingParameters;\n};\n\n// parses http://draft.ortc.org/#rtcrtcpparameters*\nSDPUtils.parseRtcpParameters = function (mediaSection) {\n  var rtcpParameters = {};\n\n  // Gets the first SSRC. Note that with RTX there might be multiple\n  // SSRCs.\n  var remoteSsrc = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:').map(function (line) {\n    return SDPUtils.parseSsrcMedia(line);\n  }).filter(function (obj) {\n    return obj.attribute === 'cname';\n  })[0];\n  if (remoteSsrc) {\n    rtcpParameters.cname = remoteSsrc.value;\n    rtcpParameters.ssrc = remoteSsrc.ssrc;\n  }\n\n  // Edge uses the compound attribute instead of reducedSize\n  // compound is !reducedSize\n  var rsize = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-rsize');\n  rtcpParameters.reducedSize = rsize.length > 0;\n  rtcpParameters.compound = rsize.length === 0;\n\n  // parses the rtcp-mux attrіbute.\n  // Note that Edge does not support unmuxed RTCP.\n  var mux = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-mux');\n  rtcpParameters.mux = mux.length > 0;\n\n  return rtcpParameters;\n};\n\nSDPUtils.writeRtcpParameters = function (rtcpParameters) {\n  var sdp = '';\n  if (rtcpParameters.reducedSize) {\n    sdp += 'a=rtcp-rsize\\r\\n';\n  }\n  if (rtcpParameters.mux) {\n    sdp += 'a=rtcp-mux\\r\\n';\n  }\n  if (rtcpParameters.ssrc !== undefined && rtcpParameters.cname) {\n    sdp += 'a=ssrc:' + rtcpParameters.ssrc + ' cname:' + rtcpParameters.cname + '\\r\\n';\n  }\n  return sdp;\n};\n\n// parses either a=msid: or a=ssrc:... msid lines and returns\n// the id of the MediaStream and MediaStreamTrack.\nSDPUtils.parseMsid = function (mediaSection) {\n  var parts = void 0;\n  var spec = SDPUtils.matchPrefix(mediaSection, 'a=msid:');\n  if (spec.length === 1) {\n    parts = spec[0].substring(7).split(' ');\n    return { stream: parts[0], track: parts[1] };\n  }\n  var planB = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:').map(function (line) {\n    return SDPUtils.parseSsrcMedia(line);\n  }).filter(function (msidParts) {\n    return msidParts.attribute === 'msid';\n  });\n  if (planB.length > 0) {\n    parts = planB[0].value.split(' ');\n    return { stream: parts[0], track: parts[1] };\n  }\n};\n\n// SCTP\n// parses draft-ietf-mmusic-sctp-sdp-26 first and falls back\n// to draft-ietf-mmusic-sctp-sdp-05\nSDPUtils.parseSctpDescription = function (mediaSection) {\n  var mline = SDPUtils.parseMLine(mediaSection);\n  var maxSizeLine = SDPUtils.matchPrefix(mediaSection, 'a=max-message-size:');\n  var maxMessageSize = void 0;\n  if (maxSizeLine.length > 0) {\n    maxMessageSize = parseInt(maxSizeLine[0].substring(19), 10);\n  }\n  if (isNaN(maxMessageSize)) {\n    maxMessageSize = 65536;\n  }\n  var sctpPort = SDPUtils.matchPrefix(mediaSection, 'a=sctp-port:');\n  if (sctpPort.length > 0) {\n    return {\n      port: parseInt(sctpPort[0].substring(12), 10),\n      protocol: mline.fmt,\n      maxMessageSize: maxMessageSize\n    };\n  }\n  var sctpMapLines = SDPUtils.matchPrefix(mediaSection, 'a=sctpmap:');\n  if (sctpMapLines.length > 0) {\n    var parts = sctpMapLines[0].substring(10).split(' ');\n    return {\n      port: parseInt(parts[0], 10),\n      protocol: parts[1],\n      maxMessageSize: maxMessageSize\n    };\n  }\n};\n\n// SCTP\n// outputs the draft-ietf-mmusic-sctp-sdp-26 version that all browsers\n// support by now receiving in this format, unless we originally parsed\n// as the draft-ietf-mmusic-sctp-sdp-05 format (indicated by the m-line\n// protocol of DTLS/SCTP -- without UDP/ or TCP/)\nSDPUtils.writeSctpDescription = function (media, sctp) {\n  var output = [];\n  if (media.protocol !== 'DTLS/SCTP') {\n    output = ['m=' + media.kind + ' 9 ' + media.protocol + ' ' + sctp.protocol + '\\r\\n', 'c=IN IP4 0.0.0.0\\r\\n', 'a=sctp-port:' + sctp.port + '\\r\\n'];\n  } else {\n    output = ['m=' + media.kind + ' 9 ' + media.protocol + ' ' + sctp.port + '\\r\\n', 'c=IN IP4 0.0.0.0\\r\\n', 'a=sctpmap:' + sctp.port + ' ' + sctp.protocol + ' 65535\\r\\n'];\n  }\n  if (sctp.maxMessageSize !== undefined) {\n    output.push('a=max-message-size:' + sctp.maxMessageSize + '\\r\\n');\n  }\n  return output.join('');\n};\n\n// Generate a session ID for SDP.\n// https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-20#section-5.2.1\n// recommends using a cryptographically random +ve 64-bit value\n// but right now this should be acceptable and within the right range\nSDPUtils.generateSessionId = function () {\n  return Math.random().toString().substr(2, 22);\n};\n\n// Write boiler plate for start of SDP\n// sessId argument is optional - if not supplied it will\n// be generated randomly\n// sessVersion is optional and defaults to 2\n// sessUser is optional and defaults to 'thisisadapterortc'\nSDPUtils.writeSessionBoilerplate = function (sessId, sessVer, sessUser) {\n  var sessionId = void 0;\n  var version = sessVer !== undefined ? sessVer : 2;\n  if (sessId) {\n    sessionId = sessId;\n  } else {\n    sessionId = SDPUtils.generateSessionId();\n  }\n  var user = sessUser || 'thisisadapterortc';\n  // FIXME: sess-id should be an NTP timestamp.\n  return 'v=0\\r\\n' + 'o=' + user + ' ' + sessionId + ' ' + version + ' IN IP4 127.0.0.1\\r\\n' + 's=-\\r\\n' + 't=0 0\\r\\n';\n};\n\n// Gets the direction from the mediaSection or the sessionpart.\nSDPUtils.getDirection = function (mediaSection, sessionpart) {\n  // Look for sendrecv, sendonly, recvonly, inactive, default to sendrecv.\n  var lines = SDPUtils.splitLines(mediaSection);\n  for (var i = 0; i < lines.length; i++) {\n    switch (lines[i]) {\n      case 'a=sendrecv':\n      case 'a=sendonly':\n      case 'a=recvonly':\n      case 'a=inactive':\n        return lines[i].substring(2);\n      default:\n      // FIXME: What should happen here?\n    }\n  }\n  if (sessionpart) {\n    return SDPUtils.getDirection(sessionpart);\n  }\n  return 'sendrecv';\n};\n\nSDPUtils.getKind = function (mediaSection) {\n  var lines = SDPUtils.splitLines(mediaSection);\n  var mline = lines[0].split(' ');\n  return mline[0].substring(2);\n};\n\nSDPUtils.isRejected = function (mediaSection) {\n  return mediaSection.split(' ', 2)[1] === '0';\n};\n\nSDPUtils.parseMLine = function (mediaSection) {\n  var lines = SDPUtils.splitLines(mediaSection);\n  var parts = lines[0].substring(2).split(' ');\n  return {\n    kind: parts[0],\n    port: parseInt(parts[1], 10),\n    protocol: parts[2],\n    fmt: parts.slice(3).join(' ')\n  };\n};\n\nSDPUtils.parseOLine = function (mediaSection) {\n  var line = SDPUtils.matchPrefix(mediaSection, 'o=')[0];\n  var parts = line.substring(2).split(' ');\n  return {\n    username: parts[0],\n    sessionId: parts[1],\n    sessionVersion: parseInt(parts[2], 10),\n    netType: parts[3],\n    addressType: parts[4],\n    address: parts[5]\n  };\n};\n\n// a very naive interpretation of a valid SDP.\nSDPUtils.isValidSDP = function (blob) {\n  if (typeof blob !== 'string' || blob.length === 0) {\n    return false;\n  }\n  var lines = SDPUtils.splitLines(blob);\n  for (var i = 0; i < lines.length; i++) {\n    if (lines[i].length < 2 || lines[i].charAt(1) !== '=') {\n      return false;\n    }\n    // TODO: check the modifier a bit more.\n  }\n  return true;\n};\n\n// Expose public methods.\nif ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object') {\n  module.exports = SDPUtils;\n}","/*\n *  Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.\n *\n *  Use of this source code is governed by a BSD-style license\n *  that can be found in the LICENSE file in the root of the source\n *  tree.\n */\n/* eslint-env node */\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.removeExtmapAllowMixed = removeExtmapAllowMixed;\nexports.shimAddIceCandidateNullOrEmpty = shimAddIceCandidateNullOrEmpty;\nexports.shimConnectionState = shimConnectionState;\nexports.shimMaxMessageSize = shimMaxMessageSize;\nexports.shimParameterlessSetLocalDescription = shimParameterlessSetLocalDescription;\nexports.shimRTCIceCandidate = shimRTCIceCandidate;\nexports.shimRTCIceCandidateRelayProtocol = shimRTCIceCandidateRelayProtocol;\nexports.shimSendThrowTypeError = shimSendThrowTypeError;\nvar _sdp = _interopRequireDefault(require(\"sdp\"));\nvar utils = _interopRequireWildcard(require(\"./utils\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction shimRTCIceCandidate(window) {\n  // foundation is arbitrarily chosen as an indicator for full support for\n  // https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface\n  if (!window.RTCIceCandidate || window.RTCIceCandidate && 'foundation' in window.RTCIceCandidate.prototype) {\n    return;\n  }\n  var NativeRTCIceCandidate = window.RTCIceCandidate;\n  window.RTCIceCandidate = function RTCIceCandidate(args) {\n    // Remove the a= which shouldn't be part of the candidate string.\n    if (_typeof(args) === 'object' && args.candidate && args.candidate.indexOf('a=') === 0) {\n      args = JSON.parse(JSON.stringify(args));\n      args.candidate = args.candidate.substring(2);\n    }\n    if (args.candidate && args.candidate.length) {\n      // Augment the native candidate with the parsed fields.\n      var nativeCandidate = new NativeRTCIceCandidate(args);\n      var parsedCandidate = _sdp[\"default\"].parseCandidate(args.candidate);\n      for (var key in parsedCandidate) {\n        if (!(key in nativeCandidate)) {\n          Object.defineProperty(nativeCandidate, key, {\n            value: parsedCandidate[key]\n          });\n        }\n      }\n\n      // Override serializer to not serialize the extra attributes.\n      nativeCandidate.toJSON = function toJSON() {\n        return {\n          candidate: nativeCandidate.candidate,\n          sdpMid: nativeCandidate.sdpMid,\n          sdpMLineIndex: nativeCandidate.sdpMLineIndex,\n          usernameFragment: nativeCandidate.usernameFragment\n        };\n      };\n      return nativeCandidate;\n    }\n    return new NativeRTCIceCandidate(args);\n  };\n  window.RTCIceCandidate.prototype = NativeRTCIceCandidate.prototype;\n\n  // Hook up the augmented candidate in onicecandidate and\n  // addEventListener('icecandidate', ...)\n  utils.wrapPeerConnectionEvent(window, 'icecandidate', function (e) {\n    if (e.candidate) {\n      Object.defineProperty(e, 'candidate', {\n        value: new window.RTCIceCandidate(e.candidate),\n        writable: 'false'\n      });\n    }\n    return e;\n  });\n}\nfunction shimRTCIceCandidateRelayProtocol(window) {\n  if (!window.RTCIceCandidate || window.RTCIceCandidate && 'relayProtocol' in window.RTCIceCandidate.prototype) {\n    return;\n  }\n\n  // Hook up the augmented candidate in onicecandidate and\n  // addEventListener('icecandidate', ...)\n  utils.wrapPeerConnectionEvent(window, 'icecandidate', function (e) {\n    if (e.candidate) {\n      var parsedCandidate = _sdp[\"default\"].parseCandidate(e.candidate.candidate);\n      if (parsedCandidate.type === 'relay') {\n        // This is a libwebrtc-specific mapping of local type preference\n        // to relayProtocol.\n        e.candidate.relayProtocol = {\n          0: 'tls',\n          1: 'tcp',\n          2: 'udp'\n        }[parsedCandidate.priority >> 24];\n      }\n    }\n    return e;\n  });\n}\nfunction shimMaxMessageSize(window, browserDetails) {\n  if (!window.RTCPeerConnection) {\n    return;\n  }\n  if (!('sctp' in window.RTCPeerConnection.prototype)) {\n    Object.defineProperty(window.RTCPeerConnection.prototype, 'sctp', {\n      get: function get() {\n        return typeof this._sctp === 'undefined' ? null : this._sctp;\n      }\n    });\n  }\n  var sctpInDescription = function sctpInDescription(description) {\n    if (!description || !description.sdp) {\n      return false;\n    }\n    var sections = _sdp[\"default\"].splitSections(description.sdp);\n    sections.shift();\n    return sections.some(function (mediaSection) {\n      var mLine = _sdp[\"default\"].parseMLine(mediaSection);\n      return mLine && mLine.kind === 'application' && mLine.protocol.indexOf('SCTP') !== -1;\n    });\n  };\n  var getRemoteFirefoxVersion = function getRemoteFirefoxVersion(description) {\n    // TODO: Is there a better solution for detecting Firefox?\n    var match = description.sdp.match(/mozilla...THIS_IS_SDPARTA-(\\d+)/);\n    if (match === null || match.length < 2) {\n      return -1;\n    }\n    var version = parseInt(match[1], 10);\n    // Test for NaN (yes, this is ugly)\n    return version !== version ? -1 : version;\n  };\n  var getCanSendMaxMessageSize = function getCanSendMaxMessageSize(remoteIsFirefox) {\n    // Every implementation we know can send at least 64 KiB.\n    // Note: Although Chrome is technically able to send up to 256 KiB, the\n    //       data does not reach the other peer reliably.\n    //       See: https://bugs.chromium.org/p/webrtc/issues/detail?id=8419\n    var canSendMaxMessageSize = 65536;\n    if (browserDetails.browser === 'firefox') {\n      if (browserDetails.version < 57) {\n        if (remoteIsFirefox === -1) {\n          // FF < 57 will send in 16 KiB chunks using the deprecated PPID\n          // fragmentation.\n          canSendMaxMessageSize = 16384;\n        } else {\n          // However, other FF (and RAWRTC) can reassemble PPID-fragmented\n          // messages. Thus, supporting ~2 GiB when sending.\n          canSendMaxMessageSize = 2147483637;\n        }\n      } else if (browserDetails.version < 60) {\n        // Currently, all FF >= 57 will reset the remote maximum message size\n        // to the default value when a data channel is created at a later\n        // stage. :(\n        // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831\n        canSendMaxMessageSize = browserDetails.version === 57 ? 65535 : 65536;\n      } else {\n        // FF >= 60 supports sending ~2 GiB\n        canSendMaxMessageSize = 2147483637;\n      }\n    }\n    return canSendMaxMessageSize;\n  };\n  var getMaxMessageSize = function getMaxMessageSize(description, remoteIsFirefox) {\n    // Note: 65536 bytes is the default value from the SDP spec. Also,\n    //       every implementation we know supports receiving 65536 bytes.\n    var maxMessageSize = 65536;\n\n    // FF 57 has a slightly incorrect default remote max message size, so\n    // we need to adjust it here to avoid a failure when sending.\n    // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1425697\n    if (browserDetails.browser === 'firefox' && browserDetails.version === 57) {\n      maxMessageSize = 65535;\n    }\n    var match = _sdp[\"default\"].matchPrefix(description.sdp, 'a=max-message-size:');\n    if (match.length > 0) {\n      maxMessageSize = parseInt(match[0].substring(19), 10);\n    } else if (browserDetails.browser === 'firefox' && remoteIsFirefox !== -1) {\n      // If the maximum message size is not present in the remote SDP and\n      // both local and remote are Firefox, the remote peer can receive\n      // ~2 GiB.\n      maxMessageSize = 2147483637;\n    }\n    return maxMessageSize;\n  };\n  var origSetRemoteDescription = window.RTCPeerConnection.prototype.setRemoteDescription;\n  window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() {\n    this._sctp = null;\n    // Chrome decided to not expose .sctp in plan-b mode.\n    // As usual, adapter.js has to do an 'ugly worakaround'\n    // to cover up the mess.\n    if (browserDetails.browser === 'chrome' && browserDetails.version >= 76) {\n      var _this$getConfiguratio = this.getConfiguration(),\n        sdpSemantics = _this$getConfiguratio.sdpSemantics;\n      if (sdpSemantics === 'plan-b') {\n        Object.defineProperty(this, 'sctp', {\n          get: function get() {\n            return typeof this._sctp === 'undefined' ? null : this._sctp;\n          },\n          enumerable: true,\n          configurable: true\n        });\n      }\n    }\n    if (sctpInDescription(arguments[0])) {\n      // Check if the remote is FF.\n      var isFirefox = getRemoteFirefoxVersion(arguments[0]);\n\n      // Get the maximum message size the local peer is capable of sending\n      var canSendMMS = getCanSendMaxMessageSize(isFirefox);\n\n      // Get the maximum message size of the remote peer.\n      var remoteMMS = getMaxMessageSize(arguments[0], isFirefox);\n\n      // Determine final maximum message size\n      var maxMessageSize;\n      if (canSendMMS === 0 && remoteMMS === 0) {\n        maxMessageSize = Number.POSITIVE_INFINITY;\n      } else if (canSendMMS === 0 || remoteMMS === 0) {\n        maxMessageSize = Math.max(canSendMMS, remoteMMS);\n      } else {\n        maxMessageSize = Math.min(canSendMMS, remoteMMS);\n      }\n\n      // Create a dummy RTCSctpTransport object and the 'maxMessageSize'\n      // attribute.\n      var sctp = {};\n      Object.defineProperty(sctp, 'maxMessageSize', {\n        get: function get() {\n          return maxMessageSize;\n        }\n      });\n      this._sctp = sctp;\n    }\n    return origSetRemoteDescription.apply(this, arguments);\n  };\n}\nfunction shimSendThrowTypeError(window) {\n  if (!(window.RTCPeerConnection && 'createDataChannel' in window.RTCPeerConnection.prototype)) {\n    return;\n  }\n\n  // Note: Although Firefox >= 57 has a native implementation, the maximum\n  //       message size can be reset for all data channels at a later stage.\n  //       See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831\n\n  function wrapDcSend(dc, pc) {\n    var origDataChannelSend = dc.send;\n    dc.send = function send() {\n      var data = arguments[0];\n      var length = data.length || data.size || data.byteLength;\n      if (dc.readyState === 'open' && pc.sctp && length > pc.sctp.maxMessageSize) {\n        throw new TypeError('Message too large (can send a maximum of ' + pc.sctp.maxMessageSize + ' bytes)');\n      }\n      return origDataChannelSend.apply(dc, arguments);\n    };\n  }\n  var origCreateDataChannel = window.RTCPeerConnection.prototype.createDataChannel;\n  window.RTCPeerConnection.prototype.createDataChannel = function createDataChannel() {\n    var dataChannel = origCreateDataChannel.apply(this, arguments);\n    wrapDcSend(dataChannel, this);\n    return dataChannel;\n  };\n  utils.wrapPeerConnectionEvent(window, 'datachannel', function (e) {\n    wrapDcSend(e.channel, e.target);\n    return e;\n  });\n}\n\n/* shims RTCConnectionState by pretending it is the same as iceConnectionState.\n * See https://bugs.chromium.org/p/webrtc/issues/detail?id=6145#c12\n * for why this is a valid hack in Chrome. In Firefox it is slightly incorrect\n * since DTLS failures would be hidden. See\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1265827\n * for the Firefox tracking bug.\n */\nfunction shimConnectionState(window) {\n  if (!window.RTCPeerConnection || 'connectionState' in window.RTCPeerConnection.prototype) {\n    return;\n  }\n  var proto = window.RTCPeerConnection.prototype;\n  Object.defineProperty(proto, 'connectionState', {\n    get: function get() {\n      return {\n        completed: 'connected',\n        checking: 'connecting'\n      }[this.iceConnectionState] || this.iceConnectionState;\n    },\n    enumerable: true,\n    configurable: true\n  });\n  Object.defineProperty(proto, 'onconnectionstatechange', {\n    get: function get() {\n      return this._onconnectionstatechange || null;\n    },\n    set: function set(cb) {\n      if (this._onconnectionstatechange) {\n        this.removeEventListener('connectionstatechange', this._onconnectionstatechange);\n        delete this._onconnectionstatechange;\n      }\n      if (cb) {\n        this.addEventListener('connectionstatechange', this._onconnectionstatechange = cb);\n      }\n    },\n    enumerable: true,\n    configurable: true\n  });\n  ['setLocalDescription', 'setRemoteDescription'].forEach(function (method) {\n    var origMethod = proto[method];\n    proto[method] = function () {\n      if (!this._connectionstatechangepoly) {\n        this._connectionstatechangepoly = function (e) {\n          var pc = e.target;\n          if (pc._lastConnectionState !== pc.connectionState) {\n            pc._lastConnectionState = pc.connectionState;\n            var newEvent = new Event('connectionstatechange', e);\n            pc.dispatchEvent(newEvent);\n          }\n          return e;\n        };\n        this.addEventListener('iceconnectionstatechange', this._connectionstatechangepoly);\n      }\n      return origMethod.apply(this, arguments);\n    };\n  });\n}\nfunction removeExtmapAllowMixed(window, browserDetails) {\n  /* remove a=extmap-allow-mixed for webrtc.org < M71 */\n  if (!window.RTCPeerConnection) {\n    return;\n  }\n  if (browserDetails.browser === 'chrome' && browserDetails.version >= 71) {\n    return;\n  }\n  if (browserDetails.browser === 'safari' && browserDetails.version >= 605) {\n    return;\n  }\n  var nativeSRD = window.RTCPeerConnection.prototype.setRemoteDescription;\n  window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription(desc) {\n    if (desc && desc.sdp && desc.sdp.indexOf('\\na=extmap-allow-mixed') !== -1) {\n      var sdp = desc.sdp.split('\\n').filter(function (line) {\n        return line.trim() !== 'a=extmap-allow-mixed';\n      }).join('\\n');\n      // Safari enforces read-only-ness of RTCSessionDescription fields.\n      if (window.RTCSessionDescription && desc instanceof window.RTCSessionDescription) {\n        arguments[0] = new window.RTCSessionDescription({\n          type: desc.type,\n          sdp: sdp\n        });\n      } else {\n        desc.sdp = sdp;\n      }\n    }\n    return nativeSRD.apply(this, arguments);\n  };\n}\nfunction shimAddIceCandidateNullOrEmpty(window, browserDetails) {\n  // Support for addIceCandidate(null or undefined)\n  // as well as addIceCandidate({candidate: \"\", ...})\n  // https://bugs.chromium.org/p/chromium/issues/detail?id=978582\n  // Note: must be called before other polyfills which change the signature.\n  if (!(window.RTCPeerConnection && window.RTCPeerConnection.prototype)) {\n    return;\n  }\n  var nativeAddIceCandidate = window.RTCPeerConnection.prototype.addIceCandidate;\n  if (!nativeAddIceCandidate || nativeAddIceCandidate.length === 0) {\n    return;\n  }\n  window.RTCPeerConnection.prototype.addIceCandidate = function addIceCandidate() {\n    if (!arguments[0]) {\n      if (arguments[1]) {\n        arguments[1].apply(null);\n      }\n      return Promise.resolve();\n    }\n    // Firefox 68+ emits and processes {candidate: \"\", ...}, ignore\n    // in older versions.\n    // Native support for ignoring exists for Chrome M77+.\n    // Safari ignores as well, exact version unknown but works in the same\n    // version that also ignores addIceCandidate(null).\n    if ((browserDetails.browser === 'chrome' && browserDetails.version < 78 || browserDetails.browser === 'firefox' && browserDetails.version < 68 || browserDetails.browser === 'safari') && arguments[0] && arguments[0].candidate === '') {\n      return Promise.resolve();\n    }\n    return nativeAddIceCandidate.apply(this, arguments);\n  };\n}\n\n// Note: Make sure to call this ahead of APIs that modify\n// setLocalDescription.length\nfunction shimParameterlessSetLocalDescription(window, browserDetails) {\n  if (!(window.RTCPeerConnection && window.RTCPeerConnection.prototype)) {\n    return;\n  }\n  var nativeSetLocalDescription = window.RTCPeerConnection.prototype.setLocalDescription;\n  if (!nativeSetLocalDescription || nativeSetLocalDescription.length === 0) {\n    return;\n  }\n  window.RTCPeerConnection.prototype.setLocalDescription = function setLocalDescription() {\n    var _this = this;\n    var desc = arguments[0] || {};\n    if (_typeof(desc) !== 'object' || desc.type && desc.sdp) {\n      return nativeSetLocalDescription.apply(this, arguments);\n    }\n    // The remaining steps should technically happen when SLD comes off the\n    // RTCPeerConnection's operations chain (not ahead of going on it), but\n    // this is too difficult to shim. Instead, this shim only covers the\n    // common case where the operations chain is empty. This is imperfect, but\n    // should cover many cases. Rationale: Even if we can't reduce the glare\n    // window to zero on imperfect implementations, there's value in tapping\n    // into the perfect negotiation pattern that several browsers support.\n    desc = {\n      type: desc.type,\n      sdp: desc.sdp\n    };\n    if (!desc.type) {\n      switch (this.signalingState) {\n        case 'stable':\n        case 'have-local-offer':\n        case 'have-remote-pranswer':\n          desc.type = 'offer';\n          break;\n        default:\n          desc.type = 'answer';\n          break;\n      }\n    }\n    if (desc.sdp || desc.type !== 'offer' && desc.type !== 'answer') {\n      return nativeSetLocalDescription.apply(this, [desc]);\n    }\n    var func = desc.type === 'offer' ? this.createOffer : this.createAnswer;\n    return func.apply(this).then(function (d) {\n      return nativeSetLocalDescription.apply(_this, [d]);\n    });\n  };\n}\n","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.adapterFactory = adapterFactory;\nvar utils = _interopRequireWildcard(require(\"./utils\"));\nvar chromeShim = _interopRequireWildcard(require(\"./chrome/chrome_shim\"));\nvar firefoxShim = _interopRequireWildcard(require(\"./firefox/firefox_shim\"));\nvar safariShim = _interopRequireWildcard(require(\"./safari/safari_shim\"));\nvar commonShim = _interopRequireWildcard(require(\"./common_shim\"));\nvar sdp = _interopRequireWildcard(require(\"sdp\"));\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { \"default\": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj[\"default\"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n/*\n *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n *\n *  Use of this source code is governed by a BSD-style license\n *  that can be found in the LICENSE file in the root of the source\n *  tree.\n */\n\n// Browser shims.\n\n// Shimming starts here.\nfunction adapterFactory() {\n  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n    window = _ref.window;\n  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n    shimChrome: true,\n    shimFirefox: true,\n    shimSafari: true\n  };\n  // Utils.\n  var logging = utils.log;\n  var browserDetails = utils.detectBrowser(window);\n  var adapter = {\n    browserDetails: browserDetails,\n    commonShim: commonShim,\n    extractVersion: utils.extractVersion,\n    disableLog: utils.disableLog,\n    disableWarnings: utils.disableWarnings,\n    // Expose sdp as a convenience. For production apps include directly.\n    sdp: sdp\n  };\n\n  // Shim browser if found.\n  switch (browserDetails.browser) {\n    case 'chrome':\n      if (!chromeShim || !chromeShim.shimPeerConnection || !options.shimChrome) {\n        logging('Chrome shim is not included in this adapter release.');\n        return adapter;\n      }\n      if (browserDetails.version === null) {\n        logging('Chrome shim can not determine version, not shimming.');\n        return adapter;\n      }\n      logging('adapter.js shimming chrome.');\n      // Export to the adapter global object visible in the browser.\n      adapter.browserShim = chromeShim;\n\n      // Must be called before shimPeerConnection.\n      commonShim.shimAddIceCandidateNullOrEmpty(window, browserDetails);\n      commonShim.shimParameterlessSetLocalDescription(window, browserDetails);\n      chromeShim.shimGetUserMedia(window, browserDetails);\n      chromeShim.shimMediaStream(window, browserDetails);\n      chromeShim.shimPeerConnection(window, browserDetails);\n      chromeShim.shimOnTrack(window, browserDetails);\n      chromeShim.shimAddTrackRemoveTrack(window, browserDetails);\n      chromeShim.shimGetSendersWithDtmf(window, browserDetails);\n      chromeShim.shimGetStats(window, browserDetails);\n      chromeShim.shimSenderReceiverGetStats(window, browserDetails);\n      chromeShim.fixNegotiationNeeded(window, browserDetails);\n      commonShim.shimRTCIceCandidate(window, browserDetails);\n      commonShim.shimRTCIceCandidateRelayProtocol(window, browserDetails);\n      commonShim.shimConnectionState(window, browserDetails);\n      commonShim.shimMaxMessageSize(window, browserDetails);\n      commonShim.shimSendThrowTypeError(window, browserDetails);\n      commonShim.removeExtmapAllowMixed(window, browserDetails);\n      break;\n    case 'firefox':\n      if (!firefoxShim || !firefoxShim.shimPeerConnection || !options.shimFirefox) {\n        logging('Firefox shim is not included in this adapter release.');\n        return adapter;\n      }\n      logging('adapter.js shimming firefox.');\n      // Export to the adapter global object visible in the browser.\n      adapter.browserShim = firefoxShim;\n\n      // Must be called before shimPeerConnection.\n      commonShim.shimAddIceCandidateNullOrEmpty(window, browserDetails);\n      commonShim.shimParameterlessSetLocalDescription(window, browserDetails);\n      firefoxShim.shimGetUserMedia(window, browserDetails);\n      firefoxShim.shimPeerConnection(window, browserDetails);\n      firefoxShim.shimOnTrack(window, browserDetails);\n      firefoxShim.shimRemoveStream(window, browserDetails);\n      firefoxShim.shimSenderGetStats(window, browserDetails);\n      firefoxShim.shimReceiverGetStats(window, browserDetails);\n      firefoxShim.shimRTCDataChannel(window, browserDetails);\n      firefoxShim.shimAddTransceiver(window, browserDetails);\n      firefoxShim.shimGetParameters(window, browserDetails);\n      firefoxShim.shimCreateOffer(window, browserDetails);\n      firefoxShim.shimCreateAnswer(window, browserDetails);\n      commonShim.shimRTCIceCandidate(window, browserDetails);\n      commonShim.shimConnectionState(window, browserDetails);\n      commonShim.shimMaxMessageSize(window, browserDetails);\n      commonShim.shimSendThrowTypeError(window, browserDetails);\n      break;\n    case 'safari':\n      if (!safariShim || !options.shimSafari) {\n        logging('Safari shim is not included in this adapter release.');\n        return adapter;\n      }\n      logging('adapter.js shimming safari.');\n      // Export to the adapter global object visible in the browser.\n      adapter.browserShim = safariShim;\n\n      // Must be called before shimCallbackAPI.\n      commonShim.shimAddIceCandidateNullOrEmpty(window, browserDetails);\n      commonShim.shimParameterlessSetLocalDescription(window, browserDetails);\n      safariShim.shimRTCIceServerUrls(window, browserDetails);\n      safariShim.shimCreateOfferLegacy(window, browserDetails);\n      safariShim.shimCallbacksAPI(window, browserDetails);\n      safariShim.shimLocalStreamsAPI(window, browserDetails);\n      safariShim.shimRemoteStreamsAPI(window, browserDetails);\n      safariShim.shimTrackEventTransceiver(window, browserDetails);\n      safariShim.shimGetUserMedia(window, browserDetails);\n      safariShim.shimAudioContext(window, browserDetails);\n      commonShim.shimRTCIceCandidate(window, browserDetails);\n      commonShim.shimRTCIceCandidateRelayProtocol(window, browserDetails);\n      commonShim.shimMaxMessageSize(window, browserDetails);\n      commonShim.shimSendThrowTypeError(window, browserDetails);\n      commonShim.removeExtmapAllowMixed(window, browserDetails);\n      break;\n    default:\n      logging('Unsupported browser!');\n      break;\n  }\n  return adapter;\n}\n","/*\n *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n *\n *  Use of this source code is governed by a BSD-style license\n *  that can be found in the LICENSE file in the root of the source\n *  tree.\n */\n/* eslint-env node */\n\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports[\"default\"] = void 0;\nvar _adapter_factory = require(\"./adapter_factory.js\");\nvar adapter = (0, _adapter_factory.adapterFactory)({\n  window: typeof window === 'undefined' ? undefined : window\n});\nvar _default = adapter;\nexports[\"default\"] = _default;\n","export const enum PlayStatus {\r\n  INIT,\r\n  PLAYING,\r\n  WAITING,\r\n}\r\n\r\nexport const enum DISCONNECT_CODE {\r\n  MANUAL,\r\n  RECONNECT,\r\n}\r\n\r\nexport const enum PlayerEvents {\r\n  ERROR = 'error',\r\n  CONNECTED = 'connected',\r\n  DESTROY = 'destroy',\r\n  STATS = 'stats',\r\n  WAITING = 'waiting',\r\n  WAITING_STOP = 'waiting_stop',\r\n  EMPTY = 'empty',\r\n  RECONNECT = 'reconnect',\r\n  PULL_START = 'pull_start',\r\n  PULL_SUCCESS = 'pull_success',\r\n}\r\n\r\nexport const enum ErrorCode {\r\n  WEBRTC_FAIL = -1001,\r\n  PULL_STREAM_FAIL = -1002,\r\n  STREAM_DISCONNECT = -1003,\r\n  DECODE_FAIL = -1004,\r\n}\r\n","const USER_AGENT = window.navigator.userAgent;\r\n\r\nexport function isWebRTCAPISupported() {\r\n  const arr = ['RTCPeerConnection', 'webkitRTCPeerConnection', 'mozRTCPeerConnection', 'RTCIceGatherer'];\r\n\r\n  for (let i = 0; i < arr.length; i++) {\r\n    if (arr[i] in window) {\r\n      return true;\r\n    }\r\n  }\r\n\r\n  return false;\r\n}\r\n\r\nexport const IS_FIREFOX = /firefox\\/(\\d+)\\./i.test(USER_AGENT);\r\nexport const IS_SAFARI = /safari\\/(\\d+)\\./i.test(USER_AGENT) && !/chrome\\/(\\d+)\\./i.test(USER_AGENT);\r\nexport const IS_IOS = /iPad|iPhone|iPod/i.test(USER_AGENT);\r\nexport const IOS_VERSION_ARR = function() {\r\n  const matches = USER_AGENT.match(/OS (\\d+)_(\\d+)_?(\\d+)?/i);\r\n  return matches ? [parseInt(matches[1], 10), parseInt(matches[2], 10), parseInt(matches[3] || '0', 10)] : [];\r\n}();\r\n\r\nexport const uuid = (len = 21) => crypto.getRandomValues(new Uint8Array(len)).reduce(((e, t) => e += (t &= 63) < 36 ? t.toString(36) : t < 62 ? (t - 26).toString(36).toUpperCase() : t > 62 ? '-' : '_'), '');\r\n\r\ndeclare global {\r\n  interface RTCStatsReport {\r\n    get(id: string): any;\r\n  }\r\n}\r\n\r\nexport const formatStatsReport = (stats: RTCStatsReport, lastStats: RTCStatsReport = null) => {\r\n  if (!lastStats) return;\r\n\r\n  let videoTrackReportId = null;\r\n  let videoRtpReportId = null;\r\n  let audioTrackReportId = null;\r\n  let audioRtpReportId = null;\r\n\r\n  stats.forEach(it => {\r\n    if (it.type === 'track') {\r\n      if (it.kind === 'video' || it.frameWidth) {\r\n        videoTrackReportId = it.id;\r\n      } else if (it.kind === 'audio' || it.audioLevel) {\r\n        audioTrackReportId = it.id;\r\n      }\r\n    }\r\n    if (it.type === 'inbound-rtp') {\r\n      if (it.kind === 'video' || it.mediaType === 'video') {\r\n        videoRtpReportId = it.id;\r\n      } else if (it.kind === 'audio' || it.mediaType === 'audio') {\r\n        audioRtpReportId = it.id;\r\n      }\r\n    }\r\n  });\r\n\r\n  const videoTrackReport = stats.get(videoTrackReportId);\r\n  const videoRtpReport = stats.get(videoRtpReportId);\r\n  const lastVideoTrackReport = lastStats.get(videoTrackReportId);\r\n  const lastVideoRtpReport = lastStats.get(videoRtpReportId);\r\n\r\n  let duration = 0;\r\n  if (undefined !== videoRtpReport?.timestamp && undefined !== lastVideoRtpReport?.timestamp) {\r\n    duration = (videoRtpReport.timestamp - lastVideoRtpReport.timestamp) / 1000;\r\n  }\r\n\r\n  let videoCodec = undefined;\r\n  if (videoRtpReport?.codecId) {\r\n    const codecReport = stats.get(videoRtpReport.codecId);\r\n    if (codecReport) {\r\n      const { mimeType, payloadType, sdpFmtpLine } = codecReport;\r\n      videoCodec = mimeType?.replace('video/', '') || '';\r\n      if (payloadType && sdpFmtpLine) {\r\n        videoCodec = videoCodec + ' (' + payloadType + ', ' + sdpFmtpLine + ')';\r\n      }\r\n    }\r\n  }\r\n\r\n  let framesPerSecond = undefined;\r\n  if (undefined !== videoRtpReport?.framesPerSecond) {\r\n    framesPerSecond = videoRtpReport.framesPerSecond;\r\n  } else if (undefined !== videoRtpReport?.framerateMean) {\r\n    framesPerSecond = videoRtpReport.framerateMean;\r\n  } else if (undefined !== videoTrackReport?.framesReceived && undefined !== lastVideoTrackReport?.framesReceived && duration) {\r\n    framesPerSecond = (videoTrackReport.framesReceived - lastVideoTrackReport.framesReceived) / duration;\r\n  }\r\n\r\n  let framesDecodedPerSecond = undefined;\r\n  if (undefined !== videoRtpReport?.framesDecoded && undefined !== lastVideoRtpReport?.framesDecoded && duration) {\r\n    framesDecodedPerSecond = (videoRtpReport.framesDecoded - lastVideoRtpReport.framesDecoded) / duration;\r\n  }\r\n\r\n  let videoBitrate = undefined;\r\n  if (undefined !== videoRtpReport?.bytesReceived && undefined !== lastVideoRtpReport?.bytesReceived && duration) {\r\n    videoBitrate = 8 * (videoRtpReport.bytesReceived - lastVideoRtpReport.bytesReceived) / duration;\r\n  }\r\n\r\n  let videoJitter = undefined;\r\n  if (undefined !== videoTrackReport?.jitterBufferDelay && undefined !== videoTrackReport?.jitterBufferEmittedCount && undefined !== lastVideoTrackReport?.jitterBufferDelay && undefined !== lastVideoTrackReport?.jitterBufferEmittedCount) {\r\n    videoJitter = videoTrackReport.jitterBufferEmittedCount - lastVideoTrackReport.jitterBufferEmittedCount ? (videoTrackReport.jitterBufferDelay - lastVideoTrackReport.jitterBufferDelay) / (videoTrackReport.jitterBufferEmittedCount - lastVideoTrackReport.jitterBufferEmittedCount) * 1e3 : videoTrackReport.jitterBufferDelay / videoTrackReport.jitterBufferEmittedCount * 1e3;\r\n  }\r\n\r\n  let frameDecodeAvgTime = undefined;\r\n  if (undefined !== videoRtpReport?.totalDecodeTime && undefined !== videoTrackReport?.framesDecoded && undefined !== lastVideoRtpReport?.totalDecodeTime && undefined !== lastVideoTrackReport?.framesDecoded) {\r\n    frameDecodeAvgTime = videoTrackReport.framesDecoded - lastVideoTrackReport.framesDecoded ? (videoRtpReport.totalDecodeTime - lastVideoRtpReport.totalDecodeTime) / (videoTrackReport.framesDecoded - lastVideoTrackReport.framesDecoded) * 1e3 : videoRtpReport.totalDecodeTime / videoTrackReport.framesDecoded * 1e3;\r\n  }\r\n\r\n  let audioTrackReport = stats.get(audioTrackReportId);\r\n  let audioRtpReport = stats.get(audioRtpReportId);\r\n  let lastAudioTrackReport = lastStats.get(audioTrackReportId);\r\n  let lastAudioRtpReport = lastStats.get(audioRtpReportId);\r\n\r\n  if (undefined !== audioRtpReport?.timestamp && undefined !== lastAudioRtpReport?.timestamp) {\r\n    duration = (audioRtpReport.timestamp - lastAudioRtpReport.timestamp) / 1000;\r\n  }\r\n\r\n  let audioCodec = undefined;\r\n  if (audioRtpReport?.codecId) {\r\n    const codecReport = stats.get(audioRtpReport.codecId);\r\n    if (codecReport) {\r\n      const { mimeType, payloadType, sdpFmtpLine } = codecReport;\r\n      audioCodec = mimeType?.replace('audio/', '') || '';\r\n      if (payloadType && sdpFmtpLine) {\r\n        audioCodec = audioCodec + ' (' + payloadType + ', ' + sdpFmtpLine + ')';\r\n      }\r\n    }\r\n  }\r\n\r\n  let audioLevel = undefined;\r\n  if (undefined !== audioTrackReport?.audioLevel) {\r\n    audioLevel = audioTrackReport?.audioLevel;\r\n  } else if (undefined !== audioRtpReport?.audioLevel) {\r\n    audioLevel = audioRtpReport?.audioLevel;\r\n  }\r\n\r\n  let audioBitrate = undefined;\r\n  if (undefined !== audioRtpReport?.bytesReceived && undefined !== lastAudioRtpReport?.bytesReceived && duration) {\r\n    audioBitrate = 8 * (audioRtpReport.bytesReceived - lastAudioRtpReport.bytesReceived) / duration;\r\n  }\r\n\r\n  let audioJitter = undefined;\r\n  if (undefined !== audioTrackReport?.jitterBufferDelay && undefined !== audioTrackReport?.jitterBufferEmittedCount && undefined !== lastAudioTrackReport?.jitterBufferDelay && undefined !== lastAudioTrackReport?.jitterBufferEmittedCount) {\r\n    audioJitter = audioTrackReport.jitterBufferEmittedCount - lastAudioTrackReport.jitterBufferEmittedCount ? (audioTrackReport.jitterBufferDelay - lastAudioTrackReport.jitterBufferDelay) / (audioTrackReport.jitterBufferEmittedCount - lastAudioTrackReport.jitterBufferEmittedCount) * 1e3 : audioTrackReport.jitterBufferDelay / audioTrackReport.jitterBufferEmittedCount * 1e3;\r\n  }\r\n\r\n  return {\r\n    timestamp: (videoRtpReport?.timestamp) || (audioRtpReport?.timestamp),\r\n    video: {\r\n      codec: videoCodec,\r\n      bitrate: videoBitrate && Number(videoBitrate.toFixed(2)),\r\n      framesPerSecond: framesPerSecond && Math.round(framesPerSecond),\r\n      framesDecodedPerSecond: framesDecodedPerSecond && Math.round(framesDecodedPerSecond),\r\n      frameWidth: videoTrackReport?.frameWidth,\r\n      frameHeight: videoTrackReport?.frameHeight,\r\n      framesDecoded: videoRtpReport?.framesDecoded,\r\n      framesDropped: videoTrackReport?.framesDropped,\r\n      framesReceived: videoTrackReport?.framesReceived,\r\n      packetsLost: videoRtpReport?.packetsLost,\r\n      packetsReceived: videoRtpReport?.packetsReceived,\r\n      nackCount: videoRtpReport?.nackCount,\r\n      firCount: videoRtpReport?.firCount,\r\n      pliCount: videoRtpReport?.pliCount,\r\n      jitterBufferDelay: videoJitter && Number(videoJitter.toFixed(2)),\r\n      frameDecodeAvgTime: frameDecodeAvgTime && Number(frameDecodeAvgTime.toFixed(2)),\r\n    },\r\n    audio: {\r\n      codec: audioCodec,\r\n      audioLevel: audioLevel,\r\n      bitrate: audioBitrate && Number(audioBitrate.toFixed(2)),\r\n      packetsLost: audioRtpReport?.packetsLost,\r\n      packetsReceived: audioRtpReport?.packetsReceived,\r\n      jitterBufferDelay: audioJitter && Number(audioJitter.toFixed(2)),\r\n    },\r\n  };\r\n};\r\n\r\nexport const formatDate = (date: Date, format: string) => {\r\n    const o = {\r\n      'M+': date.getMonth() + 1, // 月份\r\n      'd+': date.getDate(), // 日\r\n      'h+': date.getHours() % 12 === 0 ? 12 : date.getHours() % 12, // 小时\r\n      'H+': date.getHours(), // 小时\r\n      'm+': date.getMinutes(), // 分\r\n      's+': date.getSeconds(), // 秒\r\n      'q+': Math.floor((date.getMonth() + 3) / 3), // 季度\r\n      S: date.getMilliseconds(), // 毫秒\r\n      a: date.getHours() < 12 ? '上午' : '下午', // 上午/下午\r\n      A: date.getHours() < 12 ? 'AM' : 'PM', // AM/PM\r\n    };\r\n    if (/(y+)/.test(format)) {\r\n      format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));\r\n    }\r\n    for (let k in o) {\r\n      if (new RegExp('(' + k + ')').test(format)) {\r\n        format = format.replace(\r\n          RegExp.$1,\r\n          RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)\r\n        );\r\n      }\r\n    }\r\n    return format;\r\n}\r\n","import { formatDate } from './utils';\r\n\r\nexport enum LogMethod {\r\n  TRACE = 'trace',\r\n  DEBUG = 'debug',\r\n  INFO = 'info',\r\n  WARN = 'warn',\r\n  ERROR = 'error',\r\n}\r\n\r\nconst LogLevel: { [name in LogMethod]: number } = {\r\n  [LogMethod.TRACE]: 0,\r\n  [LogMethod.DEBUG]: 1,\r\n  [LogMethod.INFO]: 2,\r\n  [LogMethod.WARN]: 3,\r\n  [LogMethod.ERROR]: 4,\r\n};\r\n\r\nclass Logger {\r\n  private static maxCount: number = 100000;\r\n  private static discardStep: number = 10000;\r\n  private static logLevel: number = 2;\r\n  private tag: string;\r\n\r\n  static logs: Array<any> = [];\r\n\r\n  static setConfig(maxCount: number = 100000, discardStep: number = 10000) {\r\n    if (maxCount !== Logger.maxCount && discardStep > 0) {\r\n      Logger.maxCount = Math.floor(maxCount);\r\n      Logger.discardStep = Math.floor(discardStep);\r\n    }\r\n  }\r\n\r\n  constructor(tag: string = '') {\r\n    this.tag = tag;\r\n  }\r\n\r\n  get logList() {\r\n    return Logger.logs;\r\n  }\r\n\r\n  private get logTimeTag() {\r\n    return `[${formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')}]`;\r\n  }\r\n\r\n  public setLevel(level: LogMethod) {\r\n    if (level && LogLevel[level] !== undefined) {\r\n      Logger.logLevel = LogLevel[level];\r\n    }\r\n  }\r\n\r\n  trace(...args: any[]) {\r\n    this.l(LogMethod.TRACE, ...args);\r\n  }\r\n\r\n  debug(...args: any[]) {\r\n    this.l(LogMethod.DEBUG, ...args);\r\n  }\r\n\r\n  info(...args: any[]) {\r\n    this.l(LogMethod.INFO, ...args);\r\n  }\r\n\r\n  warn(...args: any[]) {\r\n    this.l(LogMethod.WARN, ...args);\r\n  }\r\n\r\n  error(...args: any[]) {\r\n    this.l(LogMethod.ERROR, ...args);\r\n  }\r\n\r\n  private pushLog(args: any[]) {\r\n    if (Logger.logs.length > Logger.maxCount) {\r\n      Logger.logs.splice(0, Logger.discardStep);\r\n    }\r\n    Logger.logs.push(`${args.join(' ')}\\n`);\r\n  }\r\n\r\n  private l(logLevel: LogMethod, ...args: any[]) {\r\n    if (this.tag) {\r\n      args.unshift(`[${this.tag}] >`);\r\n    }\r\n    args.unshift(this.logTimeTag);\r\n\r\n    this.pushLog(args);\r\n\r\n    let methodName = logLevel.toLowerCase();\r\n    if (logLevel === LogMethod.DEBUG) {\r\n      methodName = 'log';\r\n    }\r\n    if (window.console && Logger.logLevel <= LogLevel[logLevel]) {\r\n      console[methodName](...args);\r\n    }\r\n  }\r\n\r\n  public download() {\r\n    if (Logger.logs.length <= 0) return;\r\n\r\n    const blob = new Blob(Logger.logs, { type: 'text/plain' });\r\n    const objectURL = URL.createObjectURL(blob);\r\n    const anchor = document.createElement('a');\r\n    anchor.href = objectURL;\r\n    anchor.download = `log-${Date.now()}.txt`;\r\n\r\n    anchor.click();\r\n    URL.revokeObjectURL(objectURL);\r\n  }\r\n}\r\n\r\nexport const logger: Logger = new Logger();\r\n\r\nexport default Logger;\r\n","import { DISCONNECT_CODE } from './enums';\r\nimport Logger from './logger';\r\nimport { IS_FIREFOX } from './utils';\r\n\r\ntype IWebRTCConnectionCallbacks = {\r\n  onTrack?: (track: MediaStreamTrack) => void;\r\n  onError?: (msg: string) => void;\r\n  onSetLocalDescription?: (offer: RTCSessionDescriptionInit) => void;\r\n  onDisconnect?: (reason: { code: DISCONNECT_CODE; msg: string }) => void;\r\n  onConnect?: () => void;\r\n};\r\n\r\ntype IRTCConnectionConfig = {\r\n  rtcConfig: RTCConfiguration;\r\n  offerConfig;\r\n};\r\n\r\nenum ConnectionState {\r\n  DISCONNECTED,\r\n  CONNECTED,\r\n}\r\n\r\nconst logger = new Logger('WebRTCConnection');\r\n\r\nexport default class WebRTCConnection {\r\n  private peerConnection: RTCPeerConnection;\r\n  private connectStatus: ConnectionState = ConnectionState.DISCONNECTED;\r\n  private callbacks: IWebRTCConnectionCallbacks;\r\n\r\n  constructor(callbacks: IWebRTCConnectionCallbacks = {}) {\r\n    this.callbacks = callbacks;\r\n  }\r\n\r\n  initPeerConnection(config: IRTCConnectionConfig) {\r\n    if (this.peerConnection) {\r\n      logger.warn('peerConnection already exist');\r\n      return;\r\n    }\r\n\r\n    const rtcConfig = {\r\n      iceServers: [],\r\n      sdpSemantics: 'unified-plan',\r\n      bundlePolicy: 'max-bundle',\r\n      rtcpMuxPolicy: 'require',\r\n      tcpCandidatePolicy: 'disable',\r\n      IceTransportsType: 'nohost',\r\n      ...(config.rtcConfig ?? {}),\r\n    } as RTCConfiguration;\r\n\r\n    try {\r\n      logger.debug('rtcConfig:', rtcConfig);\r\n\r\n      this.peerConnection = new RTCPeerConnection(rtcConfig);\r\n    } catch (err) {\r\n      console.warn(err);\r\n\r\n      // DOMException: Failed to construct 'RTCPeerConnection': Cannot create so many PeerConnections\r\n      if ('ReferenceError' === err.name && err.message.includes('RTCPeerConnection')) {\r\n        logger.warn('Not Support RTCPeerConnection!');\r\n        this.callbacks.onError?.('Not support RTCPeerConnection');\r\n      } else {\r\n        this.callbacks.onError?.(err?.message || 'Create RTCPeerConnection failed');\r\n      }\r\n      return;\r\n    }\r\n\r\n    this.peerConnection.addEventListener('track', this.onTrack);\r\n    this.peerConnection.addEventListener('iceconnectionstatechange', this.onIceConnectionStateChange);\r\n    this.peerConnection.addEventListener('icecandidate', this.onIceCandidate);\r\n    this.peerConnection.addEventListener('signalingstatechange', this.onSignalingStateChange);\r\n    this.peerConnection.addEventListener('connectionstatechange', this.onConnectionStateChange);\r\n    this.peerConnection.addEventListener('negotiationneeded', this.onNegotiationNeeded);\r\n\r\n    this.createOffer(config.offerConfig);\r\n  }\r\n\r\n  disconnect(reason: { code: DISCONNECT_CODE; msg: string } = {} as any) {\r\n    const { code = DISCONNECT_CODE.MANUAL, msg = '' } = reason;\r\n\r\n    logger.warn('disconnect ->', code === 1 ? 'reconnect' : 'manual', msg);\r\n\r\n    this.connectStatus = ConnectionState.DISCONNECTED;\r\n\r\n    if (this.peerConnection) {\r\n      this.peerConnection.removeEventListener('track', this.onTrack);\r\n      this.peerConnection.removeEventListener('iceconnectionstatechange', this.onIceConnectionStateChange);\r\n      this.peerConnection.removeEventListener('icecandidate', this.onIceCandidate);\r\n      this.peerConnection.removeEventListener('signalingstatechange', this.onSignalingStateChange);\r\n      this.peerConnection.removeEventListener('connectionstatechange', this.onConnectionStateChange);\r\n      this.peerConnection.removeEventListener('negotiationneeded', this.onNegotiationNeeded);\r\n      this.peerConnection.close();\r\n      this.peerConnection = null;\r\n    }\r\n\r\n    this.callbacks.onDisconnect?.({ code, msg });\r\n  }\r\n\r\n  getStats() {\r\n    return this.peerConnection?.getStats();\r\n  }\r\n\r\n  private async createOffer(config: RTCOfferOptions & { sdpTransform }) {\r\n    try {\r\n      const { offerToReceiveAudio, offerToReceiveVideo, sdpTransform = (sdp: string) => sdp } = config;\r\n      const enableAddTransceiver = !!this.peerConnection.addTransceiver;\r\n      if (!enableAddTransceiver) {\r\n        logger.warn('PeerConnection not support addTransceiver');\r\n      } else {\r\n        offerToReceiveAudio && this.peerConnection.addTransceiver('audio', {\r\n          direction: 'recvonly',\r\n        });\r\n        offerToReceiveVideo && this.peerConnection.addTransceiver('video', {\r\n          direction: 'recvonly',\r\n        });\r\n      }\r\n\r\n      const offerConfig = { voiceActivityDetection: false, ...config };\r\n\r\n      logger.debug('offerConfig:', offerConfig);\r\n\r\n      // @ts-ignore\r\n      const offer = await this.peerConnection.createOffer(offerConfig);\r\n      logger.debug('createOffer ->');\r\n      logger.debug(offer.sdp);\r\n\r\n      // update sdp before setLocalDescription\r\n      if (sdpTransform && typeof sdpTransform === 'function') {\r\n        offer.sdp = sdpTransform(offer.sdp);\r\n      }\r\n\r\n      await this.setLocalDescription(offer);\r\n    } catch (err) {\r\n      logger.warn('create offer failed:', err);\r\n      this.disconnect({\r\n        code: DISCONNECT_CODE.RECONNECT,\r\n        msg: 'create offer failed',\r\n      });\r\n      this.callbacks.onError?.('create offer failed');\r\n    }\r\n  }\r\n\r\n  private async setLocalDescription(offer: RTCSessionDescriptionInit) {\r\n    try {\r\n      logger.debug('setLocalDescription ->');\r\n      logger.debug(offer.sdp);\r\n\r\n      await this.peerConnection.setLocalDescription(offer);\r\n      this.callbacks.onSetLocalDescription?.(offer);\r\n    } catch (err) {\r\n      logger.warn('setLocalDescription failed:', err);\r\n      this.callbacks.onError?.('setLocalDescription failed');\r\n    }\r\n  }\r\n\r\n  public async setRemoteDescription(answer: RTCSessionDescriptionInit) {\r\n    try {\r\n      logger.debug('setRemoteDescription ->');\r\n      logger.debug(answer.sdp);\r\n      await this.peerConnection.setRemoteDescription(new RTCSessionDescription(answer));\r\n    } catch (err) {\r\n      logger.warn('setRemoteDescription failed:', err);\r\n      this.callbacks.onError?.('setRemoteDescription failed');\r\n    }\r\n  }\r\n\r\n  private onTrack = (evt: RTCPeerConnectionEventMap['track']) => {\r\n    logger.debug('onTrack ->', evt.track, evt.streams, evt);\r\n\r\n    this.callbacks.onTrack?.(evt.track);\r\n  };\r\n\r\n  private onIceConnectionStateChange = (evt: RTCPeerConnectionEventMap['iceconnectionstatechange']) => {\r\n    logger.debug('onIceConnectionStateChange ->', this.peerConnection.iceConnectionState, evt);\r\n    switch (this.peerConnection.iceConnectionState) {\r\n      case 'failed':\r\n      case 'disconnected':\r\n        logger.warn('IceConnection disconnected');\r\n        this.disconnect({ code: DISCONNECT_CODE.RECONNECT, msg: 'IceConnection disconnected' });\r\n        break;\r\n      case 'connected':\r\n      case 'completed':\r\n        logger.debug('IceConnection connected');\r\n        if (!IS_FIREFOX) {\r\n          return;\r\n        }\r\n        if (this.connectStatus === ConnectionState.CONNECTED) {\r\n          return;\r\n        }\r\n        this.connectStatus = ConnectionState.CONNECTED;\r\n        this.callbacks.onConnect?.();\r\n        break;\r\n    }\r\n  };\r\n\r\n  private onIceCandidate = (evt: RTCPeerConnectionEventMap['icecandidate']) => {\r\n    logger.debug('onIceCandidate ->', evt);\r\n  };\r\n\r\n  private onSignalingStateChange = (evt: RTCPeerConnectionEventMap['signalingstatechange']) => {\r\n    logger.debug('onSignalingStateChange ->', this.peerConnection.signalingState, evt);\r\n  };\r\n\r\n  private onConnectionStateChange = (evt: RTCPeerConnectionEventMap['connectionstatechange']) => {\r\n    logger.debug('onConnectionStateChange ->', this.peerConnection.connectionState, evt);\r\n    switch (this.peerConnection.connectionState) {\r\n      case 'failed':\r\n      case 'disconnected':\r\n        logger.warn('Connection disconnected');\r\n        this.disconnect({ code: DISCONNECT_CODE.RECONNECT, msg: 'Connection disconnected' });\r\n        break;\r\n      case 'connected':\r\n        logger.debug('Connection connected');\r\n        if (this.connectStatus === ConnectionState.CONNECTED) {\r\n          return;\r\n        }\r\n        this.connectStatus = ConnectionState.CONNECTED;\r\n        this.callbacks.onConnect?.();\r\n        break;\r\n    }\r\n  };\r\n\r\n  private onNegotiationNeeded = (evt: RTCPeerConnectionEventMap['negotiationneeded']) => {\r\n    logger.debug('onNegotiationNeeded ->', evt);\r\n  };\r\n}\r\n","import { IPlayerConfig } from '../types';\r\n\r\nexport default abstract class SignalController {\r\n  protected env: string = 'prod';\r\n  protected fetchTimeout: number = 2000;\r\n  protected timerId: NodeJS.Timeout;\r\n  protected abortController: AbortController;\r\n  protected fetchSetup: IPlayerConfig['fetchSetup'];\r\n\r\n  constructor(props: Pick<IPlayerConfig, 'env' | 'fetchTimeout' | 'fetchSetup'>) {\r\n    this.env = props.env;\r\n    this.fetchTimeout = props.fetchTimeout;\r\n    this.fetchSetup = props.fetchSetup || ((url, options) => ({ url, options }));\r\n  }\r\n\r\n  public fetchPeerConnectionConfig(playUrl: string) {\r\n    return Promise.resolve<RTCConfiguration>({});\r\n  }\r\n\r\n  public abstract fetchStreamAnswer(offer: RTCSessionDescriptionInit, playUrl: string): Promise<RTCSessionDescriptionInit>;\r\n\r\n  public abstract fetchStreamSdp(offer: RTCSessionDescriptionInit, playUrl: string): Promise<RTCSessionDescriptionInit>;\r\n\r\n  public fetchStopStream(playUrl: string) {\r\n    return Promise.resolve<any>(undefined);\r\n  }\r\n\r\n  public sdpTransform(sdp: string) {\r\n    return sdp;\r\n  }\r\n\r\n  public abort(reason: string) {\r\n    this.clearTimeout();\r\n\r\n    if (this.abortController) {\r\n      try {\r\n        this.abortController.abort(reason);\r\n        console.log('abort', reason);\r\n        this.abortController = null;\r\n      } catch (e) {}\r\n    }\r\n  }\r\n\r\n  public clearTimeout() {\r\n    if (this.timerId) {\r\n      clearTimeout(this.timerId);\r\n      this.timerId = null;\r\n    }\r\n  }\r\n}\r\n","import SignalController from './index';\r\n\r\nconst replaceProtocol = (location.protocol.startsWith('http') ? location.protocol : 'http:') + '//';\r\n\r\nexport default class GbsSignalController extends SignalController {\r\n  /**\r\n   * Copy from jswebrtc.js\r\n   * @see https://github.com/kernelj/jswebrtc/blob/master/src/jswebrtc.js#L49\r\n   * @param {string} streamUrl\r\n   */\r\n  private parseUrl(streamUrl: string) {\r\n    const url = new URL(streamUrl.replace('rtmp://', replaceProtocol).replace('webrtc://', replaceProtocol).replace('rtc://', replaceProtocol));\r\n\r\n    let vhost = url.hostname;\r\n    let app = url.pathname.substr(1, url.pathname.lastIndexOf('/') - 1);\r\n    const stream = url.pathname.substr(url.pathname.lastIndexOf('/') + 1);\r\n\r\n    // parse the vhost in the params of app, that srs supports.\r\n    app = app.replace('...vhost...', '?vhost=');\r\n    if (app.indexOf('?') >= 0) {\r\n      const params = app.substr(app.indexOf('?'));\r\n      app = app.substr(0, app.indexOf('?'));\r\n\r\n      if (params.indexOf('vhost=') > 0) {\r\n        vhost = params.substr(params.indexOf('vhost=') + 'vhost='.length);\r\n        if (vhost.indexOf('&') > 0) {\r\n          vhost = vhost.substr(0, vhost.indexOf('&'));\r\n        }\r\n      }\r\n    }\r\n\r\n    // when vhost equals to server, and server is ip,\r\n    // the vhost is __defaultVhost__\r\n    if (url.hostname == vhost) {\r\n      const re = /^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$/;\r\n      if (re.test(url.hostname)) {\r\n        vhost = '__defaultVhost__';\r\n      }\r\n    }\r\n\r\n    // parse the schema\r\n    let schema = 'rtmp';\r\n    if (streamUrl.indexOf('://') > 0) {\r\n      schema = streamUrl.substr(0, streamUrl.indexOf('://'));\r\n    }\r\n\r\n    let port = url.port;\r\n    if (!port) {\r\n      switch (schema) {\r\n        case 'http':\r\n          port = '80';\r\n          break;\r\n        case 'https':\r\n          port = '443';\r\n          break;\r\n        case 'rtmp':\r\n          port = '1935';\r\n          break;\r\n        case 'webrtc':\r\n        case 'rtc':\r\n          port = '1985';\r\n          break;\r\n      }\r\n    }\r\n\r\n    const ret = {\r\n      url: streamUrl,\r\n      schema,\r\n      server: url.hostname,\r\n      port,\r\n      vhost,\r\n      app,\r\n      stream,\r\n      user_query: {} as any,\r\n      domain: undefined,\r\n    };\r\n\r\n    if (url.search.length > 0) {\r\n      for (let pair of url.search.slice(1).split('&')) {\r\n        const [key, value] = pair.split('=');\r\n        ret[key] = value;\r\n        ret.user_query[key] = value;\r\n      }\r\n\r\n      if (ret.domain) {\r\n        ret.vhost = ret.domain;\r\n      }\r\n    }\r\n\r\n    return ret;\r\n  }\r\n\r\n  async fetchStreamAnswer(offer: RTCSessionDescriptionInit, streamurl: string): Promise<RTCSessionDescriptionInit> {\r\n    const { port = '1985', user_query = {}, server } = this.parseUrl(streamurl);\r\n\r\n    let api = user_query.play || '/rtc/v1/play/';\r\n    if (!api.endsWith('/')) {\r\n      api += '/';\r\n    }\r\n\r\n    let apiUrl = replaceProtocol + server + ':' + port + api;\r\n    for (let key in user_query) {\r\n      if (key !== 'api' && key !== 'play') {\r\n        apiUrl += (apiUrl.includes('?') ? '&' : '?') + key + '=' + user_query[key];\r\n      }\r\n    }\r\n\r\n    if (this.abortController) {\r\n      this.abortController.abort('recreate');\r\n    }\r\n    this.abortController = new self.AbortController();\r\n\r\n    if (this.fetchTimeout !== Infinity && this.fetchTimeout > 0) {\r\n      this.timerId = setTimeout(() => {\r\n        this.abort('timeout');\r\n      }, this.fetchTimeout);\r\n    }\r\n\r\n    try {\r\n      const { url, options } = this.fetchSetup(apiUrl, {\r\n        method: 'post',\r\n        signal: this.abortController.signal,\r\n        body: JSON.stringify({\r\n          api: apiUrl,\r\n          streamurl,\r\n          clientip: null,\r\n          sdp: offer.sdp,\r\n        }),\r\n        headers: {\r\n          'Content-Type': 'application/json',\r\n        },\r\n      });\r\n\r\n      const answer = await fetch(url, options);\r\n\r\n      if (!answer.ok) {\r\n        throw new Error(`HTTP error! Status: ${answer.status}`);\r\n      }\r\n      const json = await answer.json();\r\n\r\n      if (json.code !== 0 && !json.sdp) {\r\n        throw new Error(`API error! ${JSON.stringify(json)}`);\r\n      }\r\n\r\n      return { type: 'answer' as RTCSdpType, sdp: json.sdp };\r\n    } finally {\r\n      this.clearTimeout();\r\n      this.abortController = null;\r\n    }\r\n  }\r\n\r\n  fetchStreamSdp(offer: RTCSessionDescriptionInit, url: string): Promise<RTCSessionDescriptionInit> {\r\n    return Promise.resolve(undefined);\r\n  }\r\n\r\n  async fetchPeerConnectionConfig(url: string): Promise<RTCConfiguration> {\r\n    return {\r\n      iceServers: [\r\n        {\r\n          urls: 'stun:47.99.56.177:3478',\r\n        },\r\n      ],\r\n    };\r\n  }\r\n}\r\n","import { IS_FIREFOX } from './utils';\r\n\r\nexport const preferCodecs = (sdp: string) => {\r\n  const sdpLines = sdp.split('\\r\\n');\r\n  const pLines = [];\r\n\r\n  sdpLines.forEach((sdpLine) => {\r\n    const line = sdpLine.toLowerCase();\r\n    if (line.includes('a=rtpmap') && line.includes('h264')) {\r\n      pLines.push(sdpLine);\r\n    }\r\n  });\r\n\r\n  const payloadTypes = pLines.map(getCodecPayloadType).filter((it) => null !== it);\r\n\r\n  const arr = [];\r\n\r\n  sdpLines.forEach((sdpLine) => {\r\n    let setup = sdpLine;\r\n\r\n    if (sdpLine.includes('a=fmtp:111')) {\r\n      setup = sdpLine + ';stereo=1';\r\n    }\r\n    if (sdpLine.includes('a=fmtp')) {\r\n      const match = /a=fmtp:(\\d+)\\s/.exec(sdpLine);\r\n      if (match && match.length > 1 && payloadTypes.includes(match[1])) {\r\n        setup = sdpLine + ';sps-pps-idr-in-keyframe=1';\r\n      }\r\n    }\r\n\r\n    arr.push(setup);\r\n  });\r\n\r\n  return preferFirefoxCodecs(arr.join('\\r\\n'));\r\n};\r\n\r\nexport const preferFirefoxCodecs = (sdp: string) => {\r\n  if (!IS_FIREFOX) {\r\n    return sdp;\r\n  }\r\n\r\n  const sdpLines = sdp.split('\\r\\n');\r\n  const pLines = [];\r\n  const slicedPayloadLines = [];\r\n\r\n  sdpLines.forEach((sdpLine) => {\r\n    const line = sdpLine.toLowerCase();\r\n    if (line.includes('a=rtpmap') && line.includes('h264')) {\r\n      pLines.push(sdpLine);\r\n    }\r\n  });\r\n\r\n  if (pLines.length > 1) {\r\n    slicedPayloadLines.push(...pLines.slice(1));\r\n  }\r\n\r\n  const payloadTypes = slicedPayloadLines.map(getCodecPayloadType).filter((it) => null !== it);\r\n  const res = [];\r\n\r\n  sdpLines.forEach((sdpLine) => {\r\n    let setup = sdpLine;\r\n\r\n    if (sdpLine.includes('a=setup')) {\r\n      setup = 'a=setup:passive';\r\n    }\r\n\r\n    if (sdpLine.includes('m=audio') || sdpLine.includes('m=video')) {\r\n      setup = sdpLine.split(' ').filter((it, index) => {\r\n        return index < 3 || !payloadTypes.includes(it);\r\n      }).join(' ');\r\n    }\r\n\r\n    if (sdpLine.includes('a=fmtp') || sdpLine.includes('a=rtcp-fb') || sdpLine.includes('a=rtpmap')) {\r\n      const match = /a=(?:fmtp|rtcp-fb|rtpmap):(\\d+)\\s/.exec(sdpLine);\r\n      if (match && match.length > 1 && payloadTypes.includes(match[1])) {\r\n        return;\r\n      }\r\n    }\r\n    res.push(setup);\r\n  });\r\n\r\n  return res.join('\\r\\n');\r\n};\r\n\r\nfunction getCodecPayloadType(sdpLine: string) {\r\n  const match = /a=rtpmap:(\\d+)\\s/.exec(sdpLine);\r\n  return match && match.length > 1 ? match[1] : null;\r\n}\r\n","import SignalController from './index';\r\nimport { uuid } from '../utils';\r\nimport { preferCodecs } from '../preferCodecs';\r\n\r\nexport default class TencentSignalController extends SignalController {\r\n  private baseUrl = 'https://overseas-webrtc.liveplay.myqcloud.com';\r\n  private svrSig = null;\r\n\r\n  async fetchStreamAnswer(offer: RTCSessionDescriptionInit, playUrl: string): Promise<RTCSessionDescriptionInit> {\r\n    const fetchPullStream = async (baseUrl: string, data) => {\r\n      const resp = await this.callAPI<{ errcode: number; errmsg: string; remotesdp: { sdp: string; type: 'answer' }; svrsig: string }>(\r\n        baseUrl + '/webrtc/v1/pullstream',\r\n        data,\r\n      );\r\n\r\n      const { errcode, errmsg, remotesdp, svrsig } = resp;\r\n      if (errcode !== 0) {\r\n        throw new Error(`errCode: ${errcode}, errMsg: ${errmsg}`);\r\n      }\r\n\r\n      return {\r\n        url: baseUrl,\r\n        remoteSdp: remotesdp,\r\n        svrSig: svrsig,\r\n      };\r\n    };\r\n\r\n    try {\r\n      let resp = null;\r\n      const data = {\r\n        streamurl: playUrl,\r\n        sessionid: uuid(),\r\n        clientinfo: null,\r\n        localsdp: offer,\r\n      };\r\n      if (this.baseUrl) {\r\n        resp = await fetchPullStream(this.baseUrl, data);\r\n      } else {\r\n        const promises = ['overseas-webrtc.liveplay.myqcloud.com', 'oswebrtc-lint.liveplay.myqcloud.com'].map((domain) => {\r\n          return fetchPullStream(`https://${domain}`, data);\r\n        });\r\n        resp = await Promise.any(promises);\r\n        this.baseUrl = resp.url;\r\n      }\r\n\r\n      this.svrSig = resp.svrSig;\r\n      return resp.remoteSdp;\r\n    } catch (err) {\r\n      throw err?.errors?.[0] || err;\r\n    }\r\n  }\r\n\r\n  fetchStreamSdp(offer: RTCSessionDescriptionInit, url: string): Promise<RTCSessionDescriptionInit> {\r\n    return Promise.resolve(undefined);\r\n  }\r\n\r\n  async fetchStopStream(playUrl: string) {\r\n    if (!this.baseUrl) {\r\n      throw new Error('signal domain name is empty');\r\n    }\r\n    if (!this.svrSig) {\r\n      return;\r\n    }\r\n    const { errcode, errmsg } = await this.callAPI(this.baseUrl + '/webrtc/v1/stopstream', {\r\n      streamurl: playUrl,\r\n      svrsig: this.svrSig,\r\n    });\r\n\r\n    if (errcode !== 0) {\r\n      throw new Error(`stop stream failed, errCode: ${errcode}, errMsg: ${errmsg}`);\r\n    }\r\n\r\n    this.svrSig = null;\r\n  }\r\n\r\n  public override sdpTransform(sdp: string): string {\r\n    return preferCodecs(sdp);\r\n  }\r\n\r\n  private async callAPI<T = any>(_url: string, data) {\r\n    if (this.abortController) {\r\n      this.abortController.abort('recreate');\r\n    }\r\n    this.abortController = new self.AbortController();\r\n\r\n    if (this.fetchTimeout !== Infinity && this.fetchTimeout > 0) {\r\n      this.timerId = setTimeout(() => {\r\n        this.abort('timeout');\r\n      }, this.fetchTimeout);\r\n    }\r\n\r\n    try {\r\n      const { url, options } = this.fetchSetup(_url, {\r\n        body: JSON.stringify(data),\r\n        cache: 'no-cache',\r\n        credentials: 'same-origin',\r\n        signal: this.abortController.signal,\r\n        headers: {\r\n          'Content-Type': 'application/json',\r\n        },\r\n        method: 'POST',\r\n        mode: 'cors',\r\n      });\r\n\r\n      const resp = await fetch(url, options);\r\n\r\n      if (resp.status !== 200) {\r\n        throw new Error(`status code: ${resp.status}`);\r\n      }\r\n\r\n      return await resp.json() as T;\r\n    } finally {\r\n      this.clearTimeout();\r\n      this.abortController = null;\r\n    }\r\n  }\r\n}\r\n","import adapter from 'webrtc-adapter';\r\nimport EventEmitter from 'events';\r\nimport type { IPlayerConfig } from './types';\r\nimport WebRTCConnection from './WebRTCConnection';\r\nimport SignalController from './SignalController';\r\nimport GbsSignalController from './SignalController/GbsSignalController';\r\nimport TencentSignalController from './SignalController/TencentSignalController';\r\nimport { DISCONNECT_CODE, ErrorCode, PlayerEvents, PlayStatus } from './enums';\r\nimport { formatStatsReport, IOS_VERSION_ARR, IS_IOS, IS_SAFARI, isWebRTCAPISupported } from './utils';\r\nimport Logger from './logger';\r\n\r\nconst logger = new Logger('WebRtcPlayer');\r\n\r\nexport { isWebRTCAPISupported, PlayerEvents, SignalController, GbsSignalController, TencentSignalController };\r\n\r\nexport default class WebRtcPlayer extends EventEmitter {\r\n  /**\r\n   * new RTCPeerConnection 需要的参数\r\n   */\r\n  private rtcOptions = null;\r\n  /**\r\n   * createOffer 需要的参数\r\n   */\r\n  private offerOptions: IPlayerConfig['offerOptions'] = {\r\n    offerToReceiveAudio: true,\r\n    offerToReceiveVideo: true,\r\n    sdpTransform: null,\r\n  };\r\n  private connectRetry = {\r\n    /** 最大重试次数 */\r\n    maxNum: 3,\r\n    /** 当前重试次数 */\r\n    curNum: 0,\r\n    /** 重试间隔时长（秒） */\r\n    delay: 1,\r\n    playing: false,\r\n  };\r\n\r\n  private streamDecodeFail = {\r\n    maxNum: 3,\r\n    curNum: 0,\r\n  };\r\n\r\n  private streamReceiveFail = {\r\n    maxNum: 5,\r\n    curNum: 0,\r\n  };\r\n\r\n  private env = 'prod';\r\n  /** 播放地址 */\r\n  private playUrl: string = null;\r\n  private playStatus: PlayStatus = PlayStatus.INIT;\r\n  private mediaElement: HTMLMediaElement = null;\r\n  private mediaStream: MediaStream = null;\r\n  private signalController: SignalController = null;\r\n  private rtcConnection: WebRTCConnection = null;\r\n  private connectTimeout = 5000;\r\n  private connectTimeoutId = null;\r\n  private retryTimeoutId = null;\r\n  private statsIntervalId = null;\r\n  private lastStatsReport: RTCStatsReport = null;\r\n  private fetchTimeout = 2000;\r\n\r\n  static VERSION = '__VERSION__';\r\n\r\n  constructor() {\r\n    super();\r\n\r\n    const { browser, version } = adapter.browserDetails;\r\n    logger.info(`browser: ${browser}, version: ${version}`);\r\n  }\r\n\r\n  static isSupported(): boolean {\r\n    if (IS_IOS && IS_SAFARI && IOS_VERSION_ARR.length > 0) {\r\n      if (IOS_VERSION_ARR[0] < 11) return false;\r\n      if (IOS_VERSION_ARR[0] === 11) {\r\n        if (IOS_VERSION_ARR[1] < 1) return false;\r\n        else if (IOS_VERSION_ARR[1] === 1 && IOS_VERSION_ARR[2] < 2) return false;\r\n      }\r\n    }\r\n    return isWebRTCAPISupported();\r\n  }\r\n\r\n  getLogger() {\r\n    return logger;\r\n  }\r\n\r\n  setConfig(config: Partial<IPlayerConfig> = {}) {\r\n    const {\r\n      env,\r\n      logLevel,\r\n      rtcOptions,\r\n      offerOptions,\r\n      connectTimeout,\r\n      connectRetryDelay,\r\n      maxConnectRetry,\r\n      signalController,\r\n      maxDecodeFailCount,\r\n      maxReceiveFailCount,\r\n      fetchTimeout,\r\n      fetchSetup,\r\n    } = config;\r\n\r\n    if ('string' === typeof env) {\r\n      this.env = env.toLowerCase();\r\n    }\r\n\r\n    if (typeof logLevel === 'string') {\r\n      logger.setLevel(logLevel as any);\r\n    }\r\n\r\n    if (!!rtcOptions && typeof rtcOptions === 'object') {\r\n      this.rtcOptions = rtcOptions;\r\n    }\r\n\r\n    if (offerOptions !== undefined) {\r\n      this.offerOptions = { ...this.offerOptions, ...offerOptions };\r\n    }\r\n\r\n    if (undefined !== connectTimeout) {\r\n      if ('number' === typeof connectTimeout && connectTimeout >= 0) {\r\n        this.connectTimeout = connectTimeout;\r\n      } else {\r\n        logger.warn('connectTimeout must be a number >= 0');\r\n      }\r\n    }\r\n\r\n    if (undefined !== fetchTimeout) {\r\n      if ('number' === typeof fetchTimeout && fetchTimeout >= 0) {\r\n        this.fetchTimeout = fetchTimeout;\r\n      } else {\r\n        logger.warn('fetchTimeout must be a number >= 0');\r\n      }\r\n    }\r\n\r\n    if (undefined !== connectRetryDelay) {\r\n      if ('number' === typeof connectRetryDelay && connectRetryDelay >= 0 && connectRetryDelay <= 10) {\r\n        this.connectRetry.delay = connectRetryDelay;\r\n      } else {\r\n        logger.warn('connectRetryDelay must be a number between 0 and 10');\r\n      }\r\n    }\r\n\r\n    if (undefined !== maxConnectRetry) {\r\n      if ('number' === typeof maxConnectRetry && maxConnectRetry >= 0 && maxConnectRetry <= 10) {\r\n        this.connectRetry.maxNum = maxConnectRetry;\r\n      } else {\r\n        logger.warn('maxConnectRetry must be a number between 0 and 10');\r\n      }\r\n    }\r\n\r\n    if (undefined !== maxDecodeFailCount) {\r\n      if ('number' === typeof maxDecodeFailCount && maxDecodeFailCount >= 0) {\r\n        this.streamDecodeFail.maxNum = maxDecodeFailCount;\r\n      } else {\r\n        logger.warn('maxDecodeFailCount must be a number >= 0');\r\n      }\r\n    }\r\n\r\n    if (undefined !== maxReceiveFailCount) {\r\n      if ('number' === typeof maxReceiveFailCount && maxReceiveFailCount >= 0) {\r\n        this.streamReceiveFail.maxNum = maxReceiveFailCount;\r\n      } else {\r\n        logger.warn('maxReceiveFailCount must be a number >= 0');\r\n      }\r\n    }\r\n\r\n    if (undefined !== signalController) {\r\n      if ('string' === typeof signalController && ['tencent', 'gbs'].includes(signalController)) {\r\n        if ('gbs' === signalController) {\r\n          this.signalController = new GbsSignalController({\r\n            env: this.env as any,\r\n            fetchTimeout: this.fetchTimeout,\r\n            fetchSetup,\r\n          });\r\n        } else if ('tencent' === signalController) {\r\n          this.signalController = new TencentSignalController({\r\n            env: this.env as any,\r\n            fetchTimeout: this.fetchTimeout,\r\n            fetchSetup,\r\n          });\r\n        }\r\n      } else if (signalController instanceof SignalController) {\r\n        this.signalController = signalController;\r\n      } else {\r\n        logger.warn('signalController must be \"tencent\", \"gbs\" or an instance of SignalController');\r\n      }\r\n    }\r\n\r\n    logger.debug(`setConfig:`, config);\r\n  }\r\n\r\n  attachMediaElement(mediaElement: string | HTMLMediaElement) {\r\n    if (this.mediaElement) {\r\n      logger.warn('already attached a media element, please destroy first');\r\n      return;\r\n    }\r\n\r\n    const view = typeof mediaElement === 'string' ? document.getElementById(mediaElement) : mediaElement;\r\n    if (view && view instanceof HTMLMediaElement) {\r\n      this.mediaElement = view;\r\n    } else {\r\n      logger.warn('HTMLMediaElement or Element id is required');\r\n    }\r\n  }\r\n\r\n  async startPlay(url: string) {\r\n    if (!this.mediaElement) {\r\n      throw new Error('HTMLMediaElement must be attached before startPlay()');\r\n    }\r\n    if (!this.signalController) {\r\n      throw new Error('signalController is required');\r\n    }\r\n    if (typeof url === 'string') {\r\n      url = url.trim();\r\n    }\r\n    if (!/^(webrtc:\\/\\/)/i.test(url) && !/\\.sdp/i.test(url)) {\r\n      throw new Error(`invalid webrtc url: ${url}`);\r\n    }\r\n    if (!this.offerOptions.offerToReceiveAudio && !this.offerOptions.offerToReceiveVideo) {\r\n      logger.warn('Both offerToReceiveAudio and offerToReceiveVideo are false!');\r\n      return;\r\n    }\r\n    this.playUrl = url;\r\n    this.streamDecodeFail.curNum = 0;\r\n    this.streamReceiveFail.curNum = 0;\r\n    this.playStatus = PlayStatus.INIT;\r\n\r\n    logger.debug(`startPlay: ${url}`);\r\n\r\n    if (this.mediaElement.autoplay) {\r\n      this.connectRetry.playing = true;\r\n    }\r\n\r\n    if (!this.rtcConnection) {\r\n      this.rtcConnection = new WebRTCConnection({\r\n        onSetLocalDescription: this.onSetLocalDescription,\r\n        onTrack: this.onTrack,\r\n        onConnect: this.onConnect,\r\n        onError: this.onError,\r\n        onDisconnect: this.onDisconnect,\r\n      });\r\n    }\r\n\r\n    let rtcOptions = {};\r\n    try {\r\n      rtcOptions = await this.signalController.fetchPeerConnectionConfig(url);\r\n    } catch (err) {\r\n      logger.warn(`url: ${url} fetchPeerConnectionConfig fail:`, err);\r\n    }\r\n\r\n    const offerConfig = { ...this.offerOptions };\r\n    if (typeof offerConfig.sdpTransform !== 'function') {\r\n      offerConfig.sdpTransform = this.signalController.sdpTransform.bind(this.signalController);\r\n    }\r\n\r\n    this.rtcConnection.initPeerConnection({\r\n      rtcConfig: Object.assign(this.rtcOptions || {}, rtcOptions),\r\n      offerConfig,\r\n    });\r\n  }\r\n\r\n  destroy() {\r\n    this.emit(PlayerEvents.DESTROY);\r\n    this.removeAllListeners();\r\n\r\n    if (this.connectTimeoutId) {\r\n      clearTimeout(this.connectTimeoutId);\r\n      this.connectTimeoutId = null;\r\n    }\r\n\r\n    if (this.retryTimeoutId) {\r\n      clearTimeout(this.retryTimeoutId);\r\n      this.retryTimeoutId = null;\r\n    }\r\n\r\n    if (this.statsIntervalId) {\r\n      clearInterval(this.statsIntervalId);\r\n      this.statsIntervalId = null;\r\n    }\r\n\r\n    this.connectRetry.curNum = 0;\r\n    this.connectRetry.playing = false;\r\n\r\n    if (this.playUrl) {\r\n      this.signalController.fetchStopStream(this.playUrl).catch(console.log);\r\n      this.playUrl = null;\r\n    }\r\n\r\n    this.signalController?.abort('destroy');\r\n    this.rtcConnection?.disconnect();\r\n    this.lastStatsReport = null;\r\n\r\n    if (this.mediaStream) {\r\n      this.mediaStream.getTracks().forEach((track) => {\r\n        track.stop();\r\n      });\r\n      this.mediaStream = null;\r\n    }\r\n\r\n    if (this.mediaElement) {\r\n      this.mediaElement.pause();\r\n      this.mediaElement.srcObject = null;\r\n      this.mediaElement.load();\r\n      this.mediaElement = null;\r\n    }\r\n  }\r\n\r\n  private onSetLocalDescription = async (offer: RTCSessionDescriptionInit) => {\r\n    try {\r\n      this.emit(PlayerEvents.PULL_START, offer.sdp);\r\n\r\n      let answer: RTCSessionDescriptionInit = null;\r\n      if (/\\.sdp/i.test(this.playUrl)) {\r\n        answer = await this.signalController.fetchStreamSdp(offer, this.playUrl);\r\n      } else {\r\n        answer = await this.signalController.fetchStreamAnswer(offer, this.playUrl);\r\n      }\r\n\r\n      this.emit(PlayerEvents.PULL_SUCCESS, answer.sdp);\r\n\r\n      this.rtcConnection.setRemoteDescription(answer);\r\n\r\n      logger.info(`url: ${this.playUrl} start:`, Date.now());\r\n\r\n      this.connectTimeoutId && clearTimeout(this.connectTimeoutId);\r\n      this.connectTimeoutId = setTimeout(() => {\r\n        logger.warn(`url: ${this.playUrl} connect timeout, ts:`, Date.now());\r\n        this.rtcConnection.disconnect({ code: DISCONNECT_CODE.RECONNECT, msg: 'connect timeout' });\r\n      }, this.connectTimeout);\r\n    } catch (err) {\r\n      console.warn(err);\r\n      this.rtcConnection.disconnect();\r\n      this.emit(PlayerEvents.ERROR, {\r\n        code: ErrorCode.PULL_STREAM_FAIL,\r\n        message: err.message,\r\n      });\r\n    }\r\n  };\r\n\r\n  private onTrack = (track: MediaStreamTrack) => {\r\n    if (this.mediaStream) {\r\n      this.mediaStream.addTrack(track);\r\n    } else {\r\n      this.mediaStream = new MediaStream();\r\n      this.mediaStream.addTrack(track);\r\n      this.mediaElement.srcObject = this.mediaStream;\r\n    }\r\n    logger.debug(`url: ${this.playUrl} current track length:`, this.mediaStream.getTracks().length);\r\n\r\n    if (this.mediaElement.autoplay && this.connectRetry.playing && this.mediaElement.paused) {\r\n      this.mediaElement.play().catch((err) => console.log(err));\r\n    }\r\n  };\r\n\r\n  private onError = (msg: string) => {\r\n    logger.warn(`url: ${this.playUrl} error:`, msg);\r\n\r\n    this.emit(PlayerEvents.ERROR, {\r\n      code: ErrorCode.WEBRTC_FAIL,\r\n      message: msg,\r\n    });\r\n  };\r\n\r\n  private onDisconnect = (reason: { code: DISCONNECT_CODE; msg: string }) => {\r\n    this.lastStatsReport = null;\r\n    this.streamReceiveFail.curNum = 0;\r\n    this.streamDecodeFail.curNum = 0;\r\n    this.playStatus = PlayStatus.INIT;\r\n\r\n    if (this.connectTimeoutId) {\r\n      clearTimeout(this.connectTimeoutId);\r\n      this.connectTimeoutId = null;\r\n    }\r\n    if (this.statsIntervalId) {\r\n      clearInterval(this.statsIntervalId);\r\n      this.statsIntervalId = null;\r\n    }\r\n\r\n    if (reason.code === DISCONNECT_CODE.RECONNECT) {\r\n      this.connectRetry.playing = !this.mediaElement.paused;\r\n      if (this.playUrl) {\r\n        this.signalController.fetchStopStream(this.playUrl).catch(console.log);\r\n      }\r\n      if (this.mediaStream) {\r\n        this.mediaStream.getTracks().forEach((track) => {\r\n          track.stop();\r\n        });\r\n        this.mediaStream = null;\r\n      }\r\n      if (this.mediaElement) {\r\n        this.mediaElement.pause();\r\n      }\r\n      if (this.retryTimeoutId) {\r\n        clearTimeout(this.retryTimeoutId);\r\n        this.retryTimeoutId = null;\r\n      }\r\n      this.retryTimeoutId = setTimeout(() => {\r\n        this.connectRetry.curNum++;\r\n        const { curNum, maxNum } = this.connectRetry;\r\n\r\n        if (curNum <= maxNum) {\r\n          logger.info(`url: ${this.playUrl} current reconnect num: ${curNum}, max reconnect num: ${maxNum}`);\r\n\r\n          this.emit(PlayerEvents.RECONNECT, curNum, maxNum);\r\n          this.startPlay(this.playUrl);\r\n        } else {\r\n          logger.warn(`url: ${this.playUrl} reached max reconnect num: ${maxNum}`);\r\n\r\n          this.emit(PlayerEvents.ERROR, {\r\n            code: ErrorCode.STREAM_DISCONNECT,\r\n            message: 'reached max reconnect num',\r\n          });\r\n          this.connectRetry.curNum = 0;\r\n          this.connectRetry.playing = false;\r\n        }\r\n      }, this.connectRetry.delay * 1000);\r\n    }\r\n  };\r\n\r\n  private onStats(stats: RTCStatsReport) {\r\n    const statsReport = formatStatsReport(stats, this.lastStatsReport);\r\n    if (statsReport) {\r\n      statsReport.video.frameWidth = statsReport.video.frameWidth || (this.mediaElement as HTMLVideoElement)?.videoWidth;\r\n      statsReport.video.frameHeight = statsReport.video.frameHeight || (this.mediaElement as HTMLVideoElement)?.videoHeight;\r\n      this.emit(PlayerEvents.STATS, statsReport);\r\n    }\r\n    this.lastStatsReport = stats;\r\n\r\n    if (statsReport?.video && this.offerOptions.offerToReceiveVideo) {\r\n      const { bitrate, framesPerSecond, framesDecoded, framesDecodedPerSecond } = statsReport.video;\r\n      if (bitrate && framesPerSecond) {\r\n        this.connectRetry.curNum = 0;\r\n      }\r\n      if (!this.mediaElement) {\r\n        return;\r\n      }\r\n      if (bitrate && framesPerSecond) {\r\n        this.streamReceiveFail.curNum = 0;\r\n      } else {\r\n        this.streamReceiveFail.curNum += 1;\r\n        if (this.streamReceiveFail.curNum >= this.streamReceiveFail.maxNum) {\r\n          this.emit(PlayerEvents.EMPTY);\r\n          this.streamReceiveFail.curNum = 0;\r\n        }\r\n      }\r\n      if (bitrate && framesPerSecond && !framesDecoded) {\r\n        this.streamDecodeFail.curNum += 1;\r\n        if (this.streamDecodeFail.curNum === this.streamDecodeFail.maxNum) {\r\n          logger.warn(`url: ${this.playUrl} stream decode failed`);\r\n\r\n          this.emit(PlayerEvents.ERROR, {\r\n            code: ErrorCode.DECODE_FAIL,\r\n            message: 'decode failed',\r\n            bitrate,\r\n            framesPerSecond,\r\n          });\r\n        }\r\n      } else {\r\n        this.streamDecodeFail.curNum = 0;\r\n      }\r\n\r\n      if (framesDecodedPerSecond >= 0 || framesPerSecond >= 0) {\r\n        if (framesDecodedPerSecond <= 5 || framesPerSecond <= 5) {\r\n          if (this.playStatus !== PlayStatus.WAITING) {\r\n            logger.info(`url: ${this.playUrl} frame waiting`);\r\n\r\n            this.playStatus = PlayStatus.WAITING;\r\n            this.emit(PlayerEvents.WAITING);\r\n          }\r\n        } else {\r\n          if (this.playStatus === PlayStatus.WAITING) {\r\n            this.emit(PlayerEvents.WAITING_STOP);\r\n          }\r\n          this.playStatus = PlayStatus.PLAYING;\r\n        }\r\n      }\r\n    }\r\n  }\r\n\r\n  private async startStat() {\r\n    logger.info(`url: ${this.playUrl} startStat`);\r\n\r\n    if (this.statsIntervalId) {\r\n      clearInterval(this.statsIntervalId);\r\n      this.statsIntervalId = null;\r\n    }\r\n    const stats = await this.rtcConnection.getStats();\r\n    if (stats) {\r\n      this.onStats(stats);\r\n    }\r\n    this.statsIntervalId = setInterval(() => {\r\n      this.rtcConnection?.getStats().then((stats) => {\r\n        stats && this.onStats(stats);\r\n      });\r\n    }, 1000);\r\n  }\r\n\r\n  private onConnect = () => {\r\n    if (this.connectTimeoutId) {\r\n      clearTimeout(this.connectTimeoutId);\r\n      this.connectTimeoutId = null;\r\n    }\r\n    this.startStat();\r\n    this.emit(PlayerEvents.CONNECTED);\r\n  };\r\n}\r\n","import WebRtcPlayer, {\r\n  isWebRTCAPISupported,\r\n  PlayerEvents,\r\n  SignalController,\r\n  GbsSignalController,\r\n  TencentSignalController,\r\n} from './index';\r\n\r\n// @ts-ignore\r\nWebRtcPlayer.isWebRTCAPISupported = isWebRTCAPISupported;\r\n// @ts-ignore\r\nWebRtcPlayer.Events = PlayerEvents;\r\n// @ts-ignore\r\nWebRtcPlayer.SignalController = SignalController;\r\n// @ts-ignore\r\nWebRtcPlayer.GbsSignalController = GbsSignalController;\r\n// @ts-ignore\r\nWebRtcPlayer.TencentSignalController = TencentSignalController;\r\n\r\nexport default WebRtcPlayer;\r\n"],"names":["_typeof","obj","Symbol","iterator","constructor","prototype","Object","defineProperty","utils","value","utils$5","compactObject","data","isObject","keys","reduce","accumulator","key","isObj","isEmptyObject","length","undefined","assign","arg","input","hint","prim","toPrimitive","res","call","TypeError","String","Number","_toPrimitive","_toPropertyKey","enumerable","configurable","writable","_defineProperty","deprecated","oldMethod","newMethod","deprecationWarnings_","console","warn","detectBrowser","window","result","browser","version","navigator","mozGetUserMedia","extractVersion","userAgent","webkitGetUserMedia","isSecureContext","webkitRTCPeerConnection","RTCPeerConnection","match","supportsUnifiedPlan","RTCRtpTransceiver","disableLog","bool","Error","logDisabled_","disableWarnings","filterStats","track","outbound","streamStatsType","filteredResult","Map","trackStats","forEach","type","trackIdentifier","id","push","trackStat","stats","trackId","walkStats","log","apply","arguments","wrapPeerConnectionEvent","eventNameToWrap","wrapper","proto","nativeAddEventListener","addEventListener","nativeEventName","cb","this","wrappedCallback","e","modifiedEvent","handleEvent","_eventMap","set","nativeRemoveEventListener","removeEventListener","has","unwrappedCb","get","size","uastring","expr","pos","parseInt","val","toString","base","resultSet","name","endsWith","getusermedia","getusermedia$1","shimGetUserMedia","browserDetails","mediaDevices","constraintsToChrome_","c","mandatory","optional","cc","r","ideal","exact","min","max","oldname_","prefix","charAt","toUpperCase","slice","oc","mix","advanced","concat","shimConstraints_","constraints","func","JSON","parse","stringify","audio","remap","a","b","video","face","facingMode","matches","getSupportedFacingModeLies","getSupportedConstraints","enumerateDevices","then","devices","dev","filter","d","kind","find","some","label","toLowerCase","includes","deviceId","logging","shimError_","PermissionDeniedError","PermissionDismissedError","InvalidStateError","DevicesNotFoundError","ConstraintNotSatisfiedError","TrackStartError","MediaDeviceFailedDueToShutdown","MediaDeviceKillSwitchOn","TabCaptureError","ScreenCaptureError","DeviceCaptureError","message","constraint","constraintName","getUserMedia","onSuccess","onError","bind","origGetUserMedia","cs","stream","getAudioTracks","getVideoTracks","getTracks","stop","DOMException","Promise","reject","nodeInterop","__esModule","default","cache","_getRequireWildcardCache","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","hasOwnProperty","desc","_interopRequireWildcard","require$$0","WeakMap","cacheBabelInterop","cacheNodeInterop","getdisplaymedia","getdisplaymedia$1","shimGetDisplayMedia","getSourceId","error","getDisplayMedia","sourceId","widthSpecified","width","heightSpecified","height","frameRateSpecified","frameRate","chromeMediaSource","chromeMediaSourceId","maxFrameRate","maxWidth","maxHeight","exports","fixNegotiationNeeded","pc","target","getConfiguration","sdpSemantics","signalingState","shimAddTrackRemoveTrack","addTrack","shimAddTrackRemoveTrackWithNative","origGetLocalStreams","getLocalStreams","_this11","nativeStreams","_reverseStreams","map","origAddStream","addStream","_this12","_streams","getSenders","s","newStream","MediaStream","origRemoveStream","removeStream","replaceInternalStreamId","description","sdp","internalId","externalStream","internalStream","replace","RegExp","RTCSessionDescription","_this13","streams","t","oldStream","resolve","dispatchEvent","Event","method","nativeMethod","methodObj","_this14","args","err","origSetLocalDescription","setLocalDescription","replaceExternalStreamId","origLocalDescription","removeTrack","sender","_this15","_pc","streamid","_getdisplaymedia","shimGetSendersWithDtmf","shimSenderWithDtmf","dtmf","_dtmf","createDTMFSender","_senders","origAddTrack","origRemoveTrack","idx","indexOf","splice","_this2","_this3","RTCRtpSender","origGetSenders","_this4","senders","shimGetStats","origGetStats","getStats","_this5","_arguments","Array","selector","onSucc","onErr","fixChromeStats_","response","standardReport","report","standardStats","timestamp","localcandidate","remotecandidate","names","stat","makeMapStats","_getusermedia","shimMediaStream","webkitMediaStream","shimOnTrack","_ontrack","f","origSetRemoteDescription","setRemoteDescription","_this","_ontrackpoly","te","receiver","getReceivers","event","transceiver","shimPeerConnection","RTCIceCandidate","shimSenderReceiverGetStats","RTCRtpReceiver","_this6","origGetReceivers","_this7","receivers","srcElement","MediaStreamTrack","require$$1","require$$2","_this8","_shimmedLocalStreams","streamId","_this9","existingSenders","newSenders","newSender","_this10","nativeGetUserMedia","getSettings","nativeGetSettings","applyConstraints","nativeApplyConstraints","preferredMediaSource","code","mediaSource","shimAddTransceiver","origAddTransceiver","addTransceiver","setParametersPromises","arr","sendEncodings","shouldPerformCheck","isArray","_arrayLikeToArray","_arrayWithoutHoles","iter","from","_iterableToArray","o","minLen","n","test","_unsupportedIterableToArray","_nonIterableSpread","encodingParam","rid","parseFloat","scaleResolutionDownBy","RangeError","maxFramerate","params","getParameters","encodings","setParameters","shimCreateAnswer","origCreateAnswer","createAnswer","_arguments3","all","shimCreateOffer","origCreateOffer","createOffer","_arguments2","shimGetParameters","origGetParameters","RTCTrackEvent","mozRTCPeerConnection","modernStatsTypes","inboundrtp","outboundrtp","candidatepair","nativeGetStats","i","shimRTCDataChannel","DataChannel","RTCDataChannel","shimReceiverGetStats","shimRemoveStream","shimSenderGetStats","len","arr2","safari_shim","shimAudioContext","AudioContext","webkitAudioContext","shimCallbacksAPI","addIceCandidate","successCallback","failureCallback","options","promise","withCallback","candidate","shimConstraints","shimCreateOfferLegacy","offerOptions","offerToReceiveAudio","audioTransceiver","getTransceivers","direction","setDirection","offerToReceiveVideo","videoTransceiver","_getUserMedia","errcb","shimLocalStreamsAPI","_localStreams","_addTrack","_len","_key","index","tracks","shimRTCIceServerUrls","OrigPeerConnection","pcConfig","pcConstraints","iceServers","newIceServers","server","urls","url","generateCertificate","shimRemoteStreamsAPI","getRemoteStreams","_remoteStreams","_onaddstream","_onaddstreampoly","shimTrackEventTransceiver","SDPUtils","Math","random","substring","localCName","generateIdentifier","splitLines","blob","trim","split","line","splitSections","part","getDescription","sections","getMediaSections","shift","matchPrefix","parseCandidate","parts","foundation","component","protocol","priority","ip","address","port","relatedAddress","relatedPort","tcpType","ufrag","usernameFragment","writeCandidate","join","parseIceOptions","parseRtpMap","parsed","payloadType","clockRate","channels","numChannels","writeRtpMap","codec","pt","preferredPayloadType","parseExtmap","uri","attributes","writeExtmap","headerExtension","preferredId","parseFmtp","kv","j","writeFmtp","parameters","param","parseRtcpFb","parameter","writeRtcpFb","lines","rtcpFeedback","fb","parseSsrcMedia","sp","ssrc","colon","attribute","parseSsrcGroup","semantics","ssrcs","getMid","mediaSection","mid","parseFingerprint","algorithm","getDtlsParameters","sessionpart","role","fingerprints","writeDtlsParameters","setupType","fp","parseCryptoLine","tag","cryptoSuite","keyParams","sessionParams","writeCryptoLine","writeCryptoKeyParams","parseCryptoKeyParams","keyMethod","keySalt","lifeTime","mkiValue","mkiLength","getCryptoParameters","getIceParameters","pwd","password","writeIceParameters","iceLite","parseRtpParameters","codecs","headerExtensions","fecMechanisms","rtcp","mline","profile","rtpmapline","fmtps","wildcardRtcpFb","existingFeedback","writeRtpDescription","caps","maxptime","extension","parseRtpEncodingParameters","encodingParameters","hasRed","hasUlpfec","primarySsrc","secondarySsrc","flows","apt","encParam","codecPayloadType","rtx","fec","mechanism","bandwidth","maxBitrate","parseRtcpParameters","rtcpParameters","remoteSsrc","cname","rsize","reducedSize","compound","mux","writeRtcpParameters","parseMsid","spec","planB","msidParts","parseSctpDescription","parseMLine","maxSizeLine","maxMessageSize","isNaN","sctpPort","fmt","sctpMapLines","writeSctpDescription","media","sctp","output","generateSessionId","substr","writeSessionBoilerplate","sessId","sessVer","sessUser","getDirection","getKind","isRejected","parseOLine","username","sessionId","sessionVersion","netType","addressType","isValidSDP","module","common_shim","removeExtmapAllowMixed","nativeSRD","shimAddIceCandidateNullOrEmpty","nativeAddIceCandidate","shimConnectionState","completed","checking","iceConnectionState","_onconnectionstatechange","origMethod","_connectionstatechangepoly","_lastConnectionState","connectionState","newEvent","shimMaxMessageSize","_sctp","remoteIsFirefox","canSendMaxMessageSize","_sdp","mLine","sctpInDescription","isFirefox","getRemoteFirefoxVersion","canSendMMS","remoteMMS","getMaxMessageSize","POSITIVE_INFINITY","shimParameterlessSetLocalDescription","nativeSetLocalDescription","shimRTCIceCandidate","NativeRTCIceCandidate","nativeCandidate","parsedCandidate","toJSON","sdpMid","sdpMLineIndex","shimRTCIceCandidateRelayProtocol","relayProtocol","shimSendThrowTypeError","wrapDcSend","dc","origDataChannelSend","send","byteLength","readyState","origCreateDataChannel","createDataChannel","dataChannel","channel","adapter_factory","adapterFactory","_ref","shimChrome","shimFirefox","shimSafari","adapter","commonShim","chromeShim","browserShim","firefoxShim","safariShim","require$$3","require$$4","require$$5","_default","PlayStatus","DISCONNECT_CODE","PlayerEvents","ErrorCode","USER_AGENT","isWebRTCAPISupported","IS_FIREFOX","IS_SAFARI","IS_IOS","IOS_VERSION_ARR","uuid","crypto","getRandomValues","Uint8Array","LogMethod","LogLevel","TRACE","DEBUG","INFO","WARN","ERROR","Logger","static","maxCount","discardStep","floor","logList","logs","logTimeTag","formatDate","date","format","getMonth","getDate","getHours","getMinutes","getSeconds","S","getMilliseconds","A","$1","getFullYear","k","Date","setLevel","level","logLevel","trace","l","debug","info","pushLog","unshift","methodName","download","Blob","objectURL","URL","createObjectURL","anchor","document","createElement","href","now","click","revokeObjectURL","ConnectionState","logger","WebRTCConnection","callbacks","connectStatus","DISCONNECTED","onTrack","evt","_this$callbacks$onTra","_this$callbacks","onIceConnectionStateChange","_this$callbacks$onCon","_this$callbacks2","peerConnection","disconnect","RECONNECT","msg","CONNECTED","onConnect","onIceCandidate","onSignalingStateChange","onConnectionStateChange","_this$callbacks$onCon2","_this$callbacks3","onNegotiationNeeded","initPeerConnection","config","_config$rtcConfig","rtcConfig","bundlePolicy","rtcpMuxPolicy","tcpCandidatePolicy","IceTransportsType","_this$callbacks$onErr","_this$callbacks4","_this$callbacks$onErr2","_this$callbacks5","offerConfig","reason","_this$callbacks$onDis","_this$callbacks6","MANUAL","close","onDisconnect","_this$peerConnection","async","sdpTransform","voiceActivityDetection","offer","_this$callbacks$onErr3","_this$callbacks7","_this$callbacks$onSet","_this$callbacks8","onSetLocalDescription","_this$callbacks$onErr4","_this$callbacks9","answer","_this$callbacks$onErr5","_this$callbacks10","SignalController","props","env","fetchTimeout","fetchSetup","fetchPeerConnectionConfig","playUrl","fetchStopStream","abort","clearTimeout","abortController","timerId","replaceProtocol","location","startsWith","GbsSignalController","parseUrl","streamUrl","vhost","hostname","app","pathname","lastIndexOf","schema","ret","user_query","domain","search","pair","streamurl","api","play","apiUrl","self","AbortController","Infinity","setTimeout","signal","body","clientip","headers","fetch","ok","status","json","fetchStreamSdp","preferFirefoxCodecs","sdpLines","pLines","slicedPayloadLines","sdpLine","payloadTypes","getCodecPayloadType","it","setup","exec","TencentSignalController","super","baseUrl","svrSig","fetchPullStream","resp","callAPI","errcode","errmsg","remotesdp","svrsig","remoteSdp","sessionid","clientinfo","localsdp","promises","any","_err$errors","errors","preferCodecs","_url","credentials","mode","WebRtcPlayer","EventEmitter","rtcOptions","connectRetry","maxNum","curNum","delay","playing","streamDecodeFail","streamReceiveFail","playStatus","INIT","mediaElement","mediaStream","signalController","rtcConnection","connectTimeout","connectTimeoutId","retryTimeoutId","statsIntervalId","lastStatsReport","emit","PULL_START","fetchStreamAnswer","PULL_SUCCESS","PULL_STREAM_FAIL","srcObject","autoplay","paused","catch","WEBRTC_FAIL","clearInterval","pause","startPlay","STREAM_DISCONNECT","startStat","getLogger","setConfig","connectRetryDelay","maxConnectRetry","maxDecodeFailCount","maxReceiveFailCount","attachMediaElement","view","getElementById","HTMLMediaElement","destroy","_this$signalControlle","_this$rtcConnection","DESTROY","removeAllListeners","load","onStats","statsReport","formatStatsReport","lastStats","videoTrackReportId","videoRtpReportId","audioTrackReportId","audioRtpReportId","frameWidth","audioLevel","mediaType","videoTrackReport","videoRtpReport","lastVideoTrackReport","lastVideoRtpReport","videoCodec","framesPerSecond","framesDecodedPerSecond","videoBitrate","videoJitter","frameDecodeAvgTime","duration","codecId","codecReport","mimeType","sdpFmtpLine","framerateMean","framesReceived","framesDecoded","bytesReceived","jitterBufferDelay","jitterBufferEmittedCount","totalDecodeTime","audioCodec","audioBitrate","audioJitter","audioTrackReport","audioRtpReport","lastAudioTrackReport","lastAudioRtpReport","bitrate","toFixed","round","frameHeight","framesDropped","packetsLost","packetsReceived","nackCount","firCount","pliCount","_this$mediaElement","_this$mediaElement2","videoWidth","videoHeight","STATS","EMPTY","DECODE_FAIL","WAITING","WAITING_STOP","PLAYING","setInterval","_this$rtcConnection2","VERSION","Events"],"mappings":"oWA0BA,SAASA,EAAQC,GAAkC,OAAOD,EAAU,mBAAqBE,QAAU,iBAAmBA,OAAOC,SAAW,SAAUF,GAAO,cAAcA,CAAM,EAAG,SAAUA,GAAO,OAAOA,GAAO,mBAAqBC,QAAUD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,CAAI,EAAID,EAAQC,EAAO,CAhBhVK,OAAOC,eAAeC,EAAS,aAAc,CAC3CC,OAAO,IAEYC,EAAAC,cAiMrB,SAASA,EAAcC,GACrB,IA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