@opentok/client 2.22.2 → 2.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/opentok.js +6052 -4565
- package/dist/js/opentok.js.map +1 -1
- package/dist/js/opentok.min.js +26 -6
- package/dist/js/opentok.min.js.map +1 -1
- package/package.json +1 -1
package/dist/js/opentok.min.js
CHANGED
|
@@ -1,29 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license OpenTok.js 2.22.
|
|
2
|
+
* @license OpenTok.js 2.22.3 32f87e772
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2010-2022 TokBox, Inc.
|
|
5
5
|
* Subject to the applicable Software Development Kit (SDK) License Agreement:
|
|
6
6
|
* https://www.vonage.com/legal/communications-apis/terms-of-use/
|
|
7
7
|
*
|
|
8
|
-
* Date:
|
|
8
|
+
* Date: Wed, 11 May 2022 23:13:05 GMT
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OT=t():e.OT=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OT=t():e.OT=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=328)}([function(e,t,n){(function(t){
|
|
11
11
|
/*!
|
|
12
12
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|
13
13
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|
14
14
|
* @license Licensed under MIT license
|
|
15
15
|
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
|
16
16
|
* @version v4.2.8+1e68dce6
|
|
17
|
-
*/var n;n=function(){"use strict";function e(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,o=void 0,i=void 0,s=function(e,t){f[r]=e,f[r+1]=t,2===(r+=2)&&(i?i(h):y())},a="undefined"!=typeof window?window:void 0,c=a||{},u=c.MutationObserver||c.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),l="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var e=setTimeout;return function(){return e(h,1)}}var f=new Array(1e3);function h(){for(var e=0;e<r;e+=2)(0,f[e])(f[e+1]),f[e]=void 0,f[e+1]=void 0;r=0}var m,b,g,v,y=void 0;function S(e,t){var n=this,r=new this.constructor(C);void 0===r[T]&&A(r);var o=n._state;if(o){var i=arguments[o-1];s((function(){return k(o,r,i,n._result)}))}else O(n,r,e,t);return r}function E(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(C);return R(t,e),t}d?y=function(){return t.nextTick(h)}:u?(b=0,g=new u(h),v=document.createTextNode(""),g.observe(v,{characterData:!0}),y=function(){v.data=b=++b%2}):l?((m=new MessageChannel).port1.onmessage=h,y=function(){return m.port2.postMessage(0)}):y=void 0===a?function(){try{var e=Function("return this")().require("vertx");return void 0!==(o=e.runOnLoop||e.runOnContext)?function(){o(h)}:p()}catch(e){return p()}}():p();var T=Math.random().toString(36).substring(2);function C(){}function w(t,n,r){n.constructor===t.constructor&&r===S&&n.constructor.resolve===E?function(e,t){1===t._state?_(e,t._result):2===t._state?x(e,t._result):O(t,void 0,(function(t){return R(e,t)}),(function(t){return x(e,t)}))}(t,n):void 0===r?_(t,n):e(r)?function(e,t,n){s((function(e){var r=!1,o=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?R(e,n):_(e,n))}),(function(t){r||(r=!0,x(e,t))}),e._label);!r&&o&&(r=!0,x(e,o))}),e)}(t,n,r):_(t,n)}function R(e,t){if(e===t)x(e,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(r=t),null===r||"object"!==o&&"function"!==o)_(e,t);else{var n=void 0;try{n=t.then}catch(t){return void x(e,t)}w(e,t,n)}var r,o}function I(e){e._onerror&&e._onerror(e._result),N(e)}function _(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&s(N,e))}function x(e,t){void 0===e._state&&(e._state=2,e._result=t,s(I,e))}function O(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+1]=n,o[i+2]=r,0===i&&e._state&&s(N,e)}function N(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,o=void 0,i=e._result,s=0;s<t.length;s+=3)r=t[s],o=t[s+n],r?k(n,r,o,i):o(i);e._subscribers.length=0}}function k(t,n,r,o){var i=e(r),s=void 0,a=void 0,c=!0;if(i){try{s=r(o)}catch(e){c=!1,a=e}if(n===s)return void x(n,new TypeError("A promises callback cannot return that same promise."))}else s=o;void 0!==n._state||(i&&c?R(n,s):!1===c?x(n,a):1===t?_(n,s):2===t&&x(n,s))}var Z=0;function A(e){e[T]=Z++,e._state=void 0,e._result=void 0,e._subscribers=[]}var L=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(C),this.promise[T]||A(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?_(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&_(this.promise,this._result))):x(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;void 0===this._state&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===E){var o=void 0,i=void 0,s=!1;try{o=e.then}catch(e){s=!0,i=e}if(o===S&&void 0!==e._state)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(n===V){var a=new n(C);s?x(a,i):w(a,e,o),this._willSettleAt(a,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;void 0===r._state&&(this._remaining--,2===e?x(r,n):this._result[t]=n),0===this._remaining&&_(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;O(e,void 0,(function(e){return n._settledAt(1,t,e)}),(function(e){return n._settledAt(2,t,e)}))},e}(),V=function(){function t(e){this[T]=Z++,this._result=this._state=void 0,this._subscribers=[],C!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){R(e,t)}),(function(t){x(e,t)}))}catch(t){x(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var n=this.constructor;return e(t)?this.then((function(e){return n.resolve(t()).then((function(){return e}))}),(function(e){return n.resolve(t()).then((function(){throw e}))})):this.then(t,t)},t}();return V.prototype.then=S,V.all=function(e){return new L(this,e).promise},V.race=function(e){var t=this;return n(e)?new t((function(n,r){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(n,r)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},V.resolve=E,V.reject=function(e){var t=new this(C);return x(t,e),t},V._setScheduler=function(e){i=e},V._setAsap=function(e){s=e},V._asap=s,V.polyfill=function(){var e=void 0;if(void 0!==(void 0!==typeof window?window:global))e=void 0!==typeof window?window:global;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=V},V.Promise=V,V},e.exports=n()}).call(this,n(43))},function(e,t,n){"use strict";const r=n(392),o=n(191),i=n(119),s=o(e=>{const t={};return Object.keys(i).forEach(n=>{const o=i[n].method,s=r(`OpenTok:${e}:${n.toLowerCase()}`);s.log=console[o].bind(console),t[n.toLowerCase()]=s}),t});s.setLogLevel=e=>{let t;try{t=(void 0!==typeof window?window:global).localStorage.debug}catch(e){t=""}const n=[...Object.keys(i).map(t=>`${e>=i[t].priority?"":"-"}(autogen)?OpenTok:*:${t.toLowerCase()}`),...(t||"").split(/[\s,]/).filter(e=>-1===e.indexOf("(autogen)?"))].filter(e=>e).join(",");r.enable(n)},e.exports=s},function(e,t,n){"use strict";const r=n(531).parse();e.exports=r},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";e.exports={AUTHENTICATION_ERROR:"OT_AUTHENTICATION_ERROR",BADLY_FORMED_RESPONSE:"OT_BADLY_FORMED_RESPONSE",CHROME_MICROPHONE_ACQUISITION_ERROR:"OT_CHROME_MICROPHONE_ACQUISITION_ERROR",CONNECT_FAILED:"OT_CONNECT_FAILED",CONNECTION_LIMIT_EXCEEDED:"OT_CONNECTION_LIMIT_EXCEEDED",CONSTRAINTS_NOT_SATISFIED:"OT_CONSTRAINTS_NOT_SATISFIED",CREATE_PEER_CONNECTION_FAILED:"OT_CREATE_PEER_CONNECTION_FAILED",DISCONNECTED:"OT_DISCONNECTED",EMPTY_RESPONSE_BODY:"OT_EMPTY_RESPONSE_BODY",GET_RTC_STATS_REPORT_NOT_SUPPORTED:"OT_GET_RTC_STATS_REPORT_NOT_SUPPORTED",HARDWARE_UNAVAILABLE:"OT_HARDWARE_UNAVAILABLE",ICE_WORKFLOW_FAILED:"OT_ICE_WORKFLOW_FAILED",INVALID_HTTP_STATUS:"OT_INVALID_HTTP_STATUS",INVALID_PARAMETER:"OT_INVALID_PARAMETER",INVALID_SESSION_ID:"OT_INVALID_SESSION_ID",MEDIA_ERR_ABORTED:"OT_MEDIA_ERR_ABORTED",MEDIA_ERR_DECODE:"OT_MEDIA_ERR_DECODE",MEDIA_ERR_NETWORK:"OT_MEDIA_ERR_NETWORK",MEDIA_ERR_SRC_NOT_SUPPORTED:"OT_MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ENDED:"OT_MEDIA_ENDED",NO_DEVICES_FOUND:"OT_NO_DEVICES_FOUND",NO_VALID_CONSTRAINTS:"OT_NO_VALID_CONSTRAINTS",NOT_CONNECTED:"OT_NOT_CONNECTED",NOT_FOUND:"OT_NOT_FOUND",NOT_SUPPORTED:"OT_NOT_SUPPORTED",PEER_CONNECTION_NOT_CONNECTED:"OT_PEER_CONNECTION_NOT_CONNECTED",PERMISSION_DENIED:"OT_PERMISSION_DENIED",RATE_LIMIT_EXCEEDED:"OT_RATE_LIMIT_EXCEEDED",REPORT_ISSUE_FAILED:"OT_REPORT_ISSUE_FAILED",SCREEN_SHARING_EXTENSION_NOT_INSTALLED:"OT_SCREEN_SHARING_EXTENSION_NOT_INSTALLED",SCREEN_SHARING_EXTENSION_NOT_REGISTERED:"OT_SCREEN_SHARING_EXTENSION_NOT_REGISTERED",SCREEN_SHARING_NOT_SUPPORTED:"OT_SCREEN_SHARING_NOT_SUPPORTED",SET_REMOTE_DESCRIPTION_FAILED:"OT_SET_REMOTE_DESCRIPTION_FAILED",SOCKET_ALREADY_CONNECTED_CONNECTING:"OT_SOCKET_ALREADY_CONNECTED_CONNECTING",SOCKET_CLOSE_ABNORMAL:"OT_SOCKET_CLOSE_ABNORMAL",SOCKET_CLOSE_CONNECT_EXCEPTION:"OT_SOCKET_CLOSE_CONNECT_EXCEPTION",SOCKET_CLOSE_CONNECTIVITY_LOSS:"OT_SOCKET_CLOSE_CONNECTIVITY_LOSS",SOCKET_CLOSE_FALLBACK_CODE:"OT_SOCKET_CLOSE_FALLBACK_CODE",SOCKET_CLOSE_INCONSISTENT_DATA:"OT_SOCKET_CLOSE_INCONSISTENT_DATA",SOCKET_CLOSE_NO_STATUS:"OT_SOCKET_CLOSE_NO_STATUS",SOCKET_CLOSE_POLICY_VIOLATION:"OT_SOCKET_CLOSE_POLICY_VIOLATION",SOCKET_CLOSE_GOING_AWAY:"OT_SOCKET_CLOSE_GOING_AWAY",SOCKET_CLOSE_PROTOCOL_ERROR:"OT_SOCKET_CLOSE_PROTOCOL_ERROR",SOCKET_CLOSE_TIMEOUT:"OT_SOCKET_CLOSE_TIMEOUT",SOCKET_CLOSE_TOO_LARGE:"OT_SOCKET_CLOSE_TOO_LARGE",SOCKET_CLOSE_UNEXPECTED_CONDITION:"OT_SOCKET_CLOSE_UNEXPECTED_CONDITION",SOCKET_CLOSE_UNSUPPORTED:"OT_SOCKET_CLOSE_UNSUPPORTED",STREAM_CREATE_FAILED:"OT_STREAM_CREATE_FAILED",STREAM_DESTROYED:"OT_STREAM_DESTROYED",STREAM_LIMIT_EXCEEDED:"OT_STREAM_LIMIT_EXCEEDED",STREAM_NOT_FOUND:"OT_STREAM_NOT_FOUND",UNABLE_TO_SUBSCRIBE:"OT_UNABLE_TO_SUBSCRIBE",TERMS_OF_SERVICE_FAILURE:"OT_TERMS_OF_SERVICE_FAILURE",TIMEOUT:"OT_TIMEOUT",CANCEL:"OT_CANCEL",UNABLE_TO_CAPTURE_MEDIA:"OT_UNABLE_TO_CAPTURE_MEDIA",UNABLE_TO_CAPTURE_SCREEN:"OT_UNABLE_TO_CAPTURE_SCREEN",UNEXPECTED_ERROR_CODE:"OT_UNEXPECTED_ERROR_CODE",UNEXPECTED_HTTP_STATUS:"OT_UNEXPECTED_HTTP_STATUS",UNEXPECTED_SERVER_RESPONSE:"OT_UNEXPECTED_SERVER_RESPONSE",UNKNOWN_HTTP_ERROR:"OT_UNKNOWN_HTTP_ERROR",UNSUPPORTED_BROWSER:"OT_UNSUPPORTED_BROWSER",USER_MEDIA_ACCESS_DENIED:"OT_USER_MEDIA_ACCESS_DENIED",XDOMAIN_OR_PARSING_ERROR:"OT_XDOMAIN_OR_PARSING_ERROR",API_KEY_DISABLED:"OT_API_KEY_DISABLED",UNABLE_TO_ACCESS_MEDIA_ENGINE:"OT_UNABLE_TO_ACCESS_MEDIA_ENGINE",SET_PROXY_URL_TIMING_ERROR:"OT_SET_PROXY_URL_TIMING_ERROR",PROXY_URL_ALREADY_SET_ERROR:"OT_PROXY_URL_ALREADY_SET_ERROR",SET_VIDEO_SOURCE_FAILURE:"OT_SET_VIDEO_SOURCE_FAILURE",INVALID_VIDEO_SOURCE:"OT_INVALID_VIDEO_SOURCE",REQUESTED_DEVICE_PERMISSION_DENIED:"OT_REQUESTED_DEVICE_PERMISSION_DENIED",INVALID_AUDIO_OUTPUT_SOURCE:"OT_INVALID_AUDIO_OUTPUT_SOURCE"}},function(e,t,n){"use strict";const r=n(246),o=n(250),i=n(6),s=n(1);r.logging=s("OT.$"),r.ElementCollection=n(247),r.env=n(2),r.ajax=n(245),r.statable=n(540),r.Analytics=n(244),r.Collection=n(249),r.domExtras=n(541),r.Error=n(251),o(r,"useLogHelpers",{value(e){const t=s("useLogHelpersDeprecatedMixin");return Object.keys(t).forEach(n=>{e[n]=t[n]}),e},name:"OT.useLogHelpers",getWarning:"Please use an external library for your debugging needs"}),r.defaults=n(140),o(r,"eventing",{value:i,name:"OT.$.eventing",getWarning:"Please use an external library to create an event emitter."}),Object.keys(r).forEach(e=>{const t=r[e]._attachToOTHelpers||{};Object.keys(t).forEach(n=>{!Object.hasOwnProperty.call(r,n)||"util"===e&&"bind"===n||console.warn(`More than one module is trying to define ${n} on OTHelpers.`),r[n]=t[n]})}),e.exports=r},function(e,t,n){"use strict";const r=n(42),o=n(15),i=n(1)("Events"),s=n(7),a=n(397);e.exports=function(e){const t=new r;t.on("newListener",e=>{t.emit(e+":added")}),t.on("removeListener",e=>{t.emit(e+":removed")});const n={on(e,n,r){return"string"==typeof e&&n?e.split(" ").forEach(e=>{t.on(e,a(n,r))}):Object.keys(e).forEach(r=>{t.on(r,a(e[r],n))}),this},off(e,n,r){return"string"==typeof e?this.off(e.split(" "),n,r):Array.isArray(e)?e.forEach(e=>{n&&o(n)?t.removeListener(e,a(n,r)):t.removeAllListeners(e)}):e?Object.keys(e).forEach(r=>{t.removeListener(r,a(e[r],n))}):t.removeAllListeners(),this},once(e,n,r){return"string"==typeof e&&n?e.split(" ").forEach(e=>{t.once(e,a(n,r))}):Object.keys(e).forEach(r=>{t.once(r,a(e[r],n))}),this},dispatchEvent(e){if(!e.type)throw new Error("dispatchEvent: Event has no type");return e.target||(e.target=this),this.trigger(e.type,e),this},trigger(e){try{for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit(e,...r)}catch(e){i.error("An error occurred in an event handler",e)}return this},emit(){return e.trigger(...arguments)},addEventListener:(t,n,r)=>(i.warn("The addEventListener() method is deprecated. Use on() or once() instead."),e.on(t,n,r)),removeEventListener:(t,n,r)=>(i.warn("The removeEventListener() method is deprecated. Use off() instead."),e.off(t,n,r)),listenerCount:e=>t.listenerCount(e)};return s(e,n)}},function(e,t,n){var r=n(83),o=n(40),i=n(192),s=n(25),a=n(69),c=n(30),u=Object.prototype.hasOwnProperty,d=i((function(e,t){if(a(t)||s(t))o(t,c(t),e);else for(var n in t)u.call(t,n)&&r(e,n,t[n])}));e.exports=d},function(e,t,n){"use strict";e.exports={JS_EXCEPTION:2e3,AUTHENTICATION_ERROR:1004,INVALID_SESSION_ID:1005,CONNECT_FAILED:1006,CONNECT_REJECTED:1007,CONNECTION_TIMEOUT:1008,NOT_CONNECTED:1010,INVALID_PARAMETER:1011,P2P_CONNECTION_FAILED:1013,API_RESPONSE_FAILURE:1014,PEER_CONNECTION_NOT_CONNECTED:1015,TERMS_OF_SERVICE_FAILURE:1026,CONNECTION_LIMIT_EXCEEDED:1027,UNABLE_TO_PUBLISH:1500,UNABLE_TO_SUBSCRIBE:1501,UNSUPPORTED_VIDEO_CODEC:1502,UNABLE_TO_FORCE_DISCONNECT:1520,UNABLE_TO_FORCE_UNPUBLISH:1530,UNABLE_TO_FORCE_MUTE:1540,PUBLISHER_ICE_WORKFLOW_FAILED:1553,SUBSCRIBER_ICE_WORKFLOW_FAILED:1554,STREAM_LIMIT_EXCEEDED:1605,UNEXPECTED_SERVER_RESPONSE:2001,REPORT_ISSUE_ERROR:2011,SET_PROXY_URL_TIMING_ERROR:2021,PROXY_URL_ALREADY_SET_ERROR:2022,GET_RTC_STATS_REPORT_NOT_SUPPORTED:2031,ANVIL_BADLY_FORMED_RESPONSE:3001,ANVIL_INVALID_HTTP_STATUS:3002,ANVIL_XDOMAIN_OR_PARSING_ERROR:3003,ANVIL_UNKNOWN_HTTP_ERROR:3004,ANVIL_UNEXPECTED_ERROR_CODE:3005,ANVIL_EMPTY_RESPONSE_BODY:3006,ANVIL_CONNECT_FAILED:3007,UNABLE_TO_ACCESS_MEDIA_ENGINE:5001}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(4),r=e.OTErrorClass||n(22),o=Object.keys(t).map(e=>t[e]);return function(e,t,n){if(-1===o.indexOf(e))return new Error(`Attempt to use invalid error name (${e}). Original message: ${t.message}`);if(!(t instanceof Error||/^\[object .*Error\]$/.test(Object.prototype.toString.call(t))))return new Error("Did not pass Error as second argument: "+t);const i=new r(void 0,t.message);if(i.name=e,!t.stack)try{throw t}catch(e){}return i.stack=t.stack,n&&(i.code=n),i}}},function(e,t,n){e.exports=n(603)},function(e,t,n){(function(t){function n(e,n,r,o,i,s,a){try{var c=e[s](a),u=c.value}catch(e){return void r(e)}c.done?n(u):t.resolve(u).then(o,i)}e.exports=function(e){return function(){var r=this,o=arguments;return new t((function(t,i){var s=e.apply(r,o);function a(e){n(s,t,i,a,c,"next",e)}function c(e){n(s,t,i,a,c,"throw",e)}a(void 0)}))}}}).call(this,n(0))},function(e,t,n){var r=n(174),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t,n){var r=n(29),o=n(9);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";var r=n(208),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:i,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:c,isUndefined:s,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:d,merge:function e(){var t={};function n(n,r){c(t[r])&&c(n)?t[r]=e(t[r],n):c(n)?t[r]=e({},n):i(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)d(arguments[r],n);return t},extend:function(e,t,n){return d(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var r=n(526),o=n(527),i=o;i.v1=r,i.v4=o,e.exports=i},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){"use strict";const r=n(249),o={publishers:new r("guid"),subscribers:new r("widgetId"),sessions:new r};e.exports=o},function(e,t,n){"use strict";const r=n(1)("GlobalExceptionHandler"),o=n(6),i=n(26),s=n(539),a=n(23)(),c=function(e,t){Error.call(this),this.code=e,this.message=t};(c.prototype=Object.create(Error.prototype)).constructor=c,e.exports=c,o(c),c.getTitleByCode=function(e){return s[+e]},c.handleJsException=e=>{let t=e.error,n=e.errorMsg,o=e.code,s=e.target,u=e.analytics;if(!s)throw new Error("handleJsException requires target");const d=()=>void 0!==o?o:t&&t.code,l=()=>void 0!==n?n:t&&t.message,p=c.getTitleByCode(d());r.error(`OT.exception :: title: ${p} (${d()}) msg: ${l()}`);try{const e={partnerId:s.session?s.session.apiKey:s.apiKey,sessionId:s.session?s.session.sessionId:s.sessionId};u.logError(d(),"tb.exception",p,{details:l()},e);const n=new a.ExceptionEvent(i.EXCEPTION,l(),p,d(),s,s,t);if(t)n.stack=t.stack;else try{throw new Error}catch(e){n.stack=e.stack}c.dispatchEvent(n)}catch(e){r.error("OT.exception :: Failed to dispatch exception - "+e.toString())}}},function(e,t,n){"use strict";var r=n(3),o=r(n(46)),i=r(n(60));const s=n(126),a=n(26);e.exports=function(e){void 0===e&&(e={});const t=e.logging||n(1)("Events"),r={ExceptionEvent:function(e,t,n,r,o,i,a){return new s(e,!1,{error:a,message:t,title:n,code:r,component:o,target:i})},IssueReportedEvent:function(e,t){return new s(e,!1,{issueId:t})},EnvLoadedEvent:function(e){return new s(e,!1)}};let c=!1;r.ConnectionEvent=function(e){function n(t,n,r){return e.call(this,t,!1,{connection:n,reason:r})||this}return(0,i.default)(n,e),(0,o.default)(n,[{key:"connections",get:function(){return c||(t.warn("OT.ConnectionEvent connections property is deprecated, use connection instead."),c=!0),[this.connection]}}]),n}(s);let u=!1;r.StreamEvent=function(e){function n(t,n,r,o){return e.call(this,t,o,{stream:n,reason:r})||this}return(0,i.default)(n,e),(0,o.default)(n,[{key:"streams",get:function(){return u||(t.warn("OT.StreamEvent streams property is deprecated, use stream instead."),u=!0),[this.stream]}}]),n}(s);let d=!1,l=!1,p=!1;return r.SessionConnectEvent=function(e){function n(t){return e.call(this,t,!1)||this}return(0,i.default)(n,e),(0,o.default)(n,[{key:"connections",get:function(){return d||(t.warn("OT.SessionConnectedEvent no longer includes connections. Listen for connectionCreated events instead."),d=!0),[]}},{key:"streams",get:function(){return l||(t.warn("OT.SessionConnectedEvent no longer includes streams. Listen for streamCreated events instead."),l=!0),[]}},{key:"archives",get:function(){return p||(t.warn("OT.SessionConnectedEvent no longer includes archives. Listen for archiveStarted events instead."),p=!0),[]}}]),n}(s),r.SessionReconnectingEvent=function(){return new s(a.SESSION_RECONNECTING,!1)},r.SessionReconnectedEvent=function(){return new s(a.SESSION_RECONNECTED)},r.SessionDisconnectEvent=function(e,t,n){return new s(e,n,{reason:t})},r.StreamPropertyChangedEvent=function(e,t,n,r,o){return new s(e,!1,{stream:t,changedProperty:n,oldValue:r,newValue:o})},r.VideoDimensionsChangedEvent=function(e,t,n){return new s("videoDimensionsChanged",!1,{target:e,oldValue:t,newValue:n})},r.ArchiveEvent=function(e,t){return new s(e,!1,{id:t.id,name:t.name,status:t.status,archive:t})},r.ArchiveUpdatedEvent=function(e,t,n,r){return new s("updated",!1,{target:e,changedProperty:t,oldValue:n,newValue:r})},r.SignalEvent=function(e,t,n){return new s(e?"signal:"+e:a.SIGNAL,!1,{data:t,from:n})},r.StreamUpdatedEvent=function(e,t,n,r){return new s("updated",!1,{target:e,changedProperty:t,oldValue:n,newValue:r})},r.DestroyedEvent=function(e,t,n){return new s(e,!1,{target:t,reason:n})},r.ConnectionStateChangedEvent=function(e,t){return new s(e,!1,{target:t})},r.VideoEnabledChangedEvent=function(e,t){return new s(e,!1,{reason:t.reason})},r.VideoDisableWarningEvent=function(e){return new s(e,!1)},r.AudioLevelUpdatedEvent=function(e){return new s(a.AUDIO_LEVEL_UPDATED,!1,{audioLevel:e})},r.MediaStoppedEvent=function(e,t){return new s(a.MEDIA_STOPPED,!0,{target:e,track:t})},r.MuteForcedEvent=function(e){return new s(a.MUTE_FORCED,!1,e)},r.VideoElementCreatedEvent=function(e){return new s(a.VIDEO_ELEMENT_CREATED,!1,{element:e})},r}},function(e,t,n){"use strict";(function(t){var r=n(3),o=r(n(12)),i=r(n(13));e.exports=function(e){void 0===e&&(e={});const r=e.getNativeEnumerateDevices||n(286)(),s=e.getNativeMediaDevices||n(627)(),a=(e.currentAudioOutputDevice||n(105)).getCurrentAudioOutputDeviceId,c=e.env||n(2),u=e.global||(void 0!==typeof window?window:global),d={},l={audio:"audioInput",video:"videoInput",audioinput:"audioInput",videoinput:"videoInput",audiooutput:"audioOutput",audioInput:"audioInput",videoInput:"videoInput",audioOutput:"audioOutput"};return d.getNativeMediaDevices=()=>s(),d.hasEnumerateDevicesCapability=()=>"function"==typeof r(),d.hasDeviceChangeCapability=()=>{const e=s();return!(!e||!("ondevicechange"in e))},d.hasSetSinkIdCapability=()=>"setSinkId"in(null==u?void 0:u.HTMLMediaElement.prototype),d.hasAudioOutputApiSupport=()=>d.hasSetSinkIdCapability()&&d.hasDeviceChangeCapability(),d.hasEnumerateDevicesBug=()=>c.isSafari&&13.1===c.version,d.getMediaDevices=()=>d.hasEnumerateDevicesCapability()?r()().then(e=>e.map(e=>({deviceId:e.deviceId||e.id,label:e.label,kind:l[e.kind]}))):t.reject(new Error("This browser does not support enumerateDevices APIs")),d.getInputMediaDevices=()=>d.getMediaDevices().then(e=>e.filter(e=>/^(audio|video)Input$/.test(e.kind))),d.getAudioOutputMediaDevices=()=>d.getMediaDevices().then(e=>e.filter(e=>"audioOutput"===e.kind).map(e=>({deviceId:e.deviceId,label:e.label}))),d.shouldAskForDevices=()=>d.hasEnumerateDevicesCapability()?d.getInputMediaDevices().then(e=>{if(0===e.length)return{video:!0,audio:!0};const t=e.filter(e=>"audioInput"===e.kind),n=e.filter(e=>"videoInput"===e.kind);return d.hasEnumerateDevicesBug()&&0===n.length?{audio:!0,video:!0}:{video:n.length>0,audio:t.length>0,videoDevices:n,audioDevices:t}}).catch(()=>({video:!0,audio:!0})):t.resolve({video:!0,audio:!0}),d.getDefaultAudioOutputDeviceId=e=>{if(!Array.isArray(e)||0===e.length)return"";return(e.find(e=>"default"===e.deviceId)||e[0]).deviceId},d.hasDevice=(e,t)=>{let n=e;return Array.isArray(n)||(n=[]),n.some(e=>e.deviceId===t)},d.getActiveAudioOutputDevice=(0,i.default)(o.default.mark((function e(){var t,n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.getAudioOutputMediaDevices();case 3:t=e.sent,e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(0),e.t0;case 9:if(0!==t.length){e.next=11;break}return e.abrupt("return",{deviceId:null,label:null});case 11:return(n=t.find(e=>e.deviceId===a()))||(r=d.getDefaultAudioOutputDeviceId(t),n=t.find(e=>e.deviceId===r)),e.abrupt("return",n);case 14:case"end":return e.stop()}}),e,null,[[0,6]])}))),d}}).call(this,n(0))},function(e,t,n){var r=n(15),o=n(112);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){"use strict";e.exports={ACTIVE:"active",INACTIVE:"inactive",UNKNOWN:"unknown",PER_SESSION:"perSession",PER_STREAM:"perStream",EXCEPTION:"exception",ISSUE_REPORTED:"issueReported",SESSION_CONNECTED:"sessionConnected",SESSION_RECONNECTING:"sessionReconnecting",SESSION_RECONNECTED:"sessionReconnected",SESSION_DISCONNECTED:"sessionDisconnected",STREAM_CREATED:"streamCreated",STREAM_DESTROYED:"streamDestroyed",CONNECTION_CREATED:"connectionCreated",CONNECTION_DESTROYED:"connectionDestroyed",SIGNAL:"signal",STREAM_PROPERTY_CHANGED:"streamPropertyChanged",MICROPHONE_LEVEL_CHANGED:"microphoneLevelChanged",RESIZE:"resize",SETTINGS_BUTTON_CLICK:"settingsButtonClick",DEVICE_INACTIVE:"deviceInactive",INVALID_DEVICE_NAME:"invalidDeviceName",ACCESS_ALLOWED:"accessAllowed",ACCESS_DENIED:"accessDenied",ACCESS_DIALOG_OPENED:"accessDialogOpened",ACCESS_DIALOG_CLOSED:"accessDialogClosed",ECHO_CANCELLATION_MODE_CHANGED:"echoCancellationModeChanged",MEDIA_STOPPED:"mediaStopped",PUBLISHER_DESTROYED:"destroyed",MUTE_FORCED:"muteForced",SUBSCRIBER_DESTROYED:"destroyed",SUBSCRIBER_CONNECTED:"connected",SUBSCRIBER_DISCONNECTED:"disconnected",DEVICES_DETECTED:"devicesDetected",DEVICES_SELECTED:"devicesSelected",CLOSE_BUTTON_CLICK:"closeButtonClick",MICLEVEL:"microphoneActivityLevel",MICGAINCHANGED:"microphoneGainChanged",ENV_LOADED:"envLoaded",ENV_UNLOADED:"envUnloaded",AUDIO_LEVEL_UPDATED:"audioLevelUpdated",VIDEO_ELEMENT_CREATED:"videoElementCreated"}},function(e,t,n){"use strict";var r=n(3),o=r(n(20)),i=r(n(46)),s=r(n(18));const a=n(241),c=n(244),u=n(141),d=n(34)(),l=n(6),p=n(542);let f=function(){function e(e){let t=void 0===e?{}:e,n=t.staticConfig,r=void 0===n?d.onlyLocal():n,o=t.sessionInfo,i=void 0===o?new u:o,a=t.ajax,c=t.queue;(0,s.default)(this,"getTurnServerName",e=>{let t,n;if(!e||"object"!=typeof e)return t;return(Array.isArray(e)?e:[e]).forEach(e=>{const r=e.urls||e.url;(Array.isArray(r)?r:[r]).forEach(e=>{const r=e.indexOf(":")+1,o=e.lastIndexOf(":");e.includes("turns")?n=e.substring(r,o):t=e.substring(r,o)})}),n||t}),this.ajax=a,this.queue=c,this.sessionInfo=i,this.staticConfig=r}var t=e.prototype;return t._getCommon=function(){return{clientVersion:this.staticConfig.clientVersion,buildHash:this.staticConfig.buildHash,source:(void 0!==typeof window?window:global).location&&(void 0!==typeof window?window:global).location.href,logVersion:"2",apiServer:this.staticConfig.apiUrl,clientSystemTime:(new Date).getTime(),sessionId:this.sessionInfo.sessionId,mediaServerName:this.sessionInfo.mediaServerName,relayServer:this.getTurnServerName(this.sessionInfo.iceServers),p2p:this.sessionInfo.p2pEnabled,messagingServer:this.sessionInfo.messagingServer,messagingUrl:this.sessionInfo.messagingURL,version:this.staticConfig.version,partnerId:this.sessionInfo.partnerId}},t.logError=function(t,n,r,i,s){void 0===s&&(s={}),a.get((a,c)=>{if(a)return;const u=[t,n,r,i,(0,o.default)({guid:c},this.combineWithCommon(s))];e.emit("logError",...u),this._analytics.logError(...u)})},t.combineWithCommon=function(e){return(0,o.default)({},this._getCommon(),e)},t.logEvent=function(t,n,r){void 0===t&&(t={}),a.get((i,s)=>{if(i)return;const a=(0,o.default)({guid:s},this.combineWithCommon(t));e.emit("logEvent",a),this._analytics.logEvent(a,!1,n,r)})},t.logQOS=function(t){void 0===t&&(t={}),a.get((n,r)=>{if(n)return;const i=(0,o.default)({guid:r,duration:0},this.combineWithCommon(t));p(i),e.emit("logQOS",i),this._analytics.logQOS(i)})},(0,i.default)(e,[{key:"staticConfig",get:function(){return this._staticConfig},set:function(e){this._staticConfig=e,this._analytics=new c({loggingUrl:this.staticConfig.loggingUrl,ajax:this.ajax,queue:this.queue})}}]),e}();l(f),e.exports=f},function(e,t,n){"use strict";var r=!0,o=!0;function i(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}e.exports={extractVersion:i,wrapPeerConnectionEvent:function(e,t,n){if(e.RTCPeerConnection){var r=e.RTCPeerConnection.prototype,o=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return o.apply(this,arguments);var i=function(e){var t=n(e);t&&r(t)};return this._eventMap=this._eventMap||{},this._eventMap[r]=i,o.apply(this,[e,i])};var i=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[n])return i.apply(this,arguments);var r=this._eventMap[n];return delete this._eventMap[n],i.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}},disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(r=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},disableWarnings:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(o=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},log:function(){if("object"==typeof window){if(r)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},deprecated:function(e,t){o&&console.warn(e+" is deprecated, please use "+t+" instead.")},detectBrowser:function(e){var t=e&&e.navigator,n={browser:null,version:null};if(void 0===e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=i(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia)n.browser="chrome",n.version=i(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=i(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=i(t.userAgent,/AppleWebKit\/(\d+)\./,1)}return n}}},function(e,t,n){var r=n(39),o=n(353),i=n(354),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?o(e):i(e)}},function(e,t,n){var r=n(178),o=n(114),i=n(25);e.exports=function(e){return i(e)?r(e):o(e)}},function(e,t,n){"use strict";var r=n(44);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var r=n(55),o=n(199),i=n(125),s=n(200),a=n(201);(e.exports=function(e,t){var n,o,c,u,d;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],r(e)?(n=a.call(e,"c"),o=a.call(e,"e"),c=a.call(e,"w")):(n=c=!0,o=!1),d={value:t,configurable:n,enumerable:o,writable:c},u?i(s(u),d):d}).gs=function(e,t,n){var c,u,d,l;return"string"!=typeof e?(d=n,n=t,t=e,e=null):d=arguments[3],r(t)?o(t)?r(n)?o(n)||(d=n,n=void 0):n=void 0:(d=t,t=n=void 0):t=void 0,r(e)?(c=a.call(e,"c"),u=a.call(e,"e")):(c=!0,u=!1),l={get:t,set:n,configurable:c,enumerable:u},d?i(s(d),l):l}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},function(e,t,n){"use strict";(function(t){var r=n(3),o=r(n(20)),i=r(n(46));const s=n(207),a=n(56),c=n(471),u=n(518),d=n(1)("StaticConfig"),l=n(138).prependProxyToUrlIfNeeded,p=a({version:"v2.22.2",buildHash:"eb4bb5146",minimumVersion:{firefox:52,chrome:49},debug:"false",websiteURL:"http://www.tokbox.com",configURL:"https://config.opentok.com",ipWhitelistConfigURL:"",cdnURL:"https://static.opentok.com",loggingURL:"https://hlg.tokbox.com/prod",apiURL:"https://anvil.opentok.com"}),f=c(["apiURL","assetURL","cdnURL","sessionInfoOverrides","loggingURL"]),h={apiUrl:"apiURL",loggingUrl:"loggingURL"},m=u(e=>h[e]);e.exports=function(e){let n=(void 0===e?{}:e).axios,r=void 0===n?s:n;return function(){function e(e){Object.defineProperty(this,"config",{value:Object.freeze(a(e))})}return e.onlyLocal=function(){const t=a((void 0!==typeof window?window:global).OTProperties);return new e((0,o.default)({},p,f(t)))},e.get=function(n){let i=n.partnerId,s=n.token,c=n.useIpWhitelistConfigUrl,u=n.proxyUrl;return(()=>{const e=this.onlyLocal();if(!e.configUrl)return t.resolve({});if(!0===c&&!e.ipWhitelistConfigUrl)return t.resolve({});let n=!0===c?e.ipWhitelistConfigUrl:e.configUrl;return n=l(n,u),r.get(`${n}/project/${i}/config.json`,{headers:{"X-TB-TOKEN-AUTH":s}}).then(e=>e.data)})().catch(e=>(d.error("could not reach live config service",e),{})).then(t=>{const n=a((void 0!==typeof window?window:global).OTProperties);return new e((0,o.default)({},p,f(n),m(t)))})},(0,i.default)(e,[{key:"configUrl",get:function(){return this.config.configURL}},{key:"ipWhitelistConfigUrl",get:function(){return this.config.ipWhitelistConfigURL}},{key:"apiUrl",get:function(){return this.config.apiURL}},{key:"loggingUrl",get:function(){return this.config.loggingURL}},{key:"apiEnabled",get:function(){return void 0===this.config.apiEnabled||this.config.apiEnabled}},{key:"version",get:function(){return this.config.version}},{key:"clientVersion",get:function(){return"js-"+(this.version||"unknown").replace("v","")}},{key:"buildHash",get:function(){return this.config.buildHash}},{key:"minimumVersion",get:function(){return this.config.minimumVersion}},{key:"websiteUrl",get:function(){return this.config.websiteURL}},{key:"debug",get:function(){return"true"===this.config.debug||!0===this.config.debug}},{key:"sessionInfoOverrides",get:function(){return this.config.sessionInfoOverrides}},{key:"cdnUrl",get:function(){return this.config.cdnURL||`${(void 0!==typeof window?window:global).location.protocol}//${(void 0!==typeof window?window:global).location.host}`}},{key:"assetUrl",get:function(){return this.config.assetURL||`${this.cdnUrl}/webrtc/${this.version}`}}]),e}()}}).call(this,n(0))},function(e,t,n){var r=n(497),o=n(503),i=n(88),s=n(10),a=n(508);e.exports=function(e){return"function"==typeof e?e:null==e?i:"object"==typeof e?s(e)?o(e[0],e[1]):r(e):a(e)}},function(e,t,n){"use strict";const r=n(5);e.exports=function(e,t){let n;const o=t||{};e.setDisplayMode=function(e){const t=e||"auto";n!==t&&(r.removeClass(this.domElement,"OT_mode-"+n),r.addClass(this.domElement,"OT_mode-"+t),n=t)},e.getDisplayMode=function(){return n},e.showAfterLoading=function(){r.removeClass(this.domElement,"OT_hide-forced")},e.hideWhileLoading=function(){r.addClass(this.domElement,"OT_hide-forced")},e.destroy=function(){return o.onDestroy&&o.onDestroy(this.domElement),this.domElement&&r.removeElement(this.domElement),e},e.appendTo=function(t){return this.domElement=r.createElement(o.nodeName||"div",o.htmlAttributes,o.htmlContent),o.onCreate&&o.onCreate(this.domElement),e.setDisplayMode(o.mode),"auto"===o.mode&&(r.addClass(e.domElement,"OT_mode-on-hold"),setTimeout(()=>{r.removeClass(e.domElement,"OT_mode-on-hold")},2e3)),t.appendChild(this.domElement),e}}},function(e,t,n){var r=n(77);e.exports=function(e){return r(e,4)}},function(e,t,n){var r=n(352),o=n(357);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(14).Symbol;e.exports=r},function(e,t,n){var r=n(83),o=n(64);e.exports=function(e,t,n,i){var s=!n;n||(n={});for(var a=-1,c=t.length;++a<c;){var u=t[a],d=i?i(n[u],e[u],u,n,e):void 0;void 0===d&&(d=e[u]),s?o(n,u,d):r(n,u,d)}return n}},function(e,t,n){var r=n(381),o=n(109),i=n(382),s=n(186),a=n(187),c=n(29),u=n(175),d=u(r),l=u(o),p=u(i),f=u(s),h=u(a),m=c;(r&&"[object DataView]"!=m(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=m(new o)||i&&"[object Promise]"!=m(i.resolve())||s&&"[object Set]"!=m(new s)||a&&"[object WeakMap]"!=m(new a))&&(m=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case d:return"[object DataView]";case l:return"[object Map]";case p:return"[object Promise]";case f:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=m},function(e,t,n){"use strict";(function(t){var n,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,n){return new t((function(t,r){function o(){void 0!==i&&e.removeListener("error",i),t([].slice.call(arguments))}var i;"error"!==n&&(i=function(t){e.removeListener(n,o),r(t)},e.once("error",i)),e.once(n,o)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var o,i,s,a;if(c(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),void 0===s)s=i[t]=n,++e._eventsCount;else if("function"==typeof s?s=i[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=u(e))>0&&s.length>o&&!s.warned){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=s.length,a=d,console&&console.warn&&console.warn(a)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function f(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):m(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)o(c,this,t);else{var u=c.length,d=m(c,u);for(n=0;n<u;++n)o(d[n],this,t)}return!0},s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,o,i,s;if(c(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}).call(this,n(0))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var c,u=[],d=!1,l=-1;function p(){d&&c&&(d=!1,c.length?u=c.concat(u):l=-1,u.length&&f())}function f(){if(!d){var e=a(p);d=!0;for(var t=u.length;t;){for(c=u,u=[];++l<t;)c&&c[l].run();l=-1,t=u.length}c=null,d=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new h(e,t)),1!==u.length||d||a(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(400)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";e.exports=n(414)()?n(91).Symbol:n(417)},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(71);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,n){var r=n(515),o=n(137)((function(e,t){return null==e?{}:r(e,t)}));e.exports=o},function(e,t,n){"use strict";const r=(void 0!==typeof window?window:global).performance||{};e.exports=function(){return r.now?r.timing.navigationStart+r.now():Date.now()}},function(e,t,n){var r=n(575);e.exports=function(e){return r(2,e)}},function(e,t,n){"use strict";const r=n(7),o=n(62),i=n(272),s=n(127),a=n(273),c=n(1)("SDPHelpers"),u={getSections:e=>e.split(/\r\n|\r|\n/).reduce((e,t)=>{const n=t.match(/^m=(\w+) \d+/);return n&&(e.sections[e.section=n[1]]=[]),e.sections[e.section].push(t),e},{sections:{header:[]},section:"header"}).sections,getCodecsAndCodecMap(e,t){const n=u.getSections(e)[t];if(!n)throw new Error("no mediaType "+t);return{codecs:n[0].match(/m=\w+ \d+ [A-Z/]+ ([\d ]+)$/)[1].split(" "),codecMap:r(...n.filter(e=>e.match(/^a=rtpmap:\d+/)).map(e=>e.match(/^a=rtpmap:(\d+) ([\w-]+)/).splice(1)).map(e=>({[e[0]]:e[1]})))}},getCodecs(e,t){const n=u.getCodecsAndCodecMap(e,t);return n.codecs.map(e=>n.codecMap[e]||"Unknown codec")},mediaDirections:{INACTIVE:"inactive",RECVONLY:"recvonly"}};e.exports=u,u.getMLineIndex=function(e,t){const n="m="+t;return i(e,e=>-1!==e.indexOf(n))},u.getMLine=function(e,t){const n=u.getMLineIndex(e,t);return n>-1?e[n]:void 0},u.hasMediaType=(e,t)=>{const n=new RegExp("^m="+t),r=e.split("\r\n");return i(r,e=>n.test(e))>=0},u.hasMLinePayloadType=function(e,t,n){const r=u.getMLine(e,t);return u.getMLinePayloadTypes(r,t).indexOf(n)>-1},u.getMLinePayloadTypes=function(e,t){const n=new RegExp(`^m=${t} \\d+(/\\d+)? [a-zA-Z0-9/]+(( [a-zA-Z0-9/]+)+)$`,"i"),r=e.match(n);return!r||r.length<2?[]:r[2].trim().split(" ")},u.splitSections=function(e){return e.split("\nm=").map((e,t)=>(t>0?"m="+e:e).trim()+"\r\n")},u.changeMediaDirection=function(e,t){const n=u.splitSections(e);return n.shift()+(e=>{const n=t===u.mediaDirections.RECVONLY?"a=inactive":"a=recvonly",r=new RegExp(n,"g");return e.replace(r,"a="+t)})(n.join(""))},u.removeTypesFromMLine=function(e,t){const n=/[0-9 ]*$/.exec(e)[0],r=n.split(" ").filter(e=>""!==e&&-1===t.indexOf(e));return e.replace(n," "+r.join(" "))},u.removeMediaEncoding=function(e,t,n){let r,o,i,s,a=e.split("\r\n");const c=u.getMLineIndex(a,t),d=c>-1?a[c]:void 0,l=[];if(-1===c)return a.join("\r\n");if(r=u.getMLinePayloadTypes(d,t),0===r.length)return a.join("\r\n");for(o=c;o<a.length;o++){const e=new RegExp(n,"i");0===a[o].indexOf("a=rtpmap:")&&(s=a[o].split(" "),2===s.length&&e.test(s[1])&&l.push(s[0].substr(9)))}if(!l.length)return a.join("\r\n");for(o=c;o<a.length;o++)if(0===a[o].indexOf("a=fmtp:"))for(s=a[o].split(" "),i=0;i<l.length;i++)2===s.length&&s[1]==="apt="+l[i]&&l.push(s[0].substr(7));return a=a.filter(e=>{for(let t=0;t<l.length;t++)if(0===e.indexOf(`a=rtpmap:${l[t]} `)||0===e.indexOf(`a=fmtp:${l[t]} `)||0===e.indexOf(`a=rtcp-fb:${l[t]} `))return!1;return!0}),l.length>0&&c>-1&&(a[c]=u.removeTypesFromMLine(d,l)),a.join("\r\n")},u.disableMediaType=function(e,t){const n=e.split("\r\n"),r=[];let o;n.forEach(e=>{let t=e;/^m=/.test(t)&&(o=void 0),o||(o=[],r.push(o)),o.push(t)});const i=new RegExp(`^m=${t} \\d+ ([^ ]+) [0-9 ]+$`),s=r.map(e=>{const n=e[0].match(i);return n?[`m=${t} 0 ${n[1]} 0`,"a=inactive",...e.filter(e=>/^c=/.test(e)||/^a=mid:/.test(e)||""===e)]:e});return[].concat(...s).join("\r\n")},u.removeVideoCodec=function(e,t){return u.removeMediaEncoding(e,"video",t)};const d=function(e,t){let n=t.filterByName("ssrc-group:FID");switch(n=0===n.length?[]:n[0].value.split(" "),n.length){case 0:case 1:var r=t.find(e=>0===e.name.indexOf("rtpmap:")&&e.value.indexOf("rtx/90000")>-1);if(!r)return!1;var o=r.name.split(":")[1];return o.indexOf("/")>-1&&(o=o.split("/")[0]),u.hasMLinePayloadType(e,"video",o);default:return c.debug("SDP Helpers: There are more than two FIDs, RTX is definitely enabled"),!0}};u.getAttributesForMediaType=function(e,t){let n,r,i,s,a,c,l,p,f,h;const m=u.getMLineIndex(e,t),b=new RegExp(`m=(?!${t}).+ `,"i"),g=new RegExp("a=ssrc:\\d+ .*","i"),v=new RegExp("a=ssrc-group:(SIM|FID) (\\d+).*?","i"),y=new RegExp("a=([a-z0-9:/-]+) (.*)","i"),S=[];for(let t=m+1;t<e.length;t++){if(b.test(e[t])){void 0!==n&&(r=t-1);break}a=e[t].match(v),c=e[t].match(g),void 0===n&&(a||c)&&(n=t,a&&(s=/^(FID|SIM)$/.test(a[1])?a[2]:a[1])),l=e[t].match(`a=ssrc:${s} msid:(.+)`),l&&(p=l[1]);const o=g.test(e[t]),u=v.test(e[t]);void 0!==n&&(void 0!==r||o||u?t===e.length-1&&(r=t):r=t-1);const d=e[t].match(/a=mid:(.+)/);d&&(f=d[1],h=t),i=y.exec(e[t]),i&&3===i.length&&S.push({lineIndex:t,name:i[1],value:i[2]})}return S.ssrcStartIndex=n,S.ssrcEndIndex=r,S.msid=p,S.mid=f,S.midIndex=h,S.isUsingRTX=d.bind(null,e,S),S.filterByName=function(e){return this.filter(t=>t.name===e)},S.getRtpNumber=e=>{const t=new RegExp("rtpmap:(.+)");return o(S.map(n=>{const r=n.name.match(t);return r&&n.value.indexOf(e)>=0?r[1]:null}),e=>null!==e)},S},u.modifyDtx=(e,t)=>{const n=e.split("\r\n");if(!u.getMLine(n,"audio"))return c.debug("No audio m-line, not enabling dtx."),e;const r=u.getAttributesForMediaType(n,"audio"),o=r.getRtpNumber("opus");if(!o)return c.debug("Could not find rtp number for opus, not enabling dtx."),e;const i=r.find(e=>e.name==="fmtp:"+o);if(!i)return c.debug("Could not find a=fmtp line for opus, not enabling dtx."),e;let s=n[i.lineIndex];const a=/usedtx=\d+([\s;]*)/;return a.test(i.value)?s=s.replace(a,t?"usedtx=1$1":""):t&&(s+="; usedtx=1"),s=s.replace(/[;\s]*$/,""),n[i.lineIndex]=s,n.join("\r\n")};const l=(e,t,n)=>{const r=t.split("\r\n");if(!u.getMLine(r,"audio"))return c.debug("No audio m-line, not enabling stereo."),t;const o=u.getAttributesForMediaType(r,"audio"),i=o.getRtpNumber("opus");if(!i)return c.debug("Could not find rtp number for opus, not enabling stereo."),t;const s=o.find(e=>e.name==="fmtp:"+i);if(!s)return c.debug("Could not find a=fmtp line for opus, not enabling stereo."),t;let a,d=r[s.lineIndex];switch(e){case"send":a=/sprop-stereo=\d+([\s;]*)/,a.test(s.value)?d=d.replace(a,n?"sprop-stereo=1$1":""):n&&(d+="; sprop-stereo=1");break;case"receive":a=/([^-])stereo=\d+([\s;]*)/,a.test(s.value)?d=d.replace(a,n?"$1stereo=1$2":"$1"):n&&(d+="; stereo=1");break;default:throw new Error(`Invalid type ${e} passed into enableStereo`)}return d=d.replace(/[;\s]*$/,""),r[s.lineIndex]=d,r.join("\r\n")};u.modifySendStereo=l.bind(null,"send"),u.modifyReceiveStereo=l.bind(null,"receive"),u.setAudioBitrate=(e,t)=>{const n=u.getAudioBitrate(e);if(void 0!==n)return c.debug(`Audio bitrate already set to ${n}, not setting audio bitrate`),e;const r=e.split("\r\n");if(!u.getMLine(r,"audio"))return c.debug("No audio m-line, not setting audio bitrate"),e;const o=u.getAttributesForMediaType(r,"audio"),i=o.getRtpNumber("opus");if(!i)return c.debug("Could not find rtp number for opus, not setting audio bitrate."),e;const s=o.find(e=>e.name==="fmtp:"+i);if(!s)return c.debug("Could not find a=fmtp line for opus, not setting audio bitrate."),e;let a=r[s.lineIndex];return a+="; maxaveragebitrate="+t,a=a.replace(/[;\s]*$/,""),r[s.lineIndex]=a,r.join("\r\n")},u.hasSendStereo=e=>/[\s;]sprop-stereo=1/.test(e),u.hasSendDtx=e=>/[\s;]usedtx=1/.test(e),u.getAudioBitrate=e=>{const t=e.match(/[\s;]maxaveragebitrate=(\d+)/);if(t)return Number(t[1])},u.MAX_SSRCS=10,u.getSSRCGroupType=e=>["SIM","FID"].find(t=>e.filterByName("ssrc-group:"+t)[0]),u.getSSRCGroup=e=>{const t=u.getSSRCGroupType(e);return e.filterByName("ssrc-group:"+t)[0]},u.getSSRCGroupSSRCs=e=>{const t=u.getSSRCGroup(e);return t?t.value.split(" ").slice(0,u.MAX_SSRCS):[]},u.getAllowedSSRCs=(e,t)=>{const n=t.slice();return e.filterByName("ssrc-group:FID").forEach(e=>{const t=e.value.split(" ");s(n,t).length&&Array.prototype.push.apply(n,t)}),a(n)},u.filterExcessSSRCs=e=>{const t=e.split("\r\n"),n=u.getAttributesForMediaType(t,"video"),r=u.getSSRCGroupType(n),o=n.ssrcStartIndex;if(void 0===o)return e;let i;const s=e=>{let t=null;return e.match(/^a=ssrc:(\d+)/)&&(t=RegExp.$1),t};if(r){const e=u.getSSRCGroupSSRCs(n),o=["a=ssrc-group:"+r,...e].join(" ");t[n.find(e=>e.name.startsWith("ssrc-group:")).lineIndex]=o,i=u.getAllowedSSRCs(n,e)}else{i=[];n.ssrcStartIndex&&i.push(s(t[n.ssrcStartIndex]))}return t.filter((e,t)=>{if(t<o||t>n.ssrcEndIndex)return!0;if(t===o){if(!r){const t=s(e);return t?i.includes(t):!/^a=ssrc:(\d+)/.test(e)}return!0}const a=s(e);if(a)return i.includes(a);if(e.match(/^a=ssrc-group:FID (\d+)/)){const e=RegExp.$1;return i.includes(e)}return!e.match(/^a=ssrc-group:SIM /)}).join("\r\n")},u.enableSimulcast=function(e,t){let n,r;const o=e.split("\r\n");if(!u.getMLine(o,"video"))return c.debug("No video m-line, not enabling simulcast."),e;const i=u.getAttributesForMediaType(o,"video");if(i.filterByName("ssrc-group:SIM").length>0)return c.debug("Simulcast is already enabled in this SDP, not attempting to enable again."),u.filterExcessSSRCs(e);if(!i.msid)return c.debug("No local stream attached, not enabling simulcast."),e;const s=i.isUsingRTX(),a=[],d=[];for(r=0;r<t;++r)a.push(1e4+r),s&&d.push(2e4+r);if(n=["a=ssrc-group:SIM "+a.join(" ")],s)for(r=0;r<t;++r)n.push(`a=ssrc-group:FID ${a[r]} ${d[r]}`);for(r=0;r<t;++r)n.push(`a=ssrc:${a[r]} cname:localCname`,`a=ssrc:${a[r]} msid:${i.msid}`);if(s)for(r=0;r<t;++r)n.push(`a=ssrc:${d[r]} cname:localCname`,`a=ssrc:${d[r]} msid:${i.msid}`);return n.unshift(i.ssrcStartIndex,i.ssrcEndIndex-i.ssrcStartIndex+1),o.splice(...n),o.join("\r\n")},u.reprioritizeVideoCodec=function(e,t,n){const r=e.split("\r\n"),o=u.getMLineIndex(r,"video");if(-1===o)return e;const i=u.getMLinePayloadTypes(r[o],"video"),s=new RegExp("^a=rtpmap:(\\d+).* "+t,"i"),a=r.map(e=>e.match(s)).filter(e=>null!==e);if(0===a.length)return e;const d=a.map(e=>e[1]);let l=i.filter(e=>-1===d.indexOf(e));"top"===n?l.unshift(...d):"bottom"===n?l.push(...d):(c.error(`Unexpected location param: ${n}; not changing ${t} priority`),l=i);const p=r[o].replace(i.join(" "),l.join(" "));return r[o]=p,r.join("\r\n")}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(178),o=n(376),i=n(25);e.exports=function(e){return i(e)?r(e,!0):o(e)}},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){"use strict";e.exports=function(e){return null!=e}},function(e,t,n){var r=n(77);e.exports=function(e){return r(e,5)}},function(e,t,n){var r=n(98);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},function(e,t,n){var r=n(10),o=n(136),i=n(236),s=n(59);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:i(s(e))}},function(e,t,n){var r=n(505);e.exports=function(e){return null==e?"":r(e)}},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t,n){"use strict";const r=n(50),o=n(34)();t.check=function(e){void 0===e&&(e={});const t=e.env||n(2),r=e.hasGetUserMediaCapability||n(584),i=e.hasPeerConnectionCapability||n(585),s=e.logging||n(1)("hasOpenTokSupport"),a=((e.staticConfig||o.onlyLocal()).minimumVersion||{})[t.name.toLowerCase()];return a&&a>t.version?(s.debug("Support for",t.name,"is disabled because we require",a,"but this is",t.version),!1):"Node"===t.name||r()&&i()},t.once=r(()=>t.check())},function(e,t,n){var r=n(599)(n(272));e.exports=r},function(e,t,n){"use strict";e.exports=function(e){const t=[];return{on(n,r){for(var o=arguments.length,i=new Array(o>2?o-2:0),s=2;s<o;s++)i[s-2]=arguments[s];if(t.push({eventName:n,handler:r,args:i}),e.on)e.on(n,r);else{if(!e.addEventListener)throw new Error("Object does not support events",e);e.addEventListener(n,r,...i)}},off(t,n){if(e.off)e.off(t,n);else{if(!e.removeEventListener)throw new Error("Object does not support events",e);for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];e.removeEventListener(t,n,...o)}},once(n,r){for(var o=arguments.length,i=new Array(o>2?o-2:0),s=2;s<o;s++)i[s-2]=arguments[s];t.push({eventName:n,handler:r,args:i}),e.once(n,r)},removeAll(){t.forEach(e=>{let t=e.eventName,n=e.handler,r=e.args;this.off(t,n,...r)}),t.splice(0,t.length)}}}},function(e,t,n){var r=n(176);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(371),o=n(16),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=c},function(e,t,n){(function(e){var r=n(14),o=n(372),i=t&&!t.nodeType&&t,s=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=s&&s.exports===i?r.Buffer:void 0,c=(a?a.isBuffer:void 0)||o;e.exports=c}).call(this,n(84)(e))},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){var r=n(29),o=n(16);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},function(e,t,n){"use strict";if("Node"===n(5).env.name)e.exports={value:""};else{var r,o;const t=null==(r=Array.prototype.slice.call(document.getElementsByTagName("script")))||null==(o=r.pop())?void 0:o.getAttribute("src"),n=(t&&t.match(/[?&]apikey=([^&]+)/i)||[])[1];e.exports={value:n||""}}},function(e,t,n){"use strict";const r=n(2);e.exports=()=>!((r.isChrome||r.isElectron)&&r.version>=90||r.isOpera&&r.version>=76)&&(r.isChrome&&r.version>71||r.isChromiumEdge&&r.version<90||r.isOpera&&r.version>58)},function(e,t,n){"use strict";e.exports=function(e,t,n){void 0===n&&(n=1/0);let r=null,o=!1,i=1;const s=1e3/t,a=()=>{!o||i>n||(i+=1,e(),r=setTimeout(a,s))};this.start=()=>{o||(o=!0,setTimeout(a,s))},this.stop=()=>{(void 0!==typeof window?window:global).clearTimeout(r),o=!1}}},function(e,t,n){"use strict";const r=n(48),o=n(642),i=n(9),s=n(158),a={};function c(e){return Number(e.framerateMean||e.googFrameRateSent||e.googFrameRateReceived||e.googFrameRateInput||e.googFrameRateOutput||0)}function u(e){return Number(e.framesEncoded||e.framesDecoded)}function d(e,t){if(c(e))return c(e);if(!u(e))return;let n=0;const r=a[e.id]?a[e.id].frames:0,o=a[e.id]?a[e.id].timestamp:t;return n=s({currentStatFrames:u(e),currentTimestamp:e.timestamp,prevStatFrames:r,prevTimestamp:o}),a[e.id]={frames:u(e),timestamp:e.timestamp},n}function l(e,t){if(!t)return{};const n=t.filter(t=>t.id===e.mediaTrackId);return n.length?n[0]:{}}function p(e,t){return"packetsLost"in t?e+t.packetsLost:e}const f={isVideoStat(e,t){const n=l(e,t);return"video"===e.kind&&["outbound-rtp","inbound-rtp"].includes(e.type)||"video"===e.mediaType||"googFrameWidthReceived"in e||"googFrameWidthInput"in e||"inbound-rtp"===e.type&&-1!==e.id.indexOf("Video")||"inboundrtp"===e.type&&0!==n.frameWidth},isAudioStat(e,t){const n=l(e,t);return"audio"===e.kind&&["outbound-rtp","inbound-rtp"].includes(e.type)||"audio"===e.mediaType||"audioInputLevel"in e||"audioOutputLevel"in e||"inbound-rtp"===e.type&&-1!==e.id.indexOf("Audio")||"inboundrtp"===e.type&&0===n.frameWidth},isInboundStat:e=>"bytesReceived"in e||"packetsReceived"in e,isOutboundStat:e=>"bytesSent"in e||"packetsSent"in e,isVideoTrackStat:e=>"track"===e.type&&(e.frameHeight>0||e.frameWidth>0||e.framesCorrupted>0||e.framesDecoded>0||e.framesPerSecond>0||e.framesSent>0||e.framesReceived>0),isVideoRemoteInboundRtpStat:e=>"remote-inbound-rtp"===e.type&&"video"===e.kind,isAudioRemoteInboundRtpStat:e=>"remote-inbound-rtp"===e.type&&"audio"===e.kind,isVideoInboundRtpStat:e=>"inbound-rtp"===e.type&&"video"===e.kind,parseStatCategory(e){const t={packetsLost:0,packetsReceived:0,bytesReceived:0};return"packetsReceived"in e&&(t.packetsReceived=parseInt(e.packetsReceived,10)),"packetsLost"in e&&(t.packetsLost=parseInt(e.packetsLost,10)),"bytesReceived"in e&&(t.bytesReceived=parseInt(e.bytesReceived,10)),this.isVideoStat(e)&&("framerateMean"in e?t.frameRate=Number(e.framerateMean):"googFrameRateOutput"in e?t.frameRate=Number(e.googFrameRateOutput):"googFrameRateInput"in e&&(t.frameRate=Number(e.googFrameRateInput))),t},getVideoPacketsLost(e){return e.filter(t=>this.isVideoRemoteInboundRtpStat(t,e)).reduce(p,0)},getAudioPacketsLost(e){return e.filter(t=>this.isAudioRemoteInboundRtpStat(t,e)).reduce(p,0)},normalizeTimestamp:(e,t)=>(void 0===t&&(t=Date.now()),i(e)&&"getTime"in e?e.getTime():Math.abs(e/(1e3*t)-1)<.05?e/1e3:e),normalizeStats(e,t,n){void 0===t&&(t=!0);const i=e.filter(t=>f.isVideoStat(t,e)).filter(e=>f.isInboundStat(e)===t),s=e.filter(t=>this.isAudioStat(t,e)).filter(e=>this.isInboundStat(e)===t)[0],a=i[0];if(!s&&!a)throw new Error("could not find stats for either audio or video");const c=f.normalizeTimestamp(a?a.timestamp:s.timestamp),u={timestamp:c};a&&!t&&void 0===a.packetsLost&&(a.packetsLost=this.getVideoPacketsLost(e)),s&&!t&&void 0===s.packetsLost&&(s.packetsLost=this.getAudioPacketsLost(e));const l=["packetsSent","packetsLost","bytesSent"],p=t?e=>r(e,["packetsReceived","packetsLost","bytesReceived"]):e=>r(e,l);if(i&&i.length>0){const e=(e=>{const t=l.concat(["framerateMean","googFrameRateSent","googFrameRateReceived","googFrameRateInput","googFrameRateOutput","framesEncoded","framesDecoded"]),n={timestamp:c,id:a.id};return t.forEach(t=>{n[t]=e.map(e=>Number(e[t]||0)).reduce((e,t)=>e+t,0)}),n})(i);u.video=Object.assign({frameRate:d(e,n)},o(p(e),Number))}return s&&(u.audio=o(p(s),Number)),u}};e.exports=f},function(e,t,n){"use strict";t.__esModule=!0,t.codes=t.messages=void 0;t.messages={1001:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection.",1002:"The endpoint is terminating the connection due to a protocol error. (CLOSE_PROTOCOL_ERROR)",1003:"The connection is being terminated because the endpoint has indicated that reconnections are not available. (CLOSE_UNSUPPORTED)",1005:"Indicates that no status code was provided even though one was expected. (CLOSE_NO_STATUS)",1006:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected. (CLOSE_ABNORMAL)",1007:"Indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [RFC3629] data within a text message)",1008:"Indicates that an endpoint is terminating the connection because it has received a message that violates its policy. This is a generic status code that can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a need to hide specific details about the policy",1009:"Indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process (CLOSE_TOO_LARGE)",1011:"Indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request",4001:"Connectivity loss was detected as it was too long since the socket received the last PONG message",4010:"Timed out while waiting for the Rumor socket to connect.",4020:"Error code unavailable.",4030:"Exception was thrown during Rumor connection, possibly because of a blocked port."};t.codes={CLOSE_NORMAL:1e3,CLOSE_GOING_AWAY:1001,CLOSE_PROTOCOL_ERROR:1002,CLOSE_UNSUPPORTED:1003,CLOSE_NO_STATUS:1005,CLOSE_ABNORMAL:1006,CLOSE_INCONSISTENT_DATA:1007,CLOSE_POLICY_VIOLATION:1008,CLOSE_TOO_LARGE:1009,CLOSE_UNEXPECTED_CONDITION:1011,CLOSE_CONNECTIVITY_LOSS:4001,CLOSE_TIMEOUT:4010,CLOSE_FALLBACK_CODE:4020,CLOSE_CONNECT_EXCEPTION:4030,ALREADY_CONNECTED_CONNECTING:null}},function(e,t,n){var r=n(78),o=n(111),i=n(83),s=n(177),a=n(375),c=n(180),u=n(54),d=n(378),l=n(380),p=n(183),f=n(185),h=n(41),m=n(383),b=n(384),g=n(190),v=n(10),y=n(66),S=n(388),E=n(9),T=n(390),C=n(30),w=n(53),R={};R["[object Arguments]"]=R["[object Array]"]=R["[object ArrayBuffer]"]=R["[object DataView]"]=R["[object Boolean]"]=R["[object Date]"]=R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Map]"]=R["[object Number]"]=R["[object Object]"]=R["[object RegExp]"]=R["[object Set]"]=R["[object String]"]=R["[object Symbol]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R["[object Error]"]=R["[object Function]"]=R["[object WeakMap]"]=!1,e.exports=function e(t,n,I,_,x,O){var N,k=1&n,Z=2&n,A=4&n;if(I&&(N=x?I(t,_,x,O):I(t)),void 0!==N)return N;if(!E(t))return t;var L=v(t);if(L){if(N=m(t),!k)return u(t,N)}else{var V=h(t),P="[object Function]"==V||"[object GeneratorFunction]"==V;if(y(t))return c(t,k);if("[object Object]"==V||"[object Arguments]"==V||P&&!x){if(N=Z||P?{}:g(t),!k)return Z?l(t,a(N,t)):d(t,s(N,t))}else{if(!R[V])return x?t:{};N=b(t,V,k)}}O||(O=new r);var W=O.get(t);if(W)return W;O.set(t,N),T(t)?t.forEach((function(r){N.add(e(r,n,I,r,t,O))})):S(t)&&t.forEach((function(r,o){N.set(o,e(r,n,I,o,t,O))}));var G=L?void 0:(A?Z?f:p:Z?w:C)(t);return o(G||t,(function(r,o){G&&(r=t[o=r]),i(N,o,e(r,n,I,o,t,O))})),N}},function(e,t,n){var r=n(79),o=n(347),i=n(348),s=n(349),a=n(350),c=n(351);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=s,u.prototype.has=a,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(342),o=n(343),i=n(344),s=n(345),a=n(346);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},function(e,t,n){var r=n(52);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(38)(Object,"create");e.exports=r},function(e,t,n){var r=n(366);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(64),o=n(52),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var s=e[t];i.call(e,t)&&o(s,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var r=n(373),o=n(68),i=n(113),s=i&&i.isTypedArray,a=s?o(s):r;e.exports=a},function(e,t,n){var r=n(9),o=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=i},function(e,t,n){var r=n(88),o=n(193),i=n(121);e.exports=function(e,t){return i(o(e,t,r),e+"")}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call(function(){return arguments}());e.exports=function(e){return r.call(e)===o}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=r.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===o)||!1}},function(e,t,n){"use strict";e.exports=n(415)()?globalThis:n(416)},function(e,t,n){var r=n(110),o=n(448),i=n(449);function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}s.prototype.add=s.prototype.push=o,s.prototype.has=i,e.exports=s},function(e,t,n){var r=n(450);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(86),o=n(9);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=r(e.prototype),i=e.apply(n,t);return o(i)?i:n}}},function(e,t,n){var r=n(490);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},function(e,t,n){var r=n(58),o=n(47);e.exports=function(e,t){for(var n=0,i=(t=r(t,e)).length;null!=e&&n<i;)e=e[o(t[n++])];return n&&n==i?e:void 0}},function(e,t,n){var r=n(239),o=n(30);e.exports=function(e,t){return e&&r(e,t,o)}},function(e,t,n){"use strict";t.adaptIceServers=function(e){return e.map(e=>({url:e.url,urls:e.urls||[e.url],username:e.username,credential:e.credential}))},t.parseIceServers=function(e){let n;try{n=JSON.parse(e.data).content.iceServers}catch(e){return[]}return t.adaptIceServers(n)}},function(e,t,n){"use strict";(function(t){const r=n(154),o=n(49),i=n(7),s=n(56),a=n(127),c=n(147),u=n(271),d=n(19),l=n(6),p=n(251),f=n(155),h=n(51),m=n(73);e.exports=function(e){void 0===e&&(e={});const b=e.hasValidPeerConnection||n(602),g=e.applySdpTransform||n(156),v=e.createPeerConnection||n(605),y=e.env||n(2),S=e.sdpTransformDefaults||n(607),E=e.getStatsAdapter||n(274),T=e.getRtcStatsReportAdapter||n(277),C=e.getSynchronizationSources||n(611),w=e.IceCandidateProcessor||n(612),R=e.logging||n(1),I=e.offerProcessor||n(614),_=e.PeerConnectionChannels||n(616),x=e.subscribeProcessor||n(618),O=e.changeMediaDirection||n(619),N=O.changeMediaDirectionToInactive,k=O.changeMediaDirectionToRecvOnly,Z=e.Qos||n(278).default,A=e.global||(void 0!==typeof window?window:global),L=e.debounce||n(623),V=e.needsToSwapH264Profiles||n(625).once,P=e.NativeRTCIceCandidate||A.RTCIceCandidate,W=e.NativeRTCSessionDescription||A.RTCSessionDescription,G=e.Errors||n(4),M=e.OTErrorClass||n(22),D=e.ExceptionCodes||n(8),X=()=>{};return function(e){void 0===e&&(e={});let n=!1;const O=e,j=O.iceConfig,U=void 0===j?{servers:[]}:j,F=O.isPublisher,Y=O.logAnalyticsEvent,B=void 0===Y?X:Y,H=O.offerOverrides,J=O.answerOverrides,K=O.sdpTransformOptions,z=O.sendMessage,Q=O.p2p,q=O.codecFlags,$=O.sourceStreamId;let ee,te=!1,ne=!1,re=!1;const oe=V();let ie=0,se=!1;const ae=f();function ce(e,t){if(!n){if(["candidate","offer","answer","pranswer"].indexOf(e)>-1){const r="candidate"===e?t.candidate:t.sdp;n=-1!==r.indexOf("typ relay")}}z(e,t)}const ue=o();B("createPeerConnection","Attempt");const de={};de.id=d();const le=R("PeerConnection:"+de.id);le.debug("construct",{id:de.id,options:e});const pe=c({},S,K),fe=e=>"relay"===U.transportPolicy&&null!=e&&-1===e.candidate.indexOf("typ relay"),he=u(e,["isPublisher","logAnalyticsEvent","offerOverrides","answerOverrides","sendMessage","sdpTransformOptions"]);let me,be,ge,ve,ye,Se=[];const Ee=(()=>{let e=he.overrideSimulcastEnabled||!1;return{get:()=>e,set(t){const n=Boolean(t)&&he.capableSimulcastStreams>1;n!==e&&void 0===he.overrideSimulcastEnabled&&(e=n,de.generateOffer())}}})(),Te=(()=>{let e=!1;return{get:()=>e,set(t){const n=Boolean(t);n!==e&&(e=n,e&&!de.iceConnectionStateIsConnected()?de.generateOffer():le.debug("iceRestart is going to wait until we disconnect and then restart ice"))}}})(),Ce={clean(){delete this.promise,delete this.resolve,delete this.reject}};Ce.promise=new t((e,t)=>{Ce.resolve=e,Ce.reject=t});let we=new w,Re="new";Object.defineProperty(de,"signalingState",{get:()=>me.signalingState,set:e=>(me.signalingState=e,e)}),l(de),de.once("iceConnected",()=>{const e={pcc:parseInt(o()-ue,10),hasRelayCandidates:n,proxyInfo:""};me&&me.proxyInfo&&(e.proxyInfo=me.proxyInfo),B("createPeerConnection","Success",e)}),Ce.resolve();const Ie=e=>{if(le.debug("internalCreatePeerConnection: called"),me)return le.debug("internalCreatePeerConnection: resolving synchronously"),void e.call(null,null,me);if(Se.push(e),Se.length>1)return;const t={optional:[{DtlsSrtpKeyAgreement:!0}]};if(le.debug(`Creating peer connection config "${JSON.stringify(he)}".`),0===U.servers.length&&(le.error("No ice servers present"),B("Error","noIceServers")),"relay"===U.transportPolicy){const e=e=>e&&0===e.indexOf("turn");U.servers=U.servers.map(t=>{const n=s(t);return Array.isArray(n.urls)||(n.urls=[n.urls]),n.urls=n.urls.filter(e),0===n.urls.length?void 0:n}).filter(e=>void 0!==e)}he.iceTransportPolicy=U.transportPolicy,he.iceServers=U.servers,b(A.RTCPeerConnection).then(e=>{if(!e)throw le.error("createPeerConnection: Invalid RTCPeerConnection object"),new Error("Failed to create valid RTCPeerConnection object");return v({window:A,config:he,constraints:t})}).then(e=>_e(null,e),e=>_e(e))},_e=(e,t)=>{if(e)return Pe({reason:"Failed to create PeerConnection, exception: "+e,prefix:"NewPeerConnection"}),void(Se=[]);le.debug("OT attachEventsToPeerConnection"),me=t,we&&we.setPeerConnection(t),be=new _(me),he.channels&&be.addMany(he.channels);const n=(e=>{let t=e.sendMessage,n=e.logging;const r={};return e=>{e.candidate?(r[e.candidate.sdpMid]=e.candidate.sdpMLineIndex,t("candidate",{candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid||"",sdpMLineIndex:e.candidate.sdpMLineIndex||0})):n.debug("IceCandidateForwarder: No more ICE candidates.")}})({sendMessage:ce,logging:le}),r=e=>{Ce.resolve(),fe(e.candidate)?le.debug("Ignore candidate",e.candidate.candidate):n(e)};let o=me.iceConnectionState;const i=e=>{me?(le.debug("iceconnectionstatechange",me.iceConnectionState),"connected"===me.iceConnectionState?("disconnected"===o&&de.clearFailedTimeout(),de.emit("iceConnected"),Te.set(!1)):"completed"===me.iceConnectionState&&y.isLegacyEdge&&setTimeout(()=>Ge.startCollecting(me),1e3)):le.debug("iceconnectionstatechange on peerConnection that no longer exists",de);const t=e.target.iceConnectionState;de.trigger("iceConnectionStateChange",t),B("attachEventsToPeerConnection","iceconnectionstatechange",t),"disconnected"===t&&(Te.get()?(le.debug("Restarting ice!"),de.generateOffer()):m()||(ye=setTimeout(()=>{B("attachEventsToPeerConnection","iceconnectionstatechange","failed"),o="failed",de.trigger("iceConnectionStateChange","failed")},1e4))),"disconnected"!==o&&"failed"===t&&Pe({reason:"The stream was unable to connect due to a network error. Make sure your connection isn't blocked by a firewall.",prefix:"ICEWorkflow"}),o=t},s=()=>{B("peerConnection:negotiationNeeded","Event"),F&&de.generateOffer()};me.onaddstream=X,me.addEventListener("icecandidate",r),me.addEventListener("addstream",Ze),me.addEventListener("removestream",Ae),me.addEventListener("signalingstatechange",Ne),me.addEventListener("negotiationneeded",s),me.addEventListener("iceconnectionstatechange",i),ae.add(()=>{me&&(me.onaddstream=null,me.removeEventListener("icecandidate",r),me.removeEventListener("addstream",Ze),me.removeEventListener("removestream",Ae),me.removeEventListener("signalingstatechange",Ne),me.removeEventListener("negotiationneeded",s),me.removeEventListener("iceconnectionstatechange",i))}),xe(null)},xe=()=>{for(;Se.length;)Se.shift().call(null)},Oe=()=>{we&&(we.destroy(),we=null),Se=[],Ge.stopCollecting(),ae.releaseAll(),Ce.clean(),null!==me&&(me.destroy&&me.destroy(),me=null,de.trigger("close")),de.off()},Ne=e=>{const t=e.target.signalingState;if(de.emit("signalingStateChange",t),"stable"===t&&de.emit("signalingStateStable"),t&&t!==Re)switch(Re=t,le.debug("stateChange: "+Re),Re){case"closed":Oe()}},ke=()=>{let e;if(me.getRemoteStreams)e=me.getRemoteStreams();else{if(!me.remoteStreams)throw new Error("Invalid Peer Connection object implements no method for retrieving remote streams");e=me.remoteStreams}return Array.prototype.slice.call(e)},Ze=e=>{B("createPeerConnection","StreamAdded"),de.trigger("streamAdded",e.stream)},Ae=e=>{B("peerConnection:streamRemoved","Event"),de.trigger("streamRemoved",e.stream)},Le=(e,t,n)=>{re=!1,Pe({reason:`PeerConnection.offerProcessor ${e}: ${t}`,prefix:n})},Ve=e=>{if(re)return void(ee=e);re=!0,B("peerConnection:processOffer","Event");const t=new W({type:"offer",sdp:e.content.sdp}),n=e=>{re=!1,we&&we.process(),ce("answer",e),y.isLegacyEdge||Ge.startCollecting(me,F),ee&&(Ve(ee),ee=null)},r=e=>de.trigger("remoteVideoSupported",e);Ie(()=>{I(me,A.RTCPeerConnection,A.RTCSessionDescription,W,pe,t,q,Q,n,Le,r,oe)})};de.generateOffer=L(()=>{te?ne=!0:(()=>{var e,t;if("closed"===(null==(e=me)||null==(t=e.signalingState)?void 0:t.toLowerCase()))return;te=!0,B("peerConnection:processSubscribe","Event"),le.debug("processSubscribe: Sending offer to subscriber.");let n=Ee.get()?he.capableSimulcastStreams:1;"P2P"===$&&!Q&&(n=1),Ie(()=>{x({peerConnection:me,NativeRTCSessionDescription:W,sdpTransforms:pe,numSimulcastStreams:n,offerOverrides:H,offerConstraints:{iceRestart:Te.get()},replaceBaselineProfile:oe}).then(e=>{le.debug("processSubscribe: got offer, waiting for _readyToSendOffer"),ge=e,Ce.promise.then(()=>{le.debug("processSubscribe: sending offer"),ce("offer",ge)})},e=>{Pe({reason:`subscribeProcessor ${e.message}: ${e.reason}`,prefix:e.prefix})}),Te.set(!1)})})()},100);const Pe=e=>{let t=e.reason,n=e.prefix;le.error(t,"in state",me?{connectionState:me.connectionState,iceConnectionState:me.iceConnectionState,iceGatheringState:me.iceGatheringState,signalingState:me.signalingState}:"(none)"),de.trigger("error",{reason:t,prefix:n})};function We(e){this.track=e}de.addTrack=(e,n)=>{const o=new t((e,t)=>{Ie(n=>{if(n)return t(n);e()})}).then(()=>{if(me.addTrack)return me.addTrack(e,n);const t=me.getLocalStreams()[0];if(void 0===t)throw new Error("PeerConnection has no existing streams, cannot addTrack");t.addTrack(e),de.generateOffer()}).then(()=>new t(e=>{de.once("signalingStateStable",()=>{e()})}));return r(o,15e3,"Renegotiation timed out")},de.removeTrack=e=>{const n=t.resolve().then(()=>e instanceof We?(me.getLocalStreams()[0].removeTrack(e.track),void de.generateOffer()):me.removeTrack(e)).then(()=>new t(e=>{de.once("signalingStateStable",()=>{e()})}));return r(n,15e3,"Renegotiation timed out")},de.addLocalStream=e=>new t((t,n)=>{Ie(r=>{if(r)n(r);else{try{me.addStream(e)}catch(e){return void n(e)}t()}})}),de.getLocalStreams=()=>me.getLocalStreams(),de.getSenders=()=>me.getSenders?me.getSenders():me.getLocalStreams()[0].getTracks().map(e=>new We(e)),de.disconnect=()=>{var e;we&&(we.destroy(),we=null),(null==(e=me)?void 0:e.signalingState)&&"closed"!==me.signalingState.toLowerCase()&&(me.close(),setTimeout(Oe))},de.iceRestart=()=>Te.set(!0),de.clearFailedTimeout=()=>clearTimeout(ye),de.changeMediaDirectionToRecvOnly=()=>k(me),de.changeMediaDirectionToInactive=()=>N(me),de.processMessage=(e,t)=>{switch(le.debug(`processMessage: Received ${e} from ${t.fromAddress}`,t),le.debug(t),e){case"generateoffer":t.content&&void 0!==t.content.simulcastEnabled&&Ee.set(t.content.simulcastEnabled),de.generateOffer(),r();break;case"offer":Ve(t),r();break;case"answer":case"pranswer":(e=>{B("peerConnection:processAnswer","Event");const t=e=>{Pe({reason:"Error while setting RemoteDescription "+e,prefix:"SetRemoteDescription"})};e.content.sdp?(ve=new W({type:"answer",sdp:g(pe,"remote","answer",i({replaceBaselineProfile:oe},J),e.content.sdp).local}),me.setRemoteDescription(ve).then(()=>{le.debug("processAnswer: setRemoteDescription Success"),we&&we.process()}).catch(t),te=!1,ne&&(ne=!1,de.generateOffer()),y.isLegacyEdge||Ge.startCollecting(me,F)):t("Weird answer message, no SDP.")})(t);break;case"candidate":var n=new P(t.content);if(fe(n))return le.debug("Ignore candidate",n.candidate),de;we&&we.addIceCandidate(n).catch(e=>{le.warn(`Error while adding ICE candidate: ${JSON.stringify(n)}: ${e.toString()}`)});break;default:le.debug(`processMessage: Received an unexpected message of type ${e} from ${t.fromAddress}: ${JSON.stringify(t)}`)}function r(){ie+=1,Ge.handleOfferMessageReceived(),ie>1&&(B("Renegotiation","Attempt"),se=!0)}return de},de.remoteStreams=()=>me?ke():[],de.remoteTracks=()=>me?me.getReceivers?Array.prototype.slice.apply(me.getReceivers()).map(e=>e.track):Array.prototype.concat.apply([],ke().map(e=>e.getTracks())):[],de.remoteDescription=()=>me.remoteDescription,de.getStats=e=>{if(me)E(me,e);else{const t=D.PEER_CONNECTION_NOT_CONNECTED;e(new p(M.getTitleByCode(t),G.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}},de.getRtcStatsReport=e=>{if(me)T(me,e);else{const t=D.PEER_CONNECTION_NOT_CONNECTED;e(new p(M.getTitleByCode(t),G.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}},de.getSynchronizationSources=e=>{if(!F){if(!me){const t=D.PEER_CONNECTION_NOT_CONNECTED;return void e(new p(M.getTitleByCode(t),G.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}C(me,e)}};de.getDataChannel=(e,t,n)=>{me?function e(t,n,r,o){let i;const s=be.get(n,r);if(!s){if(t>0)return void setTimeout(e.bind(null,t-1,n,r,o),200);i=new p(`A channel with that label and options could not be found. Label:${n}. Options: ${JSON.stringify(r)}`)}o(i,s)}(100,e,t,n):n(new p("Cannot create a DataChannel before there is a connection."))},de.getSourceStreamId=()=>$,de.iceConnectionStateIsConnected=()=>me&&["connected","completed"].indexOf(me.iceConnectionState)>-1,de.findAndReplaceTrack=(e,n)=>t.resolve().then(()=>{const r=me.getSenders().filter(t=>t.track===e)[0];if(!r)return t.resolve();if("function"!=typeof r.replaceTrack)throw new Error("Sender does not support replaceTrack");return r.replaceTrack(n)}),de.hasRelayCandidates=()=>n,de.getNegotiatedCodecs=()=>{if(!me.localDescription||!me.remoteDescription)return null;const e=e=>a(h.getCodecs(me.localDescription.sdp,e),h.getCodecs(me.remoteDescription.sdp,e));return{audio:e("audio"),video:e("video")}},de.on("signalingStateStable",()=>{se&&(se=!1,B("Renegotiation","Success",de.getNegotiatedCodecs()))}),de.on("error",e=>{let t=e.prefix;se&&-1!==["CreateOffer","SetRemoteDescription"].indexOf(t)&&(se=!1,B("Renegotiation","Failure"))}),de.on("close",()=>{se&&(se=!1,B("Renegotiation","Cancel"))});const Ge=new Z;return Ge.on("stats",e=>{e.dataChannels=be.sampleQos(),de.trigger("qos",{parsedStats:e,simulcastEnabled:Ee.get()})}),de}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(2);e.exports=()=>"Chrome"===r.name&&r.version>=58||-1!==["Firefox","Edge","Safari","Opera"].indexOf(r.name)},function(e,t,n){"use strict";e.exports=function(e){let t=null,n=!1;const r=()=>{n&&(e(),t=window.requestAnimationFrame(r))};this.start=()=>{n||(n=!0,window.requestAnimationFrame(r))},this.stop=()=>{window.cancelAnimationFrame(t),n=!1}}},function(e,t,n){"use strict";const r=n(7);e.exports=(e,t)=>{const n={};Object.keys(t).forEach(r=>{n[r]=((e,t,n)=>t&&!n?()=>t.call(e):t&&n?r=>(void 0!==r&&n.call(e,r),t.call(e)):t=>{void 0!==t&&n.call(e,t)})(e,t[r].get,t[r].set)}),r(e,n)}},function(e,t,n){"use strict";let r="";e.exports={getCurrentAudioOutputDeviceId:()=>r,setCurrentAudioOutputDeviceId:e=>{r=e}}},function(e,t,n){"use strict";(function(t){e.exports=function(e){return new t(t=>setTimeout(t,e))}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(293);e.exports=function(e){let t=(void 0===e?{}:e).NativeVideoElementWrapper;const n=void 0===t?r():t;return function(e){let t=void 0===e?{}:e,r=t.fallbackText,o=void 0===r?"Sorry, Web RTC is not available in your browser":r,i=t.fitMode,s=t.muted,a=t._inject,c=t.widgetType;return new n({fallbackText:o,fitMode:i,muted:s,defaultAudioVolume:50,_inject:a,widgetType:c})}}},function(e,t){e.exports=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}},function(e,t,n){var r=n(38)(n(14),"Map");e.exports=r},function(e,t,n){var r=n(358),o=n(365),i=n(367),s=n(368),a=n(369);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){(function(e){var r=n(174),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=i&&i.exports===o&&r.process,a=function(){try{var e=i&&i.require&&i.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a}).call(this,n(84)(e))},function(e,t,n){var r=n(69),o=n(374),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(379),o=n(181),i=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),r(s(e),(function(t){return i.call(e,t)})))}:o;e.exports=a},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(179)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(188);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t,n){"use strict";e.exports={error:{priority:1,method:"error"},warn:{priority:2,method:"warn"},info:{priority:3,method:"info"},log:{priority:4,method:"log"},debug:{priority:5,method:"debug"},spam:{priority:6,method:"log"}}},function(e,t){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},function(e,t,n){var r=n(395),o=n(194)(r);e.exports=o},function(e,t,n){var r=n(52),o=n(25),i=n(67),s=n(9);e.exports=function(e,t,n){if(!s(n))return!1;var a=typeof t;return!!("number"==a?o(n)&&i(t,n.length):"string"==a&&t in n)&&r(n[t],e)}},function(e,t,n){"use strict";e.exports=n(196)()?Object.setPrototypeOf:n(197)},function(e,t,n){"use strict";var r=n(55),o={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!r(e)&&hasOwnProperty.call(o,typeof e)}},function(e,t,n){"use strict";e.exports=n(406)()?Object.assign:n(407)},function(e,t,n){"use strict";const r=n(1)("Event"),o=n(7),i=n(127);e.exports=function(){function e(e,t,n){void 0===t&&(t=!0),void 0===n&&(n={}),this.type=e,this.cancelable=t,this._defaultPrevented=!1;const r=i(Object.keys(this),Object.keys(n));if(r.length>0)throw new Error("Cannot used reserved property names: "+r.join(","));o(this,n)}var t=e.prototype;return t.preventDefault=function(){this.cancelable?this._defaultPrevented=!0:r.warn("Event.preventDefault :: Trying to preventDefault on an event that isn't cancelable")},t.isDefaultPrevented=function(){return this._defaultPrevented},e}()},function(e,t,n){var r=n(33),o=n(447),i=n(87),s=n(453),a=i((function(e){var t=r(e,s);return t.length&&t[0]===e[0]?o(t):[]}));e.exports=a},function(e,t){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}},function(e,t,n){var r=n(25),o=n(16);e.exports=function(e){return o(e)&&r(e)}},function(e,t){e.exports={}},function(e,t,n){var r=n(217),o=n(476),i=n(477),s=n(219),a=n(488),c=n(223),u=n(489),d=n(226),l=n(227),p=n(96),f=Math.max;e.exports=function(e,t,n,h,m,b,g,v){var y=2&t;if(!y&&"function"!=typeof e)throw new TypeError("Expected a function");var S=h?h.length:0;if(S||(t&=-97,h=m=void 0),g=void 0===g?g:f(p(g),0),v=void 0===v?v:p(v),S-=m?m.length:0,64&t){var E=h,T=m;h=m=void 0}var C=y?void 0:c(e),w=[e,t,n,h,m,E,T,b,g,v];if(C&&u(w,C),e=w[0],t=w[1],n=w[2],h=w[3],m=w[4],!(v=w[9]=void 0===w[9]?y?0:e.length:f(w[9]-S,0))&&24&t&&(t&=-25),t&&1!=t)R=8==t||16==t?i(e,t,v):32!=t&&33!=t||m.length?s.apply(void 0,w):a(e,t,n,h);else var R=o(e,t,n);return l((C?r:d)(R,w),e,t)}},function(e,t,n){var r=n(86),o=n(133);function i(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var s=e[n];s!==t&&"__lodash_placeholder__"!==s||(e[n]="__lodash_placeholder__",i[o++]=n)}return i}},function(e,t,n){var r=n(29),o=n(117),i=n(16),s=Function.prototype,a=Object.prototype,c=s.toString,u=a.hasOwnProperty,d=c.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==d}},function(e,t,n){var r=n(10),o=n(71),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||(s.test(e)||!i.test(e)||null!=t&&e in Object(t))}},function(e,t,n){var r=n(512),o=n(193),i=n(121);e.exports=function(e){return i(o(e,void 0,r),e+"")}},function(e,t,n){"use strict";const r=n(240),o=e=>e.replace(/\/$/,"");e.exports={prependProxyToUrlIfNeeded:(e,t)=>{if(!t)return e;const n=r.parse(t),i=r.parse(e);if(!n.protocol||!i.protocol)return e;const s=n.protocol.match(/^https/),a=i.protocol.match(/^ws/i);return`${o(`${(a?"ws":"http")+(s?"s":"")}://${n.host}${n.pathname}`)}/${o(`${i.host}${i.pathname}${i.search||""}`)}`}}},function(e,t,n){"use strict";const r=n(21),o=n(11),i=n(4),s=n(8),a=n(22);let c;const u={SET_PROXY_URL_TIMING_ERROR:"The proxyUrl was set after a session or publisher was created.",PROXY_URL_ALREADY_SET_ERROR:"The proxyUrl has already been set. Setting it again will not have any effect."};e.exports={errorMessages:u,setProxyUrl:e=>{const t=n(27),d=n(72),l=new t,p=r.sessions.length()>0,f=r.publishers.length()>0;let h;if(p){const e=r.sessions.find(e=>"connected"===e.currentState);h=e?e.sessionId:r.sessions.find().sessionId}else h="";const m={sessionId:h,apiKey:d.value};if(f||p){const e=o()(i.SET_PROXY_URL_TIMING_ERROR,new Error(u.SET_PROXY_URL_TIMING_ERROR),s.SET_PROXY_URL_TIMING_ERROR);a.handleJsException({error:e,target:m,analytics:l})}else if(c){const e=o()(i.PROXY_URL_ALREADY_SET_ERROR,new Error(u.PROXY_URL_ALREADY_SET_ERROR),s.PROXY_URL_ALREADY_SET_ERROR);a.handleJsException({error:e,target:m,analytics:l})}else c=e},getProxyUrl:()=>c,clearProxyUrl:()=>{c=null}}},function(e,t,n){var r=n(87),o=n(52),i=n(122),s=n(53),a=Object.prototype,c=a.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&i(t[0],t[1],u)&&(r=1);++n<r;)for(var d=t[n],l=s(d),p=-1,f=l.length;++p<f;){var h=l[p],m=e[h];(void 0===m||o(m,a[h])&&!c.call(e,h))&&(e[h]=d[h])}return e}));e.exports=u},function(e,t,n){"use strict";var r=n(3)(n(46));const o=n(57),i=n(56);let s=function(){function e(e){void 0===e&&(e={}),Object.defineProperty(this,"_rawSessionInfo",{value:i(e)})}return(0,r.default)(e,[{key:"sessionId",get:function(){return this._rawSessionInfo.session_id}},{key:"partnerId",get:function(){return this._rawSessionInfo.partner_id}},{key:"messagingServer",get:function(){return this._rawSessionInfo.messaging_server_url}},{key:"mediaServerName",get:function(){return this._rawSessionInfo.media_server_hostname}},{key:"messagingURL",get:function(){return this._rawSessionInfo.messaging_url}},{key:"symphonyAddress",get:function(){return this._rawSessionInfo.symphony_address}},{key:"iceServers",get:function(){return this._rawSessionInfo.ice_servers}},{key:"simulcast",get:function(){return o(this._rawSessionInfo,"properties.simulcast")}},{key:"reconnection",get:function(){return o(this._rawSessionInfo,"properties.reconnection",!1)}},{key:"renegotiation",get:function(){return o(this._rawSessionInfo,"properties.renegotiation",!1)}},{key:"p2pEnabled",get:function(){return"enabled"===o(this._rawSessionInfo,"properties.p2p.preference.value")}},{key:"hybridSession",get:function(){return o(this._rawSessionInfo,"properties.hybridSession",!1)}},{key:"isAdaptiveEnabled",get:function(){return"adaptive"===o(this._rawSessionInfo,"properties.p2p.preference.value")}},{key:"priorityVideoCodec",get:function(){return o(this._rawSessionInfo,"properties.priorityVideoCodec","")}},{key:"h264",get:function(){return o(this._rawSessionInfo,"properties.h264",!0)}},{key:"vp8",get:function(){return o(this._rawSessionInfo,"properties.vp8",!0)}},{key:"vp9",get:function(){return o(this._rawSessionInfo,"properties.vp9",!0)}},{key:"clientCandidates",get:function(){const e=o(this._rawSessionInfo,"properties.clientCandidates");return"relayed"===e?"relay":e}}]),e}();e.exports=s},function(module,exports,__webpack_require__){"use strict";const extendES5Native=__webpack_require__(548),webrtcAdapter=__webpack_require__(549),logging=__webpack_require__(1)("createWindowMock"),env=__webpack_require__(2),windowKeys=[{key:"location",type:"object"},{key:"setTimeout",type:"function"},{key:"requestAnimationFrame",type:"function"},{key:"URL",type:"function"},{key:"MediaStream",type:"class"},{key:"webkitMediaStream",type:"class"},{key:"RTCIceCandidate",type:"class"},{key:"mozRTCIceCandidate",type:"class"},{key:"RTCSessionDescription",type:"class"},{key:"mozRTCSessionDescription",type:"class"},{key:"RTCIceGatherer",type:"class"},{key:"RTCIceTransport",type:"class"},{key:"RTCDtlsTransport",type:"class"},{key:"RTCSctpTransport",type:"class"},{key:"RTCRtpReceiver",type:"class"},{key:"HTMLMediaElement",type:"class"},{key:"RTCPeerConnection",type:"class"},{key:"webkitRTCPeerConnection",type:"class"},{key:"mozRTCPeerConnection",type:"class"},{key:"MediaStreamTrack",type:"class"},{key:"RTCRtpSender",type:"class"},{key:"RTCTrackEvent",type:"class"},{key:"RTCTransceiver",type:"class"},{key:"RTCDtmfSender",type:"class"},{key:"RTCDTMFSender",type:"class"},{key:"MediaStreamTrackEvent",type:"class"}],navigatorKeys=[{key:"userAgent",type:"string"},{key:"getUserMedia",type:"function"},{key:"getDisplayMedia",type:"function"},{key:"webkitGetUserMedia",type:"function"},{key:"mozGetUserMedia",type:"function"}],mediaDevicesKeys=[{key:"getUserMedia",type:"function"},{key:"getDisplayMedia",type:"function"},{key:"enumerateDevices",type:"function"},{key:"getSupportedConstraints",type:"function"},{key:"addEventListener",type:"function"},{key:"removeEventListener",type:"function"}],bindWithStaticProperties=(e,t)=>{if("function"!=typeof t)return logging.warn("Non-function passed into bindWithStaticProperties()"),t;const n=t.bind(e);return Object.keys(t).forEach(e=>{n[e]=t[e]}),n},extendParentClass=ParentClass=>{try{const ChildClass=eval('\n "use strict"; // Chrome<49 requires strict mode\n\n const getOwnProperties = (target) => {\n const properties = {};\n Object.getOwnPropertyNames(target).forEach((key) => {\n properties[key] = Object.getOwnPropertyDescriptor(target, key);\n });\n return properties;\n };\n\n class ChildClass extends ParentClass {\n constructor(...args) {\n super(...args);\n try {\n this.__proto__ = ChildClass.prototype;\n } catch (e) {}\n }\n };\n\n Object.defineProperties(ChildClass.prototype, getOwnProperties(ParentClass.prototype));\n Object.keys(ParentClass)\n .forEach((staticKey) => {\n ChildClass[staticKey] = ParentClass[staticKey];\n });\n\n ChildClass; // Ensure the final statement is returned in FF\n ');if(ChildClass&&ChildClass.prototype instanceof ParentClass)return ChildClass}catch(e){}return null},canUseES6Class=e=>{const t=e.RTCPeerConnection||e.webkitRTCPeerConnection||e.mozRTCPeerConnection,n=extendParentClass(t);if(n)try{n.prototype.foo="bar";const e=new n({iceServers:[]}),t="bar"===e.foo;try{e.close()}catch(e){}return t}catch(e){}return!1},extendClass=(e,t,n)=>{if("function"!=typeof e)return logging.warn("Non-function passed into extendClass()"),e;let r=n&&extendParentClass(e);return r||(r=extendES5Native(e)),r},getCopyProperties=e=>(t,n,r)=>{r.forEach(r=>{let o=r.key,i=r.type,s=n[o];if(void 0!==s){switch(i){case"function":s=bindWithStaticProperties(n,s);break;case"class":s=extendClass(s,o,e);break;case"string":case"object":break;default:throw new Error("Invalid type of window key: "+i)}t[o]=s}})},cloneWindow=e=>{const t={},n=getCopyProperties(canUseES6Class(e));return n(t,e,windowKeys),void 0!==e.navigator&&(t.navigator={},n(t.navigator,e.navigator,navigatorKeys),void 0!==e.navigator.mediaDevices&&(t.navigator.mediaDevices={},n(t.navigator.mediaDevices,e.navigator.mediaDevices,mediaDevicesKeys))),t};module.exports=function(e){if(void 0!==e.adapter||env.isLegacyEdge)return e;const t=cloneWindow(e);return webrtcAdapter({window:t}),t}},function(e,t,n){"use strict";e.exports=function(){let e=null;this.transform=t=>{e=null===e||t>=e?t:.3*t+.7*e;const n=Math.log(e)/Math.LN10/1.5+1;return Math.min(Math.max(n,0),1)}}},function(e,t,n){"use strict";const r=n(6),o=e=>Object.keys(e).map(t=>e[t]),i=n(7);e.exports=function(e){const t={},n=(n,r)=>{i(r,{parent:this}),r.appendTo(e.parent),t[n]=r,this[n]=r};e.parent&&(r(this),this.destroy=()=>{this.off(),this.hideWhileLoading(),o(t).forEach(e=>e.destroy())},this.showAfterLoading=()=>{o(t).forEach(e=>e.showAfterLoading())},this.hideWhileLoading=()=>{o(t).forEach(e=>e.hideWhileLoading())},this.set=(e,t)=>("string"==typeof e&&t?n(e,t):Object.keys(e).forEach(t=>{n(t,e[t])}),this))}},function(e,t,n){"use strict";var r=n(3)(n(18));e.exports=function(){function e(e){(0,r.default)(this,"_analyser",null),(0,r.default)(this,"_timeDomainData",null),(0,r.default)(this,"_sourceNode",null),this._audioContext=e}var t=e.prototype;return t._initAudioAnalyser=function(e){this._analyser=this._audioContext.createAnalyser(),this._sourceNode=this._audioContext.createMediaStreamSource(e),this._sourceNode.connect(this._analyser),this._timeDomainData=new Uint8Array(this._analyser.frequencyBinCount)},t.webRTCStream=function(e){this._sourceNode&&this._sourceNode.disconnect(this._analyser),"suspended"===this._audioContext.state&&this._audioContext.resume(),this._initAudioAnalyser(e)},t.destroy=function(){this._sourceNode&&this._sourceNode.disconnect(this._analyser),this._timeDomainData=null},t.sample=function(e){if("function"==typeof e)throw new Error("sample no longer takes a callback");if(this._analyser&&this._timeDomainData){this._analyser.getByteTimeDomainData(this._timeDomainData);let e=0;for(let t=this._timeDomainData.length-1;t>=0;t-=1)e=Math.max(e,Math.abs(this._timeDomainData[t]-128));return e/128}return null},e}()},function(e,t,n){"use strict";const r=n(560),o=n(26),i=n(6),s=n(23)();e.exports=new function(){const e=this;function t(){return r.isDomLoaded()&&!r.isDomUnloaded()}function n(){e.dispatchEvent(new s.EnvLoadedEvent(o.ENV_UNLOADED))}i(e),r.whenLoaded.then((function(){r.whenUnloaded.then(n),t()&&e.dispatchEvent(new s.EnvLoadedEvent(o.ENV_LOADED))})),this.onLoad=function(n,r){t()?n.call(r):e.on(o.ENV_LOADED,n,r)},this.onUnload=function(t,n){this.isUnloaded()?t.call(n):e.on(o.ENV_UNLOADED,t,n)},this.isUnloaded=function(){return r.isDomUnloaded()}}},function(e,t,n){var r=n(561),o=n(192)((function(e,t,n){r(e,t,n)}));e.exports=o},function(e,t,n){"use strict";var r=n(565);
|
|
17
|
+
*/var n;n=function(){"use strict";function e(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},r=0,i=void 0,o=void 0,s=function(e,t){f[r]=e,f[r+1]=t,2===(r+=2)&&(o?o(h):y())},a="undefined"!=typeof window?window:void 0,c=a||{},u=c.MutationObserver||c.WebKitMutationObserver,d="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),l="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){var e=setTimeout;return function(){return e(h,1)}}var f=new Array(1e3);function h(){for(var e=0;e<r;e+=2)(0,f[e])(f[e+1]),f[e]=void 0,f[e+1]=void 0;r=0}var m,g,b,v,y=void 0;function E(e,t){var n=this,r=new this.constructor(w);void 0===r[_]&&A(r);var i=n._state;if(i){var o=arguments[i-1];s((function(){return N(i,r,o,n._result)}))}else O(n,r,e,t);return r}function S(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(w);return C(t,e),t}d?y=function(){return t.nextTick(h)}:u?(g=0,b=new u(h),v=document.createTextNode(""),b.observe(v,{characterData:!0}),y=function(){v.data=g=++g%2}):l?((m=new MessageChannel).port1.onmessage=h,y=function(){return m.port2.postMessage(0)}):y=void 0===a?function(){try{var e=Function("return this")().require("vertx");return void 0!==(i=e.runOnLoop||e.runOnContext)?function(){i(h)}:p()}catch(e){return p()}}():p();var _=Math.random().toString(36).substring(2);function w(){}function T(t,n,r){n.constructor===t.constructor&&r===E&&n.constructor.resolve===S?function(e,t){1===t._state?R(e,t._result):2===t._state?x(e,t._result):O(t,void 0,(function(t){return C(e,t)}),(function(t){return x(e,t)}))}(t,n):void 0===r?R(t,n):e(r)?function(e,t,n){s((function(e){var r=!1,i=function(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}(n,t,(function(n){r||(r=!0,t!==n?C(e,n):R(e,n))}),(function(t){r||(r=!0,x(e,t))}),e._label);!r&&i&&(r=!0,x(e,i))}),e)}(t,n,r):R(t,n)}function C(e,t){if(e===t)x(e,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=t),null===r||"object"!==i&&"function"!==i)R(e,t);else{var n=void 0;try{n=t.then}catch(t){return void x(e,t)}T(e,t,n)}var r,i}function I(e){e._onerror&&e._onerror(e._result),k(e)}function R(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&s(k,e))}function x(e,t){void 0===e._state&&(e._state=2,e._result=t,s(I,e))}function O(e,t,n,r){var i=e._subscribers,o=i.length;e._onerror=null,i[o]=t,i[o+1]=n,i[o+2]=r,0===o&&e._state&&s(k,e)}function k(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,i=void 0,o=e._result,s=0;s<t.length;s+=3)r=t[s],i=t[s+n],r?N(n,r,i,o):i(o);e._subscribers.length=0}}function N(t,n,r,i){var o=e(r),s=void 0,a=void 0,c=!0;if(o){try{s=r(i)}catch(e){c=!1,a=e}if(n===s)return void x(n,new TypeError("A promises callback cannot return that same promise."))}else s=i;void 0!==n._state||(o&&c?C(n,s):!1===c?x(n,a):1===t?R(n,s):2===t&&x(n,s))}var Z=0;function A(e){e[_]=Z++,e._state=void 0,e._result=void 0,e._subscribers=[]}var L=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(w),this.promise[_]||A(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?R(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&R(this.promise,this._result))):x(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;void 0===this._state&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===S){var i=void 0,o=void 0,s=!1;try{i=e.then}catch(e){s=!0,o=e}if(i===E&&void 0!==e._state)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(n===V){var a=new n(w);s?x(a,o):T(a,e,i),this._willSettleAt(a,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;void 0===r._state&&(this._remaining--,2===e?x(r,n):this._result[t]=n),0===this._remaining&&R(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;O(e,void 0,(function(e){return n._settledAt(1,t,e)}),(function(e){return n._settledAt(2,t,e)}))},e}(),V=function(){function t(e){this[_]=Z++,this._result=this._state=void 0,this._subscribers=[],w!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(e,t){try{t((function(t){C(e,t)}),(function(t){x(e,t)}))}catch(t){x(e,t)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(e){return this.then(null,e)},t.prototype.finally=function(t){var n=this.constructor;return e(t)?this.then((function(e){return n.resolve(t()).then((function(){return e}))}),(function(e){return n.resolve(t()).then((function(){throw e}))})):this.then(t,t)},t}();return V.prototype.then=E,V.all=function(e){return new L(this,e).promise},V.race=function(e){var t=this;return n(e)?new t((function(n,r){for(var i=e.length,o=0;o<i;o++)t.resolve(e[o]).then(n,r)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},V.resolve=S,V.reject=function(e){var t=new this(w);return x(t,e),t},V._setScheduler=function(e){o=e},V._setAsap=function(e){s=e},V._asap=s,V.polyfill=function(){var e=void 0;if(void 0!==(void 0!==typeof window?window:global))e=void 0!==typeof window?window:global;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=V},V.Promise=V,V},e.exports=n()}).call(this,n(43))},function(e,t,n){"use strict";const r=n(396),i=n(194),o=n(120),s=i(e=>{const t={};return Object.keys(o).forEach(n=>{const i=o[n].method,s=r(`OpenTok:${e}:${n.toLowerCase()}`);s.log=console[i].bind(console),t[n.toLowerCase()]=s}),t});s.setLogLevel=e=>{let t;try{t=(void 0!==typeof window?window:global).localStorage.debug}catch(e){t=""}const n=[...Object.keys(o).map(t=>`${e>=o[t].priority?"":"-"}(autogen)?OpenTok:*:${t.toLowerCase()}`),...(t||"").split(/[\s,]/).filter(e=>-1===e.indexOf("(autogen)?"))].filter(e=>e).join(",");r.enable(n)},e.exports=s},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";const r=n(538).parse();e.exports=r},function(e,t,n){"use strict";e.exports={AUTHENTICATION_ERROR:"OT_AUTHENTICATION_ERROR",BADLY_FORMED_RESPONSE:"OT_BADLY_FORMED_RESPONSE",CHROME_MICROPHONE_ACQUISITION_ERROR:"OT_CHROME_MICROPHONE_ACQUISITION_ERROR",CONNECT_FAILED:"OT_CONNECT_FAILED",CONNECTION_LIMIT_EXCEEDED:"OT_CONNECTION_LIMIT_EXCEEDED",CONSTRAINTS_NOT_SATISFIED:"OT_CONSTRAINTS_NOT_SATISFIED",CREATE_PEER_CONNECTION_FAILED:"OT_CREATE_PEER_CONNECTION_FAILED",DISCONNECTED:"OT_DISCONNECTED",EMPTY_RESPONSE_BODY:"OT_EMPTY_RESPONSE_BODY",GET_RTC_STATS_REPORT_NOT_SUPPORTED:"OT_GET_RTC_STATS_REPORT_NOT_SUPPORTED",HARDWARE_UNAVAILABLE:"OT_HARDWARE_UNAVAILABLE",ICE_WORKFLOW_FAILED:"OT_ICE_WORKFLOW_FAILED",INVALID_HTTP_STATUS:"OT_INVALID_HTTP_STATUS",INVALID_PARAMETER:"OT_INVALID_PARAMETER",INVALID_SESSION_ID:"OT_INVALID_SESSION_ID",MEDIA_ERR_ABORTED:"OT_MEDIA_ERR_ABORTED",MEDIA_ERR_DECODE:"OT_MEDIA_ERR_DECODE",MEDIA_ERR_NETWORK:"OT_MEDIA_ERR_NETWORK",MEDIA_ERR_SRC_NOT_SUPPORTED:"OT_MEDIA_ERR_SRC_NOT_SUPPORTED",MEDIA_ENDED:"OT_MEDIA_ENDED",NO_DEVICES_FOUND:"OT_NO_DEVICES_FOUND",NO_VALID_CONSTRAINTS:"OT_NO_VALID_CONSTRAINTS",NOT_CONNECTED:"OT_NOT_CONNECTED",NOT_FOUND:"OT_NOT_FOUND",NOT_SUPPORTED:"OT_NOT_SUPPORTED",PEER_CONNECTION_NOT_CONNECTED:"OT_PEER_CONNECTION_NOT_CONNECTED",PERMISSION_DENIED:"OT_PERMISSION_DENIED",RATE_LIMIT_EXCEEDED:"OT_RATE_LIMIT_EXCEEDED",REPORT_ISSUE_FAILED:"OT_REPORT_ISSUE_FAILED",SCREEN_SHARING_EXTENSION_NOT_INSTALLED:"OT_SCREEN_SHARING_EXTENSION_NOT_INSTALLED",SCREEN_SHARING_EXTENSION_NOT_REGISTERED:"OT_SCREEN_SHARING_EXTENSION_NOT_REGISTERED",SCREEN_SHARING_NOT_SUPPORTED:"OT_SCREEN_SHARING_NOT_SUPPORTED",SET_REMOTE_DESCRIPTION_FAILED:"OT_SET_REMOTE_DESCRIPTION_FAILED",SOCKET_ALREADY_CONNECTED_CONNECTING:"OT_SOCKET_ALREADY_CONNECTED_CONNECTING",SOCKET_CLOSE_ABNORMAL:"OT_SOCKET_CLOSE_ABNORMAL",SOCKET_CLOSE_CONNECT_EXCEPTION:"OT_SOCKET_CLOSE_CONNECT_EXCEPTION",SOCKET_CLOSE_CONNECTIVITY_LOSS:"OT_SOCKET_CLOSE_CONNECTIVITY_LOSS",SOCKET_CLOSE_FALLBACK_CODE:"OT_SOCKET_CLOSE_FALLBACK_CODE",SOCKET_CLOSE_INCONSISTENT_DATA:"OT_SOCKET_CLOSE_INCONSISTENT_DATA",SOCKET_CLOSE_NO_STATUS:"OT_SOCKET_CLOSE_NO_STATUS",SOCKET_CLOSE_POLICY_VIOLATION:"OT_SOCKET_CLOSE_POLICY_VIOLATION",SOCKET_CLOSE_GOING_AWAY:"OT_SOCKET_CLOSE_GOING_AWAY",SOCKET_CLOSE_PROTOCOL_ERROR:"OT_SOCKET_CLOSE_PROTOCOL_ERROR",SOCKET_CLOSE_TIMEOUT:"OT_SOCKET_CLOSE_TIMEOUT",SOCKET_CLOSE_TOO_LARGE:"OT_SOCKET_CLOSE_TOO_LARGE",SOCKET_CLOSE_UNEXPECTED_CONDITION:"OT_SOCKET_CLOSE_UNEXPECTED_CONDITION",SOCKET_CLOSE_UNSUPPORTED:"OT_SOCKET_CLOSE_UNSUPPORTED",STREAM_CREATE_FAILED:"OT_STREAM_CREATE_FAILED",STREAM_DESTROYED:"OT_STREAM_DESTROYED",STREAM_LIMIT_EXCEEDED:"OT_STREAM_LIMIT_EXCEEDED",STREAM_NOT_FOUND:"OT_STREAM_NOT_FOUND",UNABLE_TO_SUBSCRIBE:"OT_UNABLE_TO_SUBSCRIBE",TERMS_OF_SERVICE_FAILURE:"OT_TERMS_OF_SERVICE_FAILURE",TIMEOUT:"OT_TIMEOUT",CANCEL:"OT_CANCEL",UNABLE_TO_CAPTURE_MEDIA:"OT_UNABLE_TO_CAPTURE_MEDIA",UNABLE_TO_CAPTURE_SCREEN:"OT_UNABLE_TO_CAPTURE_SCREEN",UNEXPECTED_ERROR_CODE:"OT_UNEXPECTED_ERROR_CODE",UNEXPECTED_HTTP_STATUS:"OT_UNEXPECTED_HTTP_STATUS",UNEXPECTED_SERVER_RESPONSE:"OT_UNEXPECTED_SERVER_RESPONSE",UNKNOWN_HTTP_ERROR:"OT_UNKNOWN_HTTP_ERROR",UNSUPPORTED_BROWSER:"OT_UNSUPPORTED_BROWSER",USER_MEDIA_ACCESS_DENIED:"OT_USER_MEDIA_ACCESS_DENIED",XDOMAIN_OR_PARSING_ERROR:"OT_XDOMAIN_OR_PARSING_ERROR",API_KEY_DISABLED:"OT_API_KEY_DISABLED",UNABLE_TO_ACCESS_MEDIA_ENGINE:"OT_UNABLE_TO_ACCESS_MEDIA_ENGINE",SET_PROXY_URL_TIMING_ERROR:"OT_SET_PROXY_URL_TIMING_ERROR",PROXY_URL_ALREADY_SET_ERROR:"OT_PROXY_URL_ALREADY_SET_ERROR",SET_VIDEO_SOURCE_FAILURE:"OT_SET_VIDEO_SOURCE_FAILURE",INVALID_VIDEO_SOURCE:"OT_INVALID_VIDEO_SOURCE",REQUESTED_DEVICE_PERMISSION_DENIED:"OT_REQUESTED_DEVICE_PERMISSION_DENIED",INVALID_AUDIO_OUTPUT_SOURCE:"OT_INVALID_AUDIO_OUTPUT_SOURCE"}},function(e,t,n){"use strict";const r=n(248),i=n(252),o=n(6),s=n(1);r.logging=s("OT.$"),r.ElementCollection=n(249),r.env=n(3),r.ajax=n(247),r.statable=n(547),r.Analytics=n(26),r.Collection=n(251),r.domExtras=n(548),r.Error=n(253),i(r,"useLogHelpers",{value(e){const t=s("useLogHelpersDeprecatedMixin");return Object.keys(t).forEach(n=>{e[n]=t[n]}),e},name:"OT.useLogHelpers",getWarning:"Please use an external library for your debugging needs"}),r.defaults=n(141),i(r,"eventing",{value:o,name:"OT.$.eventing",getWarning:"Please use an external library to create an event emitter."}),Object.keys(r).forEach(e=>{const t=r[e]._attachToOTHelpers||{};Object.keys(t).forEach(n=>{!Object.hasOwnProperty.call(r,n)||"util"===e&&"bind"===n||console.warn(`More than one module is trying to define ${n} on OTHelpers.`),r[n]=t[n]})}),e.exports=r},function(e,t,n){"use strict";const r=n(42),i=n(15),o=n(1)("Events"),s=n(9),a=n(401);e.exports=function(e){const t=new r;t.on("newListener",e=>{t.emit(e+":added")}),t.on("removeListener",e=>{t.emit(e+":removed")});const n={on(e,n,r){return"string"==typeof e&&n?e.split(" ").forEach(e=>{t.on(e,a(n,r))}):Object.keys(e).forEach(r=>{t.on(r,a(e[r],n))}),this},off(e,n,r){return"string"==typeof e?this.off(e.split(" "),n,r):Array.isArray(e)?e.forEach(e=>{n&&i(n)?t.removeListener(e,a(n,r)):t.removeAllListeners(e)}):e?Object.keys(e).forEach(r=>{t.removeListener(r,a(e[r],n))}):t.removeAllListeners(),this},once(e,n,r){return"string"==typeof e&&n?e.split(" ").forEach(e=>{t.once(e,a(n,r))}):Object.keys(e).forEach(r=>{t.once(r,a(e[r],n))}),this},dispatchEvent(e){if(!e.type)throw new Error("dispatchEvent: Event has no type");return e.target||(e.target=this),this.trigger(e.type,e),this},trigger(e){try{for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.emit(e,...r)}catch(e){o.error("An error occurred in an event handler",e)}return this},emit(){return e.trigger(...arguments)},addEventListener:(t,n,r)=>(o.warn("The addEventListener() method is deprecated. Use on() or once() instead."),e.on(t,n,r)),removeEventListener:(t,n,r)=>(o.warn("The removeEventListener() method is deprecated. Use off() instead."),e.off(t,n,r)),listenerCount:e=>t.listenerCount(e)};return s(e,n)}},function(e,t,n){e.exports=n(530)},function(e,t,n){(function(t){function n(e,n,r,i,o,s,a){try{var c=e[s](a),u=c.value}catch(e){return void r(e)}c.done?n(u):t.resolve(u).then(i,o)}e.exports=function(e){return function(){var r=this,i=arguments;return new t((function(t,o){var s=e.apply(r,i);function a(e){n(s,t,o,a,c,"next",e)}function c(e){n(s,t,o,a,c,"throw",e)}a(void 0)}))}}}).call(this,n(0))},function(e,t,n){var r=n(83),i=n(40),o=n(195),s=n(25),a=n(69),c=n(30),u=Object.prototype.hasOwnProperty,d=o((function(e,t){if(a(t)||s(t))i(t,c(t),e);else for(var n in t)u.call(t,n)&&r(e,n,t[n])}));e.exports=d},function(e,t,n){"use strict";e.exports={JS_EXCEPTION:2e3,AUTHENTICATION_ERROR:1004,INVALID_SESSION_ID:1005,CONNECT_FAILED:1006,CONNECT_REJECTED:1007,CONNECTION_TIMEOUT:1008,NOT_CONNECTED:1010,INVALID_PARAMETER:1011,P2P_CONNECTION_FAILED:1013,API_RESPONSE_FAILURE:1014,PEER_CONNECTION_NOT_CONNECTED:1015,TERMS_OF_SERVICE_FAILURE:1026,CONNECTION_LIMIT_EXCEEDED:1027,UNABLE_TO_PUBLISH:1500,UNABLE_TO_SUBSCRIBE:1501,UNSUPPORTED_VIDEO_CODEC:1502,UNABLE_TO_FORCE_DISCONNECT:1520,UNABLE_TO_FORCE_UNPUBLISH:1530,UNABLE_TO_FORCE_MUTE:1540,PUBLISHER_ICE_WORKFLOW_FAILED:1553,SUBSCRIBER_ICE_WORKFLOW_FAILED:1554,STREAM_LIMIT_EXCEEDED:1605,UNEXPECTED_SERVER_RESPONSE:2001,REPORT_ISSUE_ERROR:2011,SET_PROXY_URL_TIMING_ERROR:2021,PROXY_URL_ALREADY_SET_ERROR:2022,GET_RTC_STATS_REPORT_NOT_SUPPORTED:2031,ANVIL_BADLY_FORMED_RESPONSE:3001,ANVIL_INVALID_HTTP_STATUS:3002,ANVIL_XDOMAIN_OR_PARSING_ERROR:3003,ANVIL_UNKNOWN_HTTP_ERROR:3004,ANVIL_UNEXPECTED_ERROR_CODE:3005,ANVIL_EMPTY_RESPONSE_BODY:3006,ANVIL_CONNECT_FAILED:3007,UNABLE_TO_ACCESS_MEDIA_ENGINE:5001}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(4),r=e.OTErrorClass||n(22),i=Object.keys(t).map(e=>t[e]);return function(e,t,n){if(-1===i.indexOf(e))return new Error(`Attempt to use invalid error name (${e}). Original message: ${t.message}`);if(!(t instanceof Error||/^\[object .*Error\]$/.test(Object.prototype.toString.call(t))))return new Error("Did not pass Error as second argument: "+t);const o=new r(void 0,t.message);if(o.name=e,!t.stack)try{throw t}catch(e){}return o.stack=t.stack,n&&(o.code=n),o}}},function(e,t,n){var r=n(177),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){var r=n(29),i=n(11);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";var r=n(211),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===i.call(e)}function d(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:o,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isPlainObject:c,isUndefined:s,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:d,merge:function e(){var t={};function n(n,r){c(t[r])&&c(n)?t[r]=e(t[r],n):c(n)?t[r]=e({},n):o(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)d(arguments[r],n);return t},extend:function(e,t,n){return d(t,(function(t,i){e[i]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var r=n(532),i=n(533),o=i;o.v1=r,o.v4=i,e.exports=o},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){"use strict";const r=n(251),i={publishers:new r("guid"),subscribers:new r("widgetId"),sessions:new r};e.exports=i},function(e,t,n){"use strict";const r=n(1)("GlobalExceptionHandler"),i=n(6),o=n(27),s=n(546),a=n(23)(),c=function(e,t){Error.call(this),this.code=e,this.message=t};(c.prototype=Object.create(Error.prototype)).constructor=c,e.exports=c,i(c),c.getTitleByCode=function(e){return s[+e]},c.handleJsException=e=>{let t=e.error,n=e.errorMsg,i=e.code,s=e.target,u=e.analytics;if(!s)throw new Error("handleJsException requires target");const d=()=>void 0!==i?i:t&&t.code,l=()=>void 0!==n?n:t&&t.message,p=c.getTitleByCode(d());r.error(`OT.exception :: title: ${p} (${d()}) msg: ${l()}`);try{const e={partnerId:s.session?s.session.apiKey:s.apiKey,sessionId:s.session?s.session.sessionId:s.sessionId};u.logError(d(),"tb.exception",p,{details:l()},e);const n=new a.ExceptionEvent(o.EXCEPTION,l(),p,d(),s,s,t);if(t)n.stack=t.stack;else try{throw new Error}catch(e){n.stack=e.stack}c.dispatchEvent(n)}catch(e){r.error("OT.exception :: Failed to dispatch exception - "+e.toString())}}},function(e,t,n){"use strict";var r=n(2),i=r(n(46)),o=r(n(61));const s=n(127),a=n(27);e.exports=function(e){void 0===e&&(e={});const t=e.logging||n(1)("Events"),r={ExceptionEvent:function(e,t,n,r,i,o,a){return new s(e,!1,{error:a,message:t,title:n,code:r,component:i,target:o})},IssueReportedEvent:function(e,t){return new s(e,!1,{issueId:t})},EnvLoadedEvent:function(e){return new s(e,!1)}};let c=!1;r.ConnectionEvent=function(e){function n(t,n,r){return e.call(this,t,!1,{connection:n,reason:r})||this}return(0,o.default)(n,e),(0,i.default)(n,[{key:"connections",get:function(){return c||(t.warn("OT.ConnectionEvent connections property is deprecated, use connection instead."),c=!0),[this.connection]}}]),n}(s);let u=!1;r.StreamEvent=function(e){function n(t,n,r,i){return e.call(this,t,i,{stream:n,reason:r})||this}return(0,o.default)(n,e),(0,i.default)(n,[{key:"streams",get:function(){return u||(t.warn("OT.StreamEvent streams property is deprecated, use stream instead."),u=!0),[this.stream]}}]),n}(s);let d=!1,l=!1,p=!1;return r.SessionConnectEvent=function(e){function n(t){return e.call(this,t,!1)||this}return(0,o.default)(n,e),(0,i.default)(n,[{key:"connections",get:function(){return d||(t.warn("OT.SessionConnectedEvent no longer includes connections. Listen for connectionCreated events instead."),d=!0),[]}},{key:"streams",get:function(){return l||(t.warn("OT.SessionConnectedEvent no longer includes streams. Listen for streamCreated events instead."),l=!0),[]}},{key:"archives",get:function(){return p||(t.warn("OT.SessionConnectedEvent no longer includes archives. Listen for archiveStarted events instead."),p=!0),[]}}]),n}(s),r.SessionReconnectingEvent=function(){return new s(a.SESSION_RECONNECTING,!1)},r.SessionReconnectedEvent=function(){return new s(a.SESSION_RECONNECTED)},r.SessionDisconnectEvent=function(e,t,n){return new s(e,n,{reason:t})},r.StreamPropertyChangedEvent=function(e,t,n,r,i){return new s(e,!1,{stream:t,changedProperty:n,oldValue:r,newValue:i})},r.VideoDimensionsChangedEvent=function(e,t,n){return new s("videoDimensionsChanged",!1,{target:e,oldValue:t,newValue:n})},r.ArchiveEvent=function(e,t){return new s(e,!1,{id:t.id,name:t.name,status:t.status,archive:t})},r.ArchiveUpdatedEvent=function(e,t,n,r){return new s("updated",!1,{target:e,changedProperty:t,oldValue:n,newValue:r})},r.SignalEvent=function(e,t,n){return new s(e?"signal:"+e:a.SIGNAL,!1,{data:t,from:n})},r.StreamUpdatedEvent=function(e,t,n,r){return new s("updated",!1,{target:e,changedProperty:t,oldValue:n,newValue:r})},r.DestroyedEvent=function(e,t,n){return new s(e,!1,{target:t,reason:n})},r.ConnectionStateChangedEvent=function(e,t){return new s(e,!1,{target:t})},r.VideoEnabledChangedEvent=function(e,t){return new s(e,!1,{reason:t.reason})},r.VideoDisableWarningEvent=function(e){return new s(e,!1)},r.AudioLevelUpdatedEvent=function(e){return new s(a.AUDIO_LEVEL_UPDATED,!1,{audioLevel:e})},r.MediaStoppedEvent=function(e,t){return new s(a.MEDIA_STOPPED,!0,{target:e,track:t})},r.MuteForcedEvent=function(e){return new s(a.MUTE_FORCED,!1,e)},r.VideoElementCreatedEvent=function(e){return new s(a.VIDEO_ELEMENT_CREATED,!1,{element:e})},r}},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(7)),o=r(n(8));e.exports=function(e){void 0===e&&(e={});const r=e.getNativeEnumerateDevices||n(288)(),s=e.getNativeMediaDevices||n(639)(),a=(e.currentAudioOutputDevice||n(106)).getCurrentAudioOutputDeviceId,c=e.env||n(3),u=e.global||(void 0!==typeof window?window:global),d={},l={audio:"audioInput",video:"videoInput",audioinput:"audioInput",videoinput:"videoInput",audiooutput:"audioOutput",audioInput:"audioInput",videoInput:"videoInput",audioOutput:"audioOutput"};return d.getNativeMediaDevices=()=>s(),d.hasEnumerateDevicesCapability=()=>"function"==typeof r(),d.hasDeviceChangeCapability=()=>{const e=s();return!(!e||!("ondevicechange"in e))},d.hasSetSinkIdCapability=()=>"setSinkId"in(null==u?void 0:u.HTMLMediaElement.prototype),d.hasAudioOutputApiSupport=()=>d.hasSetSinkIdCapability()&&d.hasDeviceChangeCapability(),d.hasEnumerateDevicesBug=()=>c.isSafari&&13.1===c.version,d.getMediaDevices=()=>d.hasEnumerateDevicesCapability()?r()().then(e=>e.map(e=>({deviceId:e.deviceId||e.id,label:e.label,kind:l[e.kind]}))):t.reject(new Error("This browser does not support enumerateDevices APIs")),d.getInputMediaDevices=()=>d.getMediaDevices().then(e=>e.filter(e=>/^(audio|video)Input$/.test(e.kind))),d.getAudioOutputMediaDevices=()=>d.getMediaDevices().then(e=>e.filter(e=>"audioOutput"===e.kind).map(e=>({deviceId:e.deviceId,label:e.label}))),d.shouldAskForDevices=()=>d.hasEnumerateDevicesCapability()?d.getInputMediaDevices().then(e=>{if(0===e.length)return{video:!0,audio:!0};const t=e.filter(e=>"audioInput"===e.kind),n=e.filter(e=>"videoInput"===e.kind);return d.hasEnumerateDevicesBug()&&0===n.length?{audio:!0,video:!0}:{video:n.length>0,audio:t.length>0,videoDevices:n,audioDevices:t}}).catch(()=>({video:!0,audio:!0})):t.resolve({video:!0,audio:!0}),d.getDefaultAudioOutputDeviceId=e=>{if(!Array.isArray(e)||0===e.length)return"";return(e.find(e=>"default"===e.deviceId)||e[0]).deviceId},d.hasDevice=(e,t)=>{let n=e;return Array.isArray(n)||(n=[]),n.some(e=>e.deviceId===t)},d.getActiveAudioOutputDevice=(0,o.default)(i.default.mark((function e(){var t,n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.getAudioOutputMediaDevices();case 3:t=e.sent,e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(0),e.t0;case 9:if(0!==t.length){e.next=11;break}return e.abrupt("return",{deviceId:null,label:null});case 11:return(n=t.find(e=>e.deviceId===a()))||(r=d.getDefaultAudioOutputDeviceId(t),n=t.find(e=>e.deviceId===r)),e.abrupt("return",n);case 14:case"end":return e.stop()}}),e,null,[[0,6]])}))),d}}).call(this,n(0))},function(e,t,n){var r=n(15),i=n(113);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){"use strict";var r=n(2),i=r(n(20)),o=r(n(7)),s=r(n(8)),a=r(n(46)),c=r(n(18));const u=n(244),d=n(534),l=n(100),p=n(34)(),f=n(6),h=n(549),m=n(552);let g=function(){function e(e){let t=void 0===e?{}:e,n=t.staticConfig,r=void 0===n?p.onlyLocal():n,i=t.sessionInfo,o=void 0===i?new l:i,s=t.ajax,a=t.queue,u=t.getUserAgentClientHintData,d=void 0===u?m:u,f=t.userAgentData,h=void 0===f?"undefined"!=typeof navigator&&navigator.userAgentData:f;(0,c.default)(this,"getTurnServerName",e=>{let t,n;if(!e||"object"!=typeof e)return t;return(Array.isArray(e)?e:[e]).forEach(e=>{const r=e.urls||e.url;(Array.isArray(r)?r:[r]).forEach(e=>{const r=e.indexOf(":")+1,i=e.lastIndexOf(":");e.includes("turns")?n=e.substring(r,i):t=e.substring(r,i)})}),n||t}),this.ajax=s,this.queue=a,this.sessionInfo=o,this.getUserAgentClientHintData=d,this.userAgentData=h,this.staticConfig=r}var t=e.prototype;return t._getCachedUserAgentData=function(){var e=(0,s.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.cachedUserAgentData){e.next=4;break}return e.next=3,this.getUserAgentClientHintData(this.userAgentData);case 3:this.cachedUserAgentData=e.sent;case 4:return e.abrupt("return",this.cachedUserAgentData);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.commonQoSFields=function(){return{clientVersion:this.staticConfig.clientVersion,buildHash:this.staticConfig.buildHash,source:(void 0!==typeof window?window:global).location&&(void 0!==typeof window?window:global).location.href,logVersion:"2",apiServer:this.staticConfig.apiUrl,clientSystemTime:(new Date).getTime(),sessionId:this.sessionInfo.sessionId,mediaServerName:this.sessionInfo.mediaServerName,relayServer:this.getTurnServerName(this.sessionInfo.iceServers),p2p:this.sessionInfo.p2pEnabled,messagingServer:this.sessionInfo.messagingServer,messagingUrl:this.sessionInfo.messagingURL,version:this.staticConfig.version,partnerId:this.sessionInfo.partnerId}},t._getCommonDataFields=function(){var e=(0,s.default)(o.default.mark((function e(){var t,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.getAsync();case 2:return t=e.sent,e.next=5,this._getCachedUserAgentData();case 5:return n=e.sent,e.abrupt("return",(0,i.default)({guid:t},this.commonQoSFields(),n));case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),t.logError=function(t,n,r,o,s){void 0===s&&(s={}),this._getCommonDataFields().then(a=>{const c=[t,n,r,o,(0,i.default)({},a,s)];e.emit("logError",...c),this._analytics.logError(...c)})},t.logEvent=function(t,n,r){void 0===t&&(t={}),this._getCommonDataFields().then(o=>{const s=(0,i.default)({},o,t);e.emit("logEvent",s),this._analytics.logEvent(s,!1,n,r)})},t.logQOS=function(t){void 0===t&&(t={}),this._getCommonDataFields().then(n=>{const r=(0,i.default)({duration:0},n,t);h(r),e.emit("logQOS",r),this._analytics.logQOS(r)})},(0,a.default)(e,[{key:"staticConfig",get:function(){return this._staticConfig},set:function(e){this._staticConfig=e,this._analytics=new d({loggingUrl:this.staticConfig.loggingUrl,ajax:this.ajax,queue:this.queue})}}]),e}();f(g),e.exports=g},function(e,t,n){"use strict";e.exports={ACTIVE:"active",INACTIVE:"inactive",UNKNOWN:"unknown",PER_SESSION:"perSession",PER_STREAM:"perStream",EXCEPTION:"exception",ISSUE_REPORTED:"issueReported",SESSION_CONNECTED:"sessionConnected",SESSION_RECONNECTING:"sessionReconnecting",SESSION_RECONNECTED:"sessionReconnected",SESSION_DISCONNECTED:"sessionDisconnected",STREAM_CREATED:"streamCreated",STREAM_DESTROYED:"streamDestroyed",CONNECTION_CREATED:"connectionCreated",CONNECTION_DESTROYED:"connectionDestroyed",SIGNAL:"signal",STREAM_PROPERTY_CHANGED:"streamPropertyChanged",MICROPHONE_LEVEL_CHANGED:"microphoneLevelChanged",RESIZE:"resize",SETTINGS_BUTTON_CLICK:"settingsButtonClick",DEVICE_INACTIVE:"deviceInactive",INVALID_DEVICE_NAME:"invalidDeviceName",ACCESS_ALLOWED:"accessAllowed",ACCESS_DENIED:"accessDenied",ACCESS_DIALOG_OPENED:"accessDialogOpened",ACCESS_DIALOG_CLOSED:"accessDialogClosed",ECHO_CANCELLATION_MODE_CHANGED:"echoCancellationModeChanged",MEDIA_STOPPED:"mediaStopped",PUBLISHER_DESTROYED:"destroyed",MUTE_FORCED:"muteForced",SUBSCRIBER_DESTROYED:"destroyed",SUBSCRIBER_CONNECTED:"connected",SUBSCRIBER_DISCONNECTED:"disconnected",DEVICES_DETECTED:"devicesDetected",DEVICES_SELECTED:"devicesSelected",CLOSE_BUTTON_CLICK:"closeButtonClick",MICLEVEL:"microphoneActivityLevel",MICGAINCHANGED:"microphoneGainChanged",ENV_LOADED:"envLoaded",ENV_UNLOADED:"envUnloaded",AUDIO_LEVEL_UPDATED:"audioLevelUpdated",VIDEO_ELEMENT_CREATED:"videoElementCreated"}},function(e,t,n){"use strict";var r=!0,i=!0;function o(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}e.exports={extractVersion:o,wrapPeerConnectionEvent:function(e,t,n){if(e.RTCPeerConnection){var r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);var o=function(e){var t=n(e);t&&r(t)};return this._eventMap=this._eventMap||{},this._eventMap[r]=o,i.apply(this,[e,o])};var o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[n])return o.apply(this,arguments);var r=this._eventMap[n];return delete this._eventMap[n],o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}},disableLog:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(r=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},disableWarnings:function(e){return"boolean"!=typeof e?new Error("Argument type: "+typeof e+". Please use a boolean."):(i=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},log:function(){if("object"==typeof window){if(r)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},deprecated:function(e,t){i&&console.warn(e+" is deprecated, please use "+t+" instead.")},detectBrowser:function(e){var t=e&&e.navigator,n={browser:null,version:null};if(void 0===e||!e.navigator)return n.browser="Not a browser.",n;if(t.mozGetUserMedia)n.browser="firefox",n.version=o(t.userAgent,/Firefox\/(\d+)\./,1);else if(t.webkitGetUserMedia)n.browser="chrome",n.version=o(t.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.mediaDevices&&t.userAgent.match(/Edge\/(\d+).(\d+)$/))n.browser="edge",n.version=o(t.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!t.userAgent.match(/AppleWebKit\/(\d+)\./))return n.browser="Not a supported browser.",n;n.browser="safari",n.version=o(t.userAgent,/AppleWebKit\/(\d+)\./,1)}return n}}},function(e,t,n){var r=n(39),i=n(357),o=n(358),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},function(e,t,n){var r=n(181),i=n(115),o=n(25);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){"use strict";var r=n(44);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var r=n(56),i=n(202),o=n(126),s=n(203),a=n(204);(e.exports=function(e,t){var n,i,c,u,d;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],r(e)?(n=a.call(e,"c"),i=a.call(e,"e"),c=a.call(e,"w")):(n=c=!0,i=!1),d={value:t,configurable:n,enumerable:i,writable:c},u?o(s(u),d):d}).gs=function(e,t,n){var c,u,d,l;return"string"!=typeof e?(d=n,n=t,t=e,e=null):d=arguments[3],r(t)?i(t)?r(n)?i(n)||(d=n,n=void 0):n=void 0:(d=t,t=n=void 0):t=void 0,r(e)?(c=a.call(e,"c"),u=a.call(e,"e")):(c=!0,u=!1),l={get:t,set:n,configurable:c,enumerable:u},d?o(s(d),l):l}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(20)),o=r(n(46));const s=n(210),a=n(57),c=n(475),u=n(522),d=n(1)("StaticConfig"),l=n(139).prependProxyToUrlIfNeeded,p=a({version:"v2.22.3",buildHash:"32f87e772",minimumVersion:{firefox:52,chrome:49},debug:"false",websiteURL:"http://www.tokbox.com",configURL:"https://config.opentok.com",ipWhitelistConfigURL:"",cdnURL:"https://static.opentok.com",loggingURL:"https://hlg.tokbox.com/prod",apiURL:"https://anvil.opentok.com"}),f=c(["apiURL","assetURL","cdnURL","sessionInfoOverrides","loggingURL"]),h={apiUrl:"apiURL",loggingUrl:"loggingURL"},m=u(e=>h[e]);e.exports=function(e){let n=(void 0===e?{}:e).axios,r=void 0===n?s:n;return function(){function e(e){Object.defineProperty(this,"config",{value:Object.freeze(a(e))})}return e.onlyLocal=function(){const t=a((void 0!==typeof window?window:global).OTProperties);return new e((0,i.default)({},p,f(t)))},e.get=function(n){let o=n.partnerId,s=n.token,c=n.useIpWhitelistConfigUrl,u=n.proxyUrl;return(()=>{const e=this.onlyLocal();if(!e.configUrl)return t.resolve({});if(!0===c&&!e.ipWhitelistConfigUrl)return t.resolve({});let n=!0===c?e.ipWhitelistConfigUrl:e.configUrl;return n=l(n,u),r.get(`${n}/project/${o}/config.json`,{headers:{"X-TB-TOKEN-AUTH":s}}).then(e=>e.data)})().catch(e=>(d.error("could not reach live config service",e),{})).then(t=>{const n=a((void 0!==typeof window?window:global).OTProperties);return new e((0,i.default)({},p,f(n),m(t)))})},(0,o.default)(e,[{key:"configUrl",get:function(){return this.config.configURL}},{key:"ipWhitelistConfigUrl",get:function(){return this.config.ipWhitelistConfigURL}},{key:"apiUrl",get:function(){return this.config.apiURL}},{key:"loggingUrl",get:function(){return this.config.loggingURL}},{key:"apiEnabled",get:function(){return void 0===this.config.apiEnabled||this.config.apiEnabled}},{key:"version",get:function(){return this.config.version}},{key:"clientVersion",get:function(){return"js-"+(this.version||"unknown").replace("v","")}},{key:"buildHash",get:function(){return this.config.buildHash}},{key:"minimumVersion",get:function(){return this.config.minimumVersion}},{key:"websiteUrl",get:function(){return this.config.websiteURL}},{key:"debug",get:function(){return"true"===this.config.debug||!0===this.config.debug}},{key:"sessionInfoOverrides",get:function(){return this.config.sessionInfoOverrides}},{key:"cdnUrl",get:function(){return this.config.cdnURL||`${(void 0!==typeof window?window:global).location.protocol}//${(void 0!==typeof window?window:global).location.host}`}},{key:"assetUrl",get:function(){return this.config.assetURL||`${this.cdnUrl}/webrtc/${this.version}`}}]),e}()}}).call(this,n(0))},function(e,t,n){var r=n(501),i=n(507),o=n(88),s=n(12),a=n(512);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?s(e)?i(e[0],e[1]):r(e):a(e)}},function(e,t,n){"use strict";const r=n(5);e.exports=function(e,t){let n;const i=t||{};e.setDisplayMode=function(e){const t=e||"auto";n!==t&&(r.removeClass(this.domElement,"OT_mode-"+n),r.addClass(this.domElement,"OT_mode-"+t),n=t)},e.getDisplayMode=function(){return n},e.showAfterLoading=function(){r.removeClass(this.domElement,"OT_hide-forced")},e.hideWhileLoading=function(){r.addClass(this.domElement,"OT_hide-forced")},e.destroy=function(){return i.onDestroy&&i.onDestroy(this.domElement),this.domElement&&r.removeElement(this.domElement),e},e.appendTo=function(t){return this.domElement=r.createElement(i.nodeName||"div",i.htmlAttributes,i.htmlContent),i.onCreate&&i.onCreate(this.domElement),e.setDisplayMode(i.mode),"auto"===i.mode&&(r.addClass(e.domElement,"OT_mode-on-hold"),setTimeout(()=>{r.removeClass(e.domElement,"OT_mode-on-hold")},2e3)),t.appendChild(this.domElement),e}}},function(e,t,n){var r=n(77);e.exports=function(e){return r(e,4)}},function(e,t,n){var r=n(356),i=n(361);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(14).Symbol;e.exports=r},function(e,t,n){var r=n(83),i=n(64);e.exports=function(e,t,n,o){var s=!n;n||(n={});for(var a=-1,c=t.length;++a<c;){var u=t[a],d=o?o(n[u],e[u],u,n,e):void 0;void 0===d&&(d=e[u]),s?i(n,u,d):r(n,u,d)}return n}},function(e,t,n){var r=n(385),i=n(110),o=n(386),s=n(189),a=n(190),c=n(29),u=n(178),d=u(r),l=u(i),p=u(o),f=u(s),h=u(a),m=c;(r&&"[object DataView]"!=m(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=m(new i)||o&&"[object Promise]"!=m(o.resolve())||s&&"[object Set]"!=m(new s)||a&&"[object WeakMap]"!=m(new a))&&(m=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case d:return"[object DataView]";case l:return"[object Map]";case p:return"[object Promise]";case f:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=m},function(e,t,n){"use strict";(function(t){var n,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,n){return new t((function(t,r){function i(){void 0!==o&&e.removeListener("error",o),t([].slice.call(arguments))}var o;"error"!==n&&(o=function(t){e.removeListener(n,i),r(t)},e.once("error",o)),e.once(n,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,o,s,a;if(c(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=s.length,a=d,console&&console.warn&&console.warn(a)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):m(i,i.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var u=c.length,d=m(c,u);for(n=0;n<u;++n)i(d[n],this,t)}return!0},s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,o,s;if(c(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}).call(this,n(0))},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var c,u=[],d=!1,l=-1;function p(){d&&c&&(d=!1,c.length?u=c.concat(u):l=-1,u.length&&f())}function f(){if(!d){var e=a(p);d=!0;for(var t=u.length;t;){for(c=u,u=[];++l<t;)c&&c[l].run();l=-1,t=u.length}c=null,d=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new h(e,t)),1!==u.length||d||a(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";var r=n(404)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";e.exports=n(418)()?n(91).Symbol:n(421)},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(71);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,n){var r=n(519),i=n(138)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},function(e,t,n){"use strict";const r=(void 0!==typeof window?window:global).performance||{};e.exports=function(){return r.now?r.timing.navigationStart+r.now():Date.now()}},function(e,t,n){var r=n(584);e.exports=function(e){return r(2,e)}},function(e,t,n){"use strict";const r=n(50),i=n(34)();t.check=function(e){void 0===e&&(e={});const t=e.env||n(3),r=e.hasGetUserMediaCapability||n(593),o=e.hasPeerConnectionCapability||n(594),s=e.logging||n(1)("hasOpenTokSupport"),a=((e.staticConfig||i.onlyLocal()).minimumVersion||{})[t.name.toLowerCase()];return a&&a>t.version?(s.debug("Support for",t.name,"is disabled because we require",a,"but this is",t.version),!1):"Node"===t.name||r()&&o()},t.once=r(()=>t.check())},function(e,t,n){"use strict";const r=n(9),i=n(62),o=n(274),s=n(128),a=n(275),c=n(1)("SDPHelpers"),u={getSections:e=>e.split(/\r\n|\r|\n/).reduce((e,t)=>{const n=t.match(/^m=(\w+) \d+/);return n&&(e.sections[e.section=n[1]]=[]),e.sections[e.section].push(t),e},{sections:{header:[]},section:"header"}).sections,getCodecsAndCodecMap(e,t){const n=u.getSections(e)[t];if(!n)throw new Error("no mediaType "+t);return{codecs:n[0].match(/m=\w+ \d+ [A-Z/]+ ([\d ]+)$/)[1].split(" "),codecMap:r(...n.filter(e=>e.match(/^a=rtpmap:\d+/)).map(e=>e.match(/^a=rtpmap:(\d+) ([\w-]+)/).splice(1)).map(e=>({[e[0]]:e[1]})))}},getCodecs(e,t){const n=u.getCodecsAndCodecMap(e,t);return n.codecs.map(e=>n.codecMap[e]||"Unknown codec")},mediaDirections:{INACTIVE:"inactive",RECVONLY:"recvonly"}};e.exports=u,u.getMLineIndex=function(e,t){const n="m="+t;return o(e,e=>-1!==e.indexOf(n))},u.getMLine=function(e,t){const n=u.getMLineIndex(e,t);return n>-1?e[n]:void 0},u.hasMediaType=(e,t)=>{const n=new RegExp("^m="+t),r=e.split("\r\n");return o(r,e=>n.test(e))>=0},u.hasMLinePayloadType=function(e,t,n){const r=u.getMLine(e,t);return u.getMLinePayloadTypes(r,t).indexOf(n)>-1},u.getMLinePayloadTypes=function(e,t){const n=new RegExp(`^m=${t} \\d+(/\\d+)? [a-zA-Z0-9/]+(( [a-zA-Z0-9/]+)+)$`,"i"),r=e.match(n);return!r||r.length<2?[]:r[2].trim().split(" ")},u.splitSections=function(e){return e.split("\nm=").map((e,t)=>(t>0?"m="+e:e).trim()+"\r\n")},u.changeMediaDirection=function(e,t){const n=u.splitSections(e);return n.shift()+(e=>{const n=t===u.mediaDirections.RECVONLY?"a=inactive":"a=recvonly",r=new RegExp(n,"g");return e.replace(r,"a="+t)})(n.join(""))},u.removeTypesFromMLine=function(e,t){const n=/[0-9 ]*$/.exec(e)[0],r=n.split(" ").filter(e=>""!==e&&-1===t.indexOf(e));return e.replace(n," "+r.join(" "))},u.removeMediaEncoding=function(e,t,n){let r,i,o,s,a=e.split("\r\n");const c=u.getMLineIndex(a,t),d=c>-1?a[c]:void 0,l=[];if(-1===c)return a.join("\r\n");if(r=u.getMLinePayloadTypes(d,t),0===r.length)return a.join("\r\n");for(i=c;i<a.length;i++){const e=new RegExp(n,"i");0===a[i].indexOf("a=rtpmap:")&&(s=a[i].split(" "),2===s.length&&e.test(s[1])&&l.push(s[0].substr(9)))}if(!l.length)return a.join("\r\n");for(i=c;i<a.length;i++)if(0===a[i].indexOf("a=fmtp:"))for(s=a[i].split(" "),o=0;o<l.length;o++)2===s.length&&s[1]==="apt="+l[o]&&l.push(s[0].substr(7));return a=a.filter(e=>{for(let t=0;t<l.length;t++)if(0===e.indexOf(`a=rtpmap:${l[t]} `)||0===e.indexOf(`a=fmtp:${l[t]} `)||0===e.indexOf(`a=rtcp-fb:${l[t]} `))return!1;return!0}),l.length>0&&c>-1&&(a[c]=u.removeTypesFromMLine(d,l)),a.join("\r\n")},u.disableMediaType=function(e,t){const n=e.split("\r\n"),r=[];let i;n.forEach(e=>{let t=e;/^m=/.test(t)&&(i=void 0),i||(i=[],r.push(i)),i.push(t)});const o=new RegExp(`^m=${t} \\d+ ([^ ]+) [0-9 ]+$`),s=r.map(e=>{const n=e[0].match(o);return n?[`m=${t} 0 ${n[1]} 0`,"a=inactive",...e.filter(e=>/^c=/.test(e)||/^a=mid:/.test(e)||""===e)]:e});return[].concat(...s).join("\r\n")},u.removeVideoCodec=function(e,t){return u.removeMediaEncoding(e,"video",t)};const d=function(e,t){let n=t.filterByName("ssrc-group:FID");switch(n=0===n.length?[]:n[0].value.split(" "),n.length){case 0:case 1:var r=t.find(e=>0===e.name.indexOf("rtpmap:")&&e.value.indexOf("rtx/90000")>-1);if(!r)return!1;var i=r.name.split(":")[1];return i.indexOf("/")>-1&&(i=i.split("/")[0]),u.hasMLinePayloadType(e,"video",i);default:return c.debug("SDP Helpers: There are more than two FIDs, RTX is definitely enabled"),!0}};u.getAttributesForMediaType=function(e,t){let n,r,o,s,a,c,l,p,f,h;const m=u.getMLineIndex(e,t),g=new RegExp(`m=(?!${t}).+ `,"i"),b=new RegExp("a=ssrc:\\d+ .*","i"),v=new RegExp("a=ssrc-group:(SIM|FID) (\\d+).*?","i"),y=new RegExp("a=([a-z0-9:/-]+) (.*)","i"),E=[];for(let t=m+1;t<e.length;t++){if(g.test(e[t])){void 0!==n&&(r=t-1);break}a=e[t].match(v),c=e[t].match(b),void 0===n&&(a||c)&&(n=t,a&&(s=/^(FID|SIM)$/.test(a[1])?a[2]:a[1])),l=e[t].match(`a=ssrc:${s} msid:(.+)`),l&&(p=l[1]);const i=b.test(e[t]),u=v.test(e[t]);void 0!==n&&(void 0!==r||i||u?t===e.length-1&&(r=t):r=t-1);const d=e[t].match(/a=mid:(.+)/);d&&(f=d[1],h=t),o=y.exec(e[t]),o&&3===o.length&&E.push({lineIndex:t,name:o[1],value:o[2]})}return E.ssrcStartIndex=n,E.ssrcEndIndex=r,E.msid=p,E.mid=f,E.midIndex=h,E.isUsingRTX=d.bind(null,e,E),E.filterByName=function(e){return this.filter(t=>t.name===e)},E.getRtpNumber=e=>{const t=new RegExp("rtpmap:(.+)");return i(E.map(n=>{const r=n.name.match(t);return r&&n.value.indexOf(e)>=0?r[1]:null}),e=>null!==e)},E},u.modifyDtx=(e,t)=>{const n=e.split("\r\n");if(!u.getMLine(n,"audio"))return c.debug("No audio m-line, not enabling dtx."),e;const r=u.getAttributesForMediaType(n,"audio"),i=r.getRtpNumber("opus");if(!i)return c.debug("Could not find rtp number for opus, not enabling dtx."),e;const o=r.find(e=>e.name==="fmtp:"+i);if(!o)return c.debug("Could not find a=fmtp line for opus, not enabling dtx."),e;let s=n[o.lineIndex];const a=/usedtx=\d+([\s;]*)/;return a.test(o.value)?s=s.replace(a,t?"usedtx=1$1":""):t&&(s+="; usedtx=1"),s=s.replace(/[;\s]*$/,""),n[o.lineIndex]=s,n.join("\r\n")};const l=(e,t,n)=>{const r=t.split("\r\n");if(!u.getMLine(r,"audio"))return c.debug("No audio m-line, not enabling stereo."),t;const i=u.getAttributesForMediaType(r,"audio"),o=i.getRtpNumber("opus");if(!o)return c.debug("Could not find rtp number for opus, not enabling stereo."),t;const s=i.find(e=>e.name==="fmtp:"+o);if(!s)return c.debug("Could not find a=fmtp line for opus, not enabling stereo."),t;let a,d=r[s.lineIndex];switch(e){case"send":a=/sprop-stereo=\d+([\s;]*)/,a.test(s.value)?d=d.replace(a,n?"sprop-stereo=1$1":""):n&&(d+="; sprop-stereo=1");break;case"receive":a=/([^-])stereo=\d+([\s;]*)/,a.test(s.value)?d=d.replace(a,n?"$1stereo=1$2":"$1"):n&&(d+="; stereo=1");break;default:throw new Error(`Invalid type ${e} passed into enableStereo`)}return d=d.replace(/[;\s]*$/,""),r[s.lineIndex]=d,r.join("\r\n")};u.modifySendStereo=l.bind(null,"send"),u.modifyReceiveStereo=l.bind(null,"receive"),u.setAudioBitrate=(e,t)=>{const n=u.getAudioBitrate(e);if(void 0!==n)return c.debug(`Audio bitrate already set to ${n}, not setting audio bitrate`),e;const r=e.split("\r\n");if(!u.getMLine(r,"audio"))return c.debug("No audio m-line, not setting audio bitrate"),e;const i=u.getAttributesForMediaType(r,"audio"),o=i.getRtpNumber("opus");if(!o)return c.debug("Could not find rtp number for opus, not setting audio bitrate."),e;const s=i.find(e=>e.name==="fmtp:"+o);if(!s)return c.debug("Could not find a=fmtp line for opus, not setting audio bitrate."),e;let a=r[s.lineIndex];return a+="; maxaveragebitrate="+t,a=a.replace(/[;\s]*$/,""),r[s.lineIndex]=a,r.join("\r\n")},u.hasSendStereo=e=>/[\s;]sprop-stereo=1/.test(e),u.hasSendDtx=e=>/[\s;]usedtx=1/.test(e),u.getAudioBitrate=e=>{const t=e.match(/[\s;]maxaveragebitrate=(\d+)/);if(t)return Number(t[1])},u.MAX_SSRCS=10,u.getSSRCGroupType=e=>["SIM","FID"].find(t=>e.filterByName("ssrc-group:"+t)[0]),u.getSSRCGroup=e=>{const t=u.getSSRCGroupType(e);return e.filterByName("ssrc-group:"+t)[0]},u.getSSRCGroupSSRCs=e=>{const t=u.getSSRCGroup(e);return t?t.value.split(" ").slice(0,u.MAX_SSRCS):[]},u.getAllowedSSRCs=(e,t)=>{const n=t.slice();return e.filterByName("ssrc-group:FID").forEach(e=>{const t=e.value.split(" ");s(n,t).length&&Array.prototype.push.apply(n,t)}),a(n)},u.filterExcessSSRCs=e=>{const t=e.split("\r\n"),n=u.getAttributesForMediaType(t,"video"),r=u.getSSRCGroupType(n),i=n.ssrcStartIndex;if(void 0===i)return e;let o;const s=e=>{let t=null;return e.match(/^a=ssrc:(\d+)/)&&(t=RegExp.$1),t};if(r){const e=u.getSSRCGroupSSRCs(n),i=["a=ssrc-group:"+r,...e].join(" ");t[n.find(e=>e.name.startsWith("ssrc-group:")).lineIndex]=i,o=u.getAllowedSSRCs(n,e)}else{o=[];n.ssrcStartIndex&&o.push(s(t[n.ssrcStartIndex]))}return t.filter((e,t)=>{if(t<i||t>n.ssrcEndIndex)return!0;if(t===i){if(!r){const t=s(e);return t?o.includes(t):!/^a=ssrc:(\d+)/.test(e)}return!0}const a=s(e);if(a)return o.includes(a);if(e.match(/^a=ssrc-group:FID (\d+)/)){const e=RegExp.$1;return o.includes(e)}return!e.match(/^a=ssrc-group:SIM /)}).join("\r\n")},u.enableSimulcast=function(e,t){let n,r;const i=e.split("\r\n");if(!u.getMLine(i,"video"))return c.debug("No video m-line, not enabling simulcast."),e;const o=u.getAttributesForMediaType(i,"video");if(o.filterByName("ssrc-group:SIM").length>0)return c.debug("Simulcast is already enabled in this SDP, not attempting to enable again."),u.filterExcessSSRCs(e);if(!o.msid)return c.debug("No local stream attached, not enabling simulcast."),e;const s=o.isUsingRTX(),a=[],d=[];for(r=0;r<t;++r)a.push(1e4+r),s&&d.push(2e4+r);if(n=["a=ssrc-group:SIM "+a.join(" ")],s)for(r=0;r<t;++r)n.push(`a=ssrc-group:FID ${a[r]} ${d[r]}`);for(r=0;r<t;++r)n.push(`a=ssrc:${a[r]} cname:localCname`,`a=ssrc:${a[r]} msid:${o.msid}`);if(s)for(r=0;r<t;++r)n.push(`a=ssrc:${d[r]} cname:localCname`,`a=ssrc:${d[r]} msid:${o.msid}`);return n.unshift(o.ssrcStartIndex,o.ssrcEndIndex-o.ssrcStartIndex+1),i.splice(...n),i.join("\r\n")},u.reprioritizeVideoCodec=function(e,t,n){const r=e.split("\r\n"),i=u.getMLineIndex(r,"video");if(-1===i)return e;const o=u.getMLinePayloadTypes(r[i],"video"),s=new RegExp("^a=rtpmap:(\\d+).* "+t,"i"),a=r.map(e=>e.match(s)).filter(e=>null!==e);if(0===a.length)return e;const d=a.map(e=>e[1]);let l=o.filter(e=>-1===d.indexOf(e));"top"===n?l.unshift(...d):"bottom"===n?l.push(...d):(c.error(`Unexpected location param: ${n}; not changing ${t} priority`),l=o);const p=r[i].replace(o.join(" "),l.join(" "));return r[i]=p,r.join("\r\n")}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(181),i=n(380),o=n(25);e.exports=function(e){return o(e)?r(e,!0):i(e)}},function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},function(e,t,n){"use strict";e.exports=function(e){return null!=e}},function(e,t,n){var r=n(77);e.exports=function(e){return r(e,5)}},function(e,t,n){var r=n(98);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t,n){var r=n(12),i=n(137),o=n(239),s=n(60);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(s(e))}},function(e,t,n){var r=n(509);e.exports=function(e){return null==e?"":r(e)}},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t,n){var r=n(608)(n(274));e.exports=r},function(e,t,n){"use strict";e.exports=function(e){const t=[];return{on(n,r){for(var i=arguments.length,o=new Array(i>2?i-2:0),s=2;s<i;s++)o[s-2]=arguments[s];if(t.push({eventName:n,handler:r,args:o}),e.on)e.on(n,r);else{if(!e.addEventListener)throw new Error("Object does not support events",e);e.addEventListener(n,r,...o)}},off(t,n){if(e.off)e.off(t,n);else{if(!e.removeEventListener)throw new Error("Object does not support events",e);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];e.removeEventListener(t,n,...i)}},once(n,r){for(var i=arguments.length,o=new Array(i>2?i-2:0),s=2;s<i;s++)o[s-2]=arguments[s];t.push({eventName:n,handler:r,args:o}),e.once(n,r)},removeAll(){t.forEach(e=>{let t=e.eventName,n=e.handler,r=e.args;this.off(t,n,...r)}),t.splice(0,t.length)}}}},function(e,t,n){var r=n(179);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(375),i=n(16),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=c},function(e,t,n){(function(e){var r=n(14),i=n(376),o=t&&!t.nodeType&&t,s=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=s&&s.exports===o?r.Buffer:void 0,c=(a?a.isBuffer:void 0)||i;e.exports=c}).call(this,n(84)(e))},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e,t,n){var r=n(29),i=n(16);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},function(e,t,n){"use strict";if("Node"===n(5).env.name)e.exports={value:""};else{var r,i;const t=null==(r=Array.prototype.slice.call(document.getElementsByTagName("script")))||null==(i=r.pop())?void 0:i.getAttribute("src"),n=(t&&t.match(/[?&]apikey=([^&]+)/i)||[])[1];e.exports={value:n||""}}},function(e,t,n){"use strict";const r=n(3);e.exports=()=>!((r.isChrome||r.isElectron)&&r.version>=90||r.isOpera&&r.version>=76)&&(r.isChrome&&r.version>71||r.isChromiumEdge&&r.version<90||r.isOpera&&r.version>58)},function(e,t,n){"use strict";e.exports=function(e,t,n){void 0===n&&(n=1/0);let r=null,i=!1,o=1;const s=1e3/t,a=()=>{!i||o>n||(o+=1,e(),r=setTimeout(a,s))};this.start=()=>{i||(i=!0,setTimeout(a,s))},this.stop=()=>{(void 0!==typeof window?window:global).clearTimeout(r),i=!1}}},function(e,t,n){"use strict";const r=n(48),i=n(655),o=n(11),s=n(161),a={};function c(e){return Number(e.framerateMean||e.googFrameRateSent||e.googFrameRateReceived||e.googFrameRateInput||e.googFrameRateOutput||0)}function u(e){return Number(e.framesEncoded||e.framesDecoded)}function d(e,t){if(c(e))return c(e);if(!u(e))return;let n=0;const r=a[e.id]?a[e.id].frames:0,i=a[e.id]?a[e.id].timestamp:t;return n=s({currentStatFrames:u(e),currentTimestamp:e.timestamp,prevStatFrames:r,prevTimestamp:i}),a[e.id]={frames:u(e),timestamp:e.timestamp},n}function l(e,t){if(!t)return{};const n=t.filter(t=>t.id===e.mediaTrackId);return n.length?n[0]:{}}function p(e,t){return"packetsLost"in t?e+t.packetsLost:e}const f={isVideoStat(e,t){const n=l(e,t);return"video"===e.kind&&["outbound-rtp","inbound-rtp"].includes(e.type)||"video"===e.mediaType||"googFrameWidthReceived"in e||"googFrameWidthInput"in e||"inbound-rtp"===e.type&&-1!==e.id.indexOf("Video")||"inboundrtp"===e.type&&0!==n.frameWidth},isAudioStat(e,t){const n=l(e,t);return"audio"===e.kind&&["outbound-rtp","inbound-rtp"].includes(e.type)||"audio"===e.mediaType||"audioInputLevel"in e||"audioOutputLevel"in e||"inbound-rtp"===e.type&&-1!==e.id.indexOf("Audio")||"inboundrtp"===e.type&&0===n.frameWidth},isInboundStat:e=>"bytesReceived"in e||"packetsReceived"in e,isOutboundStat:e=>"bytesSent"in e||"packetsSent"in e,isVideoTrackStat:e=>"track"===e.type&&(e.frameHeight>0||e.frameWidth>0||e.framesCorrupted>0||e.framesDecoded>0||e.framesPerSecond>0||e.framesSent>0||e.framesReceived>0),isVideoRemoteInboundRtpStat:e=>"remote-inbound-rtp"===e.type&&"video"===e.kind,isAudioRemoteInboundRtpStat:e=>"remote-inbound-rtp"===e.type&&"audio"===e.kind,isVideoInboundRtpStat:e=>"inbound-rtp"===e.type&&"video"===e.kind,parseStatCategory(e){const t={packetsLost:0,packetsReceived:0,bytesReceived:0};return"packetsReceived"in e&&(t.packetsReceived=parseInt(e.packetsReceived,10)),"packetsLost"in e&&(t.packetsLost=parseInt(e.packetsLost,10)),"bytesReceived"in e&&(t.bytesReceived=parseInt(e.bytesReceived,10)),this.isVideoStat(e)&&("framerateMean"in e?t.frameRate=Number(e.framerateMean):"googFrameRateOutput"in e?t.frameRate=Number(e.googFrameRateOutput):"googFrameRateInput"in e&&(t.frameRate=Number(e.googFrameRateInput))),t},getVideoPacketsLost(e){return e.filter(t=>this.isVideoRemoteInboundRtpStat(t,e)).reduce(p,0)},getAudioPacketsLost(e){return e.filter(t=>this.isAudioRemoteInboundRtpStat(t,e)).reduce(p,0)},normalizeTimestamp:(e,t)=>(void 0===t&&(t=Date.now()),o(e)&&"getTime"in e?e.getTime():Math.abs(e/(1e3*t)-1)<.05?e/1e3:e),normalizeStats(e,t,n){void 0===t&&(t=!0);const o=e.filter(t=>f.isVideoStat(t,e)).filter(e=>f.isInboundStat(e)===t),s=e.filter(t=>this.isAudioStat(t,e)).filter(e=>this.isInboundStat(e)===t)[0],a=o[0];if(!s&&!a)throw new Error("could not find stats for either audio or video");const c=f.normalizeTimestamp(a?a.timestamp:s.timestamp),u={timestamp:c};a&&!t&&void 0===a.packetsLost&&(a.packetsLost=this.getVideoPacketsLost(e)),s&&!t&&void 0===s.packetsLost&&(s.packetsLost=this.getAudioPacketsLost(e));const l=["packetsSent","packetsLost","bytesSent"],p=t?e=>r(e,["packetsReceived","packetsLost","bytesReceived"]):e=>r(e,l);if(o&&o.length>0){const e=(e=>{const t=l.concat(["framerateMean","googFrameRateSent","googFrameRateReceived","googFrameRateInput","googFrameRateOutput","framesEncoded","framesDecoded"]),n={timestamp:c,id:a.id};return t.forEach(t=>{n[t]=e.map(e=>Number(e[t]||0)).reduce((e,t)=>e+t,0)}),n})(o);u.video=Object.assign({frameRate:d(e,n)},i(p(e),Number))}return s&&(u.audio=i(p(s),Number)),u}};e.exports=f},function(e,t,n){"use strict";t.__esModule=!0,t.codes=t.messages=void 0;t.messages={1001:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection.",1002:"The endpoint is terminating the connection due to a protocol error. (CLOSE_PROTOCOL_ERROR)",1003:"The connection is being terminated because the endpoint has indicated that reconnections are not available. (CLOSE_UNSUPPORTED)",1005:"Indicates that no status code was provided even though one was expected. (CLOSE_NO_STATUS)",1006:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected. (CLOSE_ABNORMAL)",1007:"Indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [RFC3629] data within a text message)",1008:"Indicates that an endpoint is terminating the connection because it has received a message that violates its policy. This is a generic status code that can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a need to hide specific details about the policy",1009:"Indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process (CLOSE_TOO_LARGE)",1011:"Indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request",4001:"Connectivity loss was detected as it was too long since the socket received the last PONG message",4010:"Timed out while waiting for the Rumor socket to connect.",4020:"Error code unavailable.",4030:"Exception was thrown during Rumor connection, possibly because of a blocked port."};t.codes={CLOSE_NORMAL:1e3,CLOSE_GOING_AWAY:1001,CLOSE_PROTOCOL_ERROR:1002,CLOSE_UNSUPPORTED:1003,CLOSE_NO_STATUS:1005,CLOSE_ABNORMAL:1006,CLOSE_INCONSISTENT_DATA:1007,CLOSE_POLICY_VIOLATION:1008,CLOSE_TOO_LARGE:1009,CLOSE_UNEXPECTED_CONDITION:1011,CLOSE_CONNECTIVITY_LOSS:4001,CLOSE_TIMEOUT:4010,CLOSE_FALLBACK_CODE:4020,CLOSE_CONNECT_EXCEPTION:4030,ALREADY_CONNECTED_CONNECTING:null}},function(e,t,n){var r=n(78),i=n(112),o=n(83),s=n(180),a=n(379),c=n(183),u=n(55),d=n(382),l=n(384),p=n(186),f=n(188),h=n(41),m=n(387),g=n(388),b=n(193),v=n(12),y=n(66),E=n(392),S=n(11),_=n(394),w=n(30),T=n(54),C={};C["[object Arguments]"]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C["[object Object]"]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C["[object Function]"]=C["[object WeakMap]"]=!1,e.exports=function e(t,n,I,R,x,O){var k,N=1&n,Z=2&n,A=4&n;if(I&&(k=x?I(t,R,x,O):I(t)),void 0!==k)return k;if(!S(t))return t;var L=v(t);if(L){if(k=m(t),!N)return u(t,k)}else{var V=h(t),P="[object Function]"==V||"[object GeneratorFunction]"==V;if(y(t))return c(t,N);if("[object Object]"==V||"[object Arguments]"==V||P&&!x){if(k=Z||P?{}:b(t),!N)return Z?l(t,a(k,t)):d(t,s(k,t))}else{if(!C[V])return x?t:{};k=g(t,V,N)}}O||(O=new r);var M=O.get(t);if(M)return M;O.set(t,k),_(t)?t.forEach((function(r){k.add(e(r,n,I,r,t,O))})):E(t)&&t.forEach((function(r,i){k.set(i,e(r,n,I,i,t,O))}));var D=L?void 0:(A?Z?f:p:Z?T:w)(t);return i(D||t,(function(r,i){D&&(r=t[i=r]),o(k,i,e(r,n,I,i,t,O))})),k}},function(e,t,n){var r=n(79),i=n(351),o=n(352),s=n(353),a=n(354),c=n(355);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=s,u.prototype.has=a,u.prototype.set=c,e.exports=u},function(e,t,n){var r=n(346),i=n(347),o=n(348),s=n(349),a=n(350);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=s,c.prototype.set=a,e.exports=c},function(e,t,n){var r=n(53);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(38)(Object,"create");e.exports=r},function(e,t,n){var r=n(370);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(64),i=n(53),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var s=e[t];o.call(e,t)&&i(s,n)&&(void 0!==n||t in e)||r(e,t,n)}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var r=n(377),i=n(68),o=n(114),s=o&&o.isTypedArray,a=s?i(s):r;e.exports=a},function(e,t,n){var r=n(11),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},function(e,t,n){var r=n(88),i=n(196),o=n(122);e.exports=function(e,t){return o(i(e,t,r),e+"")}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call(function(){return arguments}());e.exports=function(e){return r.call(e)===i}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=r.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||r.call(e)===i)||!1}},function(e,t,n){"use strict";e.exports=n(419)()?globalThis:n(420)},function(e,t,n){var r=n(111),i=n(452),o=n(453);function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}s.prototype.add=s.prototype.push=i,s.prototype.has=o,e.exports=s},function(e,t,n){var r=n(454);e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(86),i=n(11);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=r(e.prototype),o=e.apply(n,t);return i(o)?o:n}}},function(e,t,n){var r=n(494);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},function(e,t,n){var r=n(59),i=n(47);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},function(e,t,n){var r=n(242),i=n(30);e.exports=function(e,t){return e&&r(e,t,i)}},function(e,t,n){"use strict";var r=n(2)(n(46));const i=n(58),o=n(57);let s=function(){function e(e){void 0===e&&(e={}),Object.defineProperty(this,"_rawSessionInfo",{value:o(e)})}return(0,r.default)(e,[{key:"sessionId",get:function(){return this._rawSessionInfo.session_id}},{key:"partnerId",get:function(){return this._rawSessionInfo.partner_id}},{key:"messagingServer",get:function(){return this._rawSessionInfo.messaging_server_url}},{key:"mediaServerName",get:function(){return this._rawSessionInfo.media_server_hostname}},{key:"messagingURL",get:function(){return this._rawSessionInfo.messaging_url}},{key:"symphonyAddress",get:function(){return this._rawSessionInfo.symphony_address}},{key:"iceServers",get:function(){return this._rawSessionInfo.ice_servers}},{key:"simulcast",get:function(){return i(this._rawSessionInfo,"properties.simulcast")}},{key:"e2ee",get:function(){return i(this._rawSessionInfo,"properties.e2ee",!1)}},{key:"reconnection",get:function(){return i(this._rawSessionInfo,"properties.reconnection",!1)}},{key:"renegotiation",get:function(){return i(this._rawSessionInfo,"properties.renegotiation",!1)}},{key:"p2pEnabled",get:function(){return"enabled"===i(this._rawSessionInfo,"properties.p2p.preference.value")}},{key:"hybridSession",get:function(){return i(this._rawSessionInfo,"properties.hybridSession",!1)}},{key:"isAdaptiveEnabled",get:function(){return"adaptive"===i(this._rawSessionInfo,"properties.p2p.preference.value")}},{key:"priorityVideoCodec",get:function(){return i(this._rawSessionInfo,"properties.priorityVideoCodec","")}},{key:"h264",get:function(){return i(this._rawSessionInfo,"properties.h264",!0)}},{key:"vp8",get:function(){return i(this._rawSessionInfo,"properties.vp8",!0)}},{key:"vp9",get:function(){return i(this._rawSessionInfo,"properties.vp9",!0)}},{key:"clientCandidates",get:function(){const e=i(this._rawSessionInfo,"properties.clientCandidates");return"relayed"===e?"relay":e}}]),e}();e.exports=s},function(e,t,n){"use strict";t.adaptIceServers=function(e){return e.map(e=>({url:e.url,urls:e.urls||[e.url],username:e.username,credential:e.credential}))},t.parseIceServers=function(e){let n;try{n=JSON.parse(e.data).content.iceServers}catch(e){return[]}return t.adaptIceServers(n)}},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(7)),o=r(n(8));const s=n(155),a=n(49),c=n(9),u=n(57),d=n(128),l=n(148),p=n(273),f=n(19),h=n(6),m=n(253),g=n(156),b=n(52),v=n(73),y=n(611),E=n(613),S=n(614),_=n(157);e.exports=function(e){void 0===e&&(e={});const r=e.hasValidPeerConnection||n(616),w=e.applySdpTransform||n(159),T=e.createPeerConnection||n(617),C=e.env||n(3),I=e.sdpTransformDefaults||n(619),R=e.getStatsAdapter||n(276),x=e.getRtcStatsReportAdapter||n(279),O=e.getSynchronizationSources||n(623),k=e.IceCandidateProcessor||n(624),N=e.logging||n(1),Z=e.offerProcessor||n(626),A=e.PeerConnectionChannels||n(628),L=e.subscribeProcessor||n(630),V=e.changeMediaDirection||n(631),P=V.changeMediaDirectionToInactive,M=V.changeMediaDirectionToRecvOnly,D=e.Qos||n(280).default,W=e.global||(void 0!==typeof window?window:global),G=e.debounce||n(635),X=e.needsToSwapH264Profiles||n(637).once,j=e.NativeRTCIceCandidate||W.RTCIceCandidate,U=e.NativeRTCSessionDescription||W.RTCSessionDescription,F=e.Errors||n(4),Y=e.OTErrorClass||n(22),B=e.ExceptionCodes||n(10),K=()=>{};return function(e){void 0===e&&(e={});let n=!1;const V=e,H=V.iceConfig,J=void 0===H?{servers:[]}:H,z=V.isPublisher,Q=V.logAnalyticsEvent,q=void 0===Q?K:Q,$=V.offerOverrides,ee=V.answerOverrides,te=V.sdpTransformOptions,ne=V.sendMessage,re=V.p2p,ie=V.codecFlags,oe=V.sourceStreamId,se=V.remoteConnectionId,ae=V.sessionId;let ce,ue=!1,de=!1,le=!1;const pe=X();let fe,he,me,ge=0,be=!1;const ve=g();function ye(e,t){if(!n){if(["candidate","offer","answer","pranswer"].indexOf(e)>-1){const r="candidate"===e?t.candidate:t.sdp;n=-1!==r.indexOf("typ relay")}}ne(e,t)}const Ee=a();q("createPeerConnection","Attempt");const Se={};Se.id=f();const _e=N("PeerConnection:"+Se.id);_e.debug("construct",{id:Se.id,options:e});const we=l({},I,te),Te=e=>"relay"===J.transportPolicy&&null!=e&&-1===e.candidate.indexOf("typ relay"),Ce=p(e,["isPublisher","logAnalyticsEvent","offerOverrides","answerOverrides","sendMessage","sdpTransformOptions"]);let Ie,Re,xe,Oe,ke,Ne=[];const Ze=(()=>{let e=Ce.overrideSimulcastEnabled||!1;return{get:()=>e,set(t){const n=Boolean(t)&&Ce.capableSimulcastStreams>1;n!==e&&void 0===Ce.overrideSimulcastEnabled&&(e=n,Se.generateOffer())}}})(),Ae=(()=>{let e=!1;return{get:()=>e,set(t){const n=Boolean(t);n!==e&&(e=n,e&&!Se.iceConnectionStateIsConnected()?Se.generateOffer():_e.debug("iceRestart is going to wait until we disconnect and then restart ice"))}}})(),Le={clean(){delete this.promise,delete this.resolve,delete this.reject}};Le.promise=new t((e,t)=>{Le.resolve=e,Le.reject=t});let Ve=new k,Pe="new";Object.defineProperty(Se,"signalingState",{get:()=>Ie.signalingState,set:e=>(Ie.signalingState=e,e)}),h(Se),Se.startEncryption=function(){var e=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_()){e.next=2;break}return e.abrupt("return");case 2:return me=E(t),e.next=5,y.createSender(me);case 5:return he=e.sent,e.next=8,S(ae);case 8:return n=e.sent,e.next=11,he.setSenderEncryptionKey(n);case 11:Ie.getTransceivers().forEach(e=>he.encrypt(e.mid,e.sender));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Se.once("iceConnected",(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"",t={pcc:parseInt(a()-Ee,10),hasRelayCandidates:n,proxyInfo:""},Ie&&Ie.proxyInfo&&(t.proxyInfo=Ie.proxyInfo),q("createPeerConnection","Success",t);case 4:case"end":return e.stop()}}),e)})))),Le.resolve();const Me=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(ae);case 2:if(t=e.sent,me=E(se),fe=y.getReceiver(me),fe){e.next=11;break}return e.next=8,y.createReceiver(me);case 8:fe=e.sent,fe.addReceiver(me),fe.setReceiverEncryptionKey(me,t);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),De=e=>{if(_e.debug("internalCreatePeerConnection: called"),Ie)return _e.debug("internalCreatePeerConnection: resolving synchronously"),void e.call(null,null,Ie);if(Ne.push(e),Ne.length>1)return;const t={optional:[{DtlsSrtpKeyAgreement:!0}]};if(_e.debug(`Creating peer connection config "${JSON.stringify(Ce)}".`),0===J.servers.length&&(_e.error("No ice servers present"),q("Error","noIceServers")),"relay"===J.transportPolicy){const e=e=>e&&0===e.indexOf("turn");J.servers=J.servers.map(t=>{const n=u(t);return Array.isArray(n.urls)||(n.urls=[n.urls]),n.urls=n.urls.filter(e),0===n.urls.length?void 0:n}).filter(e=>void 0!==e)}Ce.iceTransportPolicy=J.transportPolicy,Ce.iceServers=J.servers,_()&&(Ce.forceEncodedVideoInsertableStreams=!0,Ce.forceEncodedAudioInsertableStreams=!0,Ce.encodedInsertableStreams=!0),r(W.RTCPeerConnection).then(e=>{if(!e)throw _e.error("createPeerConnection: Invalid RTCPeerConnection object"),new Error("Failed to create valid RTCPeerConnection object");return T({window:W,config:Ce,constraints:t})}).then(function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(z||!_()){e.next=3;break}return e.next=3,Me();case 3:We(null,t);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e=>We(e))},We=(e,t)=>{if(e)return He({reason:"Failed to create PeerConnection, exception: "+e,prefix:"NewPeerConnection"}),void(Ne=[]);_e.debug("OT attachEventsToPeerConnection"),Ie=t,Ve&&Ve.setPeerConnection(t),Re=new A(Ie),Ce.channels&&Re.addMany(Ce.channels);const n=(e=>{let t=e.sendMessage,n=e.logging;const r={};return e=>{e.candidate?(r[e.candidate.sdpMid]=e.candidate.sdpMLineIndex,t("candidate",{candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid||"",sdpMLineIndex:e.candidate.sdpMLineIndex||0})):n.debug("IceCandidateForwarder: No more ICE candidates.")}})({sendMessage:ye,logging:_e}),r=e=>{Le.resolve(),Te(e.candidate)?_e.debug("Ignore candidate",e.candidate.candidate):n(e)},s=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!z&&fe&&fe.decrypt(t.transceiver.mid,t.receiver);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();let a=Ie.iceConnectionState;const c=e=>{Ie?(_e.debug("iceconnectionstatechange",Ie.iceConnectionState),"connected"===Ie.iceConnectionState?("disconnected"===a&&Se.clearFailedTimeout(),Se.emit("iceConnected"),Ae.set(!1)):"completed"===Ie.iceConnectionState&&C.isLegacyEdge&&setTimeout(()=>ze.startCollecting(Ie),1e3)):_e.debug("iceconnectionstatechange on peerConnection that no longer exists",Se);const t=e.target.iceConnectionState;Se.trigger("iceConnectionStateChange",t),q("attachEventsToPeerConnection","iceconnectionstatechange",t),"disconnected"===t&&(Ae.get()?(_e.debug("Restarting ice!"),Se.generateOffer()):v()||(ke=setTimeout(()=>{q("attachEventsToPeerConnection","iceconnectionstatechange","failed"),a="failed",Se.trigger("iceConnectionStateChange","failed")},1e4))),"disconnected"!==a&&"failed"===t&&He({reason:"The stream was unable to connect due to a network error. Make sure your connection isn't blocked by a firewall.",prefix:"ICEWorkflow"}),a=t},u=()=>{q("peerConnection:negotiationNeeded","Event"),z&&Se.generateOffer()};Ie.onaddstream=K,Ie.addEventListener("icecandidate",r),Ie.addEventListener("addstream",Fe),Ie.addEventListener("removestream",Ye),Ie.addEventListener("signalingstatechange",je),Ie.addEventListener("negotiationneeded",u),Ie.addEventListener("iceconnectionstatechange",c),Ie.addEventListener("track",s),ve.add(()=>{Ie&&(Ie.onaddstream=null,Ie.removeEventListener("icecandidate",r),Ie.removeEventListener("addstream",Fe),Ie.removeEventListener("removestream",Ye),Ie.removeEventListener("signalingstatechange",je),Ie.removeEventListener("negotiationneeded",u),Ie.removeEventListener("iceconnectionstatechange",c),Ie.removeEventListener("track",s))}),Ge(null)},Ge=()=>{for(;Ne.length;)Ne.shift().call(null)},Xe=()=>{Ve&&(Ve.destroy(),Ve=null),Ne=[],ze.stopCollecting(),ve.releaseAll(),Le.clean(),null!==Ie&&(Ie.destroy&&Ie.destroy(),Ie=null,Se.trigger("close")),Se.off()},je=e=>{const t=e.target.signalingState;if(Se.emit("signalingStateChange",t),"stable"===t&&Se.emit("signalingStateStable"),t&&t!==Pe)switch(Pe=t,_e.debug("stateChange: "+Pe),Pe){case"closed":Xe()}},Ue=()=>{let e;if(Ie.getRemoteStreams)e=Ie.getRemoteStreams();else{if(!Ie.remoteStreams)throw new Error("Invalid Peer Connection object implements no method for retrieving remote streams");e=Ie.remoteStreams}return Array.prototype.slice.call(e)},Fe=e=>{q("createPeerConnection","StreamAdded"),Se.trigger("streamAdded",e.stream)},Ye=e=>{q("peerConnection:streamRemoved","Event"),Se.trigger("streamRemoved",e.stream)},Be=(e,t,n)=>{le=!1,He({reason:`PeerConnection.offerProcessor ${e}: ${t}`,prefix:n})},Ke=e=>{if(le)return void(ce=e);le=!0,q("peerConnection:processOffer","Event");const t=new U({type:"offer",sdp:e.content.sdp}),n=e=>{le=!1,Ve&&Ve.process(),ye("answer",e),C.isLegacyEdge||ze.startCollecting(Ie,z),ce&&(Ke(ce),ce=null)},r=e=>Se.trigger("remoteVideoSupported",e);De(()=>{Z(Ie,W.RTCPeerConnection,W.RTCSessionDescription,U,we,t,ie,re,n,Be,r,pe)})};Se.generateOffer=G(()=>{ue?de=!0:(()=>{var e,t;if("closed"===(null==(e=Ie)||null==(t=e.signalingState)?void 0:t.toLowerCase()))return;ue=!0,q("peerConnection:processSubscribe","Event"),_e.debug("processSubscribe: Sending offer to subscriber.");let n=Ze.get()?Ce.capableSimulcastStreams:1;"P2P"===oe&&!re&&(n=1),De(()=>{L({peerConnection:Ie,NativeRTCSessionDescription:U,sdpTransforms:we,numSimulcastStreams:n,offerOverrides:$,offerConstraints:{iceRestart:Ae.get()},replaceBaselineProfile:pe}).then(e=>{_e.debug("processSubscribe: got offer, waiting for _readyToSendOffer"),xe=e,Le.promise.then(()=>{_e.debug("processSubscribe: sending offer"),ye("offer",xe)})},e=>{He({reason:`subscribeProcessor ${e.message}: ${e.reason}`,prefix:e.prefix})}),Ae.set(!1)})})()},100);const He=e=>{let t=e.reason,n=e.prefix;_e.error(t,"in state",Ie?{connectionState:Ie.connectionState,iceConnectionState:Ie.iceConnectionState,iceGatheringState:Ie.iceGatheringState,signalingState:Ie.signalingState}:"(none)"),Se.trigger("error",{reason:t,prefix:n})};function Je(e){this.track=e}Se.addTrack=(e,n)=>{const r=new t((e,t)=>{De(n=>{if(n)return t(n);e()})}).then(()=>{if(Ie.addTrack)return Ie.addTrack(e,n);const t=Ie.getLocalStreams()[0];if(void 0===t)throw new Error("PeerConnection has no existing streams, cannot addTrack");t.addTrack(e),Se.generateOffer()}).then(()=>new t(e=>{Se.once("signalingStateStable",()=>{e()})}));return s(r,15e3,"Renegotiation timed out")},Se.removeTrack=e=>{const n=t.resolve().then(()=>e instanceof Je?(Ie.getLocalStreams()[0].removeTrack(e.track),void Se.generateOffer()):Ie.removeTrack(e)).then(()=>new t(e=>{Se.once("signalingStateStable",()=>{e()})}));return s(n,15e3,"Renegotiation timed out")},Se.addLocalStream=e=>new t((t,n)=>{De(r=>{if(r)n(r);else{try{Ie.addStream(e)}catch(e){return void n(e)}t()}})}),Se.getLocalStreams=()=>Ie.getLocalStreams(),Se.getSenders=()=>Ie.getSenders?Ie.getSenders():Ie.getLocalStreams()[0].getTracks().map(e=>new Je(e)),Se.disconnect=()=>{var e;Ve&&(Ve.destroy(),Ve=null),(null==(e=Ie)?void 0:e.signalingState)&&"closed"!==Ie.signalingState.toLowerCase()&&(Ie.close(),he=null,me=null,setTimeout(Xe))},Se.iceRestart=()=>Ae.set(!0),Se.clearFailedTimeout=()=>clearTimeout(ke),Se.changeMediaDirectionToRecvOnly=()=>M(Ie),Se.changeMediaDirectionToInactive=()=>P(Ie),Se.processMessage=(e,t)=>{switch(_e.debug(`processMessage: Received ${e} from ${t.fromAddress}`,t),_e.debug(t),e){case"generateoffer":t.content&&void 0!==t.content.simulcastEnabled&&Ze.set(t.content.simulcastEnabled),Se.generateOffer(),r();break;case"offer":Ke(t),r();break;case"answer":case"pranswer":(e=>{q("peerConnection:processAnswer","Event");const t=e=>{He({reason:"Error while setting RemoteDescription "+e,prefix:"SetRemoteDescription"})};e.content.sdp?(Oe=new U({type:"answer",sdp:w(we,"remote","answer",c({replaceBaselineProfile:pe},ee),e.content.sdp).local}),Ie.setRemoteDescription(Oe).then(()=>{_e.debug("processAnswer: setRemoteDescription Success"),Ve&&Ve.process()}).catch(t),ue=!1,de&&(de=!1,Se.generateOffer()),C.isLegacyEdge||ze.startCollecting(Ie,z)):t("Weird answer message, no SDP.")})(t);break;case"candidate":var n=new j(t.content);if(Te(n))return _e.debug("Ignore candidate",n.candidate),Se;Ve&&Ve.addIceCandidate(n).catch(e=>{_e.warn(`Error while adding ICE candidate: ${JSON.stringify(n)}: ${e.toString()}`)});break;default:_e.debug(`processMessage: Received an unexpected message of type ${e} from ${t.fromAddress}: ${JSON.stringify(t)}`)}function r(){ge+=1,ze.handleOfferMessageReceived(),ge>1&&(q("Renegotiation","Attempt"),be=!0)}return Se},Se.remoteStreams=()=>Ie?Ue():[],Se.remoteTracks=()=>Ie?Ie.getReceivers?Array.prototype.slice.apply(Ie.getReceivers()).map(e=>e.track):Array.prototype.concat.apply([],Ue().map(e=>e.getTracks())):[],Se.remoteDescription=()=>Ie.remoteDescription,Se.getStats=e=>{if(Ie)R(Ie,e);else{const t=B.PEER_CONNECTION_NOT_CONNECTED;e(new m(Y.getTitleByCode(t),F.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}},Se.getRtcStatsReport=e=>{if(Ie)x(Ie,e);else{const t=B.PEER_CONNECTION_NOT_CONNECTED;e(new m(Y.getTitleByCode(t),F.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}},Se.getSynchronizationSources=e=>{if(!z){if(!Ie){const t=B.PEER_CONNECTION_NOT_CONNECTED;return void e(new m(Y.getTitleByCode(t),F.PEER_CONNECTION_NOT_CONNECTED,{code:t}))}O(Ie,e)}};Se.getDataChannel=(e,t,n)=>{Ie?function e(t,n,r,i){let o;const s=Re.get(n,r);if(!s){if(t>0)return void setTimeout(e.bind(null,t-1,n,r,i),200);o=new m(`A channel with that label and options could not be found. Label:${n}. Options: ${JSON.stringify(r)}`)}i(o,s)}(100,e,t,n):n(new m("Cannot create a DataChannel before there is a connection."))},Se.getSourceStreamId=()=>oe,Se.iceConnectionStateIsConnected=()=>Ie&&["connected","completed"].indexOf(Ie.iceConnectionState)>-1,Se.findAndReplaceTrack=(e,n)=>t.resolve().then(()=>{const r=Ie.getSenders().filter(t=>t.track===e)[0];if(!r)return t.resolve();if("function"!=typeof r.replaceTrack)throw new Error("Sender does not support replaceTrack");return r.replaceTrack(n)}),Se.hasRelayCandidates=()=>n,Se.getNegotiatedCodecs=()=>{if(!Ie.localDescription||!Ie.remoteDescription)return null;const e=e=>d(b.getCodecs(Ie.localDescription.sdp,e),b.getCodecs(Ie.remoteDescription.sdp,e));return{audio:e("audio"),video:e("video")}},Se.on("signalingStateStable",()=>{be&&(be=!1,q("Renegotiation","Success",Se.getNegotiatedCodecs()))}),Se.on("error",e=>{let t=e.prefix;be&&-1!==["CreateOffer","SetRemoteDescription"].indexOf(t)&&(be=!1,q("Renegotiation","Failure"))}),Se.on("close",()=>{be&&(be=!1,q("Renegotiation","Cancel"))});const ze=new D;return ze.on("stats",e=>{e.dataChannels=Re.sampleQos(),Se.trigger("qos",{parsedStats:e,simulcastEnabled:Ze.get()})}),Se}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(3);e.exports=()=>"Chrome"===r.name&&r.version>=58||-1!==["Firefox","Edge","Safari","Opera"].indexOf(r.name)},function(e,t,n){"use strict";e.exports=function(e){let t=null,n=!1;const r=()=>{n&&(e(),t=window.requestAnimationFrame(r))};this.start=()=>{n||(n=!0,window.requestAnimationFrame(r))},this.stop=()=>{window.cancelAnimationFrame(t),n=!1}}},function(e,t,n){"use strict";const r=n(9);e.exports=(e,t)=>{const n={};Object.keys(t).forEach(r=>{n[r]=((e,t,n)=>t&&!n?()=>t.call(e):t&&n?r=>(void 0!==r&&n.call(e,r),t.call(e)):t=>{void 0!==t&&n.call(e,t)})(e,t[r].get,t[r].set)}),r(e,n)}},function(e,t,n){"use strict";let r="";e.exports={getCurrentAudioOutputDeviceId:()=>r,setCurrentAudioOutputDeviceId:e=>{r=e}}},function(e,t,n){"use strict";(function(t){e.exports=function(e){return new t(t=>setTimeout(t,e))}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(295);e.exports=function(e){let t=(void 0===e?{}:e).NativeVideoElementWrapper;const n=void 0===t?r():t;return function(e){let t=void 0===e?{}:e,r=t.fallbackText,i=void 0===r?"Sorry, Web RTC is not available in your browser":r,o=t.fitMode,s=t.muted,a=t._inject,c=t.widgetType;return new n({fallbackText:i,fitMode:o,muted:s,defaultAudioVolume:50,_inject:a,widgetType:c})}}},function(e,t){e.exports=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,n):{};r.get||r.set?Object.defineProperty(t,n,r):t[n]=e[n]}return t.default=e,t}},function(e,t,n){var r=n(38)(n(14),"Map");e.exports=r},function(e,t,n){var r=n(362),i=n(369),o=n(371),s=n(372),a=n(373);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=s,c.prototype.set=a,e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){(function(e){var r=n(177),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=o&&o.exports===i&&r.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a}).call(this,n(84)(e))},function(e,t,n){var r=n(69),i=n(378),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t,n){var r=n(383),i=n(184),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),r(s(e),(function(t){return o.call(e,t)})))}:i;e.exports=a},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},function(e,t,n){var r=n(182)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(191);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},function(e,t,n){"use strict";e.exports={error:{priority:1,method:"error"},warn:{priority:2,method:"warn"},info:{priority:3,method:"info"},log:{priority:4,method:"log"},debug:{priority:5,method:"debug"},spam:{priority:6,method:"log"}}},function(e,t){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},function(e,t,n){var r=n(399),i=n(197)(r);e.exports=i},function(e,t,n){var r=n(53),i=n(25),o=n(67),s=n(11);e.exports=function(e,t,n){if(!s(n))return!1;var a=typeof t;return!!("number"==a?i(n)&&o(t,n.length):"string"==a&&t in n)&&r(n[t],e)}},function(e,t,n){"use strict";e.exports=n(199)()?Object.setPrototypeOf:n(200)},function(e,t,n){"use strict";var r=n(56),i={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!r(e)&&hasOwnProperty.call(i,typeof e)}},function(e,t,n){"use strict";e.exports=n(410)()?Object.assign:n(411)},function(e,t,n){"use strict";const r=n(1)("Event"),i=n(9),o=n(128);e.exports=function(){function e(e,t,n){void 0===t&&(t=!0),void 0===n&&(n={}),this.type=e,this.cancelable=t,this._defaultPrevented=!1;const r=o(Object.keys(this),Object.keys(n));if(r.length>0)throw new Error("Cannot used reserved property names: "+r.join(","));i(this,n)}var t=e.prototype;return t.preventDefault=function(){this.cancelable?this._defaultPrevented=!0:r.warn("Event.preventDefault :: Trying to preventDefault on an event that isn't cancelable")},t.isDefaultPrevented=function(){return this._defaultPrevented},e}()},function(e,t,n){var r=n(33),i=n(451),o=n(87),s=n(457),a=o((function(e){var t=r(e,s);return t.length&&t[0]===e[0]?i(t):[]}));e.exports=a},function(e,t){e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},function(e,t,n){var r=n(25),i=n(16);e.exports=function(e){return i(e)&&r(e)}},function(e,t){e.exports={}},function(e,t,n){var r=n(220),i=n(480),o=n(481),s=n(222),a=n(492),c=n(226),u=n(493),d=n(229),l=n(230),p=n(96),f=Math.max;e.exports=function(e,t,n,h,m,g,b,v){var y=2&t;if(!y&&"function"!=typeof e)throw new TypeError("Expected a function");var E=h?h.length:0;if(E||(t&=-97,h=m=void 0),b=void 0===b?b:f(p(b),0),v=void 0===v?v:p(v),E-=m?m.length:0,64&t){var S=h,_=m;h=m=void 0}var w=y?void 0:c(e),T=[e,t,n,h,m,S,_,g,b,v];if(w&&u(T,w),e=T[0],t=T[1],n=T[2],h=T[3],m=T[4],!(v=T[9]=void 0===T[9]?y?0:e.length:f(T[9]-E,0))&&24&t&&(t&=-25),t&&1!=t)C=8==t||16==t?o(e,t,v):32!=t&&33!=t||m.length?s.apply(void 0,T):a(e,t,n,h);else var C=i(e,t,n);return l((w?r:d)(C,T),e,t)}},function(e,t,n){var r=n(86),i=n(134);function o(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}o.prototype=r(i.prototype),o.prototype.constructor=o,e.exports=o},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];s!==t&&"__lodash_placeholder__"!==s||(e[n]="__lodash_placeholder__",o[i++]=n)}return o}},function(e,t,n){var r=n(29),i=n(118),o=n(16),s=Function.prototype,a=Object.prototype,c=s.toString,u=a.hasOwnProperty,d=c.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==d}},function(e,t,n){var r=n(12),i=n(71),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(s.test(e)||!o.test(e)||null!=t&&e in Object(t))}},function(e,t,n){var r=n(516),i=n(196),o=n(122);e.exports=function(e){return o(i(e,void 0,r),e+"")}},function(e,t,n){"use strict";const r=n(243),i=e=>e.replace(/\/$/,"");e.exports={prependProxyToUrlIfNeeded:(e,t)=>{if(!t)return e;const n=r.parse(t),o=r.parse(e);if(!n.protocol||!o.protocol)return e;const s=n.protocol.match(/^https/),a=o.protocol.match(/^ws/i);return`${i(`${(a?"ws":"http")+(s?"s":"")}://${n.host}${n.pathname}`)}/${i(`${o.host}${o.pathname}${o.search||""}`)}`}}},function(e,t,n){"use strict";const r=n(21),i=n(13),o=n(4),s=n(10),a=n(22);let c;const u={SET_PROXY_URL_TIMING_ERROR:"The proxyUrl was set after a session or publisher was created.",PROXY_URL_ALREADY_SET_ERROR:"The proxyUrl has already been set. Setting it again will not have any effect."};e.exports={errorMessages:u,setProxyUrl:e=>{const t=n(26),d=n(72),l=new t,p=r.sessions.length()>0,f=r.publishers.length()>0;let h;if(p){const e=r.sessions.find(e=>"connected"===e.currentState);h=e?e.sessionId:r.sessions.find().sessionId}else h="";const m={sessionId:h,apiKey:d.value};if(f||p){const e=i()(o.SET_PROXY_URL_TIMING_ERROR,new Error(u.SET_PROXY_URL_TIMING_ERROR),s.SET_PROXY_URL_TIMING_ERROR);a.handleJsException({error:e,target:m,analytics:l})}else if(c){const e=i()(o.PROXY_URL_ALREADY_SET_ERROR,new Error(u.PROXY_URL_ALREADY_SET_ERROR),s.PROXY_URL_ALREADY_SET_ERROR);a.handleJsException({error:e,target:m,analytics:l})}else c=e},getProxyUrl:()=>c,clearProxyUrl:()=>{c=null}}},function(e,t,n){var r=n(87),i=n(53),o=n(123),s=n(54),a=Object.prototype,c=a.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&o(t[0],t[1],u)&&(r=1);++n<r;)for(var d=t[n],l=s(d),p=-1,f=l.length;++p<f;){var h=l[p],m=e[h];(void 0===m||i(m,a[h])&&!c.call(e,h))&&(e[h]=d[h])}return e}));e.exports=u},function(e,t,n){"use strict";let r="";e.exports={set:e=>{r=e},get:()=>r}},function(module,exports,__webpack_require__){"use strict";const extendES5Native=__webpack_require__(557),webrtcAdapter=__webpack_require__(558),logging=__webpack_require__(1)("createWindowMock"),env=__webpack_require__(3),windowKeys=[{key:"location",type:"object"},{key:"setTimeout",type:"function"},{key:"requestAnimationFrame",type:"function"},{key:"URL",type:"function"},{key:"MediaStream",type:"class"},{key:"webkitMediaStream",type:"class"},{key:"RTCIceCandidate",type:"class"},{key:"mozRTCIceCandidate",type:"class"},{key:"RTCSessionDescription",type:"class"},{key:"mozRTCSessionDescription",type:"class"},{key:"RTCIceGatherer",type:"class"},{key:"RTCIceTransport",type:"class"},{key:"RTCDtlsTransport",type:"class"},{key:"RTCSctpTransport",type:"class"},{key:"RTCRtpReceiver",type:"class"},{key:"HTMLMediaElement",type:"class"},{key:"RTCPeerConnection",type:"class"},{key:"webkitRTCPeerConnection",type:"class"},{key:"mozRTCPeerConnection",type:"class"},{key:"MediaStreamTrack",type:"class"},{key:"RTCRtpSender",type:"class"},{key:"RTCTrackEvent",type:"class"},{key:"RTCTransceiver",type:"class"},{key:"RTCDtmfSender",type:"class"},{key:"RTCDTMFSender",type:"class"},{key:"MediaStreamTrackEvent",type:"class"}],navigatorKeys=[{key:"userAgent",type:"string"},{key:"getUserMedia",type:"function"},{key:"getDisplayMedia",type:"function"},{key:"webkitGetUserMedia",type:"function"},{key:"mozGetUserMedia",type:"function"}],mediaDevicesKeys=[{key:"getUserMedia",type:"function"},{key:"getDisplayMedia",type:"function"},{key:"enumerateDevices",type:"function"},{key:"getSupportedConstraints",type:"function"},{key:"addEventListener",type:"function"},{key:"removeEventListener",type:"function"}],bindWithStaticProperties=(e,t)=>{if("function"!=typeof t)return logging.warn("Non-function passed into bindWithStaticProperties()"),t;const n=t.bind(e);return Object.keys(t).forEach(e=>{n[e]=t[e]}),n},extendParentClass=ParentClass=>{try{const ChildClass=eval('\n "use strict"; // Chrome<49 requires strict mode\n\n const getOwnProperties = (target) => {\n const properties = {};\n Object.getOwnPropertyNames(target).forEach((key) => {\n properties[key] = Object.getOwnPropertyDescriptor(target, key);\n });\n return properties;\n };\n\n class ChildClass extends ParentClass {\n constructor(...args) {\n super(...args);\n try {\n this.__proto__ = ChildClass.prototype;\n } catch (e) {}\n }\n };\n\n Object.defineProperties(ChildClass.prototype, getOwnProperties(ParentClass.prototype));\n Object.keys(ParentClass)\n .forEach((staticKey) => {\n ChildClass[staticKey] = ParentClass[staticKey];\n });\n\n ChildClass; // Ensure the final statement is returned in FF\n ');if(ChildClass&&ChildClass.prototype instanceof ParentClass)return ChildClass}catch(e){}return null},canUseES6Class=e=>{const t=e.RTCPeerConnection||e.webkitRTCPeerConnection||e.mozRTCPeerConnection,n=extendParentClass(t);if(n)try{n.prototype.foo="bar";const e=new n({iceServers:[]}),t="bar"===e.foo;try{e.close()}catch(e){}return t}catch(e){}return!1},extendClass=(e,t,n)=>{if("function"!=typeof e)return logging.warn("Non-function passed into extendClass()"),e;let r=n&&extendParentClass(e);return r||(r=extendES5Native(e)),r},getCopyProperties=e=>(t,n,r)=>{r.forEach(r=>{let i=r.key,o=r.type,s=n[i];if(void 0!==s){switch(o){case"function":s=bindWithStaticProperties(n,s);break;case"class":s=extendClass(s,i,e);break;case"string":case"object":break;default:throw new Error("Invalid type of window key: "+o)}t[i]=s}})},cloneWindow=e=>{const t={},n=getCopyProperties(canUseES6Class(e));return n(t,e,windowKeys),void 0!==e.navigator&&(t.navigator={},n(t.navigator,e.navigator,navigatorKeys),void 0!==e.navigator.mediaDevices&&(t.navigator.mediaDevices={},n(t.navigator.mediaDevices,e.navigator.mediaDevices,mediaDevicesKeys))),t};module.exports=function(e){if(void 0!==e.adapter||env.isLegacyEdge)return e;const t=cloneWindow(e);return webrtcAdapter({window:t}),t}},function(e,t,n){"use strict";e.exports=function(){let e=null;this.transform=t=>{e=null===e||t>=e?t:.3*t+.7*e;const n=Math.log(e)/Math.LN10/1.5+1;return Math.min(Math.max(n,0),1)}}},function(e,t,n){"use strict";const r=n(6),i=e=>Object.keys(e).map(t=>e[t]),o=n(9);e.exports=function(e){const t={},n=(n,r)=>{o(r,{parent:this}),r.appendTo(e.parent),t[n]=r,this[n]=r};e.parent&&(r(this),this.destroy=()=>{this.off(),this.hideWhileLoading(),i(t).forEach(e=>e.destroy())},this.showAfterLoading=()=>{i(t).forEach(e=>e.showAfterLoading())},this.hideWhileLoading=()=>{i(t).forEach(e=>e.hideWhileLoading())},this.set=(e,t)=>("string"==typeof e&&t?n(e,t):Object.keys(e).forEach(t=>{n(t,e[t])}),this))}},function(e,t,n){"use strict";var r=n(2)(n(18));e.exports=function(){function e(e){(0,r.default)(this,"_analyser",null),(0,r.default)(this,"_timeDomainData",null),(0,r.default)(this,"_sourceNode",null),this._audioContext=e}var t=e.prototype;return t._initAudioAnalyser=function(e){this._analyser=this._audioContext.createAnalyser(),this._sourceNode=this._audioContext.createMediaStreamSource(e),this._sourceNode.connect(this._analyser),this._timeDomainData=new Uint8Array(this._analyser.frequencyBinCount)},t.webRTCStream=function(e){this._sourceNode&&this._sourceNode.disconnect(this._analyser),"suspended"===this._audioContext.state&&this._audioContext.resume(),this._initAudioAnalyser(e)},t.destroy=function(){this._sourceNode&&this._sourceNode.disconnect(this._analyser),this._timeDomainData=null},t.sample=function(e){if("function"==typeof e)throw new Error("sample no longer takes a callback");if(this._analyser&&this._timeDomainData){this._analyser.getByteTimeDomainData(this._timeDomainData);let e=0;for(let t=this._timeDomainData.length-1;t>=0;t-=1)e=Math.max(e,Math.abs(this._timeDomainData[t]-128));return e/128}return null},e}()},function(e,t,n){"use strict";const r=n(569),i=n(27),o=n(6),s=n(23)();e.exports=new function(){const e=this;function t(){return r.isDomLoaded()&&!r.isDomUnloaded()}function n(){e.dispatchEvent(new s.EnvLoadedEvent(i.ENV_UNLOADED))}o(e),r.whenLoaded.then((function(){r.whenUnloaded.then(n),t()&&e.dispatchEvent(new s.EnvLoadedEvent(i.ENV_LOADED))})),this.onLoad=function(n,r){t()?n.call(r):e.on(i.ENV_LOADED,n,r)},this.onUnload=function(t,n){this.isUnloaded()?t.call(n):e.on(i.ENV_UNLOADED,t,n)},this.isUnloaded=function(){return r.isDomUnloaded()}}},function(e,t,n){var r=n(570),i=n(195)((function(e,t,n){r(e,t,n)}));e.exports=i},function(e,t,n){"use strict";var r=n(574);
|
|
18
18
|
/*!
|
|
19
19
|
* The buffer module from node.js, for the browser.
|
|
20
20
|
*
|
|
21
21
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
22
22
|
* @license MIT
|
|
23
|
-
*/function o(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0}function i(e){return(void 0!==typeof window?window:global).Buffer&&"function"==typeof(void 0!==typeof window?window:global).Buffer.isBuffer?(void 0!==typeof window?window:global).Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var s=n(566),a=Object.prototype.hasOwnProperty,c=Array.prototype.slice,u="foo"===function(){}.name;function d(e){return Object.prototype.toString.call(e)}function l(e){return!i(e)&&("function"==typeof(void 0!==typeof window?window:global).ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var p=e.exports=v,f=/\s*function\s+([^\(\s]*)\s*/;function h(e){if(s.isFunction(e)){if(u)return e.name;var t=e.toString().match(f);return t&&t[1]}}function m(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function b(e){if(u||!s.isFunction(e))return s.inspect(e);var t=h(e);return"[Function"+(t?": "+t:"")+"]"}function g(e,t,n,r,o){throw new p.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:o})}function v(e,t){e||g(e,!0,t,"==",p.ok)}function y(e,t,n,r){if(e===t)return!0;if(i(e)&&i(t))return 0===o(e,t);if(s.isDate(e)&&s.isDate(t))return e.getTime()===t.getTime();if(s.isRegExp(e)&&s.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(l(e)&&l(t)&&d(e)===d(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===o(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;var a=(r=r||{actual:[],expected:[]}).actual.indexOf(e);return-1!==a&&a===r.expected.indexOf(t)||(r.actual.push(e),r.expected.push(t),function(e,t,n,r){if(null==e||null==t)return!1;if(s.isPrimitive(e)||s.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var o=S(e),i=S(t);if(o&&!i||!o&&i)return!1;if(o)return e=c.call(e),t=c.call(t),y(e,t,n);var a,u,d=C(e),l=C(t);if(d.length!==l.length)return!1;for(d.sort(),l.sort(),u=d.length-1;u>=0;u--)if(d[u]!==l[u])return!1;for(u=d.length-1;u>=0;u--)if(a=d[u],!y(e[a],t[a],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function S(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function E(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function T(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&g(o,n,"Missing expected exception"+r);var i="string"==typeof r,a=!e&&o&&!n;if((!e&&s.isError(o)&&i&&E(o,n)||a)&&g(o,n,"Got unwanted exception"+r),e&&o&&n&&!E(o,n)||!e&&o)throw o}p.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(b(e.actual),128)+" "+e.operator+" "+m(b(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,o=h(t),i=r.indexOf("\n"+o);if(i>=0){var s=r.indexOf("\n",i+1);r=r.substring(s+1)}this.stack=r}}},s.inherits(p.AssertionError,Error),p.fail=g,p.ok=v,p.equal=function(e,t,n){e!=t&&g(e,t,n,"==",p.equal)},p.notEqual=function(e,t,n){e==t&&g(e,t,n,"!=",p.notEqual)},p.deepEqual=function(e,t,n){y(e,t,!1)||g(e,t,n,"deepEqual",p.deepEqual)},p.deepStrictEqual=function(e,t,n){y(e,t,!0)||g(e,t,n,"deepStrictEqual",p.deepStrictEqual)},p.notDeepEqual=function(e,t,n){y(e,t,!1)&&g(e,t,n,"notDeepEqual",p.notDeepEqual)},p.notDeepStrictEqual=function e(t,n,r){y(t,n,!0)&&g(t,n,r,"notDeepStrictEqual",e)},p.strictEqual=function(e,t,n){e!==t&&g(e,t,n,"===",p.strictEqual)},p.notStrictEqual=function(e,t,n){e===t&&g(e,t,n,"!==",p.notStrictEqual)},p.throws=function(e,t,n){T(!0,e,t,n)},p.doesNotThrow=function(e,t,n){T(!1,e,t,n)},p.ifError=function(e){if(e)throw e},p.strict=r((function e(t,n){t||g(t,!0,n,"==",e)}),p,{equal:p.strictEqual,deepEqual:p.deepStrictEqual,notEqual:p.notStrictEqual,notDeepEqual:p.notDeepStrictEqual}),p.strict.strict=p.strict;var C=Object.keys||function(e){var t=[];for(var n in e)a.call(e,n)&&t.push(n);return t}},function(e,t,n){"use strict";const r=n(573),o=n(265),i=n(2);e.exports=e=>i.isElectron?"screen"===e||o(e):r.indexOf(e)>-1},function(e,t,n){"use strict";const r=n(268),o=n(6),i=n(1)("StreamChannel"),s=n(151)();e.exports=function(e){this.id=e.id,this.type=e.type,this.active=r(e.active),this.orientation=e.orientation||s.ROTATED_NORMAL,e.frameRate&&(this.frameRate=parseFloat(e.frameRate)),e.preferredFrameRate&&(this.preferredFrameRate=parseFloat(e.preferredFrameRate)),e.preferredWidth&&(this.preferredWidth=parseInt(e.preferredWidth,10)),e.preferredHeight&&(this.preferredHeight=parseInt(e.preferredHeight,10)),this.width=parseInt(e.width,10),this.height=parseInt(e.height,10),this.source=e.source||"camera",this.fitMode=e.fitMode||"cover",o(this),this.update=function(e){const t={},n={};for(const o in e){if(!e.hasOwnProperty(o))continue;const s=this[o];switch(o){case"active":this.active=r(e[o]);break;case"disableWarning":this.disableWarning=r(e[o]);break;case"frameRate":this.frameRate=parseFloat(e[o],10);break;case"width":case"height":this[o]=parseInt(e[o],10),t[o]=this[o],n[o]=s;break;case"orientation":this[o]=e[o],t[o]=this[o],n[o]=s;break;case"fitMode":case"source":this[o]=e[o];break;default:return i.warn(`Tried to update unknown key ${o} on ${this.type} channel ${this.id}`),!1}this.trigger("update",this,o,s,this[o])}return Object.keys(t).length&&this.trigger("update",this,"videoDimensions",n,t),!0}}},function(e,t,n){"use strict";e.exports=function(){return{ROTATED_NORMAL:0,ROTATED_LEFT:270,ROTATED_RIGHT:90,ROTATED_UPSIDE_DOWN:180}}},function(e,t,n){"use strict";const r=n(581),o=n(1)("StylableComponent"),i=n(582),s=n(583);e.exports=function(e,t,n,a){if(!e.trigger)throw new Error("OT.StylableComponent is dependent on the eventing mixin. Ensure that this is included in the object before StylableComponent.");a=a||function(){};let c=!1;!1===n&&(t={buttonDisplayMode:"off",nameDisplayMode:"off",audioLevelDisplayMode:"off",videoDisabledDisplayMode:"off",audioBlockedDisplayMode:"off"},c=!0,a({showControls:!1}));const u=new i(t,(function(t,n,r){r?e.trigger("styleValueChanged",t,n,r):e.trigger("styleValueChanged",t,n)}));e.getStyle=function(e){return u.get(e)},e.setStyle=function(e,t,n){if(c)return o.warn("Calling setStyle() has no effect because theshowControls option was set to false"),this;let i;return"string"!=typeof e?i=e:(i={},i[e]=t),i.backgroundImageURI&&(i.backgroundImageURI=r(i.backgroundImageURI)),u.setAll(i,n),a(s(i)),this}}},function(e,t,n){"use strict";const r=n(50),o=n(34)(),i=n(27),s=n(72),a=n(146),c=n(61).once,u=n(586),d=n(5),l=n(1)("systemRequirements"),p=n(587),f=n(588),h=o.onlyLocal(),m=new i,b=r(()=>{m.logEvent({action:"checkSystemRequirements",variation:"notHasRequirements",partnerId:s.value,payload:{userAgent:d.env.userAgent}})}),g=r(()=>{n(589)()});let v=!1;e.exports={check(){l.debug("OT.checkSystemRequirements()");const e=Number(u&&c());return g(),e||b(),e},upgrade(e){let t=void 0===e?{}:e,n=t.isSupportedButOld,r=void 0===n?d.env.name.toLowerCase()in h.minimumVersion:n,o=t.userAgent,i=void 0===o?navigator.userAgent:o;a.onLoad(()=>{if(v)return;const e=new f(p);let t;v=!0,e.on("close",()=>{v=!1}),e.open(),t=i.match(/(iPad|iPhone|iPod|android|webOS)/i)?(r?"supported-":"")+"mobile-browser":(r?"upgrade":"normal")+"-install",e.el("#section-"+t).style.display="block"})}}},function(e,t,n){"use strict";(function(t){var r=n(3),o=r(n(60)),i=r(n(590));const s=n(594);let a=function(e){function t(t){var n;return(n=e.call(this,t)||this).name="TimeoutError",n}return(0,o.default)(t,e),t}((0,i.default)(Error));e.exports=(e,n,r)=>new t((t,o)=>{if("number"!=typeof n||n<0)throw new TypeError("Expected `ms` to be a positive number");const i=setTimeout(()=>{if("function"==typeof r){try{t(r())}catch(i){o(i)}return}const i=r instanceof Error?r:new a("string"==typeof r?r:`Promise timed out after ${n} milliseconds`);"function"==typeof e.cancel&&e.cancel(),o(i)},n);s(e.then(t,o),()=>{clearTimeout(i)})}),e.exports.TimeoutError=a}).call(this,n(0))},function(e,t,n){"use strict";e.exports=function(){const e=[];return{add(t){e.push(t)},remove(t){const n=e.indexOf(t);n>=0&&e.splice(n,1)},releaseAll(){const t=[];for(;e.length>0;){const n=e.pop();try{n()}catch(e){t.push(e)}}const n=t.length;if(n>0)throw new Error(`Failed to complete ${n} cleanup job${1===n?"":"s"}: ${t.map(e=>`<${e}>`).join(", ")}`)}}}},function(e,t,n){"use strict";const r=n(1)("applySdpTransform");e.exports=(e,t,n,o,i)=>{const s=e[t][n],a=`${t} ${n}`,c=`sdpTransforms (${"local offer"===a||"remote answer"===a?"publisher":"subscriber"}): ${t} ${n}`,u="local"===t?"created":"received";r.debug(`${c}: ${u}:\n${i}`);const d=s(o,i);return d.local===i?r.debug(c+": not modified"):r.debug(`${c}: modified to:\n${d.local}`),d}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";e.exports=function(e){if(void 0===e&&(e={}),!e)return 0;const t=e,n=t.currentStatFrames,r=void 0===n?0:n,o=t.prevStatFrames,i=void 0===o?0:o,s=t.currentTimestamp,a=void 0===s?0:s,c=t.prevTimestamp,u=void 0===c?0:c;if(r>=i&&a>u){const e=(r-i)/((a-u)/1e3);return Math.round(100*e)/100}return 0}},function(e,t,n){"use strict";let r;e.exports=function(e){void 0===e&&(e={});const t=e.AudioContext||(void 0!==typeof window?window:global).AudioContext||(void 0!==typeof window?window:global).webkitAudioContext;return function(){if(r=r||t&&new t,null==r)throw new Error("AudioContext could not be created, hardware limit reached.");return r}}},function(e,t,n){"use strict";var r=n(3);t.__esModule=!0,t.default=void 0;var o=r(n(57));var i="function"==typeof(0,o.default)(void 0!==typeof window?window:global,"navigator.getDisplayMedia",(0,o.default)(void 0!==typeof window?window:global,"navigator.mediaDevices.getDisplayMedia"));t.default=i},function(e,t,n){"use strict";const r=n(37);e.exports=function(){return function(e,t,n){const o=t.slice(),i=r(n);return function(t){let n=e,r=null;function s(e,o){t({message:e,newState:o,currentState:n,previousState:r})}function a(e){return t=e,-1===o.indexOf(t)?(s(`'${e}' is not a valid state`,e),!1):(a=e,!(!i[r=n]||-1===i[r].indexOf(a))||(s(`'${n}' cannot transition to '${e}'`,e),!1));var t,r,a}this.current=n,this.set=function(e){a(e)&&(r=n,this.current=e,n=e)}}}}},function(e,t,n){"use strict";(function(t){const r=n(62);e.exports=function(e){void 0===e&&(e={});const o=e.chromeExtensionHelper||n(280)(),i=e.electronExtensionHelper||n(630)(),s=e.Errors||n(4),a=e.firefoxExtensionHelper||n(632),c=e.getDisplayMediaExtensionHelper||n(287),u=e.otError||n(11)(),d=e.OTHelpers||n(5),l={extensionByKind:{},extensionClasses:{},registerExtensionHelper:(e,t)=>{l.extensionClasses[e]=t,t.autoRegisters&&t.isSupportedInThisBrowser&&l.registerExtension(e)},registerExtension:function(e){if(null==l.extensionClasses[e])throw new Error("Unsupported kind passed to OT.registerScreenSharingExtension");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const o=l.extensionClasses[e].register(...n);l.extensionByKind[e]=o}},p=()=>{const e=r(Object.keys(l.extensionClasses).sort(e=>"electron"===e?-1:1),e=>l.extensionClasses[e].isSupportedInThisBrowser);return void 0===e?{}:{name:e,proto:l.extensionClasses[e],instance:l.extensionByKind[e]}};l.pickHelper=()=>p(),l.checkCapability=e=>{const t={supported:!1,extensionRequired:void 0,extensionRegistered:void 0,extensionInstalled:void 0,supportedSources:{}},n=p();if(void 0!==n.name){if(t.supported=!0,t.extensionRequired=n.proto.extensionRequired?n.name:void 0,t.supportedSources={screen:n.proto.sources.screen,application:n.proto.sources.application,window:n.proto.sources.window,browser:n.proto.sources.browser},!n.instance)return t.extensionRegistered=!1,t.extensionRequired&&(t.extensionInstalled=!1),void setTimeout(e.bind(null,t));t.extensionRegistered=!!t.extensionRequired||void 0,n.instance.isInstalled(n=>{t.extensionInstalled=t.extensionRequired||"Firefox"===d.env.name?n:void 0,e(t)})}else setTimeout(e.bind(null,t))},l.registerExtensionHelper("electron",i),l.registerExtensionHelper("getDisplayMedia",c),l.registerExtensionHelper("chrome",o),l.registerExtensionHelper("firefox",a);const f=()=>{};return l.getConstraints=e=>{const n=e.onAccessDialogOpened,r=void 0===n?f:n,o=e.onAccessDialogClosed,i=void 0===o?f:o,a=e.videoSource,c=e.constraints;return new t((e,t)=>{l.checkCapability(n=>{if(n.supported)if(!1===n.extensionRegistered)t(u(s.SCREEN_SHARING_EXTENSION_NOT_REGISTERED,new Error("Screen Sharing support in this browser requires an extension, but one has not been registered.")));else if(n.extensionRequired&&!1===n.extensionInstalled)t(u(s.SCREEN_SHARING_EXTENSION_NOT_INSTALLED,new Error("Screen Sharing support in this browser requires an extension, but the extension is not installed.")));else{const n=l.pickHelper();n.proto.getConstraintsShowsPermissionUI&&r(),n.instance.getConstraints(a,c,(r,o)=>{n.proto.getConstraintsShowsPermissionUI&&i(),r?t(r):e(o)})}else{let e="Screen Sharing is not supported in this browser";d.env.isElectron?e="Set the webPreferences.contextIsolation option of the Electron BrowserWindow to false or use a preload script to access the desktop capturer. For more information, see https://tokbox.com/developer/guides/screen-sharing/js/.":"Chrome"===d.env.name&&d.env.version>73&&"https:"!==(void 0!==typeof window?window:global).location.protocol&&(e="https:// is required for screen sharing"),t(u(s.SCREEN_SHARING_NOT_SUPPORTED,new Error(e)))}})})},l}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(4),r=e.ExceptionCodes||n(8),o=e.otError||n(11)(),i={ICEWorkflow:t.ICE_WORKFLOW_FAILED,NewPeerConnection:t.CREATE_PEER_CONNECTION_FAILED,SetRemoteDescription:t.SET_REMOTE_DESCRIPTION_FAILED,Subscribe:{404:t.STREAM_NOT_FOUND,[r.STREAM_LIMIT_EXCEEDED]:t.STREAM_LIMIT_EXCEEDED}};return function(e,n,s,a,c){const u=`${(s?s+": ":"")+c} PeerConnection with connection ${a} failed: ${n}`,d=i[s]||{},l="string"==typeof d?d:d[e],p="Publisher"===c?r.UNABLE_TO_PUBLISH:r.UNABLE_TO_SUBSCRIBE;if(!l){const e=new Error(u);return e.code=p,e}const f="ICEWorkflow"===s?"Publisher"===c?r.PUBLISHER_ICE_WORKFLOW_FAILED:r.SUBSCRIBER_ICE_WORKFLOW_FAILED:l===t.STREAM_LIMIT_EXCEEDED?r.STREAM_LIMIT_EXCEEDED:p;return o(l,new Error(u),f)}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.OTHelpers||n(5),r=(e.global||(void 0!==typeof window?window:global)).RTCPeerConnection;return function(e,n){"Firefox"===t.env.name&&r&&r.generateCertificate?r.generateCertificate({name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])}).catch(e=>{n(e)}).then(t=>{e.certificates=[t],n(void 0,e)}):setTimeout(()=>{n(void 0,e)})}}},function(e,t,n){"use strict";var r=n(3),o=r(n(12)),i=r(n(13)),s=r(n(46)),a=r(n(18));const c=n(6),u=n(646),d=n(1)("WidgetView"),l=n(5),p=n(2),f=n(166),h=f.default,m=f.CancellationError,b=n(167),g=n(648),v=n(649),y=n(650),S=n(651),E=n(652),T=n(63),C=n(107);C();e.exports=function(e){let t=void 0===e?{}:e,n=t.logging,r=void 0===n?d:n,f=t.OTHelpers,w=void 0===f?l:f,R=t.waitForVideoToBePlaying,I=void 0===R?v:R,_=t.VideoElementFacade,x=void 0===_?C():_,O=t.env,N=void 0===O?p:O;const k=u({window:void 0!==typeof window?window:global}),Z=e=>{if(e.isCanceled())throw r.debug("bindVideo bailing due to cancellation"),new m("CANCEL")};return function(){function e(e,t){let n=void 0===t?{}:t,o=n.insertDefaultUI,i=void 0===o||o,s=n.width,u=void 0===s?264:s,d=n.height,l=void 0===d?198:d,p=n.fitMode,f=void 0===p?"cover":p,h=n.mirror,m=void 0!==h&&h,b=n.insertMode,g=n.classNames,v=n.style,C=n.widgetType;(0,a.default)(this,"_videoElementFacade",void 0),(0,a.default)(this,"_container",void 0),(0,a.default)(this,"_posterContainer",document.createElement("div")),(0,a.default)(this,"_widgetContainer",document.createElement("div")),(0,a.default)(this,"_loading",!0),(0,a.default)(this,"_audioOnly",!1),(0,a.default)(this,"_showPoster",void 0),(0,a.default)(this,"_poster",void 0),(0,a.default)(this,"_cancelBind",void 0),c(this),!1===/^(contain|cover)$/.test(f)&&r.warn(`Invalid fit value "${f}" passed. Only "contain" and "cover" can be used.`),this._widgetType=C,this._fitMode=f,this._insertDefaultUI=i;const R=T(this._widgetContainer);if(R.on("click",this.userGesture.bind(this)),R.on("touchstart",this.userGesture.bind(this),!!k&&{passive:!0}),this.once("destroy",()=>R.removeAll()),this._widgetContainer.classList.add("OT_widget-container"),this._widgetContainer.style.width="100%",this._widgetContainer.style.height="100%",!1!==i){this._container=S(e,b),N.isSafari&&N.isiOS&&N.iOSVersion&&N.iOSVersion<11.2&&this._container.classList.add("OT_ForceContain"),this._container.style.width=E(u),this._container.style.height=E(l),this._container.style.overflow="hidden",y(this._container),m&&w.addClass(this._container,"OT_mirrored"),g&&g.trim().split(/\s+/).forEach(e=>this._container.classList.add(e)),this._container.classList.add("OT_loading"),this._container.classList.add("OT_fit-mode-"+f),this._container.appendChild(this._widgetContainer);const t=w(this._container).observeSize(()=>y(this._container))[0],n=w.observeNodeOrChildNodeRemoval(this._container,e=>{if(!this._videoElementFacade)return;e.some(e=>e===this._widgetContainer||e===this._videoElementFacade.domElement())&&this.destroyVideo()});this.once("destroy",()=>{r.debug("disconnecting observers"),t.disconnect(),n.disconnect()})}this._posterContainer.classList.add("OT_video-poster"),this._widgetContainer.appendChild(this._posterContainer);const I=document.createElement("div");I.classList.add("OT_video-loading");const _=document.createElement("div");_.classList.add("OT_video-loading-spinner"),I.appendChild(_),this._widgetContainer.appendChild(I),v&&v.backgroundImageURI&&this.setBackgroundImageURI(v.backgroundImageURI)}var t=e.prototype;return t.addError=function(e,t,n){this._container&&(this._container.innerHTML=`<p>${e}${t?` <span class="ot-help-message">${t}</span>`:""}</p>`,w.addClass(this._container,n||"OT_subscriber_error"),this._container.querySelector("p").offsetHeight>this._container.offsetHeight&&(this._container.querySelector("span").style.display="none"))},t.destroy=function(){this.emit("destroy"),this.destroyVideo(),this._container&&(w.removeElement(this._container),this._container=null)},t.setBackgroundImageURI=function(e){w.css(this._posterContainer,"backgroundImage",`url(${e})`),w.css(this._posterContainer,"backgroundSize","contain"),w.css(this._posterContainer,"opacity","1.0")},t.isAudioBlocked=function(){return Boolean(this._videoElementFacade&&this._videoElementFacade.isAudioBlocked())},t.unblockAudio=function(){return this._videoElementFacade.unblockAudio()},t.userGesture=function(){this.isAudioBlocked()&&b().then(()=>r.debug("Successfully unblocked audio"),e=>r.error("Error retrying audio on user interaction:",e))},t.setAudioBlockedUi=function(e){this._container&&(e?this._container.classList.add("OT_container-audio-blocked"):this._container.classList.remove("OT_container-audio-blocked"))},t.rebindSrcObject=function(){this._videoElementFacade&&this._videoElementFacade._rebindSrcObject()},t.pauseAndPlayVideoElement=function(){this._videoElementFacade&&this._videoElementFacade._pauseAndPlay()},t._createVideoElementFacade=function(e){let t=e._inject,n=e.audioVolume,o=e.fallbackText,i=e.muted;this._videoElementFacade=new x({defaultAudioVolume:parseFloat(n),fallbackText:o,fitMode:this._fitMode,_inject:t,muted:i,widgetType:this._widgetType});const s=T(this._videoElementFacade);if(this._videoFacadeEvents=s,s.on("error",()=>{this.trigger("error")}),s.on("videoDimensionsChanged",(e,t)=>{this.trigger("videoDimensionsChanged",e,t)}),s.on("mediaStopped",e=>{this.trigger("mediaStopped",e)}),s.on("audioBlocked",()=>this.trigger("audioBlocked")),s.on("audioUnblocked",()=>this.trigger("audioUnblocked")),this._videoElementFacade.audioChannelType("telephony"),r.debug("Appending the video facade"),this._videoElementFacade.appendTo(this._widgetContainer),void 0!==n)try{this._videoElementFacade.setAudioVolume(n)}catch(e){r.warn("bindVideo "+e)}},t._bindToStream=function(){var e=(0,i.default)(o.default.mark((function e(t,n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._videoElementFacade.bindToStream(t);case 3:e.next=14;break;case 5:if(e.prev=5,e.t0=e.catch(0),!n.isCanceled()){e.next=12;break}throw r.debug("Refusing to destroyVideo as bindVideo was cancelled"),new m("CANCEL");case 12:throw this.destroyVideo(),e.t0;case 14:case"end":return e.stop()}}),e,this,[[0,5]])})));return function(t,n){return e.apply(this,arguments)}}(),t._getNewBindCancellation=function(){this._cancelBind&&(r.debug("Cancelling last bindVideo request"),this._cancelBind.cancel());const e=new h;return this._cancelBind=e,this.once("destroy",()=>e.cancel()),e},t._triggerVideoElementCreated=function(){const e=e=>{this.trigger("videoElementCreated",e),this._insertDefaultUI&&w.addClass(e,"OT_video-element")};this._videoElementFacade.domElement()?e(this._videoElementFacade.domElement()):this._videoFacadeEvents.on("videoElementCreated",t=>{e(t)})},t._waitForVideoResolution=function(){var e=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.audioOnly()&&"subscriber"===this._widgetType||!(t.getVideoTracks().length>0)){e.next=6;break}return r.debug("Waiting for correct resolution"),e.next=5,g(this._videoElementFacade,5e3);case 5:r.debug(`Resolution: ${this._videoElementFacade.videoWidth()}x${this._videoElementFacade.videoHeight()}`);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.bindVideo=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var i,s,a,c,u,d,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.audioVolume,s=n.muted,a=n.fallbackText,c=n._inject,r.debug("bindVideo ",{webRTCStream:t}),u=!!this._videoElementFacade,d=this._getNewBindCancellation(),u||this._createVideoElementFacade({_inject:c,audioVolume:i,fallbackText:a,muted:s}),e.next=7,this._bindToStream(t,d);case 7:return u||this._triggerVideoElementCreated(),Z(d),l=I(this._videoElementFacade,5e3),e.next=12,this._waitForVideoResolution(t);case 12:return r.debug("Waiting for video to be playing"),e.next=15,l;case 15:r.debug("Video is playing"),Z(d);case 17:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t.bindAudioTrackOnly=function(){this._videoElementFacade&&this._videoElementFacade.bindAudioTrackOnly()},t.destroyVideo=function(){this._videoElementFacade&&(this._videoElementFacade.destroy(),this._videoElementFacade=null)},t.video=function(){return this._videoElementFacade},t.showPoster=function(e){return void 0===e?!w.isDisplayNone(this._posterContainer):(this._showPoster=e,w[e?"show":"hide"](this._posterContainer),this.showPoster())},t.poster=function(e){return void 0===e?w.css(this._posterContainer,"backgroundImage"):(this._poster=e,w.css(this._posterContainer,"backgroundImage",`url(${e})`),this.poster())},t.loading=function(e){return void 0===e?this._loading:(this._loading=Boolean(e),this._container&&this._container.classList[e?"add":"remove"]("OT_loading"),this.loading())},t.audioOnly=function(e){return void 0===e?this._audioOnly:(this._audioOnly=e,this._container&&this._container.classList[e?"add":"remove"]("OT_audio-only"),this.audioOnly())},t.domId=function(){return this._container&&this._container.getAttribute("id")},t.setSinkId=function(e){if(this._videoElementFacade)return this._videoElementFacade.setSinkId(e)},(0,s.default)(e,[{key:"domElement",get:function(){return this._container}},{key:"videoElement",get:function(){return this._videoElementFacade&&this._videoElementFacade.domElement()||void 0}},{key:"width",get:function(){return this.videoElement&&this.videoElement.offsetWidth}},{key:"height",get:function(){return this.videoElement&&this.videoElement.offsetHeight}}]),e}()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationError=t.default=void 0;var r=i(n(647)),o=i(n(298));function i(e){return e&&e.__esModule?e:{default:e}}t.default=r.default,t.CancellationError=o.default},function(e,t,n){"use strict";(function(t){const r=n(21);e.exports=()=>t.all(r.subscribers.where().map(e=>{if(e.isAudioBlocked())return e._.unblockAudio()}))}).call(this,n(0))},function(e,t,n){"use strict";e.exports=e=>"P2P"===e?"RELAYED":"ROUTED"},function(e,t,n){"use strict";(function(t){var r=n(3),o=r(n(12)),i=r(n(13)),s=r(n(20));const a=n(57),c=n(148),u=n(7),d=n(56),l=n(62),p=n(275),f=n(48),h=n(50),m=n(666),b=n(19),g=n(259),v=n(195),y=n(166),S=y.CancellationError,E=y.default,T=n(2),C=n(676),w=n(307),R=n(75),I=n(26),_=n(6),x=n(106),O=n(126),N=n(27),k=n(74),Z=n(155),A=n(677),L=n(165)(),V=n(678),P=n(679),W=n(167),G=n(24)().getInputMediaDevices,M=n(680),D=n(269),X=n(306),j=n(681),U=n(682),F=n(290),Y=F.setVideoContentHint,B=F.getVideoContentHint,H=n(168);e.exports=function(e){void 0===e&&(e={});let r=e,y=(0,s.default)({},r);["processPubOptions"].forEach(e=>{c(y[e],e+" dependency must be injected into Publisher")});const F=y.AnalyticsHelper||N,J=y.calculateCapableSimulcastStreams||n(253),K=y.createChromeMixin||n(281)(),z=y.deviceHelpers||n(24)(),Q=y.EnvironmentLoader||n(146),q=y.Errors||n(4),$=y.Events||n(23)(),ee=y.ExceptionCodes||n(8),te=y.interpretPeerConnectionError||n(163)(),ne=y.IntervalRunner||k,re=y.logging||n(1)("Publisher"),oe=y.Microphone||n(291)(),ie=y.otError||n(11)(),se=y.OTErrorClass||n(22),ae=y.OTHelpers||n(5),ce=y.parseIceServers||n(100).parseIceServers,ue=y.PUBLISH_MAX_DELAY||n(267),de=y.PublisherPeerConnection||n(295)(),le=y.PublishingState||n(297)(),pe=y.StreamChannel||n(150),fe=y.systemRequirements||n(153),he=y.VideoOrientation||n(151)(),me=y.WidgetView||L,be=y.global||(void 0!==typeof window?window:global),ge=y.createSendMethod||n(304),ve=y.setEncodersActiveState||C,ye=y.MediaProcessor||n(683),Se=y.processPubOptions;return function(e){var n=this;void 0===e&&(e={});let r=_({});const c=new v,y=e=>c.get(e);_(this);const C=Z();let N,k,L,Ee,Te,Ce,we,Re,Ie,_e,xe,Oe,Ne=new F;fe.check()||fe.upgrade();let ke,Ze,Ae,Le=!1;const Ve={},Pe={};let We;let Ge,Me;const De=()=>this.session||Me||{isConnected:()=>!1},Xe=[],je=new ye;function Ue(){return{connectionId:De().isConnected()?De().connection.connectionId:null,streamId:k,widgetType:"Publisher"}}this.once("publishComplete",e=>{var t;e||(Le=!0,ke=(null==(t=this.session)?void 0:t.sessionInfo.p2pEnabled)?"P2P":"MANTIS")}),this.on("sourceStreamIdChanged",e=>{ke=e}),this.on("audioAcquisitionProblem",e=>{let t=e.method;pt("publisher:audioAcquisitionProblem","Event",{didPublishComplete:Le,method:t})});const Fe=e=>{const t=Object.keys(q).map(e=>q[e]),n=ie(t.indexOf(e.name)>-1?e.name:q.MEDIA_ERR_ABORTED,e,ee.UNABLE_TO_PUBLISH);re.error(`onStreamAvailableError ${n.name}: ${n.message}`),Ce.set("Failed"),N&&(N.destroy(),N=null);const r={failureReason:"GetUserMedia",failureCode:ee.UNABLE_TO_PUBLISH,failureMessage:"OT.Publisher failed to access camera/mic: "+n.message};ft("Failure",{},r),se.handleJsException({error:n,errorMsg:r.failureReason,code:r.failureCode,target:this,analytics:Ne}),this.trigger("publishComplete",n)},Ye=e=>{const t=d(e);t.code=ee.UNABLE_TO_PUBLISH,re.error("OT.Publisher.onScreenSharingError "+t.message),Ce.set("Failed"),t.message="Screensharing: "+t.message,this.trigger("publishComplete",t),ft("Failure",{},{failureReason:"ScreenSharing",failureMessage:t.message}),N&&(N.destroy(),N=null)},Be=e=>{const t=d(e);let n;try{n=window.self!==window.top}catch(e){}"https:"!==(void 0!==typeof window?window:global).location.protocol&&(rt?t.message+=" Note: https:// is required for screen sharing.":D()&&"localhost"!==ae.env.hostName&&(t.message+=` Note: ${ae.env.name} requires HTTPS for camera and microphone access.`)),n&&!rt&&(t.message+=" Note: Check that the iframe has the allow attribute for camera and microphone"),re.error(t.message),Ce.set("Failed"),t.message="OT.Publisher Access Denied: Permission Denied: "+t.message,t.code=ee.UNABLE_TO_PUBLISH,N&&(N.destroy(),N=null),ft("Cancel",{reason:"AccessDenied"}),this.trigger("publishComplete",t),this.dispatchEvent(new O(I.ACCESS_DENIED))},He=e=>{throw e.name===q.USER_MEDIA_ACCESS_DENIED||e.name===q.NOT_SUPPORTED&&e.originalMessage.match(/Only secure origins/)?Be(e):Se.isScreenSharing?Ye(e):Fe(e),e},Je=()=>{pt("accessDialog","Opened"),this.dispatchEvent(new O(I.ACCESS_DIALOG_OPENED,!0))},Ke=()=>{pt("accessDialog","Closed"),this.dispatchEvent(new O(I.ACCESS_DIALOG_CLOSED,!1))},ze=b(),Qe={};let qe=!1,$e={},et=!1,tt=Se(e,"OT.Publisher",()=>Ce&&Ce.isDestroyed());tt.on({accessDialogOpened:Je,accessDialogClosed:Ke});const nt=tt,rt=nt.isScreenSharing,ot=nt.isCustomAudioTrack,it=nt.isCustomVideoTrack,st=nt.shouldAllowAudio,at=nt.properties,ct=nt.getUserMedia;function ut(e){e.forEach(e=>e())}Object.defineProperty(this,"loudness",{writable:!1,value:void 0,configurable:!0});const dt=(e,t,n)=>e.addEventListener?(e.addEventListener(t,n),()=>e.removeEventListener(t,n)):()=>{};(function(){const e=[];r.on("streamDestroy",()=>ut(e)),r.on("streamChange",()=>{ut(e);const t=L.getAudioTracks().map(e=>dt(e,"ended",()=>{et=!0,this.trigger("audioAcquisitionProblem",{method:"trackEndedEvent"})}));e.splice(0,e.length,...t)})}).call(this),function(){const e=[];r.on("streamDestroy",()=>ut(e)),r.on("streamChange",()=>{ut(e),lt()||L.getTracks().forEach(t=>{t.addEventListener&&(e.push(dt(t,"mute",()=>{Bt()})),e.push(dt(t,"unmute",()=>{Bt()})))})})}();const lt=()=>{if(rt)return!0;const e=["text","detail"].includes(at.videoContentHint);return it&&e},pt=e.logAnalyticsEvent||((e,t,n,r,o)=>{let i=u({action:e,variation:t,payload:n},Ue(),r);"Failure"===t&&(i=u($e,i)),$e=f(i,"sessionId","connectionId","partnerId"),Ne.logEvent(i,o)}),ft=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n={}),"Non-fatal"!==n.failureReason&&("Attempt"===e&&(Re=(new Date).getTime(),Ge&&(Ge.stop(),re.error("_connectivityAttemptPinger should have been cleaned up")),Ge=new ne(()=>{pt("Publish","Attempting",t,(0,s.default)({},Ue(),n))},.2,6)),"Failure"===e||"Success"===e||"Cancel"===e?(Ge?(Ge.stop(),Ge=void 0):re.warn(`Received connectivity event: "${e}" without "Attempt"`),pt("Publish",e,(0,s.default)({videoInputDevices:_e,audioInputDevices:Ie,videoInputDeviceCount:_e?_e.length:void 0,audioInputDeviceCount:Ie?Ie.length:void 0,selectedVideoInputDeviceId:xe,selectedAudioInputDeviceId:Oe},t),(0,s.default)({attemptDuration:(new Date).getTime()-Re},n))):pt("Publish",e,t,n))},ht=(e,t)=>{pt("ICERestart",e,t)},mt=(e,t,n)=>{"Attempt"===t?(Ve[e]=(new Date).getTime(),pt(e,t,n)):"Failure"!==t&&"Success"!==t||pt(e,t,n,{attemptDuration:(new Date).getTime()-Ve[e]})},bt=function(e,t){void 0===t&&(t={}),mt("RoutedToRelayedTransition",e,t)},gt=function(e,t){void 0===t&&(t={}),mt("RelayedToRoutedTransition",e,t)},vt=h(()=>{pt("GetStats","Called")}),yt=h(()=>{pt("GetRtcStatsReport","Called")}),St=t=>{let n=t.parsedStats,r=t.simulcastEnabled,o=t.remoteConnectionId,i=t.peerId,s=t.sourceStreamId;const a={peerId:i,widgetType:"Publisher",connectionId:this.session&&this.session.isConnected()?this.session.connection.connectionId:null,streamId:k,width:N.width,height:N.height,audioTrack:L&&L.getAudioTracks().length>0,hasAudio:Yt(),publishAudio:at.publishAudio,videoTrack:L&&L.getVideoTracks().length>0,hasVideo:Ft(),publishVideo:at.publishVideo,audioSource:ot?"Custom":void 0,duration:Ee?Math.round(((new Date).getTime()-Ee.getTime())/1e3):0,remoteConnectionId:o,scalableVideo:r,sourceStreamId:H(s)};let c=(rt&&it?"Screen":rt&&e.videoSource)||it&&"Custom"||at.constraints.video&&"Camera"||null;p(c)&&(c=m(c)),a.videoSource=c;const d={videoWidth:this.videoWidth(),videoHeight:this.videoHeight()},l=u({},a,n,d);Ne.logQOS(l),this.trigger("qos",l)},Et=()=>{let e,t;const n=N&&N.video();return at.videoDimensions?(e=Math.min(at.videoDimensions.width,n&&n.videoWidth()||640),t=Math.min(at.videoDimensions.height,n&&n.videoHeight()||480)):(e=n&&n.videoWidth()||640,t=n&&n.videoHeight()||480),{width:e,height:t}},Tt=()=>{Ce.isDestroyed()?N&&N.destroyVideo():(re.debug("OT.Publisher.onLoaded; resolution:",`${this.videoWidth()}x${this.videoHeight()}`),Ce.set("MediaBound"),W().catch(re.error),N.loading(!!this.session&&!this.stream),qe=!0)},Ct=e=>{const t=ie(q.CONNECT_FAILED,e,ee.P2P_CONNECTION_FAILED);t.message="OT.Publisher PeerConnection Error: "+t.message,ft("Failure",{},{failureReason:"PeerConnectionError",failureCode:t.code,failureMessage:t.message}),Ce.set("Failed"),this.trigger("publishComplete",t),se.handleJsException({error:t,target:this,analytics:Ne})},wt=()=>{L&&(r.emit("streamDestroy"),be.MediaStreamTrack&&be.MediaStreamTrack.prototype.stop?L.getTracks().forEach(e=>e.stop()):L.stop())},Rt=()=>{const e=T.isiOS&&T.iOSVersion>=15,t=L.getVideoTracks()[0];if(!e||!t)return;document.addEventListener("visibilitychange",()=>{!document.hidden&&N&&N.rebindSrcObject()})},It=()=>{const e=T.isiOS&&T.iOSVersion>=13.3,t=L.getAudioTracks()[0];e&&t&&(t.onmute=()=>vn(t),t.onunmute=()=>yn(t))},_t=function(){var e=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t={muted:!0},N){e.next=3;break}throw new Error("Cannot bind video after widget view has been destroyed");case 3:return e.abrupt("return",N.bindVideo(L,t));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),xt=function(){var e=(0,i.default)(o.default.mark((function e(t){var i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.debug("OT.Publisher.onStreamAvailable"),Ce.set("BindingMedia"),void 0!==at.videoContentHint&&Y(t,at.videoContentHint),wt(),L=t,!at.videoFilter){e.next=14;break}return e.prev=6,e.next=9,n.applyVideoFilter(at.videoFilter);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),re.error("Error applying video filter: "+e.t0);case 14:r.emit("streamChange"),It(),Rt(),xe=(i=(e,t)=>{let n;return e.forEach(e=>{if(e.deviceId)n=e.deviceId.toString();else if(e.label&&t){const r=l(t,t=>t.label===e.label);r&&(n=r.deviceId)}}),n})(L.getVideoTracks(),_e),Oe=i(L.getAudioTracks(),Ie),Te=new oe(L,!at.publishAudio),sn(),nn(),n.accessAllowed=!0,n.dispatchEvent(new O(I.ACCESS_ALLOWED,!1));case 25:case"end":return e.stop()}}),e,null,[[6,11]])})));return function(t){return e.apply(this,arguments)}}(),Ot=e=>{let t,n;re.error("OT.Publisher.onPublishingTimeout"),et?(t=q.CHROME_MICROPHONE_ACQUISITION_ERROR,n="Unable to publish because your browser failed to get access to your microphone. You may need to fully quit and restart your browser to get it to work. See https://bugs.chromium.org/p/webrtc/issues/detail?id=4799 for more details."):(t=q.TIMEOUT,n="Could not publish in a reasonable amount of time");const r={failureReason:"ICEWorkflow",failureCode:ee.UNABLE_TO_PUBLISH,failureMessage:"OT.Publisher failed to publish in a reasonable amount of time (timeout)"};ft("Failure",{},r),se.handleJsException({errorMsg:r.failureReason,code:r.failureCode,target:this,analytics:Ne}),e.isConnected()&&this.streamId&&e._.streamDestroy(this.streamId),this.disconnect(),this.session=null,Ce.isDestroyed()||Ce.set("MediaBound"),this.trigger("publishComplete",ie(t,new Error(n),ee.UNABLE_TO_PUBLISH))},Nt=e=>{const t=ie(q.MEDIA_ERR_DECODE,e,ee.UNABLE_TO_PUBLISH);t.message="OT.Publisher while playing stream: "+t.message,re.error("OT.Publisher.onVideoError:",t),pt("stream",null,{reason:t.message});const n=Ce.isAttemptingToPublish();Ce.set("Failed"),n?this.trigger("publishComplete",t):this.trigger("error",t.message),se.handleJsException({error:t,target:this,analytics:Ne})};this._setWebRTCStream=e=>{L=e},this._setCurrentVideoFilter=e=>{un=e},this._getCurrentVideoFilter=()=>un,this._removePeerConnection=e=>{const t=y(e).peerConnectionId;delete Qe[t],e.destroy()},this._removeSubscriber=e=>{this.session.sessionInfo.isAdaptiveEnabled&&"P2P"===ke&&this._.startRelayedToRoutedTransition(),Wt(e).then(e=>{e.forEach(e=>this._removePeerConnection(e))})};const kt=e=>{const t=y(e),n=t.remoteSubscriberId,r=t.peerConnectionId;re.debug("Subscriber has been disconnected from the Publisher's PeerConnection"),pt("disconnect","PeerConnection",{subscriberConnection:r}),this._removeSubscriber(n)},Zt=function(){var e=(0,i.default)(o.default.mark((function e(t,r){var i,s,a,c,u,d,l,p,f,h;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r.reason,s=r.prefix,a=n.session&&n.session.sessionInfo,!("ICEWorkflow"===s&&a&&a.reconnection&&qe)){e.next=5;break}return re.debug("Ignoring peer connection failure due to possibility of reconnection."),e.abrupt("return");case 5:return c=y(t)||{},u=c.remoteConnectionId,d=void 0===u?"(not found)":u,l=c.peerConnectionId,p=te(void 0,i,s,d,"Publisher"),f={hasRelayCandidates:t&&t.hasRelayCandidates()},h={failureReason:s||"PeerConnectionError",failureCode:p.code,failureMessage:p.message},Ce.isPublishing()?h.reason="Non-fatal":n.trigger("publishComplete",p),ft("Failure",f,h),se.handleJsException({errorMsg:"OT.Publisher PeerConnection Error: "+i,code:p.code,target:n,analytics:Ne}),e.next=14,Qe[l];case 14:e.sent.destroy(),delete Qe[l];case 17:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),At=e=>this.session.sessionInfo.isAdaptiveEnabled&&"P2P"===e.getSourceStreamId(),Lt=function(){var e=(0,i.default)(o.default.mark((function e(t,r){var i,s,a,c,u,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.session.sessionInfo.isAdaptiveEnabled,s=r.getSourceStreamId(),Pe[s]=t,"disconnected"===t&&setTimeout(()=>{const e=n.session._.isSocketReconnecting,t=n.session._.getSocket().is("connected")&&!e();if("disconnected"===Pe[s]&&t){const e=y(r).remoteConnectionId;ht("Attempt",{remoteConnectionId:e}),r.iceRestart()}},2e3),"connected"!==t){e.next=14;break}if(clearTimeout(We),!i){e.next=14;break}return e.next=9,Dt();case 9:return a=e.sent.iceConnectionStateIsConnected(),e.next=12,Xt();case 12:c=e.sent.iceConnectionStateIsConnected(),a&&c&&Kt();case 14:if("failed"!==t){e.next=21;break}if(u=n.session._.isSocketReconnecting,d=n.session._.getSocket(),d.is("connected")&&!u()){e.next=20;break}return e.abrupt("return");case 20:i&&s===ke&&"P2P"===s?n._.startRelayedToRoutedTransition():We=setTimeout(()=>{n.session._.streamDestroy(n.streamId,s)},5e3);case 21:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Vt=n=>{let r=n.peerConnectionId,o=n.send,i=n.log,s=n.logQoS,a=n.sourceStreamId;if(Gt(r))return t.reject(new Error("PeerConnection already exists"));const c=J({isChromiumEdge:ae.env.isChromiumEdge,browserName:ae.env.name,isScreenSharing:rt,isCustomVideoTrack:it,sessionInfo:this.session.sessionInfo,constraints:at.constraints,videoDimensions:Et(),capableSimulcastScreenshare:at.capableSimulcastScreenshare});return Qe[r]=t.all([this.session._.getIceConfig(),this.session._.getVideoCodecsCompatible(L)]).then(n=>{let r=n[0],u=n[1],d=L;if(!u){d=L.clone();const e=d.getVideoTracks()[0];e&&(e.stop(),d.removeTrack(e))}const l=new de({iceConfig:r,sendMessage:(e,t)=>{"offer"===e&&this.trigger("connected"),o(e,t)},webRTCStream:d,channels:at.channels,capableSimulcastStreams:c,overrideSimulcastEnabled:e._enableSimulcast,logAnalyticsEvent:i,offerOverrides:{enableDtx:at.enableDtx,enableStereo:at.enableStereo,audioBitrate:at.audioBitrate,priorityVideoCodec:at._priorityVideoCodec||this.session.sessionInfo.priorityVideoCodec,codecFlags:at._codecFlags||this.session._.getCodecFlags()},answerOverrides:this.session.sessionInfo.p2pEnabled?void 0:{audioBitrate:at.audioBitrate},sourceStreamId:a,isP2pEnabled:this.session.sessionInfo.p2pEnabled});return l.on({disconnected:()=>kt(l),error:e=>{let t=e.reason,n=e.prefix;return Zt(l,{reason:t,prefix:n})},qos:s,iceRestartSuccess:()=>(e=>{const t=y(e).remoteConnectionId;ht("Success",{remoteConnectionId:t})})(l),iceRestartFailure:()=>(e=>{const t=y(e).remoteConnectionId;ht("Failure",{reason:"ICEWorkflow",message:"OT.Publisher PeerConnection Error: The stream was unable to connect due to a network error. Make sure your connection isn't blocked by a firewall.",remoteConnectionId:t})})(l),iceConnectionStateChange:e=>Lt(e,l),audioAcquisitionProblem:()=>{et=!0,this.trigger("audioAcquisitionProblem",{method:"getStats"})}}),l.once("connected",()=>(e=>{At(e)&&bt("Success")})(l)),new t((e,t)=>{const n=e=>{t(e)};l.once("error",n),l.init(we,r=>{if(r)return t(r);l.off("error",n),e(l)})})}),Gt(r)},Pt=()=>t.all(Object.keys(Qe).map(Gt)),Wt=e=>Pt().then(t=>t.filter(t=>y(t).remoteSubscriberId===e)),Gt=e=>Qe[e],Mt=e=>{const t=Object.keys(Qe).find(t=>t.endsWith("~"+e));return Qe[t]},Dt=()=>Mt("MANTIS"),Xt=()=>Mt("P2P");let jt=K(this,{name:at.name,publishAudio:at.publishAudio,publishVideo:at.publishVideo,audioSource:at.audioSource,showControls:at.showControls,shouldAllowAudio:st,logAnalyticsEvent:pt});const Ut=()=>{this.off("publishComplete",Bt),jt&&jt.reset(),C.releaseAll(),this.disconnect(),Te=null,wt(),L=null,N&&(N.destroy(),N=null),this.session&&this._.unpublishFromSession(this.session,"reset"),this.id=null,this.stream=null,qe=!1,this.session=null,Ce.isDestroyed()||Ce.set("NotPublishing")},Ft=()=>{if(!L||0===L.getVideoTracks().length)return!1;const e=["text","detail"].includes(at.videoContentHint),t=it&&e,n=ae.env.isChrome&&(rt||t);return L.getVideoTracks().reduce((e,t)=>e&&(!t.muted||!!n)&&t.enabled&&"ended"!==t.readyState,at.publishVideo)},Yt=()=>!(!L||0===L.getAudioTracks().length)&&(L.getAudioTracks().length>0&&L.getAudioTracks().reduce((e,t)=>e&&!t.muted&&t.enabled&&"ended"!==t.readyState,at.publishAudio)),Bt=e=>{N&&(N.audioOnly(!Ft()),N.showPoster(!Ft())),jt&&jt.setAudioOnly(!Ft()&&Yt()),this.stream?(this.stream.setChannelActiveState("audio",Yt(),e),this.stream.setChannelActiveState("video",Ft(),e)):this.once("publishComplete",Bt)},Ht=(e,n)=>{let r=!1;if("function"==typeof e?n=e:r="rtcStatsReport"===e,r?yt():vt(),!r||X)Pt().then(e=>{if(0===e.length){const e=ee.PEER_CONNECTION_NOT_CONNECTED;throw ie(q.PEER_CONNECTION_NOT_CONNECTED,new Error(se.getTitleByCode(e)),e)}return e}).then(e=>this.session.sessionInfo.isAdaptiveEnabled?e.filter(e=>e.getSourceStreamId()===ke):e).then(e=>t.all(e.map(e=>w(r?e.getRtcStatsReport.bind(e):e.getStats.bind(e))().then(t=>({pc:e,stats:t}))))).then(e=>{const t=Ee?Ee.getTime():Date.now(),o=e.map(e=>{let n=e.pc,o=e.stats;const i=y(n),s=i.remoteConnectionId,a=i.remoteSubscriberId;return u(s.match(/^symphony\./)?{}:{subscriberId:a,connectionId:s},r?{rtcStatsReport:o}:{stats:R.normalizeStats(o,!1,t)})});n(null,o)}).catch(n);else{const e=ee.GET_RTC_STATS_REPORT_NOT_SUPPORTED;n(ie(q.GET_RTC_STATS_REPORT_NOT_SUPPORTED,new Error(se.getTitleByCode(e)),e))}},Jt=(e,t)=>{this.session._.streamCreate(at.name||"",this.streamId,at.audioFallbackEnabled,Xe,at.minVideoBitrate,e,t)},Kt=function(){var e=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ae=!1,e.next=3,Dt();case 3:if(!(t=e.sent)){e.next=16;break}return n.trigger("sourceStreamIdChanged","P2P"),e.next=8,x(3e3);case 8:if(!Ae){e.next=11;break}return re.debug("Cancelling stop sending RTP to MANTIS."),e.abrupt("return");case 11:return e.next=13,t.changeMediaDirectionToInactive();case 13:if(!(ae.env.isFirefox&&ae.env.version<96)){e.next=16;break}return e.next=16,Qt();case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),zt=function(){var e=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ae=!0,e.next=3,Dt();case 3:if(!(t=e.sent)){e.next=9;break}return e.next=7,t.changeMediaDirectionToRecvOnly();case 7:Ze&&clearTimeout(Ze),n.trigger("sourceStreamIdChanged","MANTIS");case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Qt=function(){var e=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Dt();case 2:(t=e.sent)&&(Ze=setTimeout((0,i.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("P2P"!==ke){e.next=9;break}return e.next=3,t.changeMediaDirectionToRecvOnly();case 3:return e.next=5,x(3e3);case 5:return e.next=7,t.changeMediaDirectionToInactive();case 7:return e.next=9,Qt();case 9:case"end":return e.stop()}}),e)}))),3e4));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();this.publish=e=>(re.debug("OT.Publisher: publish"),(Ce.isAttemptingToPublish()||Ce.isPublishing())&&Ut(),Ce.set("GetUserMedia"),at.style&&this.setStyle(at.style,null,!0),at.classNames="OT_root OT_publisher",Q.onLoad(()=>{re.debug("OT.Publisher: publish: environment loaded"),N=new me(e,(0,s.default)({},at,{widgetType:"publisher"})),st&&V({publisher:this,widgetView:N}),N.on("error",Nt),this.id=N.domId(),this.element=N.domElement,this.element&&jt&&jt.init(N),N.on("videoDimensionsChanged",(e,t)=>{this.stream&&this.stream.setVideoDimensions(t.width,t.height),this.dispatchEvent(new $.VideoDimensionsChangedEvent(this,e,t))}),N.on("mediaStopped",e=>{const t=new $.MediaStoppedEvent(this,e);if(this.dispatchEvent(t),!t.isDefaultPrevented())if(e){const t=String(e.kind).toLowerCase();"audio"===t?nn():"video"===t?sn():re.warn("Track with invalid kind has ended: "+e.kind)}else this.session?this._.unpublishFromSession(this.session,"mediaStopped"):this.destroy("mediaStopped")}),N.on("videoElementCreated",e=>{const t=new $.VideoElementCreatedEvent(e);this.dispatchEvent(t)}),ct().catch(He).then(function(){var e=(0,i.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie=tt.audioDevices,_e=tt.videoDevices,(r=!!at.videoFilter)&&(cn=j(t,_e)),e.next=6,xt(t);case 6:return at.publishVideo||n._toggleVideo(at.publishVideo),rt||it||r||(cn=j(t,_e)),e.abrupt("return",_t().catch(e=>{if(!(e instanceof S))throw e}).then(()=>{Tt(),Ce.isDestroyed()||(n.trigger("initSuccess"),n.trigger("loaded",n))},e=>{re.error("OT.Publisher.publish failed to bind video: "+e),Ct(e)}));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}),this),this._setScalableValues=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pt().then(e=>e[0].getSenders().filter(e=>"video"===e.track.kind));case 2:return r=e.sent,i=r[0],(s=i.getParameters()).encodings.forEach((e,r)=>{e[t]=n[r]}),e.next=8,i.setParameters(s);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),this._setScalableFramerates=function(){var e=(0,i.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=en(t))||!qt(r)){e.next=4;break}return e.next=4,n._setScalableValues("maxFramerate",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this._setScalableVideoLayers=function(){var e=(0,i.default)(o.default.mark((function e(t){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=en(t))||!$t(r)){e.next=4;break}return e.next=4,n._setScalableValues("scaleResolutionDownBy",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();const qt=e=>{let t=0;return e.every(e=>!(15!==e&&30!==e||e<t)&&(t=e,!0))},$t=e=>{let t=17;return e.every(e=>!(e<1||e>=t)&&(t=e,!0))},en=e=>{let t;if("string"!=typeof e)return t;const n=e.split(":");return 0===n.length||n.length>3?t:n.every(e=>!isNaN(e))?(t=n.map(e=>parseInt(e,10)).reverse(),t):t},tn=e=>L&&L[`get${g(e)}Tracks`]().length>0&&L[`get${g(e)}Tracks`]().every(e=>"ended"!==e.readyState),nn=e=>{const t=tn("audio")&&at.publishAudio;jt&&jt.setMuted(!t),Te&&Te.muted(!t),Bt(e)};let rn;this.publishAudio=e=>{pt("publishAudio","Attempt",{publishAudio:e}),at.publishAudio=e;try{nn(),pt("publishAudio","Success",{publishAudio:e})}catch(e){pt("publishAudio","Failure",{message:e.message})}return this};let on=!1;const sn=()=>{const e=tn("video")&&at.publishVideo;"Chrome"===T.name&&T.version>=69&&(0,i.default)(o.default.mark((function t(){var n,r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return rn&&rn.cancel(),rn=new E,n=rn,t.next=5,Pt();case 5:r=t.sent,n.isCanceled()||r.forEach(t=>{ve(t,e)});case 7:case"end":return t.stop()}}),t)})))(),L&&L.getVideoTracks().forEach(t=>{t.enabled=e,t.isCreatedCanvas&&(t.enabled=!1)}),Bt()},an=function(){var e=(0,i.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return je.getOriginalVideoTrack().stop(),e.next=3,je.destroy();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();let cn,un;this._toggleVideo=P(function(){var e=(0,i.default)(o.default.mark((function e(t){var n,i,s,a,c,u,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(rt||it||on)){e.next=2;break}return e.abrupt("return");case 2:if(n=hn()){e.next=5;break}throw ie(q.NOT_SUPPORTED,new Error("Publisher._toggleVideo cannot toggleVideo when you have no video source."));case 5:if("ended"!==n.readyState){e.next=8;break}return on=!0,e.abrupt("return");case 8:i=at.videoDimensions,s=void 0===i?Et():i,e.prev=9,a=M(s),e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(9),e.abrupt("return");case 16:return e.next=18,mn();case 18:if(c=e.sent,t&&ae.env.isAndroid&&ae.env.isChrome&&n&&n.stop&&n.stop(),t){e.next=27;break}try{cn=c.find(e=>e.label===n.label).deviceId}catch(e){}if(!(u=je.getVideoFilter())){e.next=27;break}return un=u,e.next=27,an();case 27:if(!cn||-1!==c.findIndex(e=>e.deviceId===cn)){e.next=29;break}throw ie(q.NO_DEVICES_FOUND,new Error("Previous device no longer available - deviceId not found"));case 29:if(r.emit("streamDestroy"),d=a,!t){e.next=43;break}return e.next=34,fn(cn);case 34:if(d=e.sent,!un){e.next=43;break}return e.next=38,je.setVideoFilter(un);case 38:return e.next=40,je.setMediaStream(L);case 40:return e.next=42,je.setVideoTrack(d);case 42:d=e.sent;case 43:return e.prev=43,e.next=46,pn(n,d);case 46:e.next=51;break;case 48:throw e.prev=48,e.t1=e.catch(43),e.t1;case 51:case"end":return e.stop()}}),e,null,[[9,13],[43,48]])})));return function(t){return e.apply(this,arguments)}}()),this.publishVideo=e=>{pt("publishVideo","Attempt",{publishVideo:e}),at.publishVideo=e;try{this._toggleVideo(at.publishVideo),sn(),pt("publishVideo","Success",{publishVideo:e})}catch(e){pt("publishVideo","Failure",{message:e.message})}return this},this.setVideoContentHint=e=>Y(L,e),this.getVideoContentHint=()=>B(L),this.destroy=function(e,t){return Ce.isAttemptingToPublish()&&this.session&&ft("Cancel",{reason:"destroy"}),Ce.isDestroyed()||(Ce.set("Destroyed"),Ut(),tt&&(tt.off(),tt=null),jt&&(jt.destroy(),jt=null),r&&(r.off(),r=null),!0!==t&&this.dispatchEvent(new $.DestroyedEvent(I.PUBLISHER_DESTROYED,this,e)),this.off()),this},this.disconnect=()=>{Object.keys(Qe).forEach(e=>{const t=Gt(e);delete Qe[e],t.then(e=>this._removePeerConnection(e))})},this.processMessage=(e,t,n)=>{const r=a(n,"params.subscriber",t).replace(/^INVALID-STREAM$/,t),o=a(n,"content.peerId"),i=a(n,"content.sourceStreamId","MANTIS"),u=`${r}~${o}~${i}`;re.debug(`OT.Publisher.processMessage: Received ${e} from ${t} for ${u}`),re.debug(n);const d=Gt(u),l=()=>{const a=ge({socket:this.session._.getSocket(),uri:n.uri,content:{peerId:o,sourceStreamId:i}});Vt({peerConnectionId:u,send:a,log:function(e,t,n,r,a){void 0===r&&(r={});const c=(0,s.default)({peerId:o,sourceStreamId:H(i)},r);return pt(e,t,n,c,a)},logQoS:e=>{i===ke&&St((0,s.default)({},e,{peerId:o,remoteConnectionId:t,sourceStreamId:i}))},sourceStreamId:i}).then(s=>(((e,t)=>{c.set(e,t)})(s,{remoteConnectionId:t,remoteSubscriberId:r,peerId:o,sourceStreamId:i,peerConnectionId:u}),s.processMessage(e,n),null)).catch(e=>{re.error("OT.Publisher failed to create a peerConnection",e)})},p=this.session.sessionInfo.isAdaptiveEnabled;switch(e){case"unsubscribe":this._removeSubscriber(r);break;default:if(d)d.then(t=>t.processMessage(e,n));else{if(p&&Xt())return;l()}}},this.getImgData=function(){if(!qe)return re.error("OT.Publisher.getImgData: Cannot getImgData before the Publisher is publishing."),null;const e=N&&N.video();return e?e.imgData():null};const dn=e=>{e.getSenders().forEach(e=>"audio"===e.track.kind&&L.getAudioTracks().length?e.replaceTrack(L.getAudioTracks()[0]):"video"===e.track.kind&&L.getVideoTracks().length?e.replaceTrack(L.getVideoTracks()[0]):void 0)},ln=function(e){return void 0===e&&(e=dn),Pt().then(n=>(n.map(e),t.all([])))};{let e=0;const t=function(){var t=(0,i.default)(o.default.mark((function t(){var n,i,s,a;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!ae.env.isLegacyEdge&&be.RTCRtpSender&&"function"==typeof be.RTCRtpSender.prototype.replaceTrack){t.next=2;break}throw ie(q.UNSUPPORTED_BROWSER,new Error("Publisher#cycleVideo is not supported in your browser."),ee.UNABLE_TO_PUBLISH);case 2:if(!it&&!rt){t.next=4;break}throw ie(q.NOT_SUPPORTED,new Error("Publisher#cycleVideo: The publisher is not using a camera video source"));case 4:if(n=hn()){t.next=7;break}throw ie(q.NOT_SUPPORTED,new Error("Publisher#cycleVideo cannot cycleVideo when you have no video source."));case 7:return e+=1,t.next=10,mn();case 10:if(i=t.sent,i.filter(e=>e.label!==n.label).length>0)for(;i[e%i.length].label===n.label;)e+=1;return r.emit("streamDestroy"),s=i[e%i.length],a=s.deviceId,t.next=18,Cn(a);case 18:return t.abrupt("return",cn);case 19:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();this.cycleVideo=P((0,i.default)(o.default.mark((function e(){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t();case 3:n=e.sent,e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(0),re.error("Publisher#cycleVideo: could not cycle video: "+e.t0),e.t0;case 10:return e.abrupt("return",{deviceId:n});case 11:case"end":return e.stop()}}),e,null,[[0,6]])}))))}const pn=function(){var e=(0,i.default)(o.default.mark((function e(i,s){var a,c,u;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pt();case 2:return a=e.sent,e.next=5,t.all(a.map(e=>e.findAndReplaceTrack(i,s)));case 5:if(L.addTrack(s),L.removeTrack(i),i&&i.stop){try{c=s instanceof MediaStreamTrackGenerator}catch(e){c=!1}c||i.stop()}"Firefox"!==ae.env.name&&"Safari"!==ae.env.name||(n.videoElement().srcObject=null,n.videoElement().srcObject=L),(u=N&&N.video())&&u.refreshTracks(),r.emit("streamChange"),sn();case 13:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),fn=function(){var t=(0,i.default)(o.default.mark((function t(n){var r,i,s;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=d(e)).audioSource=null,r.videoSource=n,tt=Se(r,"OT.Publisher.getTrackFromDeviceId",()=>Ce&&Ce.isDestroyed()),tt.on({accessDialogOpened:Je,accessDialogClosed:Ke}),i=tt.getUserMedia,t.prev=6,t.next=9,i();case 9:s=t.sent,t.next=15;break;case 12:t.prev=12,t.t0=t.catch(6),re.error(t.t0);case 15:return t.abrupt("return",s&&s.getVideoTracks()[0]);case 16:case"end":return t.stop()}}),t,null,[[6,12]])})));return function(e){return t.apply(this,arguments)}}(),hn=()=>L.getVideoTracks()[0],mn=function(){var e=(0,i.default)(o.default.mark((function e(){var t,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z.shouldAskForDevices();case 2:if(t=e.sent,n=t.videoDevices,t.video&&n&&n.length){e.next=6;break}throw ie(q.NO_DEVICES_FOUND,new Error("No video devices available"),ee.UNABLE_TO_PUBLISH);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),bn=(e,t)=>{t&&L.addTrack(t),e&&L.removeTrack(e);const n=N&&N.video();n&&n.refreshTracks(),jt&&(t&&!e&&jt.addAudioTrack(),e&&!t&&jt.removeAudioTrack()),e&&e.stop&&e.stop(),t&&(nn(),Te=new oe(L,!at.publishAudio)),r.emit("streamChange"),Bt()},gn=function(){var e=(0,i.default)(o.default.mark((function e(t){var r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.getSettings().deviceId,e.prev=1,e.next=4,n.setAudioSource(r);case 4:(i=L.getAudioTracks()[0])&&(i.onmute=()=>vn(i),i.onunmute=()=>yn(i)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),re.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),vn=e=>{let t=!1;at.publishVideo&&document.hidden&&(t=!0,this.publishVideo(!1));const r=function(){var s=(0,i.default)(o.default.mark((function i(){return o.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(document.hidden){o.next=5;break}return o.next=3,gn(e);case 3:t&&n.publishVideo(!0),document.removeEventListener("visibilitychange",r);case 5:case"end":return o.stop()}}),i)})));return function(){return s.apply(this,arguments)}}();document.addEventListener("visibilitychange",r)},yn=e=>{Yt()&&(Ft()?this.videoElement().pause():gn(e)),this.session.trigger("gsmCallEnded")};let Sn;const En=function(){var r=(0,i.default)(o.default.mark((function r(i){var s,a,c,u,l,p,f,h,m,b,g,v;return o.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(s="Operation did not succeed due to a new request.",Sn&&Sn.cancel(),Sn=new E,a=Sn,c=e=>{if(a.isCanceled())throw e.getTracks(e=>e.stop()),ie(q.CANCEL,new Error(s));return En(e.getAudioTracks()[0])},!ae.env.isLegacyEdge&&be.RTCRtpSender&&"function"==typeof be.RTCRtpSender.prototype.replaceTrack){r.next=7;break}throw ie(q.UNSUPPORTED_BROWSER,new Error("Publisher#setAudioSource is not supported in your browser."));case 7:if(u=n.getAudioSource()){r.next=10;break}throw ie(q.NOT_SUPPORTED,new Error("Publisher#setAudioSource cannot add an audio source when you started without one."));case 10:if(!(i instanceof MediaStreamTrack)){r.next=21;break}return r.next=13,Pt();case 13:if(l=r.sent,!a.isCanceled()){r.next=16;break}throw ie(q.CANCEL,new Error(s));case 16:return r.next=18,t.all(l.map(e=>e.findAndReplaceTrack(u,i)));case 18:return r.abrupt("return",bn(u,i));case 21:if("string"!=typeof i){r.next=68;break}return(p=d(e)).audioSource=i,p.videoSource=null,tt=Se(p,"OT.Publisher.setAudioSource",()=>a.isCanceled()||Ce&&Ce.isDestroyed()),tt.on({accessDialogOpened:Je,accessDialogClosed:Ke}),f=u.label,h=u.getConstraints&&u.getSettings().deviceId||void 0,u&&u.stop(),m=tt.getUserMedia,r.prev=31,r.t0=c,r.next=35,m();case 35:return r.t1=r.sent,r.next=38,(0,r.t0)(r.t1);case 38:return r.abrupt("return",r.sent);case 41:if(r.prev=41,r.t2=r.catch(31),!a.isCanceled()){r.next=45;break}throw ie(q.CANCEL,new Error(s));case 45:if((b=d(e)).videoSource=null,b.audioSource=h,b.audioSource||!f){r.next=55;break}return r.next=51,G();case 51:if(g=r.sent.find(e=>e.label===f),!a.isCanceled()){r.next=54;break}throw ie(q.CANCEL,new Error(s));case 54:g&&(b.audioSource=g.deviceId);case 55:if(b.audioSource){r.next=58;break}throw r.t2.message+=" (could not determine previous audio device)",ie(q.NOT_FOUND,r.t2);case 58:return tt=Se(b,"OT.Publisher.setAudioSource",()=>a.isCanceled()||Ce&&Ce.isDestroyed()),r.next=61,tt.getUserMedia().catch(e=>{throw e.message+=" (could not obtain previous audio device)",e});case 61:return v=r.sent,r.next=64,c(v);case 64:throw r.t2.message+=" (reverted to previous audio device)",r.t2;case 66:r.next=69;break;case 68:throw ie(q.INVALID_PARAMETER,new Error("Invalid parameter passed to OT.Publisher.setAudioSource(). Expected string or MediaStreamTrack."));case 69:case"end":return r.stop()}}),r,null,[[31,41]])})));return function(e){return r.apply(this,arguments)}}();this.setAudioSource=En,this.getAudioSource=()=>L&&L.getAudioTracks().length>0?L.getAudioTracks()[0]:null;const Tn=function(){var e=(0,i.default)(o.default.mark((function e(t){var n,r,i,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ie(q.INVALID_VIDEO_SOURCE,new Error("Invalid video source. Video source must be a valid video input deviceId"),1041),r=ie(q.SET_VIDEO_SOURCE_FAILURE,new Error("You cannot reset the video source on a publisher that does not currently use a camera source."),1040),!ae.env.isLegacyEdge&&be.RTCRtpSender&&"function"==typeof be.RTCRtpSender.prototype.replaceTrack){e.next=4;break}throw ie(q.UNSUPPORTED_BROWSER,new Error("setVideoSource is not supported in your browser."),ee.UNABLE_TO_PUBLISH);case 4:if("string"==typeof t){e.next=6;break}throw n;case 6:if(i=!L||0===L.getVideoTracks().length,!(it||rt||i)){e.next=9;break}throw r;case 9:return e.next=11,G();case 11:if(s=e.sent,s.find(e=>"videoInput"===e.kind&&e.deviceId===t)){e.next=15;break}throw n;case 15:return e.next=17,Cn(t);case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();this.setVideoSource=Tn;const Cn=function(){var e=(0,i.default)(o.default.mark((function e(t){var n,r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=cn,cn=t,at.publishVideo){e.next=4;break}return e.abrupt("return");case 4:return r=hn(),at.publishVideo&&ae.env.isAndroid&&(ae.env.isChrome||ae.env.isFirefox)&&r&&r.stop&&r.stop(),e.prev=6,e.next=9,fn(t);case 9:i=e.sent,e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(6),cn=n,re.error(e.t0),e.abrupt("return");case 17:if(i){e.next=20;break}return console.warn("Unable to aquire video track. Moving to next device."),e.abrupt("return");case 20:if(!un){e.next=24;break}return e.next=23,je.setVideoTrack(i);case 23:i=e.sent;case 24:return e.next=26,pn(r,i);case 26:at.publishVideo&&(on=!1);case 27:case"end":return e.stop()}}),e,null,[[6,12]])})));return function(t){return e.apply(this,arguments)}}();var wn;this.getVideoSource=()=>{const e={},t=!L||0===L.getVideoTracks().length;return e.track=L&&at.publishVideo&&L.getVideoTracks()[0]||null,e.deviceId=rt||it||!cn?null:cn,e.type=it?"custom":rt?"screen":t?null:"camera",e},this._={publishToSession:(e,n)=>{n&&(Ne=n),Me=e,this.session=e;const r=b();k=r,this.streamId=r,ft("Attempt",{dataChannels:at.channels,properties:A(at)});const o=new t((e,t)=>{qe?e():(this.once("initSuccess",e),this.once("destroyed",e=>{let n=e.reason,r="";n&&(r=" Reason: "+n),t(new Error("Publisher destroyed before it finished loading."+r))}))});re.debug("publishToSession: waiting for publishComplete, which is triggered by stream#created from rumor");const i=new t((e,t)=>{this.once("publishComplete",n=>{n?t(n):(this._setScalableFramerates(at.scalableFramerates),this._setScalableVideoLayers(at.scalableVideoLayers),re.debug("publishToSession: got publishComplete"),e())})}),s=e=>{const t=U(e);throw ft("Failure",{},{failureReason:"Publish",failureCode:t.code,failureMessage:t.message}),Ce.isAttemptingToPublish()&&this.trigger("publishComplete",t),se.handleJsException({errorMsg:e.message,code:t.code,target:this,error:e,analytics:Ne}),t};re.debug("publishToSession: waiting for loaded");const a=o.then(()=>e._.getVideoCodecsCompatible(L)).then(n=>{if(re.debug("publishToSession: loaded"),!this.session)return;const r=setTimeout(()=>{Ot(e)},ue);this.once("publishComplete",()=>{clearTimeout(r)}),Ce.set("PublishingToSession");const o=n&&N&&N.video(),i=L.getVideoTracks().length>0,a=null!==at.videoSource&&!1!==at.videoSource;o&&i&&a&&Xe.push(new pe({id:"video1",type:"video",active:at.publishVideo,orientation:he.ROTATED_NORMAL,frameRate:at.frameRate,width:o.videoWidth(),height:o.videoHeight(),source:rt?"screen":it?"custom":"camera",fitMode:at.fitMode}));const c=L.getAudioTracks().length>0;return null!==at.audioSource&&!1!==at.audioSource&&c&&Xe.push(new pe({id:"audio1",type:"audio",active:at.publishAudio})),re.debug("publishToSession: creating rumor stream id"),new t((e,t)=>{Jt(null,(n,r,o)=>{n?t(s(n)):e({streamId:r,message:o})})})}).then(e=>{if(void 0===e)return;const t=e.streamId,n=e.message;if(re.debug("publishToSession: rumor stream id created:",t,"(this is different from stream#created, which requires media to actually be flowing for mantis sessions)"),t!==r)throw new Error("streamId response does not match request");this.streamId=t,we=ce(n)}).catch(e=>{throw this.trigger("publishComplete",e),e});return t.all([a,i])},unpublishFromSession:(e,t)=>{if(!this.session||e.id!==this.session.id){if("unpublished"===t){const t=this.session&&this.session.id||"no session";re.warn(`The publisher ${ze} is trying to unpublish from a session ${e.id} it is not attached to (it is attached to ${t})`)}return this}if(e.isConnected()&&(this.stream||Ce.isAttemptingToPublish())&&e._.streamDestroy(this.streamId),C.releaseAll(),this.disconnect(),Ce.isAttemptingToPublish()){ft("Cancel",{reason:"unpublish"});const e=new Error((()=>{switch(t){case"mediaStopped":return"The video element fired the ended event, indicating there is an issue with the media";case"unpublished":return"The publisher was unpublished before it could be published";case"reset":return"The publisher was reset";default:return"The publisher was destroyed due to "+t}})());this.trigger("publishComplete",ie("mediaStopped"===t?q.MEDIA_ENDED:q.CANCEL,e))}return this.session=null,pt("unpublish","Success"),this._.streamDestroyed(t),this},unpublishStreamFromSession:(e,t,n)=>k&&e.id===k?this._.unpublishFromSession(t,n):(re.warn(`The publisher ${ze} is trying to destroy a stream ${e.id} that is not attached to it (it has ${k||"no stream"} attached to it)`),this),streamDestroyed:e=>{["reset"].indexOf(e)<0&&(Ce.isDestroyed()||Ce.set("MediaBound"));const t=new $.StreamEvent("streamDestroyed",this.stream,e,!0);this.dispatchEvent(t),t.isDefaultPrevented()||this.destroy()},archivingStatus:e=>(jt&&jt.setArchivingStatus(e),e),webRtcStream:()=>L,switchTracks:()=>(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ct().catch(He);case 3:t=e.sent,e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(0),re.error("OT.Publisher.switchTracks failed to getUserMedia: "+e.t0),e.t0;case 10:n=t,wt(),L=n,r.emit("streamChange"),Te=new oe(L,!at.publishAudio),e.prev=11,_t(),e.next=21;break;case 15:if(e.prev=15,e.t1=e.catch(11),!(e.t1 instanceof S)){e.next=19;break}return e.abrupt("return");case 19:throw re.error("Error while binding video",e.t1),e.t1;case 21:e.prev=21,ln(),e.next=29;break;case 25:throw e.prev=25,e.t2=e.catch(21),re.error("Error replacing tracks",e.t2),e.t2;case 29:case"end":return e.stop()}var n}),e,null,[[0,6],[11,15],[21,25]])})))(),getDataChannel(e,t,n){const r=Gt(Object.keys(Qe)[0]);r?r.then(r=>{r.getDataChannel(e,t,n)}):n(new ae.Error("Cannot create a DataChannel before there is a subscriber."))},iceRestart(){Pt().then(e=>{e.forEach(e=>{const t=y(e).remoteConnectionId;ht("Attempt",{remoteConnectionId:t}),re.debug("Publisher: ice restart attempt"),e.iceRestart()})})},getState:()=>Ce,demoOnlyCycleVideo:this.cycleVideo,testOnlyGetFramesEncoded:()=>(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Pt();case 2:if((t=e.sent).length){e.next=5;break}throw new Error("No established PeerConnections yet");case 5:return e.abrupt("return",t[0]._testOnlyGetFramesEncoded());case 6:case"end":return e.stop()}}),e)})))(),onStreamAvailable:xt,startRoutedToRelayedTransition:()=>{bt("Attempt");const e=e=>{const t=U(e);this.trigger("streamCreateForP2PComplete",t),bt("Failure",{reason:t.message})};if(!this.session)return void bt("Failure",{reason:"Not connected to the session."});const t=setTimeout(()=>{bt("Failure",{reason:"Timeout"})},ue);this.once("streamCreateForP2PComplete",()=>{clearTimeout(t)}),re.debug("streamCreateWithSource: send a message to RUMOR for creating the stream with the sourceStreaId P2P and stream "+this.streamId),Jt("P2P",t=>{t?e(t):this.trigger("streamCreateForP2PComplete")})},startRelayedToRoutedTransition:(wn=(0,i.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(gt("Attempt"),n.session){e.next=4;break}return gt("Failure",{reason:"Not connected to the session."}),e.abrupt("return");case 4:if(n.streamId){e.next=7;break}return gt("Failure",{reason:"No streamId available"}),e.abrupt("return");case 7:if(Xt()){e.next=10;break}return gt("Failure",{reason:"There is no Relayed Peer connection created."}),e.abrupt("return");case 10:return n.session._.streamDestroy(n.streamId,"P2P"),e.t0=n,e.next=14,Xt();case 14:return e.t1=e.sent,e.t0._removePeerConnection.call(e.t0,e.t1),e.next=18,zt();case 18:gt("Success"),n.trigger("streamDestroyForP2PComplete");case 20:case"end":return e.stop()}}),e)}))),function(){return wn.apply(this,arguments)}),forceMuteAudio:function(){pt("publishAudio","Attempt",{publishAudio:!1}),at.publishAudio=!1;try{nn("auto"),this.dispatchEvent(new $.MuteForcedEvent),pt("publishAudio","Success",{publishAudio:!1})}catch(e){pt("publishAudio","Failure",{message:e.message})}}.bind(this)},this.detectDevices=function(){re.warn("Publisher.detectDevices() is not implemented.")},this.detectMicActivity=function(){re.warn("Publisher.detectMicActivity() is not implemented.")},this.getEchoCancellationMode=function(){return re.warn("Publisher.getEchoCancellationMode() is not implemented."),"fullDuplex"},this.setMicrophoneGain=function(){re.warn("Publisher.setMicrophoneGain() is not implemented.")},this.getMicrophoneGain=function(){return re.warn("Publisher.getMicrophoneGain() is not implemented."),.5},this.setCamera=function(){re.warn("Publisher.setCamera() is not implemented.")},this.setMicrophone=function(){re.warn("Publisher.setMicrophone() is not implemented.")},this.guid=function(){return ze},this.videoElement=function(){const e=N&&N.video();return e?e.domElement():null},this.setStream=e=>{if("PublishingToSession"!==Ce.current)throw new Error("assignStream called when publisher is not successfully publishing");C.releaseAll(),this.stream=e,this.stream.on("destroyed",this.disconnect,this),C.add(()=>{this.stream&&this.stream.off("destroyed",this.disconnect,this)}),Ce.set("Publishing"),N.loading(!qe),Ee=new Date,this.dispatchEvent(new $.StreamEvent("streamCreated",e,null,!1)),ft("Success"),this.trigger("publishComplete",null,this)},this.isWebRTC=!0,this.isLoading=function(){return N&&N.loading()},this.videoWidth=function(){const e=N&&N.video();return e?e.videoWidth():void 0},this.videoHeight=function(){const e=N&&N.video();return e?e.videoHeight():void 0},this.getStats=function(e){(e=>{Ht(e)})((t,n)=>{t?e(t):e(null,n)})},this.getRtcStatsReport=()=>new t((e,t)=>{Ht("rtcStatsReport",(n,r)=>{n?t(n):e(r)})}),Ce=new le(e=>{re.error("OT.Publisher State Change Failed: ",e.message),re.debug(e)}),this.accessAllowed=!1,this.applyVideoFilter=function(){var e=(0,i.default)(o.default.mark((function e(t){var r,i,s,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(pt("applyVideoFilter","Attempt",{videoFilter:t}),e.prev=1,ye.isSupported()){e.next=5;break}throw ie(q.NOT_SUPPORTED,new Error("Browser does not support video filters (Insertable Streams and Worker APIs are required)"));case 5:if(je.isValidVideoFilter(t)){e.next=7;break}throw ie(q.INVALID_PARAMETER,new Error("Video filter has invalid configuration"));case 7:if(L){e.next=12;break}return pt("applyVideoFilter","Failure",{message:r="Ignoring. No mediaStream"}),re.warn(r),e.abrupt("return");case 12:if(!rt&&!it){e.next=14;break}throw ie(q.INVALID_PARAMETER,new Error("Video filters can not be applied to screen shares or custom video sources"));case 14:if(!n.getVideoFilter()){e.next=17;break}return e.next=17,n.clearVideoFilter();case 17:if(i=L.getVideoTracks(),s=i[0]){e.next=23;break}return pt("applyVideoFilter","Failure",{message:r="Ignoring. No video"}),re.warn(r),e.abrupt("return");case 23:return e.next=25,je.setVideoFilter(t);case 25:return e.next=27,je.setMediaStream(L);case 27:if(!(a=e.sent)){e.next=31;break}return e.next=31,pn(s,a);case 31:e.next=38;break;case 33:throw e.prev=33,e.t0=e.catch(1),re.error("Error applying video filter: "+e.t0),pt("applyVideoFilter","Failure",{message:e.t0.message}),e.t0;case 38:un=t,pt("applyVideoFilter","Success",{videoFilter:t});case 40:case"end":return e.stop()}}),e,null,[[1,33]])})));return function(t){return e.apply(this,arguments)}}(),this.getVideoFilter=()=>{pt("getVideoFilter","Attempt");const e=je.getVideoFilter();return pt("getVideoFilter","Success"),e},this.clearVideoFilter=(0,i.default)(o.default.mark((function e(){var t,r,i,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(pt("clearVideoFilter","Attempt"),n.getVideoFilter()){e.next=6;break}return pt("clearVideoFilter","Success",{message:t="Ignoring. No video filter applied"}),re.debug(t),e.abrupt("return");case 6:if(ye.isSupported()){e.next=11;break}return pt("clearVideoFilter","Success",{message:t='Ignoring. "clearVideoFilter" not supported.'}),re.warn(t),e.abrupt("return");case 11:if(L){e.next=16;break}return pt("clearVideoFilter","Success",{message:t="Ignoring. No mediaStream"}),re.warn(t),e.abrupt("return");case 16:if(!un){e.next=26;break}return r=L.getVideoTracks(),i=r[0],e.next=20,fn(cn);case 20:return s=e.sent,e.next=23,pn(i,s);case 23:return e.next=25,an();case 25:un=null;case 26:case"end":return e.stop()}}),e)})))}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(61).once;e.exports=function(e){this.publish=-1!==e.indexOf("publish")?1:0,this.subscribe=-1!==e.indexOf("subscribe")?1:0,this.forceUnpublish=-1!==e.indexOf("forceunpublish")?1:0,this.forceDisconnect=-1!==e.indexOf("forcedisconnect")?1:0,this.forceMute=-1!==e.indexOf("forcemute")?1:0,this.supportsWebRTC=r()?1:0,this.permittedTo=e=>Object.prototype.hasOwnProperty.call(this,e)&&1===this[e]}},function(e,t,n){"use strict";const r=n(1)("Stream"),o=n(5),i=n(21),s=n(6),a=n(23)(),c=["name","archiving"];e.exports=function(e,t,n,u,d,l){const p=this;let f;this.id=e,this.streamId=e,this.name=t,this.creationTime=Number(n),this.connection=u,this.channel=l,this.publisher=i.publishers.find({streamId:this.id}),s(this);const h=function(e,t,n,r){let o=t;switch(o){case"active":o="audio"===e.type?"hasAudio":"hasVideo",p[o]=r;break;case"disableWarning":if(o="audio"===e.type?"audioDisableWarning":"videoDisableWarning",p[o]=r,!p["audio"===e.type?"hasAudio":"hasVideo"])return;break;case"fitMode":o="defaultFitMode",p[o]=r;break;case"source":o="audio"===e.type?"audioType":"videoType",p[o]=r;break;case"videoDimensions":p.videoDimensions=r;break;case"orientation":case"width":case"height":return}"screen"===p.videoType&&"hasVideo"===o&&!1===r||p.dispatchEvent(new a.StreamUpdatedEvent(p,o,n,r))},m=function(){return p.publisher?p.publisher:i.subscribers.find(e=>e.stream&&e.stream.id===p.id&&e.session.id===d.id)},b=function(){return!p.publisher};this.getChannelsOfType=function(e){return p.channel.filter(t=>t.type===e)},this.getChannel=function(e){for(let t=0;t<p.channel.length;++t)if(p.channel[t].id===e)return p.channel[t];return null};const g=this.getChannelsOfType("audio")[0],v=this.getChannelsOfType("video")[0];this.hasAudio=null!=g&&g.active,this.hasVideo=null!=v&&v.active,this.videoType=v&&v.source,this.defaultFitMode=v&&v.fitMode,this.videoDimensions={},v&&(this.videoDimensions.width=v.width,this.videoDimensions.height=v.height,this.videoDimensions.orientation=v.orientation,v.on("update",h),this.frameRate=v.frameRate),g&&g.on("update",h),this.setChannelActiveState=function(e,t,n){const r={active:t};n&&(r.activeReason=n),y(e,r)},this.setVideoDimensions=function(e,t){y("video",{width:e,height:t,orientation:0})},this.setRestrictFrameRate=function(e){y("video",{restrictFrameRate:e})},this.setPreferredResolution=function(e){if(!b())return void r.warn("setPreferredResolution has no affect when called by a publisher");if(d.sessionInfo.p2pEnabled)return void r.warn("Stream.setPreferredResolution will not work in a P2P Session");if(e&&void 0===e.width&&void 0===e.height)return;const t=p.getChannelsOfType("video")[0];if(t){if(e&&e.width){if(isNaN(parseInt(e.width,10)))throw new o.Error("stream preferred width must be an integer","Subscriber");t.preferredWidth=parseInt(e.width,10)}else t.preferredWidth=void 0;if(e&&e.height){if(isNaN(parseInt(e.height,10)))throw new o.Error("stream preferred height must be an integer","Subscriber");t.preferredHeight=parseInt(e.height,10)}else t.preferredHeight=void 0;d._.subscriberChannelUpdate(p,m(),t,{preferredWidth:t.preferredWidth||0,preferredHeight:t.preferredHeight||0})}},this.getPreferredResolution=function(){const e=p.getChannelsOfType("video")[0];if(e&&(e.preferredWidth||e.preferredHeight))return{width:e.preferredWidth,height:e.preferredHeight}},this.setPreferredFrameRate=function(e){if(!b())return void r.warn("setPreferredFrameRate has no affect when called by a publisher");if(d.sessionInfo.p2pEnabled)return void r.warn("Stream.setPreferredFrameRate will not work in a P2P Session");if(e&&isNaN(parseFloat(e)))throw new o.Error("stream preferred frameRate must be a number","Subscriber");const t=p.getChannelsOfType("video")[0];t&&(t.preferredFrameRate=e?parseFloat(e):null,d._.subscriberChannelUpdate(p,m(),t,{preferredFrameRate:t.preferredFrameRate||0}))},this.getPreferredFrameRate=function(){const e=p.getChannelsOfType("video")[0];return e?e.preferredFrameRate:null};let y=function(e,t){let n;if(p.publisher)n=e=>d._.streamChannelUpdate(p,e,t);else{const e=m();n=n=>d._.subscriberChannelUpdate(p,e,n,t)}p.getChannelsOfType(e).forEach(n)};this.destroyed=!1,this.destroyedReason=void 0,this.destroy=function(e,t){void 0===e&&(e="clientDisconnected"),f=e,p.destroyed=!0,p.destroyedReason=f,!0!==t&&p.dispatchEvent(new a.DestroyedEvent("destroyed",p,f))},this._={},this._.updateProperty=function(e,t){if(-1===c.indexOf(e))return void r.warn(`Unknown stream property "${e}" was modified to "${t}".`);const n=p[e],o=t;switch(e){case"name":p[e]=o;break;case"archiving":var i=m();p.publisher&&i&&i._.archivingStatus(o),p[e]=o}const s=new a.StreamUpdatedEvent(p,e,n,o);p.dispatchEvent(s)},this._.update=function(e){for(const t in e)e.hasOwnProperty(t)&&p._.updateProperty(t,e[t])},this._.forceMute=function(e){e.hasOwnProperty("channels")&&e.channels.includes("audio")&&p.publisher&&p.publisher._.forceMuteAudio()},this._.updateChannel=function(e,t){const n=p.getChannel(e);n&&n.update(t)}}},function(e,t,n){"use strict";t.__esModule=!0,t.STATUS=t.PONG=t.PING=t.DISCONNECT=t.CONNECT=t.MESSAGE=t.UNSUBSCRIBE=t.SUBSCRIBE=void 0;t.SUBSCRIBE=0;t.UNSUBSCRIBE=1;t.MESSAGE=2;t.CONNECT=3;t.DISCONNECT=4;t.PING=7;t.PONG=8;t.STATUS=9},function(e,t,n){"use strict";const r=n(7),o=n(170),i=n(6),s=n(23)(),a=n(719);function c(e,t,n,r,c){let u;this.id=e,this.connectionId=e,this.creationTime=t?Number(t):null,this.data=n,this.capabilities=a(r),this.permissions=new o(c),this.quality=null,i(this),this.destroy=(e,t)=>{u=e||"clientDisconnected",!0!==t&&this.dispatchEvent(new s.DestroyedEvent("destroyed",this,u))},this.destroyed=()=>void 0!==u,this.destroyedReason=()=>u}c.fromHash=e=>{let t=e.id,n=e.creationTime,o=e.data,i=e.capablities,s=e.permissions;return new c(t,n,o,r(i||{},{supportsWebRTC:!0}),s||[])},e.exports=c},function(e,t){var n="object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global).Object===Object&&(void 0!==typeof window?window:global);e.exports=n},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(38),o=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t,n){var r=n(40),o=n(30);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(370),o=n(65),i=n(10),s=n(66),a=n(67),c=n(85),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),d=!n&&o(e),l=!n&&!d&&s(e),p=!n&&!d&&!l&&c(e),f=n||d||l||p,h=f?r(e.length,String):[],m=h.length;for(var b in e)!t&&!u.call(e,b)||f&&("length"==b||l&&("offset"==b||"parent"==b)||p&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||a(b,m))||h.push(b);return h}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){(function(e){var r=n(14),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=i&&i.exports===o?r.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}).call(this,n(84)(e))},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(116),o=n(117),i=n(115),s=n(181),a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,i(e)),e=o(e);return t}:s;e.exports=a},function(e,t,n){var r=n(184),o=n(115),i=n(30);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(116),o=n(10);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},function(e,t,n){var r=n(184),o=n(182),i=n(53);e.exports=function(e){return r(e,i,o)}},function(e,t,n){var r=n(38)(n(14),"Set");e.exports=r},function(e,t,n){var r=n(38)(n(14),"WeakMap");e.exports=r},function(e,t,n){var r=n(14).Uint8Array;e.exports=r},function(e,t,n){var r=n(118);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},function(e,t,n){var r=n(86),o=n(117),i=n(69);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(o(e))}},function(e,t,n){var r=n(110);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},function(e,t,n){var r=n(87),o=n(122);e.exports=function(e){return r((function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,a&&o(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var c=n[r];c&&e(t,c,r,s)}return t}))}},function(e,t,n){var r=n(120),o=Math.max;e.exports=function(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var i=arguments,s=-1,a=o(i.length-t,0),c=Array(a);++s<a;)c[s]=i[t+s];s=-1;for(var u=Array(t+1);++s<t;)u[s]=i[s];return u[t]=n(c),r(e,this,u)}}},function(e,t){var n=Date.now;e.exports=function(e){var t=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){"use strict";e.exports=n(398)()?WeakMap:n(399)},function(e,t,n){"use strict";var r=Object.create,o=Object.getPrototypeOf,i={};e.exports=function(){var e=Object.setPrototypeOf,t=arguments[0]||r;return"function"==typeof e&&o(e(t(null),i))===i}},function(e,t,n){"use strict";var r,o=n(198),i=n(31),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,c={configurable:!0,enumerable:!1,writable:!0,value:void 0};r=function(e,t){if(i(e),null===t||o(t))return e;throw new TypeError("Prototype must be null or an object")},e.exports=function(e){var t,n;return e?(2===e.level?e.set?(n=e.set,t=function(e,t){return n.call(r(e,t),t),e}):t=function(e,t){return r(e,t).__proto__=t,e}:t=function e(t,n){var o;return r(t,n),(o=s.call(e.nullPolyfill,t))&&delete e.nullPolyfill.__proto__,null===n&&(n=e.nullPolyfill),t.__proto__=n,o&&a(e.nullPolyfill,"__proto__",c),t},Object.defineProperty(t,"level",{configurable:!1,enumerable:!1,writable:!1,value:e.level})):null}(function(){var e,t=Object.create(null),n={},r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(r){try{(e=r.set).call(t,n)}catch(e){}if(Object.getPrototypeOf(t)===n)return{set:e,level:2}}return t.__proto__=n,Object.getPrototypeOf(t)===n?{level:2}:((t={}).__proto__=n,Object.getPrototypeOf(t)===n&&{level:1})}()),n(401)},function(e,t,n){"use strict";var r=n(44),o={function:!0,object:!0};e.exports=function(e){return r(e)&&o[typeof e]||!1}},function(e,t,n){"use strict";var r=n(404),o=/^\s*class[\s{/}]/,i=Function.prototype.toString;e.exports=function(e){return!!r(e)&&!o.test(i.call(e))}},function(e,t,n){"use strict";var r=n(44),o=Array.prototype.forEach,i=Object.create,s=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=i(null);return o.call(arguments,(function(e){r(e)&&s(Object(e),t)})),t}},function(e,t,n){"use strict";e.exports=n(411)()?String.prototype.contains:n(412)},function(e,t,n){"use strict";var r=n(89),o=n(90),i=n(413),s=n(442),a=n(443),c=n(45).iterator;e.exports=function(e){return"function"==typeof a(e)[c]?e[c]():r(e)?new i(e):o(e)?new s(e):new i(e)}},function(e,t,n){"use strict";var r=n(418);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}},function(e,t,n){"use strict";var r,o=n(422),i=n(125),s=n(70),a=n(31),c=n(32),u=n(423),d=n(45),l=Object.defineProperty,p=Object.defineProperties;e.exports=r=function(e,t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");p(this,{__list__:c("w",a(e)),__context__:c("w",t),__nextIndex__:c("w",0)}),t&&(s(t.on),t.on("_add",this._onAdd),t.on("_delete",this._onDelete),t.on("_clear",this._onClear))},delete r.prototype.constructor,p(r.prototype,i({_next:c((function(){var e;if(this.__list__)return this.__redo__&&void 0!==(e=this.__redo__.shift())?e:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()})),next:c((function(){return this._createResult(this._next())})),_createResult:c((function(e){return void 0===e?{done:!0,value:void 0}:{done:!1,value:this._resolve(e)}})),_resolve:c((function(e){return this.__list__[e]})),_unBind:c((function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)})),toString:c((function(){return"[object "+(this[d.toStringTag]||"Object")+"]"}))},u({_onAdd:c((function(e){e>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(t,n){t>=e&&(this.__redo__[n]=++t)}),this),this.__redo__.push(e)):l(this,"__redo__",c("c",[e])))})),_onDelete:c((function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(e))&&this.__redo__.splice(t,1),this.__redo__.forEach((function(t,n){t>e&&(this.__redo__[n]=--t)}),this)))})),_onClear:c((function(){this.__redo__&&o.call(this.__redo__),this.__nextIndex__=0}))}))),l(r.prototype,d.iterator,c((function(){return this})))},function(e,t,n){"use strict";var r=n(55),o=n(124),i=n(425),s=n(426),a=function(e,t){return e.replace("%v",s(t))};e.exports=function(e,t,n){if(!o(n))throw new TypeError(a(t,e));if(!r(e)){if("default"in n)return n.default;if(n.isOptional)return null}var s=i(n.errorMessage);throw r(s)||(s=t),new TypeError(a(s,e))}},function(e,t){e.exports=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}},function(e,t,n){e.exports=n(454)},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(17);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var s=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))})))})),i=s.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";(function(t){var r=n(17),o=n(459),i={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,c={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(a=n(212)),a),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(i)})),e.exports=c}).call(this,n(43))},function(e,t,n){"use strict";(function(t){var r=n(17),o=n(460),i=n(462),s=n(209),a=n(463),c=n(466),u=n(467),d=n(213);e.exports=function(e){return new t((function(t,n){var l=e.data,p=e.headers;r.isFormData(l)&&delete p["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";p.Authorization="Basic "+btoa(h+":"+m)}var b=a(e.baseURL,e.url);if(f.open(e.method.toUpperCase(),s(b,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,f.onreadystatechange=function(){if(f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in f?c(f.getAllResponseHeaders()):null,i={data:e.responseType&&"text"!==e.responseType?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:r,config:e,request:f};o(t,n,i),f=null}},f.onabort=function(){f&&(n(d("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){n(d("Network Error",e,null,f)),f=null},f.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(d(t,e,"ECONNABORTED",f)),f=null},r.isStandardBrowserEnv()){var g=(e.withCredentials||u(b))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;g&&(p[e.xsrfHeaderName]=g)}if("setRequestHeader"in f&&r.forEach(p,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete p[t]:f.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),e.responseType)try{f.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){f&&(f.abort(),n(e),f=null)})),l||(l=null),f.send(l)}))}}).call(this,n(0))},function(e,t,n){"use strict";var r=n(461);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},function(e,t,n){"use strict";var r=n(17);e.exports=function(e,t){t=t||{};var n={},o=["url","method","data"],i=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function u(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=c(void 0,e[o])):n[o]=c(e[o],t[o])}r.forEach(o,(function(e){r.isUndefined(t[e])||(n[e]=c(void 0,t[e]))})),r.forEach(i,u),r.forEach(s,(function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=c(void 0,e[o])):n[o]=c(void 0,t[o])})),r.forEach(a,(function(r){r in t?n[r]=c(e[r],t[r]):r in e&&(n[r]=c(void 0,e[r]))}));var d=o.concat(i).concat(s).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===d.indexOf(e)}));return r.forEach(l,u),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){var r=n(472),o=n(474);e.exports=function(e,t,n){return r(o,e,t,n)}},function(e,t,n){var r=n(88),o=n(218),i=o?function(e,t){return o.set(e,t),e}:r;e.exports=i},function(e,t,n){var r=n(187),o=r&&new r;e.exports=o},function(e,t,n){var r=n(220),o=n(221),i=n(478),s=n(95),a=n(222),c=n(228),u=n(487),d=n(134),l=n(14);e.exports=function e(t,n,p,f,h,m,b,g,v,y){var S=128&n,E=1&n,T=2&n,C=24&n,w=512&n,R=T?void 0:s(t);return function I(){for(var _=arguments.length,x=Array(_),O=_;O--;)x[O]=arguments[O];if(C)var N=c(I),k=i(x,N);if(f&&(x=r(x,f,h,C)),m&&(x=o(x,m,b,C)),_-=k,C&&_<y){var Z=d(x,N);return a(t,n,e,I.placeholder,p,x,Z,g,v,y-_)}var A=E?p:this,L=T?A[t]:t;return _=x.length,g?x=u(x,g):w&&_>1&&x.reverse(),S&&v<_&&(x.length=v),this&&this!==l&&this instanceof I&&(L=R||s(L)),L.apply(A,x)}}},function(e,t){var n=Math.max;e.exports=function(e,t,r,o){for(var i=-1,s=e.length,a=r.length,c=-1,u=t.length,d=n(s-a,0),l=Array(u+d),p=!o;++c<u;)l[c]=t[c];for(;++i<a;)(p||i<s)&&(l[r[i]]=e[i]);for(;d--;)l[c++]=e[i++];return l}},function(e,t){var n=Math.max;e.exports=function(e,t,r,o){for(var i=-1,s=e.length,a=-1,c=r.length,u=-1,d=t.length,l=n(s-c,0),p=Array(l+d),f=!o;++i<l;)p[i]=e[i];for(var h=i;++u<d;)p[h+u]=t[u];for(;++a<c;)(f||i<s)&&(p[h+r[a]]=e[i++]);return p}},function(e,t,n){var r=n(479),o=n(226),i=n(227);e.exports=function(e,t,n,s,a,c,u,d,l,p){var f=8&t;t|=f?32:64,4&(t&=~(f?64:32))||(t&=-4);var h=[e,t,a,f?c:void 0,f?u:void 0,f?void 0:c,f?void 0:u,d,l,p],m=n.apply(void 0,h);return r(e)&&o(m,h),m.placeholder=s,i(m,e,t)}},function(e,t,n){var r=n(218),o=n(224),i=r?function(e){return r.get(e)}:o;e.exports=i},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(86),o=n(133);function i(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}i.prototype=r(o.prototype),i.prototype.constructor=i,e.exports=i},function(e,t,n){var r=n(217),o=n(194)(r);e.exports=o},function(e,t,n){var r=n(484),o=n(485),i=n(121),s=n(486);e.exports=function(e,t,n){var a=t+"";return i(e,o(a,s(r(a),n)))}},function(e,t){e.exports=function(e){return e.placeholder}},function(e,t,n){var r=n(491),o=n(9),i=n(71),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):s.test(e)?NaN:+e}},function(e,t,n){var r=n(499),o=n(16);e.exports=function e(t,n,i,s,a){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,s,e,a))}},function(e,t,n){var r=n(92),o=n(232),i=n(94);e.exports=function(e,t,n,s,a,c){var u=1&n,d=e.length,l=t.length;if(d!=l&&!(u&&l>d))return!1;var p=c.get(e),f=c.get(t);if(p&&f)return p==t&&f==e;var h=-1,m=!0,b=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++h<d;){var g=e[h],v=t[h];if(s)var y=u?s(v,g,h,t,e,c):s(g,v,h,e,t,c);if(void 0!==y){if(y)continue;m=!1;break}if(b){if(!o(t,(function(e,t){if(!i(b,t)&&(g===e||a(g,e,n,s,c)))return b.push(t)}))){m=!1;break}}else if(g!==v&&!a(g,v,n,s,c)){m=!1;break}}return c.delete(e),c.delete(t),m}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},function(e,t,n){var r=n(9);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},function(e,t,n){var r=n(504),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,s=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,r,o){t.push(r?o.replace(i,"$1"):n||e)})),t}));e.exports=s},function(e,t,n){var r=n(506),o=n(507);e.exports=function(e,t){return null!=e&&o(e,t,r)}},function(e,t,n){var r=n(116),o=n(513);e.exports=function e(t,n,i,s,a){var c=-1,u=t.length;for(i||(i=o),a||(a=[]);++c<u;){var d=t[c];n>0&&i(d)?n>1?e(d,n-1,i,s,a):r(a,d):s||(a[a.length]=d)}return a}},function(e,t,n){var r=n(520)();e.exports=r},function(e,t,n){"use strict";var r=n(521),o=n(522);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=y,t.resolve=function(e,t){return y(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?y(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=y(e));return e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),d=["'"].concat(u),l=["%","/","?",";","#"].concat(d),p=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=n(523);function y(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),a=-1!==i&&i<e.indexOf("#")?"?":"#",u=e.split(a);u[0]=u[0].replace(/\\/g,"/");var y=e=u.join(a);if(y=y.trim(),!n&&1===e.split("#").length){var S=c.exec(y);if(S)return this.path=y,this.href=y,this.pathname=S[1],S[2]?(this.search=S[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var E=s.exec(y);if(E){var T=(E=E[0]).toLowerCase();this.protocol=T,y=y.substr(E.length)}if(n||E||y.match(/^\/\/[^@\/]+@[^@\/]+/)){var C="//"===y.substr(0,2);!C||E&&b[E]||(y=y.substr(2),this.slashes=!0)}if(!b[E]&&(C||E&&!g[E])){for(var w,R,I=-1,_=0;_<p.length;_++){-1!==(x=y.indexOf(p[_]))&&(-1===I||x<I)&&(I=x)}-1!==(R=-1===I?y.lastIndexOf("@"):y.lastIndexOf("@",I))&&(w=y.slice(0,R),y=y.slice(R+1),this.auth=decodeURIComponent(w)),I=-1;for(_=0;_<l.length;_++){var x;-1!==(x=y.indexOf(l[_]))&&(-1===I||x<I)&&(I=x)}-1===I&&(I=y.length),this.host=y.slice(0,I),y=y.slice(I),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var N=this.hostname.split(/\./),k=(_=0,N.length);_<k;_++){var Z=N[_];if(Z&&!Z.match(f)){for(var A="",L=0,V=Z.length;L<V;L++)Z.charCodeAt(L)>127?A+="x":A+=Z[L];if(!A.match(f)){var P=N.slice(0,_),W=N.slice(_+1),G=Z.match(h);G&&(P.push(G[1]),W.unshift(G[2])),W.length&&(y="/"+W.join(".")+y),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=r.toASCII(this.hostname));var M=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+M,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!m[T])for(_=0,k=d.length;_<k;_++){var X=d[_];if(-1!==y.indexOf(X)){var j=encodeURIComponent(X);j===X&&(j=escape(X)),y=y.split(X).join(j)}}var U=y.indexOf("#");-1!==U&&(this.hash=y.substr(U),y=y.slice(0,U));var F=y.indexOf("?");if(-1!==F?(this.search=y.substr(F),this.query=y.substr(F+1),t&&(this.query=v.parse(this.query)),y=y.slice(0,F)):t&&(this.search="",this.query={}),y&&(this.pathname=y),g[T]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){M=this.pathname||"";var Y=this.search||"";this.path=M+Y}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,s="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(s=v.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+i+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+r},i.prototype.resolve=function(e){return this.resolveObject(y(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,r=Object.keys(this),s=0;s<r.length;s++){var a=r[s];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),u=0;u<c.length;u++){var d=c[u];"protocol"!==d&&(n[d]=e[d])}return g[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!g[e.protocol]){for(var l=Object.keys(e),p=0;p<l.length;p++){var f=l[p];n[f]=e[f]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||b[e.protocol])n.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),n.pathname=h.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",v=n.search||"";n.path=m+v}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var y=n.pathname&&"/"===n.pathname.charAt(0),S=e.host||e.pathname&&"/"===e.pathname.charAt(0),E=S||y||n.host&&e.pathname,T=E,C=n.pathname&&n.pathname.split("/")||[],w=(h=e.pathname&&e.pathname.split("/")||[],n.protocol&&!g[n.protocol]);if(w&&(n.hostname="",n.port=null,n.host&&(""===C[0]?C[0]=n.host:C.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),E=E&&(""===h[0]||""===C[0])),S)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,C=h;else if(h.length)C||(C=[]),C.pop(),C=C.concat(h),n.search=e.search,n.query=e.query;else if(!o.isNullOrUndefined(e.search)){if(w)n.hostname=n.host=C.shift(),(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!C.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var R=C.slice(-1)[0],I=(n.host||e.host||C.length>1)&&("."===R||".."===R)||""===R,_=0,x=C.length;x>=0;x--)"."===(R=C[x])?C.splice(x,1):".."===R?(C.splice(x,1),_++):_&&(C.splice(x,1),_--);if(!E&&!T)for(;_--;_)C.unshift("..");!E||""===C[0]||C[0]&&"/"===C[0].charAt(0)||C.unshift(""),I&&"/"!==C.join("/").substr(-1)&&C.push("");var O,N=""===C[0]||C[0]&&"/"===C[0].charAt(0);w&&(n.hostname=n.host=N?"":C.length?C.shift():"",(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift()));return(E=E||n.host&&C.length)&&!N&&C.unshift(""),C.length?n.pathname=C.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){"use strict";const r=n(15),o=n(19),i=n(1)("guidStorage"),s={};let a,c;e.exports=s;s.override=e=>{if(function(e){return!(r(e.get)&&r(e.set))}(e))throw new Error("The storageInterface argument does not seem to be valid, it must implement get and set methods");a!==e&&(a=e,c&&a.set(c,e=>{e&&i.error(`Failed to send initial Guid value (${c}) to the newly assigned Guid Storage. The error was: ${e}`)}))},s.get=e=>{!function(e){c?e(null,c):a.get(e)}((t,n)=>{t?e(t):(n?c||(c=n):(n=o(),a.set(n,t=>{t?e(t):c=n})),e(null,c))})},s.override({get(e){let t;try{t=(void 0!==typeof window?window:global).localStorage.getItem("opentok_client_id")}catch(e){t||(t=o())}e(null,t)},set(e,t){try{(void 0!==typeof window?window:global).localStorage.setItem("opentok_client_id",e)}catch(e){}t(null)}}),s.set=e=>{c=e}},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},function(e,t,n){"use strict";const r=n(7),o=n(1)("analytics"),i=n(528),s=n(19),a=n(245),c=n(138).prependProxyToUrlIfNeeded,u=n(139).getProxyUrl,d=s(),l=new i;e.exports=function(e){var t=this;let n=e.loggingUrl,i=e.queue,s=void 0===i?l:i,p=e.ajax,f=void 0===p?a:p;this.loggingUrl=n,this.updateEndPoints=()=>{if(!this.proxyUrl){this.proxyUrl=u();const e=c(this.loggingUrl,this.proxyUrl);this.loggingUrl=e}this.endPoint=this.loggingUrl+"/logging/ClientEvent",this.endPointQos=this.loggingUrl+"/logging/ClientQos"},this.updateEndPoints();const h={};this.logError=function(e,n,o,i,s){void 0===i&&(i=null),void 0===s&&(s={});const a=s.partnerId;if(((e,t,n)=>{if(!n)return!1;const r=[n,t,e].join("_");return(h[r]||0)>=100})(e,n,a))return;const c=[a,n,e].join("_"),u=i;h[c]=void 0!==h[c]?h[c]+1:1,t.logEvent(r(s,{action:`${n}.${e}`,payload:u}),!1)},this.logEvent=function(e,n,r,i){if(void 0===n&&(n=!1),void 0===i&&(i=()=>{}),t.updateEndPoints(),e.clientInstanceId=d,r&&!isNaN(r)&&Math.random()>r)return void o.debug("skipping sending analytics due to throttle:",e);let a;o.debug("queueing analytics:",t.loggingUrl,e);try{a=JSON.stringify(e)}catch(e){return void i(e)}!function(e,n,r){void 0===n&&(n=()=>{}),s.add(i=>{o.debug("sending analytics:",t.loggingUrl,e),f.post(r?t.endPointQos:t.endPoint,{body:e,overrideMimeType:"text/plain",headers:{Accept:"text/plain","Content-Type":"application/json"}},e=>{e&&o.debug("Failed to send ClientEvent, moving on to the next item."),n(e||void 0),i()})})}(a,i,n)},this.logQOS=e=>this.logEvent(e,!0)}},function(e,t,n){"use strict";const r=n(246),o=n(2),i=n(248),s=n(7),a={};e.exports=a,"Node"!==o.name&&(a.request=function(e,t,n){const o=new(void 0!==typeof window?window:global).XMLHttpRequest,i=t||{};if(i.method){t.overrideMimeType&&(o.overrideMimeType&&o.overrideMimeType(t.overrideMimeType),delete t.overrideMimeType),n&&(r(o).on("load",e=>{const t=e.target.status;t>=200&&(t<300||304===t)?n(null,e):n(e)}),r(o).on("error",n)),o.open(t.method,e,!0),i.headers||(i.headers={});for(const e in i.headers)Object.prototype.hasOwnProperty.call(i.headers,e)&&o.setRequestHeader(e,i.headers[e]);o.send(t.body&&function(e){if("string"==typeof e)return e;const t=[];return Object.keys(e).forEach(n=>{t.push(`${encodeURIComponent(n)}=${encodeURIComponent(e[n])}`)}),t.join("&").replace(/\+/g,"%20")}(t.body))}else n(new Error("No HTTP method specified in options"))},a.get=function(e,t,n){const r=s(t||{},{method:"GET"});a.request(e,r,n)},a.post=function(e,t,n){const r=s(t||{},{method:"POST"});a.request(e,r,n)},a.getJSON=function(e,t,n){const r=s({Accept:"application/json"},(t=t||{}).headers||{});a.get(e,s(t||{},{headers:r}),(function(e,t){if(e)n(e,t&&t.target&&t.target.responseText);else{let e;try{e=JSON.parse(t.target.responseText)}catch(e){return void n(e,t&&t.target&&t.target.responseText)}n(null,e,t)}}))},i(a))},function(e,t,n){"use strict";const r=n(247);e.exports=function(e,t){return new r(e,t)}},function(e,t,n){"use strict";const r=n(15),o={attributes:n(529),css:n(530),classNames:n(535),observers:n(537)},i=/^#([\w-]*)$/,s=function(e){return Array.prototype.slice.call(e)},a=function(e,t){const n=function(e,t){let n;if(void 0===e)return[];if("string"==typeof e){n=[];const r=i.exec(e);if(t=t||document,r&&r[1]){const e=t.getElementById(r[1]);e&&n.push(e)}else n=t.querySelectorAll(e)}else e&&(e.nodeType||(void 0!==typeof window?window:global).XMLHttpRequest&&e instanceof(void 0!==typeof window?window:global).XMLHttpRequest||e===(void 0!==typeof window?window:global))?(n=[e],t=e):Array.isArray(e)?(n=e.slice(),t=null):n=s(n);return n}(e,t);this.context=t,this.toArray=function(){return n},this.length=n.length,this.first=n[0],this.last=n[n.length-1],this.get=function(e){return void 0===e?n:n[e]}};e.exports=a,(a._attachToOTHelpers={}).removeElement=function(e){return new a(e).remove()},a.prototype.getAsArray=function(){let e=this.get();return r(e.forEach)||(e=s(e)),e},a.prototype.some=function(e,t){return this.getAsArray().some(e,t)},a.prototype.forEach=function(e,t){return this.getAsArray().forEach(e,t),this},a.prototype.map=function(e,t){return new a(this.getAsArray().map(e,t),this.context)},a.prototype.filter=function(e,t){return new a(this.getAsArray().filter(e,t),this.context)},a.prototype.find=function(e){return new a(e,this.first)},a.prototype.on=function(e,t){return this.forEach(n=>{n.addEventListener(e,t,!1)})},a.prototype.off=function(e,t){return this.forEach(n=>{n.removeEventListener(e,t,!1)})},a.prototype.once=function(e,t){const n=function(){this.off(e,n),t(...arguments)}.bind(this);return this.on(e,n)},a.prototype.appendTo=function(e){if(!e)throw new Error("appendTo requires a DOMElement to append to.");return this.forEach(t=>{e.appendChild(t)})},a.prototype.append=function(){const e=this.first;return e?(Array.prototype.forEach.call(arguments,t=>{e.appendChild(t)}),this):this},a.prototype.prepend=function(){if(0===arguments.length)return this;const e=this.first;let t;return e?(t=Array.prototype.slice.call(arguments),e.firstElementChild||e.appendChild(t.shift()),t.forEach(t=>{e.insertBefore(t,e.firstElementChild)}),this):this},a.prototype.after=function(e){if(!e)throw new Error("after requires a DOMElement to insert after");return this.forEach(t=>{t.parentElement&&(e!==t.parentNode.lastChild?t.parentElement.insertBefore(t,e):t.parentElement.appendChild(t))})},a.prototype.before=function(e){if(!e)throw new Error("before requires a DOMElement to insert before");return this.forEach(t=>{t.parentElement&&t.parentElement.insertBefore(t,e)})},a.prototype.remove=function(){return this.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)})},a.prototype.empty=function(){return this.forEach(e=>{for(;e.firstChild;)e.removeChild(e.firstChild)})},a.prototype.isDisplayNone=function(){return this.some(e=>(0===e.offsetWidth||0===e.offsetHeight)&&"none"===new a(e).css("display")||!(!e.parentNode||!e.parentNode.style)&&new a(e.parentNode).isDisplayNone())};const c=function e(t){return 0!==t.offsetWidth&&0!==t.offsetHeight||"none"!==new a(t).css("display")?t.parentNode&&t.parentNode.style?e(t.parentNode):null:t};a._attachToOTHelpers.emptyElement=function(e){return new a(e).empty()},a._attachToOTHelpers._findElementWithDisplayNone=c,o.css(a,c),o.attributes(a),o.classNames(a),o.observers(a),["on","off","isDisplayNone","show","hide","css","makeVisibleAndYield","addClass","removeClass"].forEach(e=>{a._attachToOTHelpers[e]=function(){const t=Array.prototype.slice.apply(arguments),n=t.shift(),r=new a(n);return a.prototype[e].apply(r,t)}})},function(e,t,n){"use strict";e.exports=function(e){const t={};Object.keys(e).forEach(n=>{t[n]=e[n]}),e._attachToOTHelpers=t}},function(e,t,n){"use strict";const r=n(15),o=n(6),i=n(1)("Collection");e.exports=function(e){let t=[],n={};const s=e||"id";o(this);const a=function(e,t){return r(e[t])?e[t]():e[t]},c=function(e){this.trigger("update",e),this.trigger("update:"+e.target.id,e)}.bind(this),u=function(e){this.remove(e.target,e.reason)}.bind(this);this.reset=function(){t.forEach((function(e){e.off("updated",c,this),e.off("destroyed",u,this)}),this),t=[],n={}},this.destroy=function(e){t.forEach(t=>{t&&"function"==typeof t.destroy&&t.destroy(e,!0)}),this.reset(),this.off()},this.get=function(e){return e&&void 0!==n[e]?t[n[e]]:void 0},this.has=function(e){return e&&void 0!==n[e]},this.toString=function(){return t.toString()},this.where=function(e,n){return r(e)?t.filter(e,n):t.filter(t=>{for(const n in e)if(e.hasOwnProperty(n)&&a(t,n)!==e[n])return!1;return!0})},this.find=function(e,n){let o;o=r(e)?e:function(t){for(const n in e)if(e.hasOwnProperty(n)&&a(t,n)!==e[n])return!1;return!0},o=o.bind(n);for(let e=0;e<t.length;++e)if(!0===o(t[e]))return t[e];return null},this.forEach=function(e,n){return t.forEach(e,n),this},this.map=function(e){return t.map(e)},this.add=function(e){const r=a(e,s);return this.has(r)?(i.warn(`Model ${r} is already in the collection`,t),this):(n[r]=t.push(e)-1,e.on("updated",c,this),e.on("destroyed",u,this),this.trigger("add",e),this.trigger("add:"+r,e),this)},this.remove=function(e,r){const o=a(e,s);t.splice(n[o],1);for(let e=n[o];e<t.length;++e)n[a(t[e],s)]=e;return delete n[o],e.off("updated",c,this),e.off("destroyed",u,this),this.trigger("remove",e,r),this.trigger("remove:"+o,e,r),this},this._triggerAddEvents=function(){this.where.apply(this,arguments).forEach((function(e){this.trigger("add",e),this.trigger("add:"+a(e,s),e)}),this)},this.length=function(){return t.length}}},function(e,t,n){"use strict";const r=n(1)("deprecation");e.exports=function(e,t,n){let o=void 0===n?{}:n,i=o.value,s=o.name,a=void 0===s?""+t:s,c=o.getWarning,u=void 0===c?"":c,d=o.setWarning,l=void 0===d?"":d,p=o.canSet,f=void 0!==p&&p,h=o.warnOnSet,m=i,b=!1,g=!(void 0!==h&&h);const v={get:()=>(b||(b=!0,r.warn(`${a} is deprecated, and will be removed in the future. ${u}`.trim())),m),set(e){f&&(m=e),g||(g=!0,f?r.warn(`${a} is deprecated. ${l}`.trim()):r.warn(`${a} is deprecated, and will be removed in the future. ${l}`.trim()))}};Object.defineProperty(e,t,v)}},function(e,t,n){"use strict";const r=n(2),o=n(9);let i;const s=["description","fileName","lineNumber","message","name","number","stack"],a=function(e,t,n){switch(arguments.length){case 1:o(e)&&(n=e,t=void 0,e=void 0);break;case 2:o(t)&&(n=t,t=void 0)}if(n instanceof Error)for(let e=0,t=s.length;e<t;++e)this[s[e]]=n[s[e]];else if(o(n))for(const e in n)n.hasOwnProperty(e)&&(this[e]=n[e]);if(!(this.fileName&&this.lineNumber&&this.columnNumber&&this.stack)){const e=i();!this.fileName&&e.fileName&&(this.fileName=e.fileName),!this.lineNumber&&e.lineNumber&&(this.lineNumber=e.lineNumber),!this.columnNumber&&e.columnNumber&&(this.columnNumber=e.columnNumber),!this.stack&&e.stack&&(this.stack=e.stack)}!this.message&&e&&(this.message=e),this.name&&"Error"!==this.name||!t||(this.name=t)};e.exports=a,(a.prototype=Object.create(Error.prototype)).toString=function(){let e="";return this.fileName&&(e+=" "+this.fileName),this.lineNumber&&(e+=" "+this.lineNumber,this.columnNumber&&(e+=":"+this.columnNumber)),`<${this.name?this.name+" ":""}${this.message}${e}>`},a.prototype.valueOf=a.prototype.toString;const c=function(e,t){return t.slice(2).map(e=>{const t={fileName:e.getFileName(),linenumber:e.getLineNumber(),columnNumber:e.getColumnNumber()};return e.getFunctionName()&&(t.functionName=e.getFunctionName()),e.getMethodName()&&(t.methodName=e.getMethodName()),e.getThis()&&(t.self=e.getThis()),t})};i=function(){const e={};let t,n,o;switch(r.name){case"Firefox":case"Safari":try{(void 0!==typeof window?window:global).call.js.is.explody()}catch(e){o=e}t=(o.stack||"").split("\n"),t.shift(),t.shift(),e.stack=t,n=/@(.+?):([0-9]+)(:([0-9]+))?$/.exec(t[0]),n&&(e.fileName=n[1],e.lineNumber=parseInt(n[2],10),n.length>3&&(e.columnNumber=parseInt(n[4],10)));break;case"Chrome":case"Node":case"Opera":var i=Error.prepareStackTrace;Error.prepareStackTrace=c,o=new Error,e.stack=o.stack,Error.prepareStackTrace=i;var s=e.stack[0];e.lineNumber=s.lineNumber,e.columnNumber=s.columnNumber,e.fileName=s.fileName,s.functionName&&(e.functionName=s.functionName),s.methodName&&(e.methodName=s.methodName),s.self&&(e.self=s.self);break;default:o=new Error,o.stack&&(e.stack=o.stack.split("\n"))}return o.message&&(e.message=o.message),e}},function(e,t,n){"use strict";var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},r.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:n[t[r]]=t[r+1]}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},r.parseIceOptions=function(e){return e.substr(14).split(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},r.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),o=0;o<r.length;o++)n[(t=r[o].trim().split("="))[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},r.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},r.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?r.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},r.getCryptoParameters=function(e,t){return r.matchPrefix(e+t,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(e,t){var n=r.matchPrefix(e+t,"a=ice-ufrag:")[0],o=r.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&o?{usernameFragment:n.substr(12),password:o.substr(10)}:null},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" "),o=3;o<n.length;o++){var i=n[o],s=r.matchPrefix(e,"a=rtpmap:"+i+" ")[0];if(s){var a=r.parseRtpMap(s),c=r.matchPrefix(e,"a=fmtp:"+i+" ");switch(a.parameters=c.length?r.parseFmtp(c[0]):{},a.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+i+" ").map(r.parseRtcpFb),t.codecs.push(a),a.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(a.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(r.parseExtmap(e))})),t},r.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}));var o=0;return t.codecs.forEach((function(e){e.maxptime>o&&(o=e.maxptime)})),o>0&&(n+="a=maxptime:"+o+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=r.writeExtmap(e)})),n},r.parseRtpEncodingParameters=function(e){var t,n=[],o=r.parseRtpParameters(e),i=-1!==o.fecMechanisms.indexOf("RED"),s=-1!==o.fecMechanisms.indexOf("ULPFEC"),a=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=a.length>0&&a[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));u.length>0&&u[0].length>1&&u[0][0]===c&&(t=u[0][1]),o.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(r.rtx={ssrc:t}),n.push(r),i&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:c,mechanism:s?"red+ulpfec":"red"},n.push(r))}})),0===n.length&&c&&n.push({ssrc:c});var d=r.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=d}))),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var o=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=o.length>0,t.compound=0===o.length;var i=r.matchPrefix(e,"a=rtcp-mux");return t.mux=i.length>0,t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var o=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return o.length>0?{stream:(t=o[0].value.split(" "))[0],track:t[1]}:void 0},r.parseSctpDescription=function(e){var t,n=r.parseMLine(e),o=r.matchPrefix(e,"a=max-message-size:");o.length>0&&(t=parseInt(o[0].substr(19),10)),isNaN(t)&&(t=65536);var i=r.matchPrefix(e,"a=sctp-port:");if(i.length>0)return{port:parseInt(i[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};if(r.matchPrefix(e,"a=sctpmap:").length>0){var s=r.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(s[0],10),protocol:s[1],maxMessageSize:t}}},r.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t,n){var o=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||r.generateSessionId())+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,o){var i=r.writeRtpDescription(e.kind,t);if(i+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),i+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),i+="a=mid:"+e.mid+"\r\n",e.direction?i+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?i+="a=sendrecv\r\n":e.rtpSender?i+="a=sendonly\r\n":e.rtpReceiver?i+="a=recvonly\r\n":i+="a=inactive\r\n",e.rtpSender){var s="msid:"+o.id+" "+e.rtpSender.track.id+"\r\n";i+="a="+s,i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,i+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),i},r.getDirection=function(e,t){for(var n=r.splitLines(e),o=0;o<n.length;o++)switch(n[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[o].substr(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substr(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},r.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=r.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},e.exports=r},function(e,t,n){"use strict";e.exports=function(e){return-1===["Chrome","Safari","Edge","Opera"].indexOf(e.browserName)||"Edge"===e.browserName&&!e.isChromiumEdge||e.isScreenSharing&&!e.capableSimulcastScreenshare||e.sessionInfo.p2pEnabled||!e.constraints.video&&!e.isCustomVideoTrack?1:e.videoDimensions.width>640&&e.videoDimensions.height>480?3:2}},function(e,t,n){"use strict";var r=n(3)(n(18));const o=n(49);e.exports=function(){function e(e,t){var n;let i=(void 0===t?{}:t).requestAnimationFrame,s=void 0===i?(n=window).requestAnimationFrame.bind(n):i;(0,r.default)(this,"_lastCalled",o()),(0,r.default)(this,"_audioLevel",void 0),(0,r.default)(this,"_running",!1),this._requestAnimationFrame=s,this._getAudioLevel=e,this._startLoop()}var t=e.prototype;return t._startLoop=function(){this._running||(this._running=!0,this._requestAnimationFrame(this._loop.bind(this)))},t._loop=function(){this._getAudioLevel((e,t)=>{let n=null;if(!e){for(let e=0;e<t.length;e+=1){const r=t[e];let o=null;if(void 0!==r.audioOutputLevel){const e=parseFloat(r.audioOutputLevel)/32768;isNaN(e)||(o=e)}else void 0!==r.audioLevel&&(o=r.audioLevel);null!==o&&(null===n||o>n)&&(n=o)}this._audioLevel=n,this._running&&o()-this._lastCalled<1e4?this._requestAnimationFrame(this._loop.bind(this)):this._running=!1}})},t.destroy=function(){this._running=!1},t.sample=function(e){if("function"==typeof e)throw new Error("sample no longer takes a callback");return this._startLoop(),this._lastCalled=o(),this._audioLevel},e}()},function(e,t,n){"use strict";const r=n(147),o=n(564),i=n(149);function s(e,t,n){return!(!e.publish&&t)&&("boolean"==typeof e.source?e.source:n?{mandatory:{sourceId:e.source}}:i(e.source)?{}:{deviceId:{exact:e.source}})}function a(e){let t=s(e.audio,e.enableRenegotiation,e.usingOptionalMandatoryStyle);if(!1===t)return!1;const n=e.usingOptionalMandatoryStyle,o=e.enableStereo,i=e.echoCancellation,a=e.noiseSuppression,c=e.autoGainControl,u=e.disableAudioProcessing,d=e=>{"object"==typeof t&&(n?(r(t,{optional:[]}),t.optional.push(e)):r(t,e))};return!o&&!u&&i&&a&&c||!0!==t||(t={}),o&&d({channelCount:2}),["echoCancellation","autoGainControl","noiseSuppression"].forEach(t=>{const n=!u&&e[t];d({[t]:n})}),t}function c(e){let t=s(e.video,e.enableRenegotiation,e.usingOptionalMandatoryStyle);if(!1===t)return!1;const n=e.videoDimensions,o=e.frameRate,i=e.maxResolution,a=e.facingMode,c=e.usingOptionalMandatoryStyle;if((n||o||i||a)&&!0===t&&(t={}),n){const e=n.width,o=n.height;c?(r(t,{optional:[]}),t.optional.push({minWidth:e},{maxWidth:e},{minHeight:o},{maxHeight:o})):r(t,{width:{ideal:e},height:{ideal:o}})}return o&&(c?(r(t,{optional:[]}),t.optional.push({minFrameRate:o},{maxFrameRate:o})):r(t,{frameRate:{ideal:o}})),i&&r(t,c?{mandatory:{maxWidth:i.width,maxHeight:i.height}}:{width:{max:i.width},height:{max:i.height}}),a&&(c?(r(t,{optional:[]}),t.optional.push({facingMode:a})):r(t,{facingMode:{ideal:a}})),t}e.exports=function(e){const t=o(e);return{constraints:function(e){return{audio:a(e),video:c(e)}}(t),publishAudio:t.audio.publish,publishVideo:t.video.publish,frameRate:t.frameRate,videoDimensions:t.videoDimensions,audioDeviceId:"string"==typeof t.audio.source?t.audio.source:void 0,videoDeviceId:"string"==typeof t.video.source?t.video.source:void 0}}},function(e,t,n){var r=n(64),o=n(52);e.exports=function(e,t,n){(void 0!==n&&!o(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},function(e,t){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},function(e,t,n){"use strict";const r=n(2),o=r.name,i=r.version,s=r.isChromiumEdge;e.exports=s||"Chrome"===o&&i>=72||"Firefox"===o&&i>=66||"Opera"===o&&i>=60||"Safari"===o},function(e,t,n){var r=n(59),o=n(260);e.exports=function(e){return o(r(e).toLowerCase())}},function(e,t,n){var r=n(569)("toUpperCase");e.exports=r},function(e,t){e.exports=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}},function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},function(e,t,n){var r=n(571),o=n(262),i=n(572);e.exports=function(e){return o(e)?i(e):r(e)}},function(e,t,n){"use strict";const r=n(2);e.exports=Boolean(r.isChrome&&r.version>=74||r.isEdge&&r.version>=79)},function(e,t,n){"use strict";const r=n(2);e.exports=e=>!!r.isElectron&&(e instanceof MediaStreamTrack&&"Screen"===e.label)},function(e,t,n){var r=n(99),o=n(578)(r);e.exports=o},function(e,t,n){"use strict";e.exports=15e3},function(e,t,n){"use strict";e.exports=function(e,t){return void 0===t&&(t=!1),void 0===e?t:"true"===e||!0===e}},function(e,t,n){"use strict";const r=n(2);e.exports=()=>{if(!(!r.isNode&&!r.isElectron))return!1;return(r.isChrome||r.isOpera||r.isChromiumEdge)&&r.version>=74||r.isFirefox&&r.version>=68||r.isSafari&&r.version>=11}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){var r=n(33),o=n(77),i=n(595),s=n(58),a=n(40),c=n(598),u=n(137),d=n(185),l=u((function(e,t){var n={};if(null==e)return n;var u=!1;t=r(t,(function(t){return t=s(t,e),u||(u=t.length>1),t})),a(e,d(e),n),u&&(n=o(n,7,c));for(var l=t.length;l--;)i(n,t[l]);return n}));e.exports=l},function(e,t,n){var r=n(206),o=n(35),i=n(96),s=Math.max;e.exports=function(e,t,n){var a=null==e?0:e.length;if(!a)return-1;var c=null==n?0:i(n);return c<0&&(c=s(a+c,0)),r(e,o(t,3),c)}},function(e,t,n){var r=n(600);e.exports=function(e){return e&&e.length?r(e):[]}},function(e,t,n){"use strict";const r=n(608),o=n(277),i=n(102)();e.exports=(e,t)=>{o(e,(e,n)=>{let o=[];i?"function"==typeof n.values?o=r(n.values()):"function"!=typeof n.forEach?o=Object.keys(n).map(e=>n[e]):n.forEach(e=>{o.push(e)}):n.result().forEach(e=>{const t={};e.names().forEach(n=>{t[n]=e.stat(n)}),t.id=e.id,t.type=e.type,t.timestamp=e.timestamp,o.push(t)}),t(null,o)})}},function(e,t,n){var r=n(29),o=n(10),i=n(16);e.exports=function(e){return"string"==typeof e||!o(e)&&i(e)&&"[object String]"==r(e)}},function(e,t,n){var r=n(610),o=n(30);e.exports=function(e){return null==e?[]:r(e,o(e))}},function(e,t,n){"use strict";const r=n(102)(),o=(e,t)=>{e.getStats(null).then(e=>t(null,e)).catch(t)},i=(e,t)=>{e.getStats(e=>{t(null,e)},t)};e.exports=(e,t)=>{(r?o:i)(e,t)}},function(e,t,n){"use strict";var r=n(3);t.__esModule=!0,t.default=void 0;var o=r(n(157)),i=r(n(60)),s=r(n(18)),a=n(42),c=r(n(37)),u=r(n(620)),d=r(n(622)),l=r(n(49));const p=(0,r(n(1)).default)("QoS");let f=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t=e.call(this,...r)||this,(0,s.default)((0,o.default)(t),"_peerConnection",void 0),(0,s.default)((0,o.default)(t),"_isPublisher",void 0),(0,s.default)((0,o.default)(t),"timeoutId",void 0),(0,s.default)((0,o.default)(t),"_creationTime",(0,l.default)()),(0,s.default)((0,o.default)(t),"offerMessagesReceived",0),(0,s.default)((0,o.default)(t),"prevStats",{timeStamp:(0,l.default)()}),(0,s.default)((0,o.default)(t),"changeCounters",{videoCodec:new d.default,audioCodec:new d.default}),t}(0,i.default)(t,e);var n=t.prototype;return n.startCollecting=function(e,n){if(!e||!e.getStats)return;this._isPublisher=n;const r=Boolean(this._peerConnection);if(this._peerConnection=e,r)return;const o=e=>{const n=(0,l.default)(),r={timeStamp:n,duration:Math.round((n-this._creationTime)/1e3),period:Math.round((n-this.prevStats.timeStamp)/1e3)};(0,u.default)(this._peerConnection,this.prevStats,r,this._isPublisher,(n,r)=>{n?p.error("Failed to Parse QOS Stats:",n):(this.handleParsedStats(r),clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>o(t.INTERVAL),e))})};this.timeoutId=setTimeout(()=>o(t.INTERVAL-t.INITIAL_INTERVAL),t.INITIAL_INTERVAL)},n.stopCollecting=function(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this._peerConnection=null},n.handleOfferMessageReceived=function(){this.offerMessagesReceived+=1},n.handleParsedStats=function(e){Object.keys(this.changeCounters).forEach(t=>{this.changeCounters[t].onValue(e[t]),e[t+"ChangeCount"]=this.changeCounters[t].changeCount}),e.offerMessagesReceived=this.offerMessagesReceived;const t=(0,c.default)(e);if(["audioSentBytes","audioSentPackets","audioSentPacketsLost","videoSentBytes","videoSentPackets","videoSentPacketsLost","audioRecvBytes","audioRecvPackets","audioRecvPacketsLost","videoRecvBytes","videoRecvPackets","videoRecvPacketsLost"].forEach(n=>{t[n]=this.prevStats&&this.prevStats[n]?e[n]-this.prevStats[n]:e[n]}),this.prevStats&&this.prevStats.videoFramesReceived){const n=e.videoFramesReceived-this.prevStats.videoFramesReceived,r=e.period;t.videoFrameRateReceived=Math.round(n/r)}this.prevStats=e,delete t.framesDecoded,delete t.framesEncoded,this.emit("stats",t)},t}(a.EventEmitter);f.INITIAL_INTERVAL=1e3,f.INTERVAL=3e4;var h=f;t.default=h},function(e,t,n){"use strict";e.exports=e=>{switch(e>>24){case 0:return"TURN/TLS";case 1:return"TURN/TCP";case 2:return"TURN/UDP";default:return""}}},function(e,t,n){"use strict";const r=n(19),o=n(160).default,i=n(4),s=n(11);e.exports=function(e){let t=void 0===e?{}:e,n=t.haveGetDisplayMedia,a=void 0===n?o:n,c=t.global,u=void 0===c?void 0!==typeof window?window:global:c,d=t.Errors,l=void 0===d?i:d,p=t.otError,f=void 0===p?s():p;const h=!a&&!!u.navigator.webkitGetUserMedia&&!u.navigator.userAgent.match(/android/i)&&void 0!==u.chrome;return{isSupportedInThisBrowser:h,autoRegisters:!1,extensionRequired:!0,getConstraintsShowsPermissionUI:!0,sources:{screen:!0,application:!1,window:!0,browser:!0},register(e,t){return 2===t?this.registerVersion2(e):this.registerVersion1(e)},registerVersion1(e){if(!e)throw new Error("initChromeScreenSharingExtensionHelper: extensionID is required.");const t=h,n={};let o=void 0;const i="com.tokbox.screenSharing."+e,s=function(e,t){const n={payload:t,from:"jsapi"};return n[i]=e,n},a=function(e,t){let o;const i=r();return n[i]=function(){clearTimeout(o),o=null,e(...arguments)},t&&(o=setTimeout(()=>{delete n[i],e(f(l.TIMEOUT,new Error("Timeout waiting for response to screensharing request.")))},t)),i},c=function(e){if(!e)throw new Error("isAvailable: callback is required.");if(t)if(void 0!==o)setTimeout(e.bind(null,o));else{const t=a(t=>{!0!==o&&(o="extensionLoaded"===t),e(o)},2e3),n=s("isExtensionInstalled",{requestId:t});u.postMessage(n,"*")}else setTimeout(e.bind(null,!1))};return u.addEventListener("message",e=>{if(e.origin!==u.location.origin)return;if(null==e.data||"object"!=typeof e.data)return;if("extension"!==e.data.from)return;const t=e.data[i],r=e.data.payload;if(r&&r.requestId){const e=n[r.requestId];delete n[r.requestId],e&&e(t,r)}"extensionLoaded"===t&&(o=!0)}),{extensionAPIVersion:1,extensionID:e,isInstalled:c,getConstraints:function(e,t,n){if(!n)throw new Error("getSourceId: callback is required");c(r=>{if(!r)return n(f(l.SCREEN_SHARING_EXTENSION_NOT_INSTALLED,new Error("Extension is not installed")));const o=a((e,r)=>{if("object"==typeof e&&e.name&&e.stack){n(e)}else"permissionDenied"===e?n(f(l.USER_MEDIA_ACCESS_DENIED,new Error("User denied access to screensharing"))):(t.video||(t.video={}),t.video.mandatory||(t.video.mandatory={}),t.video.mandatory.chromeMediaSource="desktop",t.video.mandatory.chromeMediaSourceId=r.sourceId,n(void 0,t))});u.postMessage(s("getSourceId",{requestId:o,source:e}),"*")})}}},registerVersion2(e){const t=h&&void 0!==u.chrome.runtime,n=function(n){if(!n)throw new Error("isAvailable: callback is required.");t?u.chrome.runtime.sendMessage(e,{type:"isInstalled"},null,e=>{setTimeout(n.bind(null,!!e))}):setTimeout(n.bind(null,!1))};return{extensionAPIVersion:2,extensionID:e,isInstalled:n,getConstraints:function(t,r,o){if(!o)throw new Error("getSourceId: callback is required");n(n=>{if(!n)return o(f(l.SCREEN_SHARING_EXTENSION_NOT_INSTALLED,new Error("Extension is not installed")));u.chrome.runtime.sendMessage(e,{type:"getSourceId",source:t},null,e=>{"permissionDenied"===e.error?o(f(l.USER_MEDIA_ACCESS_DENIED,new Error("User denied access to screensharing"))):e.error?o(new Error("UnexpectError: "+e.error)):(r.video||(r.video={}),r.video.mandatory||(r.video.mandatory={}),r.video.mandatory.chromeMediaSource="desktop",r.video.mandatory.chromeMediaSourceId=e.sourceId,o(void 0,r))})})}}}}}},function(e,t,n){"use strict";(function(t){const r=n(155),o=n(103);e.exports=function(e){void 0===e&&(e={});const i=e.Archiving||n(626),s=e.AudioLevelMeter||n(282),a=e.AudioLevelTransformer||n(143),c=e.BackingBar||n(283),u=e.Chrome||n(144),d=e.MuteButton||n(284)(),l=e.NamePanel||n(285),p=e.StylableComponent||n(152),f=e.logging||n(1)("createChromeMixin");return function(e,n){let h,m,b,g=void 0===n?{}:n,v=g.name,y=g.publishAudio,S=g.publishVideo,E=g.audioSource,T=g.showControls,C=g.shouldAllowAudio,w=g.logAnalyticsEvent;const R={},I=r(),_=t=>{if(!1===t)return"off";const n=e.getStyle("buttonDisplayMode");return!1===n?"on":n};let x=new t((t,n)=>{R.init=n=>{e.getStyle("showArchiveStatus")||w("showArchiveStatus","createChrome",{mode:"off"});const r={backingBar:new c({nameMode:v?e.getStyle("nameDisplayMode"):"off",muteMode:_(e.getStyle("buttonDisplayMode"))}),name:new l({name:v,mode:e.getStyle("nameDisplayMode")}),archive:new i({show:Boolean(e.getStyle("showArchiveStatus"))&&"off"!==e.getStyle("archiveStatusDisplayMode"),archiving:!1}),muteButton:new d({muted:!1===y,mode:_.call(null,e.getStyle("buttonDisplayMode"))})};h=new s({mode:e.getStyle("audioLevelDisplayMode")});const p=new a,f=new o(()=>{const t=y?p.transform(e.loudness):0;h.setValue(t)});h.watchVisibilityChanged(e=>{e?f.start():f.stop()}),h.audioOnly(!S&&y),r.audioLevel=h,n&&n.domElement&&(b=n,m=new u({parent:b.domElement}).set(r).on({muted:()=>e.publishAudio(!1),unmuted:()=>e.publishAudio(!0)}),null!==E&&!1!==E||R.removeAudioTrack(),t())},R.reset=()=>{n(new Error("Chrome still being created")),m&&(m.destroy(),m=null)},R.destroy=()=>{R.reset(),I.releaseAll(),x=null}});x.catch(e=>{e&&"Chrome still being created"===e.message||f.error("createChromeMixin failed to setup UI",e)}),R.setAudioOnly=e=>{h&&h.audioOnly(e)},R.setArchivingStatus=e=>{m&&m.archive.setArchiving(e)},R.setMuted=e=>{m&&m.muteButton&&m.muteButton.muted(e)},R.removeAudioTrack=()=>{m&&m.muteButton&&m.muteButton.remove()},R.addAudioTrack=()=>{m&&m.muteButton&&m.muteButton.add()},p(e,{showArchiveStatus:!0,nameDisplayMode:"auto",buttonDisplayMode:"auto",audioLevelDisplayMode:C?"auto":"off",archiveStatusDisplayMode:"auto",backgroundImageURI:null},T,e=>{w("SetStyle","Publisher",e,null,.1)});const O=(e,t)=>{x.then(()=>{switch(e){case"nameDisplayMode":m.name.setDisplayMode(t),m.backingBar.setNameMode(t);break;case"showArchiveStatus":w("showArchiveStatus","styleChange",{mode:t?"on":"off"}),m.archive.setShowArchiveStatus(Boolean(t));break;case"archiveStatusDisplayMode":m.archive.setShowArchiveStatus("off"!==t);break;case"buttonDisplayMode":m.muteButton.setDisplayMode(t),m.backingBar.setMuteMode(t);break;case"audioLevelDisplayMode":m.audioLevel.setDisplayMode(t);break;case"backgroundImageURI":b.setBackgroundImageURI(t)}})};return e.on("styleValueChanged",O),I.add(()=>e.off("styleValueChanged",O)),R}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const r=n(104),o=n(36),i=n(5),s=n(42);e.exports=function(e){const n=this,a=new s;let c,u,d,l,p=!0,f=!1,h="auto";const m=e.maxValue||1,b=e.minValue||0;function g(){const e=(f&&"auto"===h||"on"===h)&&p;l!==e&&(l=e,a.emit("visibilityChanged",e))}r(n,{audioOnly:{get:()=>f,set(e){f=e,g()}}}),n.setValue=function(e){d=e,function(){const e=(d-b)/(m-b);u.style.transform=`scale(${Math.sqrt(e)})`}()},n.watchVisibilityChanged=function(e){return a.on("visibilityChanged",e),t.resolve().then(()=>{e(l)}),function(){a.removeListener("visibilityChanged",e)}};const v={mode:e?e.mode:"auto",nodeName:"div",htmlAttributes:{className:"OT_audio-level-meter"},onCreate:function(){u=i.createElement("div",{className:"OT_audio-level-meter__value"},""),c=i.createElement("div",{className:"OT_audio-level-meter__audio-only-img"},"");const e=n.domElement;e.appendChild(c),e.appendChild(u),n.watchVisibilityChanged(e=>{e?i.removeClass(n.domElement,"OT_hide-forced"):i.addClass(n.domElement,"OT_hide-forced")})},onDestroy:function(){a.removeAllListeners("visibilityChanged")}};o(this,v),n.setDisplayMode=function(e){h=e,g()},n.getDisplayMode=function(){return h},n.showAfterLoading=function(){p=!0,g()},n.hideWhileLoading=function(){p=!1,g()},g()}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(36);e.exports=function(e){let t=e.nameMode,n=e.muteMode;function o(){return"on"===t||"on"===n?"on":"mini"===t||"mini"===n?"mini":"mini-auto"===t||"mini-auto"===n?"mini-auto":"auto"===t||"auto"===n?"auto":"off"}r(this,{mode:o(),nodeName:"div",htmlContent:"",htmlAttributes:{className:"OT_bar OT_edge-bar-item"}}),this.setNameMode=function(e){t=e,this.setDisplayMode(o())},this.setMuteMode=function(e){n=e,this.setDisplayMode(o())}}},function(e,t,n){"use strict";const r=n(5),o=n(36),i=n(104);e.exports=function(e){void 0===e&&(e={});const t=e.OTHelpers||r,n=e.Widget||o;return function(e){let r=e.muted||!1;const o=()=>{r?t.addClass(this.domElement,"OT_active"):t.removeClass(this.domElement,"OT_active ")},s=()=>(r=!r,o(),r?this.parent.trigger("muted",this):this.parent.trigger("unmuted",this),!1);i(this,{muted:{get:()=>r,set(e){r=e,o()}}});const a=r?"OT_edge-bar-item OT_mute OT_active":"OT_edge-bar-item OT_mute";let c;n(this,{mode:e.mode,nodeName:"button",htmlContent:"Mute",htmlAttributes:{className:a,type:"button"},onCreate:e=>{t.on(e,"click",s)},onDestroy:e=>{t.off(e,"click",s)}}),this.remove=()=>{this.domElement&&this.domElement.parentNode&&(c=this.domElement.parentNode,this.domElement.parentNode.removeChild(this.domElement))},this.add=()=>{c&&this.domElement&&!this.domElement.parentNode&&c.appendChild(this.domElement)}}}},function(e,t,n){"use strict";const r=n(36),o=e=>{const t=document.createElement("div");return t.textContent=e,t.innerHTML};e.exports=function(e){let t=e.name;t&&""!==t.trim().length||(t=null,e.mode="off"),this.setName=function(e){t||this.setDisplayMode("auto"),t=o(e),this.domElement.innerHTML=t}.bind(this),t=o(t),r(this,{mode:e.mode,nodeName:"h1",htmlContent:t,htmlAttributes:{className:"OT_name OT_edge-bar-item"}})}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.global||(void 0!==typeof window?window:global);return function(){if(t.navigator.mediaDevices){const e=t.navigator.mediaDevices;return e.enumerateDevices&&e.enumerateDevices.bind(e)}}}},function(e,t,n){"use strict";const r=n(2),o=n(160).default;e.exports={isSupportedInThisBrowser:!r.isLegacyEdge&&!r.isElectron&&o&&!r.isAndroid,autoRegisters:!0,extensionRequired:!1,getConstraintsShowsPermissionUI:!1,sources:{screen:!0,application:!1,window:"Safari"!==r.name,browser:"Safari"!==r.name},register:()=>({isInstalled(e){e(void 0)},getConstraints(e,t,n){n(void 0,{video:t.video,audio:t.audio})}})}},function(e,t,n){"use strict";t.isMediaStreamTrack=e=>e&&"object"==typeof e&&"string"==typeof e.kind&&"function"==typeof e.stop&&"boolean"==typeof e.enabled},function(e,t,n){"use strict";n.r(t),function(e){var n=function(t,n,r,o){return new(r||(r=e))((function(e,i){function s(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(s,a)}c((o=o.apply(t,n||[])).next())}))},r=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};function o(){return"undefined"!=typeof window||void 0!==typeof window?window:global}t.default=function(t,i,s){return void 0===s&&(s=10),function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return n(this,void 0,void 0,(function(){var n,c,u;return r(this,(function(d){switch(d.label){case 0:n=0,c=function(){var c,u,d;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,6]),c={},[4,t.apply(void 0,a)];case 1:return[2,(c.value=r.sent(),c)];case 2:if(u=r.sent(),!1===(d=i(u,n))||null==d||n>=s)throw u;return"number"!=typeof d?[3,4]:[4,new e((function(e){return o().setTimeout(e,d)}))];case 3:return r.sent(),[3,5];case 4:if(!0!==d)throw new Error("onFailure must return boolean, or delay in ms");r.label=5;case 5:return[3,6];case 6:return[2]}}))},d.label=1;case 1:return(n+=1)?[5,c()]:[3,3];case 2:return"object"==typeof(u=d.sent())?[2,u.value]:[3,1];case 3:return[2]}}))}))}}}.call(this,n(0))},function(e,t,n){"use strict";const r=n(1)("videoContentHint"),o=["","text","motion","detail"],i=e=>o.includes(e),s=e=>{var t;return null==e||null==(t=e.getVideoTracks())?void 0:t[0]};e.exports={isValidVideoContentHint:i,setVideoContentHint:(e,t)=>{if(!i(t))return void r.warn('Invalid content hint. Valid content hints are "text", "detail", "motion", or ""');const n=s(e);n?void 0!==n.contentHint?n.contentHint=t:r.warn("contentHint not supported by this browser"):r.warn("Tried to set contentHint but no video track is present")},getVideoContentHint:e=>{const t=s(e);return(null==t?void 0:t.contentHint)||""}}},function(e,t,n){"use strict";const r=n(104);e.exports=function(){return function(e,t){let n;r(this,{muted:{get:()=>n,set(t){if(n===t)return;n=t;const r=e.getAudioTracks();for(let e=0,t=r.length;e<t;++e)r[e].enabled=!n}}}),void 0!==t?this.muted(!0===t):e.getAudioTracks().length?this.muted(!e.getAudioTracks()[0].enabled):this.muted(!1)}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(4),r=e.otError||n(11)(),o={};return(void 0!==typeof window?window:global).MediaError&&(o[(void 0!==typeof window?window:global).MediaError.MEDIA_ERR_ABORTED]={name:t.MEDIA_ERR_ABORTED,message:"The fetching process for the media resource was aborted by the user agent at the user's request."},o[(void 0!==typeof window?window:global).MediaError.MEDIA_ERR_NETWORK]={name:t.MEDIA_ERR_NETWORK,message:"A network error of some description caused the user agent to stop fetching the media resource, after the resource was established to be usable."},o[(void 0!==typeof window?window:global).MediaError.MEDIA_ERR_DECODE]={name:t.MEDIA_ERR_DECODE,message:"An error of some description occurred while decoding the media resource, after the resource was established to be usable."},o[(void 0!==typeof window?window:global).MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED]={name:t.MEDIA_ERR_SRC_NOT_SUPPORTED,message:"The media resource indicated by the src attribute was not suitable."}),function(e){const t=o[e.code];return t?r(t.name,new Error("There was an unexpected problem with the Video Stream: "+t.message)):new Error("An unknown error occurred"+(e.message?": "+e.message:"."))}}},function(e,t,n){"use strict";(function(t){var r=n(3),o=r(n(20)),i=r(n(12)),s=r(n(13)),a=r(n(18));const c=n(6),u=n(63),d=n(637),l=n(638),p=n(639),f=n(106),h=n(2),m=n(24)().hasAudioOutputApiSupport,b=n(294),g=n(105).getCurrentAudioOutputDeviceId;function v(e,t){const n=document.createElement("video");return l(n),n.autoplay=!0,n.playsinline=!0,n.innerHTML=e,n.setAttribute("autoplay",""),n.setAttribute("playsinline",""),!0===t&&(n.muted="true"),n}function y(){const e=v("");return e.setAttribute("style","display:none"),e}e.exports=function(e){void 0===e&&(e={});const r=e.audioContext||n(159)(),l=e.canBeOrientatedMixin||n(640),S=e.document||(void 0!==typeof window?window:global).document,E=e.listenForTracksEnded||n(641)(),T=e.logging||n(1),C=e.OTHelpers||n(5),w=e.videoElementErrorMap||n(292)(),R=e.WebaudioAudioLevelSampler||n(145),I=e.global||(void 0!==typeof window?window:global);let _=1;return function(){function e(e,t){var n=this;let r=e._inject,o=void 0===r?{}:r,d=o.createVideoElement,p=void 0===d?v:d,f=o.createAudioOnlyVideoElement,m=void 0===f?y:f,g=e.muted,S=e.fallbackText,E=e.widgetType;(0,a.default)(this,"_domElement",void 0),(0,a.default)(this,"_domAudioOnlyVideoElement",void 0),(0,a.default)(this,"_blockedVolume",void 0),(0,a.default)(this,"_mediaStoppedListener",void 0),(0,a.default)(this,"_audioLevelSampler",void 0),(0,a.default)(this,"_playInterrupts",0),(0,a.default)(this,"_isVideoLoadedMetaData",!1),(0,a.default)(this,"_audioOnlyVideoElementWatcher",void 0),this.logging=T("NativeVideoElementWrapper:"+_),_+=1,c(this),this._defaultAudioVolume=t,this._widgetType=E;let C=!1;this._domElement=p(S,g),this.trigger("videoElementCreated",this._domElement),this._domElementEvents=u(this._domElement),this._domElementEvents.on("loadstart",()=>this._onDomElementLoadStart()),this._domElementEvents.on("timeupdate",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.trigger("timeupdate",...t)})),this._domElementEvents.on("loadedmetadata",(0,s.default)(i.default.mark((function e(){var t,r,o,s,a=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n._isVideoLoadedMetaData=!0,t=a.length,r=new Array(t),o=0;o<t;o++)r[o]=a[o];if(n.trigger("loadedmetadata",...r),!n._domAudioOnlyVideoElement){e.next=10;break}if(s=n._domAudioOnlyVideoElement.srcObject,n._removeAudioOnlyVideoElement(),!s){e.next=10;break}return e.next=9,b();case 9:n.play();case 10:case"end":return e.stop()}}),e)}))));this._domElementEvents.on("error",e=>{this.trigger("error",w(e.target.error))},!1),this._domElementEvents.on("pause",()=>{C||(this.logging.warn("Video element paused, auto-resuming. If you intended to do this, use publishVideo(false) or subscribeToVideo(false) instead."),C=!0),this.play()}),this.on("destroyed",()=>{this._domElementEvents.removeAll(),this._domAudioOnlyVideoElementEvents&&this._domAudioOnlyVideoElementEvents.removeAll()}),l(this,()=>this._domElement),"Safari"===h.name&&"subscriber"===this._widgetType&&(this._domAudioOnlyVideoElement=m(),this._bindAudioOnlyVideoElementEvents())}var n=e.prototype;return n._onDomElementLoadStart=function(){var e=(0,s.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("subscriber"!==this._widgetType||!m()){e.next=3;break}return e.next=3,this._setActiveAudioOutputDevice();case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._setActiveAudioOutputDevice=function(){var e=(0,s.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!==(t=g())&&"default"!==t){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.setSinkId(t);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._rebindSrcObject=function(){this._domElement&&(this._domElement.srcObject=this._domElement.srcObject)},n._pauseAndPlay=function(){this._domElement&&(this._domElement.pause(),this._domElement.play())},n._startAudioOnlyVideoElementWatcher=function(){var e=(0,s.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return 1e3,t=h.isiOS,this._audioOnlyVideoElementWatcher=setInterval(()=>{this._domAudioOnlyVideoElement&&this._domAudioOnlyVideoElement.paused&&(this._domAudioOnlyVideoElement.srcObject=this._domAudioOnlyVideoElement.srcObject,t&&this._domAudioOnlyVideoElement.play())},100),e.next=5,f(1e3);case 5:clearInterval(this._audioOnlyVideoElementWatcher),this._audioOnlyVideoElementWatcher=null;case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._removeAudioOnlyVideoElement=function(){var e=(0,s.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._domAudioOnlyVideoElement.srcObject=null,this._domAudioOnlyVideoElement.parentNode.removeChild(this._domAudioOnlyVideoElement),this._domAudioOnlyVideoElementEvents&&this._domAudioOnlyVideoElementEvents.removeAll(),this._domAudioOnlyVideoElement=null;case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n.bindAudioTrackOnly=function(){var e=(0,s.default)(i.default.mark((function e(){var t,n,r,o,s,a,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._stream.getVideoTracks(),n=this._stream.getAudioTracks(),r=t[0],o=void 0===r?{}:r,s=n[0],a=void 0===s?{}:s,e.next=6,b();case 6:c=!o.enabled&&a.enabled,!this._isVideoLoadedMetaData&&c&&this._domAudioOnlyVideoElement&&(this._domAudioOnlyVideoElement.srcObject=new I.MediaStream(n),this._startAudioOnlyVideoElementWatcher());case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._bindAudioOnlyVideoElementEvents=function(){var e=this;this._domAudioOnlyVideoElementEvents=u(this._domAudioOnlyVideoElement),this._domAudioOnlyVideoElementEvents.on("pause",()=>this.play()),this._domAudioOnlyVideoElementEvents.on("timeupdate",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.trigger("timeupdate",...n)})),this._domAudioOnlyVideoElementEvents.on("loadedmetadata",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.trigger("loadedmetadata",...n)}))},n.whenTimeIncrements=function(e,t){this.once("timeupdate",()=>{e.call(t,this)})},n.domElement=function(){return this._domElement},n.videoWidth=function(){return this._domElement?Number(this._domElement["video"+(this.isRotated()?"Height":"Width")]):0},n.videoHeight=function(){return this._domElement?Number(this._domElement["video"+(this.isRotated()?"Width":"Height")]):0},n.aspectRatio=function(){return this.videoWidth()/this.videoHeight()},n.imgData=function(){const e=C.createElement("canvas",{width:this.videoWidth(),height:this.videoHeight(),style:{display:"none"}});S.body.appendChild(e);let t=null;try{e.getContext("2d").drawImage(this._domElement,0,0,e.width,e.height),t=e.toDataURL("image/png")}catch(e){}return C.removeElement(e),null===t||"data:,"===t?(this.logging.warn("Cannot get image data yet"),null):t.replace("data:image/png;base64,","").trim()},n.appendTo=function(e){return e.appendChild(this._domElement),this._domAudioOnlyVideoElement&&e.appendChild(this._domAudioOnlyVideoElement),this},n.isAudioBlocked=function(){return void 0!==this._blockedVolume},n.unblockAudio=function(){var e=(0,s.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isAudioBlocked()){e.next=3;break}return this.logging.warn("Unexpected call to unblockAudio() without blocked audio"),e.abrupt("return");case 3:return t=this._blockedVolume,this._blockedVolume=void 0,this.setAudioVolume(t),e.prev=6,e.next=9,this.play();case 9:e.next=16;break;case 11:throw e.prev=11,e.t0=e.catch(6),this._blockedVolume=t,this._domElement.muted=!0,e.t0;case 16:this.trigger("audioUnblocked");case 17:case"end":return e.stop()}}),e,this,[[6,11]])})));return function(){return e.apply(this,arguments)}}(),n.rebind=function(){var e=(0,s.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._domElement){e.next=2;break}throw new Error("Can't rebind because _domElement no longer exists");case 2:this._playInterrupts++,this._domElement.srcObject=this._domElement.srcObject,this._hasAudioOnlyVideoElement()&&(this._domAudioOnlyVideoElement.srcObject=this._domAudioOnlyVideoElement.srcObject);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._createAudioLevelSampler=function(){if(this._removeAudioLevelSampler(),this._stream.getAudioTracks().length>0){try{this._audioContext=r()}catch(e){this.logging.warn("Failed to get AudioContext(), audio level visualisation will not work",e)}this._audioContext&&(this._audioLevelSampler=new R(this._audioContext),this._audioLevelSampler.webRTCStream(this._stream))}},n._removeAudioLevelSampler=function(){this._audioContext&&(delete this._audioContext,delete this._audioLevelSampler)},n._toggleVideoTracks=function(){var e=(0,s.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._domElement.srcObject.getTracks().filter(e=>e.enabled),!(t.length>1)){e.next=8;break}return(n=t.filter(e=>"video"===e.kind)).forEach(e=>{e.enabled=!1}),e.next=7,b();case 7:n.forEach(e=>{e.enabled=!0});case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._hasAudioOnlyVideoElement=function(){return this._domAudioOnlyVideoElement&&this._domAudioOnlyVideoElement.srcObject},n.play=function(){var e=(0,s.default)(i.default.mark((function e(){var t,n,r,o,s,a,c,u,d,l,f,m;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._playInterrupts,n="Safari"===h.name,r=this._hasAudioOnlyVideoElement()?this._domAudioOnlyVideoElement:this._domElement,!n){e.next=6;break}return e.next=6,b();case 6:if(!h.isiOS||!h.isSafari){e.next=16;break}if("publisher"!==this._widgetType){e.next=15;break}if(o=h.iOSVersion>=14&&h.iOSVersion<=14.2,s=this._stream.getVideoTracks(),a=s[0],c=void 0===a?{}:a,u=this._stream.getAudioTracks(),d=u[0],l=void 0===d?{}:d,!o||p(r)||!c.enabled){e.next=13;break}return e.abrupt("return");case 13:if(!l.muted){e.next=15;break}return e.abrupt("return");case 15:this._toggleVideoTracks();case 16:return e.prev=16,e.next=19,r.play();case 19:return e.abrupt("return");case 22:if(e.prev=22,e.t0=e.catch(16),f=e.t0||{},m=f.name,"AbortError"===m&&this._playInterrupts++,!(this._playInterrupts>t)){e.next=31;break}return e.next=30,this.play();case 30:return e.abrupt("return");case 31:throw e.t0;case 32:case"end":return e.stop()}}),e,this,[[16,22]])})));return function(){return e.apply(this,arguments)}}(),n._bindToStream=function(e){this._stream=e,this._domElement.srcObject=e,this._domAudioOnlyVideoElement&&this.bindAudioTrackOnly()},n.bindToStream=function(){var e=(0,s.default)(i.default.mark((function e(t){var n,r,a,c=this;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._domElement){e.next=2;break}throw new Error("Can't bind because _domElement no longer exists");case 2:return this._bindToStream(t),(0,s.default)(i.default.mark((function e(){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.play();case 3:e.next=26;break;case 5:if(e.prev=5,e.t0=e.catch(0),n=!!t.getAudioTracks().length,!c._hasAudioOnlyVideoElement()||"NotAllowedError"!==e.t0.name){e.next=15;break}return c._domAudioOnlyVideoElement.muted=!0,e.next=12,c.play();case 12:c._domAudioOnlyVideoElement.muted=!1,e.next=26;break;case 15:if(!n){e.next=23;break}return c._blockedVolume=c.getAudioVolume(),c._domElement.muted=!0,e.next=20,c.play();case 20:c.trigger("audioBlocked"),e.next=26;break;case 23:return c._domElement.muted=!0,e.next=26,c.play();case 26:case"end":return e.stop()}}),e,null,[[0,5]])})))().catch(e=>{this.logging.debug(".play() failed: ",e)}),n={width:this._domElement.videoWidth,height:this._domElement.videoHeight},this.trigger("videoDimensionsChanged",(0,o.default)({},n),(0,o.default)({},n)),this._domElementEvents.on("resize",()=>{const e=this._domElement,t=e.videoWidth,r=e.videoHeight,i=t!==n.width,s=r!==n.height;(i||s)&&(this.trigger("videoDimensionsChanged",(0,o.default)({},n),{width:t,height:r}),n.width=t,n.height=r)}),r=()=>{this._mediaStoppedListener.stop(),this._domElement&&(this._domElement.onended=null),this.trigger("mediaStopped")},a=e=>{this.trigger("mediaStopped",e)},this._domElement.onended=()=>r(),this._mediaStoppedListener=E(t,r,a),this._createAudioLevelSampler(),e.abrupt("return",void 0);case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.unbindStream=function(){return this._domElement&&(this._domElement.srcObject=null),this._domAudioOnlyVideoElement&&(this._domAudioOnlyVideoElement.srcObject=null),this._removeAudioLevelSampler(),this},n.setAudioVolume=function(e){if(this.isAudioBlocked())return void(this._blockedVolume=e);const t=parseFloat(e)/100,n=[this.domElement()];this._domAudioOnlyVideoElement&&n.push(this._domAudioOnlyVideoElement),n.forEach(e=>{e&&(e.volume=t,e.muted=0===t)})},n.getAudioVolume=function(){if(this.isAudioBlocked())return this._blockedVolume;const e=this.domElement();return e?e.muted?0:100*e.volume:this._defaultAudioVolume},n.audioChannelType=function(e){const t=this.domElement();return void 0!==e&&(t.mozAudioChannelType=e),"mozAudioChannelType"in this._domElement?t.mozAudioChannelType:"unknown"},n.getAudioInputLevel=function(){return this._audioLevelSampler.sample()},n.refreshTracks=function(){this._mediaStoppedListener&&this._mediaStoppedListener.refresh(),this._createAudioLevelSampler()},n.destroy=function(){this._mediaStoppedListener&&this._mediaStoppedListener.stop(),this.logging.debug("removing domElementEvents"),this._domElementEvents.removeAll(),this._domAudioOnlyVideoElementEvents&&this._domAudioOnlyVideoElementEvents.removeAll(),this._audioOnlyVideoElementWatcher&&clearInterval(this._audioOnlyVideoElementWatcher),this.unbindStream(),this._domElement&&(C.removeElement(this._domElement),this._domElement=null),this._domAudioOnlyVideoElement&&(C.removeElement(this._domAudioOnlyVideoElement),this._domAudioOnlyVideoElement=null),this.trigger("destroyed"),d("NativeVideoElementWrapper",this)},n.setSinkId=function(e){const n=[this._domElement,this._domAudioOnlyVideoElement].map(t=>{if(t)return t.setSinkId(e)});return t.all(n)},e}()}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){e.exports=()=>new t(e=>setTimeout(e))}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const r=n(7),o=n(48),i=n(62),s=n(6);e.exports=function(e){void 0===e&&(e={});const a=e.getStatsHelpers||n(75),c=e.OTHelpers||n(5),u=e.PeerConnection||n(101)(),d=e.setCertificates||n(164)(),l=e.watchAudioAcquisition||n(643);return function(e){let n,p,f=e.iceConfig,h=e.webRTCStream,m=e.channels,b=e.sendMessage,g=e.capableSimulcastStreams,v=e.overrideSimulcastEnabled,y=e.logAnalyticsEvent,S=e.offerOverrides,E=e.answerOverrides,T=e.sourceStreamId,C=e.isP2pEnabled,w=!1;const R=function(){this.destroy(),w&&(w=!1,this.trigger("iceRestartFailure")),this.trigger("disconnected")},I=function(e){let t=e.reason,n=e.prefix;this.trigger("error",{reason:t,prefix:n})},_=function(e){w&&n.iceConnectionStateIsConnected()&&(w=!1,this.trigger("iceRestartSuccess")),"connected"===e&&("Chrome"===c.env.name&&(p&&p(),p=l(n.getStats.bind(n),()=>this.trigger("audioAcquisitionProblem"))),this.trigger("connected")),this.trigger("iceConnectionStateChange",e)};s(this),this.changeMediaDirectionToInactive=()=>{n&&n.changeMediaDirectionToInactive()},this.changeMediaDirectionToRecvOnly=()=>{n&&n.changeMediaDirectionToRecvOnly()},this.getDataChannel=function(e,t,r){n.getDataChannel(e,t,r)},this.getSourceStreamId=()=>n.getSourceStreamId(),this.destroy=function(){p&&(p(),p=null),n&&(n.disconnect(),n=null),this.off()},this.processMessage=function(e,t){n.processMessage(e,t)},this.addTrack=function(e,t,r){return n.addTrack(e,t,r)},this.removeTrack=function(e){return n.removeTrack(e)},this.getLocalStreams=function(){return n.getLocalStreams()},this.init=function(e,t){const o={iceConfig:f.needRumorIceServersFallback?r(f,{servers:[...e,...f.servers]}):f,channels:m,capableSimulcastStreams:g,overrideSimulcastEnabled:v};d(o,(e,o)=>{if(e)return void t(e);const i=r({logAnalyticsEvent:y,isPublisher:!0,offerOverrides:S,answerOverrides:E,sourceStreamId:T,p2p:C},o);n=new u(r({sendMessage:b},i)),n.on({close:R,error:I,qos:e=>this.trigger("qos",e),iceConnectionStateChange:_},this),n.addLocalStream(h).then(()=>{t(void 0)}).catch(t)})},this.getSenders=function(){return n.getSenders()},this.iceRestart=function(){n&&(w=!0,n.iceRestart())},this.hasRelayCandidates=()=>n.hasRelayCandidates(),this.iceConnectionStateIsConnected=function(){return n.iceConnectionStateIsConnected()},this.findAndReplaceTrack=(e,t)=>n.findAndReplaceTrack(e,t),this._testOnlyGetFramesEncoded=()=>new t((e,t)=>{n.getStats((n,r)=>{if(n)return void t(n);const s=i(r,e=>a.isVideoStat(e,r)&&a.isOutboundStat(e));s?e(o(s,["timestamp","framesEncoded"])):t(new Error("Could not find framesEncoded in getStats report"))})}),this.getStats=e=>n.getStats(e),this.getRtcStatsReport=e=>n.getRtcStatsReport(e)}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(7),o=n(6);e.exports=function(e){void 0===e&&(e={});const t=e.OTHelpers||n(5),i=e.PeerConnection||n(101)(),s=e.setCertificates||n(164)(),a=e.Errors||n(4),c=e.ExceptionCodes||n(8),u=e.OTErrorClass||n(22),d=e.watchSubscriberAudio||n(644);return function(e){let n=e.clientCandidates,l=e.iceConfig,p=e.send,f=e.logAnalyticsEvent,h=e.p2p,m=e.codecFlags,b=e.sourceStreamId;const g=this;let v,y=!1,S=!1,E=null;const T=function(){this.destroy(),S&&this.trigger("iceRestartFailure",this),this.trigger("disconnected",this)},C=function(e){this.trigger("remoteStreamAdded",e,this)},w=function(e){this.trigger("remoteStreamRemoved",e,this)},R=e=>{this.trigger("remoteVideoSupported",e)},I=function(e){let t=e.reason,n=e.prefix;this.trigger("error",null,t,this,n)},_=function(e){!S||"connected"!==e&&"completed"!==e||(S=!1,this.trigger("iceRestartSuccess")),"connected"===e&&this.trigger("connected"),this.trigger("iceConnectionStateChange",e)},x=function(e){this.trigger("signalingStateChange",e)},O=function(e){this.trigger("signalingStateStable",e)},N=(e,t)=>{"answer"!==e&&"pranswer"!==e||this.trigger("connected"),p(e,t)};o(this),this.close=function(){y||(y=!0,v&&(v.disconnect(),v=null),this.off())},this.destroy=function(){this.stopAudioStatsWatcher(),y||this.close()},this.getDataChannel=function(e,t,n){v.getDataChannel(e,t,n)},this.getSourceStreamId=()=>v.getSourceStreamId(),this.processMessage=function(e,t){v.processMessage(e,t)},this.remoteDescription=function(){return v.remoteDescription()},this.getStats=function(e){if(v)v.getStats(e);else{const n=c.PEER_CONNECTION_NOT_CONNECTED;e(new t.Error(u.getTitleByCode(n),a.PEER_CONNECTION_NOT_CONNECTED,{code:n}))}},this.getSynchronizationSources=function(e){if(v)v.getSynchronizationSources(e);else{const n=c.PEER_CONNECTION_NOT_CONNECTED;e(new t.Error(u.getTitleByCode(n),a.PEER_CONNECTION_NOT_CONNECTED,{code:n}))}},this.getRtcStatsReport=function(e){if(v)v.getRtcStatsReport(e);else{const n=c.PEER_CONNECTION_NOT_CONNECTED;e(new t.Error(u.getTitleByCode(n),a.PEER_CONNECTION_NOT_CONNECTED,{code:n}))}},this.startAudioStatsWatcher=function(e){E||(E=d(v.getStats.bind(v),e=>{this.stopAudioStatsWatcher(),this.trigger("audioLevelStuckWarning",e)},e))},this.stopAudioStatsWatcher=function(){E&&E.stop(),E=null};const k=function(e){return function(t){v&&v.remoteTracks().forEach(n=>{n.kind===e&&n.enabled!==t&&(n.enabled=t)})}};this.subscribeToAudio=k("audio"),this.subscribeToVideo=k("video"),this.hasRelayCandidates=function(){return v.hasRelayCandidates()},this.iceRestart=function(){return S=!0,v.iceRestart()},this.iceConnectionStateIsConnected=function(){return v.iceConnectionStateIsConnected()},this.init=function(e){s({iceConfig:l},(t,o)=>{if(t)return void e(t);const s=r({logAnalyticsEvent:f,clientCandidates:n,codecFlags:m,sourceStreamId:b},o);v=new i(r({sendMessage:N,p2p:h},s)),v.on({iceConnected:()=>g.emit("iceConnected"),close:T,streamAdded:C,streamRemoved:w,signalingStateChange:x,signalingStateStable:O,error:I,qos:e=>this.trigger("qos",e),iceConnectionStateChange:_,remoteVideoSupported:R},g),v.remoteTracks().length>0?v.remoteStreams().forEach(C,g):e(void 0,g)})}}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=(e.generateSimpleStateMachine||n(161)())("NotPublishing",["NotPublishing","GetUserMedia","BindingMedia","MediaBound","PublishingToSession","Publishing","Failed","Destroyed"],{NotPublishing:["NotPublishing","GetUserMedia","Destroyed"],GetUserMedia:["BindingMedia","Failed","NotPublishing","Destroyed"],BindingMedia:["MediaBound","Failed","NotPublishing","Destroyed"],MediaBound:["NotPublishing","PublishingToSession","Failed","Destroyed"],PublishingToSession:["NotPublishing","Publishing","Failed","Destroyed","MediaBound"],Publishing:["NotPublishing","MediaBound","Failed","Destroyed"],Failed:["Destroyed"],Destroyed:[]});return t.prototype.isDestroyed=function(){return"Destroyed"===this.current},t.prototype.isAttemptingToPublish=function(){return-1!==["GetUserMedia","BindingMedia","MediaBound","PublishingToSession"].indexOf(this.current)},t.prototype.isPublishing=function(){return"Publishing"===this.current},t}},function(e,t,n){"use strict";function r(e){this.message=e||"Operation has been canceled.",this.name="CancellationError",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.prototype=Object.create(Error.prototype),r.prototype.constructor=r},function(e,t,n){var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return r.resolve(e).then(e=>r.resolve(t()).then(()=>e),e=>r.resolve(t()).then(()=>r.reject(e)))}},function(e,t,n){"use strict";(function(t){var r=n(3),o=r(n(20)),i=r(n(12)),s=r(n(13));const a=n(140),c=n(147),u=n(7),d=n(276),l=n(57),p=n(50),f=n(166).CancellationError,h=n(19),m=n(42),b=n(49),g=n(268),v=n(26),y=n(6),S=n(653),E=n(103),T=n(63),C=n(654),w=n(4),R=n(165)(),I=n(655),_=n(282),x=n(143),O=n(283),N=n(144),k=n(2),Z=n(4),A=n(23)(),L=n(8),V=n(75),P=n(301),W=n(302),G=n(656),M=n(163)(),D=n(1)("Subscriber"),X=n(284)(),j=n(285),U=n(11)(),F=n(22),Y=n(5),B=n(152),H=n(142)(void 0!==typeof window?window:global),J=n(101)({global:H}),K=n(296)({PeerConnection:J}),z=n(303),Q=n(659),q=n(660),$=n(661),ee=n(662),te=n(304),ne=n(100).parseIceServers,re=n(663),oe=n(664),ie=n(665),se=n(306),ae=n(168),ce=(e,t)=>e.connection.id===t.connection.id;function ue(e,t){const n=t&&t.hasVideo&&e&&0===e.getVideoTracks().length,r=t&&t.hasAudio&&e&&0===e.getAudioTracks().length;return!(n||r)}e.exports=function(e){let n=void 0===e?{}:e,r=n.AudioLevelMeter,H=void 0===r?_:r,J=n.AudioLevelTransformer,de=void 0===J?x:J,le=n.BackingBar,pe=void 0===le?O:le,fe=n.Chrome,he=void 0===fe?N:fe,me=n.env,be=void 0===me?k:me,ge=n.Errors,ve=void 0===ge?Z:ge,ye=n.Events,Se=void 0===ye?A:ye,Ee=n.ExceptionCodes,Te=void 0===Ee?L:Ee,Ce=n.audioLevelSampler,we=void 0===Ce?G:Ce,Re=n.getStatsHelpers,Ie=void 0===Re?V:Re,_e=n.hasAudioOutputLevelStatCapability,xe=void 0===_e?P:_e,Oe=n.hasRemoteStreamsWithWebAudio,Ne=void 0===Oe?W:Oe,ke=n.interpretPeerConnectionError,Ze=void 0===ke?M:ke,Ae=n.logging,Le=void 0===Ae?D:Ae,Ve=n.MuteButton,Pe=void 0===Ve?X:Ve,We=n.NamePanel,Ge=void 0===We?j:We,Me=n.otError,De=void 0===Me?U:Me,Xe=n.OTErrorClass,je=void 0===Xe?F:Xe,Ue=n.OTHelpers,Fe=void 0===Ue?Y:Ue,Ye=n.StylableComponent,Be=void 0===Ye?B:Ye,He=n.SubscriberPeerConnection,Je=void 0===He?K:He,Ke=n.SubscribingState,ze=void 0===Ke?z:Ke,Qe=n.VideoDisabledIndicator,qe=void 0===Qe?Q:Qe,$e=n.AudioBlockedIndicator,et=void 0===$e?q:$e,tt=n.VideoUnsupportedIndicator,nt=void 0===tt?$:tt,rt=n.watchFrameRate,ot=void 0===rt?ee:rt,it=n.createSendMethod,st=void 0===it?te:it,at=n.parseIceServers,ct=void 0===at?ne:at,ut=n.document,dt=void 0===ut?(void 0!==typeof window?window:global).document:ut,lt=n.WidgetView,pt=void 0===lt?R:lt;const ft=function e(n,r,R){var _=this;if(void 0===r&&(r={}),void 0===R&&(R=()=>{}),void 0===r.analytics)throw new Error("Subscriber requires an instance of analytics");const x=r.analytics,O=h(),N=e.hasAudioOutputLevelStatCapability()||Ne(),k=this,Z={},A={},L={},V={},P={};let W,G,M,D,X,j,U,F,Y,B,J,K,z,Q,q,$,ee,te,ne=!1,le=n||O,fe=r.session,me=r.stream,ge=!1,ye={},Ee=null,Ce=!1,Re=!0,_e=[],xe=a({},r,{showControls:!0,testNetwork:!1,fitMode:me.defaultFitMode||"cover",insertDefaultUI:!0});const Oe={P2P:v.SUBSCRIBER_DISCONNECTED,MANTIS:v.SUBSCRIBER_DISCONNECTED},ke="Chrome"===be.name&&be.version>=58||be.isChromiumEdge||be.isOpera,Ae=fe._.getSocket(),Ve=()=>d(A),We=e=>A[e],Me=()=>A[te],Xe=function(){var e=(0,s.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A[t];case 2:e.sent.close(),delete A[t];case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ue=e=>{delete L[e]},Ye=function(){var e=(0,s.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return n={error:mt,audioVolume:q},e.prev=3,e.next=6,W.bindVideo(t,n);case 6:e.next=14;break;case 8:if(e.prev=8,e.t0=e.catch(3),!(e.t0 instanceof f||j.isDestroyed())){e.next=12;break}return e.abrupt("return");case 12:throw mt(e.t0),e.t0;case 14:case"end":return e.stop()}}),e,null,[[3,8]])})));return function(t){return e.apply(this,arguments)}}(),He=function(){var e=(0,s.default)(i.default.mark((function e(t,n){var r,o,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!1,"function"==typeof t?n=t:r="rtcStatsReport"===t,r?Nt():Ot(),!r||se){e.next=7;break}return o=Te.GET_RTC_STATS_REPORT_NOT_SUPPORTED,n(De(w.GET_RTC_STATS_REPORT_NOT_SUPPORTED,new Error(je.getTitleByCode(o)),o)),e.abrupt("return");case 7:if(Me()){e.next=11;break}return o=Te.PEER_CONNECTION_NOT_CONNECTED,n(De(ve.PEER_CONNECTION_NOT_CONNECTED,new Error(je.getTitleByCode(o)),o)),e.abrupt("return");case 11:return e.next=13,Me();case 13:s=e.sent,(r?s.getRtcStatsReport:s.getStats)((e,t)=>{e?(e.code===Te.PEER_CONNECTION_NOT_CONNECTED&&(e=De(ve.PEER_CONNECTION_NOT_CONNECTED,e,Te.PEER_CONNECTION_NOT_CONNECTED)),n(e)):n(null,t)});case 16:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Je=(e,t,n,r,o)=>{let i=u({action:e,variation:t,payload:n,streamId:me?me.id:null,sessionId:fe?fe.sessionId:null,connectionId:fe&&fe.isConnected()?fe.connection.connectionId:null,partnerId:fe&&fe.sessionInfo?fe.sessionInfo.partnerId:null,subscriberId:O,widgetType:"Subscriber"},r);("Failure"===t||"iceconnectionstatechange"===t&&"closed"===n)&&(i=u(i,ye));const s=[i];o&&s.push(o),x.logEvent(...s)},Ke=(e,t,n)=>{"Attempt"===t?(V[e]=(new Date).getTime(),Je(e,t,n)):"Failure"!==t&&"Success"!==t||Je(e,t,n,{attemptDuration:(new Date).getTime()-V[e]})},Qe=function(e,t){void 0===t&&(t={}),Ke("RoutedToRelayedTransition",e,t)},$e=function(e,t){void 0===t&&(t={}),Ke("RelayedToRoutedTransition",e,t)},tt=oe({onInvalidTransition(e,t){const n=`Invalid state transition: Event '${e}' not possible in state '${t}'`;Le.error(n),Je("Subscriber:InvalidStateTransition","Event",{details:n})}});{const e="Unable to subscribe to stream in a reasonable amount of time";re({connectivityState:tt,onWarning(){rt("Warning",{})},onTimeout:()=>{if(W&&W.addError(e),j.isAttemptingToSubscribe()){j.set("Failed"),this._disconnect({noStateTransition:!0});const t=De(w.TIMEOUT,new Error(e),Te.UNABLE_TO_SUBSCRIBE);tt.fail({options:{failureReason:"Subscribe",failureMessage:e,failureCode:Te.UNABLE_TO_SUBSCRIBE},error:t})}},warningMs:15e3,timeoutMs:3e4})}if(Z.promise=new t((e,t)=>{Z.resolve=e,Z.reject=t}),xe.testNetwork&&fe.sessionInfo.p2pEnabled&&Le.warn("You cannot test your network with a relayed session. Use a routed session."),this.id=le,this.widgetId=O,this.session=fe,this.stream=xe.stream,me=xe.stream,this.streamId=me.id,!fe)return je.handleJsException({errorMsg:"OT.Subscriber must be passed a session option",code:2e3,target:this,analytics:x}),null;y(this),k.once("subscribeComplete",(function(){try{R(...arguments)}catch(e){Le.error("Completion handler threw an exception",e)}}));tt.observe({onEnterConnecting(){rt("Attempt",null,{})},onEnterConnected(){rt("Success",null,{})},onEnterDisconnected(e,t){let n=void 0===t?{}:t,r=n.options,o=void 0===r?{}:r,i=n.payload,s=void 0===i?null:i;rt((e=>{let t=e.transition,n=e.from;return"fail"===t?"connected"===n?"Disconnect":"Failure":"disconnect"===t&&"connected"===n?"Disconnect":"Cancel"})(e),s,o)}}),tt.observe({onEnterConnected:()=>{this.trigger("subscribeComplete",void 0,this)},onEnterDisconnected:function(e,t){let n=e.from,r=(void 0===t?{}:t).error;"connecting"===n&&_.trigger("subscribeComplete",r||new Error("An unknown error occurred"),_)}}),ie({connectivityState:tt,logAttempt(){Je("Subscribe","Attempting",null,{connectionId:fe&&fe.isConnected()?fe.connection.connectionId:null})}});const rt=(e,t,n)=>{"Attempt"===e&&(K=(new Date).getTime()),Je("Subscribe",e,t,"Failure"===e||"Success"===e||"Cancel"===e?(0,o.default)({},n,{attemptDuration:(new Date).getTime()-K}):n)},it=(e,t)=>{Je("ICERestart",e,t)},at=e=>{var t,n;let r=e.parsedStats,o=e.remoteConnectionId,i=e.peerId,s=e.sourceStreamId;const a={widgetType:"Subscriber",width:W.width,height:W.height,audioTrack:Y&&Y.getAudioTracks().length>0,hasAudio:me&&me.hasAudio,subscribeToAudio:Q,audioVolume:this.getAudioVolume(),videoTrack:Y&&Y.getVideoTracks().length>0,connectionId:fe?fe.connection.connectionId:null,hasVideo:me&&me.hasVideo,subscribeToVideo:xe.subscribeToVideo,congestionLevel:Ee,streamId:me.id,subscriberId:O,duration:Math.round((b()-X)/1e3),remoteConnectionId:o,peerId:i,sourceStreamId:ae(s),preferredResolutionHeight:null==(t=xe.preferredResolution)?void 0:t.height,preferredResolutionWidth:null==(n=xe.preferredResolution)?void 0:n.width,preferredFrameRate:xe.preferredFrameRate,audioFallback:!B&&"auto"===J},c=u(a,r);x.logQOS(c),this.trigger("qos",x.combineWithCommon(c))},ut=()=>{!j.isSubscribing()&&W&&W.video()&&(ne=!0,Ce||(tt.connect(),Ce=!0),Le.debug("OT.Subscriber.onLoaded"),j.set("Subscribing"),X=b(),W.loading(!1),G&&G.showAfterLoading(),ge&&me.setRestrictFrameRate(!0),D&&D.audioOnly(W.audioOnly()),this.setAudioVolume(q),this.trigger("loaded",this))},lt=()=>me&&me.hasAudio&&Q&&this.getAudioVolume()>0&&!this.isAudioBlocked(),pt=e=>{let t=!1;if(!("audioLevelStuckAt0"===e&&(!lt()||me&&me.hasVideo))&&(Je("subscriber:onAudioWarning","Event",{reason:e}),W)){if(W.rebindSrcObject(),Je("subscriber:rebindSrcObject","Called"),"audioLevelStuck"===e)return;t=!0}ft(t)},ft=function(){var e=(0,s.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===t&&(t=!1),!ke){e.next=6;break}return e.next=4,Me();case 4:e.sent.startAudioStatsWatcher(t);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ht=()=>{Le.debug("OT.Subscriber has been disconnected from the Publisher's PeerConnection"),tt.fail({options:{failureReason:"PeerConnectionError",failureCode:Te.UNABLE_TO_PUBLISH,failureMessage:"PeerConnection disconnected"},error:De(ve.DISCONNECTED,new Error("ClientDisconnected"))}),this._disconnect({noStateTransition:!0}),(j.isAttemptingToSubscribe()||j.isSubscribing())&&j.set("Failed")},mt=e=>{const t=De(ve.MEDIA_ERR_DECODE,e,e.code||Te.P2P_CONNECTION_FAILED);t.message="OT.Subscriber while playing stream: "+t.message,Le.error("OT.Subscriber.onVideoError"),tt.fail({options:{failureReason:"VideoElement",failureMessage:t.message,failureCode:t.code||Te.P2P_CONNECTION_FAILED},error:t});const n=j.isAttemptingToSubscribe();j.set("Failed"),n||k.trigger("error",t.message),je.handleJsException({error:t,code:Te.UNABLE_TO_SUBSCRIBE,target:k,analytics:x})},bt=e=>{const t=C(e);je.handleJsException({error:t,code:t.code,target:k,analytics:x}),this._disconnect({noStateTransition:!0});const n={failureReason:"Subscribe",failureMessage:"OT.Subscriber PeerConnection Error: "+t.message,failureCode:Te.P2P_CONNECTION_FAILED};_t(t.code),tt.fail({options:n,error:De(t.name,new Error("Subscribe: Subscriber PeerConnection with connection (not found) failed: "+t.message),t.code)}),t.name===w.STREAM_NOT_FOUND&&this._destroy({reason:"streamNotFound",noStateTransition:!0})},gt=(e,t,n,r)=>{if("SetRemoteDescription"===r&&!Re&&t.match(/Unsupported video without audio for fallback/)){let e;return W&&W.addError("The stream is unable to be played.","Your browser does not support the video format."),e="Safari"===Fe.env.name?new Error("VP8 is not supported in this version of Safari. You might want to consider switching to an H264 project. See https://tokbox.com/safari for more information."):new Error("Video format not supported in this browser."),e.code=Te.UNSUPPORTED_VIDEO_CODEC,void mt(e)}if("ICEWorkflow"===r&&fe.sessionInfo.reconnection&&ne)return void Le.debug("Ignoring peer connection failure due to possibility of reconnection.");let o;o="ICEWorkflow"===r?Te.SUBSCRIBER_ICE_WORKFLOW_FAILED:e===Te.STREAM_LIMIT_EXCEEDED?e:Te.P2P_CONNECTION_FAILED;const i={failureReason:r||"PeerConnectionError",failureMessage:"OT.Subscriber PeerConnection Error: "+t,failureCode:o},s=Ze(e,t,r,"(not found)","Subscriber");if(tt.fail({options:i,error:s}),j.isAttemptingToSubscribe()){const e={hasRelayCandidates:n&&n.hasRelayCandidates()};Je("createPeerConnection","Failure",e,i),j.set("Failed")}else j.isSubscribing()&&(j.set("Failed"),this.trigger("error",t));this._disconnect({noStateTransition:!0}),404===Number(e)&&this._destroy({noStateTransition:!0}),je.handleJsException({errorMsg:"OT.Subscriber PeerConnection Error: "+t,errorCode:o,target:this,analytics:x}),_t(e)},vt=function(){var e=(0,s.default)(i.default.mark((function e(n,r){var o,s,a,c,u,d,l;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=1===Object.keys(L).length,s=null==r?void 0:r.getSourceStreamId(),a=fe.sessionInfo,Y=n,s&&(L[s]=n),Le.debug("OT.Subscriber.onRemoteStreamAdded with sourceStreamId",s),e.prev=6,e.next=9,S(()=>ue(Y,me));case 9:e.next=18;break;case 11:if(e.prev=11,e.t0=e.catch(6),"TIMEOUT"!==e.t0.message){e.next=17;break}Le.error("The expected tracks never arrived"),e.next=18;break;case 17:throw e.t0;case 18:return j.set("BindingRemoteStream"),_.subscribeToAudio(Q),J="loading",_.subscribeToVideo(xe.subscribeToVideo,"loading"),a.p2pEnabled||"P2P"===s||(_.setPreferredResolution(xe.preferredResolution),_.setPreferredFrameRate(xe.preferredFrameRate)),n.getVideoTracks().forEach(e=>{(void 0!==typeof window?window:global).webkitMediaStream?e.enabled=!1:e.enabled=me.hasVideo&&xe.subscribeToVideo}),e.next=26,Ye(n);case 26:if(ft(),!j.isDestroyed()){e.next=29;break}throw new Error("Subscriber destroyed");case 29:return(void 0!==typeof window?window:global).webkitMediaStream&&n.getVideoTracks().forEach(e=>{e.enabled=me.hasVideo&&xe.subscribeToVideo}),(c=W&&W.video())&&c.orientation({width:me.videoDimensions.width,height:me.videoDimensions.height,videoOrientation:me.videoDimensions.orientation}),(u=G&&G.videoUnsupportedIndicator)&&u.setVideoUnsupported(!Re),d=new t((e,t)=>{const n=W&&W.video();n&&n.domElement()?e():(W.once("videoElementCreated",e),k.once("destroyed",t))}),e.next=37,d;case 37:return e.next=39,Z.promise;case 39:if(o?j.set("Subscribing"):ut(),U&&"webRTCStream"in U&&n.getAudioTracks().length>0&&U.webRTCStream(n),!((l=Fe.env).isSafari||l.isChromiumEdge||l.isOpera||"Chrome"===l.name&&l.version>=58||l.isFirefox&&l.version>=96)){e.next=48;break}return ee&&(ee.destroy(),ee=null),e.next=46,Me();case 46:(r=e.sent)&&(ee=ot(r.getStats.bind(r)));case 48:o||_.trigger("streamAdded",_);case 49:case"end":return e.stop()}}),e,null,[[6,11]])})));return function(t,n){return e.apply(this,arguments)}}(),yt=e=>{Y=null,Le.debug("OT.Subscriber.onStreamRemoved");const t=W&&W.video();t&&t.stream===e&&W.destroyVideo(),Ue(te),this.trigger("streamRemoved",this)},St=e=>{Re!==e&&this.dispatchEvent(new Se.VideoEnabledChangedEvent(e?"videoEnabled":"videoDisabled",{reason:e?"codecChanged":"codecNotSupported"})),Re=e},Et=e=>{W.setAudioBlockedUi(e);const t=G&&G.audioBlockedIndicator;t&&t.setAudioBlocked(e);const n=G&&G.videoUnsupportedIndicator;n&&n.setVideoUnsupported(!e&&!Re)};this.on("audioBlocked",()=>{Et(!0)}),this.on("audioUnblocked",()=>{Et(!1)});const Tt={new:v.SUBSCRIBER_DISCONNECTED,checking:v.SUBSCRIBER_DISCONNECTED,connected:v.SUBSCRIBER_CONNECTED,completed:v.SUBSCRIBER_CONNECTED,disconnected:v.SUBSCRIBER_DISCONNECTED},Ct=(e,t)=>{const n=Tt[e],r=t.getSourceStreamId(),o=Oe[r];n&&n!==o&&(Oe[r]=n,"disconnected"===e&&"P2P"!==r&&setTimeout((0,s.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=fe._.isSocketReconnecting,"disconnected"!==Oe[r]||!Ae.is("connected")||t()){e.next=4;break}return e.next=4,_._.iceRestart("peer connection disconnected");case 4:case"end":return e.stop()}}),e)}))),2e3),W&&W.loading(n!==v.SUBSCRIBER_CONNECTED),Le.debug("OT.Subscriber.connectionStateChanged to "+e),this.dispatchEvent(new Se.ConnectionStateChangedEvent(n,this)))},wt=()=>{it("Success")},Rt=()=>{it("Failure",{reason:"ICEWorkflow",message:"OT.Subscriber PeerConnection Error: The stream was unable to connect due to a network error. Make sure your connection isn't blocked by a firewall."})};M={get:()=>me.getChannelsOfType("audio").length>0?k.getStyle("buttonDisplayMode"):"off",update(){const e=M.get();G&&(G.muteButton.setDisplayMode(e),G.backingBar.setMuteMode(e))}};const It=()=>{const e={backingBar:new pe({nameMode:xe.name?this.getStyle("nameDisplayMode"):"off",muteMode:M.get()}),name:new Ge({name:xe.name,mode:this.getStyle("nameDisplayMode")}),muteButton:new Pe({muted:0===q,mode:M.get()})};if(N){const t=new de;D=new H({mode:k.getStyle("audioLevelDisplayMode")});const n=new E(()=>{D.setValue(t.transform(this.loudness))});D.watchVisibilityChanged(e=>{e?n.start():n.stop()}),D.setDisplayMode(this.getStyle("audioLevelDisplayMode")),D.audioOnly(!1),e.audioLevel=D}e.videoDisabledIndicator=new qe({mode:this.getStyle("videoDisabledDisplayMode")}),e.audioBlockedIndicator=new et({mode:this.getStyle("audioBlockedDisplayMode")}),e.videoUnsupportedIndicator=new nt({mode:this.getStyle("videoUnsupportedDisplayMode")}),W&&W.domElement&&(G=new he({parent:W.domElement}).set(e).on({muted(){k.setAudioVolume(0)},unmuted(){k.setAudioVolume($)}},this),G.hideWhileLoading())},_t=e=>{let t,n;W&&(e===Te.STREAM_LIMIT_EXCEEDED?(t="The stream was unable to connect.",n="The limit for the number of media streams has been reached."):(t="The stream was unable to connect due to a network error.",n=Ce?"Ensure you have a stable connection and try again.":"Make sure you have a stable network connection and that it isn't blocked by a firewall."),W.addError(t,n))};function xt(e){Ve().forEach(function(){var t=(0,s.default)(i.default.mark((function t(n){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n;case 2:t.sent.subscribeToVideo(!e);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),W&&(W.audioOnly(e),W.showPoster(e)),D&&D.audioOnly(e)}Be(this,{nameDisplayMode:"auto",buttonDisplayMode:"auto",audioLevelDisplayMode:"auto",videoDisabledDisplayMode:"auto",audioBlockedDisplayMode:"auto",backgroundImageURI:null,showArchiveStatus:!0,showMicButton:!0},xe.showControls,e=>{Je("SetStyle","Subscriber",e,null,.1)});const Ot=p(()=>{Je("GetStats","Called")}),Nt=p(()=>{Je("GetRtcStatsReport","Called")}),kt=e=>{F&&(F.destroy(),F=void 0),Y.getAudioTracks().length&&(U=we(e),U?F=I({subscriber:this,audioLevelSampler:U}):Object.prototype.hasOwnProperty.call(this,"loudness")||(Object.defineProperty(this,"loudness",{value:void 0,configurable:!0,writable:!1}),Le.error("No suitable audio level samplers found, audio level visualisation will not work")))},Zt=(e,t)=>{if(P[t]){P[t].removeAll();const n=()=>{e.off("error",n),e.off("disconnected",n)};e.on("error",n),e.on("disconnected",n)}const n=T(e);n.once("connected",()=>(e=>{fe.sessionInfo.isAdaptiveEnabled&&"P2P"===e.getSourceStreamId()&&Qe("Success")})(e)),n.on("disconnected",ht),n.on("error",gt),n.on("remoteStreamAdded",(0,s.default)(i.default.mark((function e(){var t=arguments;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,vt(...t);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),Le.error(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})))),n.on("audioLevelStuckWarning",pt),n.on("remoteStreamRemoved",yt),n.on("signalingStateStable",(0,s.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:k.trigger("signalingStateStable"),W&&W.video()&&Y&&U&&"webRTCStream"in U&&Y.getAudioTracks().length>0&&U.webRTCStream(Y);case 3:case"end":return e.stop()}}),e)})))),n.on("iceConnectionStateChange",t=>Ct(t,e)),n.on("iceRestartSuccess",wt),n.on("iceRestartFailure",Rt),n.on("remoteVideoSupported",St),n.once("remoteStreamAdded",kt.bind(this,e)),P[t]=P};this._destroy=e=>{let t=e.reason,n=void 0===t?"Unknown":t,r=e.quiet,o=e.noStateTransition,i=void 0!==o&&o;return j.isDestroyed()||(j.set("Destroyed"),ee&&(ee.destroy(),ee=null),ye={sessionId:fe.sessionId,connectionId:fe&&fe.isConnected()?fe.connection.connectionId:null,partnerId:fe&&fe.sessionInfo?fe.sessionInfo.partnerId:null,streamId:me&&!me.destroyed?me.id:null},this._disconnect({reason:n,noStateTransition:i}),G&&(G.destroy(),G=null),W&&(W.destroy(),W.off(),W=null,this.element=null),me&&!me.destroyed&&Je("unsubscribe",null,{streamId:me.id}),me.off(z,this),this.id=null,le=null,this.stream=null,me=null,this.streamId=null,this.session=null,fe=null,xe=null,!0!==r&&(this.dispatchEvent(new Se.DestroyedEvent(v.SUBSCRIBER_DESTROYED,this,n)),this.off())),this},this.destroy=function(e,t){void 0===e&&(e="Unsubscribe"),Le.warn("Subscriber#destroy is deprecated and will be removed. Please use Session#unsubscribe instead"),_._destroy({reason:e,quiet:t})},this._disconnect=function(e){let t=void 0===e?{}:e,n=t.reason,r=void 0===n?"Unknown":n;if(!t.noStateTransition&&!tt.is("disconnected")){const e="Unsubscribe"===r?void 0:De(ve.STREAM_DESTROYED,new Error("Stream was destroyed before it could be subscribed to"));tt.disconnect({payload:{reason:r},error:e})}j.isDestroyed()||j.isFailed()||j.set("NotSubscribing"),W&&W.destroyVideo(),Ve().forEach(function(){var e=(0,s.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:e.sent.destroy();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Object.keys(A).forEach(e=>{delete A[e]}),Ae.is("connected")&&me&&!me.destroyed&&Ae.subscriberDestroy(me.id,_.widgetId)},this.disconnect=()=>{Le.warn("Subscriber#disconnect is deprecated and will be removed. Please use Session#unsubscribe instead"),this._disconnect({reason:"Unsubscribe"})};const At=function(){var e=(0,s.default)(i.default.mark((function e(t){var n,r,s,a,c,u,d;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.peerId,r=t.fromConnectionId,s=t.sourceStreamId,i={apiKey:fe.apiKey,sessionId:fe.sessionId,streamId:me.id,subscriberId:_.widgetId},a=["/v2/partner",i.apiKey,"session",i.sessionId,"stream",i.streamId,"subscriber",i.subscriberId].join("/"),c=st({socket:_.session._.getSocket(),uri:a,content:{peerId:n,sourceStreamId:s}}),u=function(e,t,r,i,a){void 0===i&&(i={});const c=(0,o.default)({peerId:n,sourceStreamId:ae(s)},i);return Je(e,t,r,c,a)},d=e=>{te===s&&at((0,o.default)({},e,{peerId:n,remoteConnectionId:r,sourceStreamId:s}))},e.abrupt("return",_._setupPeerConnection({send:c,log:u,logQoS:d,sourceStreamId:s}));case 6:case"end":return e.stop()}var i}),e)})));return function(t){return e.apply(this,arguments)}}();function Lt(e){const t=W&&W.video();if(t)try{t.setAudioVolume(e)}catch(e){Le.warn("setAudioVolume: "+e),0===q&&(Le.info("Using subscribeToAudio to mute Audio because setAudioVolume(0) failed"),k.subscribeToAudio(!1))}G&&G.muteButton.muted(0===e)}this.processMessage=function(){var e=(0,s.default)(i.default.mark((function e(t,n,r){var o,s,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Le.debug(`OT.Subscriber.processMessage: Received ${t} message from ${n}`),Le.debug(r),o=l(r,"content.peerId"),s=l(r,"content.sourceStreamId"),e.next=6,We(s);case 6:if(!(a=e.sent)){e.next=11;break}a.processMessage(t,r),e.next=16;break;case 11:if("offer"!==t){e.next=16;break}return e.next=14,At({peerId:o,fromConnectionId:n,sourceStreamId:s});case 14:a=e.sent,_.session._.addSubscriberToPeerConnectionsQueue(a,r);case 16:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),this.disableVideo=e=>{if(e){if("auto"!==J)return void Le.info("Video was not re-enabled because it was manually disabled");Le.info("Video has been re-enabled")}else Le.warn("Due to high packet loss and low bandwidth, video has been disabled");this.subscribeToVideo(e,"auto");Je("updateQuality","video",e?{videoEnabled:!0}:{videoDisabled:!0})},this.getImgData=()=>{if(!this.isSubscribing())return Le.error("OT.Subscriber.getImgData: Cannot getImgData before the Subscriber is subscribing."),null;const e=W&&W.video();return e?e.imgData():null},this.getStats=e=>{(e=>{He(e)})((t,n)=>{if(t)return void e(t);const r={timestamp:0};n.forEach(e=>{if(Ie.isInboundStat(e)){const t=Ie.isVideoStat(e,n),o=Ie.isAudioStat(e,n);(o||t)&&(r.timestamp=Ie.normalizeTimestamp(e.timestamp)),t?(c(r,{video:Ie.parseStatCategory(e)}),ee&&c(r,{video:{frameRate:ee.getFrameRateFromStat(e)}})):o&&c(r,{audio:Ie.parseStatCategory(e)})}}),e(null,r)})},this.getRtcStatsReport=()=>new t((e,t)=>{He("rtcStatsReport",(n,r)=>{n?t(n):e(r)})}),this.setAudioVolume=e=>{const t=function(e){return Math.max(0,Math.min(100,parseInt(e,10)))}(e);return Je("setAudioVolume","Attempt",{audioVolume:t}),isNaN(t)?(Le.error("OT.Subscriber.setAudioVolume: value should be an integer between 0 and 100"),Je("setAudioVolume","Failure",{message:"value should be an integer between 0 and 100"}),this):(t!==e&&Le.warn("OT.Subscriber.setAudioVolume: value should be an integer between 0 and 100"),t===q?(Lt(q),Je("setAudioVolume","Success",{audioVolume:q,message:"Requested volume is same as already set audioVolume"}),this):(q>0&&($=q),q=t,Lt(q),q>0&&!Q&&($=q,this.subscribeToAudio(!0)),Je("setAudioVolume","Success",{audioVolume:q}),this))},this.getAudioVolume=()=>{const e=W&&W.video();if(e)try{return e.getAudioVolume()}catch(e){Le.warn("getAudioVolume "+e)}return q},this.subscribeToAudio=e=>{const t=g(e,!0);Ve().forEach(function(){var e=(0,s.default)(i.default.mark((function e(n){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n;case 2:e.sent.subscribeToAudio(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),me&&0!==Ve().length&&me.setChannelActiveState("audio",t);const n=Q!==t;return Q=t,n&&this.setAudioVolume(t?$:0),Je("subscribeToAudio","Event",{subscribeToAudio:t}),this};const Vt={auto:"quality",publishVideo:"publishVideo",subscribeToVideo:"subscribeToVideo"};if("Safari"===be.name){const e=()=>{!dt.hidden&&xe.subscribeToVideo&&(Le.debug("document visibility restored in Safari - resubscribing to video"),this.subscribeToVideo(!1),this.subscribeToVideo(!0))};dt.addEventListener("visibilitychange",e),this.once("destroyed",()=>{dt.removeEventListener("visibilitychange",e)})}if(this.subscribeToVideo=(e,t)=>{const n=g(e,!0);return Je("subscribeToVideo","Attempt",{subscribeToVideo:n,reason:t}),xt(!n||!me.hasVideo||!(Y&&Y.getVideoTracks().length>0)),me.hasVideo&&Y&&0===Y.getVideoTracks().length?(n&&Le.info("Subscriber is audio-only due to incompatibility, can't subscribeToVideo."),xe.subscribeToVideo=!1,Je("subscribeToVideo","Failure",{message:"No video tracks available"}),this):(G&&G.videoDisabledIndicator&&G.videoDisabledIndicator.disableVideo("auto"===t&&!n),Ve().length>0&&fe&&me&&(n!==xe.subscribeToVideo||t!==J)&&me.setChannelActiveState("video",n,t),xe.subscribeToVideo=n,J=t,B=n,Je("subscribeToVideo","Success",{subscribeToVideo:n,reason:t}),"loading"!==t&&(this.dispatchEvent(new Se.VideoEnabledChangedEvent(n?"videoEnabled":"videoDisabled",{reason:Vt[t]||"subscribeToVideo"})),"videoDisabled"===n&&"auto"===t&&(Ee=2)),this)},this.setPreferredResolution=e=>{if(j.isDestroyed()||0===Ve().length&&"Connecting"===!j.current)return void Le.warn("Cannot set the max Resolution when not subscribing to a publisher");if(xe.preferredResolution=e,fe.sessionInfo.p2pEnabled)return void Le.warn("OT.Subscriber.setPreferredResolution will not work in a P2P Session");if(!j.isStreamAdded())return;const t=me.getPreferredResolution();t&&e&&t.width===e.width&&t.height===e.height||!t&&!e||me.setPreferredResolution(e)},this.setPreferredFrameRate=e=>{if(j.isDestroyed()||0===Ve().length&&"Connecting"===!j.current)return void Le.warn("Cannot set the max frameRate when not subscribing to a publisher");if(xe.preferredFrameRate=e,fe.sessionInfo.p2pEnabled)return void Le.warn("OT.Subscriber.setPreferredFrameRate will not work in a P2P Session");const t=me.getPreferredFrameRate();e&&t&&t===e||!t&&!e||me.setPreferredFrameRate(e)},this.isSubscribing=()=>j.isSubscribing(),this.isWebRTC=!0,this.isLoading=()=>W&&W.loading(),this.isAudioBlocked=()=>Boolean(W&&W.isAudioBlocked()),this.videoElement=()=>{const e=W&&W.video();return e?e.domElement():null},this.videoWidth=()=>{const e=W&&W.video();return e?e.videoWidth():void 0},this.videoHeight=()=>{const e=W&&W.video();return e?e.videoHeight():void 0},this._subscribeToSelf=(0,s.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=fe.getPublisherForStream(me))&&t._.webRtcStream()){e.next=5;break}tt.fail({payload:{reason:"streamNotFound"},error:De(ve.STREAM_DESTROYED,new Error("Tried to subscribe to a local publisher, but its stream no longer exists"))}),e.next=14;break;case 5:return Z.resolve(),e.prev=6,e.next=9,vt(t._.webRtcStream());case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),Le.error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])}))),this._setupPeerConnection=function(){var n=(0,s.default)(i.default.mark((function n(r){var o,s,a,c;return i.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=r.send,s=r.log,a=r.logQoS,c=r.sourceStreamId,xe.testNetwork&&_.setAudioVolume(0),0===Ve().length&&j.set("Connecting"),te=c,A[c]=new t((t,n)=>{fe._.getIceConfig().then(r=>{r.needRumorIceServersFallback&&(r.servers=[..._e||[],...r.servers||[]]);const i={iceConfig:r,subscriberId:_.widgetId,send:o,logAnalyticsEvent:s,p2p:fe.sessionInfo.p2pEnabled,sourceStreamId:c};Object.prototype.hasOwnProperty.call(xe,"codecFlags")&&(i.codecFlags=xe.codecFlags);const u=new e.SubscriberPeerConnection(i);u.once("iceConnected",Z.resolve),u.once("error",Z.reject),u.on("qos",a),Zt(u,c),u.init(e=>{e?n(e):t(u)})})}),n.abrupt("return",A[c]);case 6:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),this.restrictFrameRate=e=>(Le.debug(`OT.Subscriber.restrictFrameRate(${e})`),Je("restrictFrameRate",e.toString(),{streamId:me.id}),fe.sessionInfo.p2pEnabled&&Le.warn("OT.Subscriber.restrictFrameRate: Cannot restrictFrameRate on a P2P session"),"boolean"!=typeof e?Le.error("OT.Subscriber.restrictFrameRate: expected a boolean value got a "+typeof e):(ge=e,me.setRestrictFrameRate(e)),this),this.on("styleValueChanged",(e,t)=>{if(G)switch(e){case"nameDisplayMode":G.name.setDisplayMode(t),G.backingBar.setNameMode(t);break;case"videoUnsupportedDisplayMode":G.videoUnsupportedIndicator.setDisplayMode(t);break;case"videoDisabledDisplayMode":G.videoDisabledIndicator.setDisplayMode(t);break;case"audioBlockedDisplayMode":G.audioBlockedIndicator.setDisplayMode(t);break;case"showArchiveStatus":G.archive.setShowArchiveStatus(t);break;case"buttonDisplayMode":M.update();break;case"audioLevelDisplayMode":G.audioLevel.setDisplayMode(t);break;case"bugDisplayMode":break;case"backgroundImageURI":W.setBackgroundImageURI(t)}},this),this._={getDataChannel:(e,t,n)=>(0,s.default)(i.default.mark((function r(){return i.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(Me()){r.next=3;break}return n(new Fe.Error("Cannot create a DataChannel before there is a publisher connection.")),r.abrupt("return");case 3:return r.next=5,Me();case 5:r.sent.getDataChannel(e,t,n);case 6:case"end":return r.stop()}}),r)})))(),iceRestart:e=>(0,s.default)(i.default.mark((function t(){var n;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,We("MANTIS");case 2:(n=t.sent)?(it("Attempt",{reason:e}),Le.debug("Subscriber: iceRestart attempt"),n.iceRestart()):Le.debug("Subscriber: Skipping ice restart, we have no peer connection");case 4:case"end":return t.stop()}}),t)})))(),unblockAudio:()=>W&&W.unblockAudio(),webRtcStream:()=>Y,privateEvents:new m,startRoutedToRelayedTransition:()=>(0,s.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!xe.testNetwork&&!ce(me,fe)){e.next=2;break}return e.abrupt("return");case 2:return Qe("Attempt"),e.next=5,We("MANTIS");case 5:if(null==(t=e.sent)?void 0:t.iceConnectionStateIsConnected()){e.next=9;break}return Qe("Failure",{reason:"Attempted to transition to Relayed without being connected in Routed mode."}),e.abrupt("return");case 9:Ae.subscriberCreate(me.id,O,Mt,"P2P",(e,t)=>{e&&!tt.is("disconnected")&&Qe("Failure",e),Le.debug("message received when created a subscriber with source",t)});case 10:case"end":return e.stop()}}),e)})))(),startRelayedToRoutedTransition:()=>(0,s.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!xe.testNetwork&&!ce(me,fe)){e.next=2;break}return e.abrupt("return");case 2:return $e("Attempt"),t=L.MANTIS,Y=t,e.next=7,Ye(t);case 7:return W.loading(!1),Xe("P2P"),te="MANTIS",Ue("P2P"),e.next=13,Me();case 13:n=e.sent,kt(n),$e("Success");case 16:case"end":return e.stop()}}),e)})))(),setSinkId(e){if(W&&W.video())return W.setSinkId(e);Le.debug("Called setAudioOutputDevice on a subscriber without a video element")},pauseAndPlayVideoElement(){W&&W.pauseAndPlayVideoElement()}},j=new ze(e=>{Le.error("OT.Subscriber State Change Failed: ",e.message),Le.debug(e)}),Le.debug("OT.Subscriber: subscribe to "+me.id),j.set("Init"),!me)return Le.error("OT.Subscriber: No stream parameter."),!1;var Pt;z={updated:e=>{const t=W&&W.video();switch(e.changedProperty){case"videoDimensions":if(!t)break;t.orientation({width:e.newValue.width,height:e.newValue.height,videoOrientation:e.newValue.orientation}),this.dispatchEvent(new Se.VideoDimensionsChangedEvent(this,e.oldValue,e.newValue));break;case"videoDisableWarning":G&&G.videoDisabledIndicator.setWarning(e.newValue),this.dispatchEvent(new Se.VideoDisableWarningEvent(e.newValue?"videoDisableWarning":"videoDisableWarningLifted")),Ee="videoDisableWarning"===e.newValue?1:null;break;case"hasVideo":xt(!me.hasVideo||!xe.subscribeToVideo),"Safari"===be.name&&!me.hasVideo&&W&&W.bindAudioTrackOnly(),this.dispatchEvent(new Se.VideoEnabledChangedEvent(me.hasVideo?"videoEnabled":"videoDisabled",{reason:"publishVideo"}));break;case"hasAudio":M.update()}}},me.on(z,this),xe.name=xe.name||me.name,xe.classNames="OT_root OT_subscriber",xe.style&&this.setStyle(xe.style,null,!0),$=100,xe.subscribeToVideo=g(xe.subscribeToVideo,!0),xe.subscribeToAudio=g(xe.subscribeToAudio,!0),this.subscribeToAudio(xe.subscribeToAudio),this.setAudioVolume(void 0!==(Pt=xe).audioVolume?Pt.audioVolume:!1===Pt.subscribeToAudio?0:100),W=new e.WidgetView(n,(0,o.default)({},xe,{widgetType:"subscriber"})),W.on("error",mt),W.on("audioBlocked",()=>this.trigger("audioBlocked")),W.on("audioUnblocked",()=>this.trigger("audioUnblocked")),this.id=W.domId(),le=W.domId(),this.element=W.domElement,W.on("videoElementCreated",e=>{const t=new Se.VideoElementCreatedEvent(e),n=this;ne?this.dispatchEvent(t):this.once("loaded",()=>{n.dispatchEvent(t)})}),this.element&&It.call(this);const Wt=me.getChannelsOfType("audio"),Gt=me.getChannelsOfType("video"),Mt=Wt.map(e=>({id:e.id,type:e.type,active:xe.subscribeToAudio})).concat(Gt.map(e=>{const t={id:e.id,type:e.type,active:xe.subscribeToVideo,restrictFrameRate:void 0!==xe.restrictFrameRate&&xe.restrictFrameRate};return void 0!==xe.preferredFrameRate&&(t.preferredFrameRate=parseFloat(xe.preferredFrameRate)),void 0!==xe.preferredHeight&&(t.preferredHeight=parseInt(xe.preferredHeight,10)),void 0!==xe.preferredWidth&&(t.preferredWidth=parseInt(xe.preferredWidth,10)),t})),Dt=!xe.testNetwork&&ce(me,fe);return tt.beginConnect(),Dt?(this._subscribeToSelf(),this):(Ae.subscriberCreate(me.id,O,Mt,null,(e,t)=>{e&&!tt.is("disconnected")&&bt(e),_e=ct(t)}),this)};return ft.hasAudioOutputLevelStatCapability=xe,ft.WidgetView=pt,ft.SubscriberPeerConnection=Je,ft}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(2);e.exports=()=>["Chrome","Opera","Safari"].indexOf(r.name)>-1},function(e,t,n){"use strict";const r=n(2).name;e.exports=()=>["Firefox","Safari","Edge","Chrome","Opera"].indexOf(r)>-1},function(e,t,n){"use strict";const r=n(161)()("NotSubscribing",["NotSubscribing","Init","Connecting","BindingRemoteStream","Subscribing","Failed","Destroyed"],{NotSubscribing:["NotSubscribing","Init","Destroyed"],Init:["NotSubscribing","Connecting","BindingRemoteStream","Destroyed"],Connecting:["NotSubscribing","BindingRemoteStream","Failed","Destroyed"],BindingRemoteStream:["NotSubscribing","Subscribing","Failed","Destroyed","BindingRemoteStream"],Subscribing:["NotSubscribing","Failed","Destroyed","BindingRemoteStream"],Failed:["Destroyed"],Destroyed:[]});r.prototype.isDestroyed=function(){return"Destroyed"===this.current},r.prototype.isFailed=function(){return"Failed"===this.current},r.prototype.isSubscribing=function(){return"Subscribing"===this.current},r.prototype.isAttemptingToSubscribe=function(){return-1!==["Init","Connecting","BindingRemoteStream"].indexOf(this.current)},r.prototype.isStreamAdded=function(){return"BindingRemoteStream"===this.current||this.isSubscribing()},e.exports=r},function(e,t,n){"use strict";var r=n(3)(n(20));e.exports=e=>{let t=e.socket,n=e.uri,o=e.content;return(e,i)=>t.send({uri:n,method:e,content:(0,r.default)({},o,i)})}},function(e,t,n){var r;r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";e.exports=function(e,t){var n,r,o;for(n=1;n<arguments.length;n++)for(o in r=arguments[n])r.hasOwnProperty(o)&&(e[o]=r[o]);return e}},function(e,t,n){"use strict";var r=n(0);e.exports={build:function(e,t){var n,o,i,s=t.plugins;for(n=0,o=s.length;n<o;n++)(i=s[n]).methods&&r(e,i.methods),i.properties&&Object.defineProperties(e,i.properties)},hook:function(e,t,n){var r,o,i,s,a=e.config.plugins,c=[e.context];for(n&&(c=c.concat(n)),r=0,o=a.length;r<o;r++)s=a[r],(i=a[r][t])&&i.apply(s,c)}}},function(e,t,n){"use strict";function r(e){if(0===e.length)return e;var t,n,r=e.split(/[_-]/);if(1===r.length&&r[0][0].toLowerCase()===r[0][0])return e;for(n=r[0].toLowerCase(),t=1;t<r.length;t++)n=n+r[t].charAt(0).toUpperCase()+r[t].substring(1).toLowerCase();return n}r.prepended=function(e,t){return e+(t=r(t))[0].toUpperCase()+t.substring(1)},e.exports=r},function(e,t,n){"use strict";var r=n(0),o=n(2);function i(e,t){e=e||{},this.options=e,this.defaults=t.defaults,this.states=[],this.transitions=[],this.map={},this.lifecycle=this.configureLifecycle(),this.init=this.configureInitTransition(e.init),this.data=this.configureData(e.data),this.methods=this.configureMethods(e.methods),this.map[this.defaults.wildcard]={},this.configureTransitions(e.transitions||[]),this.plugins=this.configurePlugins(e.plugins,t.plugin)}r(i.prototype,{addState:function(e){this.map[e]||(this.states.push(e),this.addStateLifecycleNames(e),this.map[e]={})},addStateLifecycleNames:function(e){this.lifecycle.onEnter[e]=o.prepended("onEnter",e),this.lifecycle.onLeave[e]=o.prepended("onLeave",e),this.lifecycle.on[e]=o.prepended("on",e)},addTransition:function(e){this.transitions.indexOf(e)<0&&(this.transitions.push(e),this.addTransitionLifecycleNames(e))},addTransitionLifecycleNames:function(e){this.lifecycle.onBefore[e]=o.prepended("onBefore",e),this.lifecycle.onAfter[e]=o.prepended("onAfter",e),this.lifecycle.on[e]=o.prepended("on",e)},mapTransition:function(e){var t=e.name,n=e.from,r=e.to;return this.addState(n),"function"!=typeof r&&this.addState(r),this.addTransition(t),this.map[n][t]=e,e},configureLifecycle:function(){return{onBefore:{transition:"onBeforeTransition"},onAfter:{transition:"onAfterTransition"},onEnter:{state:"onEnterState"},onLeave:{state:"onLeaveState"},on:{transition:"onTransition"}}},configureInitTransition:function(e){return"string"==typeof e?this.mapTransition(r({},this.defaults.init,{to:e,active:!0})):"object"==typeof e?this.mapTransition(r({},this.defaults.init,e,{active:!0})):(this.addState(this.defaults.init.from),this.defaults.init)},configureData:function(e){return"function"==typeof e?e:"object"==typeof e?function(){return e}:function(){return{}}},configureMethods:function(e){return e||{}},configurePlugins:function(e,t){var n,r,o;for(n=0,r=(e=e||[]).length;n<r;n++)"function"==typeof(o=e[n])&&(e[n]=o=o()),o.configure&&o.configure(this);return e},configureTransitions:function(e){var t,n,r,o,i,s=this.defaults.wildcard;for(n=0;n<e.length;n++)for(r=e[n],o=Array.isArray(r.from)?r.from:[r.from||s],i=r.to||s,t=0;t<o.length;t++)this.mapTransition({name:r.name,from:o[t],to:i})},transitionFor:function(e,t){var n=this.defaults.wildcard;return this.map[e][t]||this.map[n][t]},transitionsFor:function(e){var t=this.defaults.wildcard;return Object.keys(this.map[e]).concat(Object.keys(this.map[t]))},allStates:function(){return this.states},allTransitions:function(){return this.transitions}}),e.exports=i},function(e,t,n){var r=n(0),o=n(6),i=n(1),s=[null,[]];function a(e,t){this.context=e,this.config=t,this.state=t.init.from,this.observers=[e]}r(a.prototype,{init:function(e){if(r(this.context,this.config.data.apply(this.context,e)),i.hook(this,"init"),this.config.init.active)return this.fire(this.config.init.name,[])},is:function(e){return Array.isArray(e)?e.indexOf(this.state)>=0:this.state===e},isPending:function(){return this.pending},can:function(e){return!this.isPending()&&!!this.seek(e)},cannot:function(e){return!this.can(e)},allStates:function(){return this.config.allStates()},allTransitions:function(){return this.config.allTransitions()},transitions:function(){return this.config.transitionsFor(this.state)},seek:function(e,t){var n=this.config.defaults.wildcard,r=this.config.transitionFor(this.state,e),o=r&&r.to;return"function"==typeof o?o.apply(this.context,t):o===n?this.state:o},fire:function(e,t){return this.transit(e,this.state,this.seek(e,t),t)},transit:function(e,t,n,r){var o=this.config.lifecycle,i=this.config.options.observeUnchangedState||t!==n;return n?this.isPending()?this.context.onPendingTransition(e,t,n):(this.config.addState(n),this.beginTransit(),r.unshift({transition:e,from:t,to:n,fsm:this.context}),this.observeEvents([this.observersForEvent(o.onBefore.transition),this.observersForEvent(o.onBefore[e]),i?this.observersForEvent(o.onLeave.state):s,i?this.observersForEvent(o.onLeave[t]):s,this.observersForEvent(o.on.transition),i?["doTransit",[this]]:s,i?this.observersForEvent(o.onEnter.state):s,i?this.observersForEvent(o.onEnter[n]):s,i?this.observersForEvent(o.on[n]):s,this.observersForEvent(o.onAfter.transition),this.observersForEvent(o.onAfter[e]),this.observersForEvent(o.on[e])],r)):this.context.onInvalidTransition(e,t,n)},beginTransit:function(){this.pending=!0},endTransit:function(e){return this.pending=!1,e},failTransit:function(e){throw this.pending=!1,e},doTransit:function(e){this.state=e.to},observe:function(e){if(2===e.length){var t={};t[e[0]]=e[1],this.observers.push(t)}else this.observers.push(e[0])},observersForEvent:function(e){for(var t,n=0,r=this.observers.length,o=[];n<r;n++)(t=this.observers[n])[e]&&o.push(t);return[e,o,!0]},observeEvents:function(e,t,n,r){if(0===e.length)return this.endTransit(void 0===r||r);var o=e[0][0],s=e[0][1],a=e[0][2];if(t[0].event=o,o&&a&&o!==n&&i.hook(this,"lifecycle",t),0===s.length)return e.shift(),this.observeEvents(e,t,o,r);var c=s.shift(),u=c[o].apply(c,t);return u&&"function"==typeof u.then?u.then(this.observeEvents.bind(this,e,t,o)).catch(this.failTransit.bind(this)):!1===u?this.endTransit(!1):this.observeEvents(e,t,o,u)},onInvalidTransition:function(e,t,n){throw new o("transition is invalid in current state",e,t,n,this.state)},onPendingTransition:function(e,t,n){throw new o("transition is invalid while previous transition is still in progress",e,t,n,this.state)}}),e.exports=a},function(e,t,n){"use strict";var r=n(0),o=n(2),i=n(1),s=n(3),a=n(4),c={is:function(e){return this._fsm.is(e)},can:function(e){return this._fsm.can(e)},cannot:function(e){return this._fsm.cannot(e)},observe:function(){return this._fsm.observe(arguments)},transitions:function(){return this._fsm.transitions()},allTransitions:function(){return this._fsm.allTransitions()},allStates:function(){return this._fsm.allStates()},onInvalidTransition:function(e,t,n){return this._fsm.onInvalidTransition(e,t,n)},onPendingTransition:function(e,t,n){return this._fsm.onPendingTransition(e,t,n)}},u={state:{configurable:!1,enumerable:!0,get:function(){return this._fsm.state},set:function(e){throw Error("use transitions to change state")}}};function d(e){return l(this||{},e)}function l(e,t){return p(e,new s(t,d)),e._fsm(),e}function p(e,t){if("object"!=typeof e||Array.isArray(e))throw Error("StateMachine can only be applied to objects");i.build(e,t),Object.defineProperties(e,u),r(e,c),r(e,t.methods),t.allTransitions().forEach((function(t){e[o(t)]=function(){return this._fsm.fire(t,[].slice.call(arguments))}})),e._fsm=function(){this._fsm=new a(this,t),this._fsm.init(arguments)}}d.version="3.0.1",d.factory=function(){var e,t;"function"==typeof arguments[0]?(e=arguments[0],t=arguments[1]||{}):(e=function(){this._fsm.apply(this,arguments)},t=arguments[0]||{});var n=new s(t,d);return p(e.prototype,n),e.prototype._fsm.config=n,e},d.apply=l,d.defaults={wildcard:"*",init:{name:"init",from:"none"}},e.exports=d},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o){this.message=e,this.transition=t,this.from=n,this.to=r,this.current=o}}])},e.exports=r()},function(e,t,n){"use strict";const r=n(102)();e.exports=r},function(e,t,n){"use strict";(function(t){e.exports=function(e){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return new t((t,n)=>{e(...r,(function(e){if(e)n(e);else{for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];1!==o.length?t(o):t(o[0])}}))})}}}).call(this,n(0))},function(e,t,n){"use strict";n.r(t),function(e,r){n.d(t,"BlurRadius",(function(){return Ct})),n.d(t,"createVonageMediaProcessorConnector",(function(){return Zt})),n.d(t,"getVonageEventEmitter",(function(){return Nt})),n.d(t,"isSupported",(function(){return _t})),n.d(t,"setTrackExpectedRate",(function(){return kt}));var o={exports:{}},i=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},s=i,a=Object.prototype.toString;function c(e){return Array.isArray(e)}function u(e){return void 0===e}function d(e){return"[object ArrayBuffer]"===a.call(e)}function l(e){return null!==e&&"object"==typeof e}function p(e){if("[object Object]"!==a.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function f(e){return"[object Function]"===a.call(e)}function h(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),c(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var m={isArray:c,isArrayBuffer:d,isBuffer:function(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===a.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:l,isPlainObject:p,isUndefined:u,isDate:function(e){return"[object Date]"===a.call(e)},isFile:function(e){return"[object File]"===a.call(e)},isBlob:function(e){return"[object Blob]"===a.call(e)},isFunction:f,isStream:function(e){return l(e)&&f(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===a.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:h,merge:function e(){var t={};function n(n,r){p(t[r])&&p(n)?t[r]=e(t[r],n):p(n)?t[r]=e({},n):c(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)h(arguments[r],n);return t},extend:function(e,t,n){return h(t,(function(t,r){e[r]=n&&"function"==typeof t?s(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},b=m;function g(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var v=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(b.isURLSearchParams(t))r=t.toString();else{var o=[];b.forEach(t,(function(e,t){null!=e&&(b.isArray(e)?t+="[]":e=[e],b.forEach(e,(function(e){b.isDate(e)?e=e.toISOString():b.isObject(e)&&(e=JSON.stringify(e)),o.push(g(t)+"="+g(e))})))})),r=o.join("&")}if(r){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},y=m;function S(){this.handlers=[]}S.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},S.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},S.prototype.forEach=function(e){y.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var E=S,T=m,C=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},w=C,R=function(e,t,n,r,o){var i=new Error(e);return w(i,t,n,r,o)},I=R,_=m,x=_.isStandardBrowserEnv()?{write:function(e,t,n,r,o,i){var s=[];s.push(e+"="+encodeURIComponent(t)),_.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),_.isString(r)&&s.push("path="+r),_.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},O=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},N=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},k=m,Z=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],A=m,L=A.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=A.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function V(e){this.message=e}V.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},V.prototype.__CANCEL__=!0;var P=V,W=m,G=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(I("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},M=x,D=v,X=function(e,t){return e&&!O(t)?N(e,t):t},j=function(e){var t,n,r,o={};return e?(k.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=k.trim(e.substr(0,r)).toLowerCase(),n=k.trim(e.substr(r+1)),t){if(o[t]&&Z.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o},U=L,F=R,Y=te,B=P,H=function(t){return new e((function(e,n){var r,o=t.data,i=t.headers,s=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(r),t.signal&&t.signal.removeEventListener("abort",r)}W.isFormData(o)&&delete i["Content-Type"];var c=new XMLHttpRequest;if(t.auth){var u=t.auth.username||"",d=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(u+":"+d)}var l=X(t.baseURL,t.url);function p(){if(c){var r="getAllResponseHeaders"in c?j(c.getAllResponseHeaders()):null,o={data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:t,request:c};G((function(t){e(t),a()}),(function(e){n(e),a()}),o),c=null}}if(c.open(t.method.toUpperCase(),D(l,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=p:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(p)},c.onabort=function(){c&&(n(F("Request aborted",t,"ECONNABORTED",c)),c=null)},c.onerror=function(){n(F("Network Error",t,null,c)),c=null},c.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||Y.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(F(e,t,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",c)),c=null},W.isStandardBrowserEnv()){var f=(t.withCredentials||U(l))&&t.xsrfCookieName?M.read(t.xsrfCookieName):void 0;f&&(i[t.xsrfHeaderName]=f)}"setRequestHeader"in c&&W.forEach(i,(function(e,t){void 0===o&&"content-type"===t.toLowerCase()?delete i[t]:c.setRequestHeader(t,e)})),W.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&"json"!==s&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(r=function(e){c&&(n(!e||e&&e.type?new B("canceled"):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(r),t.signal&&(t.signal.aborted?r():t.signal.addEventListener("abort",r))),o||(o=null),c.send(o)}))},J=m,K=function(e,t){T.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},z=C,Q={"Content-Type":"application/x-www-form-urlencoded"};function q(e,t){!J.isUndefined(e)&&J.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var $,ee={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&($=H),$),transformRequest:[function(e,t){return K(t,"Accept"),K(t,"Content-Type"),J.isFormData(e)||J.isArrayBuffer(e)||J.isBuffer(e)||J.isStream(e)||J.isFile(e)||J.isBlob(e)?e:J.isArrayBufferView(e)?e.buffer:J.isURLSearchParams(e)?(q(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):J.isObject(e)||t&&"application/json"===t["Content-Type"]?(q(t,"application/json"),function(e,t,n){if(J.isString(e))try{return(t||JSON.parse)(e),J.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||ee.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||r&&J.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw z(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};J.forEach(["delete","get","head"],(function(e){ee.headers[e]={}})),J.forEach(["post","put","patch"],(function(e){ee.headers[e]=J.merge(Q)}));var te=ee,ne=m,re=te,oe=function(e){return!(!e||!e.__CANCEL__)},ie=m,se=function(e,t,n){var r=this||re;return ne.forEach(n,(function(n){e=n.call(r,e,t)})),e},ae=oe,ce=te,ue=P;function de(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ue("canceled")}var le=m,pe=function(e,t){t=t||{};var n={};function r(e,t){return le.isPlainObject(e)&&le.isPlainObject(t)?le.merge(e,t):le.isPlainObject(t)?le.merge({},t):le.isArray(t)?t.slice():t}function o(n){return le.isUndefined(t[n])?le.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function i(e){if(!le.isUndefined(t[e]))return r(void 0,t[e])}function s(n){return le.isUndefined(t[n])?le.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function a(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a};return le.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||o,r=t(e);le.isUndefined(r)&&t!==a||(n[e]=r)})),n},fe="0.25.0",he=fe,me={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){me[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var be={};me.transitional=function(e,t,n){function r(e,t){return"[Axios v"+he+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,i){if(!1===e)throw new Error(r(o," has been removed"+(t?" in "+t:"")));return t&&!be[o]&&(be[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};var ge=m,ve=v,ye=E,Se=function(t){return de(t),t.headers=t.headers||{},t.data=se.call(t,t.data,t.headers,t.transformRequest),t.headers=ie.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),ie.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||ce.adapter)(t).then((function(e){return de(t),e.data=se.call(t,e.data,e.headers,t.transformResponse),e}),(function(n){return ae(n)||(de(t),n&&n.response&&(n.response.data=se.call(t,n.response.data,n.response.headers,t.transformResponse))),e.reject(n)}))},Ee=pe,Te={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],s=t[i];if(s){var a=e[i],c=void 0===a||s(a,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:me},Ce=Te.validators;function we(e){this.defaults=e,this.interceptors={request:new ye,response:new ye}}we.prototype.request=function(t,n){if("string"==typeof t?(n=n||{}).url=t:n=t||{},!n.url)throw new Error("Provided config url is not valid");(n=Ee(this.defaults,n)).method?n.method=n.method.toLowerCase():this.defaults.method?n.method=this.defaults.method.toLowerCase():n.method="get";var r=n.transitional;void 0!==r&&Te.assertOptions(r,{silentJSONParsing:Ce.transitional(Ce.boolean),forcedJSONParsing:Ce.transitional(Ce.boolean),clarifyTimeoutError:Ce.transitional(Ce.boolean)},!1);var o=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(i=i&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));var s,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!i){var c=[Se,void 0];for(Array.prototype.unshift.apply(c,o),c=c.concat(a),s=e.resolve(n);c.length;)s=s.then(c.shift(),c.shift());return s}for(var u=n;o.length;){var d=o.shift(),l=o.shift();try{u=d(u)}catch(e){l(e);break}}try{s=Se(u)}catch(t){return e.reject(t)}for(;a.length;)s=s.then(a.shift(),a.shift());return s},we.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=Ee(this.defaults,e),ve(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},ge.forEach(["delete","get","head","options"],(function(e){we.prototype[e]=function(t,n){return this.request(Ee(n||{},{method:e,url:t,data:(n||{}).data}))}})),ge.forEach(["post","put","patch"],(function(e){we.prototype[e]=function(t,n,r){return this.request(Ee(r||{},{method:e,url:t,data:n}))}}));var Re=we,Ie=P;function _e(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new e((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(t){var n,o=new e((function(e){r.subscribe(e),n=e})).then(t);return o.cancel=function(){r.unsubscribe(n)},o},t((function(e){r.reason||(r.reason=new Ie(e),n(r.reason))}))}_e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},_e.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},_e.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},_e.source=function(){var e;return{token:new _e((function(t){e=t})),cancel:e}};var xe=_e,Oe=m,Ne=m,ke=i,Ze=Re,Ae=pe;var Le=function e(t){var n=new Ze(t),r=ke(Ze.prototype.request,n);return Ne.extend(r,Ze.prototype,n),Ne.extend(r,n),r.create=function(n){return e(Ae(t,n))},r}(te);Le.Axios=Ze,Le.Cancel=P,Le.CancelToken=xe,Le.isCancel=oe,Le.VERSION=fe,Le.all=function(t){return e.all(t)},Le.spread=function(e){return function(t){return e.apply(null,t)}},Le.isAxiosError=function(e){return Oe.isObject(e)&&!0===e.isAxiosError},o.exports=Le,o.exports.default=Le;for(var Ve=[],Pe=0;Pe<256;++Pe)Ve.push((Pe+256).toString(16).substr(1));const We=new WeakMap,Ge=new WeakMap,Me=new WeakMap,De=Symbol("anyProducer"),Xe=e.resolve(),je=Symbol("listenerAdded"),Ue=Symbol("listenerRemoved");let Fe=!1;function Ye(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function Be(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function He(e,t){const n=Ge.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}function Je(e,t){const n="string"==typeof t||"symbol"==typeof t?t:De,r=Me.get(e);return r.has(n)||r.set(n,new Set),r.get(n)}function Ke(t,n){n=Array.isArray(n)?n:[n];let r=!1,o=()=>{},i=[];const s={enqueue(e){i.push(e),o()},finish(){r=!0,o()}};for(const e of n)Je(t,e).add(s);return{async next(){return i?0===i.length?r?(i=void 0,this.next()):(await new e(e=>{o=e}),this.next()):{done:!1,value:await i.shift()}:{done:!0}},async return(e){i=void 0;for(const e of n)Je(t,e).delete(s);return o(),arguments.length>0?{done:!0,value:await e}:{done:!0}},[Symbol.asyncIterator](){return this}}}function ze(e){if(void 0===e)return $e;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(const t of e)if(!$e.includes(t)){if("string"!=typeof t)throw new TypeError("`methodNames` element must be a string");throw new Error(t+" is not Emittery method")}return e}const Qe=e=>e===je||e===Ue;class qe{static mixin(e,t){return t=ze(t),n=>{if("function"!=typeof n)throw new TypeError("`target` must be function");for(const e of t)if(void 0!==n.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``);Object.defineProperty(n.prototype,e,{enumerable:!1,get:function(){return Object.defineProperty(this,e,{enumerable:!1,value:new qe}),this[e]}});const r=t=>function(...n){return this[e][t](...n)};for(const e of t)Object.defineProperty(n.prototype,e,{enumerable:!1,value:r(e)});return n}}static get isDebugEnabled(){if("object"!=typeof r)return Fe;const{env:e}=r||{env:{}};return"emittery"===e.DEBUG||"*"===e.DEBUG||Fe}static set isDebugEnabled(e){Fe=e}constructor(e={}){We.set(this,new Set),Ge.set(this,new Map),Me.set(this,new Map),this.debug=e.debug||{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{r=JSON.stringify(r),"symbol"==typeof n&&(n=n.toString());const o=new Date,i=`${o.getHours()}:${o.getMinutes()}:${o.getSeconds()}.${o.getMilliseconds()}`;console.log(`[${i}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}logIfDebugEnabled(e,t,n){(qe.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,n)}on(e,t){Be(t),e=Array.isArray(e)?e:[e];for(const n of e)Ye(n),He(this,n).add(t),this.logIfDebugEnabled("subscribe",n,void 0),Qe(n)||this.emit(je,{eventName:n,listener:t});return this.off.bind(this,e,t)}off(e,t){Be(t),e=Array.isArray(e)?e:[e];for(const n of e)Ye(n),He(this,n).delete(t),this.logIfDebugEnabled("unsubscribe",n,void 0),Qe(n)||this.emit(Ue,{eventName:n,listener:t})}once(t){return new e(e=>{const n=this.on(t,t=>{n(),e(t)})})}events(e){e=Array.isArray(e)?e:[e];for(const t of e)Ye(t);return Ke(this,e)}async emit(t,n){Ye(t),this.logIfDebugEnabled("emit",t,n),function(t,n,r){const o=Me.get(t);if(o.has(n))for(const e of o.get(n))e.enqueue(r);if(o.has(De)){const t=e.all([n,r]);for(const e of o.get(De))e.enqueue(t)}}(this,t,n);const r=He(this,t),o=We.get(this),i=[...r],s=Qe(t)?[]:[...o];await Xe,await e.all([...i.map(async e=>{if(r.has(e))return e(n)}),...s.map(async e=>{if(o.has(e))return e(t,n)})])}async emitSerial(e,t){Ye(e),this.logIfDebugEnabled("emitSerial",e,t);const n=He(this,e),r=We.get(this),o=[...n],i=[...r];await Xe;for(const e of o)n.has(e)&&await e(t);for(const n of i)r.has(n)&&await n(e,t)}onAny(e){return Be(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),We.get(this).add(e),this.emit(je,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return Ke(this)}offAny(e){Be(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(Ue,{listener:e}),We.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(const t of e)if(this.logIfDebugEnabled("clear",t,void 0),"string"==typeof t||"symbol"==typeof t){He(this,t).clear();const e=Je(this,t);for(const t of e)t.finish();e.clear()}else{We.get(this).clear();for(const e of Ge.get(this).values())e.clear();for(const e of Me.get(this).values()){for(const t of e)t.finish();e.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let t=0;for(const n of e)if("string"!=typeof n){void 0!==n&&Ye(n),t+=We.get(this).size;for(const e of Ge.get(this).values())t+=e.size;for(const e of Me.get(this).values())t+=e.size}else t+=We.get(this).size+He(this,n).size+Je(this,n).size+Je(this).size;return t}bindMethods(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");t=ze(t);for(const n of t){if(void 0!==e[n])throw new Error(`The property \`${n}\` already exists on \`target\``);Object.defineProperty(e,n,{enumerable:!1,value:this[n].bind(this)})}}}const $e=Object.getOwnPropertyNames(qe.prototype).filter(e=>"constructor"!==e);var et;Object.defineProperty(qe,"listenerAdded",{value:je,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(qe,"listenerRemoved",{value:Ue,writable:!1,enumerable:!0,configurable:!1}),(et||(et={})).FPS_DROP="fps_drop";class tt{constructor(){this.processor_=null,this.generator_=null}init(t){return new e((e,n)=>{try{this.processor_=new MediaStreamTrackProcessor(t)}catch(e){console.log("[InsertableStreamHelper] MediaStreamTrackProcessor failed: "+e),n(e)}try{"audio"===t.kind?this.generator_=new MediaStreamTrackGenerator({kind:"audio"}):"video"===t.kind?this.generator_=new MediaStreamTrackGenerator({kind:"video"}):n("kind not supported")}catch(e){console.log("[InsertableStreamHelper] MediaStreamTrackGenerator failed: "+e),n(e)}e()})}getReadable(){return this.processor_.readable}getWriteable(){return this.generator_.writable}getProccesorTrack(){return this.generator_}}class nt{constructor(e){this.insertableStreamHelper_=new tt,this.mediaProcessor_=e}setTrack(t){return new e((e,n)=>{this.insertableStreamHelper_.init(t).then(()=>{this.mediaProcessor_.transform(this.insertableStreamHelper_.getReadable(),this.insertableStreamHelper_.getWriteable()).then(()=>{e(this.insertableStreamHelper_.getProccesorTrack())}).catch(e=>{n(e)})}).catch(e=>{n(e)})})}destroy(){return new e((e,t)=>{this.mediaProcessor_?this.mediaProcessor_.destroy().then(()=>{e()}).catch(e=>{t(e)}):t("no processor")})}}const rt="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NsYXNzICR7fSQudXBkYXRlcz17dHJhbnNmb3JtZXJfbmV3OiJOZXcgdHJhbnNmb3JtZXIiLHRyYW5zZm9ybWVyX251bGw6Ik51bGwgdHJhbnNmb3JtZXIifSwkLmVycm9ycz17dHJhbnNmb3JtZXJfbm9uZToiTm8gdHJhbnNmb3JtZXJzIHByb3ZpZGVkIix0cmFuc2Zvcm1lcl9zdGFydDoiQ2Fubm90IHN0YXJ0IHRyYW5zZm9ybWVyIix0cmFuc2Zvcm1lcl90cmFuc2Zvcm06IkNhbm5vdCB0cmFuc2Zvcm0gZnJhbWUiLHRyYW5zZm9ybWVyX2ZsdXNoOiJDYW5ub3QgZ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JzZXRUcmFja0V4cGVjdGVkUmF0ZSImJmUuc2V0VHJhY2tFeHBlY3RlZFJhdGUodC5kYXRhLnJhdGUpfX19KSgpOwo=",ot="undefined"!=typeof window&&window.Blob&&new Blob([atob(rt)],{type:"text/javascript;charset=utf-8"});function it(){const e=ot&&(window.URL||window.webkitURL).createObjectURL(ot);try{return e?new Worker(e):new Worker("data:application/javascript;base64,"+rt,{type:"module"})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}const st=new WeakMap,at=new WeakMap,ct=new WeakMap,ut=Symbol("anyProducer"),dt=e.resolve(),lt=Symbol("listenerAdded"),pt=Symbol("listenerRemoved");let ft=!1;function ht(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function mt(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function bt(e,t){const n=at.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}function gt(e,t){const n="string"==typeof t||"symbol"==typeof t?t:ut,r=ct.get(e);return r.has(n)||r.set(n,new Set),r.get(n)}function vt(t,n){n=Array.isArray(n)?n:[n];let r=!1,o=()=>{},i=[];const s={enqueue(e){i.push(e),o()},finish(){r=!0,o()}};for(const e of n)gt(t,e).add(s);return{async next(){return i?0===i.length?r?(i=void 0,this.next()):(await new e(e=>{o=e}),this.next()):{done:!1,value:await i.shift()}:{done:!0}},async return(e){i=void 0;for(const e of n)gt(t,e).delete(s);return o(),arguments.length>0?{done:!0,value:await e}:{done:!0}},[Symbol.asyncIterator](){return this}}}function yt(e){if(void 0===e)return Tt;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(const t of e)if(!Tt.includes(t)){if("string"!=typeof t)throw new TypeError("`methodNames` element must be a string");throw new Error(t+" is not Emittery method")}return e}const St=e=>e===lt||e===pt;class Et{static mixin(e,t){return t=yt(t),n=>{if("function"!=typeof n)throw new TypeError("`target` must be function");for(const e of t)if(void 0!==n.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``);Object.defineProperty(n.prototype,e,{enumerable:!1,get:function(){return Object.defineProperty(this,e,{enumerable:!1,value:new Et}),this[e]}});const r=t=>function(...n){return this[e][t](...n)};for(const e of t)Object.defineProperty(n.prototype,e,{enumerable:!1,value:r(e)});return n}}static get isDebugEnabled(){if("object"!=typeof r)return ft;const{env:e}=r||{env:{}};return"emittery"===e.DEBUG||"*"===e.DEBUG||ft}static set isDebugEnabled(e){ft=e}constructor(e={}){st.set(this,new Set),at.set(this,new Map),ct.set(this,new Map),this.debug=e.debug||{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{r=JSON.stringify(r),"symbol"==typeof n&&(n=n.toString());const o=new Date,i=`${o.getHours()}:${o.getMinutes()}:${o.getSeconds()}.${o.getMilliseconds()}`;console.log(`[${i}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}logIfDebugEnabled(e,t,n){(Et.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,n)}on(e,t){mt(t),e=Array.isArray(e)?e:[e];for(const n of e)ht(n),bt(this,n).add(t),this.logIfDebugEnabled("subscribe",n,void 0),St(n)||this.emit(lt,{eventName:n,listener:t});return this.off.bind(this,e,t)}off(e,t){mt(t),e=Array.isArray(e)?e:[e];for(const n of e)ht(n),bt(this,n).delete(t),this.logIfDebugEnabled("unsubscribe",n,void 0),St(n)||this.emit(pt,{eventName:n,listener:t})}once(t){return new e(e=>{const n=this.on(t,t=>{n(),e(t)})})}events(e){e=Array.isArray(e)?e:[e];for(const t of e)ht(t);return vt(this,e)}async emit(t,n){ht(t),this.logIfDebugEnabled("emit",t,n),function(t,n,r){const o=ct.get(t);if(o.has(n))for(const e of o.get(n))e.enqueue(r);if(o.has(ut)){const t=e.all([n,r]);for(const e of o.get(ut))e.enqueue(t)}}(this,t,n);const r=bt(this,t),o=st.get(this),i=[...r],s=St(t)?[]:[...o];await dt,await e.all([...i.map(async e=>{if(r.has(e))return e(n)}),...s.map(async e=>{if(o.has(e))return e(t,n)})])}async emitSerial(e,t){ht(e),this.logIfDebugEnabled("emitSerial",e,t);const n=bt(this,e),r=st.get(this),o=[...n],i=[...r];await dt;for(const e of o)n.has(e)&&await e(t);for(const n of i)r.has(n)&&await n(e,t)}onAny(e){return mt(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),st.get(this).add(e),this.emit(lt,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return vt(this)}offAny(e){mt(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(pt,{listener:e}),st.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(const t of e)if(this.logIfDebugEnabled("clear",t,void 0),"string"==typeof t||"symbol"==typeof t){bt(this,t).clear();const e=gt(this,t);for(const t of e)t.finish();e.clear()}else{st.get(this).clear();for(const e of at.get(this).values())e.clear();for(const e of ct.get(this).values()){for(const t of e)t.finish();e.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let t=0;for(const n of e)if("string"!=typeof n){void 0!==n&&ht(n),t+=st.get(this).size;for(const e of at.get(this).values())t+=e.size;for(const e of ct.get(this).values())t+=e.size}else t+=st.get(this).size+bt(this,n).size+gt(this,n).size+gt(this).size;return t}bindMethods(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");t=yt(t);for(const n of t){if(void 0!==e[n])throw new Error(`The property \`${n}\` already exists on \`target\``);Object.defineProperty(e,n,{enumerable:!1,value:this[n].bind(this)})}}}const Tt=Object.getOwnPropertyNames(Et.prototype).filter(e=>"constructor"!==e);Object.defineProperty(Et,"listenerAdded",{value:lt,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(Et,"listenerRemoved",{value:pt,writable:!1,enumerable:!0,configurable:!1});var Ct,wt,Rt=Et;class It extends Rt{constructor(t){super(),this.config_=t,this.worker_=new it,this.trackExpectedRate_=-1,this.workerInited_=!1,this.onMessage_=new e((e,t)=>{this.worker_.addEventListener("message",n=>{let r=JSON.parse(n.data);"success"===r.callbackType?e():"error"===r.callbackType?t(r.message):"media_processor_error_event"===r.callbackType?this.emit("error",r.message):"media_processor_warn_event"===r.callbackType&&this.emit("warn",r.message)})})}transform(t,n){return new e(async(e,r)=>{let o=JSON.stringify(globalThis._vonageMediaProcessorMetadata);if("string"!=typeof o&&(o=JSON.stringify({})),"VideoBackground"===this.config_.transformerType){const e=document.createElement("video");e.src=this.config_.backgroundAssetUri,e.muted=!0;try{await e.play()}catch(e){return void r(e)}const i=e.captureStream().getVideoTracks()[0],s=new MediaStreamTrackProcessor(i).readable;this.worker_.postMessage({operation:"transform",readable:t,writable:n,config:JSON.stringify(this.config_),videoBGReadable:s,metaData:o},[t,n,s])}else this.worker_.postMessage({operation:"transform",readable:t,writable:n,config:JSON.stringify(this.config_),metaData:o},[t,n]);this.onMessage_.then(()=>{console.log("Worker inited"),this.workerInited_=!0,-1!=this.trackExpectedRate_&&this.postTrackExpectedRate(),e()}).catch(e=>{console.log("Worker inited error"),r(e)})})}destroy(){return new e(async(e,t)=>{this.worker_.postMessage({operation:"destroy"}),this.onMessage_.then(()=>{console.log("Worker destroyed"),e()}).catch(e=>{console.log("Worker destroy error"),t(e)})})}setTrackExpectedRate(e){this.trackExpectedRate_=e,this.postTrackExpectedRate()}postTrackExpectedRate(){this.workerInited_&&this.worker_.postMessage({operation:"setTrackExpectedRate",rate:this.trackExpectedRate_})}}(wt=Ct||(Ct={})).Low="Low",wt.High="High";function _t(){return new e(async(t,n)=>{try{await new e((e,t)=>{"undefined"==typeof MediaStreamTrackProcessor||"undefined"==typeof MediaStreamTrackGenerator?t("Your browser does not support the MediaStreamTrack API for Insertable Streams of Media."):e()})}catch(e){return void n(e)}(async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))().then(e=>{!1!==e?t():n("Your browser does not support WebAssembly features.")}).catch(e=>{n(e)})})}let xt,Ot=-1;function Nt(){return xt}function kt(e){Ot=e,void 0!==xt&&xt.setTrackExpectedRate(Ot)}function Zt(t){return new e(async(e,n)=>{xt=new It(t),-1!=Ot&&xt.setTrackExpectedRate(Ot);e(new nt(xt))})}}.call(this,n(0),n(43))},function(e,t,n){"use strict";const r=n(15),o=n(9),i=n(689),s=n(690),a=n(691);e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(4),c=e.ExceptionCodes||n(8),u=e.logging||n(1)("publisherInit"),d=e.otError||n(11)(),l=e.OTHelpers||n(5),p=e.Publisher||n(169)(),f=e.sessionObjects||n(21);return function(e,n,h){let m;u.debug(`OT.initPublisher(${e})`),"string"!=typeof e||document.getElementById(e)||(e=n,n=h,h=arguments[3]),"function"==typeof e?(h=e,n=void 0,e=void 0):o(e)&&!l.isElementNode(e)&&(h=n,n=e,e=void 0),"function"==typeof n&&(h=n,n=void 0),n&&(o(n)?!1===n.insertDefaultUI&&e?m="You cannot specify a target element if insertDefaultUI is false":i(n.audioSource)&&i(n.videoSource)&&(m="You cannot specify both audioSource and videoSource as null or false"):(m="properties argument to Publisher constructor, if provided, should be an object",n=void 0)),s(n),a(n);const b=new p(n||{});f.publishers.add(b);const g=function(){h&&r(h)&&(h(...arguments),h=void 0)};void 0!==m&&(u.error(m),g(d(t.INVALID_PARAMETER,new Error(m),c.INVALID_PARAMETER)));const v=function(e){b.off("publishComplete",y),g(e)};let y=function(e){b.off("initSuccess",v),e&&g(e)};return b.once("initSuccess",v),b.once("publishComplete",y),b.publish(e),b}}},function(e,t,n){"use strict";(function(t){var r=n(3)(n(20));const o=n(42),i=n(692),s=n(9),a=n(15),c=n(7),u=n(26),d=n(6),l=n(27),p=n(34)(),f=n(74),h=n(307),m=n(694),b=n(695),g=n(138).prependProxyToUrlIfNeeded,v=n(139).getProxyUrl;e.exports=function(e){void 0===e&&(e={});const y=e.adaptIceServers||n(100).adaptIceServers,S=e.AnalyticsHelper||l,E=e.APIKEY||n(72),T=e.Capabilities||n(170),C=e.convertAnvilErrorCode||n(696),w=e.convertRumorError||n(311),R=e.Errors||n(4),I=e.Events||n(23)(),_=e.Stream||n(171),x=e.ExceptionCodes||n(8),O=e.hasIceRestartsCapability||n(312),N=e.logging||n(1)("Session"),k=e.otError||n(11)(),Z=e.OTErrorClass||n(22),A=e.OTHelpers||n(5),L=n(697),V=e.StaticConfig||p,P=e.staticConfig||V.onlyLocal(),W=e.Publisher||n(169)(),G=e.RaptorSocket||n(698).default(),M=e.SessionDispatcher||n(319),D=e.sessionObjects||n(21),X=e.sessionTag||n(318),j=e.socketCloseCodes||n(76),U=e.Subscriber||n(300)(),F=e.systemRequirements||n(153),Y=e.uuid||n(19),B=b({otError:k}),H=e.global||(void 0!==typeof window?window:global),J=e.getSessionInfo||n(722)(),K=n(141),z=e.initPublisher||n(309)({Publisher:W});return function(e,n,l){var p=this;let b=void 0===l?{}:l,Q=b.iceConfig,q=b.connectionEventsSuppressed,$=b.ipWhitelist,ee=void 0!==$&&$;const te=v(),ne=new S,re=e=>"string"==typeof e?this.streams.get(e)||{id:e}:e;let oe,ie,se,ae,ce,ue,de,le;d(this),this._tag=X,F.check()||F.upgrade(),null==n&&(n=e,e=null),B(Q),this.id=n,this.sessionId=n;let pe=!0,fe=!1,he=e;const me=this;let be=n,ge=Y(),ve=Y(),ye=N,Se=!1;const Ee=[];let Te,Ce,we,Re,Ie=null;const _e=A.statable(this,["disconnected","connecting","connected","disconnecting"],"disconnected");this.connection=null,this.connections=new A.Collection,this.streams=new A.Collection,this.archives=new A.Collection;const xe=function(e){_e("disconnected"),e.code||(e.code=x.CONNECT_FAILED),ye.error(`${e.name||"Unknown Error"}: ${e.message}`),Z.handleJsException({error:e,target:this,analytics:ne}),this.trigger("sessionConnectFailed",e)},Oe=function(e){fe=!1;const t=e.reason;this.logEvent("Connect","Disconnected",{reason:e.reason});const n=new I.SessionDisconnectEvent("sessionDisconnected",t.replace("networkTimedout","networkDisconnected"));this.isConnected()&&this.disconnect(),Ce(),Te.call(this,t),setTimeout(()=>{this.dispatchEvent(n),we.call(this,n.reason),n.isDefaultPrevented()||Re.call(this,n.reason)})},Ne=function(e){q||e.id.match(/^symphony\./)||this.dispatchEvent(new I.ConnectionEvent(u.CONNECTION_CREATED,e))},ke=function(e,t){e.id.match(/^symphony\./)||oe&&e.id===oe.id()||this.dispatchEvent(new I.ConnectionEvent(u.CONNECTION_DESTROYED,e,t))},Ze=function(e){!e||!e.connection||this.connection&&e.connection.id===this.connection.id||this.dispatchEvent(new I.StreamEvent(u.STREAM_CREATED,e,null,!1))},Ae=function(e){const t=e.target,n=e.changedProperty;let r=e.newValue;"videoDisableWarning"!==n&&"audioDisableWarning"!==n&&("videoDimensions"===n&&(r={width:r.width,height:r.height}),this.dispatchEvent(new I.StreamPropertyChangedEvent(u.STREAM_PROPERTY_CHANGED,t,n,e.oldValue,r)))},Le=function(e,t){void 0===t&&(t="clientDisconnected");const n=new I.StreamEvent("streamDestroyed",e,t,!0);e.connection.id===this.connection.id?D.publishers.where({streamId:e.id}).forEach((function(n){n._.unpublishStreamFromSession(e,this,t)}),this):this.dispatchEvent(n),(()=>{D.subscribers.where({streamId:e.id}).filter(e=>e.session.id===this.id&&e.stream).forEach(e=>{e._disconnect({reason:t}),n.isDefaultPrevented()||e._destroy({reason:t,noStateTransition:!0})})})()},Ve=function(e){this.dispatchEvent(new I.ArchiveEvent("archiveStarted",e))},Pe=function(e){this.dispatchEvent(new I.ArchiveEvent("archiveDestroyed",e))},We=function(e){const t=e.target,n=e.changedProperty,r=e.newValue;"status"===n&&"stopped"===r?this.dispatchEvent(new I.ArchiveEvent("archiveStopped",t)):this.dispatchEvent(new I.ArchiveEvent("archiveUpdated",t))},Ge=()=>D.subscribers.forEach(e=>e._.pauseAndPlayVideoElement()),Me=function(){me.token=null,se=null,_e("disconnected"),oe=null,ie&&(ie.stop(),ie=null),me.connection=null,me.capabilities=new T([]),me.connections.destroy(),me.streams.destroy(),me.archives.destroy()};Ce=function(){ve=Y(),Me()},Te=function(e){D.publishers.where({session:this}).forEach(t=>{t.disconnect(e)}),D.subscribers.where({session:this}).forEach(e=>{e._disconnect()})},we=function(e){D.publishers.where({session:this}).forEach(t=>{t._.streamDestroyed(e)})},Re=function(e){D.subscribers.where({session:this}).forEach(t=>{t._destroy({reason:e})})};const De=function(){ye.debug("OT.Session: connecting to Raptor");const e=g(this.sessionInfo.messagingURL,te);oe=new G(ve,ge,e,this.sessionInfo.symphonyAddress,M(this,{connectionEventsSuppressed:q}),ne,["forceMute","adaptive"]),oe.connect(se,this.sessionInfo,{connectionEventsSuppressed:q},(e,t)=>{if(e){const t={};let n;if("ConnectToSession"===e.reason||"GetSessionState"===e.reason){const n=w(e);c(t,{originalMessage:e.message,originalCode:e.code}),e.code=n.code,e.message=n.message}(e.code||e.message||e.reason)&&(n={failureCode:e.code,failureMessage:e.message,failureReason:e.reason,socketId:oe.socketId}),oe=null,this.logConnectivityEvent("Failure",t,n);const r=function(e,t){let n;switch(e){case"WebSocketConnection":if(n=i(j.codes,e=>e===t),n)return R["SOCKET_"+n];break;case"ConnectToSession":case"GetSessionState":switch(t){case x.CONNECT_FAILED:return R.CONNECT_FAILED;case x.UNEXPECTED_SERVER_RESPONSE:return R.UNEXPECTED_SERVER_RESPONSE;case x.CONNECTION_LIMIT_EXCEEDED:return R.CONNECTION_LIMIT_EXCEEDED}}}(e.reason,e.code);return r&&(e=k(r,new Error(e.message),e.code)),void xe.call(this,e)}ye.debug("OT.Session: Received session state from Raptor",t),this.connection=this.connections.get(oe.id()),this.connection&&(this.capabilities=this.connection.permissions),_e("connected"),this.logConnectivityEvent("Success",{connectionId:this.connection.id}),this.connection.on("destroyed",Oe,this),this.dispatchEvent(new I.SessionConnectEvent(u.SESSION_CONNECTED)),this.connections.on({add:Ne,remove:ke},this),this.streams.on({add:Ze,remove:Le,update:Ae},this),this.archives.on({add:Ve,remove:Pe,update:We},this),this.connections._triggerAddEvents(),this.streams._triggerAddEvents(),this.archives._triggerAddEvents();A.env.isiOS&&A.env.iOSVersion>=13.3&&this.on("gsmCallEnded",Ge)})},Xe=e=>this.capabilities.permittedTo(e),je=(e,t)=>{N.error(`${e.name}: ${e.message}`),"function"==typeof t&&t(e),Z.handleJsException({error:e,target:this,analytics:ne})},Ue=e=>{const t=k(e.code,new Error(e.message),e.exceptionCode);return je(t),t},Fe=()=>this.isNot("connected")?Ue(L.NOT_CONNECTED):Xe("forceMute")?null:Ue(L.PERMISSION_DENIED),Ye=e=>"404"===e.code?Ue(L.NOT_FOUND):"403"===e.code?Ue(L.PERMISSION_DENIED):Ue(L.UNEXPECTED_SERVER_RESPONSE);this.reportIssue=e=>{let t=e.id;return h(ne.logEvent.bind(ne))({action:"ReportIssue",variation:"Event",connectionId:ve,payload:{reportIssueId:t}},null)},this.logEvent=function(e,t,n,r){let o={action:e,variation:t,payload:n,sessionId:be,messagingServer:ce,p2p:ae,partnerId:he,connectionId:ve};r&&(o=c(r,o)),ne.logEvent(o)},this.logConfigurationFileEvent=function(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n={}),"Attempt"===e)de=(new Date).getTime();else if("Failure"===e||"Success"===e){const e=(new Date).getTime()-de;c(n,{attemptDuration:e})}te&&(n.proxyUrl=te),this.logEvent("ConfigurationFile",e,t,(0,r.default)({},n))},this.logConnectivityEvent=function(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n={}),te&&(n.proxyUrl=te),"Attempt"===e&&(ie&&(ie.stop(),N.error("_connectivityAttemptPinger should have been cleaned up")),ue=(new Date).getTime(),ie=new f(()=>{this.logEvent("Connect","Attempting",t,(0,r.default)({},n))},.2,6),ie.start()),"Failure"===e||"Success"===e||"Cancel"===e){const o=o=>{ie&&(ie.stop(),ie=void 0),this.logEvent("Connect",e,t,(0,r.default)({},n,{attemptDuration:(new Date).getTime()-ue,iceConfig:o,ipWhitelist:ee}))};"Success"===e?this._.getIceConfig().then(e=>{const t={includeServers:Q&&Q.includeServers||"all",transportPolicy:e.transportPolicy};t.servers=e.servers?e.servers.map(e=>({url:e.urls})):[],o(t)}):o()}else this.logEvent("Connect",e,t,n)},this.connect=function(){let r;for(var o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];i.length>1&&("string"==typeof i[0]||"number"==typeof i[0])&&"string"==typeof i[1]?(null==e&&(he=i[0].toString()),r=i[1]):r=i[0];const u=i[i.length-1];if(p.is("connecting","connected"))return ye.warn("OT.Session: Cannot connect, the session is already "+p.state),p;ne.sessionInfo=new K,Me(),_e("connecting");const d=ve;function l(){const e=ve!==d;return e&&N.debug("Connection was interrupted"),e}if(p.token=!a(r)&&r,se=!a(r)&&r,pe?pe=!1:ge=Y(),u&&a(u)){let e;const t=function(){e();for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];u(void 0,...n)},n=function(){e(),u(...arguments)};e=()=>{p.off("sessionConnected",t),p.off("sessionConnectFailed",n)},p.once("sessionConnected",t),p.once("sessionConnectFailed",n)}if(null==he||a(he))return setTimeout(xe.bind(p,k(R.AUTHENTICATION_ERROR,new Error("API Key is undefined. You must pass an API Key to initSession."),x.AUTHENTICATION_ERROR))),p;if(!be||s(be)||Array.isArray(be)){let e;return be?(e="SessionID is not a string. You must use string as the session ID passed into OT.initSession().",be=be.toString()):e="SessionID is undefined. You must pass a sessionID to initSession.",setTimeout(xe.bind(p,k(R.INVALID_SESSION_ID,new Error(e),x.INVALID_SESSION_ID))),p.logConnectivityEvent("Attempt"),p.logConnectivityEvent("Failure",null,{failureReason:"ConnectToSession",failureCode:x.INVALID_SESSION_ID,failureMessage:e}),p}p.apiKey=he.toString(),he=he.toString(),0===E.value.length&&(E.value=he);const f=Boolean(V.onlyLocal().configUrl),h=!0===ee&&Boolean(V.onlyLocal().ipWhitelistConfigUrl);f||h?p.logConfigurationFileEvent("Attempt"):p.logConfigurationFileEvent("Event",{message:"No configUrl, using local config only"});const m=f||h?V.get({partnerId:he,token:r,useIpWhitelistConfigUrl:h,proxyUrl:te}):t.resolve(V.onlyLocal());return m.then(e=>((f||h)&&p.logConfigurationFileEvent("Success"),e),e=>((f||h)&&p.logConfigurationFileEvent("Failure",{failureMessage:e.message,failureStack:e.stack}),V.onlyLocal())).then(e=>{if(p.staticConfig=e,ne.staticConfig=e,!1===e.apiEnabled)throw k(R.API_KEY_DISABLED,new Error("The API KEY has been disabled. Access to the service is currently being restricted. Please contact support."));if(l())return;p.logConnectivityEvent("Attempt"),te?p.logEvent("SessionInfo","Attempt",null,{proxyUrl:te}):p.logEvent("SessionInfo","Attempt");const t=e=>{e.code=C(e.code),p.logConnectivityEvent("Failure",null,{failureReason:"GetSessionInfo",failureCode:e.code||"No code",failureMessage:e.message,failureName:e.name}),e.name&&(e=k(e.name,new Error(`${e.message}${e.code?` (${e.code})`:""}`),e.code)),xe.call(p,e)},r=g(e.apiUrl,te);return J({anvilUrl:r,sessionId:n,token:se,connectionId:ve,clientVersion:e.clientVersion}).then(n=>{if(l())return;if(n.partnerId&&n.partnerId!==he){const e="Authentication Error: The API key does not match the token or session.";return void t(k(R.AUTHENTICATION_ERROR,new Error(e),x.AUTHENTICATION_ERROR))}ne.sessionInfo=n;const r={features:{reconnection:n.reconnection,renegotiation:O()&&n.renegotiation,simulcast:void 0!==n.simulcast&&(n.simulcast&&"Chrome"===A.env.name)}};if(te&&(r.proxyUrl=te),p.is("connecting")){p.sessionInfo=n,p._.setIceServers(p.sessionInfo.iceServers),ae=n.p2pEnabled,ce=n.messagingServer,p.logEvent("SessionInfo","Success",null,r,{messagingServer:n.messagingServer});const t=e.sessionInfoOverrides;null!=t&&"object"==typeof t&&Object.keys(t).forEach(e=>{Object.defineProperty(p.sessionInfo,e,{value:t[e]})}),De.call(p)}},t)}).catch(e=>{xe.call(p,e)}),p},this.disconnect=function(){oe&&oe.isNot("disconnected")?oe.isNot("disconnecting")&&(oe.isNot("connecting")||this.logConnectivityEvent("Cancel"),_e("disconnecting"),oe.disconnect(),this.off("gsmCallEnded",Ge)):Ce()},this.destroy=function(){this.streams.destroy(),this.connections.destroy(),this.archives.destroy(),this.disconnect()},this.publish=function(e,t,n){if("function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),n=n||function(){},this.isNot("connected"))return ne.logError(1010,"OT.exception","We need to be connected before you can publish",null,{action:"Publish",variation:"Failure",failureReason:"unconnected",failureCode:x.NOT_CONNECTED,failureMessage:"We need to be connected before you can publish",sessionId:be,streamId:e&&e.stream?e.stream.id:null,p2p:this.sessionInfo?this.sessionInfo.p2pEnabled:void 0,messagingServer:this.sessionInfo?this.sessionInfo.messagingServer:null,partnerId:he}),je(k(R.NOT_CONNECTED,new Error("We need to be connected before you can publish"),x.NOT_CONNECTED),n),null;if(!Xe("publish")){const e="This token does not allow publishing. The role must be at least `publisher` to enable this functionality",t={failureReason:"Permission",failureCode:x.UNABLE_TO_PUBLISH,failureMessage:e};return this.logEvent("Publish","Failure",null,t),je(k(R.PERMISSION_DENIED,new Error(e),x.UNABLE_TO_PUBLISH),n),null}if(!e||"string"==typeof e||A.isElementNode(e))e=z(e,t);else{if(!(e instanceof W))return void je(k(R.INVALID_PARAMETER,new Error("Session.publish :: First parameter passed in is neither a string nor an instance of the Publisher"),x.UNABLE_TO_PUBLISH),n);"session"in e&&e.session&&"sessionId"in e.session&&(e.session.sessionId===this.sessionId?ye.warn(`Cannot publish ${e.guid()} again to ${this.sessionId}. Please call session.unpublish(publisher) first.`):ye.warn(`Cannot publish ${e.guid()} publisher already attached to ${e.session.sessionId}. Please call session.unpublish(publisher) first.`))}return Se&&e._.forceMuteAudio(),e._.publishToSession(this,ne).catch(e=>{throw e.message="Session.publish :: "+e.message,ye.error(e.code,e.message),e}).then(()=>e).then((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n(null,...t)}),e=>n(e)),e},this.unpublish=function(e){e?e._.unpublishFromSession(this,"unpublished"):ye.error("OT.Session.unpublish: publisher parameter missing.")},this.subscribe=function(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0,n=void 0),"function"==typeof n&&(r=n,n=void 0),r=r||function(){},!this.connection||!this.connection.connectionId)return void je(k(R.NOT_CONNECTED,new Error("Session.subscribe :: Connection required to subscribe"),x.UNABLE_TO_SUBSCRIBE),r);if(!e)return void je(k(R.INVALID_PARAMETER,new Error("Session.subscribe :: stream cannot be null"),x.UNABLE_TO_SUBSCRIBE),r);if(!Object.prototype.hasOwnProperty.call(e,"streamId"))return void je(k(R.INVALID_PARAMETER,new Error("Session.subscribe :: invalid stream object"),x.UNABLE_TO_SUBSCRIBE),r);if(n&&!1===n.insertDefaultUI&&t)return void je(k(R.INVALID_PARAMETER,new Error("You cannot specify a target element if insertDefaultUI is false"),x.INVALID_PARAMETER),r);t&&!1===t.insertDefaultUI&&(n=t,t=void 0);const o=new U(t,c(n||{},{stream:e,session:this,analytics:ne}),e=>{e?je(e,r):r(null,o)});return D.subscribers.add(o),o},this.unsubscribe=function(e){if(!e){const e="OT.Session.unsubscribe: subscriber cannot be null";throw ye.error(e),new Error(e)}return e.stream?(ye.debug("OT.Session.unsubscribe: subscriber "+e.id),e._destroy({reason:"Unsubscribe"}),!0):(ye.warn("OT.Session.unsubscribe:: tried to unsubscribe a subscriber that had no stream"),!1)},this.getSubscribersForStream=function(e){return D.subscribers.where({streamId:e.id})},this.getPublisherForStream=function(e){let t,n;if("string"==typeof e)t=e;else{if("object"!=typeof e||!e||!Object.hasOwnProperty.call(e,"id"))throw n="Session.getPublisherForStream :: Invalid stream type",ye.error(n),new Error(n);t=e.id}return D.publishers.where({streamId:t})[0]},this._={getProxyUrl:()=>te,isSocketReconnecting:()=>fe,getSocket:()=>oe,reconnecting:function(){fe=!0,this.dispatchEvent(new I.SessionReconnectingEvent)}.bind(this),reconnected:function(){fe=!1,this.dispatchEvent(new I.SessionReconnectedEvent),this.sessionInfo.reconnection&&(D.publishers.where({session:this}).forEach(e=>{e._.iceRestart()}),this.sessionInfo.p2pEnabled||D.subscribers.where({session:this}).forEach(e=>{e._.iceRestart("socket reconnected")}))}.bind(this),dispatchSignal:function(e,t,n){const r=new I.SignalEvent(t,n,e);r.target=this,this.trigger(u.SIGNAL,r),t&&this.dispatchEvent(r)}.bind(this),subscriberChannelUpdate:(e,t,n,r)=>oe?oe.subscriberChannelUpdate(e.id,t.widgetId,n.id,r):(ye.warn("You are disconnected, cannot update subscriber properties ",r),null),streamCreate(e,t,n,r,o,i,s){oe?oe.streamCreate(e,t,n,r,o,void 0,i,s):ye.warn("You are disconnected, cannot create stream ",t)},streamDestroy(e,t){oe?oe.streamDestroy(e,t):ye.warn("You are disconnected, cannot destroy stream ",e)},streamChannelUpdate(e,t,n){oe?oe.streamChannelUpdate(e.id,t.id,n):ye.warn("You are disconnected, cannot update stream properties ",n)},setSocket(e){oe=e},setLogging(e){ye=e},setState:_e,setIceServers(e){e&&(le={iceServers:y(e),timestamp:Date.now()})},getOtIceServerInfo(){if(864e5-(le?Date.now()-le.timestamp:1/0)>3e5)return t.resolve({transportPolicy:me&&me.sessionInfo&&me.sessionInfo.clientCandidates,servers:le&&le.iceServers});if(!se)return t.resolve({transportPolicy:me&&me.sessionInfo&&me.sessionInfo.clientCandidates,servers:[],needRumorIceServersFallback:!0});const e=P.clientVersion;return J({anvilUrl:(this.staticConfig||P).apiUrl,sessionId:n,token:se,connectionId:ve,clientVersion:e}).then(e=>(me._.setIceServers(e.iceServers),le?{transportPolicy:me&&me.sessionInfo&&me.sessionInfo.clientCandidates,servers:le&&le.iceServers}:{transportPolicy:me.sessionInfo.clientCandidates,servers:[],needRumorIceServersFallback:!0}))},getCodecFlags:()=>({h264:me.sessionInfo.h264,vp9:me.sessionInfo.vp9,vp8:me.sessionInfo.vp8}),getVideoCodecsCompatible:e=>m({RTCPeerConnection:H.RTCPeerConnection,env:A.env,stream:e,codecFlags:me._.getCodecFlags()}),getIceConfig:()=>{if(!Q)return me._.getOtIceServerInfo();const e=Q&&"relay"===Q.transportPolicy?"relay":me.sessionInfo.clientCandidates;return("custom"===Q.includeServers?t.resolve({servers:[]}):me._.getOtIceServerInfo()).then(t=>c(t,{transportPolicy:e,servers:[...t.servers,...Q.customServers]}))},forceMute:function(e){this.dispatchEvent(new I.MuteForcedEvent(e))}.bind(this),enableMuteOnEntry:()=>{Se=!0},addSubscriberToPeerConnectionsQueue:(e,t)=>{Ee.push({pc:e,message:t}),Ie||(Ie=setInterval(()=>{const e=Ee.pop();e?e.pc.processMessage("offer",e.message):(clearInterval(Ie),Ie=null)},100))},disableMuteOnEntry:()=>{Se=!1},privateEvents:new o},this.signal=function(e,t){let n=e,r=t||function(){};if(a(n)&&(r=n,n=null),this.isNot("connected")){const e="Unable to send signal - you are not connected to the session.";je(k(R.NOT_CONNECTED,new Error(e),500),r)}else oe.signal(n,(function(e){if(e){const t=o(e.code);return t&&(e=k(t,new Error(e.message),e.code)),void r(e)}for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r(e,...n)}),this.logEvent),e&&e.data&&"string"!=typeof e.data&&ye.warn("Signaling of anything other than Strings is deprecated. Please update the data property to be a string.");function o(e){switch(e){case 400:case 413:return R.INVALID_PARAMETER;case 429:return R.RATE_LIMIT_EXCEEDED;case 404:return R.NOT_FOUND;case 500:return R.NOT_CONNECTED;case 403:return R.PERMISSION_DENIED;case 2001:return R.UNEXPECTED_SERVER_RESPONSE;default:return}}},this.forceDisconnect=function(e,t){if(this.isNot("connected")){const e="Cannot call forceDisconnect(). You are not connected to the session.";return void je(k(R.NOT_CONNECTED,new Error(e),x.NOT_CONNECTED),t)}const n="string"==typeof e?e:e.id,r="Invalid Parameter. Check that you have passed valid parameter values into the method call.";if(!n)return void je(k(R.INVALID_PARAMETER,new Error(r),x.INVALID_PARAMETER),t);Xe("forceDisconnect")?oe.forceDisconnect(n,(function(e){if(e)je(k(R.INVALID_PARAMETER,new Error(r),x.INVALID_PARAMETER),t);else if(t&&a(t)){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];t(e,...o)}})):je(k(R.PERMISSION_DENIED,new Error("This token does not allow forceDisconnect. The role must be at least `moderator` to enable this functionality"),x.UNABLE_TO_FORCE_DISCONNECT),t)},this.forceUnpublish=function(e,t){void 0===t&&(t=()=>{});const n=e=>je(k(e.name,new Error(e.msg),e.code),t),r={msg:"Invalid Parameter. Check that you have passed valid parameter values into the method call.",code:x.INVALID_PARAMETER,name:R.INVALID_PARAMETER},o={msg:"Cannot call forceUnpublish(). You are not connected to the session.",code:x.NOT_CONNECTED,name:R.NOT_CONNECTED},i={msg:"This token does not allow forceUnpublish. The role must be at least `moderator` to enable this functionality",code:x.UNABLE_TO_FORCE_UNPUBLISH,name:R.PERMISSION_DENIED},s={msg:"The stream does not exist.",name:R.NOT_FOUND},a={msg:"An unexpected error occurred.",name:R.UNEXPECTED_SERVER_RESPONSE,code:x.UNEXPECTED_SERVER_RESPONSE};if(!e)return void n(r);if(p.isNot("connected"))return void n(o);const c=re(e);Xe("forceUnpublish")?oe.forceUnpublish(c.id,e=>{e?"404"===e.code?n(s):"403"===e.code?n(i):n(a):t(null)}):n(i)},this.forceMuteStream=e=>new t((t,n)=>{const r=Fe();r?n(r):e&&e.id?oe.forceMuteStream(e.id,e=>{e?n(Ye(e)):t()}):n(Ue(L.INVALID_PARAMETER))}),this.forceMuteAll=e=>new t((t,n)=>{const r=Fe();if(r)return void n(r);if(Array.isArray(e)&&!e.every(e=>e instanceof _)||e&&!Array.isArray(e))return void n(Ue(L.INVALID_PARAMETER));const o=(e||[]).map(e=>e.id);oe.forceMuteAll(o,!0,e=>{e?n(Ye(e)):t()})}),this.disableForceMute=()=>new t((e,t)=>{const n=Fe();n?t(n):oe.forceMuteAll([],!1,n=>{n?t(Ye(n)):e()})}),this.isConnected=()=>this.is("connected"),this.capabilities=new T([])}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(8),o=n(22),i=[400,403,409,r.CONNECTION_LIMIT_EXCEEDED],s="ConnectToSession",a="GetSessionState";e.exports=function(e){let t,n;if(e.reason===s&&e.code===r.CONNECT_FAILED)t=e.code,n=o.getTitleByCode(e.code);else if(e.code&&i.indexOf(Number(e.code))>-1)switch(t=r.CONNECT_FAILED,e.reason){case s:switch(e.code){case r.CONNECTION_LIMIT_EXCEEDED:t=e.code,n="Cannot connect -- the limit for concurrent connections to the session has been reached";break;default:n="Received error response to connection create message."}break;case a:n="Received error response to session read";break;default:n=""}else t=r.UNEXPECTED_SERVER_RESPONSE,n="Unexpected server response. Try this operation again later.";return{code:t,message:n}}},function(e,t,n){"use strict";const r=n(2),o=n(61).once;e.exports=()=>o()&&(r.isChromiumEdge||["Chrome","Safari","Firefox","Opera"].includes(r.name))},function(e,t,n){"use strict";e.exports=function(e){return JSON.stringify(e)}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;t.default=e=>{let t=e.logger,n=e.obj;e.eventNames.forEach(e=>{n.on(e,(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.spam("emitted",e,r)}))})}},function(e,t,n){"use strict";const r=n(15),o=n(22),i=n(6),s=n(1)("Dispatcher"),a=n(172),c=n(713),u=function(){i(this),this.callbacks={}};e.exports=u,u.prototype.registerCallback=function(e,t){this.callbacks[e]=t},u.prototype.triggerCallback=function(e){if(!e)return;const t=this.callbacks[e];if(t&&r(t)){const e=Array.prototype.slice.call(arguments);e.shift(),t(...e)}delete this.callbacks[e]},u.prototype.onClose=function(e){this.emit("close",e)},u.prototype.onReconnected=function(){this.emit("reconnected")},u.prototype.onReconnecting=function(){this.emit("reconnecting")},u.prototype.dispatch=function(e){if(e.type===a.STATUS){var t;let n;if(s.debug(e),e.isError){let t;if("string"==typeof e.data)try{const n=JSON.parse(e.data);n&&"object"==typeof n&&(t=n.reason)}catch(e){s.warn("Failed to parse rumorMessage.data",e)}n=new o(e.status,t)}const r=e.data?JSON.parse(e.data):"";return(null==r||null==(t=r.mute)?void 0:t.active)&&this.dispatchMuteOnEntry(),void this.triggerCallback(e.transactionId,n,e)}const n=c(e);switch(s.debug(n.signature+":",n),n.resource){case"session":this.dispatchSession(n);break;case"connection":this.dispatchConnection(n);break;case"stream":this.dispatchStream(n);break;case"stream_channel":this.dispatchStreamChannel(n);break;case"subscriber":this.dispatchSubscriber(n);break;case"subscriber_channel":this.dispatchSubscriberChannel(n);break;case"signal":this.dispatchSignal(n);break;case"archive":this.dispatchArchive(n);break;case"source":this.dispatchSource(n);break;default:s.debug(`Type ${n.resource} is not currently implemented`)}},u.prototype.dispatchSession=function(e){switch(e.method){case"read":this.emit("session#read",e.content,e.transactionId);break;case"update":this.emit("session#update",e.content);break;default:s.debug(e.signature+" is not currently implemented")}},u.prototype.dispatchMuteOnEntry=function(){this.emit("session#muted")},u.prototype.dispatchConnection=function(e){switch(e.method){case"created":this.emit("connection#created",e.content);break;case"deleted":this.emit("connection#deleted",e.params.connection,e.reason);break;default:s.debug(e.signature+" is not currently implemented")}},u.prototype.dispatchStream=function(e){switch(e.method){case"created":this.emit("stream#created",e.content,e.transactionId);break;case"deleted":this.emit("stream#deleted",e.params.stream,e.reason,e.content);break;case"updated":this.emit("stream#updated",e.params.stream,e.content);break;case"update":this.emit("stream#update",e.params.stream,e.content);break;case"generateoffer":case"answer":case"pranswer":case"offer":case"candidate":this.dispatchJsep(e.method,e);break;default:s.debug(e.signature+" is not currently implemented")}},u.prototype.dispatchStreamChannel=function(e){switch(e.method){case"updated":this.emit("streamChannel#updated",e.params.stream,e.params.channel,e.content);break;default:s.debug(e.signature+" is not currently implemented")}},u.prototype.dispatchJsep=function(e,t){this.emit("jsep#"+e,t.params.stream,t.fromAddress,t)},u.prototype.dispatchSubscriberChannel=function(e){switch(e.method){case"updated":this.emit("subscriberChannel#updated",e.params.stream,e.params.channel,e.content);break;case"update":this.emit("subscriberChannel#update",e.params.subscriber,e.params.stream,e.content);break;default:s.debug(e.signature+" is not currently implemented")}},u.prototype.dispatchSubscriber=function(e){switch(e.method){case"created":this.emit("subscriber#created",e.params.stream,e.fromAddress,e.content.id);break;case"deleted":this.dispatchJsep("unsubscribe",e),this.emit("subscriber#deleted",e.params.stream,e.fromAddress);break;case"generateoffer":case"answer":case"pranswer":case"offer":case"candidate":this.dispatchJsep(e.method,e);break;default:s.debug(e.signature+" is not currently implemented")}},u.prototype.dispatchSignal=function(e){"signal"===e.method?this.emit("signal",e.fromAddress,e.content):s.debug(e.signature+" is not currently implemented")},u.prototype.dispatchArchive=function(e){switch(e.method){case"created":this.emit("archive#created",e.content);break;case"updated":this.emit("archive#updated",e.params.archive,e.content)}},u.prototype.dispatchSource=function(e){switch(e.method){case"create":this.emit("source#create",e.params.source,e.params.stream,e.reason);break;case"delete":this.emit("source#delete",e.params.source,e.params.stream,e.reason);break;default:s.debug(e.signature+" is not currently implemented")}}},function(e,t,n){"use strict";const r=n(19),o=n(5),i=n(716),s=n(717),a=n(313),c=n(718),u=n(34)().onlyLocal(),d={};e.exports=d,d.connections={},d.connections.create=function(e){const t=e.apiKey,n=e.sessionId,r=e.connectionId,i=e.connectionEventsSuppressed,s=e.capabilities;return a({method:"create",uri:`/v2/partner/${t}/session/${n}/connection/${r}`,content:{userAgent:o.env.userAgent,clientVersion:u.clientVersion,capabilities:s||[],connectionEventsSuppressed:i}})},d.connections.destroy=function(e){const t=e.apiKey,n=e.sessionId,r=e.connectionId;return a({method:"delete",uri:`/v2/partner/${t}/session/${n}/connection/${r}`,content:{}})},d.sessions={},d.sessions.get=function(e,t){return a({method:"read",uri:`/v2/partner/${e}/session/${t}`,content:{}})},d.streams={},d.streams.get=function(e,t,n){return a({method:"read",uri:`/v2/partner/${e}/session/${t}/stream/${n}`,content:{}})},d.streams.channelFromOTChannel=function(e){const t={id:e.id,type:e.type,active:e.active};return"video"===e.type&&(t.width=e.width,t.height=e.height,t.orientation=e.orientation,t.frameRate=e.frameRate,"default"!==e.source&&(t.source=e.source),t.fitMode=e.fitMode),t},d.streams.create=function(e){void 0===e&&(e={});const t=e,n=t.apiKey,r=t.sessionId,o=t.streamId,i=t.name,s=t.audioFallbackEnabled,c=t.channels,u=t.minBitrate,l=t.maxBitrate,p=t.sourceStreamId,f={id:o,name:i,audioFallbackEnabled:s,channel:c.map(e=>d.streams.channelFromOTChannel(e))};return u&&(f.minBitrate=Math.round(u)),l&&(f.maxBitrate=Math.round(l)),p&&(f.sourceStreamId=p),a({method:"create",uri:`/v2/partner/${n}/session/${r}/stream/${o}`,content:f})},d.streams.destroy=function(e,t,n,r){const o={};return r&&(o.sourceStreamId=r),a({method:"delete",uri:`/v2/partner/${e}/session/${t}/stream/${n}`,content:o})},d.streamChannels={},d.streamChannels.update=function(e,t,n,r,o){return a({method:"update",uri:`/v2/partner/${e}/session/${t}/stream/${n}/channel/${r}`,content:o})},d.subscribers={},d.subscribers.create=function(e){void 0===e&&(e={});const t=e,n=t.apiKey,r=t.sessionId,o=t.streamId,u=t.subscriberId,d=t.connectionId,l=t.channelsToSubscribeTo,p=t.sourceStreamId,f={id:u,connection:d,keyManagementMethod:c,bundleSupport:i(),rtcpMuxSupport:s()};return l&&(f.channel=l),p&&(f.sourceStreamId=p),a({method:"create",uri:`/v2/partner/${n}/session/${r}/stream/${o}/subscriber/${u}`,content:f})},d.subscribers.destroy=function(e,t,n,r){return a({method:"delete",uri:`/v2/partner/${e}/session/${t}/stream/${n}/subscriber/${r}`,content:{}})},d.subscribers.update=function(e,t,n,r,o){return a({method:"update",uri:`/v2/partner/${e}/session/${t}/stream/${n}/subscriber/${r}`,content:o})},d.subscriberChannels={},d.subscriberChannels.update=function(e,t,n,r,o,i){return a({method:"update",uri:`/v2/partner/${e}/session/${t}/stream/${n}/subscriber/${r}/channel/${o}`,content:i})},d.signals={},d.signals.create=function(e,t,n,o,i){const s={};return void 0!==o&&(s.type=o),void 0!==i&&(s.data=i),a({method:"signal",uri:`/v2/partner/${e}/session/${t}${void 0!==n?"/connection/"+n:""}/signal/${r()}`,content:s})},d.forceMute={},d.forceMute.update=e=>{const t=e.apiKey,n=e.sessionId,r=e.streamId,o=e.active,i=e.excludedStreamIds,s={reason:"mute",channels:["audio"],active:o,locked:!1};return i&&(s.exclusion=i),a({method:"update",uri:`/v2/partner/${t}/session/${n}${r?"/stream/"+r:""}`,content:s})}},function(e,t,n){"use strict";const r=n(37),o=n(72),i=n(173),s=n(316),a=n(318);e.exports=function(e,t,n){var c;this.toRaptorMessage=function(){let t=this.to;return t&&"string"!=typeof t&&(t=t.id),s.signals.create(o.value,e,t,this.type,this.data)},this.toHash=function(){return n},this.error=null,this.retryAfterReconnect=!0,n&&(n.hasOwnProperty("data")&&(this.data=r(n.data),this.error=function(e){let t=null;if(null==e)t={code:400,reason:"The signal data was null or undefined. Either set it to a String value or omit it"};else try{JSON.stringify(e).length>8192&&(t={code:413,reason:"The data field was too long, the maximum size of it is 8192 characters"})}catch(e){t={code:400,reason:"The data field was not valid JSON"}}return t}(this.data)),n.hasOwnProperty("to")&&(this.to=n.to,this.error||(this.error=(c=this.to)?c instanceof i||c._tag===a?null:{code:400,reason:"The To field was invalid"}:{code:400,reason:"The signal to field was invalid. Either set it to a OT.Connection, OT.Session, or omit it entirely"})),n.hasOwnProperty("type")&&(this.error||(this.error=function(e){let t=null;return null==e?t={code:400,reason:"The signal type was null or undefined. Either set it to a String value or omit it"}:e.length>128?t={code:413,reason:"The signal type was too long, the maximum length of it is 128 characters"}:function(e){return!/^[a-zA-Z0-9\-\._~]+$/.exec(e)}(e)&&(t={code:400,reason:"The signal type was invalid, it can only contain letters, numbers, '-', '_', and '~'."}),t}(n.type)),this.type=n.type),n.hasOwnProperty("retryAfterReconnect")&&(this.error||(this.error=function(e){let t=null;return!0!==e&&!1!==e&&(t={code:400,reason:"The signal retryAfterReconnect was not true or false. Either set it to a Boolean value or omit it"}),t}(n.retryAfterReconnect)),this.retryAfterReconnect=n.retryAfterReconnect)),this.valid=null===this.error}},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(3),o=r(n(12)),i=r(n(13));const s=n(320),a=n(49),c=n(173),u=n(721),d=n(315),l=n(1)("SessionDispatcher"),p=n(21),f=n(171),h=n(150),m=n(168);function b(e,t){if(t.streams.has(e.id))return;const n=function(e,t){const n=e.channel.map(e=>new h(e)),r=e.connectionId?e.connectionId:e.connection.id;return new f(e.id,e.name,e.creationTime,t.connections.get(r),t,n)}(e,t);return t.streams.add(n),n}function g(e,t){if(t.archives.has(e.id))return;const n=function(e){return new s(e.id,e.name,e.status)}(e);return t.archives.add(n),n}const v=function(e){const t={};this.enqueue=function(){const n=arguments[0],r=Array.prototype.slice.call(arguments,1);t[n]||(t[n]=new u(e)),t[n].enqueue.apply(t[n],r)},this.triggerConnectionCreated=function(e){t["connectionCreated"+e.id]&&t["connectionCreated"+e.id].triggerAll()},this.triggerSessionConnected=function(e){t.sessionConnected&&t.sessionConnected.triggerAll(),e.forEach((function(e){this.triggerConnectionCreated(e)}),this)}},y={};e.exports=function(e,t){let n=(void 0===t?{}:t).connectionEventsSuppressed;const r=new d;let s=!1;const u=new v(r);r.on("reconnecting",()=>{e._.reconnecting()}),r.on("reconnected",()=>{e._.reconnected()}),r.on("close",t=>{const n=e.connection;n&&(n.destroyedReason()?l.debug("Socket was closed but the connection had already been destroyed. Reason: "+n.destroyedReason()):n.destroy(t))});const f=function(t,n){return e.connections.has(t.id)?e.connections.get(t.id):(t=c.fromHash(t),(n||e.connection&&t.id!==e.connection.id)&&(e.connections.add(t),u.triggerConnectionCreated(t)),Object.keys(y).forEach(r=>{const o=y[r];if(o&&t.id===o.connection.id){b(o,e),delete y[o.id];const r={debug:n?"connection came in session#read":"connection came in connection#created",streamId:o.id,connectionId:t.id};e.logEvent("streamCreated","warning",r)}}),t)};r.on("session#read",(t,n)=>{let o;const i={streams:[],connections:[],archives:[]};t.connection.forEach(e=>{o=f(e,!0),i.connections.push(o)}),t.stream.forEach(t=>{i.streams.push(b(t,e))}),(t.archive||t.archives).forEach(t=>{i.archives.push(g(t,e))}),r.triggerCallback(n,null,i),s=!0,u.triggerSessionConnected(e.connections)}),r.on("session#update",t=>{if("mute"!==t.reason)return void l.debug("session#update that handle this reason is not currently implemented");const n=!0===t.active;e._.forceMute({active:n}),n?e._.enableMuteOnEntry():e._.disableMuteOnEntry()}),r.on("session#muted",()=>{e._.enableMuteOnEntry(),e._.forceMute({active:!0})}),r.on("connection#created",e=>{f(e)}),r.on("connection#deleted",(t,n)=>{(t=e.connections.get(t))?t.destroy(n):l.warn("A connection was deleted that we do not know about")}),r.on("stream#created",(t,o)=>{const i=t.id,s=t.sourceStreamId,a=t.connection;let c;if(n){if(null==a||null==a.id)return void e.logEvent("SessionDispatcher:stream#created","Event",{connection:a,info:"Stream did not contain a connection object. Event ignored"});f(a)}const u=t.connectionId||a.id;if(e.connections.has(u))c=b(t,e);else{y[i]=t;const n={debug:"eventOrderError -- streamCreated event before connectionCreated",streamId:i,sourceStreamId:m(s)};e.logEvent("streamCreated","warning",n)}c?(c.publisher&&c.publisher.setStream(c),r.triggerCallback(o,null,c)):e.sessionInfo.isAdaptiveEnabled&&"P2P"===s&&p.subscribers.where({streamId:i}).forEach(e=>{e._.startRoutedToRelayedTransition()})}),r.on("stream#deleted",(t,n,r)=>{const o=e.streams.get(t),i=r.sourceStreamId,s=p.subscribers,a=e.sessionInfo.isAdaptiveEnabled&&"P2P"===i;(o||a)&&(a?s.where({streamId:t}).forEach(e=>{e._.startRelayedToRoutedTransition()}):o.destroy(n))}),r.on("stream#updated",(t,n)=>{const r=e.streams.get(t);r?r._.update(n):l.error(`A stream does not exist with the id of ${t}, for stream#updated message!`)}),r.on("stream#update",(t,n)=>{const r=e.streams.get(t),o=n.reason,i=n.active;r?"mute"===o?i&&r._.forceMute(n):l.debug("stream#update that handle this reason is not currently implemented"):l.error(`A stream does not exist with the id of ${t}, for stream#updated message!`)}),r.on("streamChannel#updated",(t,n,r)=>{let o;t&&(o=e.streams.get(t))?o._.updateChannel(n,r):l.error("Unable to determine streamId, or the stream does not exist, for streamChannel message!")});const h=(t,n,r,s)=>{let u,d;const f={streamId:n},h=p.subscribers,m=p.publishers;switch(u=s.params.subscriber?{widgetId:s.params.subscriber}:f,t){case"offer":d=[].concat(h.where(u),m.where(f)).slice(0,1);break;case"answer":case"pranswer":d=[].concat(m.where(f),h.where(u)).slice(0,1);break;case"generateoffer":case"unsubscribe":d=m.where(f);break;case"candidate":d=[].concat(h.where(u),m.where(f));break;default:return void l.debug(`jsep#${t} is not currently implemented`)}if(0===d.length)return;let b=e.connections.get(r);!b&&r.match(/^symphony\./)&&(b=c.fromHash({id:r,creationTime:Math.floor(a())}),e.connections.add(b)),d.forEach(function(){var e=(0,i.default)(o.default.mark((function e(n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.processMessage(t,r,s);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),l.error("Error occurred during processMessage",e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}())};return r.on("jsep#offer",h.bind(null,"offer")),r.on("jsep#answer",h.bind(null,"answer")),r.on("jsep#pranswer",h.bind(null,"pranswer")),r.on("jsep#generateoffer",h.bind(null,"generateoffer")),r.on("jsep#unsubscribe",h.bind(null,"unsubscribe")),r.on("jsep#candidate",h.bind(null,"candidate")),r.on("subscriberChannel#updated",(t,n,r)=>{t&&e.streams.has(t)?e.streams.get(t)._.updateChannel(n,r):l.error("Unable to determine streamId, or the stream does not exist, for subscriberChannel#updated message!")}),r.on("subscriberChannel#update",(t,n,r)=>{n&&e.streams.has(n)?p.subscribers.has(t)?p.subscribers.get(t).disableVideo(r.active):l.error("Unable to determine subscriberId, or the subscriber does not exist, for subscriberChannel#update message!"):l.error("Unable to determine streamId, or the stream does not exist, for subscriberChannel#update message!")}),r.on("signal",(t,r)=>{if(n){let n=r.connection||r.fromConnection;null!=n&&null!=n.id||(n=function(e){return{id:e,creationTime:(new Date).getTime(),data:{},capablities:{},permissions:[]}}(t),e.logEvent("SessionDispatcher:Signal","Event",{fromAddress:t,connection:r.connection,fromConnection:r.fromConnection,info:"Signal did not contain a connection object. One has been constructed",constructedConnection:n})),f(n)}const o=r.type,i=r.data,a=e.connections.get(t);e.connection&&t===e.connection.connectionId?s?e._.dispatchSignal(a,o,i):u.enqueue("sessionConnected","signal",t,o,i):e.connections.get(t)?e._.dispatchSignal(a,o,i):""===t?e._.dispatchSignal(null,o,i):u.enqueue("connectionCreated"+t,"signal",t,o,i)}),r.on("archive#created",t=>{g(t,e)}),r.on("archive#updated",(t,n)=>{const r=e.archives.get(t);r?r._.update(n):l.error(`An archive does not exist with the id of ${t}, for archive#updated message!`)}),r.on("source#create",(t,n,r)=>{const o=m(t);e.logEvent("SessionDispatcher:source#create","Event",{sourceStreamId:o,streamId:n,reason:r}),l.debug(`Received a request from RUMOR to start a transition to ${t} for the stream ID ${n} with the reason: ${r}`),p.publishers.where({streamId:n}).forEach(e=>{e._.startRoutedToRelayedTransition()})}),r.on("source#delete",(t,n,r)=>{e.logEvent("SessionDispatcher:source#delete","Event",{sourceStreamId:m(t),streamId:n,reason:r}),l.debug(`Received a request from RUMOR to start a transition from P2P to MANTIS for the stream ID ${n} with the reason: ${r}`),p.publishers.where({streamId:n}).forEach(e=>{e._.startRelayedToRoutedTransition()})}),r}},function(e,t,n){"use strict";const r=n(23)(),o=n(6);e.exports=function(e,t,n){this.id=e,this.name=t,this.status=n,this._={},o(this),this._.update=e=>{Object.keys(e).forEach(t=>{const n=this[t];this[t]=e[t];const o=new r.ArchiveUpdatedEvent(this,t,n,this[t]);this.dispatchEvent(o)})},this.destroy=()=>{}}},function(e,t,n){"use strict";const r=n(24)().getAudioOutputMediaDevices;e.exports=()=>r()},function(e,t,n){"use strict";const r=n(24)().getActiveAudioOutputDevice;e.exports=()=>r()},function(e,t,n){"use strict";(function(t){var r=n(3),o=r(n(12)),i=r(n(13));const s=n(21),a=n(105).setCurrentAudioOutputDeviceId,c=n(322),u=n(24)(),d=u.getDefaultAudioOutputDeviceId,l=u.getAudioOutputMediaDevices,p=n(294),f=new(n(27)),h=(e,t)=>{f.logEvent({action:"updateSubscribersSinkId",variation:e,payload:t})},m=e=>{const n=s.subscribers.map(t=>t._.setSinkId(e));return t.all(n)},b=function(){var e=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p();case 2:return e.prev=2,h("Attempt",{deviceId:t}),e.next=6,m(t);case 6:h("Success",{deviceId:t}),e.next=13;break;case 9:throw e.prev=9,e.t0=e.catch(2),h("Failure",{deviceId:t,error:null==e.t0?void 0:e.t0.message}),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}(),g=function(){var e=(0,i.default)(o.default.mark((function e(){var t,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l();case 2:return t=e.sent,n=d(t),e.prev=4,e.next=7,b(n);case 7:a(n),e.next=12;break;case 10:e.prev=10,e.t0=e.catch(4);case 12:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(){return e.apply(this,arguments)}}(),v=function(){var e=(0,i.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c();case 2:return t=e.sent,e.prev=3,e.next=6,b(t.deviceId);case 6:e.next=12;break;case 8:return e.prev=8,e.t0=e.catch(3),e.next=12,g();case 12:case"end":return e.stop()}}),e,null,[[3,8]])})));return function(){return e.apply(this,arguments)}}();e.exports=function(){var e=(0,i.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,h("Attempt",{deviceId:t}),e.next=4,m(t);case 4:h("Success",{deviceId:t}),a(t),e.next=14;break;case 8:return e.prev=8,e.t0=e.catch(0),h("Failure",{deviceId:t,error:null==e.t0?void 0:e.t0.message}),e.next=13,v();case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}()}).call(this,n(0))},function(e,t,n){"use strict";n(325);const r=n(37),o=n(26),i=n(6),s=n(126),a=n(34)(),c=n(27),u=n(250),d=n(545),l=n(546),p=a.onlyLocal(),f={};f.noConflict=n(547)(),(void 0!==typeof window?window:global).OT=f,e.exports=f,(()=>{let e=f;Object.defineProperty(void 0!==typeof window?window:global,"TB",{get:()=>(e===f&&console.warn("window.TB is deprecated, and will be removed in the future. Please access via window.OT"),e),set:t=>{e=t},configurable:!0})})();const h=n(142)(void 0!==typeof window?window:global),m=n(5),b=n(72),g=n(143),v=n(253),y=n(144),S=n(145),E=n(254),T=n(146),C=n(4),w=n(8),R=n(255),I=n(241),_=n(1)("OT"),x=n(119),O=n(574),N=n(22),k=n(100).parseIceServers,Z=n(267),A=n(21),L=n(150),V=n(152),P=n(153),W=n(101)({global:h}),G=n(11)({}),M=n(159)(),D=n(280)({otError:G}),X=n(281)(),j=n(286)({global:h}),U=n(24)({getNativeEnumerateDevices:j}),F=n(23)(),Y=n(161)(),B=n(628)({otError:G,global:h}),H=n(162)({chromeExtensionHelper:D,otError:G}),J=n(633)({deviceHelpers:U,generateConstraintInfo:R,getUserMediaHelper:B,global:h,OTHelpers:m,screenSharing:H}),K=n(636)({otError:G,processPubOptions:J}),z=n(163)({otError:G}),Q=n(74),q=n(291)(),$=n(292)({otError:G}),ee=n(293)({global:h,videoElementErrorMap:$}),te=n(164)({global:h}),ne=n(295)({PeerConnection:W,setCertificates:te}),re=n(296)({PeerConnection:W,setCertificates:te}),oe=n(297)(),ie=n(645)({otError:G}),se=n(107)({NativeVideoElementWrapper:ee}),ae=n(151)(),ce=n(165)({VideoElementFacade:se}),ue=n(300)({interpretPeerConnectionError:z,otError:G,SubscriberPeerConnection:re,WidgetView:ce}),de=n(169)({APIKEY:b,createChromeMixin:X,deviceHelpers:U,EnvironmentLoader:T,Errors:C,Events:F,ExceptionCodes:w,calculateCapableSimulcastStreams:v,global:h,interpretPeerConnectionError:z,IntervalRunner:Q,Microphone:q,otError:G,OTErrorClass:N,OTHelpers:m,parseIceServers:k,processPubOptions:J,PUBLISH_MAX_DELAY:Z,PublisherPeerConnection:ne,PublishingState:oe,StreamChannel:L,systemRequirements:P,VideoOrientation:ae,WidgetView:ce}),le=n(309)({otError:G,Publisher:de}),pe=n(310)({global:h,initPublisher:le,otError:G,Publisher:de,Subscriber:ue}),fe=n(725)({Session:pe});i(f);const he=n(726);u(f,"$",{name:"OT.$",getMessage:"Please use an external library like jQuery to select elements from the page.",value:m}),f.APIKEY=b.value,f.AnalyserAudioLevelSampler=S,f.Archive=n(320),f.ArchiveEvent=F.ArchiveEvent,f.ArchiveUpdatedEvent=F.ArchiveUpdatedEvent,f.AudioLevelTransformer=g,f.AudioLevelUpdatedEvent=F.AudioLevelUpdatedEvent,f.Capabilities=n(170),f.Chrome=y,f.Connection=n(173),f.ConnectionCapabilities=f.Connection.Capabilities,f.ConnectionEvent=F.ConnectionEvent,Object.keys(x).forEach(e=>{f[e.toUpperCase()]=x[e].priority}),f.NONE=0,f.debug=_.debug,f.error=_.error,f.info=_.info,f.log=_.log,f.warn=_.warn,f.DestroyedEvent=F.DestroyedEvent,f.EnvLoadedEvent=F.EnvLoadedEvent,f.Error=N,f.Error.on(o.EXCEPTION,e=>{if(e.target===f.Error){const t=r(e);t.target=f,f.dispatchEvent(t)}else f.dispatchEvent(e)}),f.Event=s,f.ExceptionCodes=w,f.ExceptionEvent=F.ExceptionEvent,f.getDevices=n(729),f.getAudioOutputDevices=n(321),f.getActiveAudioOutputDevice=n(322),f.setAudioOutputDevice=n(730)(),f.GetAudioLevelSampler=E,f.HAS_REQUIREMENTS=1,f.IntervalRunner=Q,f.IssueReportedEvent=F.IssueReportedEvent,f.MediaStoppedEvent=F.MediaStoppedEvent,f.Microphone=q,f.NOT_HAS_REQUIREMENTS=0,f.PeerConnection=W,f.PeerConnection.QOS=n(278).default,f.Publisher=de,f.PublisherPeerConnection=ne,f.PublishingState=oe,f.MuteForcedEvent=F.MuteForcedEvent,f.Session=pe,f.SessionConnectEvent=F.SessionConnectEvent,f.SessionDisconnectEvent=F.SessionDisconnectEvent,f.SessionDispatcher=n(319),f.Signal=n(317),f.SignalEvent=F.SignalEvent,f.Stream=n(171),f.StreamChannel=L,f.StreamEvent=F.StreamEvent,f.StreamPropertyChangedEvent=F.StreamPropertyChangedEvent,f.StreamUpdatedEvent=F.StreamUpdatedEvent,f.StylableComponent=V,f.Subscriber=ue,f.SubscriberPeerConnection=re,f.SubscribingState=n(303),f.VideoDimensionsChangedEvent=F.VideoDimensionsChangedEvent,f.VideoDisableWarningEvent=F.VideoDisableWarningEvent,f.VideoElement=se,f.VideoEnabledChangedEvent=F.VideoEnabledChangedEvent,f.VideoOrientation=ae,f.WidgetView=ce,f.getSupportedCodecs=he,f._={AnalyticsHelper:c,getClientGuid:I.get,StaticConfig:a},Object.defineProperty(f,"version",{value:p.version});const me={};u(me,"version",{value:p.version,name:"OT.properties.version",getWarning:"Please use OT.version instead",warnOnSet:!0,setWarning:"Mutating version has no effect"}),d.forEach(e=>{let t,n;if(Array.isArray(e)){const r=e[0],o=e[1];n=r,t=p[o]||o}else t=p[e],n=e;const r=(o=n,l.includes(o));var o;u(me,n,{value:t,name:"OT.properties."+n,warnOnSet:!0,canSet:r,setWarning:r?`Mutating ${n} can cause side effects`:`Mutating ${n} has no effect`})}),f.properties=me,f.audioContext=M,f.checkScreenSharingCapability=H.checkCapability,f.checkSystemRequirements=P.check,f.components={},f.generateSimpleStateMachine=Y,f.getErrorTitleByCode=N.getTitleByCode,f.getLogs=_.getLogs,f.getStatsAdpater=n(274),f.getStatsHelpers=n(75),f.getUserMedia=K,f.handleJsException=N.handleJsException,f.initPublisher=le,f.setProxyUrl=n(139).setProxyUrl,f.initSession=function(e,t,n){return null==t&&(t=e,e=null),0===b.value.length&&e&&(b.value=e,f.APIKEY=e),fe(e,t,n)};const be=(e,t)=>()=>(console.warn(e+" is deprecated and will be removed in a future version of OpenTok"),t);Object.defineProperties(f,{isUnloaded:{get:be("OT.isUnloaded",T.isUnloaded)},onLoad:{get:be("OT.onLoad",T.onLoad)},onUnload:{get:be("OT.onUnload",T.onUnload)},overrideGuidStorage:{get:be("OT.overrideGuidStorage",I.override)}}),f.pickScreenSharingHelper=H.pickHelper,f.publishers=A.publishers,f.registerScreenSharingExtension=H.registerExtension,f.registerScreenSharingExtensionHelper=H.registerExtensionHelper,f.reportIssue=ie,f.sessions=A.sessions,f.setLogLevel=O,f.shouldLog=_.shouldLog,f.subscribers=A.subscribers,f.unblockAudio=n(167),f.upgradeSystemRequirements=P.upgrade,T.onUnload(()=>{A.publishers.destroy(),A.subscribers.destroy(),A.sessions.destroy("unloaded")}),n(731)()},function(e,t,n){var r=n(326);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(340)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){t=e.exports=n(327)(!1);var r=n(328),o=r(n(329)),i=r(n(330)),s=r(n(331)),a=r(n(332)),c=r(n(333)),u=r(n(334)),d=r(n(335)),l=r(n(336)),p=r(n(337)),f=r(n(338)),h=r(n(339));t.push([e.i,"/*!\n * Copyright (c) 2017 TokBox, Inc.\n * Released under the MIT license\n * http://opensource.org/licenses/MIT\n */\n\n/**\n * OT Base styles\n */\n\n/* Root OT object, this is where our CSS reset happens */\n.OT_root,\n.OT_root * {\n color: #ffffff;\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font-family: Arial, Helvetica, sans-serif;\n vertical-align: baseline;\n}\n\n/**\n * Specific Element Reset\n */\n\n.OT_root h1,\n.OT_root h2,\n.OT_root h3,\n.OT_root h4,\n.OT_root h5,\n.OT_root h6 {\n color: #ffffff;\n font-family: Arial, Helvetica, sans-serif;\n font-size: 100%;\n font-weight: bold;\n}\n\n.OT_root header {\n\n}\n\n.OT_root footer {\n\n}\n\n.OT_root div {\n\n}\n\n.OT_root section {\n\n}\n\n.OT_root video {\n\n}\n\n.OT_root button {\n\n}\n\n.OT_root strong {\n font-weight: bold;\n}\n\n.OT_root em {\n font-style: italic;\n}\n\n.OT_root a,\n.OT_root a:link,\n.OT_root a:visited,\n.OT_root a:hover,\n.OT_root a:active {\n font-family: Arial, Helvetica, sans-serif;\n}\n\n.OT_root ul, .OT_root ol {\n margin: 1em 1em 1em 2em;\n}\n\n.OT_root ol {\n list-style: decimal outside;\n}\n\n.OT_root ul {\n list-style: disc outside;\n}\n\n.OT_root dl {\n margin: 4px;\n}\n\n.OT_root dl dt,\n.OT_root dl dd {\n float: left;\n margin: 0;\n padding: 0;\n}\n\n.OT_root dl dt {\n clear: left;\n text-align: right;\n width: 50px;\n}\n\n.OT_root dl dd {\n margin-left: 10px;\n}\n\n.OT_root img {\n border: 0 none;\n}\n\n/* Modal dialog styles */\n\n/* Modal dialog styles */\n\n.OT_dialog-centering {\n display: table;\n width: 100%;\n height: 100%;\n}\n\n.OT_dialog-centering-child {\n display: table-cell;\n vertical-align: middle;\n}\n\n.OT_dialog {\n position: relative;\n\n box-sizing: border-box;\n max-width: 576px;\n margin-right: auto;\n margin-left: auto;\n padding: 36px;\n text-align: center; /* centers all the inline content */\n\n background-color: #363636;\n color: #fff;\n box-shadow: 2px 4px 6px #999;\n font-family: 'Didact Gothic', sans-serif;\n font-size: 13px;\n line-height: 1.4;\n}\n\n.OT_dialog * {\n font-family: inherit;\n box-sizing: inherit;\n}\n\n.OT_closeButton {\n color: #999999;\n cursor: pointer;\n font-size: 32px;\n line-height: 36px;\n position: absolute;\n right: 18px;\n top: 0;\n}\n\n.OT_dialog-messages {\n text-align: center;\n}\n\n.OT_dialog-messages-main {\n margin-bottom: 36px;\n line-height: 36px;\n\n font-weight: 300;\n font-size: 24px;\n}\n\n.OT_dialog-messages-minor {\n margin-bottom: 18px;\n\n font-size: 13px;\n line-height: 18px;\n color: #A4A4A4;\n}\n\n.OT_dialog-messages-minor strong {\n color: #ffffff;\n}\n\n.OT_dialog-actions-card {\n display: inline-block;\n}\n\n.OT_dialog-button-title {\n margin-bottom: 18px;\n line-height: 18px;\n\n font-weight: 300;\n text-align: center;\n font-size: 14px;\n color: #999999;\n}\n.OT_dialog-button-title label {\n color: #999999;\n}\n\n.OT_dialog-button-title a,\n.OT_dialog-button-title a:link,\n.OT_dialog-button-title a:active {\n color: #02A1DE;\n}\n\n.OT_dialog-button-title strong {\n color: #ffffff;\n font-weight: 100;\n display: block;\n}\n\n.OT_dialog-button {\n display: inline-block;\n\n margin-bottom: 18px;\n padding: 0 1em;\n\n background-color: #1CA3DC;\n text-align: center;\n cursor: pointer;\n}\n\n.OT_dialog-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.OT_dialog-button-large {\n line-height: 36px;\n padding-top: 9px;\n padding-bottom: 9px;\n\n font-weight: 100;\n font-size: 24px;\n}\n\n.OT_dialog-button-small {\n line-height: 18px;\n padding-top: 9px;\n padding-bottom: 9px;\n\n background-color: #444444;\n color: #999999;\n font-size: 16px;\n}\n\n.OT_dialog-progress-bar {\n display: inline-block; /* prevents margin collapse */\n width: 100%;\n margin-top: 5px;\n margin-bottom: 41px;\n\n border: 1px solid #4E4E4E;\n height: 8px;\n}\n\n.OT_dialog-progress-bar-fill {\n height: 100%;\n\n background-color: #29A4DA;\n}\n\n/* Helpers */\n\n.OT_centered {\n position: fixed;\n left: 50%;\n top: 50%;\n margin: 0;\n}\n\n.OT_dialog-hidden {\n display: none;\n}\n\n.OT_dialog-button-block {\n display: block;\n}\n\n.OT_dialog-no-natural-margin {\n margin-bottom: 0;\n}\n\n/* Publisher and Subscriber styles */\n\n.OT_publisher, .OT_subscriber {\n position: relative;\n min-width: 48px;\n min-height: 48px;\n}\n\n.OT_publisher .OT_video-element,\n.OT_subscriber .OT_video-element {\n display: block;\n position: absolute;\n width: 100%;\n height: 100%;\n\n transform-origin: 0 0;\n}\n\n/* Styles that are applied when the video element should be mirrored */\n.OT_publisher.OT_mirrored .OT_video-element {\n transform: scale(-1, 1);\n transform-origin: 50% 50%;\n}\n\n.OT_subscriber_error {\n background-color: #000;\n color: #fff;\n text-align: center;\n}\n\n.OT_subscriber_error > p {\n padding: 20px;\n}\n\n/* The publisher/subscriber name/mute background */\n.OT_publisher .OT_bar,\n.OT_subscriber .OT_bar,\n.OT_publisher .OT_name,\n.OT_subscriber .OT_name,\n.OT_publisher .OT_archiving,\n.OT_subscriber .OT_archiving,\n.OT_publisher .OT_archiving-status,\n.OT_subscriber .OT_archiving-status,\n.OT_publisher .OT_archiving-light-box,\n.OT_subscriber .OT_archiving-light-box {\n -ms-box-sizing: border-box;\n box-sizing: border-box;\n top: 0;\n left: 0;\n right: 0;\n display: block;\n height: 34px;\n position: absolute;\n}\n\n.OT_publisher .OT_bar,\n.OT_subscriber .OT_bar {\n background: rgba(0, 0, 0, 0.4);\n}\n\n.OT_publisher .OT_edge-bar-item,\n.OT_subscriber .OT_edge-bar-item {\n z-index: 1; /* required to get audio level meter underneath */\n}\n\n/* The publisher/subscriber name panel/archiving status bar */\n.OT_publisher .OT_name,\n.OT_subscriber .OT_name {\n background-color: transparent;\n color: #ffffff;\n font-size: 15px;\n line-height: 34px;\n font-weight: normal;\n padding: 0 4px 0 36px;\n letter-spacing: normal;\n}\n\n.OT_publisher .OT_archiving-status,\n.OT_subscriber .OT_archiving-status {\n background: rgba(0, 0, 0, 0.4);\n top: auto;\n bottom: 0;\n left: 34px;\n padding: 0 4px;\n color: rgba(255, 255, 255, 0.8);\n font-size: 15px;\n line-height: 34px;\n font-weight: normal;\n letter-spacing: normal;\n}\n\n.OT_micro .OT_archiving-status,\n.OT_micro:hover .OT_archiving-status,\n.OT_mini .OT_archiving-status,\n.OT_mini:hover .OT_archiving-status {\n display: none;\n}\n\n.OT_publisher .OT_archiving-light-box,\n.OT_subscriber .OT_archiving-light-box {\n background: rgba(0, 0, 0, 0.4);\n top: auto;\n bottom: 0;\n right: auto;\n width: 34px;\n height: 34px;\n}\n\n.OT_archiving-light {\n width: 7px;\n height: 7px;\n border-radius: 30px;\n position: absolute;\n top: 14px;\n left: 14px;\n background-color: #575757;\n box-shadow: 0 0 5px 1px #575757;\n}\n\n.OT_archiving-light.OT_active {\n background-color: #970d13;\n -webkit-animation: OT_pulse 1.3s ease-in;\n -moz-animation: OT_pulse 1.3s ease-in;\n -webkit-animation: OT_pulse 1.3s ease-in;\n -webkit-animation-iteration-count: infinite;\n -moz-animation-iteration-count: infinite;\n -webkit-animation-iteration-count: infinite;\n}\n\n.OT_mini .OT_bar,\n.OT_bar.OT_mode-mini,\n.OT_bar.OT_mode-mini-auto {\n bottom: 0;\n height: auto;\n}\n\n.OT_mini .OT_name.OT_mode-off,\n.OT_mini .OT_name.OT_mode-on,\n.OT_mini .OT_name.OT_mode-auto,\n.OT_mini:hover .OT_name.OT_mode-auto {\n display: none;\n}\n\n.OT_publisher .OT_name,\n.OT_subscriber .OT_name {\n left: 10px;\n right: 37px;\n height: 34px;\n padding-left: 0;\n}\n\n.OT_publisher .OT_mute,\n.OT_subscriber .OT_mute {\n border: none;\n cursor: pointer;\n display: block;\n position: absolute;\n text-align: center;\n text-indent: -9999em;\n background-color: transparent;\n background-repeat: no-repeat;\n}\n\n.OT_publisher .OT_mute,\n.OT_subscriber .OT_mute {\n right: 0;\n top: 0;\n border-left: 1px solid rgba(255, 255, 255, 0.2);\n height: 36px;\n width: 37px;\n}\n\n.OT_mini .OT_mute,\n.OT_publisher.OT_mini .OT_mute.OT_mode-auto.OT_mode-on-hold,\n.OT_subscriber.OT_mini .OT_mute.OT_mode-auto.OT_mode-on-hold {\n top: 50%;\n left: 50%;\n right: auto;\n margin-top: -18px;\n margin-left: -18.5px;\n border-left: none;\n}\n\n.OT_publisher .OT_mute {\n background-image: url("+o+");\n background-position: 9px 5px;\n}\n\n.OT_publisher .OT_mute.OT_active {\n background-image: url("+i+");\n background-position: 9px 4px;\n}\n\n.OT_subscriber .OT_mute {\n background-image: url("+s+");\n background-position: 8px 7px;\n}\n\n.OT_subscriber .OT_mute.OT_active {\n background-image: url("+a+");\n background-position: 7px 7px;\n}\n\n/**\n * Styles for display modes\n *\n * Note: It's important that these completely control the display and opacity\n * attributes, no other selectors should atempt to change them.\n */\n\n/* Default display mode transitions for various chrome elements */\n.OT_publisher .OT_edge-bar-item,\n.OT_subscriber .OT_edge-bar-item {\n transition-property: top, bottom, opacity;\n transition-duration: 0.5s;\n transition-timing-function: ease-in;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_mode-off,\n.OT_subscriber .OT_edge-bar-item.OT_mode-off,\n.OT_publisher .OT_edge-bar-item.OT_mode-auto,\n.OT_subscriber .OT_edge-bar-item.OT_mode-auto,\n.OT_publisher .OT_edge-bar-item.OT_mode-mini-auto,\n.OT_subscriber .OT_edge-bar-item.OT_mode-mini-auto {\n top: -25px;\n opacity: 0;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_mode-off,\n.OT_subscriber .OT_edge-bar-item.OT_mode-off {\n display: none;\n}\n\n.OT_mini .OT_mute.OT_mode-auto,\n.OT_publisher .OT_mute.OT_mode-mini-auto,\n.OT_subscriber .OT_mute.OT_mode-mini-auto {\n top: 50%;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_edge-bottom.OT_mode-off,\n.OT_subscriber .OT_edge-bar-item.OT_edge-bottom.OT_mode-off,\n.OT_publisher .OT_edge-bar-item.OT_edge-bottom.OT_mode-auto,\n.OT_subscriber .OT_edge-bar-item.OT_edge-bottom.OT_mode-auto,\n.OT_publisher .OT_edge-bar-item.OT_edge-bottom.OT_mode-mini-auto,\n.OT_subscriber .OT_edge-bar-item.OT_edge-bottom.OT_mode-mini-auto {\n top: auto;\n bottom: -25px;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_mode-on,\n.OT_subscriber .OT_edge-bar-item.OT_mode-on,\n.OT_publisher .OT_edge-bar-item.OT_mode-auto.OT_mode-on-hold,\n.OT_subscriber .OT_edge-bar-item.OT_mode-auto.OT_mode-on-hold,\n.OT_publisher:hover .OT_edge-bar-item.OT_mode-auto,\n.OT_subscriber:hover .OT_edge-bar-item.OT_mode-auto,\n.OT_publisher:hover .OT_edge-bar-item.OT_mode-mini-auto,\n.OT_subscriber:hover .OT_edge-bar-item.OT_mode-mini-auto {\n top: 0;\n opacity: 1;\n}\n\n.OT_mini .OT_mute.OT_mode-on,\n.OT_mini:hover .OT_mute.OT_mode-auto,\n.OT_mute.OT_mode-mini,\n.OT_root:hover .OT_mute.OT_mode-mini-auto {\n top: 50%;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_edge-bottom.OT_mode-on,\n.OT_subscriber .OT_edge-bar-item.OT_edge-bottom.OT_mode-on,\n.OT_publisher:hover .OT_edge-bar-item.OT_edge-bottom.OT_mode-auto,\n.OT_subscriber:hover .OT_edge-bar-item.OT_edge-bottom.OT_mode-auto {\n top: auto;\n bottom: 0;\n opacity: 1;\n}\n\n\n/* Contains the video element, used to fix video letter-boxing */\n.OT_widget-container {\n position: absolute;\n background-color: #000000;\n overflow: hidden;\n}\n\n.OT_hidden-audio {\n position: absolute !important;\n height: 1px !important;\n width: 1px !important;\n}\n\n/* Load animation */\n.OT_root .OT_video-loading {\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n display: none;\n\n background-color: rgba(0, 0, 0, .75);\n}\n\n.OT_root .OT_video-loading .OT_video-loading-spinner {\n background: url("+c+") no-repeat;\n position: absolute;\n width: 32px;\n height: 32px;\n left: 50%;\n top: 50%;\n margin-left: -16px;\n margin-top: -16px;\n animation: OT_spin 2s linear infinite;\n}\n@keyframes OT_spin {\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.OT_publisher.OT_loading .OT_video-loading,\n.OT_subscriber.OT_loading .OT_video-loading {\n display: block;\n}\n\n.OT_publisher.OT_loading .OT_video-element,\n.OT_subscriber.OT_loading .OT_video-element {\n /*display: none;*/\n}\n\n.OT_video-centering {\n display: table;\n width: 100%;\n height: 100%;\n}\n\n.OT_video-container {\n display: table-cell;\n vertical-align: middle;\n}\n\n.OT_video-poster {\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n display: none;\n\n opacity: .25;\n\n background-repeat: no-repeat;\n background-image: url("+u+");\n background-size: auto 76%;\n}\n\n.OT_fit-mode-cover .OT_video-element {\n -o-object-fit: cover;\n object-fit: cover;\n}\n\n/* Workaround for iOS freezing issue when cropping videos */\n/* https://bugs.webkit.org/show_bug.cgi?id=176439 */\n@media only screen\n and (orientation: portrait) {\n .OT_subscriber.OT_ForceContain.OT_fit-mode-cover .OT_video-element {\n -o-object-fit: contain !important;\n object-fit: contain !important;\n }\n}\n\n.OT_fit-mode-contain .OT_video-element {\n -o-object-fit: contain;\n object-fit: contain;\n}\n\n.OT_fit-mode-cover .OT_video-poster {\n background-position: center bottom;\n}\n\n.OT_fit-mode-contain .OT_video-poster {\n background-position: center;\n}\n\n.OT_audio-level-meter {\n position: absolute;\n width: 25%;\n max-width: 224px;\n min-width: 21px;\n top: 0;\n right: 0;\n overflow: hidden;\n}\n\n.OT_audio-level-meter:before {\n /* makes the height of the container equals its width */\n content: '';\n display: block;\n padding-top: 100%;\n}\n\n.OT_audio-level-meter__audio-only-img {\n position: absolute;\n top: 22%;\n right: 15%;\n width: 40%;\n\n opacity: .7;\n\n background: url("+d+") no-repeat center;\n}\n\n.OT_audio-level-meter__audio-only-img:before {\n /* makes the height of the container equals its width */\n content: '';\n display: block;\n padding-top: 100%;\n}\n\n.OT_audio-level-meter__value {\n will-change: transform;\n position: absolute;\n top: -100%;\n right: -100%;\n width: 200%;\n height: 200%;\n transform: scale(0);\n border-radius: 50%;\n background-image: radial-gradient(circle, rgba(151, 206, 0, 1) 0%, rgba(151, 206, 0, 0) 100%);\n}\n\n.OT_audio-level-meter.OT_mode-off {\n display: none;\n}\n\n.OT_audio-level-meter.OT_mode-on,\n.OT_audio-only .OT_audio-level-meter.OT_mode-auto {\n display: block;\n}\n\n.OT_audio-only.OT_publisher .OT_video-element,\n.OT_audio-only.OT_subscriber .OT_video-element {\n display: none;\n}\n\n\n.OT_video-disabled-indicator {\n opacity: 1;\n border: none;\n display: none;\n position: absolute;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: bottom right;\n pointer-events: none;\n top: 0;\n left: 0;\n bottom: 3px;\n right: 3px;\n}\n\n.OT_video-disabled {\n background-image: url("+l+");\n background-size: 33px auto;\n}\n\n.OT_video-disabled-warning {\n background-image: url("+p+");\n background-size: 33px auto;\n}\n\n.OT_video-disabled-indicator.OT_active {\n display: block;\n}\n\n.OT_audio-blocked-indicator {\n opacity: 1;\n border: none;\n display: none;\n position: absolute;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n}\n\n.OT_audio-blocked {\n background-image: url("+f+");\n background-size: 90px auto;\n}\n\n.OT_container-audio-blocked {\n cursor: pointer;\n}\n\n.OT_container-audio-blocked.OT_mini .OT_edge-bar-item {\n display: none;\n}\n\n.OT_container-audio-blocked .OT_mute {\n display: none;\n}\n\n.OT_audio-blocked-indicator.OT_active {\n display: block;\n}\n\n.OT_video-unsupported {\n opacity: 1;\n border: none;\n display: none;\n position: absolute;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url("+h+");\n background-size: 58px auto;\n pointer-events: none;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n margin-top: -30px;\n}\n\n.OT_video-unsupported-bar {\n display: none;\n position: absolute;\n width: 192%; /* copy the size of the audio meter bar for symmetry */\n height: 192%;\n top: -96% /* half of the size */;\n left: -96%;\n border-radius: 50%;\n\n background-color: rgba(0, 0, 0, .8);\n}\n\n.OT_video-unsupported-img {\n display: none;\n position: absolute;\n top: 11%;\n left: 15%;\n width: 70%;\n opacity: .7;\n background-image: url("+h+");\n background-repeat: no-repeat;\n background-position: center;\n background-size: 100% auto;\n}\n\n.OT_video-unsupported-img:before {\n /* makes the height of the container 93% of its width (90/97 px) */\n content: '';\n display: block;\n padding-top: 93%;\n}\n\n.OT_video-unsupported-text {\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n height: 100%;\n margin-top: 40px;\n}\n\n.OT_video-unsupported.OT_active {\n display: block;\n}\n\n.OT_mini .OT_video-unsupported,\n.OT_micro .OT_video-unsupported {\n position: absolute;\n width: 25%;\n max-width: 224px;\n min-width: 21px;\n top: 0;\n left: 0;\n overflow: hidden;\n background: none;\n bottom: auto;\n right: auto;\n margin: auto;\n}\n\n.OT_mini .OT_video-unsupported:before,\n.OT_micro .OT_video-unsupported:before {\n /* makes the height of the container equals its width */\n content: '';\n display: block;\n padding-top: 100%;\n}\n\n.OT_mini .OT_video-unsupported-bar,\n.OT_micro .OT_video-unsupported-bar,\n.OT_mini .OT_video-unsupported-img,\n.OT_micro .OT_video-unsupported-img {\n display: block;\n}\n\n.OT_mini .OT_video-unsupported-text,\n.OT_micro .OT_video-unsupported-text {\n display: none;\n}\n\n.OT_hide-forced {\n display: none;\n}\n\n.OT_ModalDialog {\n position: fixed;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 1000;\n background-color: rgba(0, 0, 0, 0.2);\n}\n\n#tb_alert {\n position: fixed;\n width: 570px;\n font-family: \"Lucida Grande\", Arial;\n top: 50%;\n left: 50%;\n margin-top: -75px;\n margin-left: -285px;\n}\n\n#tb_alert * {\n box-sizing: border-box;\n}\n\n#tb_alert .OT_alert {\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n background-color: #333;\n position: relative;\n padding: 30px;\n overflow: visible;\n margin-left: 70px;\n border-bottom-color: rgba(255, 255, 255, 0.1);\n border-left-color: rgba(255, 255, 255, 0.1);\n\n background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 75%, rgba(0, 0, 0, 0.2)), linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 75%, rgba(0, 0, 0, 0.2));\n\n background-image: -ms-linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 75%, rgba(0, 0, 0, 0.2)), -ms-linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 75%, rgba(0, 0, 0, 0.2));\n\n background-size: 4px 4px;\n background-position: 0 0, 2px 2px;\n box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid rgba(255, 255, 255, 0.3);\n}\n\n#tb_alert .OT_alert-exclamation {\n background-color: #9c1408;\n background-image: linear-gradient(0deg, #dd0c0a 0%, #9c1408 100%);\n box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid rgba(255, 255, 255, 0.3);\n\n margin: -1px 0;\n\n font-family: MS Trebuchet;\n font-weight: bold;\n font-size: 60px;\n text-shadow: -1px -1px 2px rgba(0, 0, 0, 0.5);\n\n color: white;\n width: 65px;\n position: absolute;\n padding: 42px 0;\n text-align: center;\n left: -70px;\n top: 0;\n bottom: 0;\n border-top-left-radius: 5px;\n border-bottom-left-radius: 5px;\n\n border-bottom-color: transparent;\n border-left: none;\n border-right: none;\n}\n\n#tb_alert .OT_alert-exclamation:after,\n#tb_alert .OT_alert-exclamation:before {\n content: \" \";\n position: absolute;\n right: -24px;\n top: 40%;\n border: 12px solid transparent;\n border-left-color: #9c1408;\n}\n\n#tb_alert .OT_alert-exclamation:before {\n border-left-color: #bc3428;\n top: 39%;\n}\n\n#tb_alert .OT_alert-body {\n color: #c8c5c5;\n margin: 0;\n text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);\n font-size: 14px;\n line-height: 1.3em;\n}\n\n#tb_alert .continue-text {\n margin-top: 12px\n}\n\n#tb_alert > * a {\n color: #a7d8df;\n text-decoration: none;\n}\n\n#tb_alert .OT_alert-header {\n font-size: 24px;\n padding-bottom: 5px;\n color: #aaa;\n font-weight: bold;\n position: relative;\n text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);\n margin: 0;\n}\n\n#tb_alert .OT_alert-header::before {\n content: attr(data-text);\n position: absolute;\n left: 0;\n color: white;\n -webkit-mask-image: -webkit-gradient(\n linear,\n left top, left bottom,\n from(rgba(0, 0, 0, 1)),\n color-stop(60%, rgba(0, 0, 0, 0)),\n to(rgba(0, 0, 0, 0))\n );\n}\n\n#tb_alert .OT_alert-close-button {\n position: absolute;\n right: 8px;\n top: 5px;\n background-color: #000;\n color: #666;\n border: none;\n font-size: 20px;\n /** Hack to bring it up to the proper line top */\n line-height: 14px;\n padding: 0;\n padding-bottom: 3px;\n cursor: pointer;\n}\n\n#tb_alert #section-mobile-browser,\n#tb_alert #section-supported-mobile-browser {\n width: 200px;\n top: 0px;\n left: 25%;\n margin-top: 0;\n margin-left: 0;\n}\n\n@media all and (max-height: 300px) {\n #tb_alert {\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n margin-left: 0;\n margin-top: 0;\n }\n #tb_alert #section-mobile-browser,\n #tb_alert #section-supported-mobile-browser {\n margin-left: 0;\n margin-top: 10px;\n left: 0;\n }\n}\n\n#tb_alert #section-normal-install,\n#tb_alert #section-upgrade-install,\n#tb_alert #section-mobile-browser,\n#tb_alert #section-supported-mobile-browser {\n display: none;\n}\n",""])},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(s=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),i=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(i).concat([o]).join("\n")}var s;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];null!=i&&(r[i]=!0)}for(o=0;o<e.length;o++){var s=e[o];null!=s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),t.push(s))}},t}},function(e,t,n){"use strict";e.exports=function(e,t){return"string"!=typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1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DcBWYOUZOHYM2AU8WQmhBifDv70O7PjX7KZ+4G7g3FM8zd6uBIaBy4AqxnIcZwFLCovPAhE4Sj38b4BDwEeVEFKD9S94Khjn486v3QAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAATCAYAAAB7u5a2AAABx0lEQVQ4jaWUv48NURiGn3ONmCs32ZBd28ht1gqyZAkF21ylQkEiSp2ehpDlD1BoFGqqVdJohYKI7MaPxMoVNghCWMF+7ybLUewnOXfcMWO9yeQ857zne8+XmZOBGjJpr0kvTIomvTZpS526UCO4DUwD64FjwCFgqZnnR+oc8LfgzKQ73vGsr42ZtGjSQFV9o8KfBCacZwCaef4YmAf2rzjcpN3A2WSpm/AssKcqPDNpDBjs410CViXzTwk/A7b1C4wxDgOngAsZcAXY2buDfp/6S4F3lDS8DjgBzDWAjX/Y/e/QgYS/AhsKHa+OMQ6GEJ4Cj4BOAxgq6aCowyZtdf4OtAr+FHDO+R4wWnVbihr3cQnICt4boO38GWj9a/icjwOACt4m4K3zEPA+AxaAtTWCnwN3lzHkEL8V/OPAGud9wK2GF9XR1Wae/1zG2AI+pGYI4VUIoRtjHAc2A9cz4LRPevYCZ+i9/4sJt4GXJU10gaPAzdI2TTro/5Tfz8XEe2LSZGmxq/SDNvP8BnA5WRrx4BwYBe6vONx1EnjovGvBLAAd4Adwuyq8UiaNmDTvr+a8SQ9MuvbfwckBHZPe+QEfTdpep+4XZmPBHiHgz74AAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAUCAYAAACXtf2DAAACtklEQVQ4jZ2VSYiURxTHf+/T9Nc9iRrBuYySmIsXUU9iFMEFERRBvAjJLUQi5ioiHvSScfTmgqC4XAT1ZIgLuJHkICaaQAgKI2hAUBT30bjUq7bbv4eukXK029F3+eqtv/fqK6qQdEnSNUmT6CDB/bvgfjO4N9zj2RD8007xg1IABkwEzkma0qb4PGAPM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2QR3KElu99PzqjGufhREqB1pjCnG3IL3fY1v733r2FMsiGhutn0LAoJWWIGbPxjKwgjUbF0m52mPhigrpdXOecEq9pR6MkHbu2LOtrcZ9y3d0ODTb15y9MePz48aF79+8fvXnr9sljx2u2I7KNxDuaMPGVECoRs7mC4eT7SIruFNfNHK15MKuM2evwNq+4qjxvGnd5CHwNNynawW4cOlUZdG8b55IIJHmkItwrZHH6QxB3OSL9kTtAGpIvZiQB3Z4SKBfXQtEE9sashWAW87Bt3sYZNR6zn4uzJwWDKUKXfaKCdqUoBpLxSjYe9nqGiwWRBGipuGZ3Qm76itYLbbJI/PEhUApfw73uOIy9xfse3M9F9BuFJHcYrseSouGkHtCVtkuGTTikI8XgZzhg9SeF4VqcvSWiaSvNHQ8JwkNjIfEHemCmNLD1RaEfLs18mlgNuN6PFALHo7CyU5W2g00gFAQF4ozvibH04muwDbWraSFAyt/AAMzewgGR8uCeWn77xzBxPxgzPRCDDMZ14bQ/3jqGKGoHf2Hjgx3kw5LbaJDYWb52t9FMgw4AuWNWukNeuOYqOsmQi2jgws4PA/DD/z0B2x0/veCs4naw0cgybezid7X9jV3rX2RSs0wfLkll4pBGcgifg+NYxe1kJ2ycTaRq66uG/wBOl0vjcw70xwAAAABJRU5ErkJggg=="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFIAAAAoCAYAAABtla08AAAGMElEQVR4Ae2aA7D0yBaAc7oH12vbRmlLaxYWb23btm3btm2899a2bWuYtPZ01cmtU9lJrib315yqr9I3Oem/5/s7acwEnehEJzoxCcX2O+wEeIgRBDDaGjAZOgQ6ihRpLklHZDJIXK1WWymMIhGGkVBKCWMM+Iv/f/b5t7faYtM/sGgIS7j8RNLjceUVl41GvGN1BFiHy9sgtRWaYbhvuVQ6o1VOvV5/tLe3dyssKoZuh8xClkDEi2MMS6ZjR0cScxdK/+HgnJsmLccYOx0e/PUGUqfTJDEHkV5go9lcMQoj4R8RpSIRRUr4a9baTJFCCNfqESK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zPjxwYXRoIGQ9Ik03MCAxMkw5LjQ0OCA3Mi41NTIgMCA2MmwzLTQ0TDI5IDBsNDEgMTJ6bTggMmwxIDUyLTI5IDE4LTM1LjUwMi02LjQ5OEw3OCAxNHoiIGlkPSJhIi8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoOCAzKSI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PHBhdGggZD0iTTkuMTEgMjAuOTY4SDQ4LjFhNSA1IDAgMDE1IDVWNTguMThhNSA1IDAgMDEtNSA1SDkuMTFhNSA1IDAgMDEtNS01VjI1Ljk3YTUgNSAwIDAxNS01em00Ny4wOCAxMy4zOTRjMC0uMzQ1IDUuNDcyLTMuMTU5IDE2LjQxNS04LjQ0M2EzIDMgMCAwMTQuMzA0IDIuNzAydjI2LjgzNWEzIDMgMCAwMS00LjMwNSAyLjcwMWMtMTAuOTQyLTUuMjg2LTE2LjQxMy04LjEtMTYuNDEzLTguNDQ2VjM0LjM2MnoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48L2c+PHBhdGggZD0iTTgxLjUgMTYuNUwxOS45OTggNzguMDAyIiBzdHJva2U9IiNGRkYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PC9nPjwvc3ZnPg=="},function(e,t,n){var r,o,i={},s=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),a=function(e,t){return t?t.querySelector(e):document.querySelector(e)},c=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var r=a.call(this,e,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),u=null,d=0,l=[],p=n(341);function f(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=i[r.id];if(o){o.refs++;for(var s=0;s<o.parts.length;s++)o.parts[s](r.parts[s]);for(;s<r.parts.length;s++)o.parts.push(y(r.parts[s],t))}else{var a=[];for(s=0;s<r.parts.length;s++)a.push(y(r.parts[s],t));i[r.id]={id:r.id,refs:1,parts:a}}}}function h(e,t){for(var n=[],r={},o=0;o<e.length;o++){var i=e[o],s=t.base?i[0]+t.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};r[s]?r[s].parts.push(a):n.push(r[s]={id:s,parts:[a]})}return n}function m(e,t){var n=c(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=l[l.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),l.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=c(e.insertAt.before,n);n.insertBefore(t,o)}}function b(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=l.indexOf(e);t>=0&&l.splice(t,1)}function g(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return v(t,e.attrs),m(e,t),t}function v(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function y(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var s=d++;n=u||(u=g(t)),r=T.bind(null,n,s,!1),o=T.bind(null,n,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),m(e,t),t}(t),r=w.bind(null,n,t),o=function(){b(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),r=C.bind(null,n),o=function(){b(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=s()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return f(n,t),function(e){for(var r=[],o=0;o<n.length;o++){var s=n[o];(a=i[s.id]).refs--,r.push(a)}e&&f(h(e,t),t);for(o=0;o<r.length;o++){var a;if(0===(a=r[o]).refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete i[a.id]}}}};var S,E=(S=[],function(e,t){return S[e]=t,S.filter(Boolean).join("\n")});function T(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=E(t,o);else{var i=document.createTextNode(o),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}function C(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function w(e,t,n){var r=n.css,o=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||i)&&(r=p(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var s=new Blob([r],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var o,i=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(80),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(80);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(80);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(80);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(79),o=n(109),i=n(110);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(15),o=n(355),i=n(9),s=n(175),a=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,d=c.toString,l=u.hasOwnProperty,p=RegExp("^"+d.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?p:a).test(s(e))}},function(e,t,n){var r=n(39),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var o=s.call(e);return r&&(t?e[a]=n:delete e[a]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,o=n(356),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},function(e,t,n){var r=n(14)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(359),o=n(79),i=n(109);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(e,t,n){var r=n(360),o=n(361),i=n(362),s=n(363),a=n(364);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},function(e,t,n){var r=n(81);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(81),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(81),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(81);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t,n){var r=n(82);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(82);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(82);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(82);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(29),o=n(16);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(29),o=n(112),i=n(16),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!s[r(e)]}},function(e,t,n){var r=n(179)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(40),o=n(53);e.exports=function(e,t){return e&&r(t,o(t),e)}},function(e,t,n){var r=n(9),o=n(69),i=n(377),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=o(e),n=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&n.push(a);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t,n){var r=n(40),o=n(115);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}},function(e,t,n){var r=n(40),o=n(182);e.exports=function(e,t){return r(e,o(e),t)}},function(e,t,n){var r=n(38)(n(14),"DataView");e.exports=r},function(e,t,n){var r=n(38)(n(14),"Promise");e.exports=r},function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},function(e,t,n){var r=n(118),o=n(385),i=n(386),s=n(387),a=n(189);e.exports=function(e,t,n){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(e,n);case"[object Map]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return i(e);case"[object Set]":return new c;case"[object Symbol]":return s(e)}}},function(e,t,n){var r=n(118);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},function(e,t){var n=/\w*$/;e.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}},function(e,t,n){var r=n(39),o=r?r.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},function(e,t,n){var r=n(389),o=n(68),i=n(113),s=i&&i.isMap,a=s?o(s):r;e.exports=a},function(e,t,n){var r=n(41),o=n(16);e.exports=function(e){return o(e)&&"[object Map]"==r(e)}},function(e,t,n){var r=n(391),o=n(68),i=n(113),s=i&&i.isSet,a=s?o(s):r;e.exports=a},function(e,t,n){var r=n(41),o=n(16);e.exports=function(e){return o(e)&&"[object Set]"==r(e)}},function(e,t,n){(function(r){t.log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(t){var n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.exports.humanize(this.diff),!n)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))})),t.splice(i,0,r)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.setItem("debug",e)}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},t.useColors=function(){var e=function(e){var n="debug_"+e.toLowerCase();try{return t.storage.getItem(n)}catch(e){return void 0!==r&&"env"in r?r.env[n.toUpperCase()]:void 0}}("colors");if(/^(no|off|false|disabled)$/i.test(e))return!1;if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return Boolean("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(393)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(43))},function(e,t,n){e.exports=function(e){function t(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return r.colors[Math.abs(n)%r.colors.length]}function r(e){var n;function i(){if(i.enabled){var e=i,t=+new Date,o=t-(n||t);e.diff=o,e.prev=n,e.curr=t,n=t;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=r.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(t,n){if("%%"===t)return t;c++;var o=r.formatters[n];if("function"==typeof o){var i=s[c];t=o.call(e,i),s.splice(c,1),c--}return t})),r.formatArgs.call(e,s);var u=e.log||r.log;u.apply(e,s)}}return i.namespace=e,i.enabled=r.enabled(e),i.useColors=r.useColors(),i.color=t(e),i.destroy=o,"function"==typeof r.init&&r.init(i),r.instances.push(i),i}function o(){var e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}return r.debug=r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){r.enable("")},r.enable=function(e){var t;r.save(e),r.names=[],r.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(t=0;t<o;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")));for(t=0;t<r.instances.length;t++){var i=r.instances[t];i.enabled=r.enabled(i.namespace)}},r.enabled=function(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=n(394),Object.keys(e).forEach((function(t){r[t]=e[t]})),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=t,r.enable(r.load()),r}},function(e,t){var n=1e3,r=6e4,o=60*r,i=24*o;function s(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,t){t=t||{};var a=typeof e;if("string"===a&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*o;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===a&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=i)return s(e,t,i,"day");if(t>=o)return s(e,t,o,"hour");if(t>=r)return s(e,t,r,"minute");if(t>=n)return s(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=i)return Math.round(e/i)+"d";if(t>=o)return Math.round(e/o)+"h";if(t>=r)return Math.round(e/r)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,n){var r=n(396),o=n(176),i=n(88),s=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=s},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t,n){"use strict";const r=n(195),o=new r;e.exports=function(e,t){if(void 0===t)return e;o.has(t)||o.set(t,new r);const n=o.get(t);return n.has(e)||n.set(e,e.bind(t)),n.get(e)}},function(e,t,n){"use strict";e.exports=function(){var e,t;if("function"!=typeof WeakMap)return!1;try{e=new WeakMap([[t={},"one"],[{},"two"],[{},"three"]])}catch(e){return!1}return"[object WeakMap]"===String(e)&&("function"==typeof e.set&&(e.set({},1)===e&&("function"==typeof e.delete&&("function"==typeof e.has&&"one"===e.get(t)))))}},function(e,t,n){"use strict";var r,o=n(44),i=n(123),s=n(402),a=n(31),c=n(403),u=n(32),d=n(202),l=n(445),p=n(45).toStringTag,f=n(446),h=Array.isArray,m=Object.defineProperty,b=Object.prototype.hasOwnProperty,g=Object.getPrototypeOf;e.exports=r=function(){var e,t=arguments[0];if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");return e=f&&i&&WeakMap!==r?i(new WeakMap,g(this)):this,o(t)&&(h(t)||(t=d(t))),m(e,"__weakMapData__",u("c","$weakMap$"+c())),t?(l(t,(function(t){a(t),e.set(t[0],t[1])})),e):e},f&&(i&&i(r,WeakMap),r.prototype=Object.create(WeakMap.prototype,{constructor:u(r)})),Object.defineProperties(r.prototype,{delete:u((function(e){return!!b.call(s(e),this.__weakMapData__)&&(delete e[this.__weakMapData__],!0)})),get:u((function(e){if(b.call(s(e),this.__weakMapData__))return e[this.__weakMapData__]})),has:u((function(e){return b.call(s(e),this.__weakMapData__)})),set:u((function(e,t){return m(s(e),this.__weakMapData__,u("c",t)),this})),toString:u((function(){return"[object WeakMap]"}))}),m(r.prototype,p,u("c","WeakMap"))},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var r,o,i,s,a=Object.create;n(196)()||(r=n(197)),e.exports=r?1!==r.level?a:(o={},i={},s={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(e){i[e]="__proto__"!==e?s:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(o,i),Object.defineProperty(r,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:o}),function(e,t){return a(null===e?o:e,t)}):a},function(e,t,n){"use strict";var r=n(198);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not an Object");return e}},function(e,t,n){"use strict";var r=Object.create(null),o=Math.random;e.exports=function(){var e;do{e=o().toString(36).slice(2)}while(r[e]);return e}},function(e,t,n){"use strict";var r=n(405);e.exports=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!r(e)}},function(e,t,n){"use strict";var r=n(124);e.exports=function(e){if(!r(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var r=n(408),o=n(31),i=Math.max;e.exports=function(e,t){var n,s,a,c=i(arguments.length,2);for(e=Object(o(e)),a=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},s=1;s<c;++s)r(t=arguments[s]).forEach(a);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(409)()?Object.keys:n(410)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var r=n(44),o=Object.keys;e.exports=function(e){return o(r(e)?Object(e):e)}},function(e,t,n){"use strict";var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(e,t,n){"use strict";var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";var r,o=n(123),i=n(201),s=n(32),a=n(45),c=n(204),u=Object.defineProperty;r=e.exports=function(e,t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");c.call(this,e),t=t?i.call(t,"key+value")?"key+value":i.call(t,"key")?"key":"value":"value",u(this,"__kind__",s("",t))},o&&o(r,c),delete r.prototype.constructor,r.prototype=Object.create(c.prototype,{_resolve:s((function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e}))}),u(r.prototype,a.toStringTag,s("c","Array Iterator"))},function(e,t,n){"use strict";var r=n(91),o={object:!0,symbol:!0};e.exports=function(){var e,t=r.Symbol;if("function"!=typeof t)return!1;e=t("test symbol");try{String(e)}catch(e){return!1}return!!o[typeof t.iterator]&&(!!o[typeof t.toPrimitive]&&!!o[typeof t.toStringTag])}},function(e,t,n){"use strict";e.exports=function(){return"object"==typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},function(e,t){var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},function(e,t,n){"use strict";var r,o,i,s=n(32),a=n(203),c=n(91).Symbol,u=n(419),d=n(420),l=n(421),p=Object.create,f=Object.defineProperties,h=Object.defineProperty;if("function"==typeof c)try{String(c()),i=!0}catch(e){}else c=null;o=function(e){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return r(e)},e.exports=r=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return i?c(t):(n=p(o.prototype),t=void 0===t?"":String(t),f(n,{__description__:s("",t),__name__:s("",u(t))}))},d(r),l(r),f(o.prototype,{constructor:s(r),toString:s("",(function(){return this.__name__}))}),f(r.prototype,{toString:s((function(){return"Symbol ("+a(this).__description__+")"})),valueOf:s((function(){return a(this)}))}),h(r.prototype,r.toPrimitive,s("",(function(){var e=a(this);return"symbol"==typeof e?e:e.toString()}))),h(r.prototype,r.toStringTag,s("c","Symbol")),h(o.prototype,r.toStringTag,s("c",r.prototype[r.toStringTag])),h(o.prototype,r.toPrimitive,s("c",r.prototype[r.toPrimitive]))},function(e,t,n){"use strict";e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},function(e,t,n){"use strict";var r=n(32),o=Object.create,i=Object.defineProperty,s=Object.prototype,a=o(null);e.exports=function(e){for(var t,n,o=0;a[e+(o||"")];)++o;return a[e+=o||""]=!0,i(s,t="@@"+e,r.gs(null,(function(e){n||(n=!0,i(this,t,r(e)),n=!1)}))),t}},function(e,t,n){"use strict";var r=n(32),o=n(91).Symbol;e.exports=function(e){return Object.defineProperties(e,{hasInstance:r("",o&&o.hasInstance||e("hasInstance")),isConcatSpreadable:r("",o&&o.isConcatSpreadable||e("isConcatSpreadable")),iterator:r("",o&&o.iterator||e("iterator")),match:r("",o&&o.match||e("match")),replace:r("",o&&o.replace||e("replace")),search:r("",o&&o.search||e("search")),species:r("",o&&o.species||e("species")),split:r("",o&&o.split||e("split")),toPrimitive:r("",o&&o.toPrimitive||e("toPrimitive")),toStringTag:r("",o&&o.toStringTag||e("toStringTag")),unscopables:r("",o&&o.unscopables||e("unscopables"))})}},function(e,t,n){"use strict";var r=n(32),o=n(203),i=Object.create(null);e.exports=function(e){return Object.defineProperties(e,{for:r((function(t){return i[t]?i[t]:i[t]=e(String(t))})),keyFor:r((function(e){var t;for(t in o(e),i)if(i[t]===e)return t}))})}},function(e,t,n){"use strict";var r=n(31);e.exports=function(){return r(this).length=0,this}},function(e,t,n){"use strict";var r,o=n(55),i=n(424),s=n(428),a=n(429),c=n(200),u=n(439),d=Function.prototype.bind,l=Object.defineProperty,p=Object.prototype.hasOwnProperty;r=function(e,t,n){var r,o=i(t)&&s(t.value);return delete(r=a(t)).writable,delete r.value,r.get=function(){return!n.overwriteDefinition&&p.call(this,e)?o:(t.value=d.call(o,n.resolveContext?n.resolveContext(this):this),l(this,e,t),this[e])},r},e.exports=function(e){var t=c(arguments[1]);return o(t.resolveContext)&&s(t.resolveContext),u(e,(function(e,n){return r(n,e,t)}))}},function(e,t,n){"use strict";var r=n(205),o=n(55);e.exports=function(e){return o(e)?e:r(e,"Cannot use %v",arguments[1])}},function(e,t,n){"use strict";var r=n(55),o=n(124),i=Object.prototype.toString;e.exports=function(e){if(!r(e))return null;if(o(e)){var t=e.toString;if("function"!=typeof t)return null;if(t===i)return null}try{return""+e}catch(e){return null}}},function(e,t,n){"use strict";var r=n(427),o=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=r(e);return null===t?"<Non-coercible to string value>":(t.length>100&&(t=t.slice(0,99)+"…"),t=t.replace(o,(function(e){switch(e){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},function(e,t,n){"use strict";e.exports=function(e){try{return e.toString()}catch(t){try{return String(e)}catch(e){return null}}}},function(e,t,n){"use strict";var r=n(205),o=n(199);e.exports=function(e){return o(e)?e:r(e,"%v is not a plain function",arguments[1])}},function(e,t,n){"use strict";var r=n(430),o=n(125),i=n(31);e.exports=function(e){var t=Object(i(e)),n=arguments[1],s=Object(arguments[2]);if(t!==e&&!n)return t;var a={};return n?r(n,(function(t){(s.ensure||t in e)&&(a[t]=e[t])})):o(a,e),a}},function(e,t,n){"use strict";e.exports=n(431)()?Array.from:n(432)},function(e,t,n){"use strict";e.exports=function(){var e,t,n=Array.from;return"function"==typeof n&&(t=n(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}},function(e,t,n){"use strict";var r=n(45).iterator,o=n(89),i=n(433),s=n(434),a=n(70),c=n(31),u=n(44),d=n(90),l=Array.isArray,p=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},h=Object.defineProperty;e.exports=function(e){var t,n,m,b,g,v,y,S,E,T,C=arguments[1],w=arguments[2];if(e=Object(c(e)),u(C)&&a(C),this&&this!==Array&&i(this))t=this;else{if(!C){if(o(e))return 1!==(g=e.length)?Array.apply(null,e):((b=new Array(1))[0]=e[0],b);if(l(e)){for(b=new Array(g=e.length),n=0;n<g;++n)b[n]=e[n];return b}}b=[]}if(!l(e))if(void 0!==(E=e[r])){for(y=a(E).call(e),t&&(b=new t),S=y.next(),n=0;!S.done;)T=C?p.call(C,w,S.value,n):S.value,t?(f.value=T,h(b,n,f)):b[n]=T,S=y.next(),++n;g=n}else if(d(e)){for(g=e.length,t&&(b=new t),n=0,m=0;n<g;++n)T=e[n],n+1<g&&(v=T.charCodeAt(0))>=55296&&v<=56319&&(T+=e[++n]),T=C?p.call(C,w,T,m):T,t?(f.value=T,h(b,m,f)):b[m]=T,++m;g=m}if(void 0===g)for(g=s(e.length),t&&(b=new t(g)),n=0;n<g;++n)T=C?p.call(C,w,e[n],n):e[n],t?(f.value=T,h(b,n,f)):b[n]=T;return t&&(f.value=null,b.length=g),b}},function(e,t,n){"use strict";var r=Object.prototype.toString,o=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(e){return"function"==typeof e&&o(r.call(e))}},function(e,t,n){"use strict";var r=n(435),o=Math.max;e.exports=function(e){return o(0,r(e))}},function(e,t,n){"use strict";var r=n(436),o=Math.abs,i=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?r(e)*i(o(e)):e}},function(e,t,n){"use strict";e.exports=n(437)()?Math.sign:n(438)},function(e,t,n){"use strict";e.exports=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}},function(e,t,n){"use strict";e.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},function(e,t,n){"use strict";var r=n(70),o=n(440),i=Function.prototype.call;e.exports=function(e,t){var n={},s=arguments[2];return r(t),o(e,(function(e,r,o,a){n[r]=i.call(t,s,e,r,o,a)})),n}},function(e,t,n){"use strict";e.exports=n(441)("forEach")},function(e,t,n){"use strict";var r=n(70),o=n(31),i=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,c=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(n,u){var d,l=arguments[2],p=arguments[3];return n=Object(o(n)),r(u),d=a(n),p&&d.sort("function"==typeof p?i.call(p,n):void 0),"function"!=typeof e&&(e=d[e]),s.call(e,d,(function(e,r){return c.call(n,e)?s.call(u,l,n[e],e,n,r):t}))}}},function(e,t,n){"use strict";var r,o=n(123),i=n(32),s=n(45),a=n(204),c=Object.defineProperty;r=e.exports=function(e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e=String(e),a.call(this,e),c(this,"__length__",i("",e.length))},o&&o(r,a),delete r.prototype.constructor,r.prototype=Object.create(a.prototype,{_next:i((function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()})),_resolve:i((function(e){var t,n=this.__list__[e];return this.__nextIndex__===this.__length__?n:(t=n.charCodeAt(0))>=55296&&t<=56319?n+this.__list__[this.__nextIndex__++]:n}))}),c(r.prototype,s.toStringTag,i("c","String Iterator"))},function(e,t,n){"use strict";var r=n(444);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not iterable");return e}},function(e,t,n){"use strict";var r=n(89),o=n(44),i=n(90),s=n(45).iterator,a=Array.isArray;e.exports=function(e){return!!o(e)&&(!!a(e)||(!!i(e)||(!!r(e)||"function"==typeof e[s])))}},function(e,t,n){"use strict";var r=n(89),o=n(70),i=n(90),s=n(202),a=Array.isArray,c=Function.prototype.call,u=Array.prototype.some;e.exports=function(e,t){var n,d,l,p,f,h,m,b,g=arguments[2];if(a(e)||r(e)?n="array":i(e)?n="string":e=s(e),o(t),l=function(){p=!0},"array"!==n)if("string"!==n)for(d=e.next();!d.done;){if(c.call(t,g,d.value,l),p)return;d=e.next()}else for(h=e.length,f=0;f<h&&(m=e[f],f+1<h&&(b=m.charCodeAt(0))>=55296&&b<=56319&&(m+=e[++f]),c.call(t,g,m,l),!p);++f);else u.call(e,(function(e){return c.call(t,g,e,l),p}))}},function(e,t,n){"use strict";e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},function(e,t,n){var r=n(92),o=n(93),i=n(128),s=n(33),a=n(68),c=n(94),u=Math.min;e.exports=function(e,t,n){for(var d=n?i:o,l=e[0].length,p=e.length,f=p,h=Array(p),m=1/0,b=[];f--;){var g=e[f];f&&t&&(g=s(g,a(t))),m=u(g.length,m),h[f]=!n&&(t||l>=120&&g.length>=120)?new r(f&&g):void 0}g=e[0];var v=-1,y=h[0];e:for(;++v<l&&b.length<m;){var S=g[v],E=t?t(S):S;if(S=n||0!==S?S:0,!(y?c(y,E):d(b,E,n))){for(f=p;--f;){var T=h[f];if(!(T?c(T,E):d(e[f],E,n)))continue e}y&&y.push(E),b.push(S)}}return b}},function(e,t){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(206),o=n(451),i=n(452);e.exports=function(e,t,n){return t==t?i(e,t,n):r(e,o,n)}},function(e,t){e.exports=function(e){return e!=e}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}},function(e,t,n){var r=n(129);e.exports=function(e){return r(e)?e:[]}},function(e,t,n){"use strict";(function(t){var r=n(17),o=n(208),i=n(455),s=n(214);function a(e){var t=new i(e),n=o(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var c=a(n(211));c.Axios=i,c.create=function(e){return a(s(c.defaults,e))},c.Cancel=n(215),c.CancelToken=n(468),c.isCancel=n(210),c.all=function(e){return t.all(e)},c.spread=n(469),c.isAxiosError=n(470),e.exports=c,e.exports.default=c}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(17),o=n(209),i=n(456),s=n(457),a=n(214);function c(e){this.defaults=e,this.interceptors={request:new i,response:new i}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=[s,void 0],r=t.resolve(e);for(this.interceptors.request.forEach((function(e){n.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){n.push(e.fulfilled,e.rejected)}));n.length;)r=r.then(n.shift(),n.shift());return r},c.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,n,r){return this.request(a(r||{},{method:e,url:t,data:n}))}})),e.exports=c}).call(this,n(0))},function(e,t,n){"use strict";var r=n(17);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,n){"use strict";(function(t){var r=n(17),o=n(458),i=n(210),s=n(211);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(n){return i(n)||(a(e),n&&n.response&&(n.response.data=o(n.response.data,n.response.headers,e.transformResponse))),t.reject(n)}))}}).call(this,n(0))},function(e,t,n){"use strict";var r=n(17);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},function(e,t,n){"use strict";var r=n(17);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},function(e,t,n){"use strict";var r=n(213);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(17);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var r=n(464),o=n(465);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(17),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,s={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},function(e,t,n){"use strict";var r=n(17);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";(function(t){var r=n(215);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var n;this.promise=new t((function(e){n=e}));var o=this;e((function(e){o.reason||(o.reason=new r(e),n(o.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o}).call(this,n(0))},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t,n){var r=n(216)("pick",n(48));r.placeholder=n(130),e.exports=r},function(e,t,n){var r=n(473),o=n(130),i=Array.prototype.push;function s(e,t){return 2==t?function(t,n){return e(t,n)}:function(t){return e(t)}}function a(e){for(var t=e?e.length:0,n=Array(t);t--;)n[t]=e[t];return n}function c(e,t){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var o=r[0]=t.apply(void 0,r);return e.apply(void 0,r),o}}}e.exports=function e(t,n,u,d){var l="function"==typeof n,p=n===Object(n);if(p&&(d=u,u=n,n=void 0),null==u)throw new TypeError;d||(d={});var f=!("cap"in d)||d.cap,h=!("curry"in d)||d.curry,m=!("fixed"in d)||d.fixed,b=!("immutable"in d)||d.immutable,g=!("rearg"in d)||d.rearg,v=l?u:o,y="curry"in d&&d.curry,S="fixed"in d&&d.fixed,E="rearg"in d&&d.rearg,T=l?u.runInContext():void 0,C=l?u:{ary:t.ary,assign:t.assign,clone:t.clone,curry:t.curry,forEach:t.forEach,isArray:t.isArray,isError:t.isError,isFunction:t.isFunction,isWeakMap:t.isWeakMap,iteratee:t.iteratee,keys:t.keys,rearg:t.rearg,toInteger:t.toInteger,toPath:t.toPath},w=C.ary,R=C.assign,I=C.clone,_=C.curry,x=C.forEach,O=C.isArray,N=C.isError,k=C.isFunction,Z=C.isWeakMap,A=C.keys,L=C.rearg,V=C.toInteger,P=C.toPath,W=A(r.aryMethod),G={castArray:function(e){return function(){var t=arguments[0];return O(t)?e(a(t)):e.apply(void 0,arguments)}},iteratee:function(e){return function(){var t=arguments[0],n=arguments[1],r=e(t,n),o=r.length;return f&&"number"==typeof n?(n=n>2?n-2:1,o&&o<=n?r:s(r,n)):r}},mixin:function(e){return function(t){var n=this;if(!k(n))return e(n,Object(t));var r=[];return x(A(t),(function(e){k(t[e])&&r.push([e,n.prototype[e]])})),e(n,Object(t)),x(r,(function(e){var t=e[1];k(t)?n.prototype[e[0]]=t:delete n.prototype[e[0]]})),n}},nthArg:function(e){return function(t){var n=t<0?1:V(t)+1;return _(e(t),n)}},rearg:function(e){return function(t,n){var r=n?n.length:0;return _(e(t,n),r)}},runInContext:function(n){return function(r){return e(t,n(r),d)}}};function M(e,t){if(f){var n=r.iterateeRearg[e];if(n)return function(e,t){return F(e,(function(e){var n=t.length;return function(e,t){return 2==t?function(t,n){return e.apply(void 0,arguments)}:function(t){return e.apply(void 0,arguments)}}(L(s(e,n),t),n)}))}(t,n);var o=!l&&r.iterateeAry[e];if(o)return function(e,t){return F(e,(function(e){return"function"==typeof e?s(e,t):e}))}(t,o)}return t}function D(e,t,n){if(m&&(S||!r.skipFixed[e])){var o=r.methodSpread[e],s=o&&o.start;return void 0===s?w(t,n):function(e,t){return function(){for(var n=arguments.length,r=n-1,o=Array(n);n--;)o[n]=arguments[n];var s=o[t],a=o.slice(0,t);return s&&i.apply(a,s),t!=r&&i.apply(a,o.slice(t+1)),e.apply(this,a)}}(t,s)}return t}function X(e,t,n){return g&&n>1&&(E||!r.skipRearg[e])?L(t,r.methodRearg[e]||r.aryRearg[n]):t}function j(e,t){for(var n=-1,r=(t=P(t)).length,o=r-1,i=I(Object(e)),s=i;null!=s&&++n<r;){var a=t[n],c=s[a];null==c||k(c)||N(c)||Z(c)||(s[a]=I(n==o?c:Object(c))),s=s[a]}return i}function U(t,n){var o=r.aliasToReal[t]||t,i=r.remap[o]||o,s=d;return function(t){var r=l?T:C,a=l?T[i]:n,c=R(R({},s),t);return e(r,o,a,c)}}function F(e,t){return function(){var n=arguments.length;if(!n)return e();for(var r=Array(n);n--;)r[n]=arguments[n];var o=g?0:n-1;return r[o]=t(r[o]),e.apply(void 0,r)}}function Y(e,t,n){var o,i=r.aliasToReal[e]||e,s=t,u=G[i];return u?s=u(t):b&&(r.mutate.array[i]?s=c(t,a):r.mutate.object[i]?s=c(t,function(e){return function(t){return e({},t)}}(t)):r.mutate.set[i]&&(s=c(t,j))),x(W,(function(e){return x(r.aryMethod[e],(function(t){if(i==t){var n=r.methodSpread[i],a=n&&n.afterRearg;return o=a?D(i,X(i,s,e),e):X(i,D(i,s,e),e),o=function(e,t,n){return y||h&&n>1?_(t,n):t}(0,o=M(i,o),e),!1}})),!o})),o||(o=s),o==t&&(o=y?_(o,1):function(){return t.apply(this,arguments)}),o.convert=U(i,t),o.placeholder=t.placeholder=n,o}if(!p)return Y(n,u,v);var B=u,H=[];return x(W,(function(e){x(r.aryMethod[e],(function(e){var t=B[r.remap[e]||e];t&&H.push([e,Y(e,t,B)])}))})),x(A(B),(function(e){var t=B[e];if("function"==typeof t){for(var n=H.length;n--;)if(H[n][0]==e)return;t.convert=U(e,t),H.push([e,t])}})),x(H,(function(e){B[e[0]]=e[1]})),B.convert=function(e){return B.runInContext.convert(e)(void 0)},B.placeholder=B,x(A(B),(function(e){x(r.realToAlias[e]||[],(function(t){B[t]=B[e]}))})),B}},function(e,t){t.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},t.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},t.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},t.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},t.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},t.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},t.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},t.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},t.realToAlias=function(){var e=Object.prototype.hasOwnProperty,n=t.aliasToReal,r={};for(var o in n){var i=n[o];e.call(r,i)?r[i].push(o):r[i]=[o]}return r}(),t.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},t.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},t.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},function(e,t,n){e.exports={ary:n(475),assign:n(177),clone:n(37),curry:n(493),forEach:n(111),isArray:n(10),isError:n(494),isFunction:n(15),isWeakMap:n(495),iteratee:n(496),keys:n(114),rearg:n(511),toInteger:n(96),toPath:n(514)}},function(e,t,n){var r=n(131);e.exports=function(e,t,n){return t=n?void 0:t,t=e&&null==t?e.length:t,r(e,128,void 0,void 0,void 0,void 0,t)}},function(e,t,n){var r=n(95),o=n(14);e.exports=function(e,t,n){var i=1&t,s=r(e);return function t(){var r=this&&this!==o&&this instanceof t?s:e;return r.apply(i?n:this,arguments)}}},function(e,t,n){var r=n(120),o=n(95),i=n(219),s=n(222),a=n(228),c=n(134),u=n(14);e.exports=function(e,t,n){var d=o(e);return function o(){for(var l=arguments.length,p=Array(l),f=l,h=a(o);f--;)p[f]=arguments[f];var m=l<3&&p[0]!==h&&p[l-1]!==h?[]:c(p,h);if((l-=m.length)<n)return s(e,t,i,o.placeholder,void 0,p,m,void 0,void 0,n-l);var b=this&&this!==u&&this instanceof o?d:e;return r(b,this,p)}}},function(e,t){e.exports=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}},function(e,t,n){var r=n(132),o=n(223),i=n(480),s=n(482);e.exports=function(e){var t=i(e),n=s[t];if("function"!=typeof n||!(t in r.prototype))return!1;if(e===n)return!0;var a=o(n);return!!a&&e===a[0]}},function(e,t,n){var r=n(481),o=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",n=r[t],i=o.call(r,t)?n.length:0;i--;){var s=n[i],a=s.func;if(null==a||a==e)return s.name}return t}},function(e,t){e.exports={}},function(e,t,n){var r=n(132),o=n(225),i=n(133),s=n(10),a=n(16),c=n(483),u=Object.prototype.hasOwnProperty;function d(e){if(a(e)&&!s(e)&&!(e instanceof r)){if(e instanceof o)return e;if(u.call(e,"__wrapped__"))return c(e)}return new o(e)}d.prototype=i.prototype,d.prototype.constructor=d,e.exports=d},function(e,t,n){var r=n(132),o=n(225),i=n(54);e.exports=function(e){if(e instanceof r)return e.clone();var t=new o(e.__wrapped__,e.__chain__);return t.__actions__=i(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},function(e,t){var n=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var t=e.match(n);return t?t[1].split(r):[]}},function(e,t){var n=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,t){var r=t.length;if(!r)return e;var o=r-1;return t[o]=(r>1?"& ":"")+t[o],t=t.join(r>2?", ":" "),e.replace(n,"{\n/* [wrapped with "+t+"] */\n")}},function(e,t,n){var r=n(111),o=n(93),i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return r(i,(function(n){var r="_."+n[0];t&n[1]&&!o(e,r)&&e.push(r)})),e.sort()}},function(e,t,n){var r=n(54),o=n(67),i=Math.min;e.exports=function(e,t){for(var n=e.length,s=i(t.length,n),a=r(e);s--;){var c=t[s];e[s]=o(c,n)?a[c]:void 0}return e}},function(e,t,n){var r=n(120),o=n(95),i=n(14);e.exports=function(e,t,n,s){var a=1&t,c=o(e);return function t(){for(var o=-1,u=arguments.length,d=-1,l=s.length,p=Array(l+u),f=this&&this!==i&&this instanceof t?c:e;++d<l;)p[d]=s[d];for(;u--;)p[d++]=arguments[++o];return r(f,a?n:this,p)}}},function(e,t,n){var r=n(220),o=n(221),i=n(134),s=Math.min;e.exports=function(e,t){var n=e[1],a=t[1],c=n|a,u=c<131,d=128==a&&8==n||128==a&&256==n&&e[7].length<=t[8]||384==a&&t[7].length<=t[8]&&8==n;if(!u&&!d)return e;1&a&&(e[2]=t[2],c|=1&n?0:4);var l=t[3];if(l){var p=e[3];e[3]=p?r(p,l,t[4]):l,e[4]=p?i(e[3],"__lodash_placeholder__"):t[4]}return(l=t[5])&&(p=e[5],e[5]=p?o(p,l,t[6]):l,e[6]=p?i(e[5],"__lodash_placeholder__"):t[6]),(l=t[7])&&(e[7]=l),128&a&&(e[8]=null==e[8]?t[8]:s(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}},function(e,t,n){var r=n(229);e.exports=function(e){return e?(e=r(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},function(e,t,n){var r=n(492),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},function(e,t){var n=/\s/;e.exports=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}},function(e,t,n){var r=n(131);function o(e,t,n){var i=r(e,8,void 0,void 0,void 0,void 0,void 0,t=n?void 0:t);return i.placeholder=o.placeholder,i}o.placeholder={},e.exports=o},function(e,t,n){var r=n(29),o=n(16),i=n(135);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!i(e)}},function(e,t,n){var r=n(41),o=n(16);e.exports=function(e){return o(e)&&"[object WeakMap]"==r(e)}},function(e,t,n){var r=n(77),o=n(35);e.exports=function(e){return o("function"==typeof e?e:r(e,1))}},function(e,t,n){var r=n(498),o=n(502),i=n(235);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?i(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(78),o=n(230);e.exports=function(e,t,n,i){var s=n.length,a=s,c=!i;if(null==e)return!a;for(e=Object(e);s--;){var u=n[s];if(c&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++s<a;){var d=(u=n[s])[0],l=e[d],p=u[1];if(c&&u[2]){if(void 0===l&&!(d in e))return!1}else{var f=new r;if(i)var h=i(l,p,d,e,t,f);if(!(void 0===h?o(p,l,3,i,f):h))return!1}}return!0}},function(e,t,n){var r=n(78),o=n(231),i=n(500),s=n(501),a=n(41),c=n(10),u=n(66),d=n(85),l="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,f,h,m){var b=c(e),g=c(t),v=b?"[object Array]":a(e),y=g?"[object Array]":a(t),S=(v="[object Arguments]"==v?l:v)==l,E=(y="[object Arguments]"==y?l:y)==l,T=v==y;if(T&&u(e)){if(!u(t))return!1;b=!0,S=!1}if(T&&!S)return m||(m=new r),b||d(e)?o(e,t,n,f,h,m):i(e,t,v,n,f,h,m);if(!(1&n)){var C=S&&p.call(e,"__wrapped__"),w=E&&p.call(t,"__wrapped__");if(C||w){var R=C?e.value():e,I=w?t.value():t;return m||(m=new r),h(R,I,n,f,m)}}return!!T&&(m||(m=new r),s(e,t,n,f,h,m))}},function(e,t,n){var r=n(39),o=n(188),i=n(52),s=n(231),a=n(233),c=n(97),u=r?r.prototype:void 0,d=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,l,p){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!l(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var h=1&r;if(f||(f=c),e.size!=t.size&&!h)return!1;var m=p.get(e);if(m)return m==t;r|=2,p.set(e,t);var b=s(f(e),f(t),r,u,l,p);return p.delete(e),b;case"[object Symbol]":if(d)return d.call(e)==d.call(t)}return!1}},function(e,t,n){var r=n(183),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,i,s,a){var c=1&n,u=r(e),d=u.length;if(d!=r(t).length&&!c)return!1;for(var l=d;l--;){var p=u[l];if(!(c?p in t:o.call(t,p)))return!1}var f=a.get(e),h=a.get(t);if(f&&h)return f==t&&h==e;var m=!0;a.set(e,t),a.set(t,e);for(var b=c;++l<d;){var g=e[p=u[l]],v=t[p];if(i)var y=c?i(v,g,p,t,e,a):i(g,v,p,e,t,a);if(!(void 0===y?g===v||s(g,v,n,i,a):y)){m=!1;break}b||(b="constructor"==p)}if(m&&!b){var S=e.constructor,E=t.constructor;S==E||!("constructor"in e)||!("constructor"in t)||"function"==typeof S&&S instanceof S&&"function"==typeof E&&E instanceof E||(m=!1)}return a.delete(e),a.delete(t),m}},function(e,t,n){var r=n(234),o=n(30);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var i=t[n],s=e[i];t[n]=[i,s,r(s)]}return t}},function(e,t,n){var r=n(230),o=n(57),i=n(237),s=n(136),a=n(234),c=n(235),u=n(47);e.exports=function(e,t){return s(e)&&a(t)?c(u(e),t):function(n){var s=o(n,e);return void 0===s&&s===t?i(n,e):r(t,s,3)}}},function(e,t,n){var r=n(191);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},function(e,t,n){var r=n(39),o=n(33),i=n(10),s=n(71),a=r?r.prototype:void 0,c=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(s(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(58),o=n(65),i=n(10),s=n(67),a=n(112),c=n(47);e.exports=function(e,t,n){for(var u=-1,d=(t=r(t,e)).length,l=!1;++u<d;){var p=c(t[u]);if(!(l=null!=e&&n(e,p)))break;e=e[p]}return l||++u!=d?l:!!(d=null==e?0:e.length)&&a(d)&&s(p,d)&&(i(e)||o(e))}},function(e,t,n){var r=n(509),o=n(510),i=n(136),s=n(47);e.exports=function(e){return i(e)?r(s(e)):o(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(98);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(131),o=n(137),i=o((function(e,t){return r(e,256,void 0,void 0,void 0,t)}));e.exports=i},function(e,t,n){var r=n(238);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},function(e,t,n){var r=n(39),o=n(65),i=n(10),s=r?r.isConcatSpreadable:void 0;e.exports=function(e){return i(e)||o(e)||!!(s&&e&&e[s])}},function(e,t,n){var r=n(33),o=n(54),i=n(10),s=n(71),a=n(236),c=n(47),u=n(59);e.exports=function(e){return i(e)?r(e,c):s(e)?[e]:o(a(u(e)))}},function(e,t,n){var r=n(516),o=n(237);e.exports=function(e,t){return r(e,t,(function(t,n){return o(e,n)}))}},function(e,t,n){var r=n(98),o=n(517),i=n(58);e.exports=function(e,t,n){for(var s=-1,a=t.length,c={};++s<a;){var u=t[s],d=r(e,u);n(d,u)&&o(c,i(u,e),d)}return c}},function(e,t,n){var r=n(83),o=n(58),i=n(67),s=n(9),a=n(47);e.exports=function(e,t,n,c){if(!s(e))return e;for(var u=-1,d=(t=o(t,e)).length,l=d-1,p=e;null!=p&&++u<d;){var f=a(t[u]),h=n;if("__proto__"===f||"constructor"===f||"prototype"===f)return e;if(u!=l){var m=p[f];void 0===(h=c?c(m,f,p):void 0)&&(h=s(m)?m:i(t[u+1])?[]:{})}r(p,f,h),p=p[f]}return e}},function(e,t,n){var r=n(216)("mapKeys",n(519));r.placeholder=n(130),e.exports=r},function(e,t,n){var r=n(64),o=n(99),i=n(35);e.exports=function(e,t){var n={};return t=i(t,3),o(e,(function(e,o,i){r(n,t(e,o,i),e)})),n}},function(e,t){e.exports=function(e){return function(t,n,r){for(var o=-1,i=Object(t),s=r(t),a=s.length;a--;){var c=s[e?a:++o];if(!1===n(i[c],c,i))break}return t}}},function(e,t,n){(function(e){var r;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global);i.global!==i&&i.window!==i&&i.self;var s,a=2147483647,c=/^xn--/,u=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,f=String.fromCharCode;function h(e){throw new RangeError(l[e])}function m(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function b(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+m((e=e.replace(d,".")).split("."),t).join(".")}function g(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function v(e){return m(e,(function(e){var t="";return e>65535&&(t+=f((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=f(e)})).join("")}function y(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,n){var r=0;for(e=n?p(e/700):e>>1,e+=p(e/t);e>455;r+=36)e=p(e/35);return p(r+36*e/(e+38))}function E(e){var t,n,r,o,i,s,c,u,d,l,f,m=[],b=e.length,g=0,y=128,E=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&h("not-basic"),m.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<b;){for(i=g,s=1,c=36;o>=b&&h("invalid-input"),((u=(f=e.charCodeAt(o++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||u>p((a-g)/s))&&h("overflow"),g+=u*s,!(u<(d=c<=E?1:c>=E+26?26:c-E));c+=36)s>p(a/(l=36-d))&&h("overflow"),s*=l;E=S(g-i,t=m.length+1,0==i),p(g/t)>a-y&&h("overflow"),y+=p(g/t),g%=t,m.splice(g++,0,y)}return v(m)}function T(e){var t,n,r,o,i,s,c,u,d,l,m,b,v,E,T,C=[];for(b=(e=g(e)).length,t=128,n=0,i=72,s=0;s<b;++s)(m=e[s])<128&&C.push(f(m));for(r=o=C.length,o&&C.push("-");r<b;){for(c=a,s=0;s<b;++s)(m=e[s])>=t&&m<c&&(c=m);for(c-t>p((a-n)/(v=r+1))&&h("overflow"),n+=(c-t)*v,t=c,s=0;s<b;++s)if((m=e[s])<t&&++n>a&&h("overflow"),m==t){for(u=n,d=36;!(u<(l=d<=i?1:d>=i+26?26:d-i));d+=36)T=u-l,E=36-l,C.push(f(y(l+T%E,0))),u=p(T/E);C.push(f(y(u,0))),i=S(n,v,r==o),n=0,++r}++n,++t}return C.join("")}s={version:"1.4.1",ucs2:{decode:g,encode:v},decode:E,encode:T,toASCII:function(e){return b(e,(function(e){return u.test(e)?"xn--"+T(e):e}))},toUnicode:function(e){return b(e,(function(e){return c.test(e)?E(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return s}.call(t,n,t,e))||(e.exports=r)}()}).call(this,n(84)(e))},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(524),t.encode=t.stringify=n(525)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,i){t=t||"&",n=n||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var c=1e3;i&&"number"==typeof i.maxKeys&&(c=i.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var d=0;d<u;++d){var l,p,f,h,m=e[d].replace(a,"%20"),b=m.indexOf(n);b>=0?(l=m.substr(0,b),p=m.substr(b+1)):(l=m,p=""),f=decodeURIComponent(l),h=decodeURIComponent(p),r(s,f)?o(s[f])?s[f].push(h):s[f]=[s[f],h]:s[f]=h}return s};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,a){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(s(e),(function(s){var a=encodeURIComponent(r(s))+n;return o(e[s])?i(e[s],(function(e){return a+encodeURIComponent(r(e))})).join(t):a+encodeURIComponent(r(e[s]))})).join(t):a?encodeURIComponent(r(a))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var s=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){var r,o,i=n(242),s=n(243),a=0,c=0;e.exports=function(e,t,n){var u=t&&n||0,d=t||[],l=(e=e||{}).node||r,p=void 0!==e.clockseq?e.clockseq:o;if(null==l||null==p){var f=i();null==l&&(l=r=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==p&&(p=o=16383&(f[6]<<8|f[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:c+1,b=h-a+(m-c)/1e4;if(b<0&&void 0===e.clockseq&&(p=p+1&16383),(b<0||h>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=h,c=m,o=p;var g=(1e4*(268435455&(h+=122192928e5))+m)%4294967296;d[u++]=g>>>24&255,d[u++]=g>>>16&255,d[u++]=g>>>8&255,d[u++]=255&g;var v=h/4294967296*1e4&268435455;d[u++]=v>>>8&255,d[u++]=255&v,d[u++]=v>>>24&15|16,d[u++]=v>>>16&255,d[u++]=p>>>8|128,d[u++]=255&p;for(var y=0;y<6;++y)d[u+y]=l[y];return t||s(d)}},function(e,t,n){var r=n(242),o=n(243);e.exports=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[i+a]=s[a];return t||o(s)}},function(e,t,n){"use strict";var r=n(3)(n(18));let o=function(){function e(e){let t=(void 0===e?{}:e).waitTime,n=void 0===t?50:t;(0,r.default)(this,"queue",[]),(0,r.default)(this,"running",!1),this.waitTime=n}var t=e.prototype;return t.add=function(e){this.queue.push(e),this.run()},t.run=function(){if(this.running)return;this.running=!0;const e=()=>{if(0===this.queue.length)return void(this.running=!1);this.queue.shift()(()=>{setTimeout(e,this.waitTime)})};e()},e}();e.exports=o},function(e,t,n){"use strict";const r=n(9),o={for:"htmlFor",class:"className"};e.exports=function(e){e.prototype.attr=function(e,t){if(r(e)){let t;Object.keys(e).forEach(n=>{t=o[n]||n,this.first.setAttribute(t,e[n])})}else{if(void 0===t)return this.first.getAttribute(o[e]||e);this.first.setAttribute(o[e]||e,t)}return this},e.prototype.removeAttr=function(e){const t=o[e]||e;return this.forEach(e=>{e.removeAttribute(t)}),this},e.prototype.html=function(e){return void 0!==e&&(this.first.innerHTML=e),this.first.innerHTML},e.prototype.center=function(t,n){let r;return this.forEach(o=>{r=new e(o),t=t||parseInt(r.width(),10),n=n||parseInt(r.height(),10);const i=-.5*t+"px",s=-.5*n+"px";r.css("margin",`${s} 0 0 ${i}`).addClass("OT_centered")}),this},e._attachToOTHelpers.centerElement=function(t,n,r){return new e(t).center(n,r)};const t=function(t){return t.offsetWidth>0?t.offsetWidth+"px":new e(t).css("width")},n=function(t){return t.offsetHeight>0?t.offsetHeight+"px":new e(t).css("height")};e.prototype.width=function(e){return e?(this.css("width",e),this):this.isDisplayNone()?this.makeVisibleAndYield(e=>t(e))[0]:t(this.get(0))},e._attachToOTHelpers.width=function(t,n){const r=new e(t).width(n);return n?e._attachToOTHelpers:r},e.prototype.height=function(e){return e?(this.css("height",e),this):this.isDisplayNone()?this.makeVisibleAndYield(e=>n(e))[0]:n(this.get(0))},e._attachToOTHelpers.height=function(t,n){const r=new e(t).height(n);return n?e._attachToOTHelpers:r}}},function(e,t,n){"use strict";const r=n(2),o=(void 0!==typeof window?window:global).getComputedStyle,i={Firefox:"moz",Opera:"O",Chrome:"Webkit",Safari:"Webkit"};e.exports=function(e,t){const n={},s={},a=function(e,t){if(t in e.style)return t;const n=i[r.name]+t[0].toUpperCase()+t.slice(1);return n in e.style?n:t};e.prototype.show=function(){return this.forEach(t=>{const r=t.style.display;""!==r&&"none"!==r||(t.style.display=n[t]||"",delete n[t]),function(e){return"none"===o(e).getPropertyValue("display")}(t)&&(n[t]="none",t.style.display=function(t){if(s[t.ownerDocument]&&s[t.ownerDocument][t.nodeName])return s[t.ownerDocument][t.nodeName];s[t.ownerDocument]||(s[t.ownerDocument]={});let n,r=t.ownerDocument.createElement(t.nodeName);return t.ownerDocument.body.appendChild(r),n=new e(r).css("display"),s[t.ownerDocument][t.nodeName]=n,new e(r).remove(),r=null,n}(t))})},e.prototype.hide=function(){return this.forEach(e=>{"none"!==e.style.display&&(n[e]=e.style.display,e.style.display="none")})},e.prototype.css=function(e,t){if(0!==this.length)return"string"!=typeof e?this.forEach(t=>{!function(e,t){const n=e.style;for(const r in t)t.hasOwnProperty(r)&&(n[a(e,r)]=t[r])}(t,e)}):void 0!==t?this.forEach(n=>{!function(e,t,n){e.style[a(e,t)]=n}(n,e,t)}):function(e,t){const n=a(e,t);let r=o(e).getPropertyValue(n);return""===r&&(r=e.style[n]),r}(this.first,e)},e.prototype.makeVisibleAndYield=function(n){const r={display:"block",visibility:"hidden"},o=[];return this.forEach(i=>{const s=t(i);s?o.push(function(t,n,r){const o=new e(t),i={};let s,a;for(s in n)n.hasOwnProperty(s)&&(i[s]=t.style[s],o.css(s,n[s]));for(s in a=r(t),n)n.hasOwnProperty(s)&&o.css(s,i[s]||"");return a}(s,r,n)):o.push(void 0)}),o}}},function(e,t,n){"use strict";(function(t){const r=n(532),o=r.isiPhone,i=r.isiPad,s=r.isiOS,a=n(533),c=n(534),u=e=>{var t,n;return(null==(n=e=e||(null==(t=void 0!==typeof window?window:global)?void 0:t.navigator))?void 0:n.userAgent.toLowerCase().indexOf("electron"))>=0},d=()=>{var e,t,n;return"string"==typeof(null==(e=void 0!==typeof window?window:global)||null==(t=e.process)||null==(n=t.versions)?void 0:n.node)&&!u()},l={version:-1,name:"unknown"};e.exports={parse:e=>(d()?(l.name="Node",l.isNode=!0,l.version=parseInt(t.versions.node,10),l.userAgent=`${l.name} ${l.version}`):(e=>{if(e=e||(void 0!==typeof window?window:global).navigator,l.userAgent=e.userAgent.toLowerCase(),l.name="unknown",l.userAgent.indexOf("opera")>-1||l.userAgent.indexOf("opr/")>-1)l.name="Opera",l.isOpera=!0,null!==/opr\/([0-9]{1,}[.0-9]{0,})/.exec(l.userAgent)&&(l.version=parseFloat(RegExp.$1));else if(l.userAgent.indexOf("firefox")>-1)l.name="Firefox",l.isFirefox=!0,null!==/firefox\/([0-9]{1,}[.0-9]{0,})/.exec(l.userAgent)&&(l.version=parseFloat(RegExp.$1));else if(l.userAgent.match(/edge?\/(\d+)(?:\.\d+)+$/)){l.name="Edge",l.isEdge=!0;const e=RegExp.$1;l.version=parseInt(e,10)}else l.userAgent.indexOf("chrome")>-1?(l.name="Chrome",l.isElectron=u(e),l.isElectron?l.electronVersion=c(e.userAgent):l.isChrome=!0,null!==/chrome\/([0-9]{1,}[.0-9]{0,})/.exec(l.userAgent)&&(l.version=parseFloat(RegExp.$1))):e.vendor&&e.vendor.toLowerCase().indexOf("apple")>-1?(l.name="Safari",l.isSafari=!0,l.isiPhone=o(e.userAgent),l.isiPad=i(e.userAgent),l.isiOS=s(e.userAgent),l.isiOS&&(l.iOSVersion=a(e.userAgent)),(null!==/version\/([0-9]{1,}[.0-9]{0,})/.exec(l.userAgent)||null!==/fxios\/([0-9]{1,}[.0-9]{0,})/.exec(l.userAgent)||null!==/crios\/([0-9]{1,}[.0-9]{0,})/.exec(l.userAgent))&&(l.version=parseFloat(RegExp.$1))):l.userAgent.indexOf("applewebkit")>-1&&-1===l.userAgent.indexOf("version")&&(l.isIosWebView=!0);l.isChromiumEdge="Edge"===l.name&&l.version>=79,l.isLegacyEdge="Edge"===l.name&&l.version<79,l.isLegacyElectron=l.isElectron&&l.electronVersion<2,l.isLegacyChrome=l.isChrome&&l.version<50,l.isAndroid=l.userAgent.indexOf("android")>-1,l.userAgent=e.userAgent,l.protocol=location.protocol,l.hostName=location.hostName,(-1===l.version||"unknown"===l.name||l.isiOS&&!l.iOSVersion)&&(l.error=!0)})(e),l),isNode:d}}).call(this,n(43))},function(e,t,n){"use strict";const r=e=>/iPhone/.test(e),o=e=>/iPad/.test(e)||(e=>{try{return e.includes("Mac")&&"ontouchend"in document}catch(e){return!1}})(e);e.exports={isiPhone:r,isiPad:o,isiOS:e=>r(e)||o(e)}},function(e,t,n){"use strict";e.exports=function(e){const t=e.match(/OS (\d+_\d+).* like Mac/);if(null!==t&&t[1])return parseFloat(t[1].replace("_","."))}},function(e,t,n){"use strict";const r=/(Electron)\/([0-9]{1,}[.0-9]{0,})/;e.exports=e=>{const t=e.match(r);return t&&parseFloat(t[2])}},function(e,t,n){"use strict";const r=n(536);function o(e,t){return!!t&&(r()?e.classList.contains(t):e.className.indexOf(t)>-1)}e.exports=function(e){e.prototype.addClass=function(e){if(e){const t=e.trim().split(/\s+/);this.forEach(e=>{!function(e,t){if(!t||0===t.length)return;if(1!==e.nodeType)return;const n=t.length;let o=0;if(r())for(;o<n;++o)e.classList.add(t[o]);else if(e.className||1!==t.length){let r=` ${e.className} `;for(;o<n;++o)~r.indexOf(` ${t[o]} `)||(r+=t[o]+" ");e.className=r.trim()}else e.className=t.join(" ")}(e,t)})}return this},e.prototype.removeClass=function(e){if(e){const t=e.trim().split(/\s+/);this.forEach(e=>{!function(e,t){if(!t||0===t.length)return;if(1!==e.nodeType)return;const n=t.length;let o=0;if(r()){for(;o<n;++o)e.classList.remove(t[o]);return}let i=` ${e.className} `.replace(/[\s+]/," ");for(;o<n;++o)i=i.replace(` ${t[o]} `," ");e.className=i.trim()}(e,t)})}return this},e.prototype.toggleClass=function(e){if(e){const t=e.trim().split(/\s+/);this.forEach(e=>{!function(e,t){if(!t||0===t.length)return;if(1!==e.nodeType)return;const n=t.length;let i=0;if(r()){for(;i<n;++i)e.classList.toggle(t[i]);return}let s=` ${e.className} `.replace(/[\s+]/," ");for(;i<n;++i)o(e,t[i])?s=s.replace(` ${t[i]} `," "):s+=t[i]+" ";e.className=s.trim()}(e,t)})}return this},e.prototype.hasClass=function(e){return this.some(t=>o(t,e))}}},function(e,t,n){"use strict";e.exports=()=>"undefined"!=typeof document&&"classList"in document.createElement("a")},function(e,t,n){"use strict";const r=n(538);e.exports=function(e){let t=0,n=0;e.prototype.observeStyleChanges=function(t,n){const o=[];return this.forEach(i=>{o.push(function(t,n,o){const i={},s=function(n){switch(n){case"width":return new e(t).width();case"height":return new e(t).height();default:return new e(t).css(n)}};n.forEach(e=>{i[e]=s(e)});const a=new(void 0!==typeof window?window:global).MutationObserver(a=>{const c={};a.forEach(r=>{if("style"!==r.attributeName)return;const o=new e(t).isDisplayNone();n.forEach(e=>{if(o&&("width"===e||"height"===e))return;const t=s(e);t!==i[e]&&(c[e]=[i[e],t],i[e]=t)})}),r(c)||setTimeout(()=>{o.call(null,c)})});return a.observe(t,{attributes:!0,attributeFilter:["style"],childList:!1,characterData:!1,subtree:!1}),a}(i,t,n))}),o},e.prototype.observeNodeOrChildNodeRemoval=function(t){const r=[];return this.forEach(o=>{r.push(function(t,r){const o=new(void 0!==typeof window?window:global).MutationObserver(t=>{let n=[];t.forEach(e=>{e.removedNodes.length&&(n=n.concat(Array.prototype.slice.call(e.removedNodes)))}),n.length&&setTimeout(()=>{r(new e(n))})});o.observe(t,{attributes:!1,childList:!0,characterData:!1,subtree:!0}),n++;const i=o.disconnect;return o.disconnect=function(){i.apply(o,arguments),n--},o}(o,t))}),r},e.prototype.observeSize=function(e){const n=[];return this.forEach(r=>{n.push(function(e,n){let r={width:0,height:0};const o=setInterval(()=>{const t=e.getBoundingClientRect();r.width===t.width&&r.height===t.height||(n(t,r),r={width:t.width,height:t.height})},200);return t++,{disconnect(){clearInterval(o),t--}}}(r,e))}),n},e._attachToOTHelpers.observeStyleChanges=function(t,n,r){return new e(t).observeStyleChanges(n,r)[0]},e._attachToOTHelpers.observeNodeOrChildNodeRemoval=function(t,n){return new e(t).observeNodeOrChildNodeRemoval(n)[0]},e.__testOnly||(e.__testOnly={}),e.__testOnly.sizeObserverCount=function(){return t},e.__testOnly.nodeRemovalObserverCount=function(){return n}}},function(e,t,n){var r=n(114),o=n(41),i=n(65),s=n(10),a=n(25),c=n(66),u=n(69),d=n(85),l=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(a(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||c(e)||d(e)||i(e)))return!e.length;var t=o(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(l.call(e,n))return!1;return!0}},function(e,t,n){"use strict";e.exports={1004:"Authentication error",1005:"Invalid Session ID",1006:"Connect Failed",1007:"Connect Rejected",1008:"Connect Time-out",1009:"Security Error",1010:"Not Connected",1011:"Invalid Parameter",1012:"Peer-to-peer Stream Play Failed",1013:"Connection Failed",1014:"API Response Failure",1015:"PeerConnection not connected, cannot call this method",1021:"Request Timeout",1026:"Terms of Service Violation: Export Compliance",1027:"Connection Limit Exceeded",1040:"Set Video Source Failure",1041:"Invalid Video Source",1500:"Unable to Publish",1501:"Unable to Subscribe",1502:"Unsupported Video Codec",1503:"No TURN server found",1520:"Unable to Force Disconnect",1530:"Unable to Force Unpublish",1540:"Unable to Force Mute",1553:"ICEWorkflow failed",1600:"createOffer, createAnswer, setLocalDescription, setRemoteDescription",1605:"Stream Limit Exceeded",2e3:"Internal Error",2001:"Unexpected Server Response",2021:"Proxy URL Timing Error",2022:"Proxy URL Already Set Error",2031:"getRtcStatsReport is not supported in this browser",4e3:"WebSocket Connection Failed",4001:"WebSocket Network Disconnected",5001:"Unable to access media engine"}},function(e,t,n){"use strict";const r=n(15);e.exports=function(e,t,n,o,i){let s,a=n;e.currentState=n;return e.is=function(){return-1!==Array.prototype.indexOf.call(arguments,a)},e.isNot=function(){return-1===Array.prototype.indexOf.call(arguments,a)},function(n){if(a!==n){if(-1===t.indexOf(n))return void(i&&r(i)&&i("invalidState",n));e.previousState=a,s=a,e.currentState=n,a=n,o&&r(o)&&o(n,s)}}}},function(e,t,n){"use strict";const r=n(248),o={};e.exports=o,o.isElementNode=function(e){return e&&"object"==typeof e&&1===e.nodeType},o.createElement=function(e,t,n,r){const o=(r||document).createElement(e);t=t||{},Object.keys(t).forEach(e=>{if("object"==typeof t[e]){o[e]||(o[e]={});const n=t[e];Object.keys(n).forEach(t=>{o[e][t]=n[t]})}else"className"===e?o.className=t[e]:o.setAttribute(e,t[e])});const i=function(e){"string"==typeof e?o.innerHTML+=e:o.appendChild(e)};return Array.isArray(n)?n.forEach(i):n&&i(n),o},r(o)},function(e,t,n){"use strict";const r=n(543);e.exports=function(e){void 0===e&&(e={});(e.isSessionProxied||n(544))(e.sessionId)&&r.forEach(t=>{t in e&&(e[t]="")})}},function(e,t,n){"use strict";e.exports=["audioLocalAddress","audioRemoteAddress","videoLocalAddress","videoRemoteAddress"]},function(e,t,n){"use strict";const r=n(21).sessions;e.exports=e=>{const t=r.get(e);return!!t&&!!t._.getProxyUrl()}},function(e,t,n){"use strict";e.exports=["buildHash","minimumVersion","debug",["websiteURL","websiteUrl"],["cdnURL","cdnUrl"],["loggingURL","loggingUrl"],["apiURL","apiUrl"],["supportSSL",!0],["cdnURLSSL","cdnUrl"],["loggingURLSSL","loggingUrl"],["apiURLSSL","apiUrl"],["assetURL","assetUrl"]]},function(e,t,n){"use strict";e.exports=["apiUrl","apiURL","apiURLSSL"]},function(e,t,n){"use strict";e.exports=function(){const e=(void 0!==typeof window?window:global).OT,t=(void 0!==typeof window?window:global).TB;return()=>{const n=(void 0!==typeof window?window:global).OT;return(void 0!==typeof window?window:global).OT=e,(void 0!==typeof window?window:global).TB=t,n}}},function(e,t,n){"use strict";e.exports=function(e){function t(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];const i=new e(...r);return Object.setPrototypeOf(i,t.prototype),i}return t.prototype=Object.create(e.prototype),Object.defineProperties(t.prototype,(e=>{const t={};return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=Object.getOwnPropertyDescriptor(e,n)}),t})(e.prototype)),Object.keys(e).forEach(n=>{t[n]=e[n]}),t}},function(e,t,n){"use strict";var r=n(28);e.exports=function(e,t){var o=e&&e.window,i={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);var a=r.log,c=r.detectBrowser(o),u=n(550)||null,d=n(552)||null,l=n(556)||null,p=n(558)||null,f=n(559)||null,h={browserDetails:c,commonShim:f,extractVersion:r.extractVersion,disableLog:r.disableLog,disableWarnings:r.disableWarnings};switch(c.browser){case"chrome":if(!u||!u.shimPeerConnection||!i.shimChrome)return a("Chrome shim is not included in this adapter release."),h;a("adapter.js shimming chrome."),h.browserShim=u,f.shimCreateObjectURL(o),u.shimGetUserMedia(o),u.shimMediaStream(o),u.shimSourceObject(o),u.shimPeerConnection(o),u.shimOnTrack(o),u.shimAddTrackRemoveTrack(o),u.shimGetSendersWithDtmf(o),u.shimSenderReceiverGetStats(o),u.fixNegotiationNeeded(o),f.shimRTCIceCandidate(o),f.shimMaxMessageSize(o),f.shimSendThrowTypeError(o);break;case"firefox":if(!l||!l.shimPeerConnection||!i.shimFirefox)return a("Firefox shim is not included in this adapter release."),h;a("adapter.js shimming firefox."),h.browserShim=l,f.shimCreateObjectURL(o),l.shimGetUserMedia(o),l.shimSourceObject(o),l.shimPeerConnection(o),l.shimOnTrack(o),l.shimRemoveStream(o),l.shimSenderGetStats(o),l.shimReceiverGetStats(o),l.shimRTCDataChannel(o),f.shimRTCIceCandidate(o),f.shimMaxMessageSize(o),f.shimSendThrowTypeError(o);break;case"edge":if(!d||!d.shimPeerConnection||!i.shimEdge)return a("MS edge shim is not included in this adapter release."),h;a("adapter.js shimming edge."),h.browserShim=d,f.shimCreateObjectURL(o),d.shimGetUserMedia(o),d.shimPeerConnection(o),d.shimReplaceTrack(o),d.shimGetDisplayMedia(o),f.shimMaxMessageSize(o),f.shimSendThrowTypeError(o);break;case"safari":if(!p||!i.shimSafari)return a("Safari shim is not included in this adapter release."),h;a("adapter.js shimming safari."),h.browserShim=p,f.shimCreateObjectURL(o),p.shimRTCIceServerUrls(o),p.shimCreateOfferLegacy(o),p.shimCallbacksAPI(o),p.shimLocalStreamsAPI(o),p.shimRemoteStreamsAPI(o),p.shimTrackEventTransceiver(o),p.shimGetUserMedia(o),f.shimRTCIceCandidate(o),f.shimMaxMessageSize(o),f.shimSendThrowTypeError(o);break;default:a("Unsupported browser!")}return h}},function(e,t,n){"use strict";(function(t){var r=n(28),o=r.log;function i(e,t,n){var r=n?"outbound-rtp":"inbound-rtp",o=new Map;if(null===t)return o;var i=[];return e.forEach((function(e){"track"===e.type&&e.trackIdentifier===t.id&&i.push(e)})),i.forEach((function(t){e.forEach((function(n){n.type===r&&n.trackId===t.id&&function e(t,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach((function(o){o.endsWith("Id")?e(t,t.get(n[o]),r):o.endsWith("Ids")&&n[o].forEach((function(n){e(t,t.get(n),r)}))})))}(e,n,o)}))})),o}e.exports={shimGetUserMedia:n(551),shimMediaStream:function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},shimOnTrack:function(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var n=this;return n._ontrackpoly||(n._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(r){var o;o=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===r.track.id})):{track:r.track};var i=new Event("track");i.track=r.track,i.receiver=o,i.transceiver={receiver:o},i.streams=[t.stream],n.dispatchEvent(i)})),t.stream.getTracks().forEach((function(r){var o;o=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===r.id})):{track:r};var i=new Event("track");i.track=r,i.receiver=o,i.transceiver={receiver:o},i.streams=[t.stream],n.dispatchEvent(i)}))},n.addEventListener("addstream",n._ontrackpoly)),t.apply(n,arguments)}}else r.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}))},shimGetSendersWithDtmf:function(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){var o=this,i=n.apply(o,arguments);return i||(i=t(o,e),o._senders.push(i)),i};var r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;r.apply(t,arguments);var n=t._senders.indexOf(e);-1!==n&&t._senders.splice(n,1)}}var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;n._senders=n._senders||[],o.apply(n,[e]),e.getTracks().forEach((function(e){n._senders.push(t(n,e))}))};var i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;t._senders=t._senders||[],i.apply(t,[e]),e.getTracks().forEach((function(e){var n=t._senders.find((function(t){return t.track===e}));n&&t._senders.splice(t._senders.indexOf(n),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var s=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=s.apply(e,[]);return t.forEach((function(t){t._pc=e})),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},shimSenderReceiverGetStats:function(e){if("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var n=e.RTCPeerConnection.prototype.getSenders;n&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=n.apply(e,[]);return t.forEach((function(t){t._pc=e})),t});var o=e.RTCPeerConnection.prototype.addTrack;o&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=o.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return i(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var s=e.RTCPeerConnection.prototype.getReceivers;s&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=s.apply(e,[]);return t.forEach((function(t){t._pc=e})),t}),r.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return i(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var a=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var n=this;if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var r,o,i,s=arguments[0];return n.getSenders().forEach((function(e){e.track===s&&(r?i=!0:r=e)})),n.getReceivers().forEach((function(e){return e.track===s&&(o?i=!0:o=e),e.track===s})),i||r&&o?t.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):r?r.getStats():o?o.getStats():t.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return a.apply(n,arguments)}}}},shimSourceObject:function(e){var t=e&&e.URL;"object"==typeof e&&e.HTMLMediaElement&&!("srcObject"in e.HTMLMediaElement.prototype)&&Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this._srcObject},set:function(e){var n=this;this._srcObject=e,this.src&&t.revokeObjectURL(this.src),e?(this.src=t.createObjectURL(e),e.addEventListener("addtrack",(function(){n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)})),e.addEventListener("removetrack",(function(){n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)}))):this.src=""}})},shimAddTrackRemoveTrackWithNative:function(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(t){return e._shimmedLocalStreams[t][0]}))};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){if(t.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")}));var r=t.getSenders();n.apply(this,arguments);var o=t.getSenders().filter((function(e){return-1===r.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(o)};var r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};var o=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((function(n){var r=t._shimmedLocalStreams[n].indexOf(e);-1!==r&&t._shimmedLocalStreams[n].splice(r,1),1===t._shimmedLocalStreams[n].length&&delete t._shimmedLocalStreams[n]})),o.apply(this,arguments)}},shimAddTrackRemoveTrack:function(e){if(e.RTCPeerConnection){var n=r.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&n.version>=65)return this.shimAddTrackRemoveTrackWithNative(e);var o=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=o.apply(this);return e._reverseStreams=e._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var n=this;if(n._streams=n._streams||{},n._reverseStreams=n._reverseStreams||{},t.getTracks().forEach((function(e){if(n.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")})),!n._reverseStreams[t.id]){var r=new e.MediaStream(t.getTracks());n._streams[t.id]=r,n._reverseStreams[r.id]=t,t=r}i.apply(n,[t])};var s=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;t._streams=t._streams||{},t._reverseStreams=t._reverseStreams||{},s.apply(t,[t._streams[e.id]||e]),delete t._reverseStreams[t._streams[e.id]?t._streams[e.id].id:e.id],delete t._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(n,r){var o=this;if("closed"===o.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find((function(e){return e===n})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");var s=o.getSenders().find((function(e){return e.track===n}));if(s)throw new DOMException("Track already exists.","InvalidAccessError");o._streams=o._streams||{},o._reverseStreams=o._reverseStreams||{};var a=o._streams[r.id];if(a)a.addTrack(n),t.resolve().then((function(){o.dispatchEvent(new Event("negotiationneeded"))}));else{var c=new e.MediaStream([n]);o._streams[r.id]=c,o._reverseStreams[c.id]=r,o.addStream(c)}return o.getSenders().find((function(e){return e.track===n}))},["createOffer","createAnswer"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=this,t=arguments,r=arguments.length&&"function"==typeof arguments[0];return r?n.apply(e,[function(n){var r=u(e,n);t[0].apply(null,[r])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(e,arguments).then((function(t){return u(e,t)}))}}));var a=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){var e=this;return arguments.length&&arguments[0].type?(arguments[0]=d(e,arguments[0]),a.apply(e,arguments)):a.apply(e,arguments)};var c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=c.get.apply(this);return""===e.type?e:u(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t,n=this;if("closed"===n.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===n))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");n._streams=n._streams||{},Object.keys(n._streams).forEach((function(r){n._streams[r].getTracks().find((function(t){return e.track===t}))&&(t=n._streams[r])})),t&&(1===t.getTracks().length?n.removeStream(n._reverseStreams[t.id]):t.removeTrack(e.track),n.dispatchEvent(new Event("negotiationneeded")))}}function u(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var r=e._reverseStreams[t],o=e._streams[r.id];n=n.replace(new RegExp(o.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function d(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var r=e._reverseStreams[t],o=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),o.id)})),new RTCSessionDescription({type:t.type,sdp:n})}},shimPeerConnection:function(e){var n=r.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=function(t,n){return o("PeerConnection"),t&&t.iceTransportPolicy&&(t.iceTransports=t.iceTransportPolicy),new e.webkitRTCPeerConnection(t,n)},e.RTCPeerConnection.prototype=e.webkitRTCPeerConnection.prototype,e.webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return e.webkitRTCPeerConnection.generateCertificate}})),e.RTCPeerConnection){var i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,n,r){var o=this,s=arguments;if(arguments.length>0&&"function"==typeof e)return i.apply(this,arguments);if(0===i.length&&(0===arguments.length||"function"!=typeof arguments[0]))return i.apply(this,[]);var a=function(e){var t={};return e.result().forEach((function(e){var n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){n[t]=e.stat(t)})),t[n.id]=n})),t},c=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};if(arguments.length>=2){var u=function(e){s[1](c(a(e)))};return i.apply(this,[u,arguments[0]])}return new t((function(e,t){i.apply(o,[function(t){e(c(a(t)))},t])})).then(n,r)},n.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(n){var r=e.RTCPeerConnection.prototype[n];e.RTCPeerConnection.prototype[n]=function(){var e=arguments,n=this,o=new t((function(t,o){r.apply(n,[e[0],t,o])}));return e.length<2?o:o.then((function(){e[1].apply(null,[])}),(function(t){e.length>=3&&e[2].apply(null,[t])}))}})),n.version<52&&["createOffer","createAnswer"].forEach((function(n){var r=e.RTCPeerConnection.prototype[n];e.RTCPeerConnection.prototype[n]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"==typeof arguments[0]){var n=1===arguments.length?arguments[0]:void 0;return new t((function(t,o){r.apply(e,[t,o,n])}))}return r.apply(this,arguments)}})),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}}));var s=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?s.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),t.resolve())}}},fixNegotiationNeeded:function(e){r.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){if("stable"===e.target.signalingState)return e}))},shimGetDisplayMedia:function(e,t){e.navigator&&e.navigator.mediaDevices&&!("getDisplayMedia"in e.navigator.mediaDevices)&&("function"==typeof t?(e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((function(t){var r=n.video&&n.video.width,o=n.video&&n.video.height,i=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:i||3}},r&&(n.video.mandatory.maxWidth=r),o&&(n.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(n)}))},e.navigator.getDisplayMedia=function(t){return r.deprecated("navigator.getDisplayMedia","navigator.mediaDevices.getDisplayMedia"),e.navigator.mediaDevices.getDisplayMedia(t)}):console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(28),o=r.log;e.exports=function(e){var n=r.detectBrowser(e),i=e&&e.navigator,s=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);var o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];var i={};"number"==typeof r.ideal?(i[o("min",n)]=r.ideal,t.optional.push(i),(i={})[o("max",n)]=r.ideal,t.optional.push(i)):(i[o("",n)]=r.ideal,t.optional.push(i))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",n)]=r.exact):["min","max"].forEach((function(e){void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,n)]=r[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},a=function(e,t){if(n.version>=61)return t(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){var r=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};r((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),r(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=s(e.audio)}if(e&&"object"==typeof e.video){var a=e.video.facingMode;a=a&&("object"==typeof a?a:{ideal:a});var c,u=n.version<66;if(a&&("user"===a.exact||"environment"===a.exact||"user"===a.ideal||"environment"===a.ideal)&&(!i.mediaDevices.getSupportedConstraints||!i.mediaDevices.getSupportedConstraints().facingMode||u))if(delete e.video.facingMode,"environment"===a.exact||"environment"===a.ideal?c=["back","rear"]:"user"!==a.exact&&"user"!==a.ideal||(c=["front"]),c)return i.mediaDevices.enumerateDevices().then((function(n){var r=(n=n.filter((function(e){return"videoinput"===e.kind}))).find((function(e){return c.some((function(t){return-1!==e.label.toLowerCase().indexOf(t)}))}));return!r&&n.length&&-1!==c.indexOf("back")&&(r=n[n.length-1]),r&&(e.video.deviceId=a.exact?{exact:r.deviceId}:{ideal:r.deviceId}),e.video=s(e.video),o("chrome: "+JSON.stringify(e)),t(e)}));e.video=s(e.video)}return o("chrome: "+JSON.stringify(e)),t(e)},c=function(e){return n.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};i.getUserMedia=function(e,t,n){a(e,(function(e){i.webkitGetUserMedia(e,t,(function(e){n&&n(c(e))}))}))};var u=function(e){return new t((function(t,n){i.getUserMedia(e,t,n)}))};if(i.mediaDevices||(i.mediaDevices={getUserMedia:u,enumerateDevices:function(){return new t((function(t){var n={audio:"audioinput",video:"videoinput"};return e.MediaStreamTrack.getSources((function(e){t(e.map((function(e){return{label:e.label,kind:n[e.kind],deviceId:e.id,groupId:""}})))}))}))},getSupportedConstraints:function(){return{deviceId:!0,echoCancellation:!0,facingMode:!0,frameRate:!0,height:!0,width:!0}}}),i.mediaDevices.getUserMedia){var d=i.mediaDevices.getUserMedia.bind(i.mediaDevices);i.mediaDevices.getUserMedia=function(e){return a(e,(function(e){return d(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return t}),(function(e){return t.reject(c(e))}))}))}}else i.mediaDevices.getUserMedia=function(e){return u(e)};void 0===i.mediaDevices.addEventListener&&(i.mediaDevices.addEventListener=function(){o("Dummy mediaDevices.addEventListener called.")}),void 0===i.mediaDevices.removeEventListener&&(i.mediaDevices.removeEventListener=function(){o("Dummy mediaDevices.removeEventListener called.")})}}).call(this,n(0))},function(e,t,n){"use strict";var r=n(28),o=n(553),i=n(554);e.exports={shimGetUserMedia:n(555),shimPeerConnection:function(e){var t=r.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var n=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){n.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var s=i(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=o(e.iceServers)),new s(e)},e.RTCPeerConnection.prototype=s.prototype},shimReplaceTrack:function(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)},shimGetDisplayMedia:function(e,t){if("getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&!("getDisplayMedia"in e.navigator.mediaDevices)){var n=e.navigator.getDisplayMedia;e.navigator.mediaDevices.getDisplayMedia=function(t){return n.call(e.navigator,t)},e.navigator.getDisplayMedia=function(t){return r.deprecated("navigator.getDisplayMedia","navigator.mediaDevices.getDisplayMedia"),n.call(e.navigator,t)}}}}},function(e,t,n){"use strict";var r=n(28);e.exports=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var o=e.urls||e.url;e.url&&!e.urls&&r.deprecated("RTCIceServer.url","RTCIceServer.urls");var i="string"==typeof o;return i&&(o=[o]),o=o.filter((function(e){return 0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!n?(n=!0,!0):0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp")})),delete e.url,e.urls=i?o[0]:o,!!o.length}}))}},function(e,t,n){"use strict";(function(t){var r=n(252);function o(e,t,n,o,i){var s=r.writeRtpDescription(e.kind,t);if(s+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),s+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":i||"active"),s+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?s+="a=sendrecv\r\n":e.rtpSender?s+="a=sendonly\r\n":e.rtpReceiver?s+="a=recvonly\r\n":s+="a=inactive\r\n",e.rtpSender){var a=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=a;var c="msid:"+(o?o.id:"-")+" "+a+"\r\n";s+="a="+c,s+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(s+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,s+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return s+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(s+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),s}function i(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var n=0;n<t.length;n++)if(t[n].payloadType===e||t[n].preferredPayloadType===e)return t[n]},o=function(e,t,n,o){var i=r(e.parameters.apt,n),s=r(t.parameters.apt,o);return i&&s&&i.name.toLowerCase()===s.name.toLowerCase()};return e.codecs.forEach((function(r){for(var i=0;i<t.codecs.length;i++){var s=t.codecs[i];if(r.name.toLowerCase()===s.name.toLowerCase()&&r.clockRate===s.clockRate){if("rtx"===r.name.toLowerCase()&&r.parameters&&s.parameters.apt&&!o(r,s,e.codecs,t.codecs))continue;(s=JSON.parse(JSON.stringify(s))).numChannels=Math.min(r.numChannels,s.numChannels),n.codecs.push(s),s.rtcpFeedback=s.rtcpFeedback.filter((function(e){for(var t=0;t<r.rtcpFeedback.length;t++)if(r.rtcpFeedback[t].type===e.type&&r.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var r=0;r<t.headerExtensions.length;r++){var o=t.headerExtensions[r];if(e.uri===o.uri){n.headerExtensions.push(o);break}}})),n}function s(e,t,n){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(n)}function a(e,t){var n=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return n||e.addRemoteCandidate(t),!n}function c(e,t){var n=new Error(t);return n.name=e,n.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],n}e.exports=function(e,n){function u(t,n){n.addTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function d(t,n,r,o){var i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=o,e.setTimeout((function(){t._dispatchEvent("track",i)}))}var l=function(t){var o=this,i=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){o[e]=i[e].bind(i)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",t=JSON.parse(JSON.stringify(t||{})),this.usingBundle="max-bundle"===t.bundlePolicy,"negotiate"===t.rtcpMuxPolicy)throw c("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(t.rtcpMuxPolicy||(t.rtcpMuxPolicy="require"),t.iceTransportPolicy){case"all":case"relay":break;default:t.iceTransportPolicy="all"}switch(t.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:t.bundlePolicy="balanced"}if(t.iceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var r=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var o="string"==typeof r;return o&&(r=[r]),r=r.filter((function(e){return 0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!n?(n=!0,!0):0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp")})),delete e.url,e.urls=o?r[0]:r,!!r.length}}))}(t.iceServers||[],n),this._iceGatherers=[],t.iceCandidatePoolSize)for(var s=t.iceCandidatePoolSize;s>0;s--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:t.iceServers,gatherPolicy:t.iceTransportPolicy}));else t.iceCandidatePoolSize=0;this._config=t,this.transceivers=[],this._sdpSessionId=r.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(l.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(l.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),l.prototype.onicecandidate=null,l.prototype.onaddstream=null,l.prototype.ontrack=null,l.prototype.onremovestream=null,l.prototype.onsignalingstatechange=null,l.prototype.oniceconnectionstatechange=null,l.prototype.onconnectionstatechange=null,l.prototype.onicegatheringstatechange=null,l.prototype.onnegotiationneeded=null,l.prototype.ondatachannel=null,l.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},l.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},l.prototype.getConfiguration=function(){return this._config},l.prototype.getLocalStreams=function(){return this.localStreams},l.prototype.getRemoteStreams=function(){return this.remoteStreams},l.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,r={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)r.iceTransport=this.transceivers[0].iceTransport,r.dtlsTransport=this.transceivers[0].dtlsTransport;else{var o=this._createIceAndDtlsTransports();r.iceTransport=o.iceTransport,r.dtlsTransport=o.dtlsTransport}return t||this.transceivers.push(r),r},l.prototype.addTrack=function(t,n){if(this._isClosed)throw c("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var r;if(this.transceivers.find((function(e){return e.track===t})))throw c("InvalidAccessError","Track already exists.");for(var o=0;o<this.transceivers.length;o++)this.transceivers[o].track||this.transceivers[o].kind!==t.kind||(r=this.transceivers[o]);return r||(r=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(n)&&this.localStreams.push(n),r.track=t,r.stream=n,r.rtpSender=new e.RTCRtpSender(t,r.dtlsTransport),r.rtpSender},l.prototype.addStream=function(e){var t=this;if(n>=15025)e.getTracks().forEach((function(n){t.addTrack(n,e)}));else{var r=e.clone();e.getTracks().forEach((function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",(function(e){n.enabled=e.enabled}))})),r.getTracks().forEach((function(e){t.addTrack(e,r)}))}},l.prototype.removeTrack=function(t){if(this._isClosed)throw c("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find((function(e){return e.rtpSender===t}));if(!n)throw c("InvalidAccessError","Sender was not created by this connection.");var r=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},l.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var n=t.getSenders().find((function(t){return t.track===e}));n&&t.removeTrack(n)}))},l.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},l.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},l.prototype._createIceGatherer=function(t,n){var r=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var o=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(o,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;o.state=n?"completed":"gathering",null!==r.transceivers[t].bufferedCandidateEvents&&r.transceivers[t].bufferedCandidateEvents.push(e)},o.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),o},l.prototype._gather=function(t,n){var o=this,i=this.transceivers[n].iceGatherer;if(!i.onlocalcandidate){var s=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,i.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),i.onlocalcandidate=function(e){if(!(o.usingBundle&&n>0)){var s=new Event("icecandidate");s.candidate={sdpMid:t,sdpMLineIndex:n};var a=e.candidate,c=!a||0===Object.keys(a).length;if(c)"new"!==i.state&&"gathering"!==i.state||(i.state="completed");else{"new"===i.state&&(i.state="gathering"),a.component=1,a.ufrag=i.getLocalParameters().usernameFragment;var u=r.writeCandidate(a);s.candidate=Object.assign(s.candidate,r.parseCandidate(u)),s.candidate.candidate=u,s.candidate.toJSON=function(){return{candidate:s.candidate.candidate,sdpMid:s.candidate.sdpMid,sdpMLineIndex:s.candidate.sdpMLineIndex,usernameFragment:s.candidate.usernameFragment}}}var d=r.getMediaSections(o._localDescription.sdp);d[s.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+s.candidate.candidate+"\r\n",o._localDescription.sdp=r.getDescription(o._localDescription.sdp)+d.join("");var l=o.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==o.iceGatheringState&&(o.iceGatheringState="gathering",o._emitGatheringStateChange()),c||o._dispatchEvent("icecandidate",s),l&&(o._dispatchEvent("icecandidate",new Event("icecandidate")),o.iceGatheringState="complete",o._emitGatheringStateChange())}},e.setTimeout((function(){s.forEach((function(e){i.onlocalcandidate(e)}))}),0)}},l.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var r=new e.RTCDtlsTransport(n);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:r}},l.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},l.prototype._transceive=function(e,t,o){var s=i(e.localCapabilities,e.remoteCapabilities);t&&e.rtpSender&&(s.encodings=e.sendEncodingParameters,s.rtcp={cname:r.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(s.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(s)),o&&e.rtpReceiver&&s.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&n<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?s.encodings=e.recvEncodingParameters:s.encodings=[{}],s.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(s.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(s.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(s))},l.prototype.setLocalDescription=function(e){var n,o,a=this;if(-1===["offer","answer"].indexOf(e.type))return t.reject(c("TypeError",'Unsupported type "'+e.type+'"'));if(!s("setLocalDescription",e.type,a.signalingState)||a._isClosed)return t.reject(c("InvalidStateError","Can not set local "+e.type+" in state "+a.signalingState));if("offer"===e.type)n=r.splitSections(e.sdp),o=n.shift(),n.forEach((function(e,t){var n=r.parseRtpParameters(e);a.transceivers[t].localCapabilities=n})),a.transceivers.forEach((function(e,t){a._gather(e.mid,t)}));else if("answer"===e.type){n=r.splitSections(a._remoteDescription.sdp),o=n.shift();var u=r.matchPrefix(o,"a=ice-lite").length>0;n.forEach((function(e,t){var n=a.transceivers[t],s=n.iceGatherer,c=n.iceTransport,d=n.dtlsTransport,l=n.localCapabilities,p=n.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length)&&!n.rejected){var f=r.getIceParameters(e,o),h=r.getDtlsParameters(e,o);u&&(h.role="server"),a.usingBundle&&0!==t||(a._gather(n.mid,t),"new"===c.state&&c.start(s,f,u?"controlling":"controlled"),"new"===d.state&&d.start(h));var m=i(l,p);a._transceive(n,m.codecs.length>0,!1)}}))}return a._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?a._updateSignalingState("have-local-offer"):a._updateSignalingState("stable"),t.resolve()},l.prototype.setRemoteDescription=function(o){var l=this;if(-1===["offer","answer"].indexOf(o.type))return t.reject(c("TypeError",'Unsupported type "'+o.type+'"'));if(!s("setRemoteDescription",o.type,l.signalingState)||l._isClosed)return t.reject(c("InvalidStateError","Can not set remote "+o.type+" in state "+l.signalingState));var p={};l.remoteStreams.forEach((function(e){p[e.id]=e}));var f=[],h=r.splitSections(o.sdp),m=h.shift(),b=r.matchPrefix(m,"a=ice-lite").length>0,g=r.matchPrefix(m,"a=group:BUNDLE ").length>0;l.usingBundle=g;var v=r.matchPrefix(m,"a=ice-options:")[0];return l.canTrickleIceCandidates=!!v&&v.substr(14).split(" ").indexOf("trickle")>=0,h.forEach((function(t,s){var c=r.splitLines(t),d=r.getKind(t),h=r.isRejected(t)&&0===r.matchPrefix(t,"a=bundle-only").length,v=c[0].substr(2).split(" ")[2],y=r.getDirection(t,m),S=r.parseMsid(t),E=r.getMid(t)||r.generateIdentifier();if(h||"application"===d&&("DTLS/SCTP"===v||"UDP/DTLS/SCTP"===v))l.transceivers[s]={mid:E,kind:d,protocol:v,rejected:!0};else{var T,C,w,R,I,_,x,O,N;!h&&l.transceivers[s]&&l.transceivers[s].rejected&&(l.transceivers[s]=l._createTransceiver(d,!0));var k,Z,A=r.parseRtpParameters(t);h||(k=r.getIceParameters(t,m),(Z=r.getDtlsParameters(t,m)).role="client"),x=r.parseRtpEncodingParameters(t);var L=r.parseRtcpParameters(t),V=r.matchPrefix(t,"a=end-of-candidates",m).length>0,P=r.matchPrefix(t,"a=candidate:").map((function(e){return r.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===o.type||"answer"===o.type)&&!h&&g&&s>0&&l.transceivers[s]&&(l._disposeIceAndDtlsTransports(s),l.transceivers[s].iceGatherer=l.transceivers[0].iceGatherer,l.transceivers[s].iceTransport=l.transceivers[0].iceTransport,l.transceivers[s].dtlsTransport=l.transceivers[0].dtlsTransport,l.transceivers[s].rtpSender&&l.transceivers[s].rtpSender.setTransport(l.transceivers[0].dtlsTransport),l.transceivers[s].rtpReceiver&&l.transceivers[s].rtpReceiver.setTransport(l.transceivers[0].dtlsTransport)),"offer"!==o.type||h){if("answer"===o.type&&!h){C=(T=l.transceivers[s]).iceGatherer,w=T.iceTransport,R=T.dtlsTransport,I=T.rtpReceiver,_=T.sendEncodingParameters,O=T.localCapabilities,l.transceivers[s].recvEncodingParameters=x,l.transceivers[s].remoteCapabilities=A,l.transceivers[s].rtcpParameters=L,P.length&&"new"===w.state&&(!b&&!V||g&&0!==s?P.forEach((function(e){a(T.iceTransport,e)})):w.setRemoteCandidates(P)),g&&0!==s||("new"===w.state&&w.start(C,k,"controlling"),"new"===R.state&&R.start(Z)),!i(T.localCapabilities,T.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&T.sendEncodingParameters[0].rtx&&delete T.sendEncodingParameters[0].rtx,l._transceive(T,"sendrecv"===y||"recvonly"===y,"sendrecv"===y||"sendonly"===y),!I||"sendrecv"!==y&&"sendonly"!==y?delete T.rtpReceiver:(N=I.track,S?(p[S.stream]||(p[S.stream]=new e.MediaStream),u(N,p[S.stream]),f.push([N,I,p[S.stream]])):(p.default||(p.default=new e.MediaStream),u(N,p.default),f.push([N,I,p.default])))}}else{(T=l.transceivers[s]||l._createTransceiver(d)).mid=E,T.iceGatherer||(T.iceGatherer=l._createIceGatherer(s,g)),P.length&&"new"===T.iceTransport.state&&(!V||g&&0!==s?P.forEach((function(e){a(T.iceTransport,e)})):T.iceTransport.setRemoteCandidates(P)),O=e.RTCRtpReceiver.getCapabilities(d),n<15019&&(O.codecs=O.codecs.filter((function(e){return"rtx"!==e.name}))),_=T.sendEncodingParameters||[{ssrc:1001*(2*s+2)}];var W,G=!1;if("sendrecv"===y||"sendonly"===y){if(G=!T.rtpReceiver,I=T.rtpReceiver||new e.RTCRtpReceiver(T.dtlsTransport,d),G)N=I.track,S&&"-"===S.stream||(S?(p[S.stream]||(p[S.stream]=new e.MediaStream,Object.defineProperty(p[S.stream],"id",{get:function(){return S.stream}})),Object.defineProperty(N,"id",{get:function(){return S.track}}),W=p[S.stream]):(p.default||(p.default=new e.MediaStream),W=p.default)),W&&(u(N,W),T.associatedRemoteMediaStreams.push(W)),f.push([N,I,W])}else T.rtpReceiver&&T.rtpReceiver.track&&(T.associatedRemoteMediaStreams.forEach((function(t){var n=t.getTracks().find((function(e){return e.id===T.rtpReceiver.track.id}));n&&function(t,n){n.removeTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(n,t)})),T.associatedRemoteMediaStreams=[]);T.localCapabilities=O,T.remoteCapabilities=A,T.rtpReceiver=I,T.rtcpParameters=L,T.sendEncodingParameters=_,T.recvEncodingParameters=x,l._transceive(l.transceivers[s],!1,G)}}})),void 0===l._dtlsRole&&(l._dtlsRole="offer"===o.type?"active":"passive"),l._remoteDescription={type:o.type,sdp:o.sdp},"offer"===o.type?l._updateSignalingState("have-remote-offer"):l._updateSignalingState("stable"),Object.keys(p).forEach((function(t){var n=p[t];if(n.getTracks().length){if(-1===l.remoteStreams.indexOf(n)){l.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout((function(){l._dispatchEvent("addstream",r)}))}f.forEach((function(e){var t=e[0],r=e[1];n.id===e[2].id&&d(l,t,r,[n])}))}})),f.forEach((function(e){e[2]||d(l,e[0],e[1],[])})),e.setTimeout((function(){l&&l.transceivers&&l.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),t.resolve()},l.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},l.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},l.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},l.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},l.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},l.prototype.createOffer=function(){var i=this;if(i._isClosed)return t.reject(c("InvalidStateError","Can not call createOffer after close"));var s=i.transceivers.filter((function(e){return"audio"===e.kind})).length,a=i.transceivers.filter((function(e){return"video"===e.kind})).length,u=arguments[0];if(u){if(u.mandatory||u.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==u.offerToReceiveAudio&&(s=!0===u.offerToReceiveAudio?1:!1===u.offerToReceiveAudio?0:u.offerToReceiveAudio),void 0!==u.offerToReceiveVideo&&(a=!0===u.offerToReceiveVideo?1:!1===u.offerToReceiveVideo?0:u.offerToReceiveVideo)}for(i.transceivers.forEach((function(e){"audio"===e.kind?--s<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)}));s>0||a>0;)s>0&&(i._createTransceiver("audio"),s--),a>0&&(i._createTransceiver("video"),a--);var d=r.writeSessionBoilerplate(i._sdpSessionId,i._sdpSessionVersion++);i.transceivers.forEach((function(t,o){var s=t.track,a=t.kind,c=t.mid||r.generateIdentifier();t.mid=c,t.iceGatherer||(t.iceGatherer=i._createIceGatherer(o,i.usingBundle));var u=e.RTCRtpSender.getCapabilities(a);n<15019&&(u.codecs=u.codecs.filter((function(e){return"rtx"!==e.name}))),u.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),t.remoteCapabilities&&t.remoteCapabilities.codecs&&t.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),u.headerExtensions.forEach((function(e){(t.remoteCapabilities&&t.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var d=t.sendEncodingParameters||[{ssrc:1001*(2*o+1)}];s&&n>=15019&&"video"===a&&!d[0].rtx&&(d[0].rtx={ssrc:d[0].ssrc+1}),t.wantReceive&&(t.rtpReceiver=new e.RTCRtpReceiver(t.dtlsTransport,a)),t.localCapabilities=u,t.sendEncodingParameters=d})),"max-compat"!==i._config.bundlePolicy&&(d+="a=group:BUNDLE "+i.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),d+="a=ice-options:trickle\r\n",i.transceivers.forEach((function(e,t){d+=o(e,e.localCapabilities,"offer",e.stream,i._dtlsRole),d+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===i.iceGatheringState||0!==t&&i.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,d+="a="+r.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(d+="a=end-of-candidates\r\n"))}));var l=new e.RTCSessionDescription({type:"offer",sdp:d});return t.resolve(l)},l.prototype.createAnswer=function(){var s=this;if(s._isClosed)return t.reject(c("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==s.signalingState&&"have-local-pranswer"!==s.signalingState)return t.reject(c("InvalidStateError","Can not call createAnswer in signalingState "+s.signalingState));var a=r.writeSessionBoilerplate(s._sdpSessionId,s._sdpSessionVersion++);s.usingBundle&&(a+="a=group:BUNDLE "+s.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var u=r.getMediaSections(s._remoteDescription.sdp).length;s.transceivers.forEach((function(e,t){if(!(t+1>u)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var r;if(e.stream)"audio"===e.kind?r=e.stream.getAudioTracks()[0]:"video"===e.kind&&(r=e.stream.getVideoTracks()[0]),r&&n>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var c=i(e.localCapabilities,e.remoteCapabilities);!c.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=o(e,c,"answer",e.stream,s._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var d=new e.RTCSessionDescription({type:"answer",sdp:a});return t.resolve(d)},l.prototype.addIceCandidate=function(e){var n,o=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?t.reject(new TypeError("sdpMLineIndex or sdpMid required")):new t((function(t,i){if(!o._remoteDescription)return i(c("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var s=e.sdpMLineIndex;if(e.sdpMid)for(var u=0;u<o.transceivers.length;u++)if(o.transceivers[u].mid===e.sdpMid){s=u;break}var d=o.transceivers[s];if(!d)return i(c("OperationError","Can not add ICE candidate"));if(d.rejected)return t();var l=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===l.protocol&&(0===l.port||9===l.port))return t();if(l.component&&1!==l.component)return t();if((0===s||s>0&&d.iceTransport!==o.transceivers[0].iceTransport)&&!a(d.iceTransport,l))return i(c("OperationError","Can not add ICE candidate"));var p=e.candidate.trim();0===p.indexOf("a=")&&(p=p.substr(2)),(n=r.getMediaSections(o._remoteDescription.sdp))[s]+="a="+(l.type?p:"end-of-candidates")+"\r\n",o._remoteDescription.sdp=r.getDescription(o._remoteDescription.sdp)+n.join("")}else for(var f=0;f<o.transceivers.length&&(o.transceivers[f].rejected||(o.transceivers[f].iceTransport.addRemoteCandidate({}),(n=r.getMediaSections(o._remoteDescription.sdp))[f]+="a=end-of-candidates\r\n",o._remoteDescription.sdp=r.getDescription(o._remoteDescription.sdp)+n.join(""),!o.usingBundle));f++);t()}))},l.prototype.getStats=function(n){if(n&&n instanceof e.MediaStreamTrack){var r=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===n?r=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===n&&(r=e.rtpReceiver)})),!r)throw c("InvalidAccessError","Invalid selector.");return r.getStats()}var o=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&o.push(e[t].getStats())}))})),t.all(o).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))};["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var n=e[t];if(n&&n.prototype&&n.prototype.getStats){var r=n.prototype.getStats;n.prototype.getStats=function(){return r.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(n){var r;e[n].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(r=e[n]).type]||r.type,t.set(n,e[n])})),t}))}}}));var p=["createOffer","createAnswer"];return p.forEach((function(e){var t=l.prototype[e];l.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(p=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=l.prototype[e];l.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=l.prototype[e];l.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),l}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){e.exports=function(e){var n=e&&e.navigator,r=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return r(e).catch((function(e){return t.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))}))}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(28);e.exports={shimGetUserMedia:n(557),shimOnTrack:function(e){"object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)&&Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.transceiver={receiver:n.receiver},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))},enumerable:!0,configurable:!0}),"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimSourceObject:function(e){"object"==typeof e&&e.HTMLMediaElement&&!("srcObject"in e.HTMLMediaElement.prototype)&&Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}})},shimPeerConnection:function(e){var n=r.detectBrowser(e);if("object"==typeof e&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){e.RTCPeerConnection||(e.RTCPeerConnection=function(t,r){if(n.version<38&&t&&t.iceServers){for(var o=[],i=0;i<t.iceServers.length;i++){var s=t.iceServers[i];if(s.hasOwnProperty("urls"))for(var a=0;a<s.urls.length;a++){var c={url:s.urls[a]};0===s.urls[a].indexOf("turn")&&(c.username=s.username,c.credential=s.credential),o.push(c)}else o.push(t.iceServers[i])}t.iceServers=o}return new e.mozRTCPeerConnection(t,r)},e.RTCPeerConnection.prototype=e.mozRTCPeerConnection.prototype,e.mozRTCPeerConnection.generateCertificate&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return e.mozRTCPeerConnection.generateCertificate}}),e.RTCSessionDescription=e.mozRTCSessionDescription,e.RTCIceCandidate=e.mozRTCIceCandidate),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}}));var o=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?o.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),t.resolve())};var i={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},s=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,t,r){return s.apply(this,[e||null]).then((function(e){if(n.version<48&&(e=function(e){var t=new Map;return Object.keys(e).forEach((function(n){t.set(n,e[n]),t[n]=e[n]})),t}(e)),n.version<53&&!t)try{e.forEach((function(e){e.type=i[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,n){e.set(n,Object.assign({},t,{type:i[t.type]||t.type}))}))}return e})).then(t,r)}}},shimSenderGetStats:function(e){if("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpSender.prototype))){var n=e.RTCPeerConnection.prototype.getSenders;n&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=n.apply(e,[]);return t.forEach((function(t){t._pc=e})),t});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):t.resolve(new Map)}}},shimReceiverGetStats:function(e){if("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpReceiver.prototype))){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,n=t.apply(e,[]);return n.forEach((function(t){t._pc=e})),n}),r.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},shimRemoveStream:function(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;r.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(n){n.track&&-1!==e.getTracks().indexOf(n.track)&&t.removeTrack(n)}))})},shimRTCDataChannel:function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)},shimGetDisplayMedia:function(e,n){e.navigator&&e.navigator.mediaDevices&&!("getDisplayMedia"in e.navigator.mediaDevices)&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){var o=new DOMException("getDisplayMedia without video constraints is undefined");return o.name="NotFoundError",o.code=8,t.reject(o)}return!0===r.video?r.video={mediaSource:n}:r.video.mediaSource=n,e.navigator.mediaDevices.getUserMedia(r)},e.navigator.getDisplayMedia=function(t){return r.deprecated("navigator.getDisplayMedia","navigator.mediaDevices.getDisplayMedia"),e.navigator.mediaDevices.getDisplayMedia(t)})}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(28),o=r.log;e.exports=function(e){var n=r.detectBrowser(e),i=e&&e.navigator,s=e&&e.MediaStreamTrack,a=function(e){return{name:{InternalError:"NotReadableError",NotSupportedError:"TypeError",PermissionDeniedError:"NotAllowedError",SecurityError:"NotAllowedError"}[e.name]||e.name,message:{"The operation is insecure.":"The request is not allowed by the user agent or the platform in the current context."}[e.message]||e.message,constraint:e.constraint,toString:function(){return this.name+(this.message&&": ")+this.message}}},c=function(e,t,r){var s=function(e){if("object"!=typeof e||e.require)return e;var t=[];return Object.keys(e).forEach((function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r=e[n]="object"==typeof e[n]?e[n]:{ideal:e[n]};if(void 0===r.min&&void 0===r.max&&void 0===r.exact||t.push(n),void 0!==r.exact&&("number"==typeof r.exact?r.min=r.max=r.exact:e[n]=r.exact,delete r.exact),void 0!==r.ideal){e.advanced=e.advanced||[];var o={};"number"==typeof r.ideal?o[n]={min:r.ideal,max:r.ideal}:o[n]=r.ideal,e.advanced.push(o),delete r.ideal,Object.keys(r).length||delete e[n]}}})),t.length&&(e.require=t),e};return e=JSON.parse(JSON.stringify(e)),n.version<38&&(o("spec: "+JSON.stringify(e)),e.audio&&(e.audio=s(e.audio)),e.video&&(e.video=s(e.video)),o("ff37: "+JSON.stringify(e))),i.mozGetUserMedia(e,t,(function(e){r(a(e))}))};if(i.mediaDevices||(i.mediaDevices={getUserMedia:function(e){return new t((function(t,n){c(e,t,n)}))},addEventListener:function(){},removeEventListener:function(){}}),i.mediaDevices.enumerateDevices=i.mediaDevices.enumerateDevices||function(){return new t((function(e){e([{kind:"audioinput",deviceId:"default",label:"",groupId:""},{kind:"videoinput",deviceId:"default",label:"",groupId:""}])}))},n.version<41){var u=i.mediaDevices.enumerateDevices.bind(i.mediaDevices);i.mediaDevices.enumerateDevices=function(){return u().then(void 0,(function(e){if("NotFoundError"===e.name)return[];throw e}))}}if(n.version<49){var d=i.mediaDevices.getUserMedia.bind(i.mediaDevices);i.mediaDevices.getUserMedia=function(e){return d(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("The object can not be found here.","NotFoundError");return t}),(function(e){return t.reject(a(e))}))}}if(!(n.version>55&&"autoGainControl"in i.mediaDevices.getSupportedConstraints())){var l=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},p=i.mediaDevices.getUserMedia.bind(i.mediaDevices);if(i.mediaDevices.getUserMedia=function(e){return"object"==typeof e&&"object"==typeof e.audio&&(e=JSON.parse(JSON.stringify(e)),l(e.audio,"autoGainControl","mozAutoGainControl"),l(e.audio,"noiseSuppression","mozNoiseSuppression")),p(e)},s&&s.prototype.getSettings){var f=s.prototype.getSettings;s.prototype.getSettings=function(){var e=f.apply(this,arguments);return l(e,"mozAutoGainControl","autoGainControl"),l(e,"mozNoiseSuppression","noiseSuppression"),e}}if(s&&s.prototype.applyConstraints){var h=s.prototype.applyConstraints;s.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"==typeof e&&(e=JSON.parse(JSON.stringify(e)),l(e,"autoGainControl","mozAutoGainControl"),l(e,"noiseSuppression","mozNoiseSuppression")),h.apply(this,[e])}}}i.getUserMedia=function(e,t,o){if(n.version<44)return c(e,t,o);r.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),i.mediaDevices.getUserMedia(e).then(t,o)}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(28);e.exports={shimLocalStreamsAPI:function(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),"getStreamById"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getStreamById=function(e){var t=null;return this._localStreams&&this._localStreams.forEach((function(n){n.id===e&&(t=n)})),this._remoteStreams&&this._remoteStreams.forEach((function(n){n.id===e&&(t=n)})),t}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),-1===this._localStreams.indexOf(e)&&this._localStreams.push(e);var n=this;e.getTracks().forEach((function(r){t.call(n,r,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e,n){return n&&(this._localStreams?-1===this._localStreams.indexOf(n)&&this._localStreams.push(n):this._localStreams=[n]),t.call(this,e,n)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);var t=this._localStreams.indexOf(e);if(-1!==t){this._localStreams.splice(t,1);var n=this,r=e.getTracks();this.getSenders().forEach((function(e){-1!==r.indexOf(e.track)&&n.removeTrack(e)}))}})}},shimRemoteStreamsAPI:function(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){this._onaddstream&&this.removeEventListener("addstream",this._onaddstream),this.addEventListener("addstream",this._onaddstream=e)}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}}))}),t.apply(e,arguments)}}},shimCallbacksAPI:function(e){if("object"==typeof e&&e.RTCPeerConnection){var n=e.RTCPeerConnection.prototype,r=n.createOffer,o=n.createAnswer,i=n.setLocalDescription,s=n.setRemoteDescription,a=n.addIceCandidate;n.createOffer=function(e,n){var o=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[o]);return n?(i.then(e,n),t.resolve()):i},n.createAnswer=function(e,n){var r=arguments.length>=2?arguments[2]:arguments[0],i=o.apply(this,[r]);return n?(i.then(e,n),t.resolve()):i};var c=function(e,n,r){var o=i.apply(this,[e]);return r?(o.then(n,r),t.resolve()):o};n.setLocalDescription=c,c=function(e,n,r){var o=s.apply(this,[e]);return r?(o.then(n,r),t.resolve()):o},n.setRemoteDescription=c,c=function(e,n,r){var o=a.apply(this,[e]);return r?(o.then(n,r),t.resolve()):o},n.addIceCandidate=c}},shimGetUserMedia:function(e){var t=e&&e.navigator;t.getUserMedia||(t.webkitGetUserMedia?t.getUserMedia=t.webkitGetUserMedia.bind(t):t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t)))},shimRTCIceServerUrls:function(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){for(var o=[],i=0;i<e.iceServers.length;i++){var s=e.iceServers[i];!s.hasOwnProperty("urls")&&s.hasOwnProperty("url")?(r.deprecated("RTCIceServer.url","RTCIceServer.urls"),(s=JSON.parse(JSON.stringify(s))).urls=s.url,delete s.url,o.push(s)):o.push(e.iceServers[i])}e.iceServers=o}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in e.RTCPeerConnection&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})},shimTrackEventTransceiver:function(e){"object"==typeof e&&e.RTCPeerConnection&&"receiver"in e.RTCTrackEvent.prototype&&!e.RTCTransceiver&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimCreateOfferLegacy:function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){var n=this;if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var r=n.getTransceivers().find((function(e){return e.sender.track&&"audio"===e.sender.track.kind}));!1===e.offerToReceiveAudio&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveAudio||r||n.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var o=n.getTransceivers().find((function(e){return e.sender.track&&"video"===e.sender.track.kind}));!1===e.offerToReceiveVideo&&o?"sendrecv"===o.direction?o.setDirection("sendonly"):"recvonly"===o.direction&&o.setDirection("inactive"):!0!==e.offerToReceiveVideo||o||n.addTransceiver("video")}return t.apply(n,arguments)}}}}).call(this,n(0))},function(e,t,n){"use strict";var r=n(252),o=n(28);e.exports={shimRTCIceCandidate:function(e){if(!(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var n=new t(e),o=r.parseCandidate(e.candidate),i=Object.assign(n,o);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,o.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}},shimCreateObjectURL:function(e){var t=e&&e.URL;if("object"==typeof e&&e.HTMLMediaElement&&"srcObject"in e.HTMLMediaElement.prototype&&t.createObjectURL&&t.revokeObjectURL){var n=t.createObjectURL.bind(t),r=t.revokeObjectURL.bind(t),i=new Map,s=0;t.createObjectURL=function(e){if("getTracks"in e){var t="polyblob:"+ ++s;return i.set(t,e),o.deprecated("URL.createObjectURL(stream)","elem.srcObject = stream"),t}return n(e)},t.revokeObjectURL=function(e){r(e),i.delete(e)};var a=Object.getOwnPropertyDescriptor(e.HTMLMediaElement.prototype,"src");Object.defineProperty(e.HTMLMediaElement.prototype,"src",{get:function(){return a.get.apply(this)},set:function(e){return this.srcObject=i.get(e)||null,a.set.apply(this,[e])}});var c=e.HTMLMediaElement.prototype.setAttribute;e.HTMLMediaElement.prototype.setAttribute=function(){return 2===arguments.length&&"src"===(""+arguments[0]).toLowerCase()&&(this.srcObject=i.get(arguments[1])||null),c.apply(this,arguments)}}},shimMaxMessageSize:function(e){if(!e.RTCSctpTransport&&e.RTCPeerConnection){var t=o.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var n=function(e){var t=r.splitSections(e.sdp);return t.shift(),t.some((function(e){var t=r.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},i=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var n=parseInt(t[1],10);return n!=n?-1:n},s=function(e){var n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},a=function(e,n){var o=65536;"firefox"===t.browser&&57===t.version&&(o=65535);var i=r.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?o=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(o=2147483637),o},c=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;if(e._sctp=null,n(arguments[0])){var t,r=i(arguments[0]),o=s(r),u=a(arguments[0],r);t=0===o&&0===u?Number.POSITIVE_INFINITY:0===o||0===u?Math.max(o,u):Math.min(o,u);var d={};Object.defineProperty(d,"maxMessageSize",{get:function(){return t}}),e._sctp=d}return c.apply(e,arguments)}}},shimSendThrowTypeError:function(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=this,r=t.apply(e,arguments);return n(r,e),r},o.wrapPeerConnectionEvent(e,"datachannel",(function(e){return n(e.channel,e.target),e}))}function n(e,t){var n=e.send;e.send=function(){var r=arguments[0],o=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&o>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}}}},function(e,t,n){"use strict";(function(t){const r=n(6);function o(){return"undefined"==typeof document||"complete"===document.readyState||"interactive"===document.readyState&&document.body}let i=!1;const s={isDomLoaded:o,isDomUnloaded:()=>i,whenUnloaded:new t(e=>{if("undefined"!=typeof window){const t=()=>{i=!0,s.emit("unload"),e()};window.addEventListener("unload",t)}}),whenLoaded:new t(e=>{if(o())return void e();const t=()=>{document.removeEventListener("DOMContentLoaded",t),document.removeEventListener("load",t),s.emit("load"),e()};document.addEventListener("DOMContentLoaded",t),document.addEventListener("load",t)})};r(s),e.exports=s}).call(this,n(0))},function(e,t,n){var r=n(78),o=n(256),i=n(239),s=n(562),a=n(9),c=n(53),u=n(257);e.exports=function e(t,n,d,l,p){t!==n&&i(n,(function(i,c){if(p||(p=new r),a(i))s(t,n,c,d,e,l,p);else{var f=l?l(u(t,c),i,c+"",t,n,p):void 0;void 0===f&&(f=i),o(t,c,f)}}),c)}},function(e,t,n){var r=n(256),o=n(180),i=n(189),s=n(54),a=n(190),c=n(65),u=n(10),d=n(129),l=n(66),p=n(15),f=n(9),h=n(135),m=n(85),b=n(257),g=n(563);e.exports=function(e,t,n,v,y,S,E){var T=b(e,n),C=b(t,n),w=E.get(C);if(w)r(e,n,w);else{var R=S?S(T,C,n+"",e,t,E):void 0,I=void 0===R;if(I){var _=u(C),x=!_&&l(C),O=!_&&!x&&m(C);R=C,_||x||O?u(T)?R=T:d(T)?R=s(T):x?(I=!1,R=o(C,!0)):O?(I=!1,R=i(C,!0)):R=[]:h(C)||c(C)?(R=T,c(T)?R=g(T):f(T)&&!p(T)||(R=a(C))):I=!1}I&&(E.set(C,R),y(R,C,v,S,E),E.delete(C)),r(e,n,R)}}},function(e,t,n){var r=n(40),o=n(53);e.exports=function(e){return r(e,o(e))}},function(e,t,n){"use strict";const r=n(148),o=n(258),i=n(259),s=n(264),a=n(1)("normalizeConstraintInput"),c={"320x240":{width:320,height:240},"320x180":{width:320,height:180},"640x480":{width:640,height:480},"640x360":{width:640,height:360},"1280x720":{width:1280,height:720},"1280x960":{width:1280,height:960},"1920x1080":{width:1920,height:1080}},u=[1,7,15,30];function d(e){return e._inject&&e._inject.logging||a}function l(e,t,n,r,o){if(void 0===t)return;const i=n(t);return i||o.warn(`Invalid ${e} passed to the Publisher. Got: ${t}, expecting one of ${r}`),i}function p(e,t){const n=d(t),r=(()=>{const n=t["publish"+i(e)];return void 0===n||Boolean(n)})();let o=(()=>{const r=t[e+"Source"];return void 0===r||null!==r&&!1!==r&&("object"==typeof r?!t[`isCustom${i(e)}Track`]&&("string"!=typeof r.deviceId?(n.warn(`Invalid ${e}Source passed to Publisher. Expected either a device ID or device.`),!0):r.deviceId):"string"!=typeof r?(n.warn(`Ignoring invalid ${e}Source parameter`),!0):r)})();return"audio"===e&&t.isScreenSharing&&!s&&!1!==o&&(t.audioSource&&d(t).warn("Invalid audioSource passed to Publisher - when using screen sharing no audioSource may be used"),o=!1),{source:o,publish:r}}function f(e,t){return"Chrome"===e.name&&-1!==e.userAgent.indexOf("Mac OS X")&&1===t?2:t}const h=["user","environment","left","right"],m=(e,t)=>{if(void 0===e||h.indexOf(e)>=0)return e;d(t).warn("Invalid facingMode passed to Publisher. Expected one of: "+h.join(", "))};e.exports=function(e){const t=d(e),n=e.env||{},i=e.isScreenSharing,s=e.isCustomAudioTrack,a=e.isCustomVideoTrack;return i&&!o&&r(e.usingOptionalMandatoryStyle,"Screensharing only uses optional-mandatory constraints right now"),["echoCancellation","autoGainControl","noiseSuppression"].forEach(t=>{!1!==e[t]&&Object.assign(e,{[t]:!0})}),{isScreenSharing:i,isCustomAudioTrack:s,isCustomVideoTrack:a,audio:p("audio",e),video:p("video",e),usingOptionalMandatoryStyle:e.usingOptionalMandatoryStyle,enableRenegotiation:e.enableRenegotiation,enableStereo:e.enableStereo,noiseSuppression:e.noiseSuppression,autoGainControl:e.autoGainControl,echoCancellation:e.echoCancellation,disableAudioProcessing:e.disableAudioProcessing,videoDimensions:l("resolution",e.resolution,e=>c[e],`"${Object.keys(c).join('", "')}"`,t),frameRate:f(n,l("frameRate",e.frameRate,e=>-1!==u.indexOf(e)?e:void 0,u.join(","),t)),maxResolution:function(){if(void 0===e.maxResolution)return i?{width:1920,height:1920}:void 0;const n={width:e.maxResolution.width,height:e.maxResolution.height};return Object.keys(n).forEach(e=>{const r=n[e];("number"!=typeof r||r>1920)&&(t.warn(`Invalid maxResolution passed to the Publisher. maxResolution.${e} must be less than or equal to 1920`),n[e]=1920)}),n}(),facingMode:m(e.facingMode,e)}}},function(e,t,n){"use strict";
|
|
23
|
+
*/function i(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0}function o(e){return(void 0!==typeof window?window:global).Buffer&&"function"==typeof(void 0!==typeof window?window:global).Buffer.isBuffer?(void 0!==typeof window?window:global).Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var s=n(575),a=Object.prototype.hasOwnProperty,c=Array.prototype.slice,u="foo"===function(){}.name;function d(e){return Object.prototype.toString.call(e)}function l(e){return!o(e)&&("function"==typeof(void 0!==typeof window?window:global).ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var p=e.exports=v,f=/\s*function\s+([^\(\s]*)\s*/;function h(e){if(s.isFunction(e)){if(u)return e.name;var t=e.toString().match(f);return t&&t[1]}}function m(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function g(e){if(u||!s.isFunction(e))return s.inspect(e);var t=h(e);return"[Function"+(t?": "+t:"")+"]"}function b(e,t,n,r,i){throw new p.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}function v(e,t){e||b(e,!0,t,"==",p.ok)}function y(e,t,n,r){if(e===t)return!0;if(o(e)&&o(t))return 0===i(e,t);if(s.isDate(e)&&s.isDate(t))return e.getTime()===t.getTime();if(s.isRegExp(e)&&s.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(l(e)&&l(t)&&d(e)===d(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===i(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var a=(r=r||{actual:[],expected:[]}).actual.indexOf(e);return-1!==a&&a===r.expected.indexOf(t)||(r.actual.push(e),r.expected.push(t),function(e,t,n,r){if(null==e||null==t)return!1;if(s.isPrimitive(e)||s.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=E(e),o=E(t);if(i&&!o||!i&&o)return!1;if(i)return e=c.call(e),t=c.call(t),y(e,t,n);var a,u,d=w(e),l=w(t);if(d.length!==l.length)return!1;for(d.sort(),l.sort(),u=d.length-1;u>=0;u--)if(d[u]!==l[u])return!1;for(u=d.length-1;u>=0;u--)if(a=d[u],!y(e[a],t[a],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function E(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function S(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,n,r){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&b(i,n,"Missing expected exception"+r);var o="string"==typeof r,a=!e&&i&&!n;if((!e&&s.isError(i)&&o&&S(i,n)||a)&&b(i,n,"Got unwanted exception"+r),e&&i&&n&&!S(i,n)||!e&&i)throw i}p.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(g(e.actual),128)+" "+e.operator+" "+m(g(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=h(t),o=r.indexOf("\n"+i);if(o>=0){var s=r.indexOf("\n",o+1);r=r.substring(s+1)}this.stack=r}}},s.inherits(p.AssertionError,Error),p.fail=b,p.ok=v,p.equal=function(e,t,n){e!=t&&b(e,t,n,"==",p.equal)},p.notEqual=function(e,t,n){e==t&&b(e,t,n,"!=",p.notEqual)},p.deepEqual=function(e,t,n){y(e,t,!1)||b(e,t,n,"deepEqual",p.deepEqual)},p.deepStrictEqual=function(e,t,n){y(e,t,!0)||b(e,t,n,"deepStrictEqual",p.deepStrictEqual)},p.notDeepEqual=function(e,t,n){y(e,t,!1)&&b(e,t,n,"notDeepEqual",p.notDeepEqual)},p.notDeepStrictEqual=function e(t,n,r){y(t,n,!0)&&b(t,n,r,"notDeepStrictEqual",e)},p.strictEqual=function(e,t,n){e!==t&&b(e,t,n,"===",p.strictEqual)},p.notStrictEqual=function(e,t,n){e===t&&b(e,t,n,"!==",p.notStrictEqual)},p.throws=function(e,t,n){_(!0,e,t,n)},p.doesNotThrow=function(e,t,n){_(!1,e,t,n)},p.ifError=function(e){if(e)throw e},p.strict=r((function e(t,n){t||b(t,!0,n,"==",e)}),p,{equal:p.strictEqual,deepEqual:p.deepStrictEqual,notEqual:p.notStrictEqual,notDeepEqual:p.notDeepStrictEqual}),p.strict.strict=p.strict;var w=Object.keys||function(e){var t=[];for(var n in e)a.call(e,n)&&t.push(n);return t}},function(e,t,n){"use strict";const r=n(582),i=n(267),o=n(3);e.exports=e=>o.isElectron?"screen"===e||i(e):r.indexOf(e)>-1},function(e,t,n){"use strict";const r=n(270),i=n(6),o=n(1)("StreamChannel"),s=n(152)();e.exports=function(e){this.id=e.id,this.type=e.type,this.active=r(e.active),this.orientation=e.orientation||s.ROTATED_NORMAL,e.frameRate&&(this.frameRate=parseFloat(e.frameRate)),e.preferredFrameRate&&(this.preferredFrameRate=parseFloat(e.preferredFrameRate)),e.preferredWidth&&(this.preferredWidth=parseInt(e.preferredWidth,10)),e.preferredHeight&&(this.preferredHeight=parseInt(e.preferredHeight,10)),this.width=parseInt(e.width,10),this.height=parseInt(e.height,10),this.source=e.source||"camera",this.fitMode=e.fitMode||"cover",i(this),this.update=function(e){const t={},n={};for(const i in e){if(!e.hasOwnProperty(i))continue;const s=this[i];switch(i){case"active":this.active=r(e[i]);break;case"disableWarning":this.disableWarning=r(e[i]);break;case"frameRate":this.frameRate=parseFloat(e[i],10);break;case"width":case"height":this[i]=parseInt(e[i],10),t[i]=this[i],n[i]=s;break;case"orientation":this[i]=e[i],t[i]=this[i],n[i]=s;break;case"fitMode":case"source":this[i]=e[i];break;default:return o.warn(`Tried to update unknown key ${i} on ${this.type} channel ${this.id}`),!1}this.trigger("update",this,i,s,this[i])}return Object.keys(t).length&&this.trigger("update",this,"videoDimensions",n,t),!0}}},function(e,t,n){"use strict";e.exports=function(){return{ROTATED_NORMAL:0,ROTATED_LEFT:270,ROTATED_RIGHT:90,ROTATED_UPSIDE_DOWN:180}}},function(e,t,n){"use strict";const r=n(590),i=n(1)("StylableComponent"),o=n(591),s=n(592);e.exports=function(e,t,n,a){if(!e.trigger)throw new Error("OT.StylableComponent is dependent on the eventing mixin. Ensure that this is included in the object before StylableComponent.");a=a||function(){};let c=!1;!1===n&&(t={buttonDisplayMode:"off",nameDisplayMode:"off",audioLevelDisplayMode:"off",videoDisabledDisplayMode:"off",audioBlockedDisplayMode:"off"},c=!0,a({showControls:!1}));const u=new o(t,(function(t,n,r){r?e.trigger("styleValueChanged",t,n,r):e.trigger("styleValueChanged",t,n)}));e.getStyle=function(e){return u.get(e)},e.setStyle=function(e,t,n){if(c)return i.warn("Calling setStyle() has no effect because theshowControls option was set to false"),this;let o;return"string"!=typeof e?o=e:(o={},o[e]=t),o.backgroundImageURI&&(o.backgroundImageURI=r(o.backgroundImageURI)),u.setAll(o,n),a(s(o)),this}}},function(e,t,n){"use strict";const r=n(50),i=n(34)(),o=n(26),s=n(72),a=n(147),c=n(51).once,u=n(595),d=n(5),l=n(1)("systemRequirements"),p=n(596),f=n(597),h=i.onlyLocal(),m=new o,g=r(()=>{m.logEvent({action:"checkSystemRequirements",variation:"notHasRequirements",partnerId:s.value,payload:{userAgent:d.env.userAgent}})}),b=r(()=>{n(598)()});let v=!1;e.exports={check(){l.debug("OT.checkSystemRequirements()");const e=Number(u&&c());return b(),e||g(),e},upgrade(e){let t=void 0===e?{}:e,n=t.isSupportedButOld,r=void 0===n?d.env.name.toLowerCase()in h.minimumVersion:n,i=t.userAgent,o=void 0===i?navigator.userAgent:i;a.onLoad(()=>{if(v)return;const e=new f(p);let t;v=!0,e.on("close",()=>{v=!1}),e.open(),t=o.match(/(iPad|iPhone|iPod|android|webOS)/i)?(r?"supported-":"")+"mobile-browser":(r?"upgrade":"normal")+"-install",e.el("#section-"+t).style.display="block"})}}},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(61)),o=r(n(599));const s=n(603);let a=function(e){function t(t){var n;return(n=e.call(this,t)||this).name="TimeoutError",n}return(0,i.default)(t,e),t}((0,o.default)(Error));e.exports=(e,n,r)=>new t((t,i)=>{if("number"!=typeof n||n<0)throw new TypeError("Expected `ms` to be a positive number");const o=setTimeout(()=>{if("function"==typeof r){try{t(r())}catch(o){i(o)}return}const o=r instanceof Error?r:new a("string"==typeof r?r:`Promise timed out after ${n} milliseconds`);"function"==typeof e.cancel&&e.cancel(),i(o)},n);s(e.then(t,i),()=>{clearTimeout(o)})}),e.exports.TimeoutError=a}).call(this,n(0))},function(e,t,n){"use strict";e.exports=function(){const e=[];return{add(t){e.push(t)},remove(t){const n=e.indexOf(t);n>=0&&e.splice(n,1)},releaseAll(){const t=[];for(;e.length>0;){const n=e.pop();try{n()}catch(e){t.push(e)}}const n=t.length;if(n>0)throw new Error(`Failed to complete ${n} cleanup job${1===n?"":"s"}: ${t.map(e=>`<${e}>`).join(", ")}`)}}}},function(e,t,n){"use strict";const r=n(100);e.exports=function(e){void 0===e&&(e={});const t=e.hasE2eeCapability||n(158),i=e.passphraseStore||n(142);if(t()){const t=e.sessionInfo||new r;return Boolean(t.e2ee)&&(e=>Boolean(e.get()))(i)}return!1}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.hasOpenTokSupport||n(51).once,r=e.env||n(3);return t()&&(e=>!e.isIos&&e.isChrome&&e.version>=99)(r)}},function(e,t,n){"use strict";const r=n(1)("applySdpTransform");e.exports=(e,t,n,i,o)=>{const s=e[t][n],a=`${t} ${n}`,c=`sdpTransforms (${"local offer"===a||"remote answer"===a?"publisher":"subscriber"}): ${t} ${n}`,u="local"===t?"created":"received";r.debug(`${c}: ${u}:\n${o}`);const d=s(i,o);return d.local===o?r.debug(c+": not modified"):r.debug(`${c}: modified to:\n${d.local}`),d}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";e.exports=function(e){if(void 0===e&&(e={}),!e)return 0;const t=e,n=t.currentStatFrames,r=void 0===n?0:n,i=t.prevStatFrames,o=void 0===i?0:i,s=t.currentTimestamp,a=void 0===s?0:s,c=t.prevTimestamp,u=void 0===c?0:c;if(r>=o&&a>u){const e=(r-o)/((a-u)/1e3);return Math.round(100*e)/100}return 0}},function(e,t,n){"use strict";let r;e.exports=function(e){void 0===e&&(e={});const t=e.AudioContext||(void 0!==typeof window?window:global).AudioContext||(void 0!==typeof window?window:global).webkitAudioContext;return function(){if(r=r||t&&new t,null==r)throw new Error("AudioContext could not be created, hardware limit reached.");return r}}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(58));var o="function"==typeof(0,i.default)(void 0!==typeof window?window:global,"navigator.getDisplayMedia",(0,i.default)(void 0!==typeof window?window:global,"navigator.mediaDevices.getDisplayMedia"));t.default=o},function(e,t,n){"use strict";const r=n(37);e.exports=function(){return function(e,t,n){const i=t.slice(),o=r(n);return function(t){let n=e,r=null;function s(e,i){t({message:e,newState:i,currentState:n,previousState:r})}function a(e){return t=e,-1===i.indexOf(t)?(s(`'${e}' is not a valid state`,e),!1):(a=e,!(!o[r=n]||-1===o[r].indexOf(a))||(s(`'${n}' cannot transition to '${e}'`,e),!1));var t,r,a}this.current=n,this.set=function(e){a(e)&&(r=n,this.current=e,n=e)}}}}},function(e,t,n){"use strict";(function(t){const r=n(62);e.exports=function(e){void 0===e&&(e={});const i=e.chromeExtensionHelper||n(282)(),o=e.electronExtensionHelper||n(642)(),s=e.Errors||n(4),a=e.firefoxExtensionHelper||n(644),c=e.getDisplayMediaExtensionHelper||n(289),u=e.otError||n(13)(),d=e.OTHelpers||n(5),l={extensionByKind:{},extensionClasses:{},registerExtensionHelper:(e,t)=>{l.extensionClasses[e]=t,t.autoRegisters&&t.isSupportedInThisBrowser&&l.registerExtension(e)},registerExtension:function(e){if(null==l.extensionClasses[e])throw new Error("Unsupported kind passed to OT.registerScreenSharingExtension");for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=l.extensionClasses[e].register(...n);l.extensionByKind[e]=i}},p=()=>{const e=r(Object.keys(l.extensionClasses).sort(e=>"electron"===e?-1:1),e=>l.extensionClasses[e].isSupportedInThisBrowser);return void 0===e?{}:{name:e,proto:l.extensionClasses[e],instance:l.extensionByKind[e]}};l.pickHelper=()=>p(),l.checkCapability=e=>{const t={supported:!1,extensionRequired:void 0,extensionRegistered:void 0,extensionInstalled:void 0,supportedSources:{}},n=p();if(void 0!==n.name){if(t.supported=!0,t.extensionRequired=n.proto.extensionRequired?n.name:void 0,t.supportedSources={screen:n.proto.sources.screen,application:n.proto.sources.application,window:n.proto.sources.window,browser:n.proto.sources.browser},!n.instance)return t.extensionRegistered=!1,t.extensionRequired&&(t.extensionInstalled=!1),void setTimeout(e.bind(null,t));t.extensionRegistered=!!t.extensionRequired||void 0,n.instance.isInstalled(n=>{t.extensionInstalled=t.extensionRequired||"Firefox"===d.env.name?n:void 0,e(t)})}else setTimeout(e.bind(null,t))},l.registerExtensionHelper("electron",o),l.registerExtensionHelper("getDisplayMedia",c),l.registerExtensionHelper("chrome",i),l.registerExtensionHelper("firefox",a);const f=()=>{};return l.getConstraints=e=>{const n=e.onAccessDialogOpened,r=void 0===n?f:n,i=e.onAccessDialogClosed,o=void 0===i?f:i,a=e.videoSource,c=e.constraints;return new t((e,t)=>{l.checkCapability(n=>{if(n.supported)if(!1===n.extensionRegistered)t(u(s.SCREEN_SHARING_EXTENSION_NOT_REGISTERED,new Error("Screen Sharing support in this browser requires an extension, but one has not been registered.")));else if(n.extensionRequired&&!1===n.extensionInstalled)t(u(s.SCREEN_SHARING_EXTENSION_NOT_INSTALLED,new Error("Screen Sharing support in this browser requires an extension, but the extension is not installed.")));else{const n=l.pickHelper();n.proto.getConstraintsShowsPermissionUI&&r(),n.instance.getConstraints(a,c,(r,i)=>{n.proto.getConstraintsShowsPermissionUI&&o(),r?t(r):e(i)})}else{let e="Screen Sharing is not supported in this browser";d.env.isElectron?e="Set the webPreferences.contextIsolation option of the Electron BrowserWindow to false or use a preload script to access the desktop capturer. For more information, see https://tokbox.com/developer/guides/screen-sharing/js/.":"Chrome"===d.env.name&&d.env.version>73&&"https:"!==(void 0!==typeof window?window:global).location.protocol&&(e="https:// is required for screen sharing"),t(u(s.SCREEN_SHARING_NOT_SUPPORTED,new Error(e)))}})})},l}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(4),r=e.ExceptionCodes||n(10),i=e.otError||n(13)(),o={ICEWorkflow:t.ICE_WORKFLOW_FAILED,NewPeerConnection:t.CREATE_PEER_CONNECTION_FAILED,SetRemoteDescription:t.SET_REMOTE_DESCRIPTION_FAILED,Subscribe:{404:t.STREAM_NOT_FOUND,[r.STREAM_LIMIT_EXCEEDED]:t.STREAM_LIMIT_EXCEEDED}};return function(e,n,s,a,c){const u=`${(s?s+": ":"")+c} PeerConnection with connection ${a} failed: ${n}`,d=o[s]||{},l="string"==typeof d?d:d[e],p="Publisher"===c?r.UNABLE_TO_PUBLISH:r.UNABLE_TO_SUBSCRIBE;if(!l){const e=new Error(u);return e.code=p,e}const f="ICEWorkflow"===s?"Publisher"===c?r.PUBLISHER_ICE_WORKFLOW_FAILED:r.SUBSCRIBER_ICE_WORKFLOW_FAILED:l===t.STREAM_LIMIT_EXCEEDED?r.STREAM_LIMIT_EXCEEDED:p;return i(l,new Error(u),f)}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.OTHelpers||n(5),r=(e.global||(void 0!==typeof window?window:global)).RTCPeerConnection;return function(e,n){"Firefox"===t.env.name&&r&&r.generateCertificate?r.generateCertificate({name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])}).catch(e=>{n(e)}).then(t=>{e.certificates=[t],n(void 0,e)}):setTimeout(()=>{n(void 0,e)})}}},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8)),s=r(n(46)),a=r(n(18));const c=n(6),u=n(659),d=n(1)("WidgetView"),l=n(5),p=n(3),f=n(169),h=f.default,m=f.CancellationError,g=n(170),b=n(661),v=n(662),y=n(663),E=n(664),S=n(665),_=n(63),w=n(108);w();e.exports=function(e){let t=void 0===e?{}:e,n=t.logging,r=void 0===n?d:n,f=t.OTHelpers,T=void 0===f?l:f,C=t.waitForVideoToBePlaying,I=void 0===C?v:C,R=t.VideoElementFacade,x=void 0===R?w():R,O=t.env,k=void 0===O?p:O;const N=u({window:void 0!==typeof window?window:global}),Z=e=>{if(e.isCanceled())throw r.debug("bindVideo bailing due to cancellation"),new m("CANCEL")};return function(){function e(e,t){let n=void 0===t?{}:t,i=n.insertDefaultUI,o=void 0===i||i,s=n.width,u=void 0===s?264:s,d=n.height,l=void 0===d?198:d,p=n.fitMode,f=void 0===p?"cover":p,h=n.mirror,m=void 0!==h&&h,g=n.insertMode,b=n.classNames,v=n.style,w=n.widgetType;(0,a.default)(this,"_videoElementFacade",void 0),(0,a.default)(this,"_container",void 0),(0,a.default)(this,"_posterContainer",document.createElement("div")),(0,a.default)(this,"_widgetContainer",document.createElement("div")),(0,a.default)(this,"_loading",!0),(0,a.default)(this,"_audioOnly",!1),(0,a.default)(this,"_showPoster",void 0),(0,a.default)(this,"_poster",void 0),(0,a.default)(this,"_cancelBind",void 0),(0,a.default)(this,"MAX_VIDEO_LOADED",5e3),c(this),!1===/^(contain|cover)$/.test(f)&&r.warn(`Invalid fit value "${f}" passed. Only "contain" and "cover" can be used.`),this._widgetType=w,this._fitMode=f,this._insertDefaultUI=o;const C=_(this._widgetContainer);if(C.on("click",this.userGesture.bind(this)),C.on("touchstart",this.userGesture.bind(this),!!N&&{passive:!0}),this.once("destroy",()=>C.removeAll()),this._widgetContainer.classList.add("OT_widget-container"),this._widgetContainer.style.width="100%",this._widgetContainer.style.height="100%",!1!==o){this._container=E(e,g),k.isSafari&&k.isiOS&&k.iOSVersion&&k.iOSVersion<11.2&&this._container.classList.add("OT_ForceContain"),this._container.style.width=S(u),this._container.style.height=S(l),this._container.style.overflow="hidden",y(this._container),m&&T.addClass(this._container,"OT_mirrored"),b&&b.trim().split(/\s+/).forEach(e=>this._container.classList.add(e)),this._container.classList.add("OT_loading"),this._container.classList.add("OT_fit-mode-"+f),this._container.appendChild(this._widgetContainer);const t=T(this._container).observeSize(()=>y(this._container))[0],n=T.observeNodeOrChildNodeRemoval(this._container,e=>{if(!this._videoElementFacade)return;e.some(e=>e===this._widgetContainer||e===this._videoElementFacade.domElement())&&this.destroyVideo()});this.once("destroy",()=>{r.debug("disconnecting observers"),t.disconnect(),n.disconnect()})}this._posterContainer.classList.add("OT_video-poster"),this._widgetContainer.appendChild(this._posterContainer);const I=document.createElement("div");I.classList.add("OT_video-loading");const R=document.createElement("div");R.classList.add("OT_video-loading-spinner"),I.appendChild(R),this._widgetContainer.appendChild(I),v&&v.backgroundImageURI&&this.setBackgroundImageURI(v.backgroundImageURI)}var t=e.prototype;return t.addError=function(e,t,n){this._container&&(this._container.innerHTML=`<p>${e}${t?` <span class="ot-help-message">${t}</span>`:""}</p>`,T.addClass(this._container,n||"OT_subscriber_error"),this._container.querySelector("p").offsetHeight>this._container.offsetHeight&&(this._container.querySelector("span").style.display="none"))},t.destroy=function(){this.emit("destroy"),this.destroyVideo(),this._container&&(T.removeElement(this._container),this._container=null)},t.setBackgroundImageURI=function(e){T.css(this._posterContainer,"backgroundImage",`url(${e})`),T.css(this._posterContainer,"backgroundSize","contain"),T.css(this._posterContainer,"opacity","1.0")},t.isAudioBlocked=function(){return Boolean(this._videoElementFacade&&this._videoElementFacade.isAudioBlocked())},t.unblockAudio=function(){return this._videoElementFacade.unblockAudio()},t.userGesture=function(){this.isAudioBlocked()&&g().then(()=>r.debug("Successfully unblocked audio"),e=>r.error("Error retrying audio on user interaction:",e))},t.setAudioBlockedUi=function(e){this._container&&(e?this._container.classList.add("OT_container-audio-blocked"):this._container.classList.remove("OT_container-audio-blocked"))},t.rebindSrcObject=function(){this._videoElementFacade&&this._videoElementFacade._rebindSrcObject()},t.pauseAndPlayVideoElement=function(){this._videoElementFacade&&this._videoElementFacade._pauseAndPlay()},t._createBufferVideoElement=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,o,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return void 0===n&&(n={}),r=n.createElement?n:document,o=!1,(s=r.createElement("video")).srcObject=t,e.prev=5,s.play(),e.next=9,I(s,this.MAX_VIDEO_LOADED);case 9:return o=e.sent,e.abrupt("return",o?s:null);case 13:return e.prev=13,e.t0=e.catch(5),e.abrupt("return",null);case 16:case"end":return e.stop()}}),e,this,[[5,13]])})));return function(t,n){return e.apply(this,arguments)}}(),t._emitAMREvent=function(e,t,n){this.emit("amrLogEvent",e,t,n)},t._createVideoElementFacade=function(e){let t=e._inject,n=e.audioVolume,i=e.fallbackText,o=e.muted;this._videoElementFacade=new x({defaultAudioVolume:parseFloat(n),fallbackText:i,fitMode:this._fitMode,_inject:t,muted:o,widgetType:this._widgetType});const s=_(this._videoElementFacade);if(this._videoFacadeEvents=s,s.on("error",()=>{this.trigger("error")}),s.on("videoDimensionsChanged",(e,t)=>{this.trigger("videoDimensionsChanged",e,t)}),s.on("mediaStopped",e=>{this.trigger("mediaStopped",e)}),s.on("audioBlocked",()=>this.trigger("audioBlocked")),s.on("audioUnblocked",()=>this.trigger("audioUnblocked")),this._videoElementFacade.audioChannelType("telephony"),r.debug("Appending the video facade"),this._videoElementFacade.appendTo(this._widgetContainer),void 0!==n)try{this._videoElementFacade.setAudioVolume(n)}catch(e){r.warn("bindVideo "+e)}},t._bindToStream=function(){var e=(0,o.default)(i.default.mark((function e(t,n){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._videoElementFacade.bindToStream(t);case 3:e.next=14;break;case 5:if(e.prev=5,e.t0=e.catch(0),!n.isCanceled()){e.next=12;break}throw r.debug("Refusing to destroyVideo as bindVideo was cancelled"),new m("CANCEL");case 12:throw this.destroyVideo(),e.t0;case 14:case"end":return e.stop()}}),e,this,[[0,5]])})));return function(t,n){return e.apply(this,arguments)}}(),t._getNewBindCancellation=function(){this._cancelBind&&(r.debug("Cancelling last bindVideo request"),this._cancelBind.cancel());const e=new h;return this._cancelBind=e,this.once("destroy",()=>e.cancel()),e},t._triggerVideoElementCreated=function(){const e=e=>{this.trigger("videoElementCreated",e),this._insertDefaultUI&&T.addClass(e,"OT_video-element")};this._videoElementFacade.domElement()?e(this._videoElementFacade.domElement()):this._videoFacadeEvents.on("videoElementCreated",t=>{e(t)})},t._waitForVideoResolution=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.audioOnly()&&"subscriber"===this._widgetType||!(t.getVideoTracks().length>0)){e.next=6;break}return r.debug("Waiting for correct resolution"),e.next=5,b(this._videoElementFacade,5e3);case 5:r.debug(`Resolution: ${this._videoElementFacade.videoWidth()}x${this._videoElementFacade.videoHeight()}`);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.bindVideo=function(){var e=(0,o.default)(i.default.mark((function e(t,n,o){var s,a,c,u,d,l,p,f;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n.audioVolume,a=n.muted,c=n.fallbackText,u=n._inject,void 0===o&&(o=!1),r.debug("bindVideo ",{webRTCStream:t}),d=!!this._videoElementFacade,p=this._getNewBindCancellation(),d){e.next=9;break}this._createVideoElementFacade({_inject:u,audioVolume:s,fallbackText:c,muted:a}),e.next=22;break;case 9:if(!(t instanceof MediaStream)){e.next=22;break}return this._emitAMREvent("AMRLoadVideoBuffer","Attempt"),e.next=13,this._createBufferVideoElement(t);case 13:if(l=e.sent){e.next=20;break}if(this._emitAMREvent("AMRLoadVideoBuffer","Failure"),!o){e.next=18;break}throw new Error("bufferFailed: videoBuffer failed to load or timeout");case 18:e.next=21;break;case 20:this._emitAMREvent("AMRLoadVideoBuffer","Success");case 21:this._videoFacadeEvents.on("amrLogEvent",(e,t,n)=>{this._emitAMREvent(e,t,n)});case 22:return e.next=24,this._bindToStream(t,p);case 24:return d||this._triggerVideoElementCreated(),Z(p),f=I(this._videoElementFacade,5e3),e.next=29,this._waitForVideoResolution(t);case 29:return r.debug("Waiting for video to be playing"),e.next=32,f;case 32:r.debug("Video is playing"),Z(p),l&&(l.remove&&l.remove(),l=null);case 35:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),t.bindAudioTrackOnly=function(){this._videoElementFacade&&this._videoElementFacade.bindAudioTrackOnly()},t.destroyVideo=function(){this._videoElementFacade&&(this._videoElementFacade.destroy(),this._videoElementFacade=null)},t.video=function(){return this._videoElementFacade},t.showPoster=function(e){return void 0===e?!T.isDisplayNone(this._posterContainer):(this._showPoster=e,T[e?"show":"hide"](this._posterContainer),this.showPoster())},t.poster=function(e){return void 0===e?T.css(this._posterContainer,"backgroundImage"):(this._poster=e,T.css(this._posterContainer,"backgroundImage",`url(${e})`),this.poster())},t.loading=function(e){return void 0===e?this._loading:(this._loading=Boolean(e),this._container&&this._container.classList[e?"add":"remove"]("OT_loading"),this.loading())},t.audioOnly=function(e){return void 0===e?this._audioOnly:(this._audioOnly=e,this._container&&this._container.classList[e?"add":"remove"]("OT_audio-only"),this.audioOnly())},t.domId=function(){return this._container&&this._container.getAttribute("id")},t.setSinkId=function(e){if(this._videoElementFacade)return this._videoElementFacade.setSinkId(e)},(0,s.default)(e,[{key:"domElement",get:function(){return this._container}},{key:"videoElement",get:function(){return this._videoElementFacade&&this._videoElementFacade.domElement()||void 0}},{key:"width",get:function(){return this.videoElement&&this.videoElement.offsetWidth}},{key:"height",get:function(){return this.videoElement&&this.videoElement.offsetHeight}}]),e}()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationError=t.default=void 0;var r=o(n(660)),i=o(n(302));function o(e){return e&&e.__esModule?e:{default:e}}t.default=r.default,t.CancellationError=i.default},function(e,t,n){"use strict";(function(t){const r=n(21);e.exports=()=>t.all(r.subscribers.where().map(e=>{if(e.isAudioBlocked())return e._.unblockAudio()}))}).call(this,n(0))},function(e,t,n){"use strict";e.exports=e=>"P2P"===e?"RELAYED":"ROUTED"},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(7)),o=r(n(8)),s=r(n(20));const a=n(58),c=n(149),u=n(9),d=n(57),l=n(62),p=n(277),f=n(48),h=n(50),m=n(679),g=n(19),b=n(261),v=n(198),y=n(169),E=y.CancellationError,S=y.default,_=n(3),w=n(689),T=n(311),C=n(75),I=n(27),R=n(6),x=n(107),O=n(127),k=n(26),N=n(74),Z=n(156),A=n(690),L=n(168)(),V=n(691),P=n(692),M=n(170),D=n(24)().getInputMediaDevices,W=n(693),G=n(271),X=n(310),j=n(694),U=n(695),F=n(292),Y=F.setVideoContentHint,B=F.getVideoContentHint,K=n(171);e.exports=function(e){void 0===e&&(e={});let r=e,y=(0,s.default)({},r);["processPubOptions"].forEach(e=>{c(y[e],e+" dependency must be injected into Publisher")});const F=y.AnalyticsHelper||k,H=y.calculateCapableSimulcastStreams||n(255),J=y.createChromeMixin||n(283)(),z=y.deviceHelpers||n(24)(),Q=y.EnvironmentLoader||n(147),q=y.Errors||n(4),$=y.Events||n(23)(),ee=y.ExceptionCodes||n(10),te=y.interpretPeerConnectionError||n(166)(),ne=y.IntervalRunner||N,re=y.logging||n(1)("Publisher"),ie=y.Microphone||n(293)(),oe=y.otError||n(13)(),se=y.OTErrorClass||n(22),ae=y.OTHelpers||n(5),ce=y.parseIceServers||n(101).parseIceServers,ue=y.PUBLISH_MAX_DELAY||n(269),de=y.PublisherPeerConnection||n(297)(),le=y.PublishingState||n(301)(),pe=y.StreamChannel||n(151),fe=y.systemRequirements||n(154),he=y.VideoOrientation||n(152)(),me=y.WidgetView||L,ge=y.global||(void 0!==typeof window?window:global),be=y.createSendMethod||n(308),ve=y.setEncodersActiveState||w,ye=y.MediaProcessor||n(696),Ee=y.isE2eeEnabled||n(157),Se=y.processPubOptions;return function(e){var n=this;void 0===e&&(e={});let r=R({});const c=new v,y=e=>c.get(e);R(this);const w=Z();let k,N,L,_e,we,Te,Ce,Ie,Re,xe,Oe,ke,Ne=new F;fe.check()||fe.upgrade();let Ze,Ae,Le,Ve=!1;const Pe={},Me={};let De;let We,Ge;const Xe=()=>this.session||Ge||{isConnected:()=>!1},je=[],Ue=new ye;function Fe(){return{connectionId:Xe().isConnected()?Xe().connection.connectionId:null,streamId:N,widgetType:"Publisher"}}this.once("publishComplete",e=>{var t;e||(Ve=!0,Ze=(null==(t=this.session)?void 0:t.sessionInfo.p2pEnabled)?"P2P":"MANTIS")}),this.on("sourceStreamIdChanged",e=>{Ze=e}),this.on("audioAcquisitionProblem",e=>{let t=e.method;ft("publisher:audioAcquisitionProblem","Event",{didPublishComplete:Ve,method:t})});const Ye=e=>{const t=Object.keys(q).map(e=>q[e]),n=oe(t.indexOf(e.name)>-1?e.name:q.MEDIA_ERR_ABORTED,e,ee.UNABLE_TO_PUBLISH);re.error(`onStreamAvailableError ${n.name}: ${n.message}`),Te.set("Failed"),k&&(k.destroy(),k=null);const r={failureReason:"GetUserMedia",failureCode:ee.UNABLE_TO_PUBLISH,failureMessage:"OT.Publisher failed to access camera/mic: "+n.message};ht("Failure",{},r),se.handleJsException({error:n,errorMsg:r.failureReason,code:r.failureCode,target:this,analytics:Ne}),this.trigger("publishComplete",n)},Be=e=>{const t=d(e);t.code=ee.UNABLE_TO_PUBLISH,re.error("OT.Publisher.onScreenSharingError "+t.message),Te.set("Failed"),t.message="Screensharing: "+t.message,this.trigger("publishComplete",t),ht("Failure",{},{failureReason:"ScreenSharing",failureMessage:t.message}),k&&(k.destroy(),k=null)},Ke=e=>{const t=d(e);let n;try{n=window.self!==window.top}catch(e){}"https:"!==(void 0!==typeof window?window:global).location.protocol&&(it?t.message+=" Note: https:// is required for screen sharing.":G()&&"localhost"!==ae.env.hostName&&(t.message+=` Note: ${ae.env.name} requires HTTPS for camera and microphone access.`)),n&&!it&&(t.message+=" Note: Check that the iframe has the allow attribute for camera and microphone"),re.error(t.message),Te.set("Failed"),t.message="OT.Publisher Access Denied: Permission Denied: "+t.message,t.code=ee.UNABLE_TO_PUBLISH,k&&(k.destroy(),k=null),ht("Cancel",{reason:"AccessDenied"}),this.trigger("publishComplete",t),this.dispatchEvent(new O(I.ACCESS_DENIED))},He=e=>{throw e.name===q.USER_MEDIA_ACCESS_DENIED||e.name===q.NOT_SUPPORTED&&e.originalMessage.match(/Only secure origins/)?Ke(e):Se.isScreenSharing?Be(e):Ye(e),e},Je=()=>{ft("accessDialog","Opened"),this.dispatchEvent(new O(I.ACCESS_DIALOG_OPENED,!0))},ze=()=>{ft("accessDialog","Closed"),this.dispatchEvent(new O(I.ACCESS_DIALOG_CLOSED,!1))},Qe=g(),qe={};let $e=!1,et={},tt=!1,nt=Se(e,"OT.Publisher",()=>Te&&Te.isDestroyed());nt.on({accessDialogOpened:Je,accessDialogClosed:ze});const rt=nt,it=rt.isScreenSharing,ot=rt.isCustomAudioTrack,st=rt.isCustomVideoTrack,at=rt.shouldAllowAudio,ct=rt.properties,ut=rt.getUserMedia;function dt(e){e.forEach(e=>e())}Object.defineProperty(this,"loudness",{writable:!1,value:void 0,configurable:!0});const lt=(e,t,n)=>e.addEventListener?(e.addEventListener(t,n),()=>e.removeEventListener(t,n)):()=>{};(function(){const e=[];r.on("streamDestroy",()=>dt(e)),r.on("streamChange",()=>{dt(e);const t=L.getAudioTracks().map(e=>lt(e,"ended",()=>{tt=!0,this.trigger("audioAcquisitionProblem",{method:"trackEndedEvent"})}));e.splice(0,e.length,...t)})}).call(this),function(){const e=[];r.on("streamDestroy",()=>dt(e)),r.on("streamChange",()=>{dt(e),pt()||L.getTracks().forEach(t=>{t.addEventListener&&(e.push(lt(t,"mute",()=>{Ht()})),e.push(lt(t,"unmute",()=>{Ht()})))})})}();const pt=()=>{if(it)return!0;const e=["text","detail"].includes(ct.videoContentHint);return st&&e},ft=e.logAnalyticsEvent||((e,t,n,r,i)=>{let o=u({action:e,variation:t,payload:n},Fe(),r);"Failure"===t&&(o=u(et,o)),et=f(o,"sessionId","connectionId","partnerId"),Ne.logEvent(o,i)}),ht=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n={}),"Non-fatal"!==n.failureReason&&("Attempt"===e&&(Ie=(new Date).getTime(),We&&(We.stop(),re.error("_connectivityAttemptPinger should have been cleaned up")),We=new ne(()=>{ft("Publish","Attempting",t,(0,s.default)({},Fe(),n))},.2,6)),"Failure"===e||"Success"===e||"Cancel"===e?(We?(We.stop(),We=void 0):re.warn(`Received connectivity event: "${e}" without "Attempt"`),ft("Publish",e,(0,s.default)({videoInputDevices:xe,audioInputDevices:Re,videoInputDeviceCount:xe?xe.length:void 0,audioInputDeviceCount:Re?Re.length:void 0,selectedVideoInputDeviceId:Oe,selectedAudioInputDeviceId:ke},t),(0,s.default)({attemptDuration:(new Date).getTime()-Ie},n))):ft("Publish",e,t,n))},mt=(e,t)=>{ft("ICERestart",e,t)},gt=(e,t,n)=>{"Attempt"===t?(Pe[e]=(new Date).getTime(),ft(e,t,n)):"Failure"!==t&&"Success"!==t||ft(e,t,n,{attemptDuration:(new Date).getTime()-Pe[e]})},bt=function(e,t){void 0===t&&(t={}),gt("RoutedToRelayedTransition",e,t)},vt=function(e,t){void 0===t&&(t={}),gt("RelayedToRoutedTransition",e,t)},yt=h(()=>{ft("GetStats","Called")}),Et=h(()=>{ft("GetRtcStatsReport","Called")}),St=t=>{let n=t.parsedStats,r=t.simulcastEnabled,i=t.remoteConnectionId,o=t.peerId,s=t.sourceStreamId;const a={peerId:o,widgetType:"Publisher",connectionId:this.session&&this.session.isConnected()?this.session.connection.connectionId:null,streamId:N,width:k.width,height:k.height,audioTrack:L&&L.getAudioTracks().length>0,hasAudio:Kt(),publishAudio:ct.publishAudio,videoTrack:L&&L.getVideoTracks().length>0,hasVideo:Bt(),publishVideo:ct.publishVideo,audioSource:ot?"Custom":void 0,duration:_e?Math.round(((new Date).getTime()-_e.getTime())/1e3):0,remoteConnectionId:i,scalableVideo:r,sourceStreamId:K(s)};let c=(it&&st?"Screen":it&&e.videoSource)||st&&"Custom"||ct.constraints.video&&"Camera"||null;p(c)&&(c=m(c)),a.videoSource=c;const d={videoWidth:this.videoWidth(),videoHeight:this.videoHeight()},l=u({},a,n,d);Ne.logQOS(l),this.trigger("qos",l)},_t=()=>{let e,t;const n=k&&k.video();return ct.videoDimensions?(e=Math.min(ct.videoDimensions.width,n&&n.videoWidth()||640),t=Math.min(ct.videoDimensions.height,n&&n.videoHeight()||480)):(e=n&&n.videoWidth()||640,t=n&&n.videoHeight()||480),{width:e,height:t}},wt=()=>{Te.isDestroyed()?k&&k.destroyVideo():(re.debug("OT.Publisher.onLoaded; resolution:",`${this.videoWidth()}x${this.videoHeight()}`),Te.set("MediaBound"),M().catch(re.error),k.loading(!!this.session&&!this.stream),$e=!0)},Tt=e=>{const t=oe(q.CONNECT_FAILED,e,ee.P2P_CONNECTION_FAILED);t.message="OT.Publisher PeerConnection Error: "+t.message,ht("Failure",{},{failureReason:"PeerConnectionError",failureCode:t.code,failureMessage:t.message}),Te.set("Failed"),this.trigger("publishComplete",t),se.handleJsException({error:t,target:this,analytics:Ne})},Ct=()=>{L&&(r.emit("streamDestroy"),ge.MediaStreamTrack&&ge.MediaStreamTrack.prototype.stop?L.getTracks().forEach(e=>e.stop()):L.stop())},It=()=>{const e=_.isiOS&&_.iOSVersion>=15&&_.iOSVersion<15.2,t=L.getVideoTracks()[0];if(!e||!t)return;document.addEventListener("visibilitychange",()=>{!document.hidden&&k&&k.rebindSrcObject()})},Rt=()=>{const e=_.isiOS&&_.iOSVersion>=13.3,t=L.getAudioTracks()[0];e&&t&&(t.onmute=()=>En(t),t.onunmute=()=>Sn(t))},xt=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t={muted:!0},k){e.next=3;break}throw new Error("Cannot bind video after widget view has been destroyed");case 3:return e.abrupt("return",k.bindVideo(L,t));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ot=function(){var e=(0,o.default)(i.default.mark((function e(t){var o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.debug("OT.Publisher.onStreamAvailable"),Te.set("BindingMedia"),void 0!==ct.videoContentHint&&Y(t,ct.videoContentHint),Ct(),L=t,!ct.videoFilter){e.next=14;break}return e.prev=6,e.next=9,n.applyVideoFilter(ct.videoFilter);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),re.error("Error applying video filter: "+e.t0);case 14:r.emit("streamChange"),Rt(),It(),Oe=(o=(e,t)=>{let n;return e.forEach(e=>{if(e.deviceId)n=e.deviceId.toString();else if(e.label&&t){const r=l(t,t=>t.label===e.label);r&&(n=r.deviceId)}}),n})(L.getVideoTracks(),xe),ke=o(L.getAudioTracks(),Re),we=new ie(L,!ct.publishAudio),cn(),on(),n.accessAllowed=!0,n.dispatchEvent(new O(I.ACCESS_ALLOWED,!1));case 25:case"end":return e.stop()}}),e,null,[[6,11]])})));return function(t){return e.apply(this,arguments)}}(),kt=e=>{let t,n;re.error("OT.Publisher.onPublishingTimeout"),tt?(t=q.CHROME_MICROPHONE_ACQUISITION_ERROR,n="Unable to publish because your browser failed to get access to your microphone. You may need to fully quit and restart your browser to get it to work. See https://bugs.chromium.org/p/webrtc/issues/detail?id=4799 for more details."):(t=q.TIMEOUT,n="Could not publish in a reasonable amount of time");const r={failureReason:"ICEWorkflow",failureCode:ee.UNABLE_TO_PUBLISH,failureMessage:"OT.Publisher failed to publish in a reasonable amount of time (timeout)"};ht("Failure",{},r),se.handleJsException({errorMsg:r.failureReason,code:r.failureCode,target:this,analytics:Ne}),e.isConnected()&&this.streamId&&e._.streamDestroy(this.streamId),this.disconnect(),this.session=null,Te.isDestroyed()||Te.set("MediaBound"),this.trigger("publishComplete",oe(t,new Error(n),ee.UNABLE_TO_PUBLISH))},Nt=e=>{const t=oe(q.MEDIA_ERR_DECODE,e,ee.UNABLE_TO_PUBLISH);t.message="OT.Publisher while playing stream: "+t.message,re.error("OT.Publisher.onVideoError:",t),ft("stream",null,{reason:t.message});const n=Te.isAttemptingToPublish();Te.set("Failed"),n?this.trigger("publishComplete",t):this.trigger("error",t.message),se.handleJsException({error:t,target:this,analytics:Ne})};this._setWebRTCStream=e=>{L=e},this._setCurrentVideoFilter=e=>{ln=e},this._getCurrentVideoFilter=()=>ln,this._removePeerConnection=e=>{const t=y(e).peerConnectionId;delete qe[t],e.destroy()},this._removeSubscriber=e=>{this.session.sessionInfo.isAdaptiveEnabled&&"P2P"===Ze&&this._.startRelayedToRoutedTransition(),Wt(e).then(e=>{e.forEach(e=>this._removePeerConnection(e))})};const Zt=e=>{const t=y(e),n=t.remoteSubscriberId,r=t.peerConnectionId;re.debug("Subscriber has been disconnected from the Publisher's PeerConnection"),ft("disconnect","PeerConnection",{subscriberConnection:r}),this._removeSubscriber(n)},At=function(){var e=(0,o.default)(i.default.mark((function e(t,r){var o,s,a,c,u,d,l,p,f,h;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.reason,s=r.prefix,a=n.session&&n.session.sessionInfo,!("ICEWorkflow"===s&&a&&a.reconnection&&$e)){e.next=5;break}return re.debug("Ignoring peer connection failure due to possibility of reconnection."),e.abrupt("return");case 5:return c=y(t)||{},u=c.remoteConnectionId,d=void 0===u?"(not found)":u,l=c.peerConnectionId,p=te(void 0,o,s,d,"Publisher"),f={hasRelayCandidates:t&&t.hasRelayCandidates()},h={failureReason:s||"PeerConnectionError",failureCode:p.code,failureMessage:p.message},Te.isPublishing()?h.reason="Non-fatal":n.trigger("publishComplete",p),ht("Failure",f,h),se.handleJsException({errorMsg:"OT.Publisher PeerConnection Error: "+o,code:p.code,target:n,analytics:Ne}),e.next=14,qe[l];case 14:e.sent.destroy(),delete qe[l];case 17:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Lt=e=>this.session.sessionInfo.isAdaptiveEnabled&&"P2P"===e.getSourceStreamId(),Vt=function(){var e=(0,o.default)(i.default.mark((function e(t,r){var o,s,a,c,u,d;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.session.sessionInfo.isAdaptiveEnabled,s=r.getSourceStreamId(),Me[s]=t,"disconnected"===t&&setTimeout(()=>{const e=n.session._.isSocketReconnecting,t=n.session._.getSocket().is("connected")&&!e();if("disconnected"===Me[s]&&t){const e=y(r).remoteConnectionId;mt("Attempt",{remoteConnectionId:e}),r.iceRestart()}},2e3),"connected"!==t){e.next=14;break}if(clearTimeout(De),!o){e.next=14;break}return e.next=9,jt();case 9:return a=e.sent.iceConnectionStateIsConnected(),e.next=12,Ut();case 12:c=e.sent.iceConnectionStateIsConnected(),a&&c&&Qt();case 14:if("failed"!==t){e.next=21;break}if(u=n.session._.isSocketReconnecting,d=n.session._.getSocket(),d.is("connected")&&!u()){e.next=20;break}return e.abrupt("return");case 20:o&&s===Ze&&"P2P"===s?n._.startRelayedToRoutedTransition():De=setTimeout(()=>{n.session._.streamDestroy(n.streamId,s)},5e3);case 21:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Pt=e=>{e.startEncryption(this.session.connection.id),Lt(e)&&bt("Success")},Mt=n=>{let r=n.peerConnectionId,i=n.send,o=n.log,s=n.logQoS,a=n.sourceStreamId;if(Gt(r))return t.reject(new Error("PeerConnection already exists"));const c=H({isChromiumEdge:ae.env.isChromiumEdge,browserName:ae.env.name,isScreenSharing:it,isCustomVideoTrack:st,sessionInfo:this.session.sessionInfo,constraints:ct.constraints,videoDimensions:_t(),capableSimulcastScreenshare:ct.capableSimulcastScreenshare});return qe[r]=t.all([this.session._.getIceConfig(),this.session._.getVideoCodecsCompatible(L)]).then(n=>{let r=n[0],u=n[1],d=L;if(!u){d=L.clone();const e=d.getVideoTracks()[0];e&&(e.stop(),d.removeTrack(e))}const l=new de({iceConfig:r,sendMessage:(e,t)=>{"offer"===e&&this.trigger("connected"),i(e,t)},webRTCStream:d,channels:ct.channels,capableSimulcastStreams:c,overrideSimulcastEnabled:e._enableSimulcast,logAnalyticsEvent:o,offerOverrides:{enableDtx:ct.enableDtx,enableStereo:ct.enableStereo,audioBitrate:ct.audioBitrate,priorityVideoCodec:ct._priorityVideoCodec||this.session.sessionInfo.priorityVideoCodec,codecFlags:ct._codecFlags||this.session._.getCodecFlags()},answerOverrides:this.session.sessionInfo.p2pEnabled?void 0:{audioBitrate:ct.audioBitrate},sourceStreamId:a,isP2pEnabled:this.session.sessionInfo.p2pEnabled,sessionId:this.session.id});return l.on({disconnected:()=>Zt(l),error:e=>{let t=e.reason,n=e.prefix;return At(l,{reason:t,prefix:n})},qos:s,iceRestartSuccess:()=>(e=>{const t=y(e).remoteConnectionId;mt("Success",{remoteConnectionId:t})})(l),iceRestartFailure:()=>(e=>{const t=y(e).remoteConnectionId;mt("Failure",{reason:"ICEWorkflow",message:"OT.Publisher PeerConnection Error: The stream was unable to connect due to a network error. Make sure your connection isn't blocked by a firewall.",remoteConnectionId:t})})(l),iceConnectionStateChange:e=>Vt(e,l),audioAcquisitionProblem:()=>{tt=!0,this.trigger("audioAcquisitionProblem",{method:"getStats"})}}),l.once("connected",()=>Pt(l)),new t((e,t)=>{const n=e=>{t(e)};l.once("error",n),l.init(Ce,r=>{if(r)return t(r);l.off("error",n),e(l)})})}),Gt(r)},Dt=()=>t.all(Object.keys(qe).map(Gt)),Wt=e=>Dt().then(t=>t.filter(t=>y(t).remoteSubscriberId===e)),Gt=e=>qe[e],Xt=e=>{const t=Object.keys(qe).find(t=>t.endsWith("~"+e));return qe[t]},jt=()=>Xt("MANTIS"),Ut=()=>Xt("P2P");let Ft=J(this,{name:ct.name,publishAudio:ct.publishAudio,publishVideo:ct.publishVideo,audioSource:ct.audioSource,showControls:ct.showControls,shouldAllowAudio:at,logAnalyticsEvent:ft});const Yt=()=>{this.off("publishComplete",Ht),Ft&&Ft.reset(),w.releaseAll(),this.disconnect(),we=null,Ct(),L=null,k&&(k.destroy(),k=null),this.session&&this._.unpublishFromSession(this.session,"reset"),this.id=null,this.stream=null,$e=!1,this.session=null,Te.isDestroyed()||Te.set("NotPublishing")},Bt=()=>{if(!L||0===L.getVideoTracks().length)return!1;const e=["text","detail"].includes(ct.videoContentHint),t=st&&e,n=ae.env.isChrome&&(it||t);return L.getVideoTracks().reduce((e,t)=>e&&(!t.muted||!!n)&&t.enabled&&"ended"!==t.readyState,ct.publishVideo)},Kt=()=>!(!L||0===L.getAudioTracks().length)&&(L.getAudioTracks().length>0&&L.getAudioTracks().reduce((e,t)=>e&&!t.muted&&t.enabled&&"ended"!==t.readyState,ct.publishAudio)),Ht=e=>{k&&(k.audioOnly(!Bt()),k.showPoster(!Bt())),Ft&&Ft.setAudioOnly(!Bt()&&Kt()),this.stream?(this.stream.setChannelActiveState("audio",Kt(),e),this.stream.setChannelActiveState("video",Bt(),e)):this.once("publishComplete",Ht)},Jt=(e,n)=>{let r=!1;if("function"==typeof e?n=e:r="rtcStatsReport"===e,r?Et():yt(),!r||X)Dt().then(e=>{if(0===e.length){const e=ee.PEER_CONNECTION_NOT_CONNECTED;throw oe(q.PEER_CONNECTION_NOT_CONNECTED,new Error(se.getTitleByCode(e)),e)}return e}).then(e=>this.session.sessionInfo.isAdaptiveEnabled?e.filter(e=>e.getSourceStreamId()===Ze):e).then(e=>t.all(e.map(e=>T(r?e.getRtcStatsReport.bind(e):e.getStats.bind(e))().then(t=>({pc:e,stats:t}))))).then(e=>{const t=_e?_e.getTime():Date.now(),i=e.map(e=>{let n=e.pc,i=e.stats;const o=y(n),s=o.remoteConnectionId,a=o.remoteSubscriberId;return u(s.match(/^symphony\./)?{}:{subscriberId:a,connectionId:s},r?{rtcStatsReport:i}:{stats:C.normalizeStats(i,!1,t)})});n(null,i)}).catch(n);else{const e=ee.GET_RTC_STATS_REPORT_NOT_SUPPORTED;n(oe(q.GET_RTC_STATS_REPORT_NOT_SUPPORTED,new Error(se.getTitleByCode(e)),e))}},zt=(e,t)=>{this.session._.streamCreate(ct.name||"",this.streamId,ct.audioFallbackEnabled,je,ct.minVideoBitrate,e,t)},Qt=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Le=!1,e.next=3,jt();case 3:if(!(t=e.sent)){e.next=16;break}return n.trigger("sourceStreamIdChanged","P2P"),e.next=8,x(5e3);case 8:if(!Le){e.next=11;break}return re.debug("Cancelling stop sending RTP to MANTIS."),e.abrupt("return");case 11:return e.next=13,t.changeMediaDirectionToInactive();case 13:if(!(ae.env.isFirefox&&ae.env.version<96)){e.next=16;break}return e.next=16,$t();case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qt=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Le=!0,e.next=3,jt();case 3:if(!(t=e.sent)){e.next=9;break}return e.next=7,t.changeMediaDirectionToRecvOnly();case 7:Ae&&clearTimeout(Ae),n.trigger("sourceStreamIdChanged","MANTIS");case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$t=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,jt();case 2:(t=e.sent)&&(Ae=setTimeout((0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("P2P"!==Ze){e.next=9;break}return e.next=3,t.changeMediaDirectionToRecvOnly();case 3:return e.next=5,x(3e3);case 5:return e.next=7,t.changeMediaDirectionToInactive();case 7:return e.next=9,$t();case 9:case"end":return e.stop()}}),e)}))),3e4));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();this.publish=e=>(re.debug("OT.Publisher: publish"),(Te.isAttemptingToPublish()||Te.isPublishing())&&Yt(),Te.set("GetUserMedia"),ct.style&&this.setStyle(ct.style,null,!0),ct.classNames="OT_root OT_publisher",Q.onLoad(()=>{re.debug("OT.Publisher: publish: environment loaded"),k=new me(e,(0,s.default)({},ct,{widgetType:"publisher"})),at&&V({publisher:this,widgetView:k}),k.on("error",Nt),this.id=k.domId(),this.element=k.domElement,this.element&&Ft&&Ft.init(k),k.on("videoDimensionsChanged",(e,t)=>{this.stream&&this.stream.setVideoDimensions(t.width,t.height),this.dispatchEvent(new $.VideoDimensionsChangedEvent(this,e,t))}),k.on("mediaStopped",e=>{const t=new $.MediaStoppedEvent(this,e);if(this.dispatchEvent(t),!t.isDefaultPrevented())if(e){const t=String(e.kind).toLowerCase();"audio"===t?on():"video"===t?cn():re.warn("Track with invalid kind has ended: "+e.kind)}else this.session?this._.unpublishFromSession(this.session,"mediaStopped"):this.destroy("mediaStopped")}),k.on("videoElementCreated",e=>{const t=new $.VideoElementCreatedEvent(e);this.dispatchEvent(t)}),ut().catch(He).then(function(){var e=(0,o.default)(i.default.mark((function e(t){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Re=nt.audioDevices,xe=nt.videoDevices,(r=!!ct.videoFilter)&&(dn=j(t,xe)),e.next=6,Ot(t);case 6:return ct.publishVideo||n._toggleVideo(ct.publishVideo),it||st||r||(dn=j(t,xe)),e.abrupt("return",xt().catch(e=>{if(!(e instanceof E))throw e}).then(()=>{wt(),Te.isDestroyed()||(n.trigger("initSuccess"),n.trigger("loaded",n))},e=>{re.error("OT.Publisher.publish failed to bind video: "+e),Tt(e)}));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}),this),this._setScalableValues=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,o,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Dt().then(e=>e[0].getSenders().filter(e=>"video"===e.track.kind));case 2:return r=e.sent,o=r[0],(s=o.getParameters()).encodings.forEach((e,r)=>{e[t]=n[r]}),e.next=8,o.setParameters(s);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),this._setScalableFramerates=function(){var e=(0,o.default)(i.default.mark((function e(t){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=nn(t))||!en(r)){e.next=4;break}return e.next=4,n._setScalableValues("maxFramerate",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this._setScalableVideoLayers=function(){var e=(0,o.default)(i.default.mark((function e(t){var r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=nn(t))||!tn(r)){e.next=4;break}return e.next=4,n._setScalableValues("scaleResolutionDownBy",r);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();const en=e=>{let t=0;return e.every(e=>!(15!==e&&30!==e||e<t)&&(t=e,!0))},tn=e=>{let t=17;return e.every(e=>!(e<1||e>=t)&&(t=e,!0))},nn=e=>{let t;if("string"!=typeof e)return t;const n=e.split(":");return 0===n.length||n.length>3?t:n.every(e=>!isNaN(e))?(t=n.map(e=>parseInt(e,10)).reverse(),t):t},rn=e=>L&&L[`get${b(e)}Tracks`]().length>0&&L[`get${b(e)}Tracks`]().every(e=>"ended"!==e.readyState),on=e=>{const t=rn("audio")&&ct.publishAudio;Ft&&Ft.setMuted(!t),we&&we.muted(!t),Ht(e)};let sn;this.publishAudio=e=>{ft("publishAudio","Attempt",{publishAudio:e}),ct.publishAudio=e;try{on(),ft("publishAudio","Success",{publishAudio:e})}catch(e){ft("publishAudio","Failure",{message:e.message})}return this};let an=!1;const cn=()=>{const e=rn("video")&&ct.publishVideo;"Chrome"===_.name&&_.version>=69&&(0,o.default)(i.default.mark((function t(){var n,r;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return sn&&sn.cancel(),sn=new S,n=sn,t.next=5,Dt();case 5:r=t.sent,n.isCanceled()||r.forEach(t=>{ve(t,e)});case 7:case"end":return t.stop()}}),t)})))(),L&&L.getVideoTracks().forEach(t=>{t.enabled=e,t.isCreatedCanvas&&(t.enabled=!1)}),Ht()},un=function(){var e=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ue.getOriginalVideoTrack().stop(),e.next=3,Ue.destroy();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();let dn,ln;this._toggleVideo=P(function(){var e=(0,o.default)(i.default.mark((function e(t){var n,o,s,a,c,u,d;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(it||st||an)){e.next=2;break}return e.abrupt("return");case 2:if(n=gn()){e.next=5;break}throw oe(q.NOT_SUPPORTED,new Error("Publisher._toggleVideo cannot toggleVideo when you have no video source."));case 5:if("ended"!==n.readyState){e.next=8;break}return an=!0,e.abrupt("return");case 8:o=ct.videoDimensions,s=void 0===o?_t():o,e.prev=9,a=W(s),e.next=16;break;case 13:return e.prev=13,e.t0=e.catch(9),e.abrupt("return");case 16:return e.next=18,bn();case 18:if(c=e.sent,t&&ae.env.isAndroid&&ae.env.isChrome&&n&&n.stop&&n.stop(),t){e.next=27;break}try{dn=c.find(e=>e.label===n.label).deviceId}catch(e){}if(!(u=Ue.getVideoFilter())){e.next=27;break}return ln=u,e.next=27,un();case 27:if(!dn||-1!==c.findIndex(e=>e.deviceId===dn)){e.next=29;break}throw oe(q.NO_DEVICES_FOUND,new Error("Previous device no longer available - deviceId not found"));case 29:if(r.emit("streamDestroy"),d=a,!t){e.next=43;break}return e.next=34,mn(dn);case 34:if(d=e.sent,!ln){e.next=43;break}return e.next=38,Ue.setVideoFilter(ln);case 38:return e.next=40,Ue.setMediaStream(L);case 40:return e.next=42,Ue.setVideoTrack(d);case 42:d=e.sent;case 43:return e.prev=43,e.next=46,hn(n,d);case 46:e.next=51;break;case 48:throw e.prev=48,e.t1=e.catch(43),e.t1;case 51:case"end":return e.stop()}}),e,null,[[9,13],[43,48]])})));return function(t){return e.apply(this,arguments)}}()),this.publishVideo=e=>{ft("publishVideo","Attempt",{publishVideo:e}),ct.publishVideo=e;try{this._toggleVideo(ct.publishVideo),cn(),ft("publishVideo","Success",{publishVideo:e})}catch(e){ft("publishVideo","Failure",{message:e.message})}return this},this.setVideoContentHint=e=>Y(L,e),this.getVideoContentHint=()=>B(L),this.destroy=function(e,t){return Te.isAttemptingToPublish()&&this.session&&ht("Cancel",{reason:"destroy"}),Te.isDestroyed()||(Te.set("Destroyed"),Yt(),nt&&(nt.off(),nt=null),Ft&&(Ft.destroy(),Ft=null),r&&(r.off(),r=null),!0!==t&&this.dispatchEvent(new $.DestroyedEvent(I.PUBLISHER_DESTROYED,this,e)),this.off()),this},this.disconnect=()=>{Object.keys(qe).forEach(e=>{const t=Gt(e);delete qe[e],t.then(e=>this._removePeerConnection(e))})},this.processMessage=(e,t,n)=>{const r=a(n,"params.subscriber",t).replace(/^INVALID-STREAM$/,t),i=a(n,"content.peerId"),o=a(n,"content.sourceStreamId","MANTIS"),u=`${r}~${i}~${o}`;re.debug(`OT.Publisher.processMessage: Received ${e} from ${t} for ${u}`),re.debug(n);const d=Gt(u),l=()=>{const a=be({socket:this.session._.getSocket(),uri:n.uri,content:{peerId:i,sourceStreamId:o}});Mt({peerConnectionId:u,send:a,log:function(e,t,n,r,a){void 0===r&&(r={});const c=(0,s.default)({peerId:i,sourceStreamId:K(o)},r);return ft(e,t,n,c,a)},logQoS:e=>{o===Ze&&St((0,s.default)({},e,{peerId:i,remoteConnectionId:t,sourceStreamId:o}))},sourceStreamId:o}).then(s=>(((e,t)=>{c.set(e,t)})(s,{remoteConnectionId:t,remoteSubscriberId:r,peerId:i,sourceStreamId:o,peerConnectionId:u}),s.processMessage(e,n),null)).catch(e=>{re.error("OT.Publisher failed to create a peerConnection",e)})},p=this.session.sessionInfo.isAdaptiveEnabled;switch(e){case"unsubscribe":this._removeSubscriber(r);break;default:if(d)d.then(t=>t.processMessage(e,n));else{if(p&&Ut())return;l()}}},this.getImgData=function(){if(!$e)return re.error("OT.Publisher.getImgData: Cannot getImgData before the Publisher is publishing."),null;const e=k&&k.video();return e?e.imgData():null};const pn=e=>{e.getSenders().forEach(e=>"audio"===e.track.kind&&L.getAudioTracks().length?e.replaceTrack(L.getAudioTracks()[0]):"video"===e.track.kind&&L.getVideoTracks().length?e.replaceTrack(L.getVideoTracks()[0]):void 0)},fn=function(e){return void 0===e&&(e=pn),Dt().then(n=>(n.map(e),t.all([])))};{let e=0;const t=function(){var t=(0,o.default)(i.default.mark((function t(){var n,o,s,a;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!ae.env.isLegacyEdge&&ge.RTCRtpSender&&"function"==typeof ge.RTCRtpSender.prototype.replaceTrack){t.next=2;break}throw oe(q.UNSUPPORTED_BROWSER,new Error("Publisher#cycleVideo is not supported in your browser."),ee.UNABLE_TO_PUBLISH);case 2:if(!st&&!it){t.next=4;break}throw oe(q.NOT_SUPPORTED,new Error("Publisher#cycleVideo: The publisher is not using a camera video source"));case 4:if(n=gn()){t.next=7;break}throw oe(q.NOT_SUPPORTED,new Error("Publisher#cycleVideo cannot cycleVideo when you have no video source."));case 7:return e+=1,t.next=10,bn();case 10:if(o=t.sent,o.filter(e=>e.label!==n.label).length>0)for(;o[e%o.length].label===n.label;)e+=1;return r.emit("streamDestroy"),s=o[e%o.length],a=s.deviceId,t.next=18,Cn(a);case 18:return t.abrupt("return",dn);case 19:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();this.cycleVideo=P((0,o.default)(i.default.mark((function e(){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t();case 3:n=e.sent,e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(0),re.error("Publisher#cycleVideo: could not cycle video: "+e.t0),e.t0;case 10:return e.abrupt("return",{deviceId:n});case 11:case"end":return e.stop()}}),e,null,[[0,6]])}))))}const hn=function(){var e=(0,o.default)(i.default.mark((function e(o,s){var a,c,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Dt();case 2:return a=e.sent,e.next=5,t.all(a.map(e=>e.findAndReplaceTrack(o,s)));case 5:if(L.addTrack(s),L.removeTrack(o),o&&o.stop){try{c=s instanceof MediaStreamTrackGenerator}catch(e){c=!1}c||o.stop()}"Firefox"!==ae.env.name&&"Safari"!==ae.env.name||(n.videoElement().srcObject=null,n.videoElement().srcObject=L),(u=k&&k.video())&&u.refreshTracks(),r.emit("streamChange"),cn();case 13:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),mn=function(){var t=(0,o.default)(i.default.mark((function t(n){var r,o,s;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=d(e)).audioSource=null,r.videoSource=n,nt=Se(r,"OT.Publisher.getTrackFromDeviceId",()=>Te&&Te.isDestroyed()),nt.on({accessDialogOpened:Je,accessDialogClosed:ze}),o=nt.getUserMedia,t.prev=6,t.next=9,o();case 9:s=t.sent,t.next=15;break;case 12:t.prev=12,t.t0=t.catch(6),re.error(t.t0);case 15:return t.abrupt("return",s&&s.getVideoTracks()[0]);case 16:case"end":return t.stop()}}),t,null,[[6,12]])})));return function(e){return t.apply(this,arguments)}}(),gn=()=>L.getVideoTracks()[0],bn=function(){var e=(0,o.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z.shouldAskForDevices();case 2:if(t=e.sent,n=t.videoDevices,t.video&&n&&n.length){e.next=6;break}throw oe(q.NO_DEVICES_FOUND,new Error("No video devices available"),ee.UNABLE_TO_PUBLISH);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),vn=(e,t)=>{t&&L.addTrack(t),e&&L.removeTrack(e);const n=k&&k.video();n&&n.refreshTracks(),Ft&&(t&&!e&&Ft.addAudioTrack(),e&&!t&&Ft.removeAudioTrack()),e&&e.stop&&e.stop(),t&&(on(),we=new ie(L,!ct.publishAudio)),r.emit("streamChange"),Ht()},yn=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.getSettings().deviceId,e.prev=1,e.next=4,n.setAudioSource(r);case 4:(o=L.getAudioTracks()[0])&&(o.onmute=()=>En(o),o.onunmute=()=>Sn(o)),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),re.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),En=e=>{let t=!1;ct.publishVideo&&document.hidden&&(t=!0,this.publishVideo(!1));const r=function(){var s=(0,o.default)(i.default.mark((function o(){return i.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(document.hidden){i.next=5;break}return i.next=3,yn(e);case 3:t&&n.publishVideo(!0),document.removeEventListener("visibilitychange",r);case 5:case"end":return i.stop()}}),o)})));return function(){return s.apply(this,arguments)}}();document.addEventListener("visibilitychange",r)},Sn=e=>{Kt()&&(Bt()?this.videoElement().pause():yn(e)),this.session.trigger("gsmCallEnded")};let _n;const wn=function(){var r=(0,o.default)(i.default.mark((function r(o){var s,a,c,u,l,p,f,h,m,g,b,v;return i.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(s="Operation did not succeed due to a new request.",_n&&_n.cancel(),_n=new S,a=_n,c=e=>{if(a.isCanceled())throw e.getTracks(e=>e.stop()),oe(q.CANCEL,new Error(s));return wn(e.getAudioTracks()[0])},!ae.env.isLegacyEdge&&ge.RTCRtpSender&&"function"==typeof ge.RTCRtpSender.prototype.replaceTrack){r.next=7;break}throw oe(q.UNSUPPORTED_BROWSER,new Error("Publisher#setAudioSource is not supported in your browser."));case 7:if(u=n.getAudioSource()){r.next=10;break}throw oe(q.NOT_SUPPORTED,new Error("Publisher#setAudioSource cannot add an audio source when you started without one."));case 10:if(!(o instanceof MediaStreamTrack)){r.next=21;break}return r.next=13,Dt();case 13:if(l=r.sent,!a.isCanceled()){r.next=16;break}throw oe(q.CANCEL,new Error(s));case 16:return r.next=18,t.all(l.map(e=>e.findAndReplaceTrack(u,o)));case 18:return r.abrupt("return",vn(u,o));case 21:if("string"!=typeof o){r.next=68;break}return(p=d(e)).audioSource=o,p.videoSource=null,nt=Se(p,"OT.Publisher.setAudioSource",()=>a.isCanceled()||Te&&Te.isDestroyed()),nt.on({accessDialogOpened:Je,accessDialogClosed:ze}),f=u.label,h=u.getConstraints&&u.getSettings().deviceId||void 0,u&&u.stop(),m=nt.getUserMedia,r.prev=31,r.t0=c,r.next=35,m();case 35:return r.t1=r.sent,r.next=38,(0,r.t0)(r.t1);case 38:return r.abrupt("return",r.sent);case 41:if(r.prev=41,r.t2=r.catch(31),!a.isCanceled()){r.next=45;break}throw oe(q.CANCEL,new Error(s));case 45:if((g=d(e)).videoSource=null,g.audioSource=h,g.audioSource||!f){r.next=55;break}return r.next=51,D();case 51:if(b=r.sent.find(e=>e.label===f),!a.isCanceled()){r.next=54;break}throw oe(q.CANCEL,new Error(s));case 54:b&&(g.audioSource=b.deviceId);case 55:if(g.audioSource){r.next=58;break}throw r.t2.message+=" (could not determine previous audio device)",oe(q.NOT_FOUND,r.t2);case 58:return nt=Se(g,"OT.Publisher.setAudioSource",()=>a.isCanceled()||Te&&Te.isDestroyed()),r.next=61,nt.getUserMedia().catch(e=>{throw e.message+=" (could not obtain previous audio device)",e});case 61:return v=r.sent,r.next=64,c(v);case 64:throw r.t2.message+=" (reverted to previous audio device)",r.t2;case 66:r.next=69;break;case 68:throw oe(q.INVALID_PARAMETER,new Error("Invalid parameter passed to OT.Publisher.setAudioSource(). Expected string or MediaStreamTrack."));case 69:case"end":return r.stop()}}),r,null,[[31,41]])})));return function(e){return r.apply(this,arguments)}}();this.setAudioSource=wn,this.getAudioSource=()=>L&&L.getAudioTracks().length>0?L.getAudioTracks()[0]:null;const Tn=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=oe(q.INVALID_VIDEO_SOURCE,new Error("Invalid video source. Video source must be a valid video input deviceId"),1041),r=oe(q.SET_VIDEO_SOURCE_FAILURE,new Error("You cannot reset the video source on a publisher that does not currently use a camera source."),1040),!ae.env.isLegacyEdge&&ge.RTCRtpSender&&"function"==typeof ge.RTCRtpSender.prototype.replaceTrack){e.next=4;break}throw oe(q.UNSUPPORTED_BROWSER,new Error("setVideoSource is not supported in your browser."),ee.UNABLE_TO_PUBLISH);case 4:if("string"==typeof t){e.next=6;break}throw n;case 6:if(o=!L||0===L.getVideoTracks().length,!(st||it||o)){e.next=9;break}throw r;case 9:return e.next=11,D();case 11:if(s=e.sent,s.find(e=>"videoInput"===e.kind&&e.deviceId===t)){e.next=15;break}throw n;case 15:return e.next=17,Cn(t);case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();this.setVideoSource=Tn;const Cn=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=dn,dn=t,ct.publishVideo){e.next=4;break}return e.abrupt("return");case 4:return r=gn(),ct.publishVideo&&ae.env.isAndroid&&(ae.env.isChrome||ae.env.isFirefox)&&r&&r.stop&&r.stop(),e.prev=6,e.next=9,mn(t);case 9:o=e.sent,e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(6),dn=n,re.error(e.t0),e.abrupt("return");case 17:if(o){e.next=20;break}return console.warn("Unable to aquire video track. Moving to next device."),e.abrupt("return");case 20:if(!ln){e.next=24;break}return e.next=23,Ue.setVideoTrack(o);case 23:o=e.sent;case 24:return e.next=26,hn(r,o);case 26:ct.publishVideo&&(an=!1);case 27:case"end":return e.stop()}}),e,null,[[6,12]])})));return function(t){return e.apply(this,arguments)}}();var In;this.getVideoSource=()=>{const e={},t=!L||0===L.getVideoTracks().length;return e.track=L&&ct.publishVideo&&L.getVideoTracks()[0]||null,e.deviceId=it||st||!dn?null:dn,e.type=st?"custom":it?"screen":t?null:"camera",e},this._={publishToSession:(e,n)=>{n&&(Ne=n),Ge=e,this.session=e;const r=g();N=r,this.streamId=r,ht("Attempt",{dataChannels:ct.channels,properties:A(ct)});const i=new t((e,t)=>{$e?e():(this.once("initSuccess",e),this.once("destroyed",e=>{let n=e.reason,r="";n&&(r=" Reason: "+n),t(new Error("Publisher destroyed before it finished loading."+r))}))});re.debug("publishToSession: waiting for publishComplete, which is triggered by stream#created from rumor");const o=new t((e,t)=>{this.once("publishComplete",n=>{n?t(n):(this._setScalableFramerates(ct.scalableFramerates),this._setScalableVideoLayers(ct.scalableVideoLayers),re.debug("publishToSession: got publishComplete"),e())})}),s=e=>{const t=U(e);throw ht("Failure",{},{failureReason:"Publish",failureCode:t.code,failureMessage:t.message}),Te.isAttemptingToPublish()&&this.trigger("publishComplete",t),se.handleJsException({errorMsg:e.message,code:t.code,target:this,error:e,analytics:Ne}),t};re.debug("publishToSession: waiting for loaded");const a=i.then(()=>e._.getVideoCodecsCompatible(L)).then(n=>{if(re.debug("publishToSession: loaded"),!this.session)return;const r=setTimeout(()=>{kt(e)},ue);this.once("publishComplete",()=>{clearTimeout(r)}),Te.set("PublishingToSession");const i=n&&k&&k.video(),o=L.getVideoTracks().length>0,a=null!==ct.videoSource&&!1!==ct.videoSource;i&&o&&a&&je.push(new pe({id:"video1",type:"video",active:ct.publishVideo,orientation:he.ROTATED_NORMAL,frameRate:ct.frameRate,width:i.videoWidth(),height:i.videoHeight(),e2ee:Ee(),source:it?"screen":st?"custom":"camera",fitMode:ct.fitMode}));const c=L.getAudioTracks().length>0;return null!==ct.audioSource&&!1!==ct.audioSource&&c&&je.push(new pe({id:"audio1",type:"audio",active:ct.publishAudio})),re.debug("publishToSession: creating rumor stream id"),new t((e,t)=>{zt(null,(n,r,i)=>{n?t(s(n)):e({streamId:r,message:i})})})}).then(e=>{if(void 0===e)return;const t=e.streamId,n=e.message;if(re.debug("publishToSession: rumor stream id created:",t,"(this is different from stream#created, which requires media to actually be flowing for mantis sessions)"),t!==r)throw new Error("streamId response does not match request");this.streamId=t,Ce=ce(n)}).catch(e=>{throw this.trigger("publishComplete",e),e});return t.all([a,o])},unpublishFromSession:(e,t)=>{if(!this.session||e.id!==this.session.id){if("unpublished"===t){const t=this.session&&this.session.id||"no session";re.warn(`The publisher ${Qe} is trying to unpublish from a session ${e.id} it is not attached to (it is attached to ${t})`)}return this}if(e.isConnected()&&(this.stream||Te.isAttemptingToPublish())&&e._.streamDestroy(this.streamId),w.releaseAll(),this.disconnect(),Te.isAttemptingToPublish()){ht("Cancel",{reason:"unpublish"});const e=new Error((()=>{switch(t){case"mediaStopped":return"The video element fired the ended event, indicating there is an issue with the media";case"unpublished":return"The publisher was unpublished before it could be published";case"reset":return"The publisher was reset";default:return"The publisher was destroyed due to "+t}})());this.trigger("publishComplete",oe("mediaStopped"===t?q.MEDIA_ENDED:q.CANCEL,e))}return this.session=null,ft("unpublish","Success"),this._.streamDestroyed(t),this},unpublishStreamFromSession:(e,t,n)=>N&&e.id===N?this._.unpublishFromSession(t,n):(re.warn(`The publisher ${Qe} is trying to destroy a stream ${e.id} that is not attached to it (it has ${N||"no stream"} attached to it)`),this),streamDestroyed:e=>{["reset"].indexOf(e)<0&&(Te.isDestroyed()||Te.set("MediaBound"));const t=new $.StreamEvent("streamDestroyed",this.stream,e,!0);this.dispatchEvent(t),t.isDefaultPrevented()||this.destroy()},archivingStatus:e=>(Ft&&Ft.setArchivingStatus(e),e),webRtcStream:()=>L,switchTracks:()=>(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ut().catch(He);case 3:t=e.sent,e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(0),re.error("OT.Publisher.switchTracks failed to getUserMedia: "+e.t0),e.t0;case 10:n=t,Ct(),L=n,r.emit("streamChange"),we=new ie(L,!ct.publishAudio),e.prev=11,xt(),e.next=21;break;case 15:if(e.prev=15,e.t1=e.catch(11),!(e.t1 instanceof E)){e.next=19;break}return e.abrupt("return");case 19:throw re.error("Error while binding video",e.t1),e.t1;case 21:e.prev=21,fn(),e.next=29;break;case 25:throw e.prev=25,e.t2=e.catch(21),re.error("Error replacing tracks",e.t2),e.t2;case 29:case"end":return e.stop()}var n}),e,null,[[0,6],[11,15],[21,25]])})))(),getDataChannel(e,t,n){const r=Gt(Object.keys(qe)[0]);r?r.then(r=>{r.getDataChannel(e,t,n)}):n(new ae.Error("Cannot create a DataChannel before there is a subscriber."))},iceRestart(){Dt().then(e=>{e.forEach(e=>{const t=y(e).remoteConnectionId;mt("Attempt",{remoteConnectionId:t}),re.debug("Publisher: ice restart attempt"),e.iceRestart()})})},getState:()=>Te,demoOnlyCycleVideo:this.cycleVideo,testOnlyGetFramesEncoded:()=>(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Dt();case 2:if((t=e.sent).length){e.next=5;break}throw new Error("No established PeerConnections yet");case 5:return e.abrupt("return",t[0]._testOnlyGetFramesEncoded());case 6:case"end":return e.stop()}}),e)})))(),onStreamAvailable:Ot,startRoutedToRelayedTransition:()=>{bt("Attempt");const e=e=>{const t=U(e);this.trigger("streamCreateForP2PComplete",t),bt("Failure",{reason:t.message})};if(!this.session)return void bt("Failure",{reason:"Not connected to the session."});const t=setTimeout(()=>{bt("Failure",{reason:"Timeout"})},ue);this.once("streamCreateForP2PComplete",()=>{clearTimeout(t)}),re.debug("streamCreateWithSource: send a message to RUMOR for creating the stream with the sourceStreaId P2P and stream "+this.streamId),zt("P2P",t=>{t?e(t):this.trigger("streamCreateForP2PComplete")})},startRelayedToRoutedTransition:(In=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(vt("Attempt"),n.session){e.next=4;break}return vt("Failure",{reason:"Not connected to the session."}),e.abrupt("return");case 4:if(n.streamId){e.next=7;break}return vt("Failure",{reason:"No streamId available"}),e.abrupt("return");case 7:if(Ut()){e.next=10;break}return vt("Failure",{reason:"There is no Relayed Peer connection created."}),e.abrupt("return");case 10:return n.session._.streamDestroy(n.streamId,"P2P"),e.t0=n,e.next=14,Ut();case 14:return e.t1=e.sent,e.t0._removePeerConnection.call(e.t0,e.t1),e.next=18,qt();case 18:vt("Success"),n.trigger("streamDestroyForP2PComplete");case 20:case"end":return e.stop()}}),e)}))),function(){return In.apply(this,arguments)}),forceMuteAudio:function(){ft("publishAudio","Attempt",{publishAudio:!1}),ct.publishAudio=!1;try{on("auto"),this.dispatchEvent(new $.MuteForcedEvent),ft("publishAudio","Success",{publishAudio:!1})}catch(e){ft("publishAudio","Failure",{message:e.message})}}.bind(this)},this.detectDevices=function(){re.warn("Publisher.detectDevices() is not implemented.")},this.detectMicActivity=function(){re.warn("Publisher.detectMicActivity() is not implemented.")},this.getEchoCancellationMode=function(){return re.warn("Publisher.getEchoCancellationMode() is not implemented."),"fullDuplex"},this.setMicrophoneGain=function(){re.warn("Publisher.setMicrophoneGain() is not implemented.")},this.getMicrophoneGain=function(){return re.warn("Publisher.getMicrophoneGain() is not implemented."),.5},this.setCamera=function(){re.warn("Publisher.setCamera() is not implemented.")},this.setMicrophone=function(){re.warn("Publisher.setMicrophone() is not implemented.")},this.guid=function(){return Qe},this.videoElement=function(){const e=k&&k.video();return e?e.domElement():null},this.setStream=e=>{if("PublishingToSession"!==Te.current)throw new Error("assignStream called when publisher is not successfully publishing");w.releaseAll(),this.stream=e,this.stream.on("destroyed",this.disconnect,this),w.add(()=>{this.stream&&this.stream.off("destroyed",this.disconnect,this)}),Te.set("Publishing"),k.loading(!$e),_e=new Date,this.dispatchEvent(new $.StreamEvent("streamCreated",e,null,!1)),ht("Success"),this.trigger("publishComplete",null,this)},this.isWebRTC=!0,this.isLoading=function(){return k&&k.loading()},this.videoWidth=function(){const e=k&&k.video();return e?e.videoWidth():void 0},this.videoHeight=function(){const e=k&&k.video();return e?e.videoHeight():void 0},this.getStats=function(e){(e=>{Jt(e)})((t,n)=>{t?e(t):e(null,n)})},this.getRtcStatsReport=()=>new t((e,t)=>{Jt("rtcStatsReport",(n,r)=>{n?t(n):e(r)})}),Te=new le(e=>{re.error("OT.Publisher State Change Failed: ",e.message),re.debug(e)}),this.accessAllowed=!1,this.applyVideoFilter=function(){var e=(0,o.default)(i.default.mark((function e(t){var r,o,s,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ft("applyVideoFilter","Attempt",{videoFilter:t}),e.prev=1,ye.isSupported()){e.next=5;break}throw oe(q.NOT_SUPPORTED,new Error("Browser does not support video filters (Insertable Streams and Worker APIs are required)"));case 5:if(Ue.isValidVideoFilter(t)){e.next=7;break}throw oe(q.INVALID_PARAMETER,new Error("Video filter has invalid configuration"));case 7:if(L){e.next=12;break}return ft("applyVideoFilter","Failure",{message:r="Ignoring. No mediaStream"}),re.warn(r),e.abrupt("return");case 12:if(!it&&!st){e.next=14;break}throw oe(q.INVALID_PARAMETER,new Error("Video filters can not be applied to screen shares or custom video sources"));case 14:if(!n.getVideoFilter()){e.next=17;break}return e.next=17,n.clearVideoFilter();case 17:if(o=L.getVideoTracks(),s=o[0]){e.next=23;break}return ft("applyVideoFilter","Failure",{message:r="Ignoring. No video"}),re.warn(r),e.abrupt("return");case 23:return e.next=25,Ue.setVideoFilter(t);case 25:return e.next=27,Ue.setMediaStream(L);case 27:if(!(a=e.sent)){e.next=31;break}return e.next=31,hn(s,a);case 31:e.next=38;break;case 33:throw e.prev=33,e.t0=e.catch(1),re.error("Error applying video filter: "+e.t0),ft("applyVideoFilter","Failure",{message:e.t0.message}),e.t0;case 38:ln=t,ft("applyVideoFilter","Success",{videoFilter:t});case 40:case"end":return e.stop()}}),e,null,[[1,33]])})));return function(t){return e.apply(this,arguments)}}(),this.getVideoFilter=()=>{ft("getVideoFilter","Attempt");const e=Ue.getVideoFilter();return ft("getVideoFilter","Success"),e},this.clearVideoFilter=(0,o.default)(i.default.mark((function e(){var t,r,o,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ft("clearVideoFilter","Attempt"),n.getVideoFilter()){e.next=6;break}return ft("clearVideoFilter","Success",{message:t="Ignoring. No video filter applied"}),re.debug(t),e.abrupt("return");case 6:if(ye.isSupported()){e.next=11;break}return ft("clearVideoFilter","Success",{message:t='Ignoring. "clearVideoFilter" not supported.'}),re.warn(t),e.abrupt("return");case 11:if(L){e.next=16;break}return ft("clearVideoFilter","Success",{message:t="Ignoring. No mediaStream"}),re.warn(t),e.abrupt("return");case 16:if(!ln){e.next=26;break}return r=L.getVideoTracks(),o=r[0],e.next=20,mn(dn);case 20:return s=e.sent,e.next=23,hn(o,s);case 23:return e.next=25,un();case 25:ln=null;case 26:case"end":return e.stop()}}),e)})))}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(51).once;e.exports=function(e,t){void 0===t&&(t={});const i=t.hasE2eeCapability||n(158),o=t.hasOpenTokSupport||r;this.publish=-1!==e.indexOf("publish")?1:0,this.subscribe=-1!==e.indexOf("subscribe")?1:0,this.forceUnpublish=-1!==e.indexOf("forceunpublish")?1:0,this.forceDisconnect=-1!==e.indexOf("forcedisconnect")?1:0,this.forceMute=-1!==e.indexOf("forcemute")?1:0,this.supportsE2ee=i()?1:0,this.supportsWebRTC=o()?1:0,this.permittedTo=e=>Object.prototype.hasOwnProperty.call(this,e)&&1===this[e]}},function(e,t,n){"use strict";const r=n(1)("Stream"),i=n(5),o=n(21),s=n(6),a=n(23)(),c=["name","archiving"];e.exports=function(e,t,n,u,d,l){const p=this;let f;this.id=e,this.streamId=e,this.name=t,this.creationTime=Number(n),this.connection=u,this.channel=l,this.publisher=o.publishers.find({streamId:this.id}),s(this);const h=function(e,t,n,r){let i=t;switch(i){case"active":i="audio"===e.type?"hasAudio":"hasVideo",p[i]=r;break;case"disableWarning":if(i="audio"===e.type?"audioDisableWarning":"videoDisableWarning",p[i]=r,!p["audio"===e.type?"hasAudio":"hasVideo"])return;break;case"fitMode":i="defaultFitMode",p[i]=r;break;case"source":i="audio"===e.type?"audioType":"videoType",p[i]=r;break;case"videoDimensions":p.videoDimensions=r;break;case"orientation":case"width":case"height":return}"screen"===p.videoType&&"hasVideo"===i&&!1===r||p.dispatchEvent(new a.StreamUpdatedEvent(p,i,n,r))},m=function(){return p.publisher?p.publisher:o.subscribers.find(e=>e.stream&&e.stream.id===p.id&&e.session.id===d.id)},g=function(){return!p.publisher};this.getChannelsOfType=function(e){return p.channel.filter(t=>t.type===e)},this.getChannel=function(e){for(let t=0;t<p.channel.length;++t)if(p.channel[t].id===e)return p.channel[t];return null};const b=this.getChannelsOfType("audio")[0],v=this.getChannelsOfType("video")[0];this.hasAudio=null!=b&&b.active,this.hasVideo=null!=v&&v.active,this.videoType=v&&v.source,this.defaultFitMode=v&&v.fitMode,this.videoDimensions={},v&&(this.videoDimensions.width=v.width,this.videoDimensions.height=v.height,this.videoDimensions.orientation=v.orientation,v.on("update",h),this.frameRate=v.frameRate),b&&b.on("update",h),this.setChannelActiveState=function(e,t,n){const r={active:t};n&&(r.activeReason=n),y(e,r)},this.setVideoDimensions=function(e,t){y("video",{width:e,height:t,orientation:0})},this.setRestrictFrameRate=function(e){y("video",{restrictFrameRate:e})},this.setPreferredResolution=function(e){if(!g())return void r.warn("setPreferredResolution has no affect when called by a publisher");if(d.sessionInfo.p2pEnabled)return void r.warn("Stream.setPreferredResolution will not work in a P2P Session");if(e&&void 0===e.width&&void 0===e.height)return;const t=p.getChannelsOfType("video")[0];if(t){if(e&&e.width){if(isNaN(parseInt(e.width,10)))throw new i.Error("stream preferred width must be an integer","Subscriber");t.preferredWidth=parseInt(e.width,10)}else t.preferredWidth=void 0;if(e&&e.height){if(isNaN(parseInt(e.height,10)))throw new i.Error("stream preferred height must be an integer","Subscriber");t.preferredHeight=parseInt(e.height,10)}else t.preferredHeight=void 0;d._.subscriberChannelUpdate(p,m(),t,{preferredWidth:t.preferredWidth||0,preferredHeight:t.preferredHeight||0})}},this.getPreferredResolution=function(){const e=p.getChannelsOfType("video")[0];if(e&&(e.preferredWidth||e.preferredHeight))return{width:e.preferredWidth,height:e.preferredHeight}},this.setPreferredFrameRate=function(e){if(!g())return void r.warn("setPreferredFrameRate has no affect when called by a publisher");if(d.sessionInfo.p2pEnabled)return void r.warn("Stream.setPreferredFrameRate will not work in a P2P Session");if(e&&isNaN(parseFloat(e)))throw new i.Error("stream preferred frameRate must be a number","Subscriber");const t=p.getChannelsOfType("video")[0];t&&(t.preferredFrameRate=e?parseFloat(e):null,d._.subscriberChannelUpdate(p,m(),t,{preferredFrameRate:t.preferredFrameRate||0}))},this.getPreferredFrameRate=function(){const e=p.getChannelsOfType("video")[0];return e?e.preferredFrameRate:null};let y=function(e,t){let n;if(p.publisher)n=e=>d._.streamChannelUpdate(p,e,t);else{const e=m();n=n=>d._.subscriberChannelUpdate(p,e,n,t)}p.getChannelsOfType(e).forEach(n)};this.destroyed=!1,this.destroyedReason=void 0,this.destroy=function(e,t){void 0===e&&(e="clientDisconnected"),f=e,p.destroyed=!0,p.destroyedReason=f,!0!==t&&p.dispatchEvent(new a.DestroyedEvent("destroyed",p,f))},this._={},this._.updateProperty=function(e,t){if(-1===c.indexOf(e))return void r.warn(`Unknown stream property "${e}" was modified to "${t}".`);const n=p[e],i=t;switch(e){case"name":p[e]=i;break;case"archiving":var o=m();p.publisher&&o&&o._.archivingStatus(i),p[e]=i}const s=new a.StreamUpdatedEvent(p,e,n,i);p.dispatchEvent(s)},this._.update=function(e){for(const t in e)e.hasOwnProperty(t)&&p._.updateProperty(t,e[t])},this._.forceMute=function(e){e.hasOwnProperty("channels")&&e.channels.includes("audio")&&p.publisher&&p.publisher._.forceMuteAudio()},this._.updateChannel=function(e,t){const n=p.getChannel(e);n&&n.update(t)}}},function(e,t,n){"use strict";t.__esModule=!0,t.STATUS=t.PONG=t.PING=t.DISCONNECT=t.CONNECT=t.MESSAGE=t.UNSUBSCRIBE=t.SUBSCRIBE=void 0;t.SUBSCRIBE=0;t.UNSUBSCRIBE=1;t.MESSAGE=2;t.CONNECT=3;t.DISCONNECT=4;t.PING=7;t.PONG=8;t.STATUS=9},function(e,t,n){"use strict";const r=n(9),i=n(173),o=n(6),s=n(23)(),a=n(732);function c(e,t,n,r,c){let u;this.id=e,this.connectionId=e,this.creationTime=t?Number(t):null,this.data=n,this.capabilities=a(r),this.permissions=new i(c),this.quality=null,o(this),this.destroy=(e,t)=>{u=e||"clientDisconnected",!0!==t&&this.dispatchEvent(new s.DestroyedEvent("destroyed",this,u))},this.destroyed=()=>void 0!==u,this.destroyedReason=()=>u}c.fromHash=e=>{let t=e.id,n=e.creationTime,i=e.data,o=e.capablities,s=e.permissions;return new c(t,n,i,r(o||{},{supportsWebRTC:!0}),s||[])},e.exports=c},function(e,t){var n="object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global).Object===Object&&(void 0!==typeof window?window:global);e.exports=n},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(38),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t,n){var r=n(40),i=n(30);e.exports=function(e,t){return e&&r(t,i(t),e)}},function(e,t,n){var r=n(374),i=n(65),o=n(12),s=n(66),a=n(67),c=n(85),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),d=!n&&i(e),l=!n&&!d&&s(e),p=!n&&!d&&!l&&c(e),f=n||d||l||p,h=f?r(e.length,String):[],m=h.length;for(var g in e)!t&&!u.call(e,g)||f&&("length"==g||l&&("offset"==g||"parent"==g)||p&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,m))||h.push(g);return h}},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){(function(e){var r=n(14),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=o&&o.exports===i?r.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}).call(this,n(84)(e))},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(117),i=n(118),o=n(116),s=n(184),a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:s;e.exports=a},function(e,t,n){var r=n(187),i=n(116),o=n(30);e.exports=function(e){return r(e,o,i)}},function(e,t,n){var r=n(117),i=n(12);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},function(e,t,n){var r=n(187),i=n(185),o=n(54);e.exports=function(e){return r(e,o,i)}},function(e,t,n){var r=n(38)(n(14),"Set");e.exports=r},function(e,t,n){var r=n(38)(n(14),"WeakMap");e.exports=r},function(e,t,n){var r=n(14).Uint8Array;e.exports=r},function(e,t,n){var r=n(119);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},function(e,t,n){var r=n(86),i=n(118),o=n(69);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},function(e,t,n){var r=n(111);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},function(e,t,n){var r=n(87),i=n(123);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(o--,s):void 0,a&&i(n[0],n[1],a)&&(s=o<3?void 0:s,o=1),t=Object(t);++r<o;){var c=n[r];c&&e(t,c,r,s)}return t}))}},function(e,t,n){var r=n(121),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,s=-1,a=i(o.length-t,0),c=Array(a);++s<a;)c[s]=o[t+s];s=-1;for(var u=Array(t+1);++s<t;)u[s]=o[s];return u[t]=n(c),r(e,this,u)}}},function(e,t){var n=Date.now;e.exports=function(e){var t=0,r=0;return function(){var i=n(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){"use strict";e.exports=n(402)()?WeakMap:n(403)},function(e,t,n){"use strict";var r=Object.create,i=Object.getPrototypeOf,o={};e.exports=function(){var e=Object.setPrototypeOf,t=arguments[0]||r;return"function"==typeof e&&i(e(t(null),o))===o}},function(e,t,n){"use strict";var r,i=n(201),o=n(31),s=Object.prototype.isPrototypeOf,a=Object.defineProperty,c={configurable:!0,enumerable:!1,writable:!0,value:void 0};r=function(e,t){if(o(e),null===t||i(t))return e;throw new TypeError("Prototype must be null or an object")},e.exports=function(e){var t,n;return e?(2===e.level?e.set?(n=e.set,t=function(e,t){return n.call(r(e,t),t),e}):t=function(e,t){return r(e,t).__proto__=t,e}:t=function e(t,n){var i;return r(t,n),(i=s.call(e.nullPolyfill,t))&&delete e.nullPolyfill.__proto__,null===n&&(n=e.nullPolyfill),t.__proto__=n,i&&a(e.nullPolyfill,"__proto__",c),t},Object.defineProperty(t,"level",{configurable:!1,enumerable:!1,writable:!1,value:e.level})):null}(function(){var e,t=Object.create(null),n={},r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(r){try{(e=r.set).call(t,n)}catch(e){}if(Object.getPrototypeOf(t)===n)return{set:e,level:2}}return t.__proto__=n,Object.getPrototypeOf(t)===n?{level:2}:((t={}).__proto__=n,Object.getPrototypeOf(t)===n&&{level:1})}()),n(405)},function(e,t,n){"use strict";var r=n(44),i={function:!0,object:!0};e.exports=function(e){return r(e)&&i[typeof e]||!1}},function(e,t,n){"use strict";var r=n(408),i=/^\s*class[\s{/}]/,o=Function.prototype.toString;e.exports=function(e){return!!r(e)&&!i.test(o.call(e))}},function(e,t,n){"use strict";var r=n(44),i=Array.prototype.forEach,o=Object.create,s=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=o(null);return i.call(arguments,(function(e){r(e)&&s(Object(e),t)})),t}},function(e,t,n){"use strict";e.exports=n(415)()?String.prototype.contains:n(416)},function(e,t,n){"use strict";var r=n(89),i=n(90),o=n(417),s=n(446),a=n(447),c=n(45).iterator;e.exports=function(e){return"function"==typeof a(e)[c]?e[c]():r(e)?new o(e):i(e)?new s(e):new o(e)}},function(e,t,n){"use strict";var r=n(422);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}},function(e,t,n){"use strict";var r,i=n(426),o=n(126),s=n(70),a=n(31),c=n(32),u=n(427),d=n(45),l=Object.defineProperty,p=Object.defineProperties;e.exports=r=function(e,t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");p(this,{__list__:c("w",a(e)),__context__:c("w",t),__nextIndex__:c("w",0)}),t&&(s(t.on),t.on("_add",this._onAdd),t.on("_delete",this._onDelete),t.on("_clear",this._onClear))},delete r.prototype.constructor,p(r.prototype,o({_next:c((function(){var e;if(this.__list__)return this.__redo__&&void 0!==(e=this.__redo__.shift())?e:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()})),next:c((function(){return this._createResult(this._next())})),_createResult:c((function(e){return void 0===e?{done:!0,value:void 0}:{done:!1,value:this._resolve(e)}})),_resolve:c((function(e){return this.__list__[e]})),_unBind:c((function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)})),toString:c((function(){return"[object "+(this[d.toStringTag]||"Object")+"]"}))},u({_onAdd:c((function(e){e>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(t,n){t>=e&&(this.__redo__[n]=++t)}),this),this.__redo__.push(e)):l(this,"__redo__",c("c",[e])))})),_onDelete:c((function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(e))&&this.__redo__.splice(t,1),this.__redo__.forEach((function(t,n){t>e&&(this.__redo__[n]=--t)}),this)))})),_onClear:c((function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0}))}))),l(r.prototype,d.iterator,c((function(){return this})))},function(e,t,n){"use strict";var r=n(56),i=n(125),o=n(429),s=n(430),a=function(e,t){return e.replace("%v",s(t))};e.exports=function(e,t,n){if(!i(n))throw new TypeError(a(t,e));if(!r(e)){if("default"in n)return n.default;if(n.isOptional)return null}var s=o(n.errorMessage);throw r(s)||(s=t),new TypeError(a(s,e))}},function(e,t){e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},function(e,t,n){e.exports=n(458)},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(17);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var o;if(n)o=n(t);else if(r.isURLSearchParams(t))o=t.toString();else{var s=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";(function(t){var r=n(17),i=n(463),o={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,c={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(a=n(215)),a),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(o)})),e.exports=c}).call(this,n(43))},function(e,t,n){"use strict";(function(t){var r=n(17),i=n(464),o=n(466),s=n(212),a=n(467),c=n(470),u=n(471),d=n(216);e.exports=function(e){return new t((function(t,n){var l=e.data,p=e.headers;r.isFormData(l)&&delete p["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";p.Authorization="Basic "+btoa(h+":"+m)}var g=a(e.baseURL,e.url);if(f.open(e.method.toUpperCase(),s(g,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,f.onreadystatechange=function(){if(f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in f?c(f.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:r,config:e,request:f};i(t,n,o),f=null}},f.onabort=function(){f&&(n(d("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){n(d("Network Error",e,null,f)),f=null},f.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(d(t,e,"ECONNABORTED",f)),f=null},r.isStandardBrowserEnv()){var b=(e.withCredentials||u(g))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;b&&(p[e.xsrfHeaderName]=b)}if("setRequestHeader"in f&&r.forEach(p,(function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete p[t]:f.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),e.responseType)try{f.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){f&&(f.abort(),n(e),f=null)})),l||(l=null),f.send(l)}))}}).call(this,n(0))},function(e,t,n){"use strict";var r=n(465);e.exports=function(e,t,n,i,o){var s=new Error(e);return r(s,t,n,i,o)}},function(e,t,n){"use strict";var r=n(17);e.exports=function(e,t){t=t||{};var n={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function u(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=c(void 0,e[i])):n[i]=c(e[i],t[i])}r.forEach(i,(function(e){r.isUndefined(t[e])||(n[e]=c(void 0,t[e]))})),r.forEach(o,u),r.forEach(s,(function(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=c(void 0,e[i])):n[i]=c(void 0,t[i])})),r.forEach(a,(function(r){r in t?n[r]=c(e[r],t[r]):r in e&&(n[r]=c(void 0,e[r]))}));var d=i.concat(o).concat(s).concat(a),l=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===d.indexOf(e)}));return r.forEach(l,u),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){var r=n(476),i=n(478);e.exports=function(e,t,n){return r(i,e,t,n)}},function(e,t,n){var r=n(88),i=n(221),o=i?function(e,t){return i.set(e,t),e}:r;e.exports=o},function(e,t,n){var r=n(190),i=r&&new r;e.exports=i},function(e,t,n){var r=n(223),i=n(224),o=n(482),s=n(95),a=n(225),c=n(231),u=n(491),d=n(135),l=n(14);e.exports=function e(t,n,p,f,h,m,g,b,v,y){var E=128&n,S=1&n,_=2&n,w=24&n,T=512&n,C=_?void 0:s(t);return function I(){for(var R=arguments.length,x=Array(R),O=R;O--;)x[O]=arguments[O];if(w)var k=c(I),N=o(x,k);if(f&&(x=r(x,f,h,w)),m&&(x=i(x,m,g,w)),R-=N,w&&R<y){var Z=d(x,k);return a(t,n,e,I.placeholder,p,x,Z,b,v,y-R)}var A=S?p:this,L=_?A[t]:t;return R=x.length,b?x=u(x,b):T&&R>1&&x.reverse(),E&&v<R&&(x.length=v),this&&this!==l&&this instanceof I&&(L=C||s(L)),L.apply(A,x)}}},function(e,t){var n=Math.max;e.exports=function(e,t,r,i){for(var o=-1,s=e.length,a=r.length,c=-1,u=t.length,d=n(s-a,0),l=Array(u+d),p=!i;++c<u;)l[c]=t[c];for(;++o<a;)(p||o<s)&&(l[r[o]]=e[o]);for(;d--;)l[c++]=e[o++];return l}},function(e,t){var n=Math.max;e.exports=function(e,t,r,i){for(var o=-1,s=e.length,a=-1,c=r.length,u=-1,d=t.length,l=n(s-c,0),p=Array(l+d),f=!i;++o<l;)p[o]=e[o];for(var h=o;++u<d;)p[h+u]=t[u];for(;++a<c;)(f||o<s)&&(p[h+r[a]]=e[o++]);return p}},function(e,t,n){var r=n(483),i=n(229),o=n(230);e.exports=function(e,t,n,s,a,c,u,d,l,p){var f=8&t;t|=f?32:64,4&(t&=~(f?64:32))||(t&=-4);var h=[e,t,a,f?c:void 0,f?u:void 0,f?void 0:c,f?void 0:u,d,l,p],m=n.apply(void 0,h);return r(e)&&i(m,h),m.placeholder=s,o(m,e,t)}},function(e,t,n){var r=n(221),i=n(227),o=r?function(e){return r.get(e)}:i;e.exports=o},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(86),i=n(134);function o(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}o.prototype=r(i.prototype),o.prototype.constructor=o,e.exports=o},function(e,t,n){var r=n(220),i=n(197)(r);e.exports=i},function(e,t,n){var r=n(488),i=n(489),o=n(122),s=n(490);e.exports=function(e,t,n){var a=t+"";return o(e,i(a,s(r(a),n)))}},function(e,t){e.exports=function(e){return e.placeholder}},function(e,t,n){var r=n(495),i=n(11),o=n(71),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):s.test(e)?NaN:+e}},function(e,t,n){var r=n(503),i=n(16);e.exports=function e(t,n,o,s,a){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,s,e,a))}},function(e,t,n){var r=n(92),i=n(235),o=n(94);e.exports=function(e,t,n,s,a,c){var u=1&n,d=e.length,l=t.length;if(d!=l&&!(u&&l>d))return!1;var p=c.get(e),f=c.get(t);if(p&&f)return p==t&&f==e;var h=-1,m=!0,g=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++h<d;){var b=e[h],v=t[h];if(s)var y=u?s(v,b,h,t,e,c):s(b,v,h,e,t,c);if(void 0!==y){if(y)continue;m=!1;break}if(g){if(!i(t,(function(e,t){if(!o(g,t)&&(b===e||a(b,e,n,s,c)))return g.push(t)}))){m=!1;break}}else if(b!==v&&!a(b,v,n,s,c)){m=!1;break}}return c.delete(e),c.delete(t),m}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},function(e,t,n){var r=n(11);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},function(e,t,n){var r=n(508),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=s},function(e,t,n){var r=n(510),i=n(511);e.exports=function(e,t){return null!=e&&i(e,t,r)}},function(e,t,n){var r=n(117),i=n(517);e.exports=function e(t,n,o,s,a){var c=-1,u=t.length;for(o||(o=i),a||(a=[]);++c<u;){var d=t[c];n>0&&o(d)?n>1?e(d,n-1,o,s,a):r(a,d):s||(a[a.length]=d)}return a}},function(e,t,n){var r=n(524)();e.exports=r},function(e,t,n){"use strict";var r=n(525),i=n(526);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=y,t.resolve=function(e,t){return y(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?y(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=y(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),d=["'"].concat(u),l=["%","/","?",";","#"].concat(d),p=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=n(527);function y(e,t,n){if(e&&i.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o<e.indexOf("#")?"?":"#",u=e.split(a);u[0]=u[0].replace(/\\/g,"/");var y=e=u.join(a);if(y=y.trim(),!n&&1===e.split("#").length){var E=c.exec(y);if(E)return this.path=y,this.href=y,this.pathname=E[1],E[2]?(this.search=E[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var S=s.exec(y);if(S){var _=(S=S[0]).toLowerCase();this.protocol=_,y=y.substr(S.length)}if(n||S||y.match(/^\/\/[^@\/]+@[^@\/]+/)){var w="//"===y.substr(0,2);!w||S&&g[S]||(y=y.substr(2),this.slashes=!0)}if(!g[S]&&(w||S&&!b[S])){for(var T,C,I=-1,R=0;R<p.length;R++){-1!==(x=y.indexOf(p[R]))&&(-1===I||x<I)&&(I=x)}-1!==(C=-1===I?y.lastIndexOf("@"):y.lastIndexOf("@",I))&&(T=y.slice(0,C),y=y.slice(C+1),this.auth=decodeURIComponent(T)),I=-1;for(R=0;R<l.length;R++){var x;-1!==(x=y.indexOf(l[R]))&&(-1===I||x<I)&&(I=x)}-1===I&&(I=y.length),this.host=y.slice(0,I),y=y.slice(I),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var k=this.hostname.split(/\./),N=(R=0,k.length);R<N;R++){var Z=k[R];if(Z&&!Z.match(f)){for(var A="",L=0,V=Z.length;L<V;L++)Z.charCodeAt(L)>127?A+="x":A+=Z[L];if(!A.match(f)){var P=k.slice(0,R),M=k.slice(R+1),D=Z.match(h);D&&(P.push(D[1]),M.unshift(D[2])),M.length&&(y="/"+M.join(".")+y),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=r.toASCII(this.hostname));var W=this.port?":"+this.port:"",G=this.hostname||"";this.host=G+W,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!m[_])for(R=0,N=d.length;R<N;R++){var X=d[R];if(-1!==y.indexOf(X)){var j=encodeURIComponent(X);j===X&&(j=escape(X)),y=y.split(X).join(j)}}var U=y.indexOf("#");-1!==U&&(this.hash=y.substr(U),y=y.slice(0,U));var F=y.indexOf("?");if(-1!==F?(this.search=y.substr(F),this.query=y.substr(F+1),t&&(this.query=v.parse(this.query)),y=y.slice(0,F)):t&&(this.search="",this.query={}),y&&(this.pathname=y),b[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){W=this.pathname||"";var Y=this.search||"";this.path=W+Y}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,s="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(s=v.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||b[t])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+o+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+r},o.prototype.resolve=function(e){return this.resolveObject(y(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var n=new o,r=Object.keys(this),s=0;s<r.length;s++){var a=r[s];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),u=0;u<c.length;u++){var d=c[u];"protocol"!==d&&(n[d]=e[d])}return b[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!b[e.protocol]){for(var l=Object.keys(e),p=0;p<l.length;p++){var f=l[p];n[f]=e[f]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||g[e.protocol])n.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),n.pathname=h.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var m=n.pathname||"",v=n.search||"";n.path=m+v}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var y=n.pathname&&"/"===n.pathname.charAt(0),E=e.host||e.pathname&&"/"===e.pathname.charAt(0),S=E||y||n.host&&e.pathname,_=S,w=n.pathname&&n.pathname.split("/")||[],T=(h=e.pathname&&e.pathname.split("/")||[],n.protocol&&!b[n.protocol]);if(T&&(n.hostname="",n.port=null,n.host&&(""===w[0]?w[0]=n.host:w.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),S=S&&(""===h[0]||""===w[0])),E)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,w=h;else if(h.length)w||(w=[]),w.pop(),w=w.concat(h),n.search=e.search,n.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(T)n.hostname=n.host=w.shift(),(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift());return n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=w.slice(-1)[0],I=(n.host||e.host||w.length>1)&&("."===C||".."===C)||""===C,R=0,x=w.length;x>=0;x--)"."===(C=w[x])?w.splice(x,1):".."===C?(w.splice(x,1),R++):R&&(w.splice(x,1),R--);if(!S&&!_)for(;R--;R)w.unshift("..");!S||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),I&&"/"!==w.join("/").substr(-1)&&w.push("");var O,k=""===w[0]||w[0]&&"/"===w[0].charAt(0);T&&(n.hostname=n.host=k?"":w.length?w.shift():"",(O=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=O.shift(),n.host=n.hostname=O.shift()));return(S=S||n.host&&w.length)&&!k&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){"use strict";(function(t){const r=n(15),i=n(19),o=n(1)("guidStorage"),s={};let a,c;e.exports=s;s.override=e=>{if(function(e){return!(r(e.get)&&r(e.set))}(e))throw new Error("The storageInterface argument does not seem to be valid, it must implement get and set methods");a!==e&&(a=e,c&&a.set(c,e=>{e&&o.error(`Failed to send initial Guid value (${c}) to the newly assigned Guid Storage. The error was: ${e}`)}))},s.get=e=>{!function(e){c?e(null,c):a.get(e)}((t,n)=>{t?e(t):(n?c||(c=n):(n=i(),a.set(n,t=>{t?e(t):c=n})),e(null,c))})},s.getAsync=()=>new t((e,t)=>{s.get((n,r)=>n?t(n):e(r))}),s.override({get(e){let t;try{t=(void 0!==typeof window?window:global).localStorage.getItem("opentok_client_id")}catch(e){t||(t=i())}e(null,t)},set(e,t){try{(void 0!==typeof window?window:global).localStorage.setItem("opentok_client_id",e)}catch(e){}t(null)}}),s.set=e=>{c=e}}).call(this,n(0))},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var i=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},function(e,t,n){"use strict";const r=n(248),i=n(3),o=n(250),s=n(9),a={};e.exports=a,"Node"!==i.name&&(a.request=function(e,t,n){const i=new(void 0!==typeof window?window:global).XMLHttpRequest,o=t||{};if(o.method){t.overrideMimeType&&(i.overrideMimeType&&i.overrideMimeType(t.overrideMimeType),delete t.overrideMimeType),n&&(r(i).on("load",e=>{const t=e.target.status;t>=200&&(t<300||304===t)?n(null,e):n(e)}),r(i).on("error",n)),i.open(t.method,e,!0),o.headers||(o.headers={});for(const e in o.headers)Object.prototype.hasOwnProperty.call(o.headers,e)&&i.setRequestHeader(e,o.headers[e]);i.send(t.body&&function(e){if("string"==typeof e)return e;const t=[];return Object.keys(e).forEach(n=>{t.push(`${encodeURIComponent(n)}=${encodeURIComponent(e[n])}`)}),t.join("&").replace(/\+/g,"%20")}(t.body))}else n(new Error("No HTTP method specified in options"))},a.get=function(e,t,n){const r=s(t||{},{method:"GET"});a.request(e,r,n)},a.post=function(e,t,n){const r=s(t||{},{method:"POST"});a.request(e,r,n)},a.getJSON=function(e,t,n){const r=s({Accept:"application/json"},(t=t||{}).headers||{});a.get(e,s(t||{},{headers:r}),(function(e,t){if(e)n(e,t&&t.target&&t.target.responseText);else{let e;try{e=JSON.parse(t.target.responseText)}catch(e){return void n(e,t&&t.target&&t.target.responseText)}n(null,e,t)}}))},o(a))},function(e,t,n){"use strict";const r=n(249);e.exports=function(e,t){return new r(e,t)}},function(e,t,n){"use strict";const r=n(15),i={attributes:n(536),css:n(537),classNames:n(542),observers:n(544)},o=/^#([\w-]*)$/,s=function(e){return Array.prototype.slice.call(e)},a=function(e,t){const n=function(e,t){let n;if(void 0===e)return[];if("string"==typeof e){n=[];const r=o.exec(e);if(t=t||document,r&&r[1]){const e=t.getElementById(r[1]);e&&n.push(e)}else n=t.querySelectorAll(e)}else e&&(e.nodeType||(void 0!==typeof window?window:global).XMLHttpRequest&&e instanceof(void 0!==typeof window?window:global).XMLHttpRequest||e===(void 0!==typeof window?window:global))?(n=[e],t=e):Array.isArray(e)?(n=e.slice(),t=null):n=s(n);return n}(e,t);this.context=t,this.toArray=function(){return n},this.length=n.length,this.first=n[0],this.last=n[n.length-1],this.get=function(e){return void 0===e?n:n[e]}};e.exports=a,(a._attachToOTHelpers={}).removeElement=function(e){return new a(e).remove()},a.prototype.getAsArray=function(){let e=this.get();return r(e.forEach)||(e=s(e)),e},a.prototype.some=function(e,t){return this.getAsArray().some(e,t)},a.prototype.forEach=function(e,t){return this.getAsArray().forEach(e,t),this},a.prototype.map=function(e,t){return new a(this.getAsArray().map(e,t),this.context)},a.prototype.filter=function(e,t){return new a(this.getAsArray().filter(e,t),this.context)},a.prototype.find=function(e){return new a(e,this.first)},a.prototype.on=function(e,t){return this.forEach(n=>{n.addEventListener(e,t,!1)})},a.prototype.off=function(e,t){return this.forEach(n=>{n.removeEventListener(e,t,!1)})},a.prototype.once=function(e,t){const n=function(){this.off(e,n),t(...arguments)}.bind(this);return this.on(e,n)},a.prototype.appendTo=function(e){if(!e)throw new Error("appendTo requires a DOMElement to append to.");return this.forEach(t=>{e.appendChild(t)})},a.prototype.append=function(){const e=this.first;return e?(Array.prototype.forEach.call(arguments,t=>{e.appendChild(t)}),this):this},a.prototype.prepend=function(){if(0===arguments.length)return this;const e=this.first;let t;return e?(t=Array.prototype.slice.call(arguments),e.firstElementChild||e.appendChild(t.shift()),t.forEach(t=>{e.insertBefore(t,e.firstElementChild)}),this):this},a.prototype.after=function(e){if(!e)throw new Error("after requires a DOMElement to insert after");return this.forEach(t=>{t.parentElement&&(e!==t.parentNode.lastChild?t.parentElement.insertBefore(t,e):t.parentElement.appendChild(t))})},a.prototype.before=function(e){if(!e)throw new Error("before requires a DOMElement to insert before");return this.forEach(t=>{t.parentElement&&t.parentElement.insertBefore(t,e)})},a.prototype.remove=function(){return this.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)})},a.prototype.empty=function(){return this.forEach(e=>{for(;e.firstChild;)e.removeChild(e.firstChild)})},a.prototype.isDisplayNone=function(){return this.some(e=>(0===e.offsetWidth||0===e.offsetHeight)&&"none"===new a(e).css("display")||!(!e.parentNode||!e.parentNode.style)&&new a(e.parentNode).isDisplayNone())};const c=function e(t){return 0!==t.offsetWidth&&0!==t.offsetHeight||"none"!==new a(t).css("display")?t.parentNode&&t.parentNode.style?e(t.parentNode):null:t};a._attachToOTHelpers.emptyElement=function(e){return new a(e).empty()},a._attachToOTHelpers._findElementWithDisplayNone=c,i.css(a,c),i.attributes(a),i.classNames(a),i.observers(a),["on","off","isDisplayNone","show","hide","css","makeVisibleAndYield","addClass","removeClass"].forEach(e=>{a._attachToOTHelpers[e]=function(){const t=Array.prototype.slice.apply(arguments),n=t.shift(),r=new a(n);return a.prototype[e].apply(r,t)}})},function(e,t,n){"use strict";e.exports=function(e){const t={};Object.keys(e).forEach(n=>{t[n]=e[n]}),e._attachToOTHelpers=t}},function(e,t,n){"use strict";const r=n(15),i=n(6),o=n(1)("Collection");e.exports=function(e){let t=[],n={};const s=e||"id";i(this);const a=function(e,t){return r(e[t])?e[t]():e[t]},c=function(e){this.trigger("update",e),this.trigger("update:"+e.target.id,e)}.bind(this),u=function(e){this.remove(e.target,e.reason)}.bind(this);this.reset=function(){t.forEach((function(e){e.off("updated",c,this),e.off("destroyed",u,this)}),this),t=[],n={}},this.destroy=function(e){t.forEach(t=>{t&&"function"==typeof t.destroy&&t.destroy(e,!0)}),this.reset(),this.off()},this.get=function(e){return e&&void 0!==n[e]?t[n[e]]:void 0},this.has=function(e){return e&&void 0!==n[e]},this.toString=function(){return t.toString()},this.where=function(e,n){return r(e)?t.filter(e,n):t.filter(t=>{for(const n in e)if(e.hasOwnProperty(n)&&a(t,n)!==e[n])return!1;return!0})},this.find=function(e,n){let i;i=r(e)?e:function(t){for(const n in e)if(e.hasOwnProperty(n)&&a(t,n)!==e[n])return!1;return!0},i=i.bind(n);for(let e=0;e<t.length;++e)if(!0===i(t[e]))return t[e];return null},this.forEach=function(e,n){return t.forEach(e,n),this},this.map=function(e){return t.map(e)},this.add=function(e){const r=a(e,s);return this.has(r)?(o.warn(`Model ${r} is already in the collection`,t),this):(n[r]=t.push(e)-1,e.on("updated",c,this),e.on("destroyed",u,this),this.trigger("add",e),this.trigger("add:"+r,e),this)},this.remove=function(e,r){const i=a(e,s);t.splice(n[i],1);for(let e=n[i];e<t.length;++e)n[a(t[e],s)]=e;return delete n[i],e.off("updated",c,this),e.off("destroyed",u,this),this.trigger("remove",e,r),this.trigger("remove:"+i,e,r),this},this._triggerAddEvents=function(){this.where.apply(this,arguments).forEach((function(e){this.trigger("add",e),this.trigger("add:"+a(e,s),e)}),this)},this.length=function(){return t.length}}},function(e,t,n){"use strict";const r=n(1)("deprecation");e.exports=function(e,t,n){let i=void 0===n?{}:n,o=i.value,s=i.name,a=void 0===s?""+t:s,c=i.getWarning,u=void 0===c?"":c,d=i.setWarning,l=void 0===d?"":d,p=i.canSet,f=void 0!==p&&p,h=i.warnOnSet,m=o,g=!1,b=!(void 0!==h&&h);const v={get:()=>(g||(g=!0,r.warn(`${a} is deprecated, and will be removed in the future. ${u}`.trim())),m),set(e){f&&(m=e),b||(b=!0,f?r.warn(`${a} is deprecated. ${l}`.trim()):r.warn(`${a} is deprecated, and will be removed in the future. ${l}`.trim()))}};Object.defineProperty(e,t,v)}},function(e,t,n){"use strict";const r=n(3),i=n(11);let o;const s=["description","fileName","lineNumber","message","name","number","stack"],a=function(e,t,n){switch(arguments.length){case 1:i(e)&&(n=e,t=void 0,e=void 0);break;case 2:i(t)&&(n=t,t=void 0)}if(n instanceof Error)for(let e=0,t=s.length;e<t;++e)this[s[e]]=n[s[e]];else if(i(n))for(const e in n)n.hasOwnProperty(e)&&(this[e]=n[e]);if(!(this.fileName&&this.lineNumber&&this.columnNumber&&this.stack)){const e=o();!this.fileName&&e.fileName&&(this.fileName=e.fileName),!this.lineNumber&&e.lineNumber&&(this.lineNumber=e.lineNumber),!this.columnNumber&&e.columnNumber&&(this.columnNumber=e.columnNumber),!this.stack&&e.stack&&(this.stack=e.stack)}!this.message&&e&&(this.message=e),this.name&&"Error"!==this.name||!t||(this.name=t)};e.exports=a,(a.prototype=Object.create(Error.prototype)).toString=function(){let e="";return this.fileName&&(e+=" "+this.fileName),this.lineNumber&&(e+=" "+this.lineNumber,this.columnNumber&&(e+=":"+this.columnNumber)),`<${this.name?this.name+" ":""}${this.message}${e}>`},a.prototype.valueOf=a.prototype.toString;const c=function(e,t){return t.slice(2).map(e=>{const t={fileName:e.getFileName(),linenumber:e.getLineNumber(),columnNumber:e.getColumnNumber()};return e.getFunctionName()&&(t.functionName=e.getFunctionName()),e.getMethodName()&&(t.methodName=e.getMethodName()),e.getThis()&&(t.self=e.getThis()),t})};o=function(){const e={};let t,n,i;switch(r.name){case"Firefox":case"Safari":try{(void 0!==typeof window?window:global).call.js.is.explody()}catch(e){i=e}t=(i.stack||"").split("\n"),t.shift(),t.shift(),e.stack=t,n=/@(.+?):([0-9]+)(:([0-9]+))?$/.exec(t[0]),n&&(e.fileName=n[1],e.lineNumber=parseInt(n[2],10),n.length>3&&(e.columnNumber=parseInt(n[4],10)));break;case"Chrome":case"Node":case"Opera":var o=Error.prepareStackTrace;Error.prepareStackTrace=c,i=new Error,e.stack=i.stack,Error.prepareStackTrace=o;var s=e.stack[0];e.lineNumber=s.lineNumber,e.columnNumber=s.columnNumber,e.fileName=s.fileName,s.functionName&&(e.functionName=s.functionName),s.methodName&&(e.methodName=s.methodName),s.self&&(e.self=s.self);break;default:i=new Error,i.stack&&(e.stack=i.stack.split("\n"))}return i.message&&(e.message=i.message),e}},function(e,t,n){"use strict";var r={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},r.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:n[t[r]]=t[r+1]}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var n=e.type;return t.push("typ"),t.push(n),"host"!==n&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},r.parseIceOptions=function(e){return e.substr(14).split(" ")},r.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},r.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)n[(t=r[i].trim().split("="))[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},r.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},r.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},r.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},r.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?r.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},r.getCryptoParameters=function(e,t){return r.matchPrefix(e+t,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(e,t){var n=r.matchPrefix(e+t,"a=ice-ufrag:")[0],i=r.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substr(12),password:i.substr(10)}:null},r.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},r.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" "),i=3;i<n.length;i++){var o=n[i],s=r.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(s){var a=r.parseRtpMap(s),c=r.matchPrefix(e,"a=fmtp:"+o+" ");switch(a.parameters=c.length?r.parseFmtp(c[0]):{},a.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(r.parseRtcpFb),t.codecs.push(a),a.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(a.name.toUpperCase())}}}return r.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(r.parseExtmap(e))})),t},r.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}));var i=0;return t.codecs.forEach((function(e){e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),n+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=r.writeExtmap(e)})),n},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),o=-1!==i.fecMechanisms.indexOf("RED"),s=-1!==i.fecMechanisms.indexOf("ULPFEC"),a=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=a.length>0&&a[0].ssrc,u=r.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));u.length>0&&u[0].length>1&&u[0][0]===c&&(t=u[0][1]),i.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(r.rtx={ssrc:t}),n.push(r),o&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:c,mechanism:s?"red+ulpfec":"red"},n.push(r))}})),0===n.length&&c&&n.push({ssrc:c});var d=r.matchPrefix(e,"b=");return d.length&&(d=0===d[0].indexOf("b=TIAS:")?parseInt(d[0].substr(7),10):0===d[0].indexOf("b=AS:")?1e3*parseInt(d[0].substr(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=d}))),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var i=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var o=r.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var i=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return i.length>0?{stream:(t=i[0].value.split(" "))[0],track:t[1]}:void 0},r.parseSctpDescription=function(e){var t,n=r.parseMLine(e),i=r.matchPrefix(e,"a=max-message-size:");i.length>0&&(t=parseInt(i[0].substr(19),10)),isNaN(t)&&(t=65536);var o=r.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:n.fmt,maxMessageSize:t};if(r.matchPrefix(e,"a=sctpmap:").length>0){var s=r.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(s[0],10),protocol:s[1],maxMessageSize:t}}},r.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,21)},r.writeSessionBoilerplate=function(e,t,n){var i=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||r.generateSessionId())+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.writeMediaSection=function(e,t,n,i){var o=r.writeRtpDescription(e.kind,t);if(o+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),o+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":"active"),o+="a=mid:"+e.mid+"\r\n",e.direction?o+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?o+="a=sendrecv\r\n":e.rtpSender?o+="a=sendonly\r\n":e.rtpReceiver?o+="a=recvonly\r\n":o+="a=inactive\r\n",e.rtpSender){var s="msid:"+i.id+" "+e.rtpSender.track.id+"\r\n";o+="a="+s,o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+s,e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+s,o+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),o},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;i<n.length;i++)switch(n[i]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[i].substr(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substr(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},r.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=r.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},e.exports=r},function(e,t,n){"use strict";e.exports=function(e){return-1===["Chrome","Safari","Edge","Opera"].indexOf(e.browserName)||"Edge"===e.browserName&&!e.isChromiumEdge||e.isScreenSharing&&!e.capableSimulcastScreenshare||e.sessionInfo.p2pEnabled||!e.constraints.video&&!e.isCustomVideoTrack?1:e.videoDimensions.width>640&&e.videoDimensions.height>480?3:2}},function(e,t,n){"use strict";var r=n(2)(n(18));const i=n(49);e.exports=function(){function e(e,t){var n;let o=(void 0===t?{}:t).requestAnimationFrame,s=void 0===o?(n=window).requestAnimationFrame.bind(n):o;(0,r.default)(this,"_lastCalled",i()),(0,r.default)(this,"_audioLevel",void 0),(0,r.default)(this,"_running",!1),this._requestAnimationFrame=s,this._getAudioLevel=e,this._startLoop()}var t=e.prototype;return t._startLoop=function(){this._running||(this._running=!0,this._requestAnimationFrame(this._loop.bind(this)))},t._loop=function(){this._getAudioLevel((e,t)=>{let n=null;if(!e){for(let e=0;e<t.length;e+=1){const r=t[e];let i=null;if(void 0!==r.audioOutputLevel){const e=parseFloat(r.audioOutputLevel)/32768;isNaN(e)||(i=e)}else void 0!==r.audioLevel&&(i=r.audioLevel);null!==i&&(null===n||i>n)&&(n=i)}this._audioLevel=n,this._running&&i()-this._lastCalled<1e4?this._requestAnimationFrame(this._loop.bind(this)):this._running=!1}})},t.destroy=function(){this._running=!1},t.sample=function(e){if("function"==typeof e)throw new Error("sample no longer takes a callback");return this._startLoop(),this._lastCalled=i(),this._audioLevel},e}()},function(e,t,n){"use strict";const r=n(148),i=n(573),o=n(150);function s(e,t,n){return!(!e.publish&&t)&&("boolean"==typeof e.source?e.source:n?{mandatory:{sourceId:e.source}}:o(e.source)?{}:{deviceId:{exact:e.source}})}function a(e){let t=s(e.audio,e.enableRenegotiation,e.usingOptionalMandatoryStyle);if(!1===t)return!1;const n=e.usingOptionalMandatoryStyle,i=e.enableStereo,o=e.echoCancellation,a=e.noiseSuppression,c=e.autoGainControl,u=e.disableAudioProcessing,d=e=>{"object"==typeof t&&(n?(r(t,{optional:[]}),t.optional.push(e)):r(t,e))};return!i&&!u&&o&&a&&c||!0!==t||(t={}),i&&d({channelCount:2}),["echoCancellation","autoGainControl","noiseSuppression"].forEach(t=>{const n=!u&&e[t];d({[t]:n})}),t}function c(e){let t=s(e.video,e.enableRenegotiation,e.usingOptionalMandatoryStyle);if(!1===t)return!1;const n=e.videoDimensions,i=e.frameRate,o=e.maxResolution,a=e.facingMode,c=e.usingOptionalMandatoryStyle;if((n||i||o||a)&&!0===t&&(t={}),n){const e=n.width,i=n.height;c?(r(t,{optional:[]}),t.optional.push({minWidth:e},{maxWidth:e},{minHeight:i},{maxHeight:i})):r(t,{width:{ideal:e},height:{ideal:i}})}return i&&(c?(r(t,{optional:[]}),t.optional.push({minFrameRate:i},{maxFrameRate:i})):r(t,{frameRate:{ideal:i}})),o&&r(t,c?{mandatory:{maxWidth:o.width,maxHeight:o.height}}:{width:{max:o.width},height:{max:o.height}}),a&&(c?(r(t,{optional:[]}),t.optional.push({facingMode:a})):r(t,{facingMode:{ideal:a}})),t}e.exports=function(e){const t=i(e);return{constraints:function(e){return{audio:a(e),video:c(e)}}(t),publishAudio:t.audio.publish,publishVideo:t.video.publish,frameRate:t.frameRate,videoDimensions:t.videoDimensions,audioDeviceId:"string"==typeof t.audio.source?t.audio.source:void 0,videoDeviceId:"string"==typeof t.video.source?t.video.source:void 0}}},function(e,t,n){var r=n(64),i=n(53);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},function(e,t){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},function(e,t,n){"use strict";const r=n(3),i=r.name,o=r.version,s=r.isChromiumEdge;e.exports=s||"Chrome"===i&&o>=72||"Firefox"===i&&o>=66||"Opera"===i&&o>=60||"Safari"===i},function(e,t,n){var r=n(60),i=n(262);e.exports=function(e){return i(r(e).toLowerCase())}},function(e,t,n){var r=n(578)("toUpperCase");e.exports=r},function(e,t){e.exports=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}},function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},function(e,t,n){var r=n(580),i=n(264),o=n(581);e.exports=function(e){return i(e)?o(e):r(e)}},function(e,t,n){"use strict";const r=n(3);e.exports=Boolean(r.isChrome&&r.version>=74||r.isEdge&&r.version>=79)},function(e,t,n){"use strict";const r=n(3);e.exports=e=>!!r.isElectron&&(e instanceof MediaStreamTrack&&"Screen"===e.label)},function(e,t,n){var r=n(99),i=n(587)(r);e.exports=i},function(e,t,n){"use strict";e.exports=15e3},function(e,t,n){"use strict";e.exports=function(e,t){return void 0===t&&(t=!1),void 0===e?t:"true"===e||!0===e}},function(e,t,n){"use strict";const r=n(3);e.exports=()=>{if(!(!r.isNode&&!r.isElectron))return!1;return(r.isChrome||r.isOpera||r.isChromiumEdge)&&r.version>=74||r.isFirefox&&r.version>=68||r.isSafari&&r.version>=11}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t,n){var r=n(33),i=n(77),o=n(604),s=n(59),a=n(40),c=n(607),u=n(138),d=n(188),l=u((function(e,t){var n={};if(null==e)return n;var u=!1;t=r(t,(function(t){return t=s(t,e),u||(u=t.length>1),t})),a(e,d(e),n),u&&(n=i(n,7,c));for(var l=t.length;l--;)o(n,t[l]);return n}));e.exports=l},function(e,t,n){var r=n(209),i=n(35),o=n(96),s=Math.max;e.exports=function(e,t,n){var a=null==e?0:e.length;if(!a)return-1;var c=null==n?0:o(n);return c<0&&(c=s(a+c,0)),r(e,i(t,3),c)}},function(e,t,n){var r=n(609);e.exports=function(e){return e&&e.length?r(e):[]}},function(e,t,n){"use strict";const r=n(620),i=n(279),o=n(103)();e.exports=(e,t)=>{i(e,(e,n)=>{let i=[];o?"function"==typeof n.values?i=r(n.values()):"function"!=typeof n.forEach?i=Object.keys(n).map(e=>n[e]):n.forEach(e=>{i.push(e)}):n.result().forEach(e=>{const t={};e.names().forEach(n=>{t[n]=e.stat(n)}),t.id=e.id,t.type=e.type,t.timestamp=e.timestamp,i.push(t)}),t(null,i)})}},function(e,t,n){var r=n(29),i=n(12),o=n(16);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},function(e,t,n){var r=n(622),i=n(30);e.exports=function(e){return null==e?[]:r(e,i(e))}},function(e,t,n){"use strict";const r=n(103)(),i=(e,t)=>{e.getStats(null).then(e=>t(null,e)).catch(t)},o=(e,t)=>{e.getStats(e=>{t(null,e)},t)};e.exports=(e,t)=>{(r?i:o)(e,t)}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(160)),o=r(n(61)),s=r(n(18)),a=n(42),c=r(n(37)),u=r(n(632)),d=r(n(634)),l=r(n(49));const p=(0,r(n(1)).default)("QoS");let f=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=e.call(this,...r)||this,(0,s.default)((0,i.default)(t),"_peerConnection",void 0),(0,s.default)((0,i.default)(t),"_isPublisher",void 0),(0,s.default)((0,i.default)(t),"timeoutId",void 0),(0,s.default)((0,i.default)(t),"_creationTime",(0,l.default)()),(0,s.default)((0,i.default)(t),"offerMessagesReceived",0),(0,s.default)((0,i.default)(t),"prevStats",{timeStamp:(0,l.default)()}),(0,s.default)((0,i.default)(t),"changeCounters",{videoCodec:new d.default,audioCodec:new d.default}),t}(0,o.default)(t,e);var n=t.prototype;return n.startCollecting=function(e,n){if(!e||!e.getStats)return;this._isPublisher=n;const r=Boolean(this._peerConnection);if(this._peerConnection=e,r)return;const i=e=>{const n=(0,l.default)(),r={timeStamp:n,duration:Math.round((n-this._creationTime)/1e3),period:Math.round((n-this.prevStats.timeStamp)/1e3)};(0,u.default)(this._peerConnection,this.prevStats,r,this._isPublisher,(n,r)=>{n?p.error("Failed to Parse QOS Stats:",n):(this.handleParsedStats(r),clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>i(t.INTERVAL),e))})};this.timeoutId=setTimeout(()=>i(t.INTERVAL-t.INITIAL_INTERVAL),t.INITIAL_INTERVAL)},n.stopCollecting=function(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this._peerConnection=null},n.handleOfferMessageReceived=function(){this.offerMessagesReceived+=1},n.handleParsedStats=function(e){Object.keys(this.changeCounters).forEach(t=>{this.changeCounters[t].onValue(e[t]),e[t+"ChangeCount"]=this.changeCounters[t].changeCount}),e.offerMessagesReceived=this.offerMessagesReceived;const t=(0,c.default)(e);if(["audioSentBytes","audioSentPackets","audioSentPacketsLost","videoSentBytes","videoSentPackets","videoSentPacketsLost","audioRecvBytes","audioRecvPackets","audioRecvPacketsLost","videoRecvBytes","videoRecvPackets","videoRecvPacketsLost"].forEach(n=>{t[n]=this.prevStats&&this.prevStats[n]?e[n]-this.prevStats[n]:e[n]}),this.prevStats&&this.prevStats.videoFramesReceived){const n=e.videoFramesReceived-this.prevStats.videoFramesReceived,r=e.period;t.videoFrameRateReceived=Math.round(n/r)}this.prevStats=e,delete t.framesDecoded,delete t.framesEncoded,this.emit("stats",t)},t}(a.EventEmitter);f.INITIAL_INTERVAL=1e3,f.INTERVAL=3e4;var h=f;t.default=h},function(e,t,n){"use strict";e.exports=e=>{switch(e>>24){case 0:return"TURN/TLS";case 1:return"TURN/TCP";case 2:return"TURN/UDP";default:return""}}},function(e,t,n){"use strict";const r=n(19),i=n(163).default,o=n(4),s=n(13);e.exports=function(e){let t=void 0===e?{}:e,n=t.haveGetDisplayMedia,a=void 0===n?i:n,c=t.global,u=void 0===c?void 0!==typeof window?window:global:c,d=t.Errors,l=void 0===d?o:d,p=t.otError,f=void 0===p?s():p;const h=!a&&!!u.navigator.webkitGetUserMedia&&!u.navigator.userAgent.match(/android/i)&&void 0!==u.chrome;return{isSupportedInThisBrowser:h,autoRegisters:!1,extensionRequired:!0,getConstraintsShowsPermissionUI:!0,sources:{screen:!0,application:!1,window:!0,browser:!0},register(e,t){return 2===t?this.registerVersion2(e):this.registerVersion1(e)},registerVersion1(e){if(!e)throw new Error("initChromeScreenSharingExtensionHelper: extensionID is required.");const t=h,n={};let i=void 0;const o="com.tokbox.screenSharing."+e,s=function(e,t){const n={payload:t,from:"jsapi"};return n[o]=e,n},a=function(e,t){let i;const o=r();return n[o]=function(){clearTimeout(i),i=null,e(...arguments)},t&&(i=setTimeout(()=>{delete n[o],e(f(l.TIMEOUT,new Error("Timeout waiting for response to screensharing request.")))},t)),o},c=function(e){if(!e)throw new Error("isAvailable: callback is required.");if(t)if(void 0!==i)setTimeout(e.bind(null,i));else{const t=a(t=>{!0!==i&&(i="extensionLoaded"===t),e(i)},2e3),n=s("isExtensionInstalled",{requestId:t});u.postMessage(n,"*")}else setTimeout(e.bind(null,!1))};return u.addEventListener("message",e=>{if(e.origin!==u.location.origin)return;if(null==e.data||"object"!=typeof e.data)return;if("extension"!==e.data.from)return;const t=e.data[o],r=e.data.payload;if(r&&r.requestId){const e=n[r.requestId];delete n[r.requestId],e&&e(t,r)}"extensionLoaded"===t&&(i=!0)}),{extensionAPIVersion:1,extensionID:e,isInstalled:c,getConstraints:function(e,t,n){if(!n)throw new Error("getSourceId: callback is required");c(r=>{if(!r)return n(f(l.SCREEN_SHARING_EXTENSION_NOT_INSTALLED,new Error("Extension is not installed")));const i=a((e,r)=>{if("object"==typeof e&&e.name&&e.stack){n(e)}else"permissionDenied"===e?n(f(l.USER_MEDIA_ACCESS_DENIED,new Error("User denied access to screensharing"))):(t.video||(t.video={}),t.video.mandatory||(t.video.mandatory={}),t.video.mandatory.chromeMediaSource="desktop",t.video.mandatory.chromeMediaSourceId=r.sourceId,n(void 0,t))});u.postMessage(s("getSourceId",{requestId:i,source:e}),"*")})}}},registerVersion2(e){const t=h&&void 0!==u.chrome.runtime,n=function(n){if(!n)throw new Error("isAvailable: callback is required.");t?u.chrome.runtime.sendMessage(e,{type:"isInstalled"},null,e=>{setTimeout(n.bind(null,!!e))}):setTimeout(n.bind(null,!1))};return{extensionAPIVersion:2,extensionID:e,isInstalled:n,getConstraints:function(t,r,i){if(!i)throw new Error("getSourceId: callback is required");n(n=>{if(!n)return i(f(l.SCREEN_SHARING_EXTENSION_NOT_INSTALLED,new Error("Extension is not installed")));u.chrome.runtime.sendMessage(e,{type:"getSourceId",source:t},null,e=>{"permissionDenied"===e.error?i(f(l.USER_MEDIA_ACCESS_DENIED,new Error("User denied access to screensharing"))):e.error?i(new Error("UnexpectError: "+e.error)):(r.video||(r.video={}),r.video.mandatory||(r.video.mandatory={}),r.video.mandatory.chromeMediaSource="desktop",r.video.mandatory.chromeMediaSourceId=e.sourceId,i(void 0,r))})})}}}}}},function(e,t,n){"use strict";(function(t){const r=n(156),i=n(104);e.exports=function(e){void 0===e&&(e={});const o=e.Archiving||n(638),s=e.AudioLevelMeter||n(284),a=e.AudioLevelTransformer||n(144),c=e.BackingBar||n(285),u=e.Chrome||n(145),d=e.MuteButton||n(286)(),l=e.NamePanel||n(287),p=e.StylableComponent||n(153),f=e.logging||n(1)("createChromeMixin");return function(e,n){let h,m,g,b=void 0===n?{}:n,v=b.name,y=b.publishAudio,E=b.publishVideo,S=b.audioSource,_=b.showControls,w=b.shouldAllowAudio,T=b.logAnalyticsEvent;const C={},I=r(),R=t=>{if(!1===t)return"off";const n=e.getStyle("buttonDisplayMode");return!1===n?"on":n};let x=new t((t,n)=>{C.init=n=>{e.getStyle("showArchiveStatus")||T("showArchiveStatus","createChrome",{mode:"off"});const r={backingBar:new c({nameMode:v?e.getStyle("nameDisplayMode"):"off",muteMode:R(e.getStyle("buttonDisplayMode"))}),name:new l({name:v,mode:e.getStyle("nameDisplayMode")}),archive:new o({show:Boolean(e.getStyle("showArchiveStatus"))&&"off"!==e.getStyle("archiveStatusDisplayMode"),archiving:!1}),muteButton:new d({muted:!1===y,mode:R.call(null,e.getStyle("buttonDisplayMode"))})};h=new s({mode:e.getStyle("audioLevelDisplayMode")});const p=new a,f=new i(()=>{const t=y?p.transform(e.loudness):0;h.setValue(t)});h.watchVisibilityChanged(e=>{e?f.start():f.stop()}),h.audioOnly(!E&&y),r.audioLevel=h,n&&n.domElement&&(g=n,m=new u({parent:g.domElement}).set(r).on({muted:()=>e.publishAudio(!1),unmuted:()=>e.publishAudio(!0)}),null!==S&&!1!==S||C.removeAudioTrack(),t())},C.reset=()=>{n(new Error("Chrome still being created")),m&&(m.destroy(),m=null)},C.destroy=()=>{C.reset(),I.releaseAll(),x=null}});x.catch(e=>{e&&"Chrome still being created"===e.message||f.error("createChromeMixin failed to setup UI",e)}),C.setAudioOnly=e=>{h&&h.audioOnly(e)},C.setArchivingStatus=e=>{m&&m.archive.setArchiving(e)},C.setMuted=e=>{m&&m.muteButton&&m.muteButton.muted(e)},C.removeAudioTrack=()=>{m&&m.muteButton&&m.muteButton.remove()},C.addAudioTrack=()=>{m&&m.muteButton&&m.muteButton.add()},p(e,{showArchiveStatus:!0,nameDisplayMode:"auto",buttonDisplayMode:"auto",audioLevelDisplayMode:w?"auto":"off",archiveStatusDisplayMode:"auto",backgroundImageURI:null},_,e=>{T("SetStyle","Publisher",e,null,.1)});const O=(e,t)=>{x.then(()=>{switch(e){case"nameDisplayMode":m.name.setDisplayMode(t),m.backingBar.setNameMode(t);break;case"showArchiveStatus":T("showArchiveStatus","styleChange",{mode:t?"on":"off"}),m.archive.setShowArchiveStatus(Boolean(t));break;case"archiveStatusDisplayMode":m.archive.setShowArchiveStatus("off"!==t);break;case"buttonDisplayMode":m.muteButton.setDisplayMode(t),m.backingBar.setMuteMode(t);break;case"audioLevelDisplayMode":m.audioLevel.setDisplayMode(t);break;case"backgroundImageURI":g.setBackgroundImageURI(t)}})};return e.on("styleValueChanged",O),I.add(()=>e.off("styleValueChanged",O)),C}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const r=n(105),i=n(36),o=n(5),s=n(42);e.exports=function(e){const n=this,a=new s;let c,u,d,l,p=!0,f=!1,h="auto";const m=e.maxValue||1,g=e.minValue||0;function b(){const e=(f&&"auto"===h||"on"===h)&&p;l!==e&&(l=e,a.emit("visibilityChanged",e))}r(n,{audioOnly:{get:()=>f,set(e){f=e,b()}}}),n.setValue=function(e){d=e,function(){const e=(d-g)/(m-g);u.style.transform=`scale(${Math.sqrt(e)})`}()},n.watchVisibilityChanged=function(e){return a.on("visibilityChanged",e),t.resolve().then(()=>{e(l)}),function(){a.removeListener("visibilityChanged",e)}};const v={mode:e?e.mode:"auto",nodeName:"div",htmlAttributes:{className:"OT_audio-level-meter"},onCreate:function(){u=o.createElement("div",{className:"OT_audio-level-meter__value"},""),c=o.createElement("div",{className:"OT_audio-level-meter__audio-only-img"},"");const e=n.domElement;e.appendChild(c),e.appendChild(u),n.watchVisibilityChanged(e=>{e?o.removeClass(n.domElement,"OT_hide-forced"):o.addClass(n.domElement,"OT_hide-forced")})},onDestroy:function(){a.removeAllListeners("visibilityChanged")}};i(this,v),n.setDisplayMode=function(e){h=e,b()},n.getDisplayMode=function(){return h},n.showAfterLoading=function(){p=!0,b()},n.hideWhileLoading=function(){p=!1,b()},b()}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(36);e.exports=function(e){let t=e.nameMode,n=e.muteMode;function i(){return"on"===t||"on"===n?"on":"mini"===t||"mini"===n?"mini":"mini-auto"===t||"mini-auto"===n?"mini-auto":"auto"===t||"auto"===n?"auto":"off"}r(this,{mode:i(),nodeName:"div",htmlContent:"",htmlAttributes:{className:"OT_bar OT_edge-bar-item"}}),this.setNameMode=function(e){t=e,this.setDisplayMode(i())},this.setMuteMode=function(e){n=e,this.setDisplayMode(i())}}},function(e,t,n){"use strict";const r=n(5),i=n(36),o=n(105);e.exports=function(e){void 0===e&&(e={});const t=e.OTHelpers||r,n=e.Widget||i;return function(e){let r=e.muted||!1;const i=()=>{r?t.addClass(this.domElement,"OT_active"):t.removeClass(this.domElement,"OT_active ")},s=()=>(r=!r,i(),r?this.parent.trigger("muted",this):this.parent.trigger("unmuted",this),!1);o(this,{muted:{get:()=>r,set(e){r=e,i()}}});const a=r?"OT_edge-bar-item OT_mute OT_active":"OT_edge-bar-item OT_mute";let c;n(this,{mode:e.mode,nodeName:"button",htmlContent:"Mute",htmlAttributes:{className:a,type:"button"},onCreate:e=>{t.on(e,"click",s)},onDestroy:e=>{t.off(e,"click",s)}}),this.remove=()=>{this.domElement&&this.domElement.parentNode&&(c=this.domElement.parentNode,this.domElement.parentNode.removeChild(this.domElement))},this.add=()=>{c&&this.domElement&&!this.domElement.parentNode&&c.appendChild(this.domElement)}}}},function(e,t,n){"use strict";const r=n(36),i=e=>{const t=document.createElement("div");return t.textContent=e,t.innerHTML};e.exports=function(e){let t=e.name;t&&""!==t.trim().length||(t=null,e.mode="off"),this.setName=function(e){t||this.setDisplayMode("auto"),t=i(e),this.domElement.innerHTML=t}.bind(this),t=i(t),r(this,{mode:e.mode,nodeName:"h1",htmlContent:t,htmlAttributes:{className:"OT_name OT_edge-bar-item"}})}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.global||(void 0!==typeof window?window:global);return function(){if(t.navigator.mediaDevices){const e=t.navigator.mediaDevices;return e.enumerateDevices&&e.enumerateDevices.bind(e)}}}},function(e,t,n){"use strict";const r=n(3),i=n(163).default;e.exports={isSupportedInThisBrowser:!r.isLegacyEdge&&!r.isElectron&&i&&!r.isAndroid,autoRegisters:!0,extensionRequired:!1,getConstraintsShowsPermissionUI:!1,sources:{screen:!0,application:!1,window:"Safari"!==r.name,browser:"Safari"!==r.name},register:()=>({isInstalled(e){e(void 0)},getConstraints(e,t,n){n(void 0,{video:t.video,audio:t.audio})}})}},function(e,t,n){"use strict";t.isMediaStreamTrack=e=>e&&"object"==typeof e&&"string"==typeof e.kind&&"function"==typeof e.stop&&"boolean"==typeof e.enabled},function(e,t,n){"use strict";n.r(t),function(e){var n=function(t,n,r,i){return new(r||(r=e))((function(e,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(s,a)}c((i=i.apply(t,n||[])).next())}))},r=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};function i(){return"undefined"!=typeof window||void 0!==typeof window?window:global}t.default=function(t,o,s){return void 0===s&&(s=10),function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return n(this,void 0,void 0,(function(){var n,c,u;return r(this,(function(d){switch(d.label){case 0:n=0,c=function(){var c,u,d;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,6]),c={},[4,t.apply(void 0,a)];case 1:return[2,(c.value=r.sent(),c)];case 2:if(u=r.sent(),!1===(d=o(u,n))||null==d||n>=s)throw u;return"number"!=typeof d?[3,4]:[4,new e((function(e){return i().setTimeout(e,d)}))];case 3:return r.sent(),[3,5];case 4:if(!0!==d)throw new Error("onFailure must return boolean, or delay in ms");r.label=5;case 5:return[3,6];case 6:return[2]}}))},d.label=1;case 1:return(n+=1)?[5,c()]:[3,3];case 2:return"object"==typeof(u=d.sent())?[2,u.value]:[3,1];case 3:return[2]}}))}))}}}.call(this,n(0))},function(e,t,n){"use strict";const r=n(1)("videoContentHint"),i=["","text","motion","detail"],o=e=>i.includes(e),s=e=>{var t;return null==e||null==(t=e.getVideoTracks())?void 0:t[0]};e.exports={isValidVideoContentHint:o,setVideoContentHint:(e,t)=>{if(!o(t))return void r.warn('Invalid content hint. Valid content hints are "text", "detail", "motion", or ""');const n=s(e);n?void 0!==n.contentHint?n.contentHint=t:r.warn("contentHint not supported by this browser"):r.warn("Tried to set contentHint but no video track is present")},getVideoContentHint:e=>{const t=s(e);return(null==t?void 0:t.contentHint)||""}}},function(e,t,n){"use strict";const r=n(105);e.exports=function(){return function(e,t){let n;r(this,{muted:{get:()=>n,set(t){if(n===t)return;n=t;const r=e.getAudioTracks();for(let e=0,t=r.length;e<t;++e)r[e].enabled=!n}}}),void 0!==t?this.muted(!0===t):e.getAudioTracks().length?this.muted(!e.getAudioTracks()[0].enabled):this.muted(!1)}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(4),r=e.otError||n(13)(),i={};return(void 0!==typeof window?window:global).MediaError&&(i[(void 0!==typeof window?window:global).MediaError.MEDIA_ERR_ABORTED]={name:t.MEDIA_ERR_ABORTED,message:"The fetching process for the media resource was aborted by the user agent at the user's request."},i[(void 0!==typeof window?window:global).MediaError.MEDIA_ERR_NETWORK]={name:t.MEDIA_ERR_NETWORK,message:"A network error of some description caused the user agent to stop fetching the media resource, after the resource was established to be usable."},i[(void 0!==typeof window?window:global).MediaError.MEDIA_ERR_DECODE]={name:t.MEDIA_ERR_DECODE,message:"An error of some description occurred while decoding the media resource, after the resource was established to be usable."},i[(void 0!==typeof window?window:global).MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED]={name:t.MEDIA_ERR_SRC_NOT_SUPPORTED,message:"The media resource indicated by the src attribute was not suitable."}),function(e){const t=i[e.code];return t?r(t.name,new Error("There was an unexpected problem with the Video Stream: "+t.message)):new Error("An unknown error occurred"+(e.message?": "+e.message:"."))}}},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(20)),o=r(n(7)),s=r(n(8)),a=r(n(18));const c=n(6),u=n(63),d=n(649),l=n(650),p=n(651),f=n(107),h=n(3),m=n(24)().hasAudioOutputApiSupport,g=n(296),b=n(106).getCurrentAudioOutputDeviceId;function v(e,t){const n=document.createElement("video");return l(n),n.autoplay=!0,n.playsinline=!0,n.innerHTML=e,n.setAttribute("autoplay",""),n.setAttribute("playsinline",""),!0===t&&(n.muted="true"),n}function y(){const e=v("");return e.setAttribute("style","display:none"),e}e.exports=function(e){void 0===e&&(e={});const r=e.audioContext||n(162)(),l=e.canBeOrientatedMixin||n(652),E=e.document||(void 0!==typeof window?window:global).document,S=e.listenForTracksEnded||n(653)(),_=e.logging||n(1),w=e.OTHelpers||n(5),T=e.videoElementErrorMap||n(294)(),C=e.WebaudioAudioLevelSampler||n(146),I=e.global||(void 0!==typeof window?window:global);let R=1;return function(){function e(e,t){var n=this;let r=e._inject,i=void 0===r?{}:r,d=i.createVideoElement,p=void 0===d?v:d,f=i.createAudioOnlyVideoElement,m=void 0===f?y:f,b=e.muted,E=e.fallbackText,S=e.widgetType;(0,a.default)(this,"_domElement",void 0),(0,a.default)(this,"_domAudioOnlyVideoElement",void 0),(0,a.default)(this,"_blockedVolume",void 0),(0,a.default)(this,"_mediaStoppedListener",void 0),(0,a.default)(this,"_audioLevelSampler",void 0),(0,a.default)(this,"_playInterrupts",0),(0,a.default)(this,"_isVideoLoadedMetaData",!1),(0,a.default)(this,"_audioOnlyVideoElementWatcher",void 0),(0,a.default)(this,"_blinkStartTime",null),this.logging=_("NativeVideoElementWrapper:"+R),R+=1,c(this),this._defaultAudioVolume=t,this._widgetType=S,this._emitVideoPlayAttempt=()=>{this._blinkStartTime=(new Date).getTime(),this.trigger("amrLogEvent","AMRTransitionVideo","Attempt")},this._emitVideoPlaySuccess=()=>{const e=(new Date).getTime()-this._blinkStartTime;this.trigger("amrLogEvent","AMRTransitionVideo","Success",{attemptDuration:e}),this._blinkStartTime=null},this._emitVideoPlayFailure=()=>{this.trigger("amrLogEvent","AMRTransitionVideo","Failure")};let w=!1;this._domElement=p(E,b),this.trigger("videoElementCreated",this._domElement),this._domElementEvents=u(this._domElement),this._domElementEvents.on("loadstart",()=>this._onDomElementLoadStart()),this._domElementEvents.on("timeupdate",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.trigger("timeupdate",...t)})),this._domElementEvents.on("loadedmetadata",(0,s.default)(o.default.mark((function e(){var t,r,i,s,a=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n._isVideoLoadedMetaData=!0,t=a.length,r=new Array(t),i=0;i<t;i++)r[i]=a[i];if(n.trigger("loadedmetadata",...r),!n._domAudioOnlyVideoElement){e.next=10;break}if(s=n._domAudioOnlyVideoElement.srcObject,n._removeAudioOnlyVideoElement(),!s){e.next=10;break}return e.next=9,g();case 9:n.play();case 10:case"end":return e.stop()}}),e)}))));this._domElementEvents.on("error",e=>{this.trigger("error",T(e.target.error))},!1),this._domElementEvents.on("pause",()=>{w||(this.logging.warn("Video element paused, auto-resuming. If you intended to do this, use publishVideo(false) or subscribeToVideo(false) instead."),w=!0),this.play()}),this.on("destroyed",()=>{this._domElementEvents.removeAll(),this._domAudioOnlyVideoElementEvents&&this._domAudioOnlyVideoElementEvents.removeAll()}),l(this,()=>this._domElement),h.isSafari&&"subscriber"===this._widgetType&&(this._domAudioOnlyVideoElement=m(),this._bindAudioOnlyVideoElementEvents())}var n=e.prototype;return n._onDomElementLoadStart=function(){var e=(0,s.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("subscriber"!==this._widgetType||!m()){e.next=3;break}return e.next=3,this._setActiveAudioOutputDevice();case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._setActiveAudioOutputDevice=function(){var e=(0,s.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!==(t=b())&&"default"!==t){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,this.setSinkId(t);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._rebindSrcObject=function(){this._domElement&&(this._domElement.srcObject=this._domElement.srcObject)},n._pauseAndPlay=function(){this._domElement&&(this._domElement.pause(),this._domElement.play())},n._startAudioOnlyVideoElementWatcher=function(){var e=(0,s.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return 1e3,t=h.isiOS,this._audioOnlyVideoElementWatcher=setInterval(()=>{this._domAudioOnlyVideoElement&&this._domAudioOnlyVideoElement.paused&&(this._domAudioOnlyVideoElement.srcObject=this._domAudioOnlyVideoElement.srcObject,t&&this._domAudioOnlyVideoElement.play())},100),e.next=5,f(1e3);case 5:clearInterval(this._audioOnlyVideoElementWatcher),this._audioOnlyVideoElementWatcher=null;case 7:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._removeAudioOnlyVideoElement=function(){var e=(0,s.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._domAudioOnlyVideoElement.srcObject=null,this._domAudioOnlyVideoElement.parentNode.removeChild(this._domAudioOnlyVideoElement),this._domAudioOnlyVideoElementEvents&&this._domAudioOnlyVideoElementEvents.removeAll(),this._domAudioOnlyVideoElement=null;case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n.bindAudioTrackOnly=function(){var e=(0,s.default)(o.default.mark((function e(){var t,n,r,i,s,a,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._stream.getVideoTracks(),n=this._stream.getAudioTracks(),r=t[0],i=void 0===r?{}:r,s=n[0],a=void 0===s?{}:s,e.next=6,g();case 6:c=!i.enabled&&a.enabled,!this._isVideoLoadedMetaData&&c&&this._domAudioOnlyVideoElement&&(this._domAudioOnlyVideoElement.srcObject=new I.MediaStream(n),this._startAudioOnlyVideoElementWatcher());case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._bindAudioOnlyVideoElementEvents=function(){var e=this;this._domAudioOnlyVideoElementEvents=u(this._domAudioOnlyVideoElement),this._domAudioOnlyVideoElementEvents.on("pause",()=>this.play()),this._domAudioOnlyVideoElementEvents.on("timeupdate",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.trigger("timeupdate",...n)})),this._domAudioOnlyVideoElementEvents.on("loadedmetadata",(function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.trigger("loadedmetadata",...n)}))},n.whenTimeIncrements=function(e,t){this.once("timeupdate",()=>{e.call(t,this)})},n.domElement=function(){return this._domElement},n.videoWidth=function(){return this._domElement?Number(this._domElement["video"+(this.isRotated()?"Height":"Width")]):0},n.videoHeight=function(){return this._domElement?Number(this._domElement["video"+(this.isRotated()?"Width":"Height")]):0},n.aspectRatio=function(){return this.videoWidth()/this.videoHeight()},n.imgData=function(){const e=w.createElement("canvas",{width:this.videoWidth(),height:this.videoHeight(),style:{display:"none"}});E.body.appendChild(e);let t=null;try{e.getContext("2d").drawImage(this._domElement,0,0,e.width,e.height),t=e.toDataURL("image/png")}catch(e){}return w.removeElement(e),null===t||"data:,"===t?(this.logging.warn("Cannot get image data yet"),null):t.replace("data:image/png;base64,","").trim()},n.appendTo=function(e){return e.appendChild(this._domElement),this._domAudioOnlyVideoElement&&e.appendChild(this._domAudioOnlyVideoElement),this},n.isAudioBlocked=function(){return void 0!==this._blockedVolume},n.unblockAudio=function(){var e=(0,s.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isAudioBlocked()){e.next=3;break}return this.logging.warn("Unexpected call to unblockAudio() without blocked audio"),e.abrupt("return");case 3:return t=this._blockedVolume,this._blockedVolume=void 0,this.setAudioVolume(t),e.prev=6,e.next=9,this.play();case 9:e.next=16;break;case 11:throw e.prev=11,e.t0=e.catch(6),this._blockedVolume=t,this._domElement.muted=!0,e.t0;case 16:this.trigger("audioUnblocked");case 17:case"end":return e.stop()}}),e,this,[[6,11]])})));return function(){return e.apply(this,arguments)}}(),n.rebind=function(){var e=(0,s.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._domElement){e.next=2;break}throw new Error("Can't rebind because _domElement no longer exists");case 2:this._playInterrupts++,this._domElement.srcObject=this._domElement.srcObject,this._hasAudioOnlyVideoElement()&&(this._domAudioOnlyVideoElement.srcObject=this._domAudioOnlyVideoElement.srcObject);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._createAudioLevelSampler=function(){if(this._removeAudioLevelSampler(),this._stream.getAudioTracks().length>0){try{this._audioContext=r()}catch(e){this.logging.warn("Failed to get AudioContext(), audio level visualisation will not work",e)}this._audioContext&&(this._audioLevelSampler=new C(this._audioContext),this._audioLevelSampler.webRTCStream(this._stream))}},n._removeAudioLevelSampler=function(){this._audioContext&&(delete this._audioContext,delete this._audioLevelSampler)},n._toggleVideoTracks=function(){var e=(0,s.default)(o.default.mark((function e(){var t,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._domElement.srcObject.getTracks().filter(e=>e.enabled),!(t.length>1)){e.next=8;break}return(n=t.filter(e=>"video"===e.kind)).forEach(e=>{e.enabled=!1}),e.next=7,g();case 7:n.forEach(e=>{e.enabled=!0});case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}(),n._hasAudioOnlyVideoElement=function(){return this._domAudioOnlyVideoElement&&this._domAudioOnlyVideoElement.srcObject},n.play=function(){var e=(0,s.default)(o.default.mark((function e(){var t,n,r,i,s,a,c,u,d,l,f;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this._playInterrupts,n=this._hasAudioOnlyVideoElement()?this._domAudioOnlyVideoElement:this._domElement,!h.isSafari){e.next=5;break}return e.next=5,g();case 5:if(!h.isiOS||!h.isSafari){e.next=15;break}if("publisher"!==this._widgetType){e.next=14;break}if(r=h.iOSVersion>=14&&h.iOSVersion<=14.2,i=this._stream.getVideoTracks(),s=i[0],a=void 0===s?{}:s,c=this._stream.getAudioTracks(),u=c[0],d=void 0===u?{}:u,!r||p(n)||!a.enabled){e.next=12;break}return e.abrupt("return");case 12:if(!d.muted){e.next=14;break}return e.abrupt("return");case 14:this._toggleVideoTracks();case 15:return e.prev=15,this._emitVideoPlayAttempt(),e.next=19,n.play();case 19:return this._emitVideoPlaySuccess(),e.abrupt("return");case 23:if(e.prev=23,e.t0=e.catch(15),this._emitVideoPlayFailure(),l=e.t0||{},f=l.name,"AbortError"===f&&this._playInterrupts++,!(this._playInterrupts>t)){e.next=33;break}return e.next=32,this.play();case 32:return e.abrupt("return");case 33:throw e.t0;case 34:case"end":return e.stop()}}),e,this,[[15,23]])})));return function(){return e.apply(this,arguments)}}(),n._bindToStream=function(e){this._stream=e,this._domElement.srcObject=e,this._domAudioOnlyVideoElement&&this.bindAudioTrackOnly()},n.bindToStream=function(){var e=(0,s.default)(o.default.mark((function e(t){var n,r,a,c=this;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._domElement){e.next=2;break}throw new Error("Can't bind because _domElement no longer exists");case 2:return this._bindToStream(t),(0,s.default)(o.default.mark((function e(){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.play();case 3:e.next=26;break;case 5:if(e.prev=5,e.t0=e.catch(0),n=!!t.getAudioTracks().length,!c._hasAudioOnlyVideoElement()||"NotAllowedError"!==e.t0.name){e.next=15;break}return c._domAudioOnlyVideoElement.muted=!0,e.next=12,c.play();case 12:c._domAudioOnlyVideoElement.muted=!1,e.next=26;break;case 15:if(!n){e.next=23;break}return c._blockedVolume=c.getAudioVolume(),c._domElement.muted=!0,e.next=20,c.play();case 20:c.trigger("audioBlocked"),e.next=26;break;case 23:return c._domElement.muted=!0,e.next=26,c.play();case 26:case"end":return e.stop()}}),e,null,[[0,5]])})))().catch(e=>{this.logging.debug(".play() failed: ",e)}),n={width:this._domElement.videoWidth,height:this._domElement.videoHeight},this.trigger("videoDimensionsChanged",(0,i.default)({},n),(0,i.default)({},n)),this._domElementEvents.on("resize",()=>{const e=this._domElement,t=e.videoWidth,r=e.videoHeight,o=t!==n.width,s=r!==n.height;(o||s)&&(this.trigger("videoDimensionsChanged",(0,i.default)({},n),{width:t,height:r}),n.width=t,n.height=r)}),r=()=>{this._mediaStoppedListener.stop(),this._domElement&&(this._domElement.onended=null),this.trigger("mediaStopped")},a=e=>{this.trigger("mediaStopped",e)},this._domElement.onended=()=>r(),this._mediaStoppedListener=S(t,r,a),this._createAudioLevelSampler(),e.abrupt("return",void 0);case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.unbindStream=function(){return this._domElement&&(this._domElement.srcObject=null),this._domAudioOnlyVideoElement&&(this._domAudioOnlyVideoElement.srcObject=null),this._removeAudioLevelSampler(),this},n.setAudioVolume=function(e){if(this.isAudioBlocked())return void(this._blockedVolume=e);const t=parseFloat(e)/100,n=[this.domElement()];this._domAudioOnlyVideoElement&&n.push(this._domAudioOnlyVideoElement),n.forEach(e=>{e&&(e.volume=t,e.muted=0===t)})},n.getAudioVolume=function(){if(this.isAudioBlocked())return this._blockedVolume;const e=this.domElement();return e?e.muted?0:100*e.volume:this._defaultAudioVolume},n.audioChannelType=function(e){const t=this.domElement();return void 0!==e&&(t.mozAudioChannelType=e),"mozAudioChannelType"in this._domElement?t.mozAudioChannelType:"unknown"},n.getAudioInputLevel=function(){return this._audioLevelSampler.sample()},n.refreshTracks=function(){this._mediaStoppedListener&&this._mediaStoppedListener.refresh(),this._createAudioLevelSampler()},n.destroy=function(){this._mediaStoppedListener&&this._mediaStoppedListener.stop(),this.logging.debug("removing domElementEvents"),this._domElementEvents.removeAll(),this._domAudioOnlyVideoElementEvents&&this._domAudioOnlyVideoElementEvents.removeAll(),this._audioOnlyVideoElementWatcher&&clearInterval(this._audioOnlyVideoElementWatcher),this.unbindStream(),this._domElement&&(w.removeElement(this._domElement),this._domElement=null),this._domAudioOnlyVideoElement&&(w.removeElement(this._domAudioOnlyVideoElement),this._domAudioOnlyVideoElement=null),this.trigger("destroyed"),d("NativeVideoElementWrapper",this)},n.setSinkId=function(e){const n=[this._domElement,this._domAudioOnlyVideoElement].map(t=>{if(t)return t.setSinkId(e)});return t.all(n)},e}()}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){e.exports=()=>new t(e=>setTimeout(e))}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const r=n(9),i=n(48),o=n(62),s=n(6),a=n(298),c=n(299);e.exports=function(e){void 0===e&&(e={});const u=e.getStatsHelpers||n(75),d=e.OTHelpers||n(5),l=e.PeerConnection||n(102)(),p=e.setCertificates||n(167)(),f=e.watchAudioAcquisition||n(656);return function(e){let n,h,m=e.iceConfig,g=e.webRTCStream,b=e.channels,v=e.sendMessage,y=e.capableSimulcastStreams,E=e.overrideSimulcastEnabled,S=e.logAnalyticsEvent,_=e.offerOverrides,w=e.answerOverrides,T=e.sourceStreamId,C=e.isP2pEnabled,I=e.sessionId,R=!1;const x=function(){this.destroy(),R&&(R=!1,this.trigger("iceRestartFailure")),this.trigger("disconnected")},O=function(e){let t=e.reason,n=e.prefix;this.trigger("error",{reason:t,prefix:n})},k=function(e){R&&n.iceConnectionStateIsConnected()&&(R=!1,this.trigger("iceRestartSuccess")),"connected"===e&&("Chrome"===d.env.name&&(h&&h(),h=f(n.getStats.bind(n),()=>this.trigger("audioAcquisitionProblem"))),this.trigger("connected")),this.trigger("iceConnectionStateChange",e)};s(this),this.startEncryption=e=>{n&&n.startEncryption(e)},this.changeMediaDirectionToInactive=()=>{n&&n.changeMediaDirectionToInactive()},this.changeMediaDirectionToRecvOnly=()=>{n&&n.changeMediaDirectionToRecvOnly()},this.getDataChannel=function(e,t,r){n.getDataChannel(e,t,r)},this.getSourceStreamId=()=>n.getSourceStreamId(),this.destroy=function(){h&&(h(),h=null),n&&(n.disconnect(),n=null),this.off()},this.processMessage=function(e,t){n.processMessage(e,t)},this.addTrack=function(e,t,r){return n.addTrack(e,t,r)},this.removeTrack=function(e){return n.removeTrack(e)},this.getLocalStreams=function(){return n.getLocalStreams()},this.init=function(e,t){a(T)&&c(m);const i={iceConfig:m.needRumorIceServersFallback?r(m,{servers:[...e,...m.servers]}):m,channels:b,capableSimulcastStreams:y,overrideSimulcastEnabled:E};p(i,(e,i)=>{if(e)return void t(e);const o=r({logAnalyticsEvent:S,isPublisher:!0,offerOverrides:_,answerOverrides:w,sourceStreamId:T,p2p:C,sessionId:I},i);n=new l(r({sendMessage:v},o)),n.on({close:x,error:O,qos:e=>this.trigger("qos",e),iceConnectionStateChange:k},this),n.addLocalStream(g).then(()=>{t(void 0)}).catch(t)})},this.getSenders=function(){return n.getSenders()},this.iceRestart=function(){n&&(R=!0,n.iceRestart())},this.hasRelayCandidates=()=>n.hasRelayCandidates(),this.iceConnectionStateIsConnected=function(){return n.iceConnectionStateIsConnected()},this.findAndReplaceTrack=(e,t)=>n.findAndReplaceTrack(e,t),this._testOnlyGetFramesEncoded=()=>new t((e,t)=>{n.getStats((n,r)=>{if(n)return void t(n);const s=o(r,e=>u.isVideoStat(e,r)&&u.isOutboundStat(e));s?e(i(s,["timestamp","framesEncoded"])):t(new Error("Could not find framesEncoded in getStats report"))})}),this.getStats=e=>n.getStats(e),this.getRtcStatsReport=e=>n.getRtcStatsReport(e)}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(654);e.exports=e=>"P2P"===e&&r()},function(e,t,n){"use strict";e.exports=e=>{e.transportPolicy="relay",e.customServers=e.customServers||[]}},function(e,t,n){"use strict";const r=n(9),i=n(6),o=n(298),s=n(299);e.exports=function(e){void 0===e&&(e={});const t=e.OTHelpers||n(5),a=e.PeerConnection||n(102)(),c=e.setCertificates||n(167)(),u=e.Errors||n(4),d=e.ExceptionCodes||n(10),l=e.OTErrorClass||n(22),p=e.watchSubscriberAudio||n(657);return function(e){let n=e.clientCandidates,f=e.iceConfig,h=e.send,m=e.logAnalyticsEvent,g=e.p2p,b=e.codecFlags,v=e.sourceStreamId,y=e.remoteConnectionId,E=e.sessionId;const S=this;let _,w=!1,T=!1,C=null;const I=function(){this.destroy(),T&&this.trigger("iceRestartFailure",this),this.trigger("disconnected",this)},R=function(e){this.trigger("remoteStreamAdded",e,this)},x=function(e){this.trigger("remoteStreamRemoved",e,this)},O=e=>{this.trigger("remoteVideoSupported",e)},k=function(e){let t=e.reason,n=e.prefix;this.trigger("error",null,t,this,n)},N=function(e){!T||"connected"!==e&&"completed"!==e||(T=!1,this.trigger("iceRestartSuccess")),"connected"===e&&this.trigger("connected"),this.trigger("iceConnectionStateChange",e)},Z=function(e){this.trigger("signalingStateChange",e)},A=function(e){this.trigger("signalingStateStable",e)},L=(e,t)=>{"answer"!==e&&"pranswer"!==e||this.trigger("connected"),h(e,t)};i(this),this.close=function(){w||(w=!0,_&&(_.disconnect(),_=null),this.off())},this.destroy=function(){this.stopAudioStatsWatcher(),w||this.close()},this.getDataChannel=function(e,t,n){_.getDataChannel(e,t,n)},this.getSourceStreamId=()=>_.getSourceStreamId(),this.processMessage=function(e,t){_.processMessage(e,t)},this.remoteDescription=function(){return _.remoteDescription()},this.getStats=function(e){if(_)_.getStats(e);else{const n=d.PEER_CONNECTION_NOT_CONNECTED;e(new t.Error(l.getTitleByCode(n),u.PEER_CONNECTION_NOT_CONNECTED,{code:n}))}},this.getSynchronizationSources=function(e){if(_)_.getSynchronizationSources(e);else{const n=d.PEER_CONNECTION_NOT_CONNECTED;e(new t.Error(l.getTitleByCode(n),u.PEER_CONNECTION_NOT_CONNECTED,{code:n}))}},this.getRtcStatsReport=function(e){if(_)_.getRtcStatsReport(e);else{const n=d.PEER_CONNECTION_NOT_CONNECTED;e(new t.Error(l.getTitleByCode(n),u.PEER_CONNECTION_NOT_CONNECTED,{code:n}))}},this.startAudioStatsWatcher=function(e){C||(C=p(_.getStats.bind(_),e=>{this.stopAudioStatsWatcher(),this.trigger("audioLevelStuckWarning",e)},e))},this.stopAudioStatsWatcher=function(){C&&C.stop(),C=null};const V=function(e){return function(t){_&&_.remoteTracks().forEach(n=>{n.kind===e&&n.enabled!==t&&(n.enabled=t)})}};this.subscribeToAudio=V("audio"),this.subscribeToVideo=V("video"),this.hasRelayCandidates=function(){return _.hasRelayCandidates()},this.iceRestart=function(){return T=!0,_.iceRestart()},this.iceConnectionStateIsConnected=function(){return _.iceConnectionStateIsConnected()},this.init=function(e){o(v)&&s(f);c({iceConfig:f},(t,i)=>{if(t)return void e(t);const o=r({logAnalyticsEvent:m,clientCandidates:n,codecFlags:b,sourceStreamId:v,sessionId:E},i);_=new a(r({sendMessage:L,p2p:g},o,{remoteConnectionId:y})),_.on({iceConnected:()=>S.emit("iceConnected"),close:I,streamAdded:R,streamRemoved:x,signalingStateChange:Z,signalingStateStable:A,error:k,qos:e=>this.trigger("qos",e),iceConnectionStateChange:N,remoteVideoSupported:O},S),_.remoteTracks().length>0?_.remoteStreams().forEach(R,S):e(void 0,S)})}}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=(e.generateSimpleStateMachine||n(164)())("NotPublishing",["NotPublishing","GetUserMedia","BindingMedia","MediaBound","PublishingToSession","Publishing","Failed","Destroyed"],{NotPublishing:["NotPublishing","GetUserMedia","Destroyed"],GetUserMedia:["BindingMedia","Failed","NotPublishing","Destroyed"],BindingMedia:["MediaBound","Failed","NotPublishing","Destroyed"],MediaBound:["NotPublishing","PublishingToSession","Failed","Destroyed"],PublishingToSession:["NotPublishing","Publishing","Failed","Destroyed","MediaBound"],Publishing:["NotPublishing","MediaBound","Failed","Destroyed"],Failed:["Destroyed"],Destroyed:[]});return t.prototype.isDestroyed=function(){return"Destroyed"===this.current},t.prototype.isAttemptingToPublish=function(){return-1!==["GetUserMedia","BindingMedia","MediaBound","PublishingToSession"].indexOf(this.current)},t.prototype.isPublishing=function(){return"Publishing"===this.current},t}},function(e,t,n){"use strict";function r(e){this.message=e||"Operation has been canceled.",this.name="CancellationError",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.prototype=Object.create(Error.prototype),r.prototype.constructor=r},function(e,t,n){var r=n(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return r.resolve(e).then(e=>r.resolve(t()).then(()=>e),e=>r.resolve(t()).then(()=>r.reject(e)))}},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(20)),o=r(n(7)),s=r(n(8));const a=n(141),c=n(148),u=n(9),d=n(278),l=n(58),p=n(50),f=n(169).CancellationError,h=n(19),m=n(42),g=n(49),b=n(270),v=n(27),y=n(6),E=n(666),S=n(104),_=n(63),w=n(667),T=n(4),C=n(168)(),I=n(668),R=n(284),x=n(144),O=n(285),k=n(145),N=n(3),Z=n(4),A=n(23)(),L=n(10),V=n(75),P=n(305),M=n(306),D=n(669),W=n(166)(),G=n(1)("Subscriber"),X=n(286)(),j=n(287),U=n(13)(),F=n(22),Y=n(5),B=n(153),K=n(143)(void 0!==typeof window?window:global),H=n(102)({global:K}),J=n(300)({PeerConnection:H}),z=n(307),Q=n(672),q=n(673),$=n(674),ee=n(675),te=n(308),ne=n(101).parseIceServers,re=n(676),ie=n(677),oe=n(678),se=n(310),ae=n(171),ce=n(157),ue=(e,t)=>e.connection.id===t.connection.id;function de(e,t){const n=t&&t.hasVideo&&e&&0===e.getVideoTracks().length,r=t&&t.hasAudio&&e&&0===e.getAudioTracks().length;return!(n||r)}e.exports=function(e){let n=void 0===e?{}:e,r=n.AudioLevelMeter,K=void 0===r?R:r,H=n.AudioLevelTransformer,le=void 0===H?x:H,pe=n.BackingBar,fe=void 0===pe?O:pe,he=n.Chrome,me=void 0===he?k:he,ge=n.env,be=void 0===ge?N:ge,ve=n.Errors,ye=void 0===ve?Z:ve,Ee=n.Events,Se=void 0===Ee?A:Ee,_e=n.ExceptionCodes,we=void 0===_e?L:_e,Te=n.audioLevelSampler,Ce=void 0===Te?D:Te,Ie=n.getStatsHelpers,Re=void 0===Ie?V:Ie,xe=n.hasAudioOutputLevelStatCapability,Oe=void 0===xe?P:xe,ke=n.hasRemoteStreamsWithWebAudio,Ne=void 0===ke?M:ke,Ze=n.interpretPeerConnectionError,Ae=void 0===Ze?W:Ze,Le=n.logging,Ve=void 0===Le?G:Le,Pe=n.MuteButton,Me=void 0===Pe?X:Pe,De=n.NamePanel,We=void 0===De?j:De,Ge=n.otError,Xe=void 0===Ge?U:Ge,je=n.OTErrorClass,Ue=void 0===je?F:je,Fe=n.OTHelpers,Ye=void 0===Fe?Y:Fe,Be=n.StylableComponent,Ke=void 0===Be?B:Be,He=n.SubscriberPeerConnection,Je=void 0===He?J:He,ze=n.SubscribingState,Qe=void 0===ze?z:ze,qe=n.VideoDisabledIndicator,$e=void 0===qe?Q:qe,et=n.AudioBlockedIndicator,tt=void 0===et?q:et,nt=n.VideoUnsupportedIndicator,rt=void 0===nt?$:nt,it=n.watchFrameRate,ot=void 0===it?ee:it,st=n.createSendMethod,at=void 0===st?te:st,ct=n.parseIceServers,ut=void 0===ct?ne:ct,dt=n.document,lt=void 0===dt?(void 0!==typeof window?window:global).document:dt,pt=n.WidgetView,ft=void 0===pt?C:pt;const ht=function e(n,r,C){var R=this;if(void 0===r&&(r={}),void 0===C&&(C=()=>{}),void 0===r.analytics)throw new Error("Subscriber requires an instance of analytics");const x=r.analytics,O=h(),k=e.hasAudioOutputLevelStatCapability()||Ne(),N=this,Z={},A={},L={},V={},P={};let M,D,W,G,X,j,U,F,Y,B,H,J,z,Q,q,$,ee,te,ne=!1,pe=n||O,he=r.session,ge=r.stream,ve=!1,Ee={},_e=null,Te=!1,Ie=!0,xe=[],Oe=a({},r,{showControls:!0,testNetwork:!1,fitMode:ge.defaultFitMode||"cover",insertDefaultUI:!0});const ke=he.sessionInfo.isAdaptiveEnabled,Ze={P2P:v.SUBSCRIBER_DISCONNECTED,MANTIS:v.SUBSCRIBER_DISCONNECTED},Le="Chrome"===be.name&&be.version>=58||be.isChromiumEdge||be.isOpera,Pe=he._.getSocket(),De=()=>d(A),Ge=e=>A[e],je=()=>A[te],Fe=function(){var e=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A[t];case 2:e.sent.close(),delete A[t];case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Be=e=>{delete L[e]},He=function(){var e=(0,s.default)(o.default.mark((function e(t){var n,r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return n={error:bt,audioVolume:q},r=ke&&"P2P"===te,e.prev=4,e.next=7,M.bindVideo(t,n,r);case 7:e.next=18;break;case 9:if(e.prev=9,e.t0=e.catch(4),!(e.t0 instanceof f||j.isDestroyed())){e.next=13;break}return e.abrupt("return");case 13:if(!e.t0.message.includes("bufferFailed")){e.next=16;break}return R._.startRelayedToRoutedTransition(),e.abrupt("return");case 16:throw bt(e.t0),e.t0;case 18:case"end":return e.stop()}}),e,null,[[4,9]])})));return function(t){return e.apply(this,arguments)}}(),Je=function(){var e=(0,s.default)(o.default.mark((function e(t,n){var r,i,s;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=!1,"function"==typeof t?n=t:r="rtcStatsReport"===t,r?Zt():Nt(),!r||se){e.next=7;break}return i=we.GET_RTC_STATS_REPORT_NOT_SUPPORTED,n(Xe(T.GET_RTC_STATS_REPORT_NOT_SUPPORTED,new Error(Ue.getTitleByCode(i)),i)),e.abrupt("return");case 7:if(je()){e.next=11;break}return i=we.PEER_CONNECTION_NOT_CONNECTED,n(Xe(ye.PEER_CONNECTION_NOT_CONNECTED,new Error(Ue.getTitleByCode(i)),i)),e.abrupt("return");case 11:return e.next=13,je();case 13:s=e.sent,(r?s.getRtcStatsReport:s.getStats)((e,t)=>{e?(e.code===we.PEER_CONNECTION_NOT_CONNECTED&&(e=Xe(ye.PEER_CONNECTION_NOT_CONNECTED,e,we.PEER_CONNECTION_NOT_CONNECTED)),n(e)):n(null,t)});case 16:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),ze=(e,t,n,r,i)=>{let o=u({action:e,variation:t,payload:n,streamId:ge?ge.id:null,sessionId:he?he.sessionId:null,connectionId:he&&he.isConnected()?he.connection.connectionId:null,partnerId:he&&he.sessionInfo?he.sessionInfo.partnerId:null,subscriberId:O,widgetType:"Subscriber"},r);("Failure"===t||"iceconnectionstatechange"===t&&"closed"===n)&&(o=u(o,Ee));const s=[o];i&&s.push(i),x.logEvent(...s)},qe=(e,t,n)=>{"Attempt"===t?(V[e]=(new Date).getTime(),ze(e,t,n)):"Failure"!==t&&"Success"!==t||ze(e,t,n,{attemptDuration:(new Date).getTime()-V[e]})},et=function(e,t){void 0===t&&(t={}),qe("RoutedToRelayedTransition",e,t)},nt=function(e,t){void 0===t&&(t={}),qe("RelayedToRoutedTransition",e,t)},it=ie({onInvalidTransition(e,t){const n=`Invalid state transition: Event '${e}' not possible in state '${t}'`;Ve.error(n),ze("Subscriber:InvalidStateTransition","Event",{details:n})}});{const e="Unable to subscribe to stream in a reasonable amount of time";re({connectivityState:it,onWarning(){st("Warning",{})},onTimeout:()=>{if(M&&M.addError(e),j.isAttemptingToSubscribe()){j.set("Failed"),this._disconnect({noStateTransition:!0});const t=Xe(T.TIMEOUT,new Error(e),we.UNABLE_TO_SUBSCRIBE);it.fail({options:{failureReason:"Subscribe",failureMessage:e,failureCode:we.UNABLE_TO_SUBSCRIBE},error:t})}},warningMs:15e3,timeoutMs:3e4})}if(Z.promise=new t((e,t)=>{Z.resolve=e,Z.reject=t}),Oe.testNetwork&&he.sessionInfo.p2pEnabled&&Ve.warn("You cannot test your network with a relayed session. Use a routed session."),this.id=pe,this.widgetId=O,this.session=he,this.stream=Oe.stream,ge=Oe.stream,this.streamId=ge.id,!he)return Ue.handleJsException({errorMsg:"OT.Subscriber must be passed a session option",code:2e3,target:this,analytics:x}),null;y(this),N.once("subscribeComplete",(function(){try{C(...arguments)}catch(e){Ve.error("Completion handler threw an exception",e)}}));it.observe({onEnterConnecting(){st("Attempt",null,{})},onEnterConnected(){st("Success",null,{})},onEnterDisconnected(e,t){let n=void 0===t?{}:t,r=n.options,i=void 0===r?{}:r,o=n.payload,s=void 0===o?null:o;st((e=>{let t=e.transition,n=e.from;return"fail"===t?"connected"===n?"Disconnect":"Failure":"disconnect"===t&&"connected"===n?"Disconnect":"Cancel"})(e),s,i)}}),it.observe({onEnterConnected:()=>{this.trigger("subscribeComplete",void 0,this)},onEnterDisconnected:function(e,t){let n=e.from,r=(void 0===t?{}:t).error;"connecting"===n&&R.trigger("subscribeComplete",r||new Error("An unknown error occurred"),R)}}),oe({connectivityState:it,logAttempt(){ze("Subscribe","Attempting",null,{connectionId:he&&he.isConnected()?he.connection.connectionId:null})}});const st=(e,t,n)=>{"Attempt"===e&&(J=(new Date).getTime()),ze("Subscribe",e,t,"Failure"===e||"Success"===e||"Cancel"===e?(0,i.default)({},n,{attemptDuration:(new Date).getTime()-J}):n)},ct=(e,t)=>{ze("ICERestart",e,t)},dt=e=>{var t,n;let r=e.parsedStats,o=e.remoteConnectionId,s=e.peerId,a=e.sourceStreamId;const c={widgetType:"Subscriber",width:M.width,height:M.height,audioTrack:Y&&Y.getAudioTracks().length>0,hasAudio:ge&&ge.hasAudio,subscribeToAudio:Q,audioVolume:this.getAudioVolume(),videoTrack:Y&&Y.getVideoTracks().length>0,connectionId:he?he.connection.connectionId:null,hasVideo:ge&&ge.hasVideo,subscribeToVideo:Oe.subscribeToVideo,congestionLevel:_e,streamId:ge.id,subscriberId:O,duration:Math.round((g()-X)/1e3),remoteConnectionId:o,peerId:s,sourceStreamId:ae(a),preferredResolutionHeight:null==(t=Oe.preferredResolution)?void 0:t.height,preferredResolutionWidth:null==(n=Oe.preferredResolution)?void 0:n.width,preferredFrameRate:Oe.preferredFrameRate,audioFallback:!B&&"auto"===H},d=u(c,r);x.logQOS(d),this.trigger("qos",(0,i.default)({},x.commonQoSFields(),d))},pt=()=>{!j.isSubscribing()&&M&&M.video()&&(ne=!0,Te||(it.connect(),Te=!0),Ve.debug("OT.Subscriber.onLoaded"),j.set("Subscribing"),X=g(),M.loading(!1),D&&D.showAfterLoading(),ve&&ge.setRestrictFrameRate(!0),G&&G.audioOnly(M.audioOnly()),this.setAudioVolume(q),this.trigger("loaded",this))},ft=()=>ge&&ge.hasAudio&&Q&&this.getAudioVolume()>0&&!this.isAudioBlocked(),ht=e=>{let t=!1;if(!("audioLevelStuckAt0"===e&&(!ft()||ge&&ge.hasVideo))&&(ze("subscriber:onAudioWarning","Event",{reason:e}),M)){if(M.rebindSrcObject(),ze("subscriber:rebindSrcObject","Called"),"audioLevelStuck"===e)return;t=!0}mt(t)},mt=function(){var e=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===t&&(t=!1),!Le){e.next=6;break}return e.next=4,je();case 4:e.sent.startAudioStatsWatcher(t);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),gt=()=>{Ve.debug("OT.Subscriber has been disconnected from the Publisher's PeerConnection"),it.fail({options:{failureReason:"PeerConnectionError",failureCode:we.UNABLE_TO_PUBLISH,failureMessage:"PeerConnection disconnected"},error:Xe(ye.DISCONNECTED,new Error("ClientDisconnected"))}),this._disconnect({noStateTransition:!0}),(j.isAttemptingToSubscribe()||j.isSubscribing())&&j.set("Failed")},bt=e=>{const t=Xe(ye.MEDIA_ERR_DECODE,e,e.code||we.P2P_CONNECTION_FAILED);t.message="OT.Subscriber while playing stream: "+t.message,Ve.error("OT.Subscriber.onVideoError"),it.fail({options:{failureReason:"VideoElement",failureMessage:t.message,failureCode:t.code||we.P2P_CONNECTION_FAILED},error:t});const n=j.isAttemptingToSubscribe();j.set("Failed"),n||N.trigger("error",t.message),Ue.handleJsException({error:t,code:we.UNABLE_TO_SUBSCRIBE,target:N,analytics:x})},vt=e=>{const t=w(e);Ue.handleJsException({error:t,code:t.code,target:N,analytics:x}),this._disconnect({noStateTransition:!0});const n={failureReason:"Subscribe",failureMessage:"OT.Subscriber PeerConnection Error: "+t.message,failureCode:we.P2P_CONNECTION_FAILED};Ot(t.code),it.fail({options:n,error:Xe(t.name,new Error("Subscribe: Subscriber PeerConnection with connection (not found) failed: "+t.message),t.code)}),t.name===T.STREAM_NOT_FOUND&&this._destroy({reason:"streamNotFound",noStateTransition:!0})},yt=(e,t,n,r)=>{if("SetRemoteDescription"===r&&!Ie&&t.match(/Unsupported video without audio for fallback/)){let e;return M&&M.addError("The stream is unable to be played.","Your browser does not support the video format."),e="Safari"===Ye.env.name?new Error("VP8 is not supported in this version of Safari. You might want to consider switching to an H264 project. See https://tokbox.com/safari for more information."):new Error("Video format not supported in this browser."),e.code=we.UNSUPPORTED_VIDEO_CODEC,void bt(e)}if("ICEWorkflow"===r&&he.sessionInfo.reconnection&&ne)return void Ve.debug("Ignoring peer connection failure due to possibility of reconnection.");let i;i="ICEWorkflow"===r?we.SUBSCRIBER_ICE_WORKFLOW_FAILED:e===we.STREAM_LIMIT_EXCEEDED?e:we.P2P_CONNECTION_FAILED;const o={failureReason:r||"PeerConnectionError",failureMessage:"OT.Subscriber PeerConnection Error: "+t,failureCode:i},s=Ae(e,t,r,"(not found)","Subscriber");if(it.fail({options:o,error:s}),j.isAttemptingToSubscribe()){const e={hasRelayCandidates:n&&n.hasRelayCandidates()};ze("createPeerConnection","Failure",e,o),j.set("Failed")}else j.isSubscribing()&&(j.set("Failed"),this.trigger("error",t));this._disconnect({noStateTransition:!0}),404===Number(e)&&this._destroy({noStateTransition:!0}),Ue.handleJsException({errorMsg:"OT.Subscriber PeerConnection Error: "+t,errorCode:i,target:this,analytics:x}),Ot(e)},Et=function(){var e=(0,s.default)(o.default.mark((function e(n,r){var i,s,a,c,u,d,l;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=1===Object.keys(L).length,s=null==r?void 0:r.getSourceStreamId(),a=he.sessionInfo,Y=n,s&&(L[s]=n),Ve.debug("OT.Subscriber.onRemoteStreamAdded with sourceStreamId",s),e.prev=6,e.next=9,E(()=>de(Y,ge));case 9:e.next=18;break;case 11:if(e.prev=11,e.t0=e.catch(6),"TIMEOUT"!==e.t0.message){e.next=17;break}Ve.error("The expected tracks never arrived"),e.next=18;break;case 17:throw e.t0;case 18:return j.set("BindingRemoteStream"),R.subscribeToAudio(Q),H="loading",R.subscribeToVideo(Oe.subscribeToVideo,"loading"),a.p2pEnabled||"P2P"===s||(R.setPreferredResolution(Oe.preferredResolution),R.setPreferredFrameRate(Oe.preferredFrameRate)),n.getVideoTracks().forEach(e=>{(void 0!==typeof window?window:global).webkitMediaStream?e.enabled=!1:e.enabled=ge.hasVideo&&Oe.subscribeToVideo}),e.next=26,He(n);case 26:if(mt(),!j.isDestroyed()){e.next=29;break}throw new Error("Subscriber destroyed");case 29:return(void 0!==typeof window?window:global).webkitMediaStream&&n.getVideoTracks().forEach(e=>{e.enabled=ge.hasVideo&&Oe.subscribeToVideo}),(c=M&&M.video())&&c.orientation({width:ge.videoDimensions.width,height:ge.videoDimensions.height,videoOrientation:ge.videoDimensions.orientation}),(u=D&&D.videoUnsupportedIndicator)&&u.setVideoUnsupported(!Ie),d=new t((e,t)=>{const n=M&&M.video();n&&n.domElement()?e():(M.once("videoElementCreated",e),N.once("destroyed",t))}),e.next=37,d;case 37:return e.next=39,Z.promise;case 39:if(i?j.set("Subscribing"):pt(),U&&"webRTCStream"in U&&n.getAudioTracks().length>0&&U.webRTCStream(n),!((l=Ye.env).isSafari||l.isChromiumEdge||l.isOpera||"Chrome"===l.name&&l.version>=58||l.isFirefox&&l.version>=96)){e.next=48;break}return ee&&(ee.destroy(),ee=null),e.next=46,je();case 46:(r=e.sent)&&(ee=ot(r.getStats.bind(r)));case 48:i||R.trigger("streamAdded",R);case 49:case"end":return e.stop()}}),e,null,[[6,11]])})));return function(t,n){return e.apply(this,arguments)}}(),St=e=>{Y=null,Ve.debug("OT.Subscriber.onStreamRemoved");const t=M&&M.video();t&&t.stream===e&&M.destroyVideo(),Be(te),this.trigger("streamRemoved",this)},_t=e=>{Ie!==e&&this.dispatchEvent(new Se.VideoEnabledChangedEvent(e?"videoEnabled":"videoDisabled",{reason:e?"codecChanged":"codecNotSupported"})),Ie=e},wt=e=>{M.setAudioBlockedUi(e);const t=D&&D.audioBlockedIndicator;t&&t.setAudioBlocked(e);const n=D&&D.videoUnsupportedIndicator;n&&n.setVideoUnsupported(!e&&!Ie)};this.on("audioBlocked",()=>{wt(!0)}),this.on("audioUnblocked",()=>{wt(!1)});const Tt={new:v.SUBSCRIBER_DISCONNECTED,checking:v.SUBSCRIBER_DISCONNECTED,connected:v.SUBSCRIBER_CONNECTED,completed:v.SUBSCRIBER_CONNECTED,disconnected:v.SUBSCRIBER_DISCONNECTED},Ct=(e,t)=>{const n=Tt[e],r=t.getSourceStreamId(),i=Ze[r];n&&n!==i&&(Ze[r]=n,"disconnected"===e&&"P2P"!==r&&setTimeout((0,s.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=he._.isSocketReconnecting,"disconnected"!==Ze[r]||!Pe.is("connected")||t()){e.next=4;break}return e.next=4,R._.iceRestart("peer connection disconnected");case 4:case"end":return e.stop()}}),e)}))),2e3),M&&M.loading(n!==v.SUBSCRIBER_CONNECTED),Ve.debug("OT.Subscriber.connectionStateChanged to "+e),this.dispatchEvent(new Se.ConnectionStateChangedEvent(n,this)))},It=()=>{ct("Success")},Rt=()=>{ct("Failure",{reason:"ICEWorkflow",message:"OT.Subscriber PeerConnection Error: The stream was unable to connect due to a network error. Make sure your connection isn't blocked by a firewall."})};W={get:()=>ge.getChannelsOfType("audio").length>0?N.getStyle("buttonDisplayMode"):"off",update(){const e=W.get();D&&(D.muteButton.setDisplayMode(e),D.backingBar.setMuteMode(e))}};const xt=()=>{const e={backingBar:new fe({nameMode:Oe.name?this.getStyle("nameDisplayMode"):"off",muteMode:W.get()}),name:new We({name:Oe.name,mode:this.getStyle("nameDisplayMode")}),muteButton:new Me({muted:0===q,mode:W.get()})};if(k){const t=new le;G=new K({mode:N.getStyle("audioLevelDisplayMode")});const n=new S(()=>{G.setValue(t.transform(this.loudness))});G.watchVisibilityChanged(e=>{e?n.start():n.stop()}),G.setDisplayMode(this.getStyle("audioLevelDisplayMode")),G.audioOnly(!1),e.audioLevel=G}e.videoDisabledIndicator=new $e({mode:this.getStyle("videoDisabledDisplayMode")}),e.audioBlockedIndicator=new tt({mode:this.getStyle("audioBlockedDisplayMode")}),e.videoUnsupportedIndicator=new rt({mode:this.getStyle("videoUnsupportedDisplayMode")}),M&&M.domElement&&(D=new me({parent:M.domElement}).set(e).on({muted(){N.setAudioVolume(0)},unmuted(){N.setAudioVolume($)}},this),D.hideWhileLoading())},Ot=e=>{let t,n;M&&(e===we.STREAM_LIMIT_EXCEEDED?(t="The stream was unable to connect.",n="The limit for the number of media streams has been reached."):(t="The stream was unable to connect due to a network error.",n=Te?"Ensure you have a stable connection and try again.":"Make sure you have a stable network connection and that it isn't blocked by a firewall."),M.addError(t,n))};function kt(e){De().forEach(function(){var t=(0,s.default)(o.default.mark((function t(n){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n;case 2:t.sent.subscribeToVideo(!e);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),M&&(M.audioOnly(e),M.showPoster(e)),G&&G.audioOnly(e)}Ke(this,{nameDisplayMode:"auto",buttonDisplayMode:"auto",audioLevelDisplayMode:"auto",videoDisabledDisplayMode:"auto",audioBlockedDisplayMode:"auto",backgroundImageURI:null,showArchiveStatus:!0,showMicButton:!0},Oe.showControls,e=>{ze("SetStyle","Subscriber",e,null,.1)});const Nt=p(()=>{ze("GetStats","Called")}),Zt=p(()=>{ze("GetRtcStatsReport","Called")}),At=e=>{F&&(F.destroy(),F=void 0),Y.getAudioTracks().length&&(U=Ce(e),U?F=I({subscriber:this,audioLevelSampler:U}):Object.prototype.hasOwnProperty.call(this,"loudness")||(Object.defineProperty(this,"loudness",{value:void 0,configurable:!0,writable:!1}),Ve.error("No suitable audio level samplers found, audio level visualisation will not work")))},Lt=(e,t)=>{if(P[t]){P[t].removeAll();const n=()=>{e.off("error",n),e.off("disconnected",n)};e.on("error",n),e.on("disconnected",n)}const n=_(e);n.once("connected",()=>(e=>{ke&&"P2P"===e.getSourceStreamId()&&et("Success")})(e)),n.on("disconnected",gt),n.on("error",yt),n.on("remoteStreamAdded",(0,s.default)(o.default.mark((function e(){var t=arguments;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Et(...t);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),Ve.error(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})))),n.on("audioLevelStuckWarning",ht),n.on("remoteStreamRemoved",St),n.on("signalingStateStable",(0,s.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:N.trigger("signalingStateStable"),M&&M.video()&&Y&&U&&"webRTCStream"in U&&Y.getAudioTracks().length>0&&U.webRTCStream(Y);case 3:case"end":return e.stop()}}),e)})))),n.on("iceConnectionStateChange",t=>Ct(t,e)),n.on("iceRestartSuccess",It),n.on("iceRestartFailure",Rt),n.on("remoteVideoSupported",_t),n.once("remoteStreamAdded",At.bind(this,e)),P[t]=P};this._destroy=e=>{let t=e.reason,n=void 0===t?"Unknown":t,r=e.quiet,i=e.noStateTransition,o=void 0!==i&&i;return j.isDestroyed()||(j.set("Destroyed"),ee&&(ee.destroy(),ee=null),Ee={sessionId:he.sessionId,connectionId:he&&he.isConnected()?he.connection.connectionId:null,partnerId:he&&he.sessionInfo?he.sessionInfo.partnerId:null,streamId:ge&&!ge.destroyed?ge.id:null},this._disconnect({reason:n,noStateTransition:o}),D&&(D.destroy(),D=null),M&&(M.destroy(),M.off(),M=null,this.element=null),ge&&!ge.destroyed&&ze("unsubscribe",null,{streamId:ge.id}),ge.off(z,this),this.id=null,pe=null,this.stream=null,ge=null,this.streamId=null,this.session=null,he=null,Oe=null,!0!==r&&(this.dispatchEvent(new Se.DestroyedEvent(v.SUBSCRIBER_DESTROYED,this,n)),this.off())),this},this.destroy=function(e,t){void 0===e&&(e="Unsubscribe"),Ve.warn("Subscriber#destroy is deprecated and will be removed. Please use Session#unsubscribe instead"),R._destroy({reason:e,quiet:t})},this._disconnect=function(e){let t=void 0===e?{}:e,n=t.reason,r=void 0===n?"Unknown":n;if(!t.noStateTransition&&!it.is("disconnected")){const e="Unsubscribe"===r?void 0:Xe(ye.STREAM_DESTROYED,new Error("Stream was destroyed before it could be subscribed to"));it.disconnect({payload:{reason:r},error:e})}j.isDestroyed()||j.isFailed()||j.set("NotSubscribing"),M&&M.destroyVideo(),De().forEach(function(){var e=(0,s.default)(o.default.mark((function e(t){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:e.sent.destroy();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Object.keys(A).forEach(e=>{delete A[e]}),Pe.is("connected")&&ge&&!ge.destroyed&&Pe.subscriberDestroy(ge.id,R.widgetId)},this.disconnect=()=>{Ve.warn("Subscriber#disconnect is deprecated and will be removed. Please use Session#unsubscribe instead"),this._disconnect({reason:"Unsubscribe"})};const Vt=function(){var e=(0,s.default)(o.default.mark((function e(t){var n,r,s,a,c,u,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.peerId,r=t.fromConnectionId,s=t.sourceStreamId,o={apiKey:he.apiKey,sessionId:he.sessionId,streamId:ge.id,subscriberId:R.widgetId},a=["/v2/partner",o.apiKey,"session",o.sessionId,"stream",o.streamId,"subscriber",o.subscriberId].join("/"),c=at({socket:R.session._.getSocket(),uri:a,content:{peerId:n,sourceStreamId:s}}),u=function(e,t,r,o,a){void 0===o&&(o={});const c=(0,i.default)({peerId:n,sourceStreamId:ae(s)},o);return ze(e,t,r,c,a)},d=e=>{te===s&&dt((0,i.default)({},e,{peerId:n,remoteConnectionId:r,sourceStreamId:s}))},e.abrupt("return",R._setupPeerConnection({send:c,log:u,logQoS:d,sourceStreamId:s}));case 6:case"end":return e.stop()}var o}),e)})));return function(t){return e.apply(this,arguments)}}();function Pt(e){const t=M&&M.video();if(t)try{t.setAudioVolume(e)}catch(e){Ve.warn("setAudioVolume: "+e),0===q&&(Ve.info("Using subscribeToAudio to mute Audio because setAudioVolume(0) failed"),N.subscribeToAudio(!1))}D&&D.muteButton.muted(0===e)}this.processMessage=function(){var e=(0,s.default)(o.default.mark((function e(t,n,r){var i,s,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ve.debug(`OT.Subscriber.processMessage: Received ${t} message from ${n}`),Ve.debug(r),i=l(r,"content.peerId"),s=l(r,"content.sourceStreamId"),e.next=6,Ge(s);case 6:if(!(a=e.sent)){e.next=11;break}a.processMessage(t,r),e.next=16;break;case 11:if("offer"!==t){e.next=16;break}return e.next=14,Vt({peerId:i,fromConnectionId:n,sourceStreamId:s});case 14:a=e.sent,R.session._.addSubscriberToPeerConnectionsQueue(a,r);case 16:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),this.disableVideo=e=>{if(e){if("auto"!==H)return void Ve.info("Video was not re-enabled because it was manually disabled");Ve.info("Video has been re-enabled")}else Ve.warn("Due to high packet loss and low bandwidth, video has been disabled");this.subscribeToVideo(e,"auto");ze("updateQuality","video",e?{videoEnabled:!0}:{videoDisabled:!0})},this.getImgData=()=>{if(!this.isSubscribing())return Ve.error("OT.Subscriber.getImgData: Cannot getImgData before the Subscriber is subscribing."),null;const e=M&&M.video();return e?e.imgData():null},this.getStats=e=>{(e=>{Je(e)})((t,n)=>{if(t)return void e(t);const r={timestamp:0};n.forEach(e=>{if(Re.isInboundStat(e)){const t=Re.isVideoStat(e,n),i=Re.isAudioStat(e,n);(i||t)&&(r.timestamp=Re.normalizeTimestamp(e.timestamp)),t?(c(r,{video:Re.parseStatCategory(e)}),ee&&c(r,{video:{frameRate:ee.getFrameRateFromStat(e)}})):i&&c(r,{audio:Re.parseStatCategory(e)})}}),e(null,r)})},this.getRtcStatsReport=()=>new t((e,t)=>{Je("rtcStatsReport",(n,r)=>{n?t(n):e(r)})}),this.setAudioVolume=e=>{const t=function(e){return Math.max(0,Math.min(100,parseInt(e,10)))}(e);return ze("setAudioVolume","Attempt",{audioVolume:t}),isNaN(t)?(Ve.error("OT.Subscriber.setAudioVolume: value should be an integer between 0 and 100"),ze("setAudioVolume","Failure",{message:"value should be an integer between 0 and 100"}),this):(t!==e&&Ve.warn("OT.Subscriber.setAudioVolume: value should be an integer between 0 and 100"),t===q?(Pt(q),ze("setAudioVolume","Success",{audioVolume:q,message:"Requested volume is same as already set audioVolume"}),this):(q>0&&($=q),q=t,Pt(q),q>0&&!Q&&($=q,this.subscribeToAudio(!0)),ze("setAudioVolume","Success",{audioVolume:q}),this))},this.getAudioVolume=()=>{const e=M&&M.video();if(e)try{return e.getAudioVolume()}catch(e){Ve.warn("getAudioVolume "+e)}return q},this.subscribeToAudio=e=>{const t=b(e,!0);De().forEach(function(){var e=(0,s.default)(o.default.mark((function e(n){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n;case 2:e.sent.subscribeToAudio(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),ge&&0!==De().length&&ge.setChannelActiveState("audio",t);const n=Q!==t;return Q=t,n&&this.setAudioVolume(t?$:0),ze("subscribeToAudio","Event",{subscribeToAudio:t}),this};const Mt={auto:"quality",publishVideo:"publishVideo",subscribeToVideo:"subscribeToVideo"};if("Safari"===be.name){const e=()=>{!lt.hidden&&Oe.subscribeToVideo&&(Ve.debug("document visibility restored in Safari - resubscribing to video"),this.subscribeToVideo(!1),this.subscribeToVideo(!0))};lt.addEventListener("visibilitychange",e),this.once("destroyed",()=>{lt.removeEventListener("visibilitychange",e)})}if(this.subscribeToVideo=(e,t)=>{const n=b(e,!0);return ze("subscribeToVideo","Attempt",{subscribeToVideo:n,reason:t}),kt(!n||!ge.hasVideo||!(Y&&Y.getVideoTracks().length>0)),ge.hasVideo&&Y&&0===Y.getVideoTracks().length?(n&&Ve.info("Subscriber is audio-only due to incompatibility, can't subscribeToVideo."),Oe.subscribeToVideo=!1,ze("subscribeToVideo","Failure",{message:"No video tracks available"}),this):(D&&D.videoDisabledIndicator&&D.videoDisabledIndicator.disableVideo("auto"===t&&!n),De().length>0&&he&&ge&&(n!==Oe.subscribeToVideo||t!==H)&&ge.setChannelActiveState("video",n,t),Oe.subscribeToVideo=n,H=t,B=n,ze("subscribeToVideo","Success",{subscribeToVideo:n,reason:t}),"loading"!==t&&(this.dispatchEvent(new Se.VideoEnabledChangedEvent(n?"videoEnabled":"videoDisabled",{reason:Mt[t]||"subscribeToVideo"})),"videoDisabled"===n&&"auto"===t&&(_e=2)),this)},this.setPreferredResolution=e=>{if(j.isDestroyed()||0===De().length&&"Connecting"===!j.current)return void Ve.warn("Cannot set the max Resolution when not subscribing to a publisher");if(Oe.preferredResolution=e,he.sessionInfo.p2pEnabled)return void Ve.warn("OT.Subscriber.setPreferredResolution will not work in a P2P Session");if(!j.isStreamAdded())return;const t=ge.getPreferredResolution();t&&e&&t.width===e.width&&t.height===e.height||!t&&!e||ge.setPreferredResolution(e)},this.setPreferredFrameRate=e=>{if(j.isDestroyed()||0===De().length&&"Connecting"===!j.current)return void Ve.warn("Cannot set the max frameRate when not subscribing to a publisher");if(Oe.preferredFrameRate=e,he.sessionInfo.p2pEnabled)return void Ve.warn("OT.Subscriber.setPreferredFrameRate will not work in a P2P Session");const t=ge.getPreferredFrameRate();e&&t&&t===e||!t&&!e||ge.setPreferredFrameRate(e)},this.isSubscribing=()=>j.isSubscribing(),this.isWebRTC=!0,this.isLoading=()=>M&&M.loading(),this.isAudioBlocked=()=>Boolean(M&&M.isAudioBlocked()),this.videoElement=()=>{const e=M&&M.video();return e?e.domElement():null},this.videoWidth=()=>{const e=M&&M.video();return e?e.videoWidth():void 0},this.videoHeight=()=>{const e=M&&M.video();return e?e.videoHeight():void 0},this._subscribeToSelf=(0,s.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=he.getPublisherForStream(ge))&&t._.webRtcStream()){e.next=5;break}it.fail({payload:{reason:"streamNotFound"},error:Xe(ye.STREAM_DESTROYED,new Error("Tried to subscribe to a local publisher, but its stream no longer exists"))}),e.next=14;break;case 5:return Z.resolve(),e.prev=6,e.next=9,Et(t._.webRtcStream());case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),Ve.error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[6,11]])}))),this._setupPeerConnection=function(){var n=(0,s.default)(o.default.mark((function n(r){var i,s,a,c;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=r.send,s=r.log,a=r.logQoS,c=r.sourceStreamId,Oe.testNetwork&&R.setAudioVolume(0),0===De().length&&j.set("Connecting"),te=c,A[c]=new t((t,n)=>{he._.getIceConfig().then(r=>{r.needRumorIceServersFallback&&(r.servers=[...xe||[],...r.servers||[]]);const o={iceConfig:r,subscriberId:R.widgetId,send:i,logAnalyticsEvent:s,p2p:he.sessionInfo.p2pEnabled,sourceStreamId:c,remoteConnectionId:ge.connection.id,sessionId:he.id};Object.prototype.hasOwnProperty.call(Oe,"codecFlags")&&(o.codecFlags=Oe.codecFlags);const u=new e.SubscriberPeerConnection(o);u.once("iceConnected",Z.resolve),u.once("error",Z.reject),u.on("qos",a),Lt(u,c),u.init(e=>{e?n(e):t(u)})})}),n.abrupt("return",A[c]);case 6:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),this.restrictFrameRate=e=>(Ve.debug(`OT.Subscriber.restrictFrameRate(${e})`),ze("restrictFrameRate",e.toString(),{streamId:ge.id}),he.sessionInfo.p2pEnabled&&Ve.warn("OT.Subscriber.restrictFrameRate: Cannot restrictFrameRate on a P2P session"),"boolean"!=typeof e?Ve.error("OT.Subscriber.restrictFrameRate: expected a boolean value got a "+typeof e):(ve=e,ge.setRestrictFrameRate(e)),this),this.on("styleValueChanged",(e,t)=>{if(D)switch(e){case"nameDisplayMode":D.name.setDisplayMode(t),D.backingBar.setNameMode(t);break;case"videoUnsupportedDisplayMode":D.videoUnsupportedIndicator.setDisplayMode(t);break;case"videoDisabledDisplayMode":D.videoDisabledIndicator.setDisplayMode(t);break;case"audioBlockedDisplayMode":D.audioBlockedIndicator.setDisplayMode(t);break;case"showArchiveStatus":D.archive.setShowArchiveStatus(t);break;case"buttonDisplayMode":W.update();break;case"audioLevelDisplayMode":D.audioLevel.setDisplayMode(t);break;case"bugDisplayMode":break;case"backgroundImageURI":M.setBackgroundImageURI(t)}},this),this._={getDataChannel:(e,t,n)=>(0,s.default)(o.default.mark((function r(){return o.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(je()){r.next=3;break}return n(new Ye.Error("Cannot create a DataChannel before there is a publisher connection.")),r.abrupt("return");case 3:return r.next=5,je();case 5:r.sent.getDataChannel(e,t,n);case 6:case"end":return r.stop()}}),r)})))(),iceRestart:e=>(0,s.default)(o.default.mark((function t(){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ge("MANTIS");case 2:(n=t.sent)?(ct("Attempt",{reason:e}),Ve.debug("Subscriber: iceRestart attempt"),n.iceRestart()):Ve.debug("Subscriber: Skipping ice restart, we have no peer connection");case 4:case"end":return t.stop()}}),t)})))(),unblockAudio:()=>M&&M.unblockAudio(),webRtcStream:()=>Y,privateEvents:new m,startRoutedToRelayedTransition:()=>(0,s.default)(o.default.mark((function e(){var t;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Oe.testNetwork&&!ue(ge,he)){e.next=2;break}return e.abrupt("return");case 2:return et("Attempt"),e.next=5,Ge("MANTIS");case 5:if(null==(t=e.sent)?void 0:t.iceConnectionStateIsConnected()){e.next=9;break}return et("Failure",{reason:"Attempted to transition to Relayed without being connected in Routed mode."}),e.abrupt("return");case 9:Pe.subscriberCreate(ge.id,O,Xt,"P2P",ce(),(e,t)=>{e&&!it.is("disconnected")&&et("Failure",e),Ve.debug("message received when created a subscriber with source",t)});case 10:case"end":return e.stop()}}),e)})))(),startRelayedToRoutedTransition:()=>(0,s.default)(o.default.mark((function e(){var t,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Oe.testNetwork&&!ue(ge,he)){e.next=2;break}return e.abrupt("return");case 2:return nt("Attempt"),t=L.MANTIS,Y=t,e.next=7,He(t);case 7:return M.loading(!1),Fe("P2P"),te="MANTIS",Be("P2P"),e.next=13,je();case 13:n=e.sent,At(n),nt("Success");case 16:case"end":return e.stop()}}),e)})))(),setSinkId(e){if(M&&M.video())return M.setSinkId(e);Ve.debug("Called setAudioOutputDevice on a subscriber without a video element")},pauseAndPlayVideoElement(){M&&M.pauseAndPlayVideoElement()}},j=new Qe(e=>{Ve.error("OT.Subscriber State Change Failed: ",e.message),Ve.debug(e)}),Ve.debug("OT.Subscriber: subscribe to "+ge.id),j.set("Init"),!ge)return Ve.error("OT.Subscriber: No stream parameter."),!1;var Dt;z={updated:e=>{const t=M&&M.video();switch(e.changedProperty){case"videoDimensions":if(!t)break;t.orientation({width:e.newValue.width,height:e.newValue.height,videoOrientation:e.newValue.orientation}),this.dispatchEvent(new Se.VideoDimensionsChangedEvent(this,e.oldValue,e.newValue));break;case"videoDisableWarning":D&&D.videoDisabledIndicator.setWarning(e.newValue),this.dispatchEvent(new Se.VideoDisableWarningEvent(e.newValue?"videoDisableWarning":"videoDisableWarningLifted")),_e="videoDisableWarning"===e.newValue?1:null;break;case"hasVideo":kt(!ge.hasVideo||!Oe.subscribeToVideo),be.isSafari&&!ge.hasVideo&&M&&M.bindAudioTrackOnly(),this.dispatchEvent(new Se.VideoEnabledChangedEvent(ge.hasVideo?"videoEnabled":"videoDisabled",{reason:"publishVideo"}));break;case"hasAudio":W.update()}}},ge.on(z,this),Oe.name=Oe.name||ge.name,Oe.classNames="OT_root OT_subscriber",Oe.style&&this.setStyle(Oe.style,null,!0),$=100,Oe.subscribeToVideo=b(Oe.subscribeToVideo,!0),Oe.subscribeToAudio=b(Oe.subscribeToAudio,!0),this.subscribeToAudio(Oe.subscribeToAudio),this.setAudioVolume(void 0!==(Dt=Oe).audioVolume?Dt.audioVolume:!1===Dt.subscribeToAudio?0:100),M=new e.WidgetView(n,(0,i.default)({},Oe,{widgetType:"subscriber"})),M.on("error",bt),M.on("audioBlocked",()=>this.trigger("audioBlocked")),M.on("audioUnblocked",()=>this.trigger("audioUnblocked")),M.on("amrLogEvent",(e,t,n)=>{ze(e,t,{},n)}),this.id=M.domId(),pe=M.domId(),this.element=M.domElement,M.on("videoElementCreated",e=>{const t=new Se.VideoElementCreatedEvent(e),n=this;ne?this.dispatchEvent(t):this.once("loaded",()=>{n.dispatchEvent(t)})}),this.element&&xt.call(this);const Wt=ge.getChannelsOfType("audio"),Gt=ge.getChannelsOfType("video"),Xt=Wt.map(e=>({id:e.id,type:e.type,active:Oe.subscribeToAudio})).concat(Gt.map(e=>{const t={id:e.id,type:e.type,active:Oe.subscribeToVideo,restrictFrameRate:void 0!==Oe.restrictFrameRate&&Oe.restrictFrameRate};return void 0!==Oe.preferredFrameRate&&(t.preferredFrameRate=parseFloat(Oe.preferredFrameRate)),void 0!==Oe.preferredHeight&&(t.preferredHeight=parseInt(Oe.preferredHeight,10)),void 0!==Oe.preferredWidth&&(t.preferredWidth=parseInt(Oe.preferredWidth,10)),t})),jt=!Oe.testNetwork&&ue(ge,he);return it.beginConnect(),jt?(this._subscribeToSelf(),this):(Pe.subscriberCreate(ge.id,O,Xt,null,ce(),(e,t)=>{e&&!it.is("disconnected")&&vt(e),xe=ut(t)}),this)};return ht.hasAudioOutputLevelStatCapability=Oe,ht.WidgetView=ft,ht.SubscriberPeerConnection=Je,ht}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(3);e.exports=()=>["Chrome","Opera","Safari"].indexOf(r.name)>-1},function(e,t,n){"use strict";const r=n(3).name;e.exports=()=>["Firefox","Safari","Edge","Chrome","Opera"].indexOf(r)>-1},function(e,t,n){"use strict";const r=n(164)()("NotSubscribing",["NotSubscribing","Init","Connecting","BindingRemoteStream","Subscribing","Failed","Destroyed"],{NotSubscribing:["NotSubscribing","Init","Destroyed"],Init:["NotSubscribing","Connecting","BindingRemoteStream","Destroyed"],Connecting:["NotSubscribing","BindingRemoteStream","Failed","Destroyed"],BindingRemoteStream:["NotSubscribing","Subscribing","Failed","Destroyed","BindingRemoteStream"],Subscribing:["NotSubscribing","Failed","Destroyed","BindingRemoteStream"],Failed:["Destroyed"],Destroyed:[]});r.prototype.isDestroyed=function(){return"Destroyed"===this.current},r.prototype.isFailed=function(){return"Failed"===this.current},r.prototype.isSubscribing=function(){return"Subscribing"===this.current},r.prototype.isAttemptingToSubscribe=function(){return-1!==["Init","Connecting","BindingRemoteStream"].indexOf(this.current)},r.prototype.isStreamAdded=function(){return"BindingRemoteStream"===this.current||this.isSubscribing()},e.exports=r},function(e,t,n){"use strict";var r=n(2)(n(20));e.exports=e=>{let t=e.socket,n=e.uri,i=e.content;return(e,o)=>t.send({uri:n,method:e,content:(0,r.default)({},i,o)})}},function(e,t,n){var r;r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i;for(n=1;n<arguments.length;n++)for(i in r=arguments[n])r.hasOwnProperty(i)&&(e[i]=r[i]);return e}},function(e,t,n){"use strict";var r=n(0);e.exports={build:function(e,t){var n,i,o,s=t.plugins;for(n=0,i=s.length;n<i;n++)(o=s[n]).methods&&r(e,o.methods),o.properties&&Object.defineProperties(e,o.properties)},hook:function(e,t,n){var r,i,o,s,a=e.config.plugins,c=[e.context];for(n&&(c=c.concat(n)),r=0,i=a.length;r<i;r++)s=a[r],(o=a[r][t])&&o.apply(s,c)}}},function(e,t,n){"use strict";function r(e){if(0===e.length)return e;var t,n,r=e.split(/[_-]/);if(1===r.length&&r[0][0].toLowerCase()===r[0][0])return e;for(n=r[0].toLowerCase(),t=1;t<r.length;t++)n=n+r[t].charAt(0).toUpperCase()+r[t].substring(1).toLowerCase();return n}r.prepended=function(e,t){return e+(t=r(t))[0].toUpperCase()+t.substring(1)},e.exports=r},function(e,t,n){"use strict";var r=n(0),i=n(2);function o(e,t){e=e||{},this.options=e,this.defaults=t.defaults,this.states=[],this.transitions=[],this.map={},this.lifecycle=this.configureLifecycle(),this.init=this.configureInitTransition(e.init),this.data=this.configureData(e.data),this.methods=this.configureMethods(e.methods),this.map[this.defaults.wildcard]={},this.configureTransitions(e.transitions||[]),this.plugins=this.configurePlugins(e.plugins,t.plugin)}r(o.prototype,{addState:function(e){this.map[e]||(this.states.push(e),this.addStateLifecycleNames(e),this.map[e]={})},addStateLifecycleNames:function(e){this.lifecycle.onEnter[e]=i.prepended("onEnter",e),this.lifecycle.onLeave[e]=i.prepended("onLeave",e),this.lifecycle.on[e]=i.prepended("on",e)},addTransition:function(e){this.transitions.indexOf(e)<0&&(this.transitions.push(e),this.addTransitionLifecycleNames(e))},addTransitionLifecycleNames:function(e){this.lifecycle.onBefore[e]=i.prepended("onBefore",e),this.lifecycle.onAfter[e]=i.prepended("onAfter",e),this.lifecycle.on[e]=i.prepended("on",e)},mapTransition:function(e){var t=e.name,n=e.from,r=e.to;return this.addState(n),"function"!=typeof r&&this.addState(r),this.addTransition(t),this.map[n][t]=e,e},configureLifecycle:function(){return{onBefore:{transition:"onBeforeTransition"},onAfter:{transition:"onAfterTransition"},onEnter:{state:"onEnterState"},onLeave:{state:"onLeaveState"},on:{transition:"onTransition"}}},configureInitTransition:function(e){return"string"==typeof e?this.mapTransition(r({},this.defaults.init,{to:e,active:!0})):"object"==typeof e?this.mapTransition(r({},this.defaults.init,e,{active:!0})):(this.addState(this.defaults.init.from),this.defaults.init)},configureData:function(e){return"function"==typeof e?e:"object"==typeof e?function(){return e}:function(){return{}}},configureMethods:function(e){return e||{}},configurePlugins:function(e,t){var n,r,i;for(n=0,r=(e=e||[]).length;n<r;n++)"function"==typeof(i=e[n])&&(e[n]=i=i()),i.configure&&i.configure(this);return e},configureTransitions:function(e){var t,n,r,i,o,s=this.defaults.wildcard;for(n=0;n<e.length;n++)for(r=e[n],i=Array.isArray(r.from)?r.from:[r.from||s],o=r.to||s,t=0;t<i.length;t++)this.mapTransition({name:r.name,from:i[t],to:o})},transitionFor:function(e,t){var n=this.defaults.wildcard;return this.map[e][t]||this.map[n][t]},transitionsFor:function(e){var t=this.defaults.wildcard;return Object.keys(this.map[e]).concat(Object.keys(this.map[t]))},allStates:function(){return this.states},allTransitions:function(){return this.transitions}}),e.exports=o},function(e,t,n){var r=n(0),i=n(6),o=n(1),s=[null,[]];function a(e,t){this.context=e,this.config=t,this.state=t.init.from,this.observers=[e]}r(a.prototype,{init:function(e){if(r(this.context,this.config.data.apply(this.context,e)),o.hook(this,"init"),this.config.init.active)return this.fire(this.config.init.name,[])},is:function(e){return Array.isArray(e)?e.indexOf(this.state)>=0:this.state===e},isPending:function(){return this.pending},can:function(e){return!this.isPending()&&!!this.seek(e)},cannot:function(e){return!this.can(e)},allStates:function(){return this.config.allStates()},allTransitions:function(){return this.config.allTransitions()},transitions:function(){return this.config.transitionsFor(this.state)},seek:function(e,t){var n=this.config.defaults.wildcard,r=this.config.transitionFor(this.state,e),i=r&&r.to;return"function"==typeof i?i.apply(this.context,t):i===n?this.state:i},fire:function(e,t){return this.transit(e,this.state,this.seek(e,t),t)},transit:function(e,t,n,r){var i=this.config.lifecycle,o=this.config.options.observeUnchangedState||t!==n;return n?this.isPending()?this.context.onPendingTransition(e,t,n):(this.config.addState(n),this.beginTransit(),r.unshift({transition:e,from:t,to:n,fsm:this.context}),this.observeEvents([this.observersForEvent(i.onBefore.transition),this.observersForEvent(i.onBefore[e]),o?this.observersForEvent(i.onLeave.state):s,o?this.observersForEvent(i.onLeave[t]):s,this.observersForEvent(i.on.transition),o?["doTransit",[this]]:s,o?this.observersForEvent(i.onEnter.state):s,o?this.observersForEvent(i.onEnter[n]):s,o?this.observersForEvent(i.on[n]):s,this.observersForEvent(i.onAfter.transition),this.observersForEvent(i.onAfter[e]),this.observersForEvent(i.on[e])],r)):this.context.onInvalidTransition(e,t,n)},beginTransit:function(){this.pending=!0},endTransit:function(e){return this.pending=!1,e},failTransit:function(e){throw this.pending=!1,e},doTransit:function(e){this.state=e.to},observe:function(e){if(2===e.length){var t={};t[e[0]]=e[1],this.observers.push(t)}else this.observers.push(e[0])},observersForEvent:function(e){for(var t,n=0,r=this.observers.length,i=[];n<r;n++)(t=this.observers[n])[e]&&i.push(t);return[e,i,!0]},observeEvents:function(e,t,n,r){if(0===e.length)return this.endTransit(void 0===r||r);var i=e[0][0],s=e[0][1],a=e[0][2];if(t[0].event=i,i&&a&&i!==n&&o.hook(this,"lifecycle",t),0===s.length)return e.shift(),this.observeEvents(e,t,i,r);var c=s.shift(),u=c[i].apply(c,t);return u&&"function"==typeof u.then?u.then(this.observeEvents.bind(this,e,t,i)).catch(this.failTransit.bind(this)):!1===u?this.endTransit(!1):this.observeEvents(e,t,i,u)},onInvalidTransition:function(e,t,n){throw new i("transition is invalid in current state",e,t,n,this.state)},onPendingTransition:function(e,t,n){throw new i("transition is invalid while previous transition is still in progress",e,t,n,this.state)}}),e.exports=a},function(e,t,n){"use strict";var r=n(0),i=n(2),o=n(1),s=n(3),a=n(4),c={is:function(e){return this._fsm.is(e)},can:function(e){return this._fsm.can(e)},cannot:function(e){return this._fsm.cannot(e)},observe:function(){return this._fsm.observe(arguments)},transitions:function(){return this._fsm.transitions()},allTransitions:function(){return this._fsm.allTransitions()},allStates:function(){return this._fsm.allStates()},onInvalidTransition:function(e,t,n){return this._fsm.onInvalidTransition(e,t,n)},onPendingTransition:function(e,t,n){return this._fsm.onPendingTransition(e,t,n)}},u={state:{configurable:!1,enumerable:!0,get:function(){return this._fsm.state},set:function(e){throw Error("use transitions to change state")}}};function d(e){return l(this||{},e)}function l(e,t){return p(e,new s(t,d)),e._fsm(),e}function p(e,t){if("object"!=typeof e||Array.isArray(e))throw Error("StateMachine can only be applied to objects");o.build(e,t),Object.defineProperties(e,u),r(e,c),r(e,t.methods),t.allTransitions().forEach((function(t){e[i(t)]=function(){return this._fsm.fire(t,[].slice.call(arguments))}})),e._fsm=function(){this._fsm=new a(this,t),this._fsm.init(arguments)}}d.version="3.0.1",d.factory=function(){var e,t;"function"==typeof arguments[0]?(e=arguments[0],t=arguments[1]||{}):(e=function(){this._fsm.apply(this,arguments)},t=arguments[0]||{});var n=new s(t,d);return p(e.prototype,n),e.prototype._fsm.config=n,e},d.apply=l,d.defaults={wildcard:"*",init:{name:"init",from:"none"}},e.exports=d},function(e,t,n){"use strict";e.exports=function(e,t,n,r,i){this.message=e,this.transition=t,this.from=n,this.to=r,this.current=i}}])},e.exports=r()},function(e,t,n){"use strict";const r=n(103)();e.exports=r},function(e,t,n){"use strict";(function(t){e.exports=function(e){return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return new t((t,n)=>{e(...r,(function(e){if(e)n(e);else{for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];1!==i.length?t(i):t(i[0])}}))})}}}).call(this,n(0))},function(e,t,n){"use strict";n.r(t),function(e,r){n.d(t,"BlurRadius",(function(){return wt})),n.d(t,"createVonageMediaProcessorConnector",(function(){return Zt})),n.d(t,"getVonageEventEmitter",(function(){return kt})),n.d(t,"isSupported",(function(){return Rt})),n.d(t,"setTrackExpectedRate",(function(){return Nt}));var i={exports:{}},o=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},s=o,a=Object.prototype.toString;function c(e){return Array.isArray(e)}function u(e){return void 0===e}function d(e){return"[object ArrayBuffer]"===a.call(e)}function l(e){return null!==e&&"object"==typeof e}function p(e){if("[object Object]"!==a.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function f(e){return"[object Function]"===a.call(e)}function h(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),c(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var m={isArray:c,isArrayBuffer:d,isBuffer:function(e){return null!==e&&!u(e)&&null!==e.constructor&&!u(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===a.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&d(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:l,isPlainObject:p,isUndefined:u,isDate:function(e){return"[object Date]"===a.call(e)},isFile:function(e){return"[object File]"===a.call(e)},isBlob:function(e){return"[object Blob]"===a.call(e)},isFunction:f,isStream:function(e){return l(e)&&f(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===a.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:h,merge:function e(){var t={};function n(n,r){p(t[r])&&p(n)?t[r]=e(t[r],n):p(n)?t[r]=e({},n):c(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)h(arguments[r],n);return t},extend:function(e,t,n){return h(t,(function(t,r){e[r]=n&&"function"==typeof t?s(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},g=m;function b(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var v=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(g.isURLSearchParams(t))r=t.toString();else{var i=[];g.forEach(t,(function(e,t){null!=e&&(g.isArray(e)?t+="[]":e=[e],g.forEach(e,(function(e){g.isDate(e)?e=e.toISOString():g.isObject(e)&&(e=JSON.stringify(e)),i.push(b(t)+"="+b(e))})))})),r=i.join("&")}if(r){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},y=m;function E(){this.handlers=[]}E.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},E.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},E.prototype.forEach=function(e){y.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var S=E,_=m,w=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},T=w,C=function(e,t,n,r,i){var o=new Error(e);return T(o,t,n,r,i)},I=C,R=m,x=R.isStandardBrowserEnv()?{write:function(e,t,n,r,i,o){var s=[];s.push(e+"="+encodeURIComponent(t)),R.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),R.isString(r)&&s.push("path="+r),R.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},O=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},k=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},N=m,Z=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],A=m,L=A.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=A.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function V(e){this.message=e}V.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},V.prototype.__CANCEL__=!0;var P=V,M=m,D=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(I("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},W=x,G=v,X=function(e,t){return e&&!O(t)?k(e,t):t},j=function(e){var t,n,r,i={};return e?(N.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=N.trim(e.substr(0,r)).toLowerCase(),n=N.trim(e.substr(r+1)),t){if(i[t]&&Z.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i},U=L,F=C,Y=te,B=P,K=function(t){return new e((function(e,n){var r,i=t.data,o=t.headers,s=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(r),t.signal&&t.signal.removeEventListener("abort",r)}M.isFormData(i)&&delete o["Content-Type"];var c=new XMLHttpRequest;if(t.auth){var u=t.auth.username||"",d=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(u+":"+d)}var l=X(t.baseURL,t.url);function p(){if(c){var r="getAllResponseHeaders"in c?j(c.getAllResponseHeaders()):null,i={data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:t,request:c};D((function(t){e(t),a()}),(function(e){n(e),a()}),i),c=null}}if(c.open(t.method.toUpperCase(),G(l,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=p:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(p)},c.onabort=function(){c&&(n(F("Request aborted",t,"ECONNABORTED",c)),c=null)},c.onerror=function(){n(F("Network Error",t,null,c)),c=null},c.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||Y.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(F(e,t,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",c)),c=null},M.isStandardBrowserEnv()){var f=(t.withCredentials||U(l))&&t.xsrfCookieName?W.read(t.xsrfCookieName):void 0;f&&(o[t.xsrfHeaderName]=f)}"setRequestHeader"in c&&M.forEach(o,(function(e,t){void 0===i&&"content-type"===t.toLowerCase()?delete o[t]:c.setRequestHeader(t,e)})),M.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&"json"!==s&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(r=function(e){c&&(n(!e||e&&e.type?new B("canceled"):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(r),t.signal&&(t.signal.aborted?r():t.signal.addEventListener("abort",r))),i||(i=null),c.send(i)}))},H=m,J=function(e,t){_.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},z=w,Q={"Content-Type":"application/x-www-form-urlencoded"};function q(e,t){!H.isUndefined(e)&&H.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var $,ee={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&($=K),$),transformRequest:[function(e,t){return J(t,"Accept"),J(t,"Content-Type"),H.isFormData(e)||H.isArrayBuffer(e)||H.isBuffer(e)||H.isStream(e)||H.isFile(e)||H.isBlob(e)?e:H.isArrayBufferView(e)?e.buffer:H.isURLSearchParams(e)?(q(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):H.isObject(e)||t&&"application/json"===t["Content-Type"]?(q(t,"application/json"),function(e,t,n){if(H.isString(e))try{return(t||JSON.parse)(e),H.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||ee.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,i=!n&&"json"===this.responseType;if(i||r&&H.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw z(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};H.forEach(["delete","get","head"],(function(e){ee.headers[e]={}})),H.forEach(["post","put","patch"],(function(e){ee.headers[e]=H.merge(Q)}));var te=ee,ne=m,re=te,ie=function(e){return!(!e||!e.__CANCEL__)},oe=m,se=function(e,t,n){var r=this||re;return ne.forEach(n,(function(n){e=n.call(r,e,t)})),e},ae=ie,ce=te,ue=P;function de(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ue("canceled")}var le=m,pe=function(e,t){t=t||{};var n={};function r(e,t){return le.isPlainObject(e)&&le.isPlainObject(t)?le.merge(e,t):le.isPlainObject(t)?le.merge({},t):le.isArray(t)?t.slice():t}function i(n){return le.isUndefined(t[n])?le.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function o(e){if(!le.isUndefined(t[e]))return r(void 0,t[e])}function s(n){return le.isUndefined(t[n])?le.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function a(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a};return le.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||i,r=t(e);le.isUndefined(r)&&t!==a||(n[e]=r)})),n},fe="0.25.0",he=fe,me={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){me[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var ge={};me.transitional=function(e,t,n){function r(e,t){return"[Axios v"+he+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,i,o){if(!1===e)throw new Error(r(i," has been removed"+(t?" in "+t:"")));return t&&!ge[i]&&(ge[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}};var be=m,ve=v,ye=S,Ee=function(t){return de(t),t.headers=t.headers||{},t.data=se.call(t,t.data,t.headers,t.transformRequest),t.headers=oe.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),oe.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||ce.adapter)(t).then((function(e){return de(t),e.data=se.call(t,e.data,e.headers,t.transformResponse),e}),(function(n){return ae(n)||(de(t),n&&n.response&&(n.response.data=se.call(t,n.response.data,n.response.headers,t.transformResponse))),e.reject(n)}))},Se=pe,_e={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),i=r.length;i-- >0;){var o=r[i],s=t[o];if(s){var a=e[o],c=void 0===a||s(a,o,e);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+o)}},validators:me},we=_e.validators;function Te(e){this.defaults=e,this.interceptors={request:new ye,response:new ye}}Te.prototype.request=function(t,n){if("string"==typeof t?(n=n||{}).url=t:n=t||{},!n.url)throw new Error("Provided config url is not valid");(n=Se(this.defaults,n)).method?n.method=n.method.toLowerCase():this.defaults.method?n.method=this.defaults.method.toLowerCase():n.method="get";var r=n.transitional;void 0!==r&&_e.assertOptions(r,{silentJSONParsing:we.transitional(we.boolean),forcedJSONParsing:we.transitional(we.boolean),clarifyTimeoutError:we.transitional(we.boolean)},!1);var i=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(o=o&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));var s,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!o){var c=[Ee,void 0];for(Array.prototype.unshift.apply(c,i),c=c.concat(a),s=e.resolve(n);c.length;)s=s.then(c.shift(),c.shift());return s}for(var u=n;i.length;){var d=i.shift(),l=i.shift();try{u=d(u)}catch(e){l(e);break}}try{s=Ee(u)}catch(t){return e.reject(t)}for(;a.length;)s=s.then(a.shift(),a.shift());return s},Te.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=Se(this.defaults,e),ve(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},be.forEach(["delete","get","head","options"],(function(e){Te.prototype[e]=function(t,n){return this.request(Se(n||{},{method:e,url:t,data:(n||{}).data}))}})),be.forEach(["post","put","patch"],(function(e){Te.prototype[e]=function(t,n,r){return this.request(Se(r||{},{method:e,url:t,data:n}))}}));var Ce=Te,Ie=P;function Re(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new e((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(t){var n,i=new e((function(e){r.subscribe(e),n=e})).then(t);return i.cancel=function(){r.unsubscribe(n)},i},t((function(e){r.reason||(r.reason=new Ie(e),n(r.reason))}))}Re.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Re.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},Re.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},Re.source=function(){var e;return{token:new Re((function(t){e=t})),cancel:e}};var xe=Re,Oe=m,ke=m,Ne=o,Ze=Ce,Ae=pe;var Le=function e(t){var n=new Ze(t),r=Ne(Ze.prototype.request,n);return ke.extend(r,Ze.prototype,n),ke.extend(r,n),r.create=function(n){return e(Ae(t,n))},r}(te);Le.Axios=Ze,Le.Cancel=P,Le.CancelToken=xe,Le.isCancel=ie,Le.VERSION=fe,Le.all=function(t){return e.all(t)},Le.spread=function(e){return function(t){return e.apply(null,t)}},Le.isAxiosError=function(e){return Oe.isObject(e)&&!0===e.isAxiosError},i.exports=Le,i.exports.default=Le;for(var Ve=[],Pe=0;Pe<256;++Pe)Ve.push((Pe+256).toString(16).substr(1));const Me=new WeakMap,De=new WeakMap,We=new WeakMap,Ge=Symbol("anyProducer"),Xe=e.resolve(),je=Symbol("listenerAdded"),Ue=Symbol("listenerRemoved");let Fe=!1;function Ye(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function Be(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function Ke(e,t){const n=De.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}function He(e,t){const n="string"==typeof t||"symbol"==typeof t?t:Ge,r=We.get(e);return r.has(n)||r.set(n,new Set),r.get(n)}function Je(t,n){n=Array.isArray(n)?n:[n];let r=!1,i=()=>{},o=[];const s={enqueue(e){o.push(e),i()},finish(){r=!0,i()}};for(const e of n)He(t,e).add(s);return{async next(){return o?0===o.length?r?(o=void 0,this.next()):(await new e(e=>{i=e}),this.next()):{done:!1,value:await o.shift()}:{done:!0}},async return(e){o=void 0;for(const e of n)He(t,e).delete(s);return i(),arguments.length>0?{done:!0,value:await e}:{done:!0}},[Symbol.asyncIterator](){return this}}}function ze(e){if(void 0===e)return $e;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(const t of e)if(!$e.includes(t)){if("string"!=typeof t)throw new TypeError("`methodNames` element must be a string");throw new Error(t+" is not Emittery method")}return e}const Qe=e=>e===je||e===Ue;class qe{static mixin(e,t){return t=ze(t),n=>{if("function"!=typeof n)throw new TypeError("`target` must be function");for(const e of t)if(void 0!==n.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``);Object.defineProperty(n.prototype,e,{enumerable:!1,get:function(){return Object.defineProperty(this,e,{enumerable:!1,value:new qe}),this[e]}});const r=t=>function(...n){return this[e][t](...n)};for(const e of t)Object.defineProperty(n.prototype,e,{enumerable:!1,value:r(e)});return n}}static get isDebugEnabled(){if("object"!=typeof r)return Fe;const{env:e}=r||{env:{}};return"emittery"===e.DEBUG||"*"===e.DEBUG||Fe}static set isDebugEnabled(e){Fe=e}constructor(e={}){Me.set(this,new Set),De.set(this,new Map),We.set(this,new Map),this.debug=e.debug||{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{r=JSON.stringify(r),"symbol"==typeof n&&(n=n.toString());const i=new Date,o=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()}.${i.getMilliseconds()}`;console.log(`[${o}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}logIfDebugEnabled(e,t,n){(qe.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,n)}on(e,t){Be(t),e=Array.isArray(e)?e:[e];for(const n of e)Ye(n),Ke(this,n).add(t),this.logIfDebugEnabled("subscribe",n,void 0),Qe(n)||this.emit(je,{eventName:n,listener:t});return this.off.bind(this,e,t)}off(e,t){Be(t),e=Array.isArray(e)?e:[e];for(const n of e)Ye(n),Ke(this,n).delete(t),this.logIfDebugEnabled("unsubscribe",n,void 0),Qe(n)||this.emit(Ue,{eventName:n,listener:t})}once(t){return new e(e=>{const n=this.on(t,t=>{n(),e(t)})})}events(e){e=Array.isArray(e)?e:[e];for(const t of e)Ye(t);return Je(this,e)}async emit(t,n){Ye(t),this.logIfDebugEnabled("emit",t,n),function(t,n,r){const i=We.get(t);if(i.has(n))for(const e of i.get(n))e.enqueue(r);if(i.has(Ge)){const t=e.all([n,r]);for(const e of i.get(Ge))e.enqueue(t)}}(this,t,n);const r=Ke(this,t),i=Me.get(this),o=[...r],s=Qe(t)?[]:[...i];await Xe,await e.all([...o.map(async e=>{if(r.has(e))return e(n)}),...s.map(async e=>{if(i.has(e))return e(t,n)})])}async emitSerial(e,t){Ye(e),this.logIfDebugEnabled("emitSerial",e,t);const n=Ke(this,e),r=Me.get(this),i=[...n],o=[...r];await Xe;for(const e of i)n.has(e)&&await e(t);for(const n of o)r.has(n)&&await n(e,t)}onAny(e){return Be(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),Me.get(this).add(e),this.emit(je,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return Je(this)}offAny(e){Be(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(Ue,{listener:e}),Me.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(const t of e)if(this.logIfDebugEnabled("clear",t,void 0),"string"==typeof t||"symbol"==typeof t){Ke(this,t).clear();const e=He(this,t);for(const t of e)t.finish();e.clear()}else{Me.get(this).clear();for(const e of De.get(this).values())e.clear();for(const e of We.get(this).values()){for(const t of e)t.finish();e.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let t=0;for(const n of e)if("string"!=typeof n){void 0!==n&&Ye(n),t+=Me.get(this).size;for(const e of De.get(this).values())t+=e.size;for(const e of We.get(this).values())t+=e.size}else t+=Me.get(this).size+Ke(this,n).size+He(this,n).size+He(this).size;return t}bindMethods(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");t=ze(t);for(const n of t){if(void 0!==e[n])throw new Error(`The property \`${n}\` already exists on \`target\``);Object.defineProperty(e,n,{enumerable:!1,value:this[n].bind(this)})}}}const $e=Object.getOwnPropertyNames(qe.prototype).filter(e=>"constructor"!==e);var et;Object.defineProperty(qe,"listenerAdded",{value:je,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(qe,"listenerRemoved",{value:Ue,writable:!1,enumerable:!0,configurable:!1}),(et||(et={})).FPS_DROP="fps_drop";class tt{constructor(){this.processor_=null,this.generator_=null}init(t){return new e((e,n)=>{try{this.processor_=new MediaStreamTrackProcessor(t)}catch(e){console.log("[InsertableStreamHelper] MediaStreamTrackProcessor failed: "+e),n(e)}try{"audio"===t.kind?this.generator_=new MediaStreamTrackGenerator({kind:"audio"}):"video"===t.kind?this.generator_=new MediaStreamTrackGenerator({kind:"video"}):n("kind not supported")}catch(e){console.log("[InsertableStreamHelper] MediaStreamTrackGenerator failed: "+e),n(e)}e()})}getReadable(){return this.processor_.readable}getWriteable(){return this.generator_.writable}getProccesorTrack(){return this.generator_}}class nt{constructor(e){this.insertableStreamHelper_=new tt,this.mediaProcessor_=e}setTrack(t){return new e((e,n)=>{this.insertableStreamHelper_.init(t).then(()=>{this.mediaProcessor_.transform(this.insertableStreamHelper_.getReadable(),this.insertableStreamHelper_.getWriteable()).then(()=>{e(this.insertableStreamHelper_.getProccesorTrack())}).catch(e=>{n(e)})}).catch(e=>{n(e)})})}destroy(){return new e((e,t)=>{this.mediaProcessor_?this.mediaProcessor_.destroy().then(()=>{e()}).catch(e=>{t(e)}):t("no processor")})}}const rt="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NsYXNzICR7fSQudXBkYXRlcz17dHJhbnNmb3JtZXJfbmV3OiJOZXcgdHJhbnNmb3JtZXIiLHRyYW5zZm9ybWVyX251bGw6Ik51bGwgdHJhbnNmb3JtZXIifSwkLmVycm9ycz17dH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jYWxsYmFja1R5cGU6InN1Y2Nlc3MiLG1lc3NhZ2U6ImRlc3Ryb3kifTtwb3N0TWVzc2FnZShKU09OLnN0cmluZ2lmeShzKSl9KS5jYXRjaChzPT57Y29uc3Qgbz17Y2FsbGJhY2tUeXBlOiJlcnJvciIsbWVzc2FnZTpWZShzKX07cG9zdE1lc3NhZ2UoSlNPTi5zdHJpbmdpZnkobykpfSk6bj09PSJzZXRUcmFja0V4cGVjdGVkUmF0ZSImJmUuc2V0VHJhY2tFeHBlY3RlZFJhdGUodC5kYXRhLnJhdGUpfX19KSgpOwo=",it="undefined"!=typeof window&&window.Blob&&new Blob([atob(rt)],{type:"text/javascript;charset=utf-8"});function ot(){const e=it&&(window.URL||window.webkitURL).createObjectURL(it);try{return e?new Worker(e):new Worker("data:application/javascript;base64,"+rt,{type:"module"})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}const st=new WeakMap,at=new WeakMap,ct=new WeakMap,ut=Symbol("anyProducer"),dt=e.resolve(),lt=Symbol("listenerAdded"),pt=Symbol("listenerRemoved");let ft=!1;function ht(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function mt(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function gt(e,t){const n=at.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}function bt(e,t){const n="string"==typeof t||"symbol"==typeof t?t:ut,r=ct.get(e);return r.has(n)||r.set(n,new Set),r.get(n)}function vt(t,n){n=Array.isArray(n)?n:[n];let r=!1,i=()=>{},o=[];const s={enqueue(e){o.push(e),i()},finish(){r=!0,i()}};for(const e of n)bt(t,e).add(s);return{async next(){return o?0===o.length?r?(o=void 0,this.next()):(await new e(e=>{i=e}),this.next()):{done:!1,value:await o.shift()}:{done:!0}},async return(e){o=void 0;for(const e of n)bt(t,e).delete(s);return i(),arguments.length>0?{done:!0,value:await e}:{done:!0}},[Symbol.asyncIterator](){return this}}}function yt(e){if(void 0===e)return _t;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(const t of e)if(!_t.includes(t)){if("string"!=typeof t)throw new TypeError("`methodNames` element must be a string");throw new Error(t+" is not Emittery method")}return e}const Et=e=>e===lt||e===pt;class St{static mixin(e,t){return t=yt(t),n=>{if("function"!=typeof n)throw new TypeError("`target` must be function");for(const e of t)if(void 0!==n.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``);Object.defineProperty(n.prototype,e,{enumerable:!1,get:function(){return Object.defineProperty(this,e,{enumerable:!1,value:new St}),this[e]}});const r=t=>function(...n){return this[e][t](...n)};for(const e of t)Object.defineProperty(n.prototype,e,{enumerable:!1,value:r(e)});return n}}static get isDebugEnabled(){if("object"!=typeof r)return ft;const{env:e}=r||{env:{}};return"emittery"===e.DEBUG||"*"===e.DEBUG||ft}static set isDebugEnabled(e){ft=e}constructor(e={}){st.set(this,new Set),at.set(this,new Map),ct.set(this,new Map),this.debug=e.debug||{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{r=JSON.stringify(r),"symbol"==typeof n&&(n=n.toString());const i=new Date,o=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()}.${i.getMilliseconds()}`;console.log(`[${o}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}logIfDebugEnabled(e,t,n){(St.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,n)}on(e,t){mt(t),e=Array.isArray(e)?e:[e];for(const n of e)ht(n),gt(this,n).add(t),this.logIfDebugEnabled("subscribe",n,void 0),Et(n)||this.emit(lt,{eventName:n,listener:t});return this.off.bind(this,e,t)}off(e,t){mt(t),e=Array.isArray(e)?e:[e];for(const n of e)ht(n),gt(this,n).delete(t),this.logIfDebugEnabled("unsubscribe",n,void 0),Et(n)||this.emit(pt,{eventName:n,listener:t})}once(t){return new e(e=>{const n=this.on(t,t=>{n(),e(t)})})}events(e){e=Array.isArray(e)?e:[e];for(const t of e)ht(t);return vt(this,e)}async emit(t,n){ht(t),this.logIfDebugEnabled("emit",t,n),function(t,n,r){const i=ct.get(t);if(i.has(n))for(const e of i.get(n))e.enqueue(r);if(i.has(ut)){const t=e.all([n,r]);for(const e of i.get(ut))e.enqueue(t)}}(this,t,n);const r=gt(this,t),i=st.get(this),o=[...r],s=Et(t)?[]:[...i];await dt,await e.all([...o.map(async e=>{if(r.has(e))return e(n)}),...s.map(async e=>{if(i.has(e))return e(t,n)})])}async emitSerial(e,t){ht(e),this.logIfDebugEnabled("emitSerial",e,t);const n=gt(this,e),r=st.get(this),i=[...n],o=[...r];await dt;for(const e of i)n.has(e)&&await e(t);for(const n of o)r.has(n)&&await n(e,t)}onAny(e){return mt(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),st.get(this).add(e),this.emit(lt,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return vt(this)}offAny(e){mt(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(pt,{listener:e}),st.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(const t of e)if(this.logIfDebugEnabled("clear",t,void 0),"string"==typeof t||"symbol"==typeof t){gt(this,t).clear();const e=bt(this,t);for(const t of e)t.finish();e.clear()}else{st.get(this).clear();for(const e of at.get(this).values())e.clear();for(const e of ct.get(this).values()){for(const t of e)t.finish();e.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let t=0;for(const n of e)if("string"!=typeof n){void 0!==n&&ht(n),t+=st.get(this).size;for(const e of at.get(this).values())t+=e.size;for(const e of ct.get(this).values())t+=e.size}else t+=st.get(this).size+gt(this,n).size+bt(this,n).size+bt(this).size;return t}bindMethods(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");t=yt(t);for(const n of t){if(void 0!==e[n])throw new Error(`The property \`${n}\` already exists on \`target\``);Object.defineProperty(e,n,{enumerable:!1,value:this[n].bind(this)})}}}const _t=Object.getOwnPropertyNames(St.prototype).filter(e=>"constructor"!==e);Object.defineProperty(St,"listenerAdded",{value:lt,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(St,"listenerRemoved",{value:pt,writable:!1,enumerable:!0,configurable:!1});var wt,Tt,Ct=St;class It extends Ct{constructor(t){super(),this.config_=t,this.worker_=new ot,this.trackExpectedRate_=-1,this.workerInited_=!1,this.onMessage_=new e((e,t)=>{this.worker_.addEventListener("message",n=>{let r=JSON.parse(n.data);"success"===r.callbackType?e():"error"===r.callbackType?t(r.message):"media_processor_error_event"===r.callbackType?this.emit("error",r.message):"media_processor_warn_event"===r.callbackType&&this.emit("warn",r.message)})})}transform(t,n){return new e(async(e,r)=>{let i=JSON.stringify(globalThis._vonageMediaProcessorMetadata);if("string"!=typeof i&&(i=JSON.stringify({})),"VideoBackground"===this.config_.transformerType){const e=document.createElement("video");e.src=this.config_.backgroundAssetUri,e.muted=!0;try{await e.play()}catch(e){return void r(e)}const o=e.captureStream().getVideoTracks()[0],s=new MediaStreamTrackProcessor(o).readable;this.worker_.postMessage({operation:"transform",readable:t,writable:n,config:JSON.stringify(this.config_),videoBGReadable:s,metaData:i},[t,n,s])}else this.worker_.postMessage({operation:"transform",readable:t,writable:n,config:JSON.stringify(this.config_),metaData:i},[t,n]);this.onMessage_.then(()=>{console.log("Worker inited"),this.workerInited_=!0,-1!=this.trackExpectedRate_&&this.postTrackExpectedRate(),e()}).catch(e=>{console.log("Worker inited error"),r(e)})})}destroy(){return new e(async(e,t)=>{this.worker_.postMessage({operation:"destroy"}),this.onMessage_.then(()=>{console.log("Worker destroyed"),e()}).catch(e=>{console.log("Worker destroy error"),t(e)})})}setTrackExpectedRate(e){this.trackExpectedRate_=e,this.postTrackExpectedRate()}postTrackExpectedRate(){this.workerInited_&&this.worker_.postMessage({operation:"setTrackExpectedRate",rate:this.trackExpectedRate_})}}(Tt=wt||(wt={})).Low="Low",Tt.High="High";function Rt(){return new e(async(t,n)=>{try{await new e((e,t)=>{"undefined"==typeof MediaStreamTrackProcessor||"undefined"==typeof MediaStreamTrackGenerator?t("Your browser does not support the MediaStreamTrack API for Insertable Streams of Media."):e()})}catch(e){return void n(e)}(async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))().then(e=>{!1!==e?t():n("Your browser does not support WebAssembly features.")}).catch(e=>{n(e)})})}let xt,Ot=-1;function kt(){return xt}function Nt(e){Ot=e,void 0!==xt&&xt.setTrackExpectedRate(Ot)}function Zt(t){return new e(async(e,n)=>{xt=new It(t),-1!=Ot&&xt.setTrackExpectedRate(Ot);e(new nt(xt))})}}.call(this,n(0),n(43))},function(e,t,n){"use strict";const r=n(15),i=n(11),o=n(702),s=n(703),a=n(704);e.exports=function(e){void 0===e&&(e={});const t=e.Errors||n(4),c=e.ExceptionCodes||n(10),u=e.logging||n(1)("publisherInit"),d=e.otError||n(13)(),l=e.OTHelpers||n(5),p=e.Publisher||n(172)(),f=e.sessionObjects||n(21);return function(e,n,h){let m;u.debug(`OT.initPublisher(${e})`),"string"!=typeof e||document.getElementById(e)||(e=n,n=h,h=arguments[3]),"function"==typeof e?(h=e,n=void 0,e=void 0):i(e)&&!l.isElementNode(e)&&(h=n,n=e,e=void 0),"function"==typeof n&&(h=n,n=void 0),n&&(i(n)?!1===n.insertDefaultUI&&e?m="You cannot specify a target element if insertDefaultUI is false":o(n.audioSource)&&o(n.videoSource)&&(m="You cannot specify both audioSource and videoSource as null or false"):(m="properties argument to Publisher constructor, if provided, should be an object",n=void 0)),s(n),a(n);const g=new p(n||{});f.publishers.add(g);const b=function(){h&&r(h)&&(h(...arguments),h=void 0)};void 0!==m&&(u.error(m),b(d(t.INVALID_PARAMETER,new Error(m),c.INVALID_PARAMETER)));const v=function(e){g.off("publishComplete",y),b(e)};let y=function(e){g.off("initSuccess",v),e&&b(e)};return g.once("initSuccess",v),g.once("publishComplete",y),g.publish(e),g}}},function(e,t,n){"use strict";(function(t){var r=n(2)(n(20));const i=n(42),o=n(705),s=n(11),a=n(15),c=n(9),u=n(27),d=n(6),l=n(26),p=n(34)(),f=n(74),h=n(311),m=n(707),g=n(708),b=n(139).prependProxyToUrlIfNeeded,v=n(140).getProxyUrl;e.exports=function(e){void 0===e&&(e={});const y=e.adaptIceServers||n(101).adaptIceServers,E=e.AnalyticsHelper||l,S=e.APIKEY||n(72),_=e.Capabilities||n(173),w=e.convertAnvilErrorCode||n(709),T=e.convertRumorError||n(315),C=e.Errors||n(4),I=e.Events||n(23)(),R=e.Stream||n(174),x=e.ExceptionCodes||n(10),O=e.hasIceRestartsCapability||n(316),k=e.logging||n(1)("Session"),N=e.otError||n(13)(),Z=e.OTErrorClass||n(22),A=e.OTHelpers||n(5),L=n(710),V=e.StaticConfig||p,P=e.staticConfig||V.onlyLocal(),M=e.Publisher||n(172)(),D=e.RaptorSocket||n(711).default(),W=e.SessionDispatcher||n(323),G=e.sessionObjects||n(21),X=e.sessionTag||n(322),j=e.socketCloseCodes||n(76),U=e.Subscriber||n(304)(),F=e.systemRequirements||n(154),Y=e.uuid||n(19),B=g({otError:N}),K=e.global||(void 0!==typeof window?window:global),H=e.getSessionInfo||n(735)(),J=n(100),z=e.initPublisher||n(313)({Publisher:M});return function(e,n,l){var p=this;let g=void 0===l?{}:l,Q=g.iceConfig,q=g.connectionEventsSuppressed,$=g.ipWhitelist,ee=void 0!==$&&$;const te=v(),ne=new E,re=e=>"string"==typeof e?this.streams.get(e)||{id:e}:e;let ie,oe,se,ae,ce,ue,de,le;d(this),this._tag=X,F.check()||F.upgrade(),null==n&&(n=e,e=null),B(Q),this.id=n,this.sessionId=n;let pe=!0,fe=!1,he=e;const me=this;let ge=n,be=Y(),ve=Y(),ye=k,Ee=!1;const Se=[];let _e,we,Te,Ce,Ie=null;const Re=A.statable(this,["disconnected","connecting","connected","disconnecting"],"disconnected");this.connection=null,this.connections=new A.Collection,this.streams=new A.Collection,this.archives=new A.Collection;const xe=function(e){Re("disconnected"),e.code||(e.code=x.CONNECT_FAILED),ye.error(`${e.name||"Unknown Error"}: ${e.message}`),Z.handleJsException({error:e,target:this,analytics:ne}),this.trigger("sessionConnectFailed",e)},Oe=function(e){fe=!1;const t=e.reason;this.logEvent("Connect","Disconnected",{reason:e.reason});const n=new I.SessionDisconnectEvent("sessionDisconnected",t.replace("networkTimedout","networkDisconnected"));this.isConnected()&&this.disconnect(),we(),_e.call(this,t),setTimeout(()=>{this.dispatchEvent(n),Te.call(this,n.reason),n.isDefaultPrevented()||Ce.call(this,n.reason)})},ke=function(e){q||e.id.match(/^symphony\./)||this.dispatchEvent(new I.ConnectionEvent(u.CONNECTION_CREATED,e))},Ne=function(e,t){e.id.match(/^symphony\./)||ie&&e.id===ie.id()||this.dispatchEvent(new I.ConnectionEvent(u.CONNECTION_DESTROYED,e,t))},Ze=function(e){!e||!e.connection||this.connection&&e.connection.id===this.connection.id||this.dispatchEvent(new I.StreamEvent(u.STREAM_CREATED,e,null,!1))},Ae=function(e){const t=e.target,n=e.changedProperty;let r=e.newValue;"videoDisableWarning"!==n&&"audioDisableWarning"!==n&&("videoDimensions"===n&&(r={width:r.width,height:r.height}),this.dispatchEvent(new I.StreamPropertyChangedEvent(u.STREAM_PROPERTY_CHANGED,t,n,e.oldValue,r)))},Le=function(e,t){void 0===t&&(t="clientDisconnected");const n=new I.StreamEvent("streamDestroyed",e,t,!0);e.connection.id===this.connection.id?G.publishers.where({streamId:e.id}).forEach((function(n){n._.unpublishStreamFromSession(e,this,t)}),this):this.dispatchEvent(n),(()=>{G.subscribers.where({streamId:e.id}).filter(e=>e.session.id===this.id&&e.stream).forEach(e=>{e._disconnect({reason:t}),n.isDefaultPrevented()||e._destroy({reason:t,noStateTransition:!0})})})()},Ve=function(e){this.dispatchEvent(new I.ArchiveEvent("archiveStarted",e))},Pe=function(e){this.dispatchEvent(new I.ArchiveEvent("archiveDestroyed",e))},Me=function(e){const t=e.target,n=e.changedProperty,r=e.newValue;"status"===n&&"stopped"===r?this.dispatchEvent(new I.ArchiveEvent("archiveStopped",t)):this.dispatchEvent(new I.ArchiveEvent("archiveUpdated",t))},De=()=>G.subscribers.forEach(e=>e._.pauseAndPlayVideoElement()),We=function(){me.token=null,se=null,Re("disconnected"),ie=null,oe&&(oe.stop(),oe=null),me.connection=null,me.capabilities=new _([]),me.connections.destroy(),me.streams.destroy(),me.archives.destroy()};we=function(){ve=Y(),We()},_e=function(e){G.publishers.where({session:this}).forEach(t=>{t.disconnect(e)}),G.subscribers.where({session:this}).forEach(e=>{e._disconnect()})},Te=function(e){G.publishers.where({session:this}).forEach(t=>{t._.streamDestroyed(e)})},Ce=function(e){G.subscribers.where({session:this}).forEach(t=>{t._destroy({reason:e})})};const Ge=function(){ye.debug("OT.Session: connecting to Raptor");const e=b(this.sessionInfo.messagingURL,te);ie=new D(ve,be,e,this.sessionInfo.symphonyAddress,W(this,{connectionEventsSuppressed:q}),ne,["forceMute","adaptive"]),ie.connect(se,this.sessionInfo,{connectionEventsSuppressed:q},(e,t)=>{if(e){const t={};let n;if("ConnectToSession"===e.reason||"GetSessionState"===e.reason){const n=T(e);c(t,{originalMessage:e.message,originalCode:e.code}),e.code=n.code,e.message=n.message}(e.code||e.message||e.reason)&&(n={failureCode:e.code,failureMessage:e.message,failureReason:e.reason,socketId:ie.socketId}),ie=null,this.logConnectivityEvent("Failure",t,n);const r=function(e,t){let n;switch(e){case"WebSocketConnection":if(n=o(j.codes,e=>e===t),n)return C["SOCKET_"+n];break;case"ConnectToSession":case"GetSessionState":switch(t){case x.CONNECT_FAILED:return C.CONNECT_FAILED;case x.UNEXPECTED_SERVER_RESPONSE:return C.UNEXPECTED_SERVER_RESPONSE;case x.CONNECTION_LIMIT_EXCEEDED:return C.CONNECTION_LIMIT_EXCEEDED}}}(e.reason,e.code);return r&&(e=N(r,new Error(e.message),e.code)),void xe.call(this,e)}ye.debug("OT.Session: Received session state from Raptor",t),this.connection=this.connections.get(ie.id()),this.connection&&(this.capabilities=this.connection.permissions),Re("connected"),this.logConnectivityEvent("Success",{connectionId:this.connection.id}),this.connection.on("destroyed",Oe,this),this.dispatchEvent(new I.SessionConnectEvent(u.SESSION_CONNECTED)),this.connections.on({add:ke,remove:Ne},this),this.streams.on({add:Ze,remove:Le,update:Ae},this),this.archives.on({add:Ve,remove:Pe,update:Me},this),this.connections._triggerAddEvents(),this.streams._triggerAddEvents(),this.archives._triggerAddEvents();A.env.isiOS&&A.env.iOSVersion>=13.3&&this.on("gsmCallEnded",De)})},Xe=e=>this.capabilities.permittedTo(e),je=(e,t)=>{k.error(`${e.name}: ${e.message}`),"function"==typeof t&&t(e),Z.handleJsException({error:e,target:this,analytics:ne})},Ue=e=>{const t=N(e.code,new Error(e.message),e.exceptionCode);return je(t),t},Fe=()=>this.isNot("connected")?Ue(L.NOT_CONNECTED):Xe("forceMute")?null:Ue(L.PERMISSION_DENIED),Ye=e=>"404"===e.code?Ue(L.NOT_FOUND):"403"===e.code?Ue(L.PERMISSION_DENIED):Ue(L.UNEXPECTED_SERVER_RESPONSE);this.reportIssue=e=>{let t=e.id;return h(ne.logEvent.bind(ne))({action:"ReportIssue",variation:"Event",connectionId:ve,payload:{reportIssueId:t}},null)},this.logEvent=function(e,t,n,r){let i={action:e,variation:t,payload:n,sessionId:ge,messagingServer:ce,p2p:ae,partnerId:he,connectionId:ve};r&&(i=c(r,i)),ne.logEvent(i)},this.logConfigurationFileEvent=function(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n={}),"Attempt"===e)de=(new Date).getTime();else if("Failure"===e||"Success"===e){const e=(new Date).getTime()-de;c(n,{attemptDuration:e})}te&&(n.proxyUrl=te),this.logEvent("ConfigurationFile",e,t,(0,r.default)({},n))},this.logConnectivityEvent=function(e,t,n){if(void 0===t&&(t=null),void 0===n&&(n={}),te&&(n.proxyUrl=te),"Attempt"===e&&(oe&&(oe.stop(),k.error("_connectivityAttemptPinger should have been cleaned up")),ue=(new Date).getTime(),oe=new f(()=>{this.logEvent("Connect","Attempting",t,(0,r.default)({},n))},.2,6),oe.start()),"Failure"===e||"Success"===e||"Cancel"===e){const i=i=>{oe&&(oe.stop(),oe=void 0),this.logEvent("Connect",e,t,(0,r.default)({},n,{attemptDuration:(new Date).getTime()-ue,iceConfig:i,ipWhitelist:ee}))};"Success"===e?this._.getIceConfig().then(e=>{const t={includeServers:Q&&Q.includeServers||"all",transportPolicy:e.transportPolicy};t.servers=e.servers?e.servers.map(e=>({url:e.urls})):[],i(t)}):i()}else this.logEvent("Connect",e,t,n)},this.connect=function(){let r;for(var i=arguments.length,o=new Array(i),c=0;c<i;c++)o[c]=arguments[c];o.length>1&&("string"==typeof o[0]||"number"==typeof o[0])&&"string"==typeof o[1]?(null==e&&(he=o[0].toString()),r=o[1]):r=o[0];const u=o[o.length-1];if(p.is("connecting","connected"))return ye.warn("OT.Session: Cannot connect, the session is already "+p.state),p;ne.sessionInfo=new J,We(),Re("connecting");const d=ve;function l(){const e=ve!==d;return e&&k.debug("Connection was interrupted"),e}if(p.token=!a(r)&&r,se=!a(r)&&r,pe?pe=!1:be=Y(),u&&a(u)){let e;const t=function(){e();for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];u(void 0,...n)},n=function(){e(),u(...arguments)};e=()=>{p.off("sessionConnected",t),p.off("sessionConnectFailed",n)},p.once("sessionConnected",t),p.once("sessionConnectFailed",n)}if(null==he||a(he))return setTimeout(xe.bind(p,N(C.AUTHENTICATION_ERROR,new Error("API Key is undefined. You must pass an API Key to initSession."),x.AUTHENTICATION_ERROR))),p;if(!ge||s(ge)||Array.isArray(ge)){let e;return ge?(e="SessionID is not a string. You must use string as the session ID passed into OT.initSession().",ge=ge.toString()):e="SessionID is undefined. You must pass a sessionID to initSession.",setTimeout(xe.bind(p,N(C.INVALID_SESSION_ID,new Error(e),x.INVALID_SESSION_ID))),p.logConnectivityEvent("Attempt"),p.logConnectivityEvent("Failure",null,{failureReason:"ConnectToSession",failureCode:x.INVALID_SESSION_ID,failureMessage:e}),p}p.apiKey=he.toString(),he=he.toString(),0===S.value.length&&(S.value=he);const f=Boolean(V.onlyLocal().configUrl),h=!0===ee&&Boolean(V.onlyLocal().ipWhitelistConfigUrl);f||h?p.logConfigurationFileEvent("Attempt"):p.logConfigurationFileEvent("Event",{message:"No configUrl, using local config only"});const m=f||h?V.get({partnerId:he,token:r,useIpWhitelistConfigUrl:h,proxyUrl:te}):t.resolve(V.onlyLocal());return m.then(e=>((f||h)&&p.logConfigurationFileEvent("Success"),e),e=>((f||h)&&p.logConfigurationFileEvent("Failure",{failureMessage:e.message,failureStack:e.stack}),V.onlyLocal())).then(e=>{if(p.staticConfig=e,ne.staticConfig=e,!1===e.apiEnabled)throw N(C.API_KEY_DISABLED,new Error("The API KEY has been disabled. Access to the service is currently being restricted. Please contact support."));if(l())return;p.logConnectivityEvent("Attempt"),te?p.logEvent("SessionInfo","Attempt",null,{proxyUrl:te}):p.logEvent("SessionInfo","Attempt");const t=e=>{e.code=w(e.code),p.logConnectivityEvent("Failure",null,{failureReason:"GetSessionInfo",failureCode:e.code||"No code",failureMessage:e.message,failureName:e.name}),e.name&&(e=N(e.name,new Error(`${e.message}${e.code?` (${e.code})`:""}`),e.code)),xe.call(p,e)},r=b(e.apiUrl,te);return H({anvilUrl:r,sessionId:n,token:se,connectionId:ve,clientVersion:e.clientVersion}).then(n=>{if(l())return;if(n.partnerId&&n.partnerId!==he){const e="Authentication Error: The API key does not match the token or session.";return void t(N(C.AUTHENTICATION_ERROR,new Error(e),x.AUTHENTICATION_ERROR))}ne.sessionInfo=n;const r={features:{reconnection:n.reconnection,renegotiation:O()&&n.renegotiation,simulcast:void 0!==n.simulcast&&(n.simulcast&&"Chrome"===A.env.name)}};if(te&&(r.proxyUrl=te),p.is("connecting")){p.sessionInfo=n,p._.setIceServers(p.sessionInfo.iceServers),ae=n.p2pEnabled,ce=n.messagingServer,p.logEvent("SessionInfo","Success",null,r,{messagingServer:n.messagingServer});const t=e.sessionInfoOverrides;null!=t&&"object"==typeof t&&Object.keys(t).forEach(e=>{Object.defineProperty(p.sessionInfo,e,{value:t[e]})}),Ge.call(p)}},t)}).catch(e=>{xe.call(p,e)}),p},this.disconnect=function(){ie&&ie.isNot("disconnected")?ie.isNot("disconnecting")&&(ie.isNot("connecting")||this.logConnectivityEvent("Cancel"),Re("disconnecting"),ie.disconnect(),this.off("gsmCallEnded",De)):we()},this.destroy=function(){this.streams.destroy(),this.connections.destroy(),this.archives.destroy(),this.disconnect()},this.publish=function(e,t,n){if("function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),n=n||function(){},this.isNot("connected"))return ne.logError(1010,"OT.exception","We need to be connected before you can publish",null,{action:"Publish",variation:"Failure",failureReason:"unconnected",failureCode:x.NOT_CONNECTED,failureMessage:"We need to be connected before you can publish",sessionId:ge,streamId:e&&e.stream?e.stream.id:null,p2p:this.sessionInfo?this.sessionInfo.p2pEnabled:void 0,messagingServer:this.sessionInfo?this.sessionInfo.messagingServer:null,partnerId:he}),je(N(C.NOT_CONNECTED,new Error("We need to be connected before you can publish"),x.NOT_CONNECTED),n),null;if(!Xe("publish")){const e="This token does not allow publishing. The role must be at least `publisher` to enable this functionality",t={failureReason:"Permission",failureCode:x.UNABLE_TO_PUBLISH,failureMessage:e};return this.logEvent("Publish","Failure",null,t),je(N(C.PERMISSION_DENIED,new Error(e),x.UNABLE_TO_PUBLISH),n),null}if(!e||"string"==typeof e||A.isElementNode(e))e=z(e,t);else{if(!(e instanceof M))return void je(N(C.INVALID_PARAMETER,new Error("Session.publish :: First parameter passed in is neither a string nor an instance of the Publisher"),x.UNABLE_TO_PUBLISH),n);"session"in e&&e.session&&"sessionId"in e.session&&(e.session.sessionId===this.sessionId?ye.warn(`Cannot publish ${e.guid()} again to ${this.sessionId}. Please call session.unpublish(publisher) first.`):ye.warn(`Cannot publish ${e.guid()} publisher already attached to ${e.session.sessionId}. Please call session.unpublish(publisher) first.`))}return Ee&&e._.forceMuteAudio(),e._.publishToSession(this,ne).catch(e=>{throw e.message="Session.publish :: "+e.message,ye.error(e.code,e.message),e}).then(()=>e).then((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n(null,...t)}),e=>n(e)),e},this.unpublish=function(e){e?e._.unpublishFromSession(this,"unpublished"):ye.error("OT.Session.unpublish: publisher parameter missing.")},this.subscribe=function(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0,n=void 0),"function"==typeof n&&(r=n,n=void 0),r=r||function(){},!this.connection||!this.connection.connectionId)return void je(N(C.NOT_CONNECTED,new Error("Session.subscribe :: Connection required to subscribe"),x.UNABLE_TO_SUBSCRIBE),r);if(!e)return void je(N(C.INVALID_PARAMETER,new Error("Session.subscribe :: stream cannot be null"),x.UNABLE_TO_SUBSCRIBE),r);if(!Object.prototype.hasOwnProperty.call(e,"streamId"))return void je(N(C.INVALID_PARAMETER,new Error("Session.subscribe :: invalid stream object"),x.UNABLE_TO_SUBSCRIBE),r);if(n&&!1===n.insertDefaultUI&&t)return void je(N(C.INVALID_PARAMETER,new Error("You cannot specify a target element if insertDefaultUI is false"),x.INVALID_PARAMETER),r);t&&!1===t.insertDefaultUI&&(n=t,t=void 0);const i=new U(t,c(n||{},{stream:e,session:this,analytics:ne}),e=>{e?je(e,r):r(null,i)});return G.subscribers.add(i),i},this.unsubscribe=function(e){if(!e){const e="OT.Session.unsubscribe: subscriber cannot be null";throw ye.error(e),new Error(e)}return e.stream?(ye.debug("OT.Session.unsubscribe: subscriber "+e.id),e._destroy({reason:"Unsubscribe"}),!0):(ye.warn("OT.Session.unsubscribe:: tried to unsubscribe a subscriber that had no stream"),!1)},this.getSubscribersForStream=function(e){return G.subscribers.where({streamId:e.id})},this.getPublisherForStream=function(e){let t,n;if("string"==typeof e)t=e;else{if("object"!=typeof e||!e||!Object.hasOwnProperty.call(e,"id"))throw n="Session.getPublisherForStream :: Invalid stream type",ye.error(n),new Error(n);t=e.id}return G.publishers.where({streamId:t})[0]},this._={getProxyUrl:()=>te,isSocketReconnecting:()=>fe,getSocket:()=>ie,reconnecting:function(){fe=!0,this.dispatchEvent(new I.SessionReconnectingEvent)}.bind(this),reconnected:function(){fe=!1,this.dispatchEvent(new I.SessionReconnectedEvent),this.sessionInfo.reconnection&&(G.publishers.where({session:this}).forEach(e=>{e._.iceRestart()}),this.sessionInfo.p2pEnabled||G.subscribers.where({session:this}).forEach(e=>{e._.iceRestart("socket reconnected")}))}.bind(this),dispatchSignal:function(e,t,n){const r=new I.SignalEvent(t,n,e);r.target=this,this.trigger(u.SIGNAL,r),t&&this.dispatchEvent(r)}.bind(this),subscriberChannelUpdate:(e,t,n,r)=>ie?ie.subscriberChannelUpdate(e.id,t.widgetId,n.id,r):(ye.warn("You are disconnected, cannot update subscriber properties ",r),null),streamCreate(e,t,n,r,i,o,s){ie?ie.streamCreate(e,t,n,r,i,void 0,o,s):ye.warn("You are disconnected, cannot create stream ",t)},streamDestroy(e,t){ie?ie.streamDestroy(e,t):ye.warn("You are disconnected, cannot destroy stream ",e)},streamChannelUpdate(e,t,n){ie?ie.streamChannelUpdate(e.id,t.id,n):ye.warn("You are disconnected, cannot update stream properties ",n)},setSocket(e){ie=e},setLogging(e){ye=e},setState:Re,setIceServers(e){e&&(le={iceServers:y(e),timestamp:Date.now()})},getOtIceServerInfo(){if(864e5-(le?Date.now()-le.timestamp:1/0)>3e5)return t.resolve({transportPolicy:me&&me.sessionInfo&&me.sessionInfo.clientCandidates,servers:le&&le.iceServers});if(!se)return t.resolve({transportPolicy:me&&me.sessionInfo&&me.sessionInfo.clientCandidates,servers:[],needRumorIceServersFallback:!0});const e=P.clientVersion;return H({anvilUrl:(this.staticConfig||P).apiUrl,sessionId:n,token:se,connectionId:ve,clientVersion:e}).then(e=>(me._.setIceServers(e.iceServers),le?{transportPolicy:me&&me.sessionInfo&&me.sessionInfo.clientCandidates,servers:le&&le.iceServers}:{transportPolicy:me.sessionInfo.clientCandidates,servers:[],needRumorIceServersFallback:!0}))},getCodecFlags:()=>({h264:me.sessionInfo.h264,vp9:me.sessionInfo.vp9,vp8:me.sessionInfo.vp8}),getVideoCodecsCompatible:e=>m({RTCPeerConnection:K.RTCPeerConnection,env:A.env,stream:e,codecFlags:me._.getCodecFlags()}),getIceConfig:()=>{if(!Q)return me._.getOtIceServerInfo();const e=Q&&"relay"===Q.transportPolicy?"relay":me.sessionInfo.clientCandidates;return("custom"===Q.includeServers?t.resolve({servers:[]}):me._.getOtIceServerInfo()).then(t=>c(t,{transportPolicy:e,servers:[...t.servers,...Q.customServers]}))},forceMute:function(e){this.dispatchEvent(new I.MuteForcedEvent(e))}.bind(this),enableMuteOnEntry:()=>{Ee=!0},addSubscriberToPeerConnectionsQueue:(e,t)=>{Se.push({pc:e,message:t}),Ie||(Ie=setInterval(()=>{const e=Se.pop();e?e.pc.processMessage("offer",e.message):(clearInterval(Ie),Ie=null)},100))},disableMuteOnEntry:()=>{Ee=!1},privateEvents:new i},this.signal=function(e,t){let n=e,r=t||function(){};if(a(n)&&(r=n,n=null),this.isNot("connected")){const e="Unable to send signal - you are not connected to the session.";je(N(C.NOT_CONNECTED,new Error(e),500),r)}else ie.signal(n,(function(e){if(e){const t=i(e.code);return t&&(e=N(t,new Error(e.message),e.code)),void r(e)}for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];r(e,...n)}),this.logEvent),e&&e.data&&"string"!=typeof e.data&&ye.warn("Signaling of anything other than Strings is deprecated. Please update the data property to be a string.");function i(e){switch(e){case 400:case 413:return C.INVALID_PARAMETER;case 429:return C.RATE_LIMIT_EXCEEDED;case 404:return C.NOT_FOUND;case 500:return C.NOT_CONNECTED;case 403:return C.PERMISSION_DENIED;case 2001:return C.UNEXPECTED_SERVER_RESPONSE;default:return}}},this.forceDisconnect=function(e,t){if(this.isNot("connected")){const e="Cannot call forceDisconnect(). You are not connected to the session.";return void je(N(C.NOT_CONNECTED,new Error(e),x.NOT_CONNECTED),t)}const n="string"==typeof e?e:e.id,r="Invalid Parameter. Check that you have passed valid parameter values into the method call.";if(!n)return void je(N(C.INVALID_PARAMETER,new Error(r),x.INVALID_PARAMETER),t);Xe("forceDisconnect")?ie.forceDisconnect(n,(function(e){if(e)je(N(C.INVALID_PARAMETER,new Error(r),x.INVALID_PARAMETER),t);else if(t&&a(t)){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];t(e,...i)}})):je(N(C.PERMISSION_DENIED,new Error("This token does not allow forceDisconnect. The role must be at least `moderator` to enable this functionality"),x.UNABLE_TO_FORCE_DISCONNECT),t)},this.forceUnpublish=function(e,t){void 0===t&&(t=()=>{});const n=e=>je(N(e.name,new Error(e.msg),e.code),t),r={msg:"Invalid Parameter. Check that you have passed valid parameter values into the method call.",code:x.INVALID_PARAMETER,name:C.INVALID_PARAMETER},i={msg:"Cannot call forceUnpublish(). You are not connected to the session.",code:x.NOT_CONNECTED,name:C.NOT_CONNECTED},o={msg:"This token does not allow forceUnpublish. The role must be at least `moderator` to enable this functionality",code:x.UNABLE_TO_FORCE_UNPUBLISH,name:C.PERMISSION_DENIED},s={msg:"The stream does not exist.",name:C.NOT_FOUND},a={msg:"An unexpected error occurred.",name:C.UNEXPECTED_SERVER_RESPONSE,code:x.UNEXPECTED_SERVER_RESPONSE};if(!e)return void n(r);if(p.isNot("connected"))return void n(i);const c=re(e);Xe("forceUnpublish")?ie.forceUnpublish(c.id,e=>{e?"404"===e.code?n(s):"403"===e.code?n(o):n(a):t(null)}):n(o)},this.forceMuteStream=e=>new t((t,n)=>{const r=Fe();r?n(r):e&&e.id?ie.forceMuteStream(e.id,e=>{e?n(Ye(e)):t()}):n(Ue(L.INVALID_PARAMETER))}),this.forceMuteAll=e=>new t((t,n)=>{const r=Fe();if(r)return void n(r);if(Array.isArray(e)&&!e.every(e=>e instanceof R)||e&&!Array.isArray(e))return void n(Ue(L.INVALID_PARAMETER));const i=(e||[]).map(e=>e.id);ie.forceMuteAll(i,!0,e=>{e?n(Ye(e)):t()})}),this.disableForceMute=()=>new t((e,t)=>{const n=Fe();n?t(n):ie.forceMuteAll([],!1,n=>{n?t(Ye(n)):e()})}),this.isConnected=()=>this.is("connected"),this.capabilities=new _([])}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(10),i=n(22),o=[400,403,409,r.CONNECTION_LIMIT_EXCEEDED],s="ConnectToSession",a="GetSessionState";e.exports=function(e){let t,n;if(e.reason===s&&e.code===r.CONNECT_FAILED)t=e.code,n=i.getTitleByCode(e.code);else if(e.code&&o.indexOf(Number(e.code))>-1)switch(t=r.CONNECT_FAILED,e.reason){case s:switch(e.code){case r.CONNECTION_LIMIT_EXCEEDED:t=e.code,n="Cannot connect -- the limit for concurrent connections to the session has been reached";break;default:n="Received error response to connection create message."}break;case a:n="Received error response to session read";break;default:n=""}else t=r.UNEXPECTED_SERVER_RESPONSE,n="Unexpected server response. Try this operation again later.";return{code:t,message:n}}},function(e,t,n){"use strict";const r=n(3),i=n(51).once;e.exports=()=>i()&&(r.isChromiumEdge||["Chrome","Safari","Firefox","Opera"].includes(r.name))},function(e,t,n){"use strict";e.exports=function(e){return JSON.stringify(e)}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;t.default=e=>{let t=e.logger,n=e.obj;e.eventNames.forEach(e=>{n.on(e,(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spam("emitted",e,r)}))})}},function(e,t,n){"use strict";const r=n(15),i=n(22),o=n(6),s=n(1)("Dispatcher"),a=n(175),c=n(726),u=function(){o(this),this.callbacks={}};e.exports=u,u.prototype.registerCallback=function(e,t){this.callbacks[e]=t},u.prototype.triggerCallback=function(e){if(!e)return;const t=this.callbacks[e];if(t&&r(t)){const e=Array.prototype.slice.call(arguments);e.shift(),t(...e)}delete this.callbacks[e]},u.prototype.onClose=function(e){this.emit("close",e)},u.prototype.onReconnected=function(){this.emit("reconnected")},u.prototype.onReconnecting=function(){this.emit("reconnecting")},u.prototype.dispatch=function(e){if(e.type===a.STATUS){var t;let n;if(s.debug(e),e.isError){let t;if("string"==typeof e.data)try{const n=JSON.parse(e.data);n&&"object"==typeof n&&(t=n.reason)}catch(e){s.warn("Failed to parse rumorMessage.data",e)}n=new i(e.status,t)}const r=e.data?JSON.parse(e.data):"";return(null==r||null==(t=r.mute)?void 0:t.active)&&this.dispatchMuteOnEntry(),void this.triggerCallback(e.transactionId,n,e)}const n=c(e);switch(s.debug(n.signature+":",n),n.resource){case"session":this.dispatchSession(n);break;case"connection":this.dispatchConnection(n);break;case"stream":this.dispatchStream(n);break;case"stream_channel":this.dispatchStreamChannel(n);break;case"subscriber":this.dispatchSubscriber(n);break;case"subscriber_channel":this.dispatchSubscriberChannel(n);break;case"signal":this.dispatchSignal(n);break;case"archive":this.dispatchArchive(n);break;case"source":this.dispatchSource(n);break;default:s.debug(`Type ${n.resource} is not currently implemented`)}},u.prototype.dispatchSession=function(e){switch(e.method){case"read":this.emit("session#read",e.content,e.transactionId);break;case"update":this.emit("session#update",e.content);break;default:s.debug(e.signature+" is not currently implemented")}},u.prototype.dispatchMuteOnEntry=function(){this.emit("session#muted")},u.prototype.dispatchConnection=function(e){switch(e.method){case"created":this.emit("connection#created",e.content);break;case"deleted":this.emit("connection#deleted",e.params.connection,e.reason);break;default:s.debug(e.signature+" is not currently implemented")}},u.prototype.dispatchStream=function(e){switch(e.method){case"created":this.emit("stream#created",e.content,e.transactionId);break;case"deleted":this.emit("stream#deleted",e.params.stream,e.reason,e.content);break;case"updated":this.emit("stream#updated",e.params.stream,e.content);break;case"update":this.emit("stream#update",e.params.stream,e.content);break;case"generateoffer":case"answer":case"pranswer":case"offer":case"candidate":this.dispatchJsep(e.method,e);break;default:s.debug(e.signature+" is not currently implemented")}},u.prototype.dispatchStreamChannel=function(e){switch(e.method){case"updated":this.emit("streamChannel#updated",e.params.stream,e.params.channel,e.content);break;default:s.debug(e.signature+" is not currently implemented")}},u.prototype.dispatchJsep=function(e,t){this.emit("jsep#"+e,t.params.stream,t.fromAddress,t)},u.prototype.dispatchSubscriberChannel=function(e){switch(e.method){case"updated":this.emit("subscriberChannel#updated",e.params.stream,e.params.channel,e.content);break;case"update":this.emit("subscriberChannel#update",e.params.subscriber,e.params.stream,e.content);break;default:s.debug(e.signature+" is not currently implemented")}},u.prototype.dispatchSubscriber=function(e){switch(e.method){case"created":this.emit("subscriber#created",e.params.stream,e.fromAddress,e.content.id);break;case"deleted":this.dispatchJsep("unsubscribe",e),this.emit("subscriber#deleted",e.params.stream,e.fromAddress);break;case"generateoffer":case"answer":case"pranswer":case"offer":case"candidate":this.dispatchJsep(e.method,e);break;default:s.debug(e.signature+" is not currently implemented")}},u.prototype.dispatchSignal=function(e){"signal"===e.method?this.emit("signal",e.fromAddress,e.content):s.debug(e.signature+" is not currently implemented")},u.prototype.dispatchArchive=function(e){switch(e.method){case"created":this.emit("archive#created",e.content);break;case"updated":this.emit("archive#updated",e.params.archive,e.content)}},u.prototype.dispatchSource=function(e){switch(e.method){case"create":this.emit("source#create",e.params.source,e.params.stream,e.reason);break;case"delete":this.emit("source#delete",e.params.source,e.params.stream,e.reason);break;default:s.debug(e.signature+" is not currently implemented")}}},function(e,t,n){"use strict";const r=n(19),i=n(5),o=n(729),s=n(730),a=n(317),c=n(731),u=n(34)().onlyLocal(),d={};e.exports=d,d.connections={},d.connections.create=function(e){const t=e.apiKey,n=e.sessionId,r=e.connectionId,o=e.connectionEventsSuppressed,s=e.capabilities;return a({method:"create",uri:`/v2/partner/${t}/session/${n}/connection/${r}`,content:{userAgent:i.env.userAgent,clientVersion:u.clientVersion,capabilities:s||[],connectionEventsSuppressed:o}})},d.connections.destroy=function(e){const t=e.apiKey,n=e.sessionId,r=e.connectionId;return a({method:"delete",uri:`/v2/partner/${t}/session/${n}/connection/${r}`,content:{}})},d.sessions={},d.sessions.get=function(e,t){return a({method:"read",uri:`/v2/partner/${e}/session/${t}`,content:{}})},d.streams={},d.streams.get=function(e,t,n){return a({method:"read",uri:`/v2/partner/${e}/session/${t}/stream/${n}`,content:{}})},d.streams.channelFromOTChannel=function(e){const t={id:e.id,type:e.type,active:e.active};return"video"===e.type&&(t.width=e.width,t.height=e.height,t.orientation=e.orientation,t.frameRate=e.frameRate,"default"!==e.source&&(t.source=e.source),t.fitMode=e.fitMode),t},d.streams.create=function(e){void 0===e&&(e={});const t=e,n=t.apiKey,r=t.sessionId,i=t.streamId,o=t.name,s=t.audioFallbackEnabled,c=t.channels,u=t.minBitrate,l=t.maxBitrate,p=t.sourceStreamId,f=t.e2ee,h={id:i,name:o,audioFallbackEnabled:s,channel:c.map(e=>d.streams.channelFromOTChannel(e)),e2ee:f};return u&&(h.minBitrate=Math.round(u)),l&&(h.maxBitrate=Math.round(l)),p&&(h.sourceStreamId=p),"boolean"==typeof f&&(h.e2ee=f),a({method:"create",uri:`/v2/partner/${n}/session/${r}/stream/${i}`,content:h})},d.streams.destroy=function(e,t,n,r){const i={};return r&&(i.sourceStreamId=r),a({method:"delete",uri:`/v2/partner/${e}/session/${t}/stream/${n}`,content:i})},d.streamChannels={},d.streamChannels.update=function(e,t,n,r,i){return a({method:"update",uri:`/v2/partner/${e}/session/${t}/stream/${n}/channel/${r}`,content:i})},d.subscribers={},d.subscribers.create=function(e){void 0===e&&(e={});const t=e,n=t.apiKey,r=t.sessionId,i=t.streamId,u=t.subscriberId,d=t.connectionId,l=t.channelsToSubscribeTo,p=t.sourceStreamId,f=t.e2ee,h={id:u,connection:d,keyManagementMethod:c,bundleSupport:o(),rtcpMuxSupport:s(),e2ee:f};return l&&(h.channel=l),p&&(h.sourceStreamId=p),a({method:"create",uri:`/v2/partner/${n}/session/${r}/stream/${i}/subscriber/${u}`,content:h})},d.subscribers.destroy=function(e,t,n,r){return a({method:"delete",uri:`/v2/partner/${e}/session/${t}/stream/${n}/subscriber/${r}`,content:{}})},d.subscribers.update=function(e,t,n,r,i){return a({method:"update",uri:`/v2/partner/${e}/session/${t}/stream/${n}/subscriber/${r}`,content:i})},d.subscriberChannels={},d.subscriberChannels.update=function(e,t,n,r,i,o){return a({method:"update",uri:`/v2/partner/${e}/session/${t}/stream/${n}/subscriber/${r}/channel/${i}`,content:o})},d.signals={},d.signals.create=function(e,t,n,i,o){const s={};return void 0!==i&&(s.type=i),void 0!==o&&(s.data=o),a({method:"signal",uri:`/v2/partner/${e}/session/${t}${void 0!==n?"/connection/"+n:""}/signal/${r()}`,content:s})},d.forceMute={},d.forceMute.update=e=>{const t=e.apiKey,n=e.sessionId,r=e.streamId,i=e.active,o=e.excludedStreamIds,s={reason:"mute",channels:["audio"],active:i,locked:!1};return o&&(s.exclusion=o),a({method:"update",uri:`/v2/partner/${t}/session/${n}${r?"/stream/"+r:""}`,content:s})}},function(e,t,n){"use strict";const r=n(37),i=n(72),o=n(176),s=n(320),a=n(322);e.exports=function(e,t,n){var c;this.toRaptorMessage=function(){let t=this.to;return t&&"string"!=typeof t&&(t=t.id),s.signals.create(i.value,e,t,this.type,this.data)},this.toHash=function(){return n},this.error=null,this.retryAfterReconnect=!0,n&&(n.hasOwnProperty("data")&&(this.data=r(n.data),this.error=function(e){let t=null;if(null==e)t={code:400,reason:"The signal data was null or undefined. Either set it to a String value or omit it"};else try{JSON.stringify(e).length>8192&&(t={code:413,reason:"The data field was too long, the maximum size of it is 8192 characters"})}catch(e){t={code:400,reason:"The data field was not valid JSON"}}return t}(this.data)),n.hasOwnProperty("to")&&(this.to=n.to,this.error||(this.error=(c=this.to)?c instanceof o||c._tag===a?null:{code:400,reason:"The To field was invalid"}:{code:400,reason:"The signal to field was invalid. Either set it to a OT.Connection, OT.Session, or omit it entirely"})),n.hasOwnProperty("type")&&(this.error||(this.error=function(e){let t=null;return null==e?t={code:400,reason:"The signal type was null or undefined. Either set it to a String value or omit it"}:e.length>128?t={code:413,reason:"The signal type was too long, the maximum length of it is 128 characters"}:function(e){return!/^[a-zA-Z0-9\-\._~]+$/.exec(e)}(e)&&(t={code:400,reason:"The signal type was invalid, it can only contain letters, numbers, '-', '_', and '~'."}),t}(n.type)),this.type=n.type),n.hasOwnProperty("retryAfterReconnect")&&(this.error||(this.error=function(e){let t=null;return!0!==e&&!1!==e&&(t={code:400,reason:"The signal retryAfterReconnect was not true or false. Either set it to a Boolean value or omit it"}),t}(n.retryAfterReconnect)),this.retryAfterReconnect=n.retryAfterReconnect)),this.valid=null===this.error}},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8));const s=n(324),a=n(49),c=n(176),u=n(734),d=n(319),l=n(1)("SessionDispatcher"),p=n(21),f=n(174),h=n(151),m=n(171);function g(e,t){if(t.streams.has(e.id))return;const n=function(e,t){const n=e.channel.map(e=>new h(e)),r=e.connectionId?e.connectionId:e.connection.id;return new f(e.id,e.name,e.creationTime,t.connections.get(r),t,n)}(e,t);return t.streams.add(n),n}function b(e,t){if(t.archives.has(e.id))return;const n=function(e){return new s(e.id,e.name,e.status)}(e);return t.archives.add(n),n}const v=function(e){const t={};this.enqueue=function(){const n=arguments[0],r=Array.prototype.slice.call(arguments,1);t[n]||(t[n]=new u(e)),t[n].enqueue.apply(t[n],r)},this.triggerConnectionCreated=function(e){t["connectionCreated"+e.id]&&t["connectionCreated"+e.id].triggerAll()},this.triggerSessionConnected=function(e){t.sessionConnected&&t.sessionConnected.triggerAll(),e.forEach((function(e){this.triggerConnectionCreated(e)}),this)}},y={};e.exports=function(e,t){let n=(void 0===t?{}:t).connectionEventsSuppressed;const r=new d;let s=!1;const u=new v(r);r.on("reconnecting",()=>{e._.reconnecting()}),r.on("reconnected",()=>{e._.reconnected()}),r.on("close",t=>{const n=e.connection;n&&(n.destroyedReason()?l.debug("Socket was closed but the connection had already been destroyed. Reason: "+n.destroyedReason()):n.destroy(t))});const f=function(t,n){return e.connections.has(t.id)?e.connections.get(t.id):(t=c.fromHash(t),(n||e.connection&&t.id!==e.connection.id)&&(e.connections.add(t),u.triggerConnectionCreated(t)),Object.keys(y).forEach(r=>{const i=y[r];if(i&&t.id===i.connection.id){g(i,e),delete y[i.id];const r={debug:n?"connection came in session#read":"connection came in connection#created",streamId:i.id,connectionId:t.id};e.logEvent("streamCreated","warning",r)}}),t)};r.on("session#read",(t,n)=>{let i;const o={streams:[],connections:[],archives:[]};t.connection.forEach(e=>{i=f(e,!0),o.connections.push(i)}),t.stream.forEach(t=>{o.streams.push(g(t,e))}),(t.archive||t.archives).forEach(t=>{o.archives.push(b(t,e))}),r.triggerCallback(n,null,o),s=!0,u.triggerSessionConnected(e.connections)}),r.on("session#update",t=>{if("mute"!==t.reason)return void l.debug("session#update that handle this reason is not currently implemented");const n=!0===t.active;e._.forceMute({active:n}),n?e._.enableMuteOnEntry():e._.disableMuteOnEntry()}),r.on("session#muted",()=>{e._.enableMuteOnEntry(),e._.forceMute({active:!0})}),r.on("connection#created",e=>{f(e)}),r.on("connection#deleted",(t,n)=>{(t=e.connections.get(t))?t.destroy(n):l.warn("A connection was deleted that we do not know about")}),r.on("stream#created",(t,i)=>{const o=t.id,s=t.sourceStreamId,a=t.connection;let c;if(n){if(null==a||null==a.id)return void e.logEvent("SessionDispatcher:stream#created","Event",{connection:a,info:"Stream did not contain a connection object. Event ignored"});f(a)}const u=t.connectionId||a.id;if(e.connections.has(u))c=g(t,e);else{y[o]=t;const n={debug:"eventOrderError -- streamCreated event before connectionCreated",streamId:o,sourceStreamId:m(s)};e.logEvent("streamCreated","warning",n)}c?(c.publisher&&c.publisher.setStream(c),r.triggerCallback(i,null,c)):e.sessionInfo.isAdaptiveEnabled&&"P2P"===s&&p.subscribers.where({streamId:o}).forEach(e=>{e._.startRoutedToRelayedTransition()})}),r.on("stream#deleted",(t,n,r)=>{const i=e.streams.get(t),o=r.sourceStreamId,s=p.subscribers,a=e.sessionInfo.isAdaptiveEnabled&&"P2P"===o;(i||a)&&(a?s.where({streamId:t}).forEach(e=>{e._.startRelayedToRoutedTransition()}):i.destroy(n))}),r.on("stream#updated",(t,n)=>{const r=e.streams.get(t);r?r._.update(n):l.error(`A stream does not exist with the id of ${t}, for stream#updated message!`)}),r.on("stream#update",(t,n)=>{const r=e.streams.get(t),i=n.reason,o=n.active;r?"mute"===i?o&&r._.forceMute(n):l.debug("stream#update that handle this reason is not currently implemented"):l.error(`A stream does not exist with the id of ${t}, for stream#updated message!`)}),r.on("streamChannel#updated",(t,n,r)=>{let i;t&&(i=e.streams.get(t))?i._.updateChannel(n,r):l.error("Unable to determine streamId, or the stream does not exist, for streamChannel message!")});const h=(t,n,r,s)=>{let u,d;const f={streamId:n},h=p.subscribers,m=p.publishers;switch(u=s.params.subscriber?{widgetId:s.params.subscriber}:f,t){case"offer":d=[].concat(h.where(u),m.where(f)).slice(0,1);break;case"answer":case"pranswer":d=[].concat(m.where(f),h.where(u)).slice(0,1);break;case"generateoffer":case"unsubscribe":d=m.where(f);break;case"candidate":d=[].concat(h.where(u),m.where(f));break;default:return void l.debug(`jsep#${t} is not currently implemented`)}if(0===d.length)return;let g=e.connections.get(r);!g&&r.match(/^symphony\./)&&(g=c.fromHash({id:r,creationTime:Math.floor(a())}),e.connections.add(g)),d.forEach(function(){var e=(0,o.default)(i.default.mark((function e(n){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.processMessage(t,r,s);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),l.error("Error occurred during processMessage",e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}())};return r.on("jsep#offer",h.bind(null,"offer")),r.on("jsep#answer",h.bind(null,"answer")),r.on("jsep#pranswer",h.bind(null,"pranswer")),r.on("jsep#generateoffer",h.bind(null,"generateoffer")),r.on("jsep#unsubscribe",h.bind(null,"unsubscribe")),r.on("jsep#candidate",h.bind(null,"candidate")),r.on("subscriberChannel#updated",(t,n,r)=>{t&&e.streams.has(t)?e.streams.get(t)._.updateChannel(n,r):l.error("Unable to determine streamId, or the stream does not exist, for subscriberChannel#updated message!")}),r.on("subscriberChannel#update",(t,n,r)=>{n&&e.streams.has(n)?p.subscribers.has(t)?p.subscribers.get(t).disableVideo(r.active):l.error("Unable to determine subscriberId, or the subscriber does not exist, for subscriberChannel#update message!"):l.error("Unable to determine streamId, or the stream does not exist, for subscriberChannel#update message!")}),r.on("signal",(t,r)=>{if(n){let n=r.connection||r.fromConnection;null!=n&&null!=n.id||(n=function(e){return{id:e,creationTime:(new Date).getTime(),data:{},capablities:{},permissions:[]}}(t),e.logEvent("SessionDispatcher:Signal","Event",{fromAddress:t,connection:r.connection,fromConnection:r.fromConnection,info:"Signal did not contain a connection object. One has been constructed",constructedConnection:n})),f(n)}const i=r.type,o=r.data,a=e.connections.get(t);e.connection&&t===e.connection.connectionId?s?e._.dispatchSignal(a,i,o):u.enqueue("sessionConnected","signal",t,i,o):e.connections.get(t)?e._.dispatchSignal(a,i,o):""===t?e._.dispatchSignal(null,i,o):u.enqueue("connectionCreated"+t,"signal",t,i,o)}),r.on("archive#created",t=>{b(t,e)}),r.on("archive#updated",(t,n)=>{const r=e.archives.get(t);r?r._.update(n):l.error(`An archive does not exist with the id of ${t}, for archive#updated message!`)}),r.on("source#create",(t,n,r)=>{const i=m(t);e.logEvent("SessionDispatcher:source#create","Event",{sourceStreamId:i,streamId:n,reason:r}),l.debug(`Received a request from RUMOR to start a transition to ${t} for the stream ID ${n} with the reason: ${r}`),p.publishers.where({streamId:n}).forEach(e=>{e._.startRoutedToRelayedTransition()})}),r.on("source#delete",(t,n,r)=>{e.logEvent("SessionDispatcher:source#delete","Event",{sourceStreamId:m(t),streamId:n,reason:r}),l.debug(`Received a request from RUMOR to start a transition from P2P to MANTIS for the stream ID ${n} with the reason: ${r}`),p.publishers.where({streamId:n}).forEach(e=>{e._.startRelayedToRoutedTransition()})}),r}},function(e,t,n){"use strict";const r=n(23)(),i=n(6);e.exports=function(e,t,n){this.id=e,this.name=t,this.status=n,this._={},i(this),this._.update=e=>{Object.keys(e).forEach(t=>{const n=this[t];this[t]=e[t];const i=new r.ArchiveUpdatedEvent(this,t,n,this[t]);this.dispatchEvent(i)})},this.destroy=()=>{}}},function(e,t,n){"use strict";const r=n(24)().getAudioOutputMediaDevices;e.exports=()=>r()},function(e,t,n){"use strict";const r=n(24)().getActiveAudioOutputDevice;e.exports=()=>r()},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(7)),o=r(n(8));const s=n(21),a=n(106).setCurrentAudioOutputDeviceId,c=n(326),u=n(24)(),d=u.getDefaultAudioOutputDeviceId,l=u.getAudioOutputMediaDevices,p=n(296),f=new(n(26)),h=(e,t)=>{f.logEvent({action:"updateSubscribersSinkId",variation:e,payload:t})},m=e=>{const n=s.subscribers.map(t=>t._.setSinkId(e));return t.all(n)},g=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p();case 2:return e.prev=2,h("Attempt",{deviceId:t}),e.next=6,m(t);case 6:h("Success",{deviceId:t}),e.next=13;break;case 9:throw e.prev=9,e.t0=e.catch(2),h("Failure",{deviceId:t,error:null==e.t0?void 0:e.t0.message}),e.t0;case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}(),b=function(){var e=(0,o.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l();case 2:return t=e.sent,n=d(t),e.prev=4,e.next=7,g(n);case 7:a(n),e.next=12;break;case 10:e.prev=10,e.t0=e.catch(4);case 12:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(){return e.apply(this,arguments)}}(),v=function(){var e=(0,o.default)(i.default.mark((function e(){var t;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c();case 2:return t=e.sent,e.prev=3,e.next=6,g(t.deviceId);case 6:e.next=12;break;case 8:return e.prev=8,e.t0=e.catch(3),e.next=12,b();case 12:case"end":return e.stop()}}),e,null,[[3,8]])})));return function(){return e.apply(this,arguments)}}();e.exports=function(){var e=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,h("Attempt",{deviceId:t}),e.next=4,m(t);case 4:h("Success",{deviceId:t}),a(t),e.next=14;break;case 8:return e.prev=8,e.t0=e.catch(0),h("Failure",{deviceId:t,error:null==e.t0?void 0:e.t0.message}),e.next=13,v();case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}()}).call(this,n(0))},function(e,t,n){"use strict";n(329);const r=n(37),i=n(27),o=n(6),s=n(127),a=n(34)(),c=n(26),u=n(252),d=n(553),l=n(554),p=n(555),f=a.onlyLocal(),h={};h.noConflict=n(556)(),(void 0!==typeof window?window:global).OT=h,e.exports=h,(()=>{let e=h;Object.defineProperty(void 0!==typeof window?window:global,"TB",{get:()=>(e===h&&console.warn("window.TB is deprecated, and will be removed in the future. Please access via window.OT"),e),set:t=>{e=t},configurable:!0})})();const m=n(143)(void 0!==typeof window?window:global),g=n(5),b=n(72),v=n(144),y=n(255),E=n(145),S=n(146),_=n(256),w=n(147),T=n(4),C=n(10),I=n(257),R=n(244),x=n(1)("OT"),O=n(120),k=n(583),N=n(22),Z=n(101).parseIceServers,A=n(269),L=n(21),V=n(151),P=n(153),M=n(154),D=n(102)({global:m}),W=n(13)({}),G=n(162)(),X=n(282)({otError:W}),j=n(283)(),U=n(288)({global:m}),F=n(24)({getNativeEnumerateDevices:U}),Y=n(23)(),B=n(164)(),K=n(640)({otError:W,global:m}),H=n(165)({chromeExtensionHelper:X,otError:W}),J=n(645)({deviceHelpers:F,generateConstraintInfo:I,getUserMediaHelper:K,global:m,OTHelpers:g,screenSharing:H}),z=n(648)({otError:W,processPubOptions:J}),Q=n(166)({otError:W}),q=n(74),$=n(293)(),ee=n(294)({otError:W}),te=n(295)({global:m,videoElementErrorMap:ee}),ne=n(167)({global:m}),re=n(297)({PeerConnection:D,setCertificates:ne}),ie=n(300)({PeerConnection:D,setCertificates:ne}),oe=n(301)(),se=n(658)({otError:W}),ae=n(108)({NativeVideoElementWrapper:te}),ce=n(152)(),ue=n(168)({VideoElementFacade:ae}),de=n(304)({interpretPeerConnectionError:Q,otError:W,SubscriberPeerConnection:ie,WidgetView:ue}),le=n(172)({APIKEY:b,createChromeMixin:j,deviceHelpers:F,EnvironmentLoader:w,Errors:T,Events:Y,ExceptionCodes:C,calculateCapableSimulcastStreams:y,global:m,interpretPeerConnectionError:Q,IntervalRunner:q,Microphone:$,otError:W,OTErrorClass:N,OTHelpers:g,parseIceServers:Z,processPubOptions:J,PUBLISH_MAX_DELAY:A,PublisherPeerConnection:re,PublishingState:oe,StreamChannel:V,systemRequirements:M,VideoOrientation:ce,WidgetView:ue}),pe=n(313)({otError:W,Publisher:le}),fe=n(314)({global:m,initPublisher:pe,otError:W,Publisher:le,Subscriber:de}),he=n(738)({Session:fe});o(h);const me=n(739);u(h,"$",{name:"OT.$",getMessage:"Please use an external library like jQuery to select elements from the page.",value:g}),h.APIKEY=b.value,h.AnalyserAudioLevelSampler=S,h.Archive=n(324),h.ArchiveEvent=Y.ArchiveEvent,h.ArchiveUpdatedEvent=Y.ArchiveUpdatedEvent,h.AudioLevelTransformer=v,h.AudioLevelUpdatedEvent=Y.AudioLevelUpdatedEvent,h.Capabilities=n(173),h.Chrome=E,h.Connection=n(176),h.ConnectionCapabilities=h.Connection.Capabilities,h.ConnectionEvent=Y.ConnectionEvent,Object.keys(O).forEach(e=>{h[e.toUpperCase()]=O[e].priority}),h.NONE=0,h.debug=x.debug,h.error=x.error,h.info=x.info,h.log=x.log,h.warn=x.warn,h.DestroyedEvent=Y.DestroyedEvent,h.EnvLoadedEvent=Y.EnvLoadedEvent,h.Error=N,h.Error.on(i.EXCEPTION,e=>{if(e.target===h.Error){const t=r(e);t.target=h,h.dispatchEvent(t)}else h.dispatchEvent(e)}),h.Event=s,h.ExceptionCodes=C,h.ExceptionEvent=Y.ExceptionEvent,h.getDevices=n(742),h.getAudioOutputDevices=n(325),h.getActiveAudioOutputDevice=n(326),h.setAudioOutputDevice=n(743)(),h.GetAudioLevelSampler=_,h.HAS_REQUIREMENTS=1,h.IntervalRunner=q,h.IssueReportedEvent=Y.IssueReportedEvent,h.MediaStoppedEvent=Y.MediaStoppedEvent,h.Microphone=$,h.NOT_HAS_REQUIREMENTS=0,h.PeerConnection=D,h.PeerConnection.QOS=n(280).default,h.Publisher=le,h.PublisherPeerConnection=re,h.PublishingState=oe,h.MuteForcedEvent=Y.MuteForcedEvent,h.Session=fe,h.SessionConnectEvent=Y.SessionConnectEvent,h.SessionDisconnectEvent=Y.SessionDisconnectEvent,h.SessionDispatcher=n(323),h.Signal=n(321),h.SignalEvent=Y.SignalEvent,h.Stream=n(174),h.StreamChannel=V,h.StreamEvent=Y.StreamEvent,h.StreamPropertyChangedEvent=Y.StreamPropertyChangedEvent,h.StreamUpdatedEvent=Y.StreamUpdatedEvent,h.StylableComponent=P,h.Subscriber=de,h.SubscriberPeerConnection=ie,h.SubscribingState=n(307),h.VideoDimensionsChangedEvent=Y.VideoDimensionsChangedEvent,h.VideoDisableWarningEvent=Y.VideoDisableWarningEvent,h.VideoElement=ae,h.VideoEnabledChangedEvent=Y.VideoEnabledChangedEvent,h.VideoOrientation=ce,h.WidgetView=ue,h.getSupportedCodecs=me,h._={AnalyticsHelper:c,getClientGuid:R.get,StaticConfig:a,initE2EE:p},Object.defineProperty(h,"version",{value:f.version});const ge={};u(ge,"version",{value:f.version,name:"OT.properties.version",getWarning:"Please use OT.version instead",warnOnSet:!0,setWarning:"Mutating version has no effect"}),d.forEach(e=>{let t,n;if(Array.isArray(e)){const r=e[0],i=e[1];n=r,t=f[i]||i}else t=f[e],n=e;const r=(i=n,l.includes(i));var i;u(ge,n,{value:t,name:"OT.properties."+n,warnOnSet:!0,canSet:r,setWarning:r?`Mutating ${n} can cause side effects`:`Mutating ${n} has no effect`})}),h.properties=ge,h.audioContext=G,h.checkScreenSharingCapability=H.checkCapability,h.checkSystemRequirements=M.check,h.components={},h.generateSimpleStateMachine=B,h.getErrorTitleByCode=N.getTitleByCode,h.getLogs=x.getLogs,h.getStatsAdpater=n(276),h.getStatsHelpers=n(75),h.getUserMedia=z,h.handleJsException=N.handleJsException,h.initPublisher=pe,h.setProxyUrl=n(140).setProxyUrl,h.initSession=function(e,t,n){return null==t&&(t=e,e=null),0===b.value.length&&e&&(b.value=e,h.APIKEY=e),he(e,t,n)};const be=(e,t)=>()=>(console.warn(e+" is deprecated and will be removed in a future version of OpenTok"),t);Object.defineProperties(h,{isUnloaded:{get:be("OT.isUnloaded",w.isUnloaded)},onLoad:{get:be("OT.onLoad",w.onLoad)},onUnload:{get:be("OT.onUnload",w.onUnload)},overrideGuidStorage:{get:be("OT.overrideGuidStorage",R.override)}}),h.pickScreenSharingHelper=H.pickHelper,h.publishers=L.publishers,h.registerScreenSharingExtension=H.registerExtension,h.registerScreenSharingExtensionHelper=H.registerExtensionHelper,h.reportIssue=se,h.sessions=L.sessions,h.setLogLevel=k,h.shouldLog=x.shouldLog,h.subscribers=L.subscribers,h.unblockAudio=n(170),h.upgradeSystemRequirements=M.upgrade,w.onUnload(()=>{L.publishers.destroy(),L.subscribers.destroy(),L.sessions.destroy("unloaded")}),n(744)()},function(e,t,n){var r=n(330);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(344)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){t=e.exports=n(331)(!1);var r=n(332),i=r(n(333)),o=r(n(334)),s=r(n(335)),a=r(n(336)),c=r(n(337)),u=r(n(338)),d=r(n(339)),l=r(n(340)),p=r(n(341)),f=r(n(342)),h=r(n(343));t.push([e.i,"/*!\n * Copyright (c) 2017 TokBox, Inc.\n * Released under the MIT license\n * http://opensource.org/licenses/MIT\n */\n\n/**\n * OT Base styles\n */\n\n/* Root OT object, this is where our CSS reset happens */\n.OT_root,\n.OT_root * {\n color: #ffffff;\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n font-family: Arial, Helvetica, sans-serif;\n vertical-align: baseline;\n}\n\n/**\n * Specific Element Reset\n */\n\n.OT_root h1,\n.OT_root h2,\n.OT_root h3,\n.OT_root h4,\n.OT_root h5,\n.OT_root h6 {\n color: #ffffff;\n font-family: Arial, Helvetica, sans-serif;\n font-size: 100%;\n font-weight: bold;\n}\n\n.OT_root header {\n\n}\n\n.OT_root footer {\n\n}\n\n.OT_root div {\n\n}\n\n.OT_root section {\n\n}\n\n.OT_root video {\n\n}\n\n.OT_root button {\n\n}\n\n.OT_root strong {\n font-weight: bold;\n}\n\n.OT_root em {\n font-style: italic;\n}\n\n.OT_root a,\n.OT_root a:link,\n.OT_root a:visited,\n.OT_root a:hover,\n.OT_root a:active {\n font-family: Arial, Helvetica, sans-serif;\n}\n\n.OT_root ul, .OT_root ol {\n margin: 1em 1em 1em 2em;\n}\n\n.OT_root ol {\n list-style: decimal outside;\n}\n\n.OT_root ul {\n list-style: disc outside;\n}\n\n.OT_root dl {\n margin: 4px;\n}\n\n.OT_root dl dt,\n.OT_root dl dd {\n float: left;\n margin: 0;\n padding: 0;\n}\n\n.OT_root dl dt {\n clear: left;\n text-align: right;\n width: 50px;\n}\n\n.OT_root dl dd {\n margin-left: 10px;\n}\n\n.OT_root img {\n border: 0 none;\n}\n\n/* Modal dialog styles */\n\n/* Modal dialog styles */\n\n.OT_dialog-centering {\n display: table;\n width: 100%;\n height: 100%;\n}\n\n.OT_dialog-centering-child {\n display: table-cell;\n vertical-align: middle;\n}\n\n.OT_dialog {\n position: relative;\n\n box-sizing: border-box;\n max-width: 576px;\n margin-right: auto;\n margin-left: auto;\n padding: 36px;\n text-align: center; /* centers all the inline content */\n\n background-color: #363636;\n color: #fff;\n box-shadow: 2px 4px 6px #999;\n font-family: 'Didact Gothic', sans-serif;\n font-size: 13px;\n line-height: 1.4;\n}\n\n.OT_dialog * {\n font-family: inherit;\n box-sizing: inherit;\n}\n\n.OT_closeButton {\n color: #999999;\n cursor: pointer;\n font-size: 32px;\n line-height: 36px;\n position: absolute;\n right: 18px;\n top: 0;\n}\n\n.OT_dialog-messages {\n text-align: center;\n}\n\n.OT_dialog-messages-main {\n margin-bottom: 36px;\n line-height: 36px;\n\n font-weight: 300;\n font-size: 24px;\n}\n\n.OT_dialog-messages-minor {\n margin-bottom: 18px;\n\n font-size: 13px;\n line-height: 18px;\n color: #A4A4A4;\n}\n\n.OT_dialog-messages-minor strong {\n color: #ffffff;\n}\n\n.OT_dialog-actions-card {\n display: inline-block;\n}\n\n.OT_dialog-button-title {\n margin-bottom: 18px;\n line-height: 18px;\n\n font-weight: 300;\n text-align: center;\n font-size: 14px;\n color: #999999;\n}\n.OT_dialog-button-title label {\n color: #999999;\n}\n\n.OT_dialog-button-title a,\n.OT_dialog-button-title a:link,\n.OT_dialog-button-title a:active {\n color: #02A1DE;\n}\n\n.OT_dialog-button-title strong {\n color: #ffffff;\n font-weight: 100;\n display: block;\n}\n\n.OT_dialog-button {\n display: inline-block;\n\n margin-bottom: 18px;\n padding: 0 1em;\n\n background-color: #1CA3DC;\n text-align: center;\n cursor: pointer;\n}\n\n.OT_dialog-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.OT_dialog-button-large {\n line-height: 36px;\n padding-top: 9px;\n padding-bottom: 9px;\n\n font-weight: 100;\n font-size: 24px;\n}\n\n.OT_dialog-button-small {\n line-height: 18px;\n padding-top: 9px;\n padding-bottom: 9px;\n\n background-color: #444444;\n color: #999999;\n font-size: 16px;\n}\n\n.OT_dialog-progress-bar {\n display: inline-block; /* prevents margin collapse */\n width: 100%;\n margin-top: 5px;\n margin-bottom: 41px;\n\n border: 1px solid #4E4E4E;\n height: 8px;\n}\n\n.OT_dialog-progress-bar-fill {\n height: 100%;\n\n background-color: #29A4DA;\n}\n\n/* Helpers */\n\n.OT_centered {\n position: fixed;\n left: 50%;\n top: 50%;\n margin: 0;\n}\n\n.OT_dialog-hidden {\n display: none;\n}\n\n.OT_dialog-button-block {\n display: block;\n}\n\n.OT_dialog-no-natural-margin {\n margin-bottom: 0;\n}\n\n/* Publisher and Subscriber styles */\n\n.OT_publisher, .OT_subscriber {\n position: relative;\n min-width: 48px;\n min-height: 48px;\n}\n\n.OT_publisher .OT_video-element,\n.OT_subscriber .OT_video-element {\n display: block;\n position: absolute;\n width: 100%;\n height: 100%;\n\n transform-origin: 0 0;\n}\n\n/* Styles that are applied when the video element should be mirrored */\n.OT_publisher.OT_mirrored .OT_video-element {\n transform: scale(-1, 1);\n transform-origin: 50% 50%;\n}\n\n.OT_subscriber_error {\n background-color: #000;\n color: #fff;\n text-align: center;\n}\n\n.OT_subscriber_error > p {\n padding: 20px;\n}\n\n/* The publisher/subscriber name/mute background */\n.OT_publisher .OT_bar,\n.OT_subscriber .OT_bar,\n.OT_publisher .OT_name,\n.OT_subscriber .OT_name,\n.OT_publisher .OT_archiving,\n.OT_subscriber .OT_archiving,\n.OT_publisher .OT_archiving-status,\n.OT_subscriber .OT_archiving-status,\n.OT_publisher .OT_archiving-light-box,\n.OT_subscriber .OT_archiving-light-box {\n -ms-box-sizing: border-box;\n box-sizing: border-box;\n top: 0;\n left: 0;\n right: 0;\n display: block;\n height: 34px;\n position: absolute;\n}\n\n.OT_publisher .OT_bar,\n.OT_subscriber .OT_bar {\n background: rgba(0, 0, 0, 0.4);\n}\n\n.OT_publisher .OT_edge-bar-item,\n.OT_subscriber .OT_edge-bar-item {\n z-index: 1; /* required to get audio level meter underneath */\n}\n\n/* The publisher/subscriber name panel/archiving status bar */\n.OT_publisher .OT_name,\n.OT_subscriber .OT_name {\n background-color: transparent;\n color: #ffffff;\n font-size: 15px;\n line-height: 34px;\n font-weight: normal;\n padding: 0 4px 0 36px;\n letter-spacing: normal;\n}\n\n.OT_publisher .OT_archiving-status,\n.OT_subscriber .OT_archiving-status {\n background: rgba(0, 0, 0, 0.4);\n top: auto;\n bottom: 0;\n left: 34px;\n padding: 0 4px;\n color: rgba(255, 255, 255, 0.8);\n font-size: 15px;\n line-height: 34px;\n font-weight: normal;\n letter-spacing: normal;\n}\n\n.OT_micro .OT_archiving-status,\n.OT_micro:hover .OT_archiving-status,\n.OT_mini .OT_archiving-status,\n.OT_mini:hover .OT_archiving-status {\n display: none;\n}\n\n.OT_publisher .OT_archiving-light-box,\n.OT_subscriber .OT_archiving-light-box {\n background: rgba(0, 0, 0, 0.4);\n top: auto;\n bottom: 0;\n right: auto;\n width: 34px;\n height: 34px;\n}\n\n.OT_archiving-light {\n width: 7px;\n height: 7px;\n border-radius: 30px;\n position: absolute;\n top: 14px;\n left: 14px;\n background-color: #575757;\n box-shadow: 0 0 5px 1px #575757;\n}\n\n.OT_archiving-light.OT_active {\n background-color: #970d13;\n -webkit-animation: OT_pulse 1.3s ease-in;\n -moz-animation: OT_pulse 1.3s ease-in;\n -webkit-animation: OT_pulse 1.3s ease-in;\n -webkit-animation-iteration-count: infinite;\n -moz-animation-iteration-count: infinite;\n -webkit-animation-iteration-count: infinite;\n}\n\n.OT_mini .OT_bar,\n.OT_bar.OT_mode-mini,\n.OT_bar.OT_mode-mini-auto {\n bottom: 0;\n height: auto;\n}\n\n.OT_mini .OT_name.OT_mode-off,\n.OT_mini .OT_name.OT_mode-on,\n.OT_mini .OT_name.OT_mode-auto,\n.OT_mini:hover .OT_name.OT_mode-auto {\n display: none;\n}\n\n.OT_publisher .OT_name,\n.OT_subscriber .OT_name {\n left: 10px;\n right: 37px;\n height: 34px;\n padding-left: 0;\n}\n\n.OT_publisher .OT_mute,\n.OT_subscriber .OT_mute {\n border: none;\n cursor: pointer;\n display: block;\n position: absolute;\n text-align: center;\n text-indent: -9999em;\n background-color: transparent;\n background-repeat: no-repeat;\n}\n\n.OT_publisher .OT_mute,\n.OT_subscriber .OT_mute {\n right: 0;\n top: 0;\n border-left: 1px solid rgba(255, 255, 255, 0.2);\n height: 36px;\n width: 37px;\n}\n\n.OT_mini .OT_mute,\n.OT_publisher.OT_mini .OT_mute.OT_mode-auto.OT_mode-on-hold,\n.OT_subscriber.OT_mini .OT_mute.OT_mode-auto.OT_mode-on-hold {\n top: 50%;\n left: 50%;\n right: auto;\n margin-top: -18px;\n margin-left: -18.5px;\n border-left: none;\n}\n\n.OT_publisher .OT_mute {\n background-image: url("+i+");\n background-position: 9px 5px;\n}\n\n.OT_publisher .OT_mute.OT_active {\n background-image: url("+o+");\n background-position: 9px 4px;\n}\n\n.OT_subscriber .OT_mute {\n background-image: url("+s+");\n background-position: 8px 7px;\n}\n\n.OT_subscriber .OT_mute.OT_active {\n background-image: url("+a+");\n background-position: 7px 7px;\n}\n\n/**\n * Styles for display modes\n *\n * Note: It's important that these completely control the display and opacity\n * attributes, no other selectors should atempt to change them.\n */\n\n/* Default display mode transitions for various chrome elements */\n.OT_publisher .OT_edge-bar-item,\n.OT_subscriber .OT_edge-bar-item {\n transition-property: top, bottom, opacity;\n transition-duration: 0.5s;\n transition-timing-function: ease-in;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_mode-off,\n.OT_subscriber .OT_edge-bar-item.OT_mode-off,\n.OT_publisher .OT_edge-bar-item.OT_mode-auto,\n.OT_subscriber .OT_edge-bar-item.OT_mode-auto,\n.OT_publisher .OT_edge-bar-item.OT_mode-mini-auto,\n.OT_subscriber .OT_edge-bar-item.OT_mode-mini-auto {\n top: -25px;\n opacity: 0;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_mode-off,\n.OT_subscriber .OT_edge-bar-item.OT_mode-off {\n display: none;\n}\n\n.OT_mini .OT_mute.OT_mode-auto,\n.OT_publisher .OT_mute.OT_mode-mini-auto,\n.OT_subscriber .OT_mute.OT_mode-mini-auto {\n top: 50%;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_edge-bottom.OT_mode-off,\n.OT_subscriber .OT_edge-bar-item.OT_edge-bottom.OT_mode-off,\n.OT_publisher .OT_edge-bar-item.OT_edge-bottom.OT_mode-auto,\n.OT_subscriber .OT_edge-bar-item.OT_edge-bottom.OT_mode-auto,\n.OT_publisher .OT_edge-bar-item.OT_edge-bottom.OT_mode-mini-auto,\n.OT_subscriber .OT_edge-bar-item.OT_edge-bottom.OT_mode-mini-auto {\n top: auto;\n bottom: -25px;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_mode-on,\n.OT_subscriber .OT_edge-bar-item.OT_mode-on,\n.OT_publisher .OT_edge-bar-item.OT_mode-auto.OT_mode-on-hold,\n.OT_subscriber .OT_edge-bar-item.OT_mode-auto.OT_mode-on-hold,\n.OT_publisher:hover .OT_edge-bar-item.OT_mode-auto,\n.OT_subscriber:hover .OT_edge-bar-item.OT_mode-auto,\n.OT_publisher:hover .OT_edge-bar-item.OT_mode-mini-auto,\n.OT_subscriber:hover .OT_edge-bar-item.OT_mode-mini-auto {\n top: 0;\n opacity: 1;\n}\n\n.OT_mini .OT_mute.OT_mode-on,\n.OT_mini:hover .OT_mute.OT_mode-auto,\n.OT_mute.OT_mode-mini,\n.OT_root:hover .OT_mute.OT_mode-mini-auto {\n top: 50%;\n}\n\n.OT_publisher .OT_edge-bar-item.OT_edge-bottom.OT_mode-on,\n.OT_subscriber .OT_edge-bar-item.OT_edge-bottom.OT_mode-on,\n.OT_publisher:hover .OT_edge-bar-item.OT_edge-bottom.OT_mode-auto,\n.OT_subscriber:hover .OT_edge-bar-item.OT_edge-bottom.OT_mode-auto {\n top: auto;\n bottom: 0;\n opacity: 1;\n}\n\n\n/* Contains the video element, used to fix video letter-boxing */\n.OT_widget-container {\n position: absolute;\n background-color: #000000;\n overflow: hidden;\n}\n\n.OT_hidden-audio {\n position: absolute !important;\n height: 1px !important;\n width: 1px !important;\n}\n\n/* Load animation */\n.OT_root .OT_video-loading {\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n display: none;\n\n background-color: rgba(0, 0, 0, .75);\n}\n\n.OT_root .OT_video-loading .OT_video-loading-spinner {\n background: url("+c+") no-repeat;\n position: absolute;\n width: 32px;\n height: 32px;\n left: 50%;\n top: 50%;\n margin-left: -16px;\n margin-top: -16px;\n animation: OT_spin 2s linear infinite;\n}\n@keyframes OT_spin {\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.OT_publisher.OT_loading .OT_video-loading,\n.OT_subscriber.OT_loading .OT_video-loading {\n display: block;\n}\n\n.OT_publisher.OT_loading .OT_video-element,\n.OT_subscriber.OT_loading .OT_video-element {\n /*display: none;*/\n}\n\n.OT_video-centering {\n display: table;\n width: 100%;\n height: 100%;\n}\n\n.OT_video-container {\n display: table-cell;\n vertical-align: middle;\n}\n\n.OT_video-poster {\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n display: none;\n\n opacity: .25;\n\n background-repeat: no-repeat;\n background-image: url("+u+");\n background-size: auto 76%;\n}\n\n.OT_fit-mode-cover .OT_video-element {\n -o-object-fit: cover;\n object-fit: cover;\n}\n\n/* Workaround for iOS freezing issue when cropping videos */\n/* https://bugs.webkit.org/show_bug.cgi?id=176439 */\n@media only screen\n and (orientation: portrait) {\n .OT_subscriber.OT_ForceContain.OT_fit-mode-cover .OT_video-element {\n -o-object-fit: contain !important;\n object-fit: contain !important;\n }\n}\n\n.OT_fit-mode-contain .OT_video-element {\n -o-object-fit: contain;\n object-fit: contain;\n}\n\n.OT_fit-mode-cover .OT_video-poster {\n background-position: center bottom;\n}\n\n.OT_fit-mode-contain .OT_video-poster {\n background-position: center;\n}\n\n.OT_audio-level-meter {\n position: absolute;\n width: 25%;\n max-width: 224px;\n min-width: 21px;\n top: 0;\n right: 0;\n overflow: hidden;\n}\n\n.OT_audio-level-meter:before {\n /* makes the height of the container equals its width */\n content: '';\n display: block;\n padding-top: 100%;\n}\n\n.OT_audio-level-meter__audio-only-img {\n position: absolute;\n top: 22%;\n right: 15%;\n width: 40%;\n\n opacity: .7;\n\n background: url("+d+") no-repeat center;\n}\n\n.OT_audio-level-meter__audio-only-img:before {\n /* makes the height of the container equals its width */\n content: '';\n display: block;\n padding-top: 100%;\n}\n\n.OT_audio-level-meter__value {\n will-change: transform;\n position: absolute;\n top: -100%;\n right: -100%;\n width: 200%;\n height: 200%;\n transform: scale(0);\n border-radius: 50%;\n background-image: radial-gradient(circle, rgba(151, 206, 0, 1) 0%, rgba(151, 206, 0, 0) 100%);\n}\n\n.OT_audio-level-meter.OT_mode-off {\n display: none;\n}\n\n.OT_audio-level-meter.OT_mode-on,\n.OT_audio-only .OT_audio-level-meter.OT_mode-auto {\n display: block;\n}\n\n.OT_audio-only.OT_publisher .OT_video-element,\n.OT_audio-only.OT_subscriber .OT_video-element {\n display: none;\n}\n\n\n.OT_video-disabled-indicator {\n opacity: 1;\n border: none;\n display: none;\n position: absolute;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: bottom right;\n pointer-events: none;\n top: 0;\n left: 0;\n bottom: 3px;\n right: 3px;\n}\n\n.OT_video-disabled {\n background-image: url("+l+");\n background-size: 33px auto;\n}\n\n.OT_video-disabled-warning {\n background-image: url("+p+");\n background-size: 33px auto;\n}\n\n.OT_video-disabled-indicator.OT_active {\n display: block;\n}\n\n.OT_audio-blocked-indicator {\n opacity: 1;\n border: none;\n display: none;\n position: absolute;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n pointer-events: none;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n}\n\n.OT_audio-blocked {\n background-image: url("+f+");\n background-size: 90px auto;\n}\n\n.OT_container-audio-blocked {\n cursor: pointer;\n}\n\n.OT_container-audio-blocked.OT_mini .OT_edge-bar-item {\n display: none;\n}\n\n.OT_container-audio-blocked .OT_mute {\n display: none;\n}\n\n.OT_audio-blocked-indicator.OT_active {\n display: block;\n}\n\n.OT_video-unsupported {\n opacity: 1;\n border: none;\n display: none;\n position: absolute;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url("+h+");\n background-size: 58px auto;\n pointer-events: none;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n margin-top: -30px;\n}\n\n.OT_video-unsupported-bar {\n display: none;\n position: absolute;\n width: 192%; /* copy the size of the audio meter bar for symmetry */\n height: 192%;\n top: -96% /* half of the size */;\n left: -96%;\n border-radius: 50%;\n\n background-color: rgba(0, 0, 0, .8);\n}\n\n.OT_video-unsupported-img {\n display: none;\n position: absolute;\n top: 11%;\n left: 15%;\n width: 70%;\n opacity: .7;\n background-image: url("+h+");\n background-repeat: no-repeat;\n background-position: center;\n background-size: 100% auto;\n}\n\n.OT_video-unsupported-img:before {\n /* makes the height of the container 93% of its width (90/97 px) */\n content: '';\n display: block;\n padding-top: 93%;\n}\n\n.OT_video-unsupported-text {\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n height: 100%;\n margin-top: 40px;\n}\n\n.OT_video-unsupported.OT_active {\n display: block;\n}\n\n.OT_mini .OT_video-unsupported,\n.OT_micro .OT_video-unsupported {\n position: absolute;\n width: 25%;\n max-width: 224px;\n min-width: 21px;\n top: 0;\n left: 0;\n overflow: hidden;\n background: none;\n bottom: auto;\n right: auto;\n margin: auto;\n}\n\n.OT_mini .OT_video-unsupported:before,\n.OT_micro .OT_video-unsupported:before {\n /* makes the height of the container equals its width */\n content: '';\n display: block;\n padding-top: 100%;\n}\n\n.OT_mini .OT_video-unsupported-bar,\n.OT_micro .OT_video-unsupported-bar,\n.OT_mini .OT_video-unsupported-img,\n.OT_micro .OT_video-unsupported-img {\n display: block;\n}\n\n.OT_mini .OT_video-unsupported-text,\n.OT_micro .OT_video-unsupported-text {\n display: none;\n}\n\n.OT_hide-forced {\n display: none;\n}\n\n.OT_ModalDialog {\n position: fixed;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n z-index: 1000;\n background-color: rgba(0, 0, 0, 0.2);\n}\n\n#tb_alert {\n position: fixed;\n width: 570px;\n font-family: \"Lucida Grande\", Arial;\n top: 50%;\n left: 50%;\n margin-top: -75px;\n margin-left: -285px;\n}\n\n#tb_alert * {\n box-sizing: border-box;\n}\n\n#tb_alert .OT_alert {\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n background-color: #333;\n position: relative;\n padding: 30px;\n overflow: visible;\n margin-left: 70px;\n border-bottom-color: rgba(255, 255, 255, 0.1);\n border-left-color: rgba(255, 255, 255, 0.1);\n\n background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 75%, rgba(0, 0, 0, 0.2)), linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 75%, rgba(0, 0, 0, 0.2));\n\n background-image: -ms-linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 75%, rgba(0, 0, 0, 0.2)), -ms-linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.2) 75%, rgba(0, 0, 0, 0.2));\n\n background-size: 4px 4px;\n background-position: 0 0, 2px 2px;\n box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid rgba(255, 255, 255, 0.3);\n}\n\n#tb_alert .OT_alert-exclamation {\n background-color: #9c1408;\n background-image: linear-gradient(0deg, #dd0c0a 0%, #9c1408 100%);\n box-shadow: 0 2px 2px rgba(0, 0, 0, 0.15);\n border: 1px solid rgba(255, 255, 255, 0.3);\n\n margin: -1px 0;\n\n font-family: MS Trebuchet;\n font-weight: bold;\n font-size: 60px;\n text-shadow: -1px -1px 2px rgba(0, 0, 0, 0.5);\n\n color: white;\n width: 65px;\n position: absolute;\n padding: 42px 0;\n text-align: center;\n left: -70px;\n top: 0;\n bottom: 0;\n border-top-left-radius: 5px;\n border-bottom-left-radius: 5px;\n\n border-bottom-color: transparent;\n border-left: none;\n border-right: none;\n}\n\n#tb_alert .OT_alert-exclamation:after,\n#tb_alert .OT_alert-exclamation:before {\n content: \" \";\n position: absolute;\n right: -24px;\n top: 40%;\n border: 12px solid transparent;\n border-left-color: #9c1408;\n}\n\n#tb_alert .OT_alert-exclamation:before {\n border-left-color: #bc3428;\n top: 39%;\n}\n\n#tb_alert .OT_alert-body {\n color: #c8c5c5;\n margin: 0;\n text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);\n font-size: 14px;\n line-height: 1.3em;\n}\n\n#tb_alert .continue-text {\n margin-top: 12px\n}\n\n#tb_alert > * a {\n color: #a7d8df;\n text-decoration: none;\n}\n\n#tb_alert .OT_alert-header {\n font-size: 24px;\n padding-bottom: 5px;\n color: #aaa;\n font-weight: bold;\n position: relative;\n text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);\n margin: 0;\n}\n\n#tb_alert .OT_alert-header::before {\n content: attr(data-text);\n position: absolute;\n left: 0;\n color: white;\n -webkit-mask-image: -webkit-gradient(\n linear,\n left top, left bottom,\n from(rgba(0, 0, 0, 1)),\n color-stop(60%, rgba(0, 0, 0, 0)),\n to(rgba(0, 0, 0, 0))\n );\n}\n\n#tb_alert .OT_alert-close-button {\n position: absolute;\n right: 8px;\n top: 5px;\n background-color: #000;\n color: #666;\n border: none;\n font-size: 20px;\n /** Hack to bring it up to the proper line top */\n line-height: 14px;\n padding: 0;\n padding-bottom: 3px;\n cursor: pointer;\n}\n\n#tb_alert #section-mobile-browser,\n#tb_alert #section-supported-mobile-browser {\n width: 200px;\n top: 0px;\n left: 25%;\n margin-top: 0;\n margin-left: 0;\n}\n\n@media all and (max-height: 300px) {\n #tb_alert {\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n margin-left: 0;\n margin-top: 0;\n }\n #tb_alert #section-mobile-browser,\n #tb_alert #section-supported-mobile-browser {\n margin-left: 0;\n margin-top: 10px;\n left: 0;\n }\n}\n\n#tb_alert #section-normal-install,\n#tb_alert #section-upgrade-install,\n#tb_alert #section-mobile-browser,\n#tb_alert #section-supported-mobile-browser {\n display: none;\n}\n",""])},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=(s=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),o=r.sources.map((function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"}));return[n].concat(o).concat([i]).join("\n")}var s;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];null!=o&&(r[o]=!0)}for(i=0;i<e.length;i++){var s=e[i];null!=s[0]&&r[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),t.push(s))}},t}},function(e,t,n){"use strict";e.exports=function(e,t){return"string"!=typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),/["'() \t\n]/.test(e)||t?'"'+e.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':e)}},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAcCAMAAAC02HQrAAAA1VBMVEUAAAD3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pn3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pn3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj3+Pj39/j3+Pj3+Pn4+Pk/JRMlAAAAQ3RSTlMABAUHCQoLDhAQERwdHiAjLjAxOD9ASFBRVl1mbnZ6fH2LjI+QkaWqrrC1uLzAwcXJycrL1NXj5Ofo6u3w9fr7/P3+d4M3+QAAAQBJREFUGBlVwYdCglAABdCLlr5Unijm3hMUtBzlBLSr//9JgUToOQgVJgceJgU8aHgMeA38K50ZOpcQmTPwcyXn+JM8M3JJIqQypiIkeXelTyIkGZPwKS1NMia1lgKTVka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D0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+PC9nPjwvc3ZnPg=="},function(e,t,n){var r,i,o={},s=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===i&&(i=r.apply(this,arguments)),i}),a=function(e,t){return t?t.querySelector(e):document.querySelector(e)},c=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var r=a.call(this,e,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),u=null,d=0,l=[],p=n(345);function f(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=o[r.id];if(i){i.refs++;for(var s=0;s<i.parts.length;s++)i.parts[s](r.parts[s]);for(;s<r.parts.length;s++)i.parts.push(y(r.parts[s],t))}else{var a=[];for(s=0;s<r.parts.length;s++)a.push(y(r.parts[s],t));o[r.id]={id:r.id,refs:1,parts:a}}}}function h(e,t){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],s=t.base?o[0]+t.base:o[0],a={css:o[1],media:o[2],sourceMap:o[3]};r[s]?r[s].parts.push(a):n.push(r[s]={id:s,parts:[a]})}return n}function m(e,t){var n=c(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=l[l.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),l.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var i=c(e.insertAt.before,n);n.insertBefore(t,i)}}function g(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=l.indexOf(e);t>=0&&l.splice(t,1)}function b(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return v(t,e.attrs),m(e,t),t}function v(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function y(e,t){var n,r,i,o;if(t.transform&&e.css){if(!(o="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=o}if(t.singleton){var s=d++;n=u||(u=b(t)),r=_.bind(null,n,s,!1),i=_.bind(null,n,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),m(e,t),t}(t),r=T.bind(null,n,t),i=function(){g(n),n.href&&URL.revokeObjectURL(n.href)}):(n=b(t),r=w.bind(null,n),i=function(){g(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=s()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return f(n,t),function(e){for(var r=[],i=0;i<n.length;i++){var s=n[i];(a=o[s.id]).refs--,r.push(a)}e&&f(h(e,t),t);for(i=0;i<r.length;i++){var a;if(0===(a=r[i]).refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete o[a.id]}}}};var E,S=(E=[],function(e,t){return E[e]=t,E.filter(Boolean).join("\n")});function _(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=S(t,i);else{var o=document.createTextNode(i),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(o,s[t]):e.appendChild(o)}}function w(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function T(e,t,n){var r=n.css,i=n.sourceMap,o=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||o)&&(r=p(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var s=new Blob([r],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var i,o=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?e:(i=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:r+o.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(80),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(80);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(80);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(80);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(79),i=n(110),o=n(111);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(15),i=n(359),o=n(11),s=n(178),a=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,d=c.toString,l=u.hasOwnProperty,p=RegExp("^"+d.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?p:a).test(s(e))}},function(e,t,n){var r=n(39),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[a]=n:delete e[a]),i}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,i=n(360),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(14)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(363),i=n(79),o=n(110);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(e,t,n){var r=n(364),i=n(365),o=n(366),s=n(367),a=n(368);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=o,c.prototype.has=s,c.prototype.set=a,e.exports=c},function(e,t,n){var r=n(81);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(81),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(81),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},function(e,t,n){var r=n(81);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t,n){var r=n(82);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(82);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(82);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(82);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(29),i=n(16);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(29),i=n(113),o=n(16),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!s[r(e)]}},function(e,t,n){var r=n(182)(Object.keys,Object);e.exports=r},function(e,t,n){var r=n(40),i=n(54);e.exports=function(e,t){return e&&r(t,i(t),e)}},function(e,t,n){var r=n(11),i=n(69),o=n(381),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&n.push(a);return n}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},function(e,t,n){var r=n(40),i=n(116);e.exports=function(e,t){return r(e,i(e),t)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}},function(e,t,n){var r=n(40),i=n(185);e.exports=function(e,t){return r(e,i(e),t)}},function(e,t,n){var r=n(38)(n(14),"DataView");e.exports=r},function(e,t,n){var r=n(38)(n(14),"Promise");e.exports=r},function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},function(e,t,n){var r=n(119),i=n(389),o=n(390),s=n(391),a=n(192);e.exports=function(e,t,n){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(e,n);case"[object Map]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return o(e);case"[object Set]":return new c;case"[object Symbol]":return s(e)}}},function(e,t,n){var r=n(119);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},function(e,t){var n=/\w*$/;e.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}},function(e,t,n){var r=n(39),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},function(e,t,n){var r=n(393),i=n(68),o=n(114),s=o&&o.isMap,a=s?i(s):r;e.exports=a},function(e,t,n){var r=n(41),i=n(16);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},function(e,t,n){var r=n(395),i=n(68),o=n(114),s=o&&o.isSet,a=s?i(s):r;e.exports=a},function(e,t,n){var r=n(41),i=n(16);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},function(e,t,n){(function(r){t.log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(t){var n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.exports.humanize(this.diff),!n)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var i=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))})),t.splice(o,0,r)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.setItem("debug",e)}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},t.useColors=function(){var e=function(e){var n="debug_"+e.toLowerCase();try{return t.storage.getItem(n)}catch(e){return void 0!==r&&"env"in r?r.env[n.toUpperCase()]:void 0}}("colors");if(/^(no|off|false|disabled)$/i.test(e))return!1;if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return Boolean("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(397)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n(43))},function(e,t,n){e.exports=function(e){function t(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return r.colors[Math.abs(n)%r.colors.length]}function r(e){var n;function o(){if(o.enabled){var e=o,t=+new Date,i=t-(n||t);e.diff=i,e.prev=n,e.curr=t,n=t;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=r.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(t,n){if("%%"===t)return t;c++;var i=r.formatters[n];if("function"==typeof i){var o=s[c];t=i.call(e,o),s.splice(c,1),c--}return t})),r.formatArgs.call(e,s);var u=e.log||r.log;u.apply(e,s)}}return o.namespace=e,o.enabled=r.enabled(e),o.useColors=r.useColors(),o.color=t(e),o.destroy=i,"function"==typeof r.init&&r.init(o),r.instances.push(o),o}function i(){var e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}return r.debug=r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){r.enable("")},r.enable=function(e){var t;r.save(e),r.names=[],r.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length;for(t=0;t<i;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")));for(t=0;t<r.instances.length;t++){var o=r.instances[t];o.enabled=r.enabled(o.namespace)}},r.enabled=function(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=n(398),Object.keys(e).forEach((function(t){r[t]=e[t]})),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=t,r.enable(r.load()),r}},function(e,t){var n=1e3,r=6e4,i=60*r,o=24*i;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,t){t=t||{};var a=typeof e;if("string"===a&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return 6048e5*s;case"days":case"day":case"d":return s*o;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*r;case"seconds":case"second":case"secs":case"sec":case"s":return s*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===a&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return s(e,t,o,"day");if(t>=i)return s(e,t,i,"hour");if(t>=r)return s(e,t,r,"minute");if(t>=n)return s(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=i)return Math.round(e/i)+"h";if(t>=r)return Math.round(e/r)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,n){var r=n(400),i=n(179),o=n(88),s=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=s},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t,n){"use strict";const r=n(198),i=new r;e.exports=function(e,t){if(void 0===t)return e;i.has(t)||i.set(t,new r);const n=i.get(t);return n.has(e)||n.set(e,e.bind(t)),n.get(e)}},function(e,t,n){"use strict";e.exports=function(){var e,t;if("function"!=typeof WeakMap)return!1;try{e=new WeakMap([[t={},"one"],[{},"two"],[{},"three"]])}catch(e){return!1}return"[object WeakMap]"===String(e)&&("function"==typeof e.set&&(e.set({},1)===e&&("function"==typeof e.delete&&("function"==typeof e.has&&"one"===e.get(t)))))}},function(e,t,n){"use strict";var r,i=n(44),o=n(124),s=n(406),a=n(31),c=n(407),u=n(32),d=n(205),l=n(449),p=n(45).toStringTag,f=n(450),h=Array.isArray,m=Object.defineProperty,g=Object.prototype.hasOwnProperty,b=Object.getPrototypeOf;e.exports=r=function(){var e,t=arguments[0];if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");return e=f&&o&&WeakMap!==r?o(new WeakMap,b(this)):this,i(t)&&(h(t)||(t=d(t))),m(e,"__weakMapData__",u("c","$weakMap$"+c())),t?(l(t,(function(t){a(t),e.set(t[0],t[1])})),e):e},f&&(o&&o(r,WeakMap),r.prototype=Object.create(WeakMap.prototype,{constructor:u(r)})),Object.defineProperties(r.prototype,{delete:u((function(e){return!!g.call(s(e),this.__weakMapData__)&&(delete e[this.__weakMapData__],!0)})),get:u((function(e){if(g.call(s(e),this.__weakMapData__))return e[this.__weakMapData__]})),has:u((function(e){return g.call(s(e),this.__weakMapData__)})),set:u((function(e,t){return m(s(e),this.__weakMapData__,u("c",t)),this})),toString:u((function(){return"[object WeakMap]"}))}),m(r.prototype,p,u("c","WeakMap"))},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var r,i,o,s,a=Object.create;n(199)()||(r=n(200)),e.exports=r?1!==r.level?a:(i={},o={},s={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(e){o[e]="__proto__"!==e?s:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(i,o),Object.defineProperty(r,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:i}),function(e,t){return a(null===e?i:e,t)}):a},function(e,t,n){"use strict";var r=n(201);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not an Object");return e}},function(e,t,n){"use strict";var r=Object.create(null),i=Math.random;e.exports=function(){var e;do{e=i().toString(36).slice(2)}while(r[e]);return e}},function(e,t,n){"use strict";var r=n(409);e.exports=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!r(e)}},function(e,t,n){"use strict";var r=n(125);e.exports=function(e){if(!r(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var r=n(412),i=n(31),o=Math.max;e.exports=function(e,t){var n,s,a,c=o(arguments.length,2);for(e=Object(i(e)),a=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},s=1;s<c;++s)r(t=arguments[s]).forEach(a);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(413)()?Object.keys:n(414)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var r=n(44),i=Object.keys;e.exports=function(e){return i(r(e)?Object(e):e)}},function(e,t,n){"use strict";var r="razdwatrzy";e.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(e,t,n){"use strict";var r=String.prototype.indexOf;e.exports=function(e){return r.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";var r,i=n(124),o=n(204),s=n(32),a=n(45),c=n(207),u=Object.defineProperty;r=e.exports=function(e,t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");c.call(this,e),t=t?o.call(t,"key+value")?"key+value":o.call(t,"key")?"key":"value":"value",u(this,"__kind__",s("",t))},i&&i(r,c),delete r.prototype.constructor,r.prototype=Object.create(c.prototype,{_resolve:s((function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e}))}),u(r.prototype,a.toStringTag,s("c","Array Iterator"))},function(e,t,n){"use strict";var r=n(91),i={object:!0,symbol:!0};e.exports=function(){var e,t=r.Symbol;if("function"!=typeof t)return!1;e=t("test symbol");try{String(e)}catch(e){return!1}return!!i[typeof t.iterator]&&(!!i[typeof t.toPrimitive]&&!!i[typeof t.toStringTag])}},function(e,t,n){"use strict";e.exports=function(){return"object"==typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},function(e,t){var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},function(e,t,n){"use strict";var r,i,o,s=n(32),a=n(206),c=n(91).Symbol,u=n(423),d=n(424),l=n(425),p=Object.create,f=Object.defineProperties,h=Object.defineProperty;if("function"==typeof c)try{String(c()),o=!0}catch(e){}else c=null;i=function(e){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return r(e)},e.exports=r=function e(t){var n;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return o?c(t):(n=p(i.prototype),t=void 0===t?"":String(t),f(n,{__description__:s("",t),__name__:s("",u(t))}))},d(r),l(r),f(i.prototype,{constructor:s(r),toString:s("",(function(){return this.__name__}))}),f(r.prototype,{toString:s((function(){return"Symbol ("+a(this).__description__+")"})),valueOf:s((function(){return a(this)}))}),h(r.prototype,r.toPrimitive,s("",(function(){var e=a(this);return"symbol"==typeof e?e:e.toString()}))),h(r.prototype,r.toStringTag,s("c","Symbol")),h(i.prototype,r.toStringTag,s("c",r.prototype[r.toStringTag])),h(i.prototype,r.toPrimitive,s("c",r.prototype[r.toPrimitive]))},function(e,t,n){"use strict";e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},function(e,t,n){"use strict";var r=n(32),i=Object.create,o=Object.defineProperty,s=Object.prototype,a=i(null);e.exports=function(e){for(var t,n,i=0;a[e+(i||"")];)++i;return a[e+=i||""]=!0,o(s,t="@@"+e,r.gs(null,(function(e){n||(n=!0,o(this,t,r(e)),n=!1)}))),t}},function(e,t,n){"use strict";var r=n(32),i=n(91).Symbol;e.exports=function(e){return Object.defineProperties(e,{hasInstance:r("",i&&i.hasInstance||e("hasInstance")),isConcatSpreadable:r("",i&&i.isConcatSpreadable||e("isConcatSpreadable")),iterator:r("",i&&i.iterator||e("iterator")),match:r("",i&&i.match||e("match")),replace:r("",i&&i.replace||e("replace")),search:r("",i&&i.search||e("search")),species:r("",i&&i.species||e("species")),split:r("",i&&i.split||e("split")),toPrimitive:r("",i&&i.toPrimitive||e("toPrimitive")),toStringTag:r("",i&&i.toStringTag||e("toStringTag")),unscopables:r("",i&&i.unscopables||e("unscopables"))})}},function(e,t,n){"use strict";var r=n(32),i=n(206),o=Object.create(null);e.exports=function(e){return Object.defineProperties(e,{for:r((function(t){return o[t]?o[t]:o[t]=e(String(t))})),keyFor:r((function(e){var t;for(t in i(e),o)if(o[t]===e)return t}))})}},function(e,t,n){"use strict";var r=n(31);e.exports=function(){return r(this).length=0,this}},function(e,t,n){"use strict";var r,i=n(56),o=n(428),s=n(432),a=n(433),c=n(203),u=n(443),d=Function.prototype.bind,l=Object.defineProperty,p=Object.prototype.hasOwnProperty;r=function(e,t,n){var r,i=o(t)&&s(t.value);return delete(r=a(t)).writable,delete r.value,r.get=function(){return!n.overwriteDefinition&&p.call(this,e)?i:(t.value=d.call(i,n.resolveContext?n.resolveContext(this):this),l(this,e,t),this[e])},r},e.exports=function(e){var t=c(arguments[1]);return i(t.resolveContext)&&s(t.resolveContext),u(e,(function(e,n){return r(n,e,t)}))}},function(e,t,n){"use strict";var r=n(208),i=n(56);e.exports=function(e){return i(e)?e:r(e,"Cannot use %v",arguments[1])}},function(e,t,n){"use strict";var r=n(56),i=n(125),o=Object.prototype.toString;e.exports=function(e){if(!r(e))return null;if(i(e)){var t=e.toString;if("function"!=typeof t)return null;if(t===o)return null}try{return""+e}catch(e){return null}}},function(e,t,n){"use strict";var r=n(431),i=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=r(e);return null===t?"<Non-coercible to string value>":(t.length>100&&(t=t.slice(0,99)+"…"),t=t.replace(i,(function(e){switch(e){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},function(e,t,n){"use strict";e.exports=function(e){try{return e.toString()}catch(t){try{return String(e)}catch(e){return null}}}},function(e,t,n){"use strict";var r=n(208),i=n(202);e.exports=function(e){return i(e)?e:r(e,"%v is not a plain function",arguments[1])}},function(e,t,n){"use strict";var r=n(434),i=n(126),o=n(31);e.exports=function(e){var t=Object(o(e)),n=arguments[1],s=Object(arguments[2]);if(t!==e&&!n)return t;var a={};return n?r(n,(function(t){(s.ensure||t in e)&&(a[t]=e[t])})):i(a,e),a}},function(e,t,n){"use strict";e.exports=n(435)()?Array.from:n(436)},function(e,t,n){"use strict";e.exports=function(){var e,t,n=Array.from;return"function"==typeof n&&(t=n(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}},function(e,t,n){"use strict";var r=n(45).iterator,i=n(89),o=n(437),s=n(438),a=n(70),c=n(31),u=n(44),d=n(90),l=Array.isArray,p=Function.prototype.call,f={configurable:!0,enumerable:!0,writable:!0,value:null},h=Object.defineProperty;e.exports=function(e){var t,n,m,g,b,v,y,E,S,_,w=arguments[1],T=arguments[2];if(e=Object(c(e)),u(w)&&a(w),this&&this!==Array&&o(this))t=this;else{if(!w){if(i(e))return 1!==(b=e.length)?Array.apply(null,e):((g=new Array(1))[0]=e[0],g);if(l(e)){for(g=new Array(b=e.length),n=0;n<b;++n)g[n]=e[n];return g}}g=[]}if(!l(e))if(void 0!==(S=e[r])){for(y=a(S).call(e),t&&(g=new t),E=y.next(),n=0;!E.done;)_=w?p.call(w,T,E.value,n):E.value,t?(f.value=_,h(g,n,f)):g[n]=_,E=y.next(),++n;b=n}else if(d(e)){for(b=e.length,t&&(g=new t),n=0,m=0;n<b;++n)_=e[n],n+1<b&&(v=_.charCodeAt(0))>=55296&&v<=56319&&(_+=e[++n]),_=w?p.call(w,T,_,m):_,t?(f.value=_,h(g,m,f)):g[m]=_,++m;b=m}if(void 0===b)for(b=s(e.length),t&&(g=new t(b)),n=0;n<b;++n)_=w?p.call(w,T,e[n],n):e[n],t?(f.value=_,h(g,n,f)):g[n]=_;return t&&(f.value=null,g.length=b),g}},function(e,t,n){"use strict";var r=Object.prototype.toString,i=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(e){return"function"==typeof e&&i(r.call(e))}},function(e,t,n){"use strict";var r=n(439),i=Math.max;e.exports=function(e){return i(0,r(e))}},function(e,t,n){"use strict";var r=n(440),i=Math.abs,o=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?r(e)*o(i(e)):e}},function(e,t,n){"use strict";e.exports=n(441)()?Math.sign:n(442)},function(e,t,n){"use strict";e.exports=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}},function(e,t,n){"use strict";e.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},function(e,t,n){"use strict";var r=n(70),i=n(444),o=Function.prototype.call;e.exports=function(e,t){var n={},s=arguments[2];return r(t),i(e,(function(e,r,i,a){n[r]=o.call(t,s,e,r,i,a)})),n}},function(e,t,n){"use strict";e.exports=n(445)("forEach")},function(e,t,n){"use strict";var r=n(70),i=n(31),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,c=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(n,u){var d,l=arguments[2],p=arguments[3];return n=Object(i(n)),r(u),d=a(n),p&&d.sort("function"==typeof p?o.call(p,n):void 0),"function"!=typeof e&&(e=d[e]),s.call(e,d,(function(e,r){return c.call(n,e)?s.call(u,l,n[e],e,n,r):t}))}}},function(e,t,n){"use strict";var r,i=n(124),o=n(32),s=n(45),a=n(207),c=Object.defineProperty;r=e.exports=function(e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e=String(e),a.call(this,e),c(this,"__length__",o("",e.length))},i&&i(r,a),delete r.prototype.constructor,r.prototype=Object.create(a.prototype,{_next:o((function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()})),_resolve:o((function(e){var t,n=this.__list__[e];return this.__nextIndex__===this.__length__?n:(t=n.charCodeAt(0))>=55296&&t<=56319?n+this.__list__[this.__nextIndex__++]:n}))}),c(r.prototype,s.toStringTag,o("c","String Iterator"))},function(e,t,n){"use strict";var r=n(448);e.exports=function(e){if(!r(e))throw new TypeError(e+" is not iterable");return e}},function(e,t,n){"use strict";var r=n(89),i=n(44),o=n(90),s=n(45).iterator,a=Array.isArray;e.exports=function(e){return!!i(e)&&(!!a(e)||(!!o(e)||(!!r(e)||"function"==typeof e[s])))}},function(e,t,n){"use strict";var r=n(89),i=n(70),o=n(90),s=n(205),a=Array.isArray,c=Function.prototype.call,u=Array.prototype.some;e.exports=function(e,t){var n,d,l,p,f,h,m,g,b=arguments[2];if(a(e)||r(e)?n="array":o(e)?n="string":e=s(e),i(t),l=function(){p=!0},"array"!==n)if("string"!==n)for(d=e.next();!d.done;){if(c.call(t,b,d.value,l),p)return;d=e.next()}else for(h=e.length,f=0;f<h&&(m=e[f],f+1<h&&(g=m.charCodeAt(0))>=55296&&g<=56319&&(m+=e[++f]),c.call(t,b,m,l),!p);++f);else u.call(e,(function(e){return c.call(t,b,e,l),p}))}},function(e,t,n){"use strict";e.exports="function"==typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)},function(e,t,n){var r=n(92),i=n(93),o=n(129),s=n(33),a=n(68),c=n(94),u=Math.min;e.exports=function(e,t,n){for(var d=n?o:i,l=e[0].length,p=e.length,f=p,h=Array(p),m=1/0,g=[];f--;){var b=e[f];f&&t&&(b=s(b,a(t))),m=u(b.length,m),h[f]=!n&&(t||l>=120&&b.length>=120)?new r(f&&b):void 0}b=e[0];var v=-1,y=h[0];e:for(;++v<l&&g.length<m;){var E=b[v],S=t?t(E):E;if(E=n||0!==E?E:0,!(y?c(y,S):d(g,S,n))){for(f=p;--f;){var _=h[f];if(!(_?c(_,S):d(e[f],S,n)))continue e}y&&y.push(S),g.push(E)}}return g}},function(e,t){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(209),i=n(455),o=n(456);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},function(e,t){e.exports=function(e){return e!=e}},function(e,t){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},function(e,t,n){var r=n(130);e.exports=function(e){return r(e)?e:[]}},function(e,t,n){"use strict";(function(t){var r=n(17),i=n(211),o=n(459),s=n(217);function a(e){var t=new o(e),n=i(o.prototype.request,t);return r.extend(n,o.prototype,t),r.extend(n,t),n}var c=a(n(214));c.Axios=o,c.create=function(e){return a(s(c.defaults,e))},c.Cancel=n(218),c.CancelToken=n(472),c.isCancel=n(213),c.all=function(e){return t.all(e)},c.spread=n(473),c.isAxiosError=n(474),e.exports=c,e.exports.default=c}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(17),i=n(212),o=n(460),s=n(461),a=n(217);function c(e){this.defaults=e,this.interceptors={request:new o,response:new o}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=[s,void 0],r=t.resolve(e);for(this.interceptors.request.forEach((function(e){n.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){n.push(e.fulfilled,e.rejected)}));n.length;)r=r.then(n.shift(),n.shift());return r},c.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,n,r){return this.request(a(r||{},{method:e,url:t,data:n}))}})),e.exports=c}).call(this,n(0))},function(e,t,n){"use strict";var r=n(17);function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},function(e,t,n){"use strict";(function(t){var r=n(17),i=n(462),o=n(213),s=n(214);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=i(t.data,t.headers,e.transformResponse),t}),(function(n){return o(n)||(a(e),n&&n.response&&(n.response.data=i(n.response.data,n.response.headers,e.transformResponse))),t.reject(n)}))}}).call(this,n(0))},function(e,t,n){"use strict";var r=n(17);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},function(e,t,n){"use strict";var r=n(17);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},function(e,t,n){"use strict";var r=n(216);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(17);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var r=n(468),i=n(469);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(17),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,o,s={};return e?(r.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},function(e,t,n){"use strict";var r=n(17);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";(function(t){var r=n(218);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var n;this.promise=new t((function(e){n=e}));var i=this;e((function(e){i.reason||(i.reason=new r(e),n(i.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i}).call(this,n(0))},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t,n){var r=n(219)("pick",n(48));r.placeholder=n(131),e.exports=r},function(e,t,n){var r=n(477),i=n(131),o=Array.prototype.push;function s(e,t){return 2==t?function(t,n){return e(t,n)}:function(t){return e(t)}}function a(e){for(var t=e?e.length:0,n=Array(t);t--;)n[t]=e[t];return n}function c(e,t){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var i=r[0]=t.apply(void 0,r);return e.apply(void 0,r),i}}}e.exports=function e(t,n,u,d){var l="function"==typeof n,p=n===Object(n);if(p&&(d=u,u=n,n=void 0),null==u)throw new TypeError;d||(d={});var f=!("cap"in d)||d.cap,h=!("curry"in d)||d.curry,m=!("fixed"in d)||d.fixed,g=!("immutable"in d)||d.immutable,b=!("rearg"in d)||d.rearg,v=l?u:i,y="curry"in d&&d.curry,E="fixed"in d&&d.fixed,S="rearg"in d&&d.rearg,_=l?u.runInContext():void 0,w=l?u:{ary:t.ary,assign:t.assign,clone:t.clone,curry:t.curry,forEach:t.forEach,isArray:t.isArray,isError:t.isError,isFunction:t.isFunction,isWeakMap:t.isWeakMap,iteratee:t.iteratee,keys:t.keys,rearg:t.rearg,toInteger:t.toInteger,toPath:t.toPath},T=w.ary,C=w.assign,I=w.clone,R=w.curry,x=w.forEach,O=w.isArray,k=w.isError,N=w.isFunction,Z=w.isWeakMap,A=w.keys,L=w.rearg,V=w.toInteger,P=w.toPath,M=A(r.aryMethod),D={castArray:function(e){return function(){var t=arguments[0];return O(t)?e(a(t)):e.apply(void 0,arguments)}},iteratee:function(e){return function(){var t=arguments[0],n=arguments[1],r=e(t,n),i=r.length;return f&&"number"==typeof n?(n=n>2?n-2:1,i&&i<=n?r:s(r,n)):r}},mixin:function(e){return function(t){var n=this;if(!N(n))return e(n,Object(t));var r=[];return x(A(t),(function(e){N(t[e])&&r.push([e,n.prototype[e]])})),e(n,Object(t)),x(r,(function(e){var t=e[1];N(t)?n.prototype[e[0]]=t:delete n.prototype[e[0]]})),n}},nthArg:function(e){return function(t){var n=t<0?1:V(t)+1;return R(e(t),n)}},rearg:function(e){return function(t,n){var r=n?n.length:0;return R(e(t,n),r)}},runInContext:function(n){return function(r){return e(t,n(r),d)}}};function W(e,t){if(f){var n=r.iterateeRearg[e];if(n)return function(e,t){return F(e,(function(e){var n=t.length;return function(e,t){return 2==t?function(t,n){return e.apply(void 0,arguments)}:function(t){return e.apply(void 0,arguments)}}(L(s(e,n),t),n)}))}(t,n);var i=!l&&r.iterateeAry[e];if(i)return function(e,t){return F(e,(function(e){return"function"==typeof e?s(e,t):e}))}(t,i)}return t}function G(e,t,n){if(m&&(E||!r.skipFixed[e])){var i=r.methodSpread[e],s=i&&i.start;return void 0===s?T(t,n):function(e,t){return function(){for(var n=arguments.length,r=n-1,i=Array(n);n--;)i[n]=arguments[n];var s=i[t],a=i.slice(0,t);return s&&o.apply(a,s),t!=r&&o.apply(a,i.slice(t+1)),e.apply(this,a)}}(t,s)}return t}function X(e,t,n){return b&&n>1&&(S||!r.skipRearg[e])?L(t,r.methodRearg[e]||r.aryRearg[n]):t}function j(e,t){for(var n=-1,r=(t=P(t)).length,i=r-1,o=I(Object(e)),s=o;null!=s&&++n<r;){var a=t[n],c=s[a];null==c||N(c)||k(c)||Z(c)||(s[a]=I(n==i?c:Object(c))),s=s[a]}return o}function U(t,n){var i=r.aliasToReal[t]||t,o=r.remap[i]||i,s=d;return function(t){var r=l?_:w,a=l?_[o]:n,c=C(C({},s),t);return e(r,i,a,c)}}function F(e,t){return function(){var n=arguments.length;if(!n)return e();for(var r=Array(n);n--;)r[n]=arguments[n];var i=b?0:n-1;return r[i]=t(r[i]),e.apply(void 0,r)}}function Y(e,t,n){var i,o=r.aliasToReal[e]||e,s=t,u=D[o];return u?s=u(t):g&&(r.mutate.array[o]?s=c(t,a):r.mutate.object[o]?s=c(t,function(e){return function(t){return e({},t)}}(t)):r.mutate.set[o]&&(s=c(t,j))),x(M,(function(e){return x(r.aryMethod[e],(function(t){if(o==t){var n=r.methodSpread[o],a=n&&n.afterRearg;return i=a?G(o,X(o,s,e),e):X(o,G(o,s,e),e),i=function(e,t,n){return y||h&&n>1?R(t,n):t}(0,i=W(o,i),e),!1}})),!i})),i||(i=s),i==t&&(i=y?R(i,1):function(){return t.apply(this,arguments)}),i.convert=U(o,t),i.placeholder=t.placeholder=n,i}if(!p)return Y(n,u,v);var B=u,K=[];return x(M,(function(e){x(r.aryMethod[e],(function(e){var t=B[r.remap[e]||e];t&&K.push([e,Y(e,t,B)])}))})),x(A(B),(function(e){var t=B[e];if("function"==typeof t){for(var n=K.length;n--;)if(K[n][0]==e)return;t.convert=U(e,t),K.push([e,t])}})),x(K,(function(e){B[e[0]]=e[1]})),B.convert=function(e){return B.runInContext.convert(e)(void 0)},B.placeholder=B,x(A(B),(function(e){x(r.realToAlias[e]||[],(function(t){B[t]=B[e]}))})),B}},function(e,t){t.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},t.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},t.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},t.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},t.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},t.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},t.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},t.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},t.realToAlias=function(){var e=Object.prototype.hasOwnProperty,n=t.aliasToReal,r={};for(var i in n){var o=n[i];e.call(r,o)?r[o].push(i):r[o]=[i]}return r}(),t.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},t.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},t.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}},function(e,t,n){e.exports={ary:n(479),assign:n(180),clone:n(37),curry:n(497),forEach:n(112),isArray:n(12),isError:n(498),isFunction:n(15),isWeakMap:n(499),iteratee:n(500),keys:n(115),rearg:n(515),toInteger:n(96),toPath:n(518)}},function(e,t,n){var r=n(132);e.exports=function(e,t,n){return t=n?void 0:t,t=e&&null==t?e.length:t,r(e,128,void 0,void 0,void 0,void 0,t)}},function(e,t,n){var r=n(95),i=n(14);e.exports=function(e,t,n){var o=1&t,s=r(e);return function t(){var r=this&&this!==i&&this instanceof t?s:e;return r.apply(o?n:this,arguments)}}},function(e,t,n){var r=n(121),i=n(95),o=n(222),s=n(225),a=n(231),c=n(135),u=n(14);e.exports=function(e,t,n){var d=i(e);return function i(){for(var l=arguments.length,p=Array(l),f=l,h=a(i);f--;)p[f]=arguments[f];var m=l<3&&p[0]!==h&&p[l-1]!==h?[]:c(p,h);if((l-=m.length)<n)return s(e,t,o,i.placeholder,void 0,p,m,void 0,void 0,n-l);var g=this&&this!==u&&this instanceof i?d:e;return r(g,this,p)}}},function(e,t){e.exports=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}},function(e,t,n){var r=n(133),i=n(226),o=n(484),s=n(486);e.exports=function(e){var t=o(e),n=s[t];if("function"!=typeof n||!(t in r.prototype))return!1;if(e===n)return!0;var a=i(n);return!!a&&e===a[0]}},function(e,t,n){var r=n(485),i=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",n=r[t],o=i.call(r,t)?n.length:0;o--;){var s=n[o],a=s.func;if(null==a||a==e)return s.name}return t}},function(e,t){e.exports={}},function(e,t,n){var r=n(133),i=n(228),o=n(134),s=n(12),a=n(16),c=n(487),u=Object.prototype.hasOwnProperty;function d(e){if(a(e)&&!s(e)&&!(e instanceof r)){if(e instanceof i)return e;if(u.call(e,"__wrapped__"))return c(e)}return new i(e)}d.prototype=o.prototype,d.prototype.constructor=d,e.exports=d},function(e,t,n){var r=n(133),i=n(228),o=n(55);e.exports=function(e){if(e instanceof r)return e.clone();var t=new i(e.__wrapped__,e.__chain__);return t.__actions__=o(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},function(e,t){var n=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var t=e.match(n);return t?t[1].split(r):[]}},function(e,t){var n=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,t){var r=t.length;if(!r)return e;var i=r-1;return t[i]=(r>1?"& ":"")+t[i],t=t.join(r>2?", ":" "),e.replace(n,"{\n/* [wrapped with "+t+"] */\n")}},function(e,t,n){var r=n(112),i=n(93),o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return r(o,(function(n){var r="_."+n[0];t&n[1]&&!i(e,r)&&e.push(r)})),e.sort()}},function(e,t,n){var r=n(55),i=n(67),o=Math.min;e.exports=function(e,t){for(var n=e.length,s=o(t.length,n),a=r(e);s--;){var c=t[s];e[s]=i(c,n)?a[c]:void 0}return e}},function(e,t,n){var r=n(121),i=n(95),o=n(14);e.exports=function(e,t,n,s){var a=1&t,c=i(e);return function t(){for(var i=-1,u=arguments.length,d=-1,l=s.length,p=Array(l+u),f=this&&this!==o&&this instanceof t?c:e;++d<l;)p[d]=s[d];for(;u--;)p[d++]=arguments[++i];return r(f,a?n:this,p)}}},function(e,t,n){var r=n(223),i=n(224),o=n(135),s=Math.min;e.exports=function(e,t){var n=e[1],a=t[1],c=n|a,u=c<131,d=128==a&&8==n||128==a&&256==n&&e[7].length<=t[8]||384==a&&t[7].length<=t[8]&&8==n;if(!u&&!d)return e;1&a&&(e[2]=t[2],c|=1&n?0:4);var l=t[3];if(l){var p=e[3];e[3]=p?r(p,l,t[4]):l,e[4]=p?o(e[3],"__lodash_placeholder__"):t[4]}return(l=t[5])&&(p=e[5],e[5]=p?i(p,l,t[6]):l,e[6]=p?o(e[5],"__lodash_placeholder__"):t[6]),(l=t[7])&&(e[7]=l),128&a&&(e[8]=null==e[8]?t[8]:s(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}},function(e,t,n){var r=n(232);e.exports=function(e){return e?(e=r(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},function(e,t,n){var r=n(496),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},function(e,t){var n=/\s/;e.exports=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}},function(e,t,n){var r=n(132);function i(e,t,n){var o=r(e,8,void 0,void 0,void 0,void 0,void 0,t=n?void 0:t);return o.placeholder=i.placeholder,o}i.placeholder={},e.exports=i},function(e,t,n){var r=n(29),i=n(16),o=n(136);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!o(e)}},function(e,t,n){var r=n(41),i=n(16);e.exports=function(e){return i(e)&&"[object WeakMap]"==r(e)}},function(e,t,n){var r=n(77),i=n(35);e.exports=function(e){return i("function"==typeof e?e:r(e,1))}},function(e,t,n){var r=n(502),i=n(506),o=n(238);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(78),i=n(233);e.exports=function(e,t,n,o){var s=n.length,a=s,c=!o;if(null==e)return!a;for(e=Object(e);s--;){var u=n[s];if(c&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++s<a;){var d=(u=n[s])[0],l=e[d],p=u[1];if(c&&u[2]){if(void 0===l&&!(d in e))return!1}else{var f=new r;if(o)var h=o(l,p,d,e,t,f);if(!(void 0===h?i(p,l,3,o,f):h))return!1}}return!0}},function(e,t,n){var r=n(78),i=n(234),o=n(504),s=n(505),a=n(41),c=n(12),u=n(66),d=n(85),l="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,f,h,m){var g=c(e),b=c(t),v=g?"[object Array]":a(e),y=b?"[object Array]":a(t),E=(v="[object Arguments]"==v?l:v)==l,S=(y="[object Arguments]"==y?l:y)==l,_=v==y;if(_&&u(e)){if(!u(t))return!1;g=!0,E=!1}if(_&&!E)return m||(m=new r),g||d(e)?i(e,t,n,f,h,m):o(e,t,v,n,f,h,m);if(!(1&n)){var w=E&&p.call(e,"__wrapped__"),T=S&&p.call(t,"__wrapped__");if(w||T){var C=w?e.value():e,I=T?t.value():t;return m||(m=new r),h(C,I,n,f,m)}}return!!_&&(m||(m=new r),s(e,t,n,f,h,m))}},function(e,t,n){var r=n(39),i=n(191),o=n(53),s=n(234),a=n(236),c=n(97),u=r?r.prototype:void 0,d=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,l,p){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!l(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=a;case"[object Set]":var h=1&r;if(f||(f=c),e.size!=t.size&&!h)return!1;var m=p.get(e);if(m)return m==t;r|=2,p.set(e,t);var g=s(f(e),f(t),r,u,l,p);return p.delete(e),g;case"[object Symbol]":if(d)return d.call(e)==d.call(t)}return!1}},function(e,t,n){var r=n(186),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,s,a){var c=1&n,u=r(e),d=u.length;if(d!=r(t).length&&!c)return!1;for(var l=d;l--;){var p=u[l];if(!(c?p in t:i.call(t,p)))return!1}var f=a.get(e),h=a.get(t);if(f&&h)return f==t&&h==e;var m=!0;a.set(e,t),a.set(t,e);for(var g=c;++l<d;){var b=e[p=u[l]],v=t[p];if(o)var y=c?o(v,b,p,t,e,a):o(b,v,p,e,t,a);if(!(void 0===y?b===v||s(b,v,n,o,a):y)){m=!1;break}g||(g="constructor"==p)}if(m&&!g){var E=e.constructor,S=t.constructor;E==S||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof S&&S instanceof S||(m=!1)}return a.delete(e),a.delete(t),m}},function(e,t,n){var r=n(237),i=n(30);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],s=e[o];t[n]=[o,s,r(s)]}return t}},function(e,t,n){var r=n(233),i=n(58),o=n(240),s=n(137),a=n(237),c=n(238),u=n(47);e.exports=function(e,t){return s(e)&&a(t)?c(u(e),t):function(n){var s=i(n,e);return void 0===s&&s===t?o(n,e):r(t,s,3)}}},function(e,t,n){var r=n(194);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},function(e,t,n){var r=n(39),i=n(33),o=n(12),s=n(71),a=r?r.prototype:void 0,c=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(s(t))return c?c.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(59),i=n(65),o=n(12),s=n(67),a=n(113),c=n(47);e.exports=function(e,t,n){for(var u=-1,d=(t=r(t,e)).length,l=!1;++u<d;){var p=c(t[u]);if(!(l=null!=e&&n(e,p)))break;e=e[p]}return l||++u!=d?l:!!(d=null==e?0:e.length)&&a(d)&&s(p,d)&&(o(e)||i(e))}},function(e,t,n){var r=n(513),i=n(514),o=n(137),s=n(47);e.exports=function(e){return o(e)?r(s(e)):i(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(98);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(132),i=n(138),o=i((function(e,t){return r(e,256,void 0,void 0,void 0,t)}));e.exports=o},function(e,t,n){var r=n(241);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},function(e,t,n){var r=n(39),i=n(65),o=n(12),s=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(s&&e&&e[s])}},function(e,t,n){var r=n(33),i=n(55),o=n(12),s=n(71),a=n(239),c=n(47),u=n(60);e.exports=function(e){return o(e)?r(e,c):s(e)?[e]:i(a(u(e)))}},function(e,t,n){var r=n(520),i=n(240);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},function(e,t,n){var r=n(98),i=n(521),o=n(59);e.exports=function(e,t,n){for(var s=-1,a=t.length,c={};++s<a;){var u=t[s],d=r(e,u);n(d,u)&&i(c,o(u,e),d)}return c}},function(e,t,n){var r=n(83),i=n(59),o=n(67),s=n(11),a=n(47);e.exports=function(e,t,n,c){if(!s(e))return e;for(var u=-1,d=(t=i(t,e)).length,l=d-1,p=e;null!=p&&++u<d;){var f=a(t[u]),h=n;if("__proto__"===f||"constructor"===f||"prototype"===f)return e;if(u!=l){var m=p[f];void 0===(h=c?c(m,f,p):void 0)&&(h=s(m)?m:o(t[u+1])?[]:{})}r(p,f,h),p=p[f]}return e}},function(e,t,n){var r=n(219)("mapKeys",n(523));r.placeholder=n(131),e.exports=r},function(e,t,n){var r=n(64),i=n(99),o=n(35);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,t(e,i,o),e)})),n}},function(e,t){e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var c=s[e?a:++i];if(!1===n(o[c],c,o))break}return t}}},function(e,t,n){(function(e){var r;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(i){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof(void 0!==typeof window?window:global)&&(void 0!==typeof window?window:global);o.global!==o&&o.window!==o&&o.self;var s,a=2147483647,c=/^xn--/,u=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,f=String.fromCharCode;function h(e){throw new RangeError(l[e])}function m(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function g(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+m((e=e.replace(d,".")).split("."),t).join(".")}function b(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function v(e){return m(e,(function(e){var t="";return e>65535&&(t+=f((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=f(e)})).join("")}function y(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function E(e,t,n){var r=0;for(e=n?p(e/700):e>>1,e+=p(e/t);e>455;r+=36)e=p(e/35);return p(r+36*e/(e+38))}function S(e){var t,n,r,i,o,s,c,u,d,l,f,m=[],g=e.length,b=0,y=128,S=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&h("not-basic"),m.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<g;){for(o=b,s=1,c=36;i>=g&&h("invalid-input"),((u=(f=e.charCodeAt(i++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||u>p((a-b)/s))&&h("overflow"),b+=u*s,!(u<(d=c<=S?1:c>=S+26?26:c-S));c+=36)s>p(a/(l=36-d))&&h("overflow"),s*=l;S=E(b-o,t=m.length+1,0==o),p(b/t)>a-y&&h("overflow"),y+=p(b/t),b%=t,m.splice(b++,0,y)}return v(m)}function _(e){var t,n,r,i,o,s,c,u,d,l,m,g,v,S,_,w=[];for(g=(e=b(e)).length,t=128,n=0,o=72,s=0;s<g;++s)(m=e[s])<128&&w.push(f(m));for(r=i=w.length,i&&w.push("-");r<g;){for(c=a,s=0;s<g;++s)(m=e[s])>=t&&m<c&&(c=m);for(c-t>p((a-n)/(v=r+1))&&h("overflow"),n+=(c-t)*v,t=c,s=0;s<g;++s)if((m=e[s])<t&&++n>a&&h("overflow"),m==t){for(u=n,d=36;!(u<(l=d<=o?1:d>=o+26?26:d-o));d+=36)_=u-l,S=36-l,w.push(f(y(l+_%S,0))),u=p(_/S);w.push(f(y(u,0))),o=E(n,v,r==i),n=0,++r}++n,++t}return w.join("")}s={version:"1.4.1",ucs2:{decode:b,encode:v},decode:S,encode:_,toASCII:function(e){return g(e,(function(e){return u.test(e)?"xn--"+_(e):e}))},toUnicode:function(e){return g(e,(function(e){return c.test(e)?S(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return s}.call(t,n,t,e))||(e.exports=r)}()}).call(this,n(84)(e))},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(528),t.encode=t.stringify=n(529)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var c=1e3;o&&"number"==typeof o.maxKeys&&(c=o.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var d=0;d<u;++d){var l,p,f,h,m=e[d].replace(a,"%20"),g=m.indexOf(n);g>=0?(l=m.substr(0,g),p=m.substr(g+1)):(l=m,p=""),f=decodeURIComponent(l),h=decodeURIComponent(p),r(s,f)?i(s[f])?s[f].push(h):s[f]=[s[f],h]:s[f]=h}return s};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,a){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?o(s(e),(function(s){var a=encodeURIComponent(r(s))+n;return i(e[s])?o(e[s],(function(e){return a+encodeURIComponent(r(e))})).join(t):a+encodeURIComponent(r(e[s]))})).join(t):a?encodeURIComponent(r(a))+n+encodeURIComponent(r(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var s=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){var r=function(){return this||"object"==typeof self&&self}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(531),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t,n){(function(t){!function(n){"use strict";var r=Object.prototype,i=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag",u="object"==typeof e,d=n.regeneratorRuntime;if(d)u&&(e.exports=d);else{(d=n.regeneratorRuntime=u?e.exports:{}).wrap=g;var l={},p={};p[s]=function(){return this};var f=Object.getPrototypeOf,h=f&&f(f(R([])));h&&h!==r&&i.call(h,s)&&(p=h);var m=E.prototype=v.prototype=Object.create(p);y.prototype=m.constructor=E,E.constructor=y,E[c]=y.displayName="GeneratorFunction",d.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},d.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(m),e},d.awrap=function(e){return{__await:e}},S(_.prototype),_.prototype[a]=function(){return this},d.AsyncIterator=_,d.async=function(e,t,n,r){var i=new _(g(e,t,n,r));return d.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},S(m),m[c]="Generator",m[s]=function(){return this},m.toString=function(){return"[object Generator]"},d.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},d.values=R,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return s.type="throw",s.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}}}function g(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),s=new I(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return x()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=w(s,n);if(a){if(a===l)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=b(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,s),o}function b(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function v(){}function y(){}function E(){}function S(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function _(e){var n;this._invoke=function(r,o){function s(){return new t((function(n,s){!function n(r,o,s,a){var c=b(e[r],e,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&i.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,a)}))}a(c.arg)}(r,o,n,s)}))}return n=n?n.then(s,s):s()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=b(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:x}}function x(){return{value:void 0,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())}).call(this,n(0))},function(e,t,n){var r,i,o=n(245),s=n(246),a=0,c=0;e.exports=function(e,t,n){var u=t&&n||0,d=t||[],l=(e=e||{}).node||r,p=void 0!==e.clockseq?e.clockseq:i;if(null==l||null==p){var f=o();null==l&&(l=r=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==p&&(p=i=16383&(f[6]<<8|f[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:c+1,g=h-a+(m-c)/1e4;if(g<0&&void 0===e.clockseq&&(p=p+1&16383),(g<0||h>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=h,c=m,i=p;var b=(1e4*(268435455&(h+=122192928e5))+m)%4294967296;d[u++]=b>>>24&255,d[u++]=b>>>16&255,d[u++]=b>>>8&255,d[u++]=255&b;var v=h/4294967296*1e4&268435455;d[u++]=v>>>8&255,d[u++]=255&v,d[u++]=v>>>24&15|16,d[u++]=v>>>16&255,d[u++]=p>>>8|128,d[u++]=255&p;for(var y=0;y<6;++y)d[u+y]=l[y];return t||s(d)}},function(e,t,n){var r=n(245),i=n(246);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[o+a]=s[a];return t||i(s)}},function(e,t,n){"use strict";var r=n(2)(n(20));const i=n(9),o=n(1)("analytics"),s=n(535),a=n(19),c=n(247),u=n(139).prependProxyToUrlIfNeeded,d=n(140).getProxyUrl,l=a(),p=new s;e.exports=function(e){var t=this;let n=e.loggingUrl,s=e.queue,a=void 0===s?p:s,f=e.ajax,h=void 0===f?c:f;this.loggingUrl=n,this.updateEndPoints=()=>{if(!this.proxyUrl){this.proxyUrl=d();const e=u(this.loggingUrl,this.proxyUrl);this.loggingUrl=e}this.endPoint=this.loggingUrl+"/logging/ClientEvent",this.endPointQos=this.loggingUrl+"/logging/ClientQos"},this.updateEndPoints();const m={};this.logError=function(e,n,r,o,s){void 0===o&&(o=null),void 0===s&&(s={});const a=s.partnerId;if(((e,t,n)=>{if(!n)return!1;const r=[n,t,e].join("_");return(m[r]||0)>=100})(e,n,a))return;const c=[a,n,e].join("_"),u=o;m[c]=void 0!==m[c]?m[c]+1:1,t.logEvent(i(s,{action:`${n}.${e}`,payload:u}),!1)},this.logEvent=function(e,n,i,s){void 0===n&&(n=!1),void 0===s&&(s=()=>{}),t.updateEndPoints();const c=(0,r.default)({},e,{clientInstanceId:l});if(i&&!isNaN(i)&&Math.random()>i)return void o.debug("skipping sending analytics due to throttle:",c);let u;o.debug("queueing analytics:",t.loggingUrl,c);try{u=JSON.stringify(c)}catch(e){return void s(e)}!function(e,n,r){void 0===n&&(n=()=>{}),a.add(i=>{o.debug("sending analytics:",t.loggingUrl,e),h.post(r?t.endPointQos:t.endPoint,{body:e,overrideMimeType:"text/plain",headers:{Accept:"text/plain","Content-Type":"application/json"}},e=>{e&&o.debug("Failed to send ClientEvent, moving on to the next item."),n(e||void 0),i()})})}(u,s,n)},this.logQOS=e=>this.logEvent(e,!0)}},function(e,t,n){"use strict";var r=n(2)(n(18));let i=function(){function e(e){let t=(void 0===e?{}:e).waitTime,n=void 0===t?50:t;(0,r.default)(this,"queue",[]),(0,r.default)(this,"running",!1),this.waitTime=n}var t=e.prototype;return t.add=function(e){this.queue.push(e),this.run()},t.run=function(){if(this.running)return;this.running=!0;const e=()=>{if(0===this.queue.length)return void(this.running=!1);this.queue.shift()(()=>{setTimeout(e,this.waitTime)})};e()},e}();e.exports=i},function(e,t,n){"use strict";const r=n(11),i={for:"htmlFor",class:"className"};e.exports=function(e){e.prototype.attr=function(e,t){if(r(e)){let t;Object.keys(e).forEach(n=>{t=i[n]||n,this.first.setAttribute(t,e[n])})}else{if(void 0===t)return this.first.getAttribute(i[e]||e);this.first.setAttribute(i[e]||e,t)}return this},e.prototype.removeAttr=function(e){const t=i[e]||e;return this.forEach(e=>{e.removeAttribute(t)}),this},e.prototype.html=function(e){return void 0!==e&&(this.first.innerHTML=e),this.first.innerHTML},e.prototype.center=function(t,n){let r;return this.forEach(i=>{r=new e(i),t=t||parseInt(r.width(),10),n=n||parseInt(r.height(),10);const o=-.5*t+"px",s=-.5*n+"px";r.css("margin",`${s} 0 0 ${o}`).addClass("OT_centered")}),this},e._attachToOTHelpers.centerElement=function(t,n,r){return new e(t).center(n,r)};const t=function(t){return t.offsetWidth>0?t.offsetWidth+"px":new e(t).css("width")},n=function(t){return t.offsetHeight>0?t.offsetHeight+"px":new e(t).css("height")};e.prototype.width=function(e){return e?(this.css("width",e),this):this.isDisplayNone()?this.makeVisibleAndYield(e=>t(e))[0]:t(this.get(0))},e._attachToOTHelpers.width=function(t,n){const r=new e(t).width(n);return n?e._attachToOTHelpers:r},e.prototype.height=function(e){return e?(this.css("height",e),this):this.isDisplayNone()?this.makeVisibleAndYield(e=>n(e))[0]:n(this.get(0))},e._attachToOTHelpers.height=function(t,n){const r=new e(t).height(n);return n?e._attachToOTHelpers:r}}},function(e,t,n){"use strict";const r=n(3),i=(void 0!==typeof window?window:global).getComputedStyle,o={Firefox:"moz",Opera:"O",Chrome:"Webkit",Safari:"Webkit"};e.exports=function(e,t){const n={},s={},a=function(e,t){if(t in e.style)return t;const n=o[r.name]+t[0].toUpperCase()+t.slice(1);return n in e.style?n:t};e.prototype.show=function(){return this.forEach(t=>{const r=t.style.display;""!==r&&"none"!==r||(t.style.display=n[t]||"",delete n[t]),function(e){return"none"===i(e).getPropertyValue("display")}(t)&&(n[t]="none",t.style.display=function(t){if(s[t.ownerDocument]&&s[t.ownerDocument][t.nodeName])return s[t.ownerDocument][t.nodeName];s[t.ownerDocument]||(s[t.ownerDocument]={});let n,r=t.ownerDocument.createElement(t.nodeName);return t.ownerDocument.body.appendChild(r),n=new e(r).css("display"),s[t.ownerDocument][t.nodeName]=n,new e(r).remove(),r=null,n}(t))})},e.prototype.hide=function(){return this.forEach(e=>{"none"!==e.style.display&&(n[e]=e.style.display,e.style.display="none")})},e.prototype.css=function(e,t){if(0!==this.length)return"string"!=typeof e?this.forEach(t=>{!function(e,t){const n=e.style;for(const r in t)t.hasOwnProperty(r)&&(n[a(e,r)]=t[r])}(t,e)}):void 0!==t?this.forEach(n=>{!function(e,t,n){e.style[a(e,t)]=n}(n,e,t)}):function(e,t){const n=a(e,t);let r=i(e).getPropertyValue(n);return""===r&&(r=e.style[n]),r}(this.first,e)},e.prototype.makeVisibleAndYield=function(n){const r={display:"block",visibility:"hidden"},i=[];return this.forEach(o=>{const s=t(o);s?i.push(function(t,n,r){const i=new e(t),o={};let s,a;for(s in n)n.hasOwnProperty(s)&&(o[s]=t.style[s],i.css(s,n[s]));for(s in a=r(t),n)n.hasOwnProperty(s)&&i.css(s,o[s]||"");return a}(s,r,n)):i.push(void 0)}),i}}},function(e,t,n){"use strict";(function(t){const r=n(539),i=r.isiPhone,o=r.isiPad,s=r.isiOS,a=n(540),c=n(541),u=e=>{var t,n;return(null==(n=e=e||(null==(t=void 0!==typeof window?window:global)?void 0:t.navigator))?void 0:n.userAgent.toLowerCase().indexOf("electron"))>=0},d=()=>{var e,t,n;return"string"==typeof(null==(e=void 0!==typeof window?window:global)||null==(t=e.process)||null==(n=t.versions)?void 0:n.node)&&!u()},l={version:-1,name:"unknown"};e.exports={parse:e=>(d()?(l.name="Node",l.isNode=!0,l.version=parseInt(t.versions.node,10),l.userAgent=`${l.name} ${l.version}`):(e=>{if(e=e||(void 0!==typeof window?window:global).navigator,l.userAgent=e.userAgent.toLowerCase(),l.name="unknown",l.userAgent.indexOf("opera")>-1||l.userAgent.indexOf("opr/")>-1)l.name="Opera",l.isOpera=!0,null!==/opr\/([0-9]{1,}[.0-9]{0,})/.exec(l.userAgent)&&(l.version=parseFloat(RegExp.$1));else if(l.userAgent.indexOf("firefox")>-1)l.name="Firefox",l.isFirefox=!0,null!==/firefox\/([0-9]{1,}[.0-9]{0,})/.exec(l.userAgent)&&(l.version=parseFloat(RegExp.$1));else if(l.userAgent.match(/edge?\/(\d+)(?:\.\d+)+$/)){l.name="Edge",l.isEdge=!0;const e=RegExp.$1;l.version=parseInt(e,10)}else l.userAgent.indexOf("chrome")>-1?(l.name="Chrome",l.isElectron=u(e),l.isElectron?l.electronVersion=c(e.userAgent):l.isChrome=!0,null!==/chrome\/([0-9]{1,}[.0-9]{0,})/.exec(l.userAgent)&&(l.version=parseFloat(RegExp.$1))):e.vendor&&e.vendor.toLowerCase().indexOf("apple")>-1?(l.name="Safari",l.isSafari=!0,l.isiPhone=i(e.userAgent),l.isiPad=o(e.userAgent),l.isiOS=s(e.userAgent),l.isiOS&&(l.iOSVersion=a(e.userAgent)),(null!==/version\/([0-9]{1,}[.0-9]{0,})/.exec(l.userAgent)||null!==/fxios\/([0-9]{1,}[.0-9]{0,})/.exec(l.userAgent)||null!==/crios\/([0-9]{1,}[.0-9]{0,})/.exec(l.userAgent))&&(l.version=parseFloat(RegExp.$1))):l.userAgent.indexOf("applewebkit")>-1&&-1===l.userAgent.indexOf("version")&&(l.isIosWebView=!0);l.isChromiumEdge="Edge"===l.name&&l.version>=79,l.isLegacyEdge="Edge"===l.name&&l.version<79,l.isLegacyElectron=l.isElectron&&l.electronVersion<2,l.isLegacyChrome=l.isChrome&&l.version<50,l.isAndroid=l.userAgent.indexOf("android")>-1,l.userAgent=e.userAgent,l.protocol=location.protocol,l.hostName=location.hostName,(-1===l.version||"unknown"===l.name||l.isiOS&&!l.iOSVersion)&&(l.error=!0)})(e),l),isNode:d}}).call(this,n(43))},function(e,t,n){"use strict";const r=e=>/iPhone/.test(e),i=e=>/iPad/.test(e)||(e=>{try{return e.includes("Mac")&&"ontouchend"in document}catch(e){return!1}})(e);e.exports={isiPhone:r,isiPad:i,isiOS:e=>r(e)||i(e)}},function(e,t,n){"use strict";e.exports=function(e){const t=e.match(/OS (\d+_\d+).* like Mac/);if(null!==t&&t[1])return parseFloat(t[1].replace("_","."))}},function(e,t,n){"use strict";const r=/(Electron)\/([0-9]{1,}[.0-9]{0,})/;e.exports=e=>{const t=e.match(r);return t&&parseFloat(t[2])}},function(e,t,n){"use strict";const r=n(543);function i(e,t){return!!t&&(r()?e.classList.contains(t):e.className.indexOf(t)>-1)}e.exports=function(e){e.prototype.addClass=function(e){if(e){const t=e.trim().split(/\s+/);this.forEach(e=>{!function(e,t){if(!t||0===t.length)return;if(1!==e.nodeType)return;const n=t.length;let i=0;if(r())for(;i<n;++i)e.classList.add(t[i]);else if(e.className||1!==t.length){let r=` ${e.className} `;for(;i<n;++i)~r.indexOf(` ${t[i]} `)||(r+=t[i]+" ");e.className=r.trim()}else e.className=t.join(" ")}(e,t)})}return this},e.prototype.removeClass=function(e){if(e){const t=e.trim().split(/\s+/);this.forEach(e=>{!function(e,t){if(!t||0===t.length)return;if(1!==e.nodeType)return;const n=t.length;let i=0;if(r()){for(;i<n;++i)e.classList.remove(t[i]);return}let o=` ${e.className} `.replace(/[\s+]/," ");for(;i<n;++i)o=o.replace(` ${t[i]} `," ");e.className=o.trim()}(e,t)})}return this},e.prototype.toggleClass=function(e){if(e){const t=e.trim().split(/\s+/);this.forEach(e=>{!function(e,t){if(!t||0===t.length)return;if(1!==e.nodeType)return;const n=t.length;let o=0;if(r()){for(;o<n;++o)e.classList.toggle(t[o]);return}let s=` ${e.className} `.replace(/[\s+]/," ");for(;o<n;++o)i(e,t[o])?s=s.replace(` ${t[o]} `," "):s+=t[o]+" ";e.className=s.trim()}(e,t)})}return this},e.prototype.hasClass=function(e){return this.some(t=>i(t,e))}}},function(e,t,n){"use strict";e.exports=()=>"undefined"!=typeof document&&"classList"in document.createElement("a")},function(e,t,n){"use strict";const r=n(545);e.exports=function(e){let t=0,n=0;e.prototype.observeStyleChanges=function(t,n){const i=[];return this.forEach(o=>{i.push(function(t,n,i){const o={},s=function(n){switch(n){case"width":return new e(t).width();case"height":return new e(t).height();default:return new e(t).css(n)}};n.forEach(e=>{o[e]=s(e)});const a=new(void 0!==typeof window?window:global).MutationObserver(a=>{const c={};a.forEach(r=>{if("style"!==r.attributeName)return;const i=new e(t).isDisplayNone();n.forEach(e=>{if(i&&("width"===e||"height"===e))return;const t=s(e);t!==o[e]&&(c[e]=[o[e],t],o[e]=t)})}),r(c)||setTimeout(()=>{i.call(null,c)})});return a.observe(t,{attributes:!0,attributeFilter:["style"],childList:!1,characterData:!1,subtree:!1}),a}(o,t,n))}),i},e.prototype.observeNodeOrChildNodeRemoval=function(t){const r=[];return this.forEach(i=>{r.push(function(t,r){const i=new(void 0!==typeof window?window:global).MutationObserver(t=>{let n=[];t.forEach(e=>{e.removedNodes.length&&(n=n.concat(Array.prototype.slice.call(e.removedNodes)))}),n.length&&setTimeout(()=>{r(new e(n))})});i.observe(t,{attributes:!1,childList:!0,characterData:!1,subtree:!0}),n++;const o=i.disconnect;return i.disconnect=function(){o.apply(i,arguments),n--},i}(i,t))}),r},e.prototype.observeSize=function(e){const n=[];return this.forEach(r=>{n.push(function(e,n){let r={width:0,height:0};const i=setInterval(()=>{const t=e.getBoundingClientRect();r.width===t.width&&r.height===t.height||(n(t,r),r={width:t.width,height:t.height})},200);return t++,{disconnect(){clearInterval(i),t--}}}(r,e))}),n},e._attachToOTHelpers.observeStyleChanges=function(t,n,r){return new e(t).observeStyleChanges(n,r)[0]},e._attachToOTHelpers.observeNodeOrChildNodeRemoval=function(t,n){return new e(t).observeNodeOrChildNodeRemoval(n)[0]},e.__testOnly||(e.__testOnly={}),e.__testOnly.sizeObserverCount=function(){return t},e.__testOnly.nodeRemovalObserverCount=function(){return n}}},function(e,t,n){var r=n(115),i=n(41),o=n(65),s=n(12),a=n(25),c=n(66),u=n(69),d=n(85),l=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(a(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||c(e)||d(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(l.call(e,n))return!1;return!0}},function(e,t,n){"use strict";e.exports={1004:"Authentication error",1005:"Invalid Session ID",1006:"Connect Failed",1007:"Connect Rejected",1008:"Connect Time-out",1009:"Security Error",1010:"Not Connected",1011:"Invalid Parameter",1012:"Peer-to-peer Stream Play Failed",1013:"Connection Failed",1014:"API Response Failure",1015:"PeerConnection not connected, cannot call this method",1021:"Request Timeout",1026:"Terms of Service Violation: Export Compliance",1027:"Connection Limit Exceeded",1040:"Set Video Source Failure",1041:"Invalid Video Source",1500:"Unable to Publish",1501:"Unable to Subscribe",1502:"Unsupported Video Codec",1503:"No TURN server found",1520:"Unable to Force Disconnect",1530:"Unable to Force Unpublish",1540:"Unable to Force Mute",1553:"ICEWorkflow failed",1600:"createOffer, createAnswer, setLocalDescription, setRemoteDescription",1605:"Stream Limit Exceeded",2e3:"Internal Error",2001:"Unexpected Server Response",2021:"Proxy URL Timing Error",2022:"Proxy URL Already Set Error",2031:"getRtcStatsReport is not supported in this browser",4e3:"WebSocket Connection Failed",4001:"WebSocket Network Disconnected",5001:"Unable to access media engine"}},function(e,t,n){"use strict";const r=n(15);e.exports=function(e,t,n,i,o){let s,a=n;e.currentState=n;return e.is=function(){return-1!==Array.prototype.indexOf.call(arguments,a)},e.isNot=function(){return-1===Array.prototype.indexOf.call(arguments,a)},function(n){if(a!==n){if(-1===t.indexOf(n))return void(o&&r(o)&&o("invalidState",n));e.previousState=a,s=a,e.currentState=n,a=n,i&&r(i)&&i(n,s)}}}},function(e,t,n){"use strict";const r=n(250),i={};e.exports=i,i.isElementNode=function(e){return e&&"object"==typeof e&&1===e.nodeType},i.createElement=function(e,t,n,r){const i=(r||document).createElement(e);t=t||{},Object.keys(t).forEach(e=>{if("object"==typeof t[e]){i[e]||(i[e]={});const n=t[e];Object.keys(n).forEach(t=>{i[e][t]=n[t]})}else"className"===e?i.className=t[e]:i.setAttribute(e,t[e])});const o=function(e){"string"==typeof e?i.innerHTML+=e:i.appendChild(e)};return Array.isArray(n)?n.forEach(o):n&&o(n),i},r(i)},function(e,t,n){"use strict";const r=n(550);e.exports=function(e){void 0===e&&(e={});(e.isSessionProxied||n(551))(e.sessionId)&&r.forEach(t=>{t in e&&(e[t]="")})}},function(e,t,n){"use strict";e.exports=["audioLocalAddress","audioRemoteAddress","videoLocalAddress","videoRemoteAddress"]},function(e,t,n){"use strict";const r=n(21).sessions;e.exports=e=>{const t=r.get(e);return!!t&&!!t._.getProxyUrl()}},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8));const s={architecture:"event_ua_arch",bitness:"event_ua_bitness",model:"event_ua_model",platformVersion:"event_ua_platform_version"},a=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={},!(null==t?void 0:t.getHighEntropyValues)){e.next=6;break}return e.next=4,t.getHighEntropyValues(Object.keys(s));case 4:(r=e.sent)&&Object.entries(s).forEach(e=>{let t=e[0],i=e[1];void 0!==r[t]&&(n[i]=r[t])});case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();e.exports=a},function(e,t,n){"use strict";e.exports=["buildHash","minimumVersion","debug",["websiteURL","websiteUrl"],["cdnURL","cdnUrl"],["loggingURL","loggingUrl"],["apiURL","apiUrl"],["supportSSL",!0],["cdnURLSSL","cdnUrl"],["loggingURLSSL","loggingUrl"],["apiURLSSL","apiUrl"],["assetURL","assetUrl"]]},function(e,t,n){"use strict";e.exports=["apiUrl","apiURL","apiURLSSL"]},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8));const s=n(142);e.exports=function(){var e=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.passphrase,s.set(n);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},function(e,t,n){"use strict";e.exports=function(){const e=(void 0!==typeof window?window:global).OT,t=(void 0!==typeof window?window:global).TB;return()=>{const n=(void 0!==typeof window?window:global).OT;return(void 0!==typeof window?window:global).OT=e,(void 0!==typeof window?window:global).TB=t,n}}},function(e,t,n){"use strict";e.exports=function(e){function t(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];const o=new e(...r);return Object.setPrototypeOf(o,t.prototype),o}return t.prototype=Object.create(e.prototype),Object.defineProperties(t.prototype,(e=>{const t={};return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=Object.getOwnPropertyDescriptor(e,n)}),t})(e.prototype)),Object.keys(e).forEach(n=>{t[n]=e[n]}),t}},function(e,t,n){"use strict";var r=n(28);e.exports=function(e,t){var i=e&&e.window,o={shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);var a=r.log,c=r.detectBrowser(i),u=n(559)||null,d=n(561)||null,l=n(565)||null,p=n(567)||null,f=n(568)||null,h={browserDetails:c,commonShim:f,extractVersion:r.extractVersion,disableLog:r.disableLog,disableWarnings:r.disableWarnings};switch(c.browser){case"chrome":if(!u||!u.shimPeerConnection||!o.shimChrome)return a("Chrome shim is not included in this adapter release."),h;a("adapter.js shimming chrome."),h.browserShim=u,f.shimCreateObjectURL(i),u.shimGetUserMedia(i),u.shimMediaStream(i),u.shimSourceObject(i),u.shimPeerConnection(i),u.shimOnTrack(i),u.shimAddTrackRemoveTrack(i),u.shimGetSendersWithDtmf(i),u.shimSenderReceiverGetStats(i),u.fixNegotiationNeeded(i),f.shimRTCIceCandidate(i),f.shimMaxMessageSize(i),f.shimSendThrowTypeError(i);break;case"firefox":if(!l||!l.shimPeerConnection||!o.shimFirefox)return a("Firefox shim is not included in this adapter release."),h;a("adapter.js shimming firefox."),h.browserShim=l,f.shimCreateObjectURL(i),l.shimGetUserMedia(i),l.shimSourceObject(i),l.shimPeerConnection(i),l.shimOnTrack(i),l.shimRemoveStream(i),l.shimSenderGetStats(i),l.shimReceiverGetStats(i),l.shimRTCDataChannel(i),f.shimRTCIceCandidate(i),f.shimMaxMessageSize(i),f.shimSendThrowTypeError(i);break;case"edge":if(!d||!d.shimPeerConnection||!o.shimEdge)return a("MS edge shim is not included in this adapter release."),h;a("adapter.js shimming edge."),h.browserShim=d,f.shimCreateObjectURL(i),d.shimGetUserMedia(i),d.shimPeerConnection(i),d.shimReplaceTrack(i),d.shimGetDisplayMedia(i),f.shimMaxMessageSize(i),f.shimSendThrowTypeError(i);break;case"safari":if(!p||!o.shimSafari)return a("Safari shim is not included in this adapter release."),h;a("adapter.js shimming safari."),h.browserShim=p,f.shimCreateObjectURL(i),p.shimRTCIceServerUrls(i),p.shimCreateOfferLegacy(i),p.shimCallbacksAPI(i),p.shimLocalStreamsAPI(i),p.shimRemoteStreamsAPI(i),p.shimTrackEventTransceiver(i),p.shimGetUserMedia(i),f.shimRTCIceCandidate(i),f.shimMaxMessageSize(i),f.shimSendThrowTypeError(i);break;default:a("Unsupported browser!")}return h}},function(e,t,n){"use strict";(function(t){var r=n(28),i=r.log;function o(e,t,n){var r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;var o=[];return e.forEach((function(e){"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((function(t){e.forEach((function(n){n.type===r&&n.trackId===t.id&&function e(t,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach((function(i){i.endsWith("Id")?e(t,t.get(n[i]),r):i.endsWith("Ids")&&n[i].forEach((function(n){e(t,t.get(n),r)}))})))}(e,n,i)}))})),i}e.exports={shimGetUserMedia:n(560),shimMediaStream:function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},shimOnTrack:function(e){if("object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var n=this;return n._ontrackpoly||(n._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===r.track.id})):{track:r.track};var o=new Event("track");o.track=r.track,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],n.dispatchEvent(o)})),t.stream.getTracks().forEach((function(r){var i;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===r.id})):{track:r};var o=new Event("track");o.track=r,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],n.dispatchEvent(o)}))},n.addEventListener("addstream",n._ontrackpoly)),t.apply(n,arguments)}}else r.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}))},shimGetSendersWithDtmf:function(e){if("object"==typeof e&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){var i=this,o=n.apply(i,arguments);return o||(o=t(i,e),i._senders.push(o)),o};var r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;r.apply(t,arguments);var n=t._senders.indexOf(e);-1!==n&&t._senders.splice(n,1)}}var i=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;n._senders=n._senders||[],i.apply(n,[e]),e.getTracks().forEach((function(e){n._senders.push(t(n,e))}))};var o=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;t._senders=t._senders||[],o.apply(t,[e]),e.getTracks().forEach((function(e){var n=t._senders.find((function(t){return t.track===e}));n&&t._senders.splice(t._senders.indexOf(n),1)}))}}else if("object"==typeof e&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var s=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=s.apply(e,[]);return t.forEach((function(t){t._pc=e})),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},shimSenderReceiverGetStats:function(e){if("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var n=e.RTCPeerConnection.prototype.getSenders;n&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=n.apply(e,[]);return t.forEach((function(t){t._pc=e})),t});var i=e.RTCPeerConnection.prototype.addTrack;i&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=i.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return o(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var s=e.RTCPeerConnection.prototype.getReceivers;s&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=s.apply(e,[]);return t.forEach((function(t){t._pc=e})),t}),r.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return o(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var a=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var n=this;if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var r,i,o,s=arguments[0];return n.getSenders().forEach((function(e){e.track===s&&(r?o=!0:r=e)})),n.getReceivers().forEach((function(e){return e.track===s&&(i?o=!0:i=e),e.track===s})),o||r&&i?t.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):r?r.getStats():i?i.getStats():t.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return a.apply(n,arguments)}}}},shimSourceObject:function(e){var t=e&&e.URL;"object"==typeof e&&e.HTMLMediaElement&&!("srcObject"in e.HTMLMediaElement.prototype)&&Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this._srcObject},set:function(e){var n=this;this._srcObject=e,this.src&&t.revokeObjectURL(this.src),e?(this.src=t.createObjectURL(e),e.addEventListener("addtrack",(function(){n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)})),e.addEventListener("removetrack",(function(){n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)}))):this.src=""}})},shimAddTrackRemoveTrackWithNative:function(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(t){return e._shimmedLocalStreams[t][0]}))};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){if(t.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")}));var r=t.getSenders();n.apply(this,arguments);var i=t.getSenders().filter((function(e){return-1===r.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(i)};var r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((function(n){var r=t._shimmedLocalStreams[n].indexOf(e);-1!==r&&t._shimmedLocalStreams[n].splice(r,1),1===t._shimmedLocalStreams[n].length&&delete t._shimmedLocalStreams[n]})),i.apply(this,arguments)}},shimAddTrackRemoveTrack:function(e){if(e.RTCPeerConnection){var n=r.detectBrowser(e);if(e.RTCPeerConnection.prototype.addTrack&&n.version>=65)return this.shimAddTrackRemoveTrackWithNative(e);var i=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=i.apply(this);return e._reverseStreams=e._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var n=this;if(n._streams=n._streams||{},n._reverseStreams=n._reverseStreams||{},t.getTracks().forEach((function(e){if(n.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")})),!n._reverseStreams[t.id]){var r=new e.MediaStream(t.getTracks());n._streams[t.id]=r,n._reverseStreams[r.id]=t,t=r}o.apply(n,[t])};var s=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;t._streams=t._streams||{},t._reverseStreams=t._reverseStreams||{},s.apply(t,[t._streams[e.id]||e]),delete t._reverseStreams[t._streams[e.id]?t._streams[e.id].id:e.id],delete t._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(n,r){var i=this;if("closed"===i.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var o=[].slice.call(arguments,1);if(1!==o.length||!o[0].getTracks().find((function(e){return e===n})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");var s=i.getSenders().find((function(e){return e.track===n}));if(s)throw new DOMException("Track already exists.","InvalidAccessError");i._streams=i._streams||{},i._reverseStreams=i._reverseStreams||{};var a=i._streams[r.id];if(a)a.addTrack(n),t.resolve().then((function(){i.dispatchEvent(new Event("negotiationneeded"))}));else{var c=new e.MediaStream([n]);i._streams[r.id]=c,i._reverseStreams[c.id]=r,i.addStream(c)}return i.getSenders().find((function(e){return e.track===n}))},["createOffer","createAnswer"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){var e=this,t=arguments,r=arguments.length&&"function"==typeof arguments[0];return r?n.apply(e,[function(n){var r=u(e,n);t[0].apply(null,[r])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(e,arguments).then((function(t){return u(e,t)}))}}));var a=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){var e=this;return arguments.length&&arguments[0].type?(arguments[0]=d(e,arguments[0]),a.apply(e,arguments)):a.apply(e,arguments)};var c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=c.get.apply(this);return""===e.type?e:u(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t,n=this;if("closed"===n.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(e._pc===n))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");n._streams=n._streams||{},Object.keys(n._streams).forEach((function(r){n._streams[r].getTracks().find((function(t){return e.track===t}))&&(t=n._streams[r])})),t&&(1===t.getTracks().length?n.removeStream(n._reverseStreams[t.id]):t.removeTrack(e.track),n.dispatchEvent(new Event("negotiationneeded")))}}function u(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function d(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}},shimPeerConnection:function(e){var n=r.detectBrowser(e);if(!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=function(t,n){return i("PeerConnection"),t&&t.iceTransportPolicy&&(t.iceTransports=t.iceTransportPolicy),new e.webkitRTCPeerConnection(t,n)},e.RTCPeerConnection.prototype=e.webkitRTCPeerConnection.prototype,e.webkitRTCPeerConnection.generateCertificate&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return e.webkitRTCPeerConnection.generateCertificate}})),e.RTCPeerConnection){var o=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,n,r){var i=this,s=arguments;if(arguments.length>0&&"function"==typeof e)return o.apply(this,arguments);if(0===o.length&&(0===arguments.length||"function"!=typeof arguments[0]))return o.apply(this,[]);var a=function(e){var t={};return e.result().forEach((function(e){var n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){n[t]=e.stat(t)})),t[n.id]=n})),t},c=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};if(arguments.length>=2){var u=function(e){s[1](c(a(e)))};return o.apply(this,[u,arguments[0]])}return new t((function(e,t){o.apply(i,[function(t){e(c(a(t)))},t])})).then(n,r)},n.version<51&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(n){var r=e.RTCPeerConnection.prototype[n];e.RTCPeerConnection.prototype[n]=function(){var e=arguments,n=this,i=new t((function(t,i){r.apply(n,[e[0],t,i])}));return e.length<2?i:i.then((function(){e[1].apply(null,[])}),(function(t){e.length>=3&&e[2].apply(null,[t])}))}})),n.version<52&&["createOffer","createAnswer"].forEach((function(n){var r=e.RTCPeerConnection.prototype[n];e.RTCPeerConnection.prototype[n]=function(){var e=this;if(arguments.length<1||1===arguments.length&&"object"==typeof arguments[0]){var n=1===arguments.length?arguments[0]:void 0;return new t((function(t,i){r.apply(e,[t,i,n])}))}return r.apply(this,arguments)}})),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}}));var s=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?s.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),t.resolve())}}},fixNegotiationNeeded:function(e){r.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){if("stable"===e.target.signalingState)return e}))},shimGetDisplayMedia:function(e,t){e.navigator&&e.navigator.mediaDevices&&!("getDisplayMedia"in e.navigator.mediaDevices)&&("function"==typeof t?(e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((function(t){var r=n.video&&n.video.width,i=n.video&&n.video.height,o=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(n)}))},e.navigator.getDisplayMedia=function(t){return r.deprecated("navigator.getDisplayMedia","navigator.mediaDevices.getDisplayMedia"),e.navigator.mediaDevices.getDisplayMedia(t)}):console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(28),i=r.log;e.exports=function(e){var n=r.detectBrowser(e),o=e&&e.navigator,s=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r="object"==typeof e[n]?e[n]:{ideal:e[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);var i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==r.ideal){t.optional=t.optional||[];var o={};"number"==typeof r.ideal?(o[i("min",n)]=r.ideal,t.optional.push(o),(o={})[i("max",n)]=r.ideal,t.optional.push(o)):(o[i("",n)]=r.ideal,t.optional.push(o))}void 0!==r.exact&&"number"!=typeof r.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",n)]=r.exact):["min","max"].forEach((function(e){void 0!==r[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},a=function(e,t){if(n.version>=61)return t(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"==typeof e.audio){var r=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};r((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),r(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=s(e.audio)}if(e&&"object"==typeof e.video){var a=e.video.facingMode;a=a&&("object"==typeof a?a:{ideal:a});var c,u=n.version<66;if(a&&("user"===a.exact||"environment"===a.exact||"user"===a.ideal||"environment"===a.ideal)&&(!o.mediaDevices.getSupportedConstraints||!o.mediaDevices.getSupportedConstraints().facingMode||u))if(delete e.video.facingMode,"environment"===a.exact||"environment"===a.ideal?c=["back","rear"]:"user"!==a.exact&&"user"!==a.ideal||(c=["front"]),c)return o.mediaDevices.enumerateDevices().then((function(n){var r=(n=n.filter((function(e){return"videoinput"===e.kind}))).find((function(e){return c.some((function(t){return-1!==e.label.toLowerCase().indexOf(t)}))}));return!r&&n.length&&-1!==c.indexOf("back")&&(r=n[n.length-1]),r&&(e.video.deviceId=a.exact?{exact:r.deviceId}:{ideal:r.deviceId}),e.video=s(e.video),i("chrome: "+JSON.stringify(e)),t(e)}));e.video=s(e.video)}return i("chrome: "+JSON.stringify(e)),t(e)},c=function(e){return n.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};o.getUserMedia=function(e,t,n){a(e,(function(e){o.webkitGetUserMedia(e,t,(function(e){n&&n(c(e))}))}))};var u=function(e){return new t((function(t,n){o.getUserMedia(e,t,n)}))};if(o.mediaDevices||(o.mediaDevices={getUserMedia:u,enumerateDevices:function(){return new t((function(t){var n={audio:"audioinput",video:"videoinput"};return e.MediaStreamTrack.getSources((function(e){t(e.map((function(e){return{label:e.label,kind:n[e.kind],deviceId:e.id,groupId:""}})))}))}))},getSupportedConstraints:function(){return{deviceId:!0,echoCancellation:!0,facingMode:!0,frameRate:!0,height:!0,width:!0}}}),o.mediaDevices.getUserMedia){var d=o.mediaDevices.getUserMedia.bind(o.mediaDevices);o.mediaDevices.getUserMedia=function(e){return a(e,(function(e){return d(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return t}),(function(e){return t.reject(c(e))}))}))}}else o.mediaDevices.getUserMedia=function(e){return u(e)};void 0===o.mediaDevices.addEventListener&&(o.mediaDevices.addEventListener=function(){i("Dummy mediaDevices.addEventListener called.")}),void 0===o.mediaDevices.removeEventListener&&(o.mediaDevices.removeEventListener=function(){i("Dummy mediaDevices.removeEventListener called.")})}}).call(this,n(0))},function(e,t,n){"use strict";var r=n(28),i=n(562),o=n(563);e.exports={shimGetUserMedia:n(564),shimPeerConnection:function(e){var t=r.detectBrowser(e);if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var n=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){n.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)&&Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var s=o(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=i(e.iceServers)),new s(e)},e.RTCPeerConnection.prototype=s.prototype},shimReplaceTrack:function(e){e.RTCRtpSender&&!("replaceTrack"in e.RTCRtpSender.prototype)&&(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)},shimGetDisplayMedia:function(e,t){if("getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&!("getDisplayMedia"in e.navigator.mediaDevices)){var n=e.navigator.getDisplayMedia;e.navigator.mediaDevices.getDisplayMedia=function(t){return n.call(e.navigator,t)},e.navigator.getDisplayMedia=function(t){return r.deprecated("navigator.getDisplayMedia","navigator.mediaDevices.getDisplayMedia"),n.call(e.navigator,t)}}}}},function(e,t,n){"use strict";var r=n(28);e.exports=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var i=e.urls||e.url;e.url&&!e.urls&&r.deprecated("RTCIceServer.url","RTCIceServer.urls");var o="string"==typeof i;return o&&(i=[i]),i=i.filter((function(e){return 0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!n?(n=!0,!0):0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp")})),delete e.url,e.urls=o?i[0]:i,!!i.length}}))}},function(e,t,n){"use strict";(function(t){var r=n(254);function i(e,t,n,i,o){var s=r.writeRtpDescription(e.kind,t);if(s+=r.writeIceParameters(e.iceGatherer.getLocalParameters()),s+=r.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===n?"actpass":o||"active"),s+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?s+="a=sendrecv\r\n":e.rtpSender?s+="a=sendonly\r\n":e.rtpReceiver?s+="a=recvonly\r\n":s+="a=inactive\r\n",e.rtpSender){var a=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=a;var c="msid:"+(i?i.id:"-")+" "+a+"\r\n";s+="a="+c,s+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(s+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,s+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return s+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+r.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(s+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+r.localCName+"\r\n"),s}function o(e,t){var n={codecs:[],headerExtensions:[],fecMechanisms:[]},r=function(e,t){e=parseInt(e,10);for(var n=0;n<t.length;n++)if(t[n].payloadType===e||t[n].preferredPayloadType===e)return t[n]},i=function(e,t,n,i){var o=r(e.parameters.apt,n),s=r(t.parameters.apt,i);return o&&s&&o.name.toLowerCase()===s.name.toLowerCase()};return e.codecs.forEach((function(r){for(var o=0;o<t.codecs.length;o++){var s=t.codecs[o];if(r.name.toLowerCase()===s.name.toLowerCase()&&r.clockRate===s.clockRate){if("rtx"===r.name.toLowerCase()&&r.parameters&&s.parameters.apt&&!i(r,s,e.codecs,t.codecs))continue;(s=JSON.parse(JSON.stringify(s))).numChannels=Math.min(r.numChannels,s.numChannels),n.codecs.push(s),s.rtcpFeedback=s.rtcpFeedback.filter((function(e){for(var t=0;t<r.rtcpFeedback.length;t++)if(r.rtcpFeedback[t].type===e.type&&r.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var r=0;r<t.headerExtensions.length;r++){var i=t.headerExtensions[r];if(e.uri===i.uri){n.headerExtensions.push(i);break}}})),n}function s(e,t,n){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(n)}function a(e,t){var n=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return n||e.addRemoteCandidate(t),!n}function c(e,t){var n=new Error(t);return n.name=e,n.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],n}e.exports=function(e,n){function u(t,n){n.addTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function d(t,n,r,i){var o=new Event("track");o.track=n,o.receiver=r,o.transceiver={receiver:r},o.streams=i,e.setTimeout((function(){t._dispatchEvent("track",o)}))}var l=function(t){var i=this,o=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){i[e]=o[e].bind(o)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",t=JSON.parse(JSON.stringify(t||{})),this.usingBundle="max-bundle"===t.bundlePolicy,"negotiate"===t.rtcpMuxPolicy)throw c("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(t.rtcpMuxPolicy||(t.rtcpMuxPolicy="require"),t.iceTransportPolicy){case"all":case"relay":break;default:t.iceTransportPolicy="all"}switch(t.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:t.bundlePolicy="balanced"}if(t.iceServers=function(e,t){var n=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var r=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var i="string"==typeof r;return i&&(r=[r]),r=r.filter((function(e){return 0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!n?(n=!0,!0):0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp")})),delete e.url,e.urls=i?r[0]:r,!!r.length}}))}(t.iceServers||[],n),this._iceGatherers=[],t.iceCandidatePoolSize)for(var s=t.iceCandidatePoolSize;s>0;s--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:t.iceServers,gatherPolicy:t.iceTransportPolicy}));else t.iceCandidatePoolSize=0;this._config=t,this.transceivers=[],this._sdpSessionId=r.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(l.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(l.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),l.prototype.onicecandidate=null,l.prototype.onaddstream=null,l.prototype.ontrack=null,l.prototype.onremovestream=null,l.prototype.onsignalingstatechange=null,l.prototype.oniceconnectionstatechange=null,l.prototype.onconnectionstatechange=null,l.prototype.onicegatheringstatechange=null,l.prototype.onnegotiationneeded=null,l.prototype.ondatachannel=null,l.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},l.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},l.prototype.getConfiguration=function(){return this._config},l.prototype.getLocalStreams=function(){return this.localStreams},l.prototype.getRemoteStreams=function(){return this.remoteStreams},l.prototype._createTransceiver=function(e,t){var n=this.transceivers.length>0,r={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&n)r.iceTransport=this.transceivers[0].iceTransport,r.dtlsTransport=this.transceivers[0].dtlsTransport;else{var i=this._createIceAndDtlsTransports();r.iceTransport=i.iceTransport,r.dtlsTransport=i.dtlsTransport}return t||this.transceivers.push(r),r},l.prototype.addTrack=function(t,n){if(this._isClosed)throw c("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var r;if(this.transceivers.find((function(e){return e.track===t})))throw c("InvalidAccessError","Track already exists.");for(var i=0;i<this.transceivers.length;i++)this.transceivers[i].track||this.transceivers[i].kind!==t.kind||(r=this.transceivers[i]);return r||(r=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(n)&&this.localStreams.push(n),r.track=t,r.stream=n,r.rtpSender=new e.RTCRtpSender(t,r.dtlsTransport),r.rtpSender},l.prototype.addStream=function(e){var t=this;if(n>=15025)e.getTracks().forEach((function(n){t.addTrack(n,e)}));else{var r=e.clone();e.getTracks().forEach((function(e,t){var n=r.getTracks()[t];e.addEventListener("enabled",(function(e){n.enabled=e.enabled}))})),r.getTracks().forEach((function(e){t.addTrack(e,r)}))}},l.prototype.removeTrack=function(t){if(this._isClosed)throw c("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var n=this.transceivers.find((function(e){return e.rtpSender===t}));if(!n)throw c("InvalidAccessError","Sender was not created by this connection.");var r=n.stream;n.rtpSender.stop(),n.rtpSender=null,n.track=null,n.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(r)&&this.localStreams.indexOf(r)>-1&&this.localStreams.splice(this.localStreams.indexOf(r),1),this._maybeFireNegotiationNeeded()},l.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var n=t.getSenders().find((function(t){return t.track===e}));n&&t.removeTrack(n)}))},l.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},l.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},l.prototype._createIceGatherer=function(t,n){var r=this;if(n&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var i=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(i,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var n=!e.candidate||0===Object.keys(e.candidate).length;i.state=n?"completed":"gathering",null!==r.transceivers[t].bufferedCandidateEvents&&r.transceivers[t].bufferedCandidateEvents.push(e)},i.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),i},l.prototype._gather=function(t,n){var i=this,o=this.transceivers[n].iceGatherer;if(!o.onlocalcandidate){var s=this.transceivers[n].bufferedCandidateEvents;this.transceivers[n].bufferedCandidateEvents=null,o.removeEventListener("localcandidate",this.transceivers[n].bufferCandidates),o.onlocalcandidate=function(e){if(!(i.usingBundle&&n>0)){var s=new Event("icecandidate");s.candidate={sdpMid:t,sdpMLineIndex:n};var a=e.candidate,c=!a||0===Object.keys(a).length;if(c)"new"!==o.state&&"gathering"!==o.state||(o.state="completed");else{"new"===o.state&&(o.state="gathering"),a.component=1,a.ufrag=o.getLocalParameters().usernameFragment;var u=r.writeCandidate(a);s.candidate=Object.assign(s.candidate,r.parseCandidate(u)),s.candidate.candidate=u,s.candidate.toJSON=function(){return{candidate:s.candidate.candidate,sdpMid:s.candidate.sdpMid,sdpMLineIndex:s.candidate.sdpMLineIndex,usernameFragment:s.candidate.usernameFragment}}}var d=r.getMediaSections(i._localDescription.sdp);d[s.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+s.candidate.candidate+"\r\n",i._localDescription.sdp=r.getDescription(i._localDescription.sdp)+d.join("");var l=i.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==i.iceGatheringState&&(i.iceGatheringState="gathering",i._emitGatheringStateChange()),c||i._dispatchEvent("icecandidate",s),l&&(i._dispatchEvent("icecandidate",new Event("icecandidate")),i.iceGatheringState="complete",i._emitGatheringStateChange())}},e.setTimeout((function(){s.forEach((function(e){o.onlocalcandidate(e)}))}),0)}},l.prototype._createIceAndDtlsTransports=function(){var t=this,n=new e.RTCIceTransport(null);n.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var r=new e.RTCDtlsTransport(n);return r.ondtlsstatechange=function(){t._updateConnectionState()},r.onerror=function(){Object.defineProperty(r,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:n,dtlsTransport:r}},l.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var n=this.transceivers[e].iceTransport;n&&(delete n.onicestatechange,delete this.transceivers[e].iceTransport);var r=this.transceivers[e].dtlsTransport;r&&(delete r.ondtlsstatechange,delete r.onerror,delete this.transceivers[e].dtlsTransport)},l.prototype._transceive=function(e,t,i){var s=o(e.localCapabilities,e.remoteCapabilities);t&&e.rtpSender&&(s.encodings=e.sendEncodingParameters,s.rtcp={cname:r.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(s.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(s)),i&&e.rtpReceiver&&s.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&n<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?s.encodings=e.recvEncodingParameters:s.encodings=[{}],s.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(s.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(s.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(s))},l.prototype.setLocalDescription=function(e){var n,i,a=this;if(-1===["offer","answer"].indexOf(e.type))return t.reject(c("TypeError",'Unsupported type "'+e.type+'"'));if(!s("setLocalDescription",e.type,a.signalingState)||a._isClosed)return t.reject(c("InvalidStateError","Can not set local "+e.type+" in state "+a.signalingState));if("offer"===e.type)n=r.splitSections(e.sdp),i=n.shift(),n.forEach((function(e,t){var n=r.parseRtpParameters(e);a.transceivers[t].localCapabilities=n})),a.transceivers.forEach((function(e,t){a._gather(e.mid,t)}));else if("answer"===e.type){n=r.splitSections(a._remoteDescription.sdp),i=n.shift();var u=r.matchPrefix(i,"a=ice-lite").length>0;n.forEach((function(e,t){var n=a.transceivers[t],s=n.iceGatherer,c=n.iceTransport,d=n.dtlsTransport,l=n.localCapabilities,p=n.remoteCapabilities;if(!(r.isRejected(e)&&0===r.matchPrefix(e,"a=bundle-only").length)&&!n.rejected){var f=r.getIceParameters(e,i),h=r.getDtlsParameters(e,i);u&&(h.role="server"),a.usingBundle&&0!==t||(a._gather(n.mid,t),"new"===c.state&&c.start(s,f,u?"controlling":"controlled"),"new"===d.state&&d.start(h));var m=o(l,p);a._transceive(n,m.codecs.length>0,!1)}}))}return a._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?a._updateSignalingState("have-local-offer"):a._updateSignalingState("stable"),t.resolve()},l.prototype.setRemoteDescription=function(i){var l=this;if(-1===["offer","answer"].indexOf(i.type))return t.reject(c("TypeError",'Unsupported type "'+i.type+'"'));if(!s("setRemoteDescription",i.type,l.signalingState)||l._isClosed)return t.reject(c("InvalidStateError","Can not set remote "+i.type+" in state "+l.signalingState));var p={};l.remoteStreams.forEach((function(e){p[e.id]=e}));var f=[],h=r.splitSections(i.sdp),m=h.shift(),g=r.matchPrefix(m,"a=ice-lite").length>0,b=r.matchPrefix(m,"a=group:BUNDLE ").length>0;l.usingBundle=b;var v=r.matchPrefix(m,"a=ice-options:")[0];return l.canTrickleIceCandidates=!!v&&v.substr(14).split(" ").indexOf("trickle")>=0,h.forEach((function(t,s){var c=r.splitLines(t),d=r.getKind(t),h=r.isRejected(t)&&0===r.matchPrefix(t,"a=bundle-only").length,v=c[0].substr(2).split(" ")[2],y=r.getDirection(t,m),E=r.parseMsid(t),S=r.getMid(t)||r.generateIdentifier();if(h||"application"===d&&("DTLS/SCTP"===v||"UDP/DTLS/SCTP"===v))l.transceivers[s]={mid:S,kind:d,protocol:v,rejected:!0};else{var _,w,T,C,I,R,x,O,k;!h&&l.transceivers[s]&&l.transceivers[s].rejected&&(l.transceivers[s]=l._createTransceiver(d,!0));var N,Z,A=r.parseRtpParameters(t);h||(N=r.getIceParameters(t,m),(Z=r.getDtlsParameters(t,m)).role="client"),x=r.parseRtpEncodingParameters(t);var L=r.parseRtcpParameters(t),V=r.matchPrefix(t,"a=end-of-candidates",m).length>0,P=r.matchPrefix(t,"a=candidate:").map((function(e){return r.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===i.type||"answer"===i.type)&&!h&&b&&s>0&&l.transceivers[s]&&(l._disposeIceAndDtlsTransports(s),l.transceivers[s].iceGatherer=l.transceivers[0].iceGatherer,l.transceivers[s].iceTransport=l.transceivers[0].iceTransport,l.transceivers[s].dtlsTransport=l.transceivers[0].dtlsTransport,l.transceivers[s].rtpSender&&l.transceivers[s].rtpSender.setTransport(l.transceivers[0].dtlsTransport),l.transceivers[s].rtpReceiver&&l.transceivers[s].rtpReceiver.setTransport(l.transceivers[0].dtlsTransport)),"offer"!==i.type||h){if("answer"===i.type&&!h){w=(_=l.transceivers[s]).iceGatherer,T=_.iceTransport,C=_.dtlsTransport,I=_.rtpReceiver,R=_.sendEncodingParameters,O=_.localCapabilities,l.transceivers[s].recvEncodingParameters=x,l.transceivers[s].remoteCapabilities=A,l.transceivers[s].rtcpParameters=L,P.length&&"new"===T.state&&(!g&&!V||b&&0!==s?P.forEach((function(e){a(_.iceTransport,e)})):T.setRemoteCandidates(P)),b&&0!==s||("new"===T.state&&T.start(w,N,"controlling"),"new"===C.state&&C.start(Z)),!o(_.localCapabilities,_.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&_.sendEncodingParameters[0].rtx&&delete _.sendEncodingParameters[0].rtx,l._transceive(_,"sendrecv"===y||"recvonly"===y,"sendrecv"===y||"sendonly"===y),!I||"sendrecv"!==y&&"sendonly"!==y?delete _.rtpReceiver:(k=I.track,E?(p[E.stream]||(p[E.stream]=new e.MediaStream),u(k,p[E.stream]),f.push([k,I,p[E.stream]])):(p.default||(p.default=new e.MediaStream),u(k,p.default),f.push([k,I,p.default])))}}else{(_=l.transceivers[s]||l._createTransceiver(d)).mid=S,_.iceGatherer||(_.iceGatherer=l._createIceGatherer(s,b)),P.length&&"new"===_.iceTransport.state&&(!V||b&&0!==s?P.forEach((function(e){a(_.iceTransport,e)})):_.iceTransport.setRemoteCandidates(P)),O=e.RTCRtpReceiver.getCapabilities(d),n<15019&&(O.codecs=O.codecs.filter((function(e){return"rtx"!==e.name}))),R=_.sendEncodingParameters||[{ssrc:1001*(2*s+2)}];var M,D=!1;if("sendrecv"===y||"sendonly"===y){if(D=!_.rtpReceiver,I=_.rtpReceiver||new e.RTCRtpReceiver(_.dtlsTransport,d),D)k=I.track,E&&"-"===E.stream||(E?(p[E.stream]||(p[E.stream]=new e.MediaStream,Object.defineProperty(p[E.stream],"id",{get:function(){return E.stream}})),Object.defineProperty(k,"id",{get:function(){return E.track}}),M=p[E.stream]):(p.default||(p.default=new e.MediaStream),M=p.default)),M&&(u(k,M),_.associatedRemoteMediaStreams.push(M)),f.push([k,I,M])}else _.rtpReceiver&&_.rtpReceiver.track&&(_.associatedRemoteMediaStreams.forEach((function(t){var n=t.getTracks().find((function(e){return e.id===_.rtpReceiver.track.id}));n&&function(t,n){n.removeTrack(t),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:t}))}(n,t)})),_.associatedRemoteMediaStreams=[]);_.localCapabilities=O,_.remoteCapabilities=A,_.rtpReceiver=I,_.rtcpParameters=L,_.sendEncodingParameters=R,_.recvEncodingParameters=x,l._transceive(l.transceivers[s],!1,D)}}})),void 0===l._dtlsRole&&(l._dtlsRole="offer"===i.type?"active":"passive"),l._remoteDescription={type:i.type,sdp:i.sdp},"offer"===i.type?l._updateSignalingState("have-remote-offer"):l._updateSignalingState("stable"),Object.keys(p).forEach((function(t){var n=p[t];if(n.getTracks().length){if(-1===l.remoteStreams.indexOf(n)){l.remoteStreams.push(n);var r=new Event("addstream");r.stream=n,e.setTimeout((function(){l._dispatchEvent("addstream",r)}))}f.forEach((function(e){var t=e[0],r=e[1];n.id===e[2].id&&d(l,t,r,[n])}))}})),f.forEach((function(e){e[2]||d(l,e[0],e[1],[])})),e.setTimeout((function(){l&&l.transceivers&&l.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),t.resolve()},l.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},l.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},l.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},l.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var n=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",n)}},l.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var n=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",n)}},l.prototype.createOffer=function(){var o=this;if(o._isClosed)return t.reject(c("InvalidStateError","Can not call createOffer after close"));var s=o.transceivers.filter((function(e){return"audio"===e.kind})).length,a=o.transceivers.filter((function(e){return"video"===e.kind})).length,u=arguments[0];if(u){if(u.mandatory||u.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==u.offerToReceiveAudio&&(s=!0===u.offerToReceiveAudio?1:!1===u.offerToReceiveAudio?0:u.offerToReceiveAudio),void 0!==u.offerToReceiveVideo&&(a=!0===u.offerToReceiveVideo?1:!1===u.offerToReceiveVideo?0:u.offerToReceiveVideo)}for(o.transceivers.forEach((function(e){"audio"===e.kind?--s<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)}));s>0||a>0;)s>0&&(o._createTransceiver("audio"),s--),a>0&&(o._createTransceiver("video"),a--);var d=r.writeSessionBoilerplate(o._sdpSessionId,o._sdpSessionVersion++);o.transceivers.forEach((function(t,i){var s=t.track,a=t.kind,c=t.mid||r.generateIdentifier();t.mid=c,t.iceGatherer||(t.iceGatherer=o._createIceGatherer(i,o.usingBundle));var u=e.RTCRtpSender.getCapabilities(a);n<15019&&(u.codecs=u.codecs.filter((function(e){return"rtx"!==e.name}))),u.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),t.remoteCapabilities&&t.remoteCapabilities.codecs&&t.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),u.headerExtensions.forEach((function(e){(t.remoteCapabilities&&t.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var d=t.sendEncodingParameters||[{ssrc:1001*(2*i+1)}];s&&n>=15019&&"video"===a&&!d[0].rtx&&(d[0].rtx={ssrc:d[0].ssrc+1}),t.wantReceive&&(t.rtpReceiver=new e.RTCRtpReceiver(t.dtlsTransport,a)),t.localCapabilities=u,t.sendEncodingParameters=d})),"max-compat"!==o._config.bundlePolicy&&(d+="a=group:BUNDLE "+o.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),d+="a=ice-options:trickle\r\n",o.transceivers.forEach((function(e,t){d+=i(e,e.localCapabilities,"offer",e.stream,o._dtlsRole),d+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===o.iceGatheringState||0!==t&&o.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,d+="a="+r.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(d+="a=end-of-candidates\r\n"))}));var l=new e.RTCSessionDescription({type:"offer",sdp:d});return t.resolve(l)},l.prototype.createAnswer=function(){var s=this;if(s._isClosed)return t.reject(c("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==s.signalingState&&"have-local-pranswer"!==s.signalingState)return t.reject(c("InvalidStateError","Can not call createAnswer in signalingState "+s.signalingState));var a=r.writeSessionBoilerplate(s._sdpSessionId,s._sdpSessionVersion++);s.usingBundle&&(a+="a=group:BUNDLE "+s.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var u=r.getMediaSections(s._remoteDescription.sdp).length;s.transceivers.forEach((function(e,t){if(!(t+1>u)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var r;if(e.stream)"audio"===e.kind?r=e.stream.getAudioTracks()[0]:"video"===e.kind&&(r=e.stream.getVideoTracks()[0]),r&&n>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1});var c=o(e.localCapabilities,e.remoteCapabilities);!c.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=i(e,c,"answer",e.stream,s._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var d=new e.RTCSessionDescription({type:"answer",sdp:a});return t.resolve(d)},l.prototype.addIceCandidate=function(e){var n,i=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?t.reject(new TypeError("sdpMLineIndex or sdpMid required")):new t((function(t,o){if(!i._remoteDescription)return o(c("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var s=e.sdpMLineIndex;if(e.sdpMid)for(var u=0;u<i.transceivers.length;u++)if(i.transceivers[u].mid===e.sdpMid){s=u;break}var d=i.transceivers[s];if(!d)return o(c("OperationError","Can not add ICE candidate"));if(d.rejected)return t();var l=Object.keys(e.candidate).length>0?r.parseCandidate(e.candidate):{};if("tcp"===l.protocol&&(0===l.port||9===l.port))return t();if(l.component&&1!==l.component)return t();if((0===s||s>0&&d.iceTransport!==i.transceivers[0].iceTransport)&&!a(d.iceTransport,l))return o(c("OperationError","Can not add ICE candidate"));var p=e.candidate.trim();0===p.indexOf("a=")&&(p=p.substr(2)),(n=r.getMediaSections(i._remoteDescription.sdp))[s]+="a="+(l.type?p:"end-of-candidates")+"\r\n",i._remoteDescription.sdp=r.getDescription(i._remoteDescription.sdp)+n.join("")}else for(var f=0;f<i.transceivers.length&&(i.transceivers[f].rejected||(i.transceivers[f].iceTransport.addRemoteCandidate({}),(n=r.getMediaSections(i._remoteDescription.sdp))[f]+="a=end-of-candidates\r\n",i._remoteDescription.sdp=r.getDescription(i._remoteDescription.sdp)+n.join(""),!i.usingBundle));f++);t()}))},l.prototype.getStats=function(n){if(n&&n instanceof e.MediaStreamTrack){var r=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===n?r=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===n&&(r=e.rtpReceiver)})),!r)throw c("InvalidAccessError","Invalid selector.");return r.getStats()}var i=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&i.push(e[t].getStats())}))})),t.all(i).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))};["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var n=e[t];if(n&&n.prototype&&n.prototype.getStats){var r=n.prototype.getStats;n.prototype.getStats=function(){return r.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(n){var r;e[n].type={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[(r=e[n]).type]||r.type,t.set(n,e[n])})),t}))}}}));var p=["createOffer","createAnswer"];return p.forEach((function(e){var t=l.prototype[e];l.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(p=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=l.prototype[e];l.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=l.prototype[e];l.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),l}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){e.exports=function(e){var n=e&&e.navigator,r=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return r(e).catch((function(e){return t.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))}))}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(28);e.exports={shimGetUserMedia:n(566),shimOnTrack:function(e){"object"==typeof e&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)&&Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&(this.removeEventListener("track",this._ontrack),this.removeEventListener("addstream",this._ontrackpoly)),this.addEventListener("track",this._ontrack=e),this.addEventListener("addstream",this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(t){var n=new Event("track");n.track=t,n.receiver={track:t},n.transceiver={receiver:n.receiver},n.streams=[e.stream],this.dispatchEvent(n)}.bind(this))}.bind(this))},enumerable:!0,configurable:!0}),"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimSourceObject:function(e){"object"==typeof e&&e.HTMLMediaElement&&!("srcObject"in e.HTMLMediaElement.prototype)&&Object.defineProperty(e.HTMLMediaElement.prototype,"srcObject",{get:function(){return this.mozSrcObject},set:function(e){this.mozSrcObject=e}})},shimPeerConnection:function(e){var n=r.detectBrowser(e);if("object"==typeof e&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){e.RTCPeerConnection||(e.RTCPeerConnection=function(t,r){if(n.version<38&&t&&t.iceServers){for(var i=[],o=0;o<t.iceServers.length;o++){var s=t.iceServers[o];if(s.hasOwnProperty("urls"))for(var a=0;a<s.urls.length;a++){var c={url:s.urls[a]};0===s.urls[a].indexOf("turn")&&(c.username=s.username,c.credential=s.credential),i.push(c)}else i.push(t.iceServers[o])}t.iceServers=i}return new e.mozRTCPeerConnection(t,r)},e.RTCPeerConnection.prototype=e.mozRTCPeerConnection.prototype,e.mozRTCPeerConnection.generateCertificate&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return e.mozRTCPeerConnection.generateCertificate}}),e.RTCSessionDescription=e.mozRTCSessionDescription,e.RTCIceCandidate=e.mozRTCIceCandidate),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t];e.RTCPeerConnection.prototype[t]=function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}}));var i=e.RTCPeerConnection.prototype.addIceCandidate;e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?i.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),t.resolve())};var o={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},s=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(e,t,r){return s.apply(this,[e||null]).then((function(e){if(n.version<48&&(e=function(e){var t=new Map;return Object.keys(e).forEach((function(n){t.set(n,e[n]),t[n]=e[n]})),t}(e)),n.version<53&&!t)try{e.forEach((function(e){e.type=o[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,n){e.set(n,Object.assign({},t,{type:o[t.type]||t.type}))}))}return e})).then(t,r)}}},shimSenderGetStats:function(e){if("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpSender.prototype))){var n=e.RTCPeerConnection.prototype.getSenders;n&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=n.apply(e,[]);return t.forEach((function(t){t._pc=e})),t});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):t.resolve(new Map)}}},shimReceiverGetStats:function(e){if("object"==typeof e&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpReceiver.prototype))){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,n=t.apply(e,[]);return n.forEach((function(t){t._pc=e})),n}),r.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},shimRemoveStream:function(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;r.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(n){n.track&&-1!==e.getTracks().indexOf(n.track)&&t.removeTrack(n)}))})},shimRTCDataChannel:function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)},shimGetDisplayMedia:function(e,n){e.navigator&&e.navigator.mediaDevices&&!("getDisplayMedia"in e.navigator.mediaDevices)&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){var i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,t.reject(i)}return!0===r.video?r.video={mediaSource:n}:r.video.mediaSource=n,e.navigator.mediaDevices.getUserMedia(r)},e.navigator.getDisplayMedia=function(t){return r.deprecated("navigator.getDisplayMedia","navigator.mediaDevices.getDisplayMedia"),e.navigator.mediaDevices.getDisplayMedia(t)})}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(28),i=r.log;e.exports=function(e){var n=r.detectBrowser(e),o=e&&e.navigator,s=e&&e.MediaStreamTrack,a=function(e){return{name:{InternalError:"NotReadableError",NotSupportedError:"TypeError",PermissionDeniedError:"NotAllowedError",SecurityError:"NotAllowedError"}[e.name]||e.name,message:{"The operation is insecure.":"The request is not allowed by the user agent or the platform in the current context."}[e.message]||e.message,constraint:e.constraint,toString:function(){return this.name+(this.message&&": ")+this.message}}},c=function(e,t,r){var s=function(e){if("object"!=typeof e||e.require)return e;var t=[];return Object.keys(e).forEach((function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var r=e[n]="object"==typeof e[n]?e[n]:{ideal:e[n]};if(void 0===r.min&&void 0===r.max&&void 0===r.exact||t.push(n),void 0!==r.exact&&("number"==typeof r.exact?r.min=r.max=r.exact:e[n]=r.exact,delete r.exact),void 0!==r.ideal){e.advanced=e.advanced||[];var i={};"number"==typeof r.ideal?i[n]={min:r.ideal,max:r.ideal}:i[n]=r.ideal,e.advanced.push(i),delete r.ideal,Object.keys(r).length||delete e[n]}}})),t.length&&(e.require=t),e};return e=JSON.parse(JSON.stringify(e)),n.version<38&&(i("spec: "+JSON.stringify(e)),e.audio&&(e.audio=s(e.audio)),e.video&&(e.video=s(e.video)),i("ff37: "+JSON.stringify(e))),o.mozGetUserMedia(e,t,(function(e){r(a(e))}))};if(o.mediaDevices||(o.mediaDevices={getUserMedia:function(e){return new t((function(t,n){c(e,t,n)}))},addEventListener:function(){},removeEventListener:function(){}}),o.mediaDevices.enumerateDevices=o.mediaDevices.enumerateDevices||function(){return new t((function(e){e([{kind:"audioinput",deviceId:"default",label:"",groupId:""},{kind:"videoinput",deviceId:"default",label:"",groupId:""}])}))},n.version<41){var u=o.mediaDevices.enumerateDevices.bind(o.mediaDevices);o.mediaDevices.enumerateDevices=function(){return u().then(void 0,(function(e){if("NotFoundError"===e.name)return[];throw e}))}}if(n.version<49){var d=o.mediaDevices.getUserMedia.bind(o.mediaDevices);o.mediaDevices.getUserMedia=function(e){return d(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("The object can not be found here.","NotFoundError");return t}),(function(e){return t.reject(a(e))}))}}if(!(n.version>55&&"autoGainControl"in o.mediaDevices.getSupportedConstraints())){var l=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},p=o.mediaDevices.getUserMedia.bind(o.mediaDevices);if(o.mediaDevices.getUserMedia=function(e){return"object"==typeof e&&"object"==typeof e.audio&&(e=JSON.parse(JSON.stringify(e)),l(e.audio,"autoGainControl","mozAutoGainControl"),l(e.audio,"noiseSuppression","mozNoiseSuppression")),p(e)},s&&s.prototype.getSettings){var f=s.prototype.getSettings;s.prototype.getSettings=function(){var e=f.apply(this,arguments);return l(e,"mozAutoGainControl","autoGainControl"),l(e,"mozNoiseSuppression","noiseSuppression"),e}}if(s&&s.prototype.applyConstraints){var h=s.prototype.applyConstraints;s.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"==typeof e&&(e=JSON.parse(JSON.stringify(e)),l(e,"autoGainControl","mozAutoGainControl"),l(e,"noiseSuppression","mozNoiseSuppression")),h.apply(this,[e])}}}o.getUserMedia=function(e,t,i){if(n.version<44)return c(e,t,i);r.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),o.mediaDevices.getUserMedia(e).then(t,i)}}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){var r=n(28);e.exports={shimLocalStreamsAPI:function(e){if("object"==typeof e&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),"getStreamById"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getStreamById=function(e){var t=null;return this._localStreams&&this._localStreams.forEach((function(n){n.id===e&&(t=n)})),this._remoteStreams&&this._remoteStreams.forEach((function(n){n.id===e&&(t=n)})),t}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||(this._localStreams=[]),-1===this._localStreams.indexOf(e)&&this._localStreams.push(e);var n=this;e.getTracks().forEach((function(r){t.call(n,r,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e,n){return n&&(this._localStreams?-1===this._localStreams.indexOf(n)&&this._localStreams.push(n):this._localStreams=[n]),t.call(this,e,n)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||(this._localStreams=[]);var t=this._localStreams.indexOf(e);if(-1!==t){this._localStreams.splice(t,1);var n=this,r=e.getTracks();this.getSenders().forEach((function(e){-1!==r.indexOf(e.track)&&n.removeTrack(e)}))}})}},shimRemoteStreamsAPI:function(e){if("object"==typeof e&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){this._onaddstream&&this.removeEventListener("addstream",this._onaddstream),this.addEventListener("addstream",this._onaddstream=e)}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}}))}),t.apply(e,arguments)}}},shimCallbacksAPI:function(e){if("object"==typeof e&&e.RTCPeerConnection){var n=e.RTCPeerConnection.prototype,r=n.createOffer,i=n.createAnswer,o=n.setLocalDescription,s=n.setRemoteDescription,a=n.addIceCandidate;n.createOffer=function(e,n){var i=arguments.length>=2?arguments[2]:arguments[0],o=r.apply(this,[i]);return n?(o.then(e,n),t.resolve()):o},n.createAnswer=function(e,n){var r=arguments.length>=2?arguments[2]:arguments[0],o=i.apply(this,[r]);return n?(o.then(e,n),t.resolve()):o};var c=function(e,n,r){var i=o.apply(this,[e]);return r?(i.then(n,r),t.resolve()):i};n.setLocalDescription=c,c=function(e,n,r){var i=s.apply(this,[e]);return r?(i.then(n,r),t.resolve()):i},n.setRemoteDescription=c,c=function(e,n,r){var i=a.apply(this,[e]);return r?(i.then(n,r),t.resolve()):i},n.addIceCandidate=c}},shimGetUserMedia:function(e){var t=e&&e.navigator;t.getUserMedia||(t.webkitGetUserMedia?t.getUserMedia=t.webkitGetUserMedia.bind(t):t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t)))},shimRTCIceServerUrls:function(e){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){for(var i=[],o=0;o<e.iceServers.length;o++){var s=e.iceServers[o];!s.hasOwnProperty("urls")&&s.hasOwnProperty("url")?(r.deprecated("RTCIceServer.url","RTCIceServer.urls"),(s=JSON.parse(JSON.stringify(s))).urls=s.url,delete s.url,i.push(s)):i.push(e.iceServers[o])}e.iceServers=i}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in e.RTCPeerConnection&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})},shimTrackEventTransceiver:function(e){"object"==typeof e&&e.RTCPeerConnection&&"receiver"in e.RTCTrackEvent.prototype&&!e.RTCTransceiver&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},shimCreateOfferLegacy:function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){var n=this;if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var r=n.getTransceivers().find((function(e){return e.sender.track&&"audio"===e.sender.track.kind}));!1===e.offerToReceiveAudio&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveAudio||r||n.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var i=n.getTransceivers().find((function(e){return e.sender.track&&"video"===e.sender.track.kind}));!1===e.offerToReceiveVideo&&i?"sendrecv"===i.direction?i.setDirection("sendonly"):"recvonly"===i.direction&&i.setDirection("inactive"):!0!==e.offerToReceiveVideo||i||n.addTransceiver("video")}return t.apply(n,arguments)}}}}).call(this,n(0))},function(e,t,n){"use strict";var r=n(254),i=n(28);e.exports={shimRTCIceCandidate:function(e){if(!(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"==typeof e&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var n=new t(e),i=r.parseCandidate(e.candidate),o=Object.assign(n,i);return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,i.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}},shimCreateObjectURL:function(e){var t=e&&e.URL;if("object"==typeof e&&e.HTMLMediaElement&&"srcObject"in e.HTMLMediaElement.prototype&&t.createObjectURL&&t.revokeObjectURL){var n=t.createObjectURL.bind(t),r=t.revokeObjectURL.bind(t),o=new Map,s=0;t.createObjectURL=function(e){if("getTracks"in e){var t="polyblob:"+ ++s;return o.set(t,e),i.deprecated("URL.createObjectURL(stream)","elem.srcObject = stream"),t}return n(e)},t.revokeObjectURL=function(e){r(e),o.delete(e)};var a=Object.getOwnPropertyDescriptor(e.HTMLMediaElement.prototype,"src");Object.defineProperty(e.HTMLMediaElement.prototype,"src",{get:function(){return a.get.apply(this)},set:function(e){return this.srcObject=o.get(e)||null,a.set.apply(this,[e])}});var c=e.HTMLMediaElement.prototype.setAttribute;e.HTMLMediaElement.prototype.setAttribute=function(){return 2===arguments.length&&"src"===(""+arguments[0]).toLowerCase()&&(this.srcObject=o.get(arguments[1])||null),c.apply(this,arguments)}}},shimMaxMessageSize:function(e){if(!e.RTCSctpTransport&&e.RTCPeerConnection){var t=i.detectBrowser(e);"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var n=function(e){var t=r.splitSections(e.sdp);return t.shift(),t.some((function(e){var t=r.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},o=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var n=parseInt(t[1],10);return n!=n?-1:n},s=function(e){var n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},a=function(e,n){var i=65536;"firefox"===t.browser&&57===t.version&&(i=65535);var o=r.matchPrefix(e.sdp,"a=max-message-size:");return o.length>0?i=parseInt(o[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(i=2147483637),i},c=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;if(e._sctp=null,n(arguments[0])){var t,r=o(arguments[0]),i=s(r),u=a(arguments[0],r);t=0===i&&0===u?Number.POSITIVE_INFINITY:0===i||0===u?Math.max(i,u):Math.min(i,u);var d={};Object.defineProperty(d,"maxMessageSize",{get:function(){return t}}),e._sctp=d}return c.apply(e,arguments)}}},shimSendThrowTypeError:function(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=this,r=t.apply(e,arguments);return n(r,e),r},i.wrapPeerConnectionEvent(e,"datachannel",(function(e){return n(e.channel,e.target),e}))}function n(e,t){var n=e.send;e.send=function(){var r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}}}},function(e,t,n){"use strict";(function(t){const r=n(6);function i(){return"undefined"==typeof document||"complete"===document.readyState||"interactive"===document.readyState&&document.body}let o=!1;const s={isDomLoaded:i,isDomUnloaded:()=>o,whenUnloaded:new t(e=>{if("undefined"!=typeof window){const t=()=>{o=!0,s.emit("unload"),e()};window.addEventListener("unload",t)}}),whenLoaded:new t(e=>{if(i())return void e();const t=()=>{document.removeEventListener("DOMContentLoaded",t),document.removeEventListener("load",t),s.emit("load"),e()};document.addEventListener("DOMContentLoaded",t),document.addEventListener("load",t)})};r(s),e.exports=s}).call(this,n(0))},function(e,t,n){var r=n(78),i=n(258),o=n(242),s=n(571),a=n(11),c=n(54),u=n(259);e.exports=function e(t,n,d,l,p){t!==n&&o(n,(function(o,c){if(p||(p=new r),a(o))s(t,n,c,d,e,l,p);else{var f=l?l(u(t,c),o,c+"",t,n,p):void 0;void 0===f&&(f=o),i(t,c,f)}}),c)}},function(e,t,n){var r=n(258),i=n(183),o=n(192),s=n(55),a=n(193),c=n(65),u=n(12),d=n(130),l=n(66),p=n(15),f=n(11),h=n(136),m=n(85),g=n(259),b=n(572);e.exports=function(e,t,n,v,y,E,S){var _=g(e,n),w=g(t,n),T=S.get(w);if(T)r(e,n,T);else{var C=E?E(_,w,n+"",e,t,S):void 0,I=void 0===C;if(I){var R=u(w),x=!R&&l(w),O=!R&&!x&&m(w);C=w,R||x||O?u(_)?C=_:d(_)?C=s(_):x?(I=!1,C=i(w,!0)):O?(I=!1,C=o(w,!0)):C=[]:h(w)||c(w)?(C=_,c(_)?C=b(_):f(_)&&!p(_)||(C=a(w))):I=!1}I&&(S.set(w,C),y(C,w,v,E,S),S.delete(w)),r(e,n,C)}}},function(e,t,n){var r=n(40),i=n(54);e.exports=function(e){return r(e,i(e))}},function(e,t,n){"use strict";const r=n(149),i=n(260),o=n(261),s=n(266),a=n(1)("normalizeConstraintInput"),c={"320x240":{width:320,height:240},"320x180":{width:320,height:180},"640x480":{width:640,height:480},"640x360":{width:640,height:360},"1280x720":{width:1280,height:720},"1280x960":{width:1280,height:960},"1920x1080":{width:1920,height:1080}},u=[1,7,15,30];function d(e){return e._inject&&e._inject.logging||a}function l(e,t,n,r,i){if(void 0===t)return;const o=n(t);return o||i.warn(`Invalid ${e} passed to the Publisher. Got: ${t}, expecting one of ${r}`),o}function p(e,t){const n=d(t),r=(()=>{const n=t["publish"+o(e)];return void 0===n||Boolean(n)})();let i=(()=>{const r=t[e+"Source"];return void 0===r||null!==r&&!1!==r&&("object"==typeof r?!t[`isCustom${o(e)}Track`]&&("string"!=typeof r.deviceId?(n.warn(`Invalid ${e}Source passed to Publisher. Expected either a device ID or device.`),!0):r.deviceId):"string"!=typeof r?(n.warn(`Ignoring invalid ${e}Source parameter`),!0):r)})();return"audio"===e&&t.isScreenSharing&&!s&&!1!==i&&(t.audioSource&&d(t).warn("Invalid audioSource passed to Publisher - when using screen sharing no audioSource may be used"),i=!1),{source:i,publish:r}}function f(e,t){return"Chrome"===e.name&&-1!==e.userAgent.indexOf("Mac OS X")&&1===t?2:t}const h=["user","environment","left","right"],m=(e,t)=>{if(void 0===e||h.indexOf(e)>=0)return e;d(t).warn("Invalid facingMode passed to Publisher. Expected one of: "+h.join(", "))};e.exports=function(e){const t=d(e),n=e.env||{},o=e.isScreenSharing,s=e.isCustomAudioTrack,a=e.isCustomVideoTrack;return o&&!i&&r(e.usingOptionalMandatoryStyle,"Screensharing only uses optional-mandatory constraints right now"),["echoCancellation","autoGainControl","noiseSuppression"].forEach(t=>{!1!==e[t]&&Object.assign(e,{[t]:!0})}),{isScreenSharing:o,isCustomAudioTrack:s,isCustomVideoTrack:a,audio:p("audio",e),video:p("video",e),usingOptionalMandatoryStyle:e.usingOptionalMandatoryStyle,enableRenegotiation:e.enableRenegotiation,enableStereo:e.enableStereo,noiseSuppression:e.noiseSuppression,autoGainControl:e.autoGainControl,echoCancellation:e.echoCancellation,disableAudioProcessing:e.disableAudioProcessing,videoDimensions:l("resolution",e.resolution,e=>c[e],`"${Object.keys(c).join('", "')}"`,t),frameRate:f(n,l("frameRate",e.frameRate,e=>-1!==u.indexOf(e)?e:void 0,u.join(","),t)),maxResolution:function(){if(void 0===e.maxResolution)return o?{width:1920,height:1920}:void 0;const n={width:e.maxResolution.width,height:e.maxResolution.height};return Object.keys(n).forEach(e=>{const r=n[e];("number"!=typeof r||r>1920)&&(t.warn(`Invalid maxResolution passed to the Publisher. maxResolution.${e} must be less than or equal to 1920`),n[e]=1920)}),n}(),facingMode:m(e.facingMode,e)}}},function(e,t,n){"use strict";
|
|
24
24
|
/*
|
|
25
25
|
object-assign
|
|
26
26
|
(c) Sindre Sorhus
|
|
27
27
|
@license MIT
|
|
28
|
-
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function s(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,c=s(e),u=1;u<arguments.length;u++){for(var d in n=Object(arguments[u]))o.call(n,d)&&(c[d]=n[d]);if(r){a=r(n);for(var l=0;l<a.length;l++)i.call(n,a[l])&&(c[a[l]]=n[a[l]])}}return c}},function(e,t,n){(function(e,r){var o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},i=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(c(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,o=r.length,s=String(e).replace(i,(function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),a=r[n];n<o;a=r[++n])b(a)||!E(a)?s+=" "+a:s+=" "+c(a);return s},t.deprecate=function(n,r){if(void 0!==e&&!0===e.noDeprecation)return n;if(void 0===e)return function(){return t.deprecate(n,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(e.throwDeprecation)throw new Error(r);e.traceDeprecation?console.trace(r):console.error(r),o=!0}return n.apply(this,arguments)}};var s,a={};function c(e,n){var r={seen:[],stylize:d};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&t._extend(r,n),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),l(r,e,r.depth)}function u(e,t){var n=c.styles[t];return n?"["+c.colors[n][0]+"m"+e+"["+c.colors[n][1]+"m":e}function d(e,t){return e}function l(e,n,r){if(e.customInspect&&n&&w(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return v(o)||(o=l(e,o,r)),o}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(v(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(g(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(b(t))return e.stylize("null","null")}(e,n);if(i)return i;var s=Object.keys(n),a=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(n)),C(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(n);if(0===s.length){if(w(n)){var c=n.name?": "+n.name:"";return e.stylize("[Function"+c+"]","special")}if(S(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(T(n))return e.stylize(Date.prototype.toString.call(n),"date");if(C(n))return p(n)}var u,d="",E=!1,R=["{","}"];(h(n)&&(E=!0,R=["[","]"]),w(n))&&(d=" [Function"+(n.name?": "+n.name:"")+"]");return S(n)&&(d=" "+RegExp.prototype.toString.call(n)),T(n)&&(d=" "+Date.prototype.toUTCString.call(n)),C(n)&&(d=" "+p(n)),0!==s.length||E&&0!=n.length?r<0?S(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=E?function(e,t,n,r,o){for(var i=[],s=0,a=t.length;s<a;++s)O(t,String(s))?i.push(f(e,t,n,r,String(s),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(f(e,t,n,r,o,!0))})),i}(e,n,r,a,s):s.map((function(t){return f(e,n,r,a,t,E)})),e.seen.pop(),function(e,t,n){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(u,d,R)):R[0]+d+R[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,o,i){var s,a,c;if((c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),O(r,o)||(s="["+o+"]"),a||(e.seen.indexOf(c.value)<0?(a=b(n)?l(e,c.value,null):l(e,c.value,n-1)).indexOf("\n")>-1&&(a=i?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),y(s)){if(i&&o.match(/^\d+$/))return a;(s=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function h(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function b(e){return null===e}function g(e){return"number"==typeof e}function v(e){return"string"==typeof e}function y(e){return void 0===e}function S(e){return E(e)&&"[object RegExp]"===R(e)}function E(e){return"object"==typeof e&&null!==e}function T(e){return E(e)&&"[object Date]"===R(e)}function C(e){return E(e)&&("[object Error]"===R(e)||e instanceof Error)}function w(e){return"function"==typeof e}function R(e){return Object.prototype.toString.call(e)}function I(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(y(s)&&(s=e.env.NODE_DEBUG||""),n=n.toUpperCase(),!a[n])if(new RegExp("\\b"+n+"\\b","i").test(s)){var r=e.pid;a[n]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",n,r,e)}}else a[n]=function(){};return a[n]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=m,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=S,t.isObject=E,t.isDate=T,t.isError=C,t.isFunction=w,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(567);var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(){var e=new Date,t=[I(e.getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":");return[e.getDate(),_[e.getMonth()],t].join(" ")}function O(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",x(),t.format.apply(t,arguments))},t.inherits=n(568),t._extend=function(e,t){if(!t||!E(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var N="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function k(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(N&&e[N]){var t;if("function"!=typeof(t=e[N]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,N,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,o=new r((function(e,r){t=e,n=r})),i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);i.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,i)}catch(e){n(e)}return o}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),N&&Object.defineProperty(t,N,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=N,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var o=n.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,s=function(){return o.apply(i,arguments)};t.apply(this,n).then((function(t){e.nextTick(s,null,t)}),(function(t){e.nextTick(k,t,s)}))}return Object.setPrototypeOf(n,Object.getPrototypeOf(t)),Object.defineProperties(n,o(t)),n}}).call(this,n(43),n(0))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r=n(570),o=n(262),i=n(263),s=n(59);e.exports=function(e){return function(t){t=s(t);var n=o(t)?i(t):void 0,a=n?n[0]:t.charAt(0),c=n?r(n,1).join(""):t.slice(1);return a[e]()+c}}},function(e,t,n){var r=n(261);e.exports=function(e,t,n){var o=e.length;return n=void 0===n?o:n,!t&&n>=o?e:r(e,t,n)}},function(e,t){e.exports=function(e){return e.split("")}},function(e,t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",o="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",c="(?:"+r+"|"+o+")"+"?",u="[\\ufe0e\\ufe0f]?"+c+("(?:\\u200d(?:"+[i,s,a].join("|")+")[\\ufe0e\\ufe0f]?"+c+")*"),d="(?:"+[i+r+"?",r,s,a,n].join("|")+")",l=RegExp(o+"(?="+o+")|"+d+u,"g");e.exports=function(e){return e.match(l)||[]}},function(e,t,n){"use strict";e.exports=["screen","window","tab","browser","application"]},function(e,t,n){"use strict";const r=n(1),o=n(34)(),i=n(50),s=n(119),a=n(576),c=n(579),u=o.onlyLocal(),d=r("setLogLevel"),l=i(()=>{d.info("%c\n ██████╗ ██████╗ ███████╗███╗ ██╗████████╗ ██████╗ ██╗ ██╗\n██╔═══██╗██╔══██╗██╔════╝████╗ ██║╚══██╔══╝██╔═══██╗██║ ██╔╝\n██║ ██║██████╔╝█████╗ ██╔██╗ ██║ ██║ ██║ ██║█████╔╝\n██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║ ██║ ██║██╔═██╗\n╚██████╔╝██║ ███████╗██║ ╚████║ ██║ ╚██████╔╝██║ ██╗\n ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝",'font-family: "Fire Code", Courier, "Courier New", Consolas, "DejaVu Sans Mono"'),d.info("OpenTok JS SDK "+u.version),d.info(`Release notes: ${u.websiteUrl}/opentok/webrtc/docs/js/release-notes.html`),d.info(`Known issues: ${u.websiteUrl}/opentok/webrtc/docs/js/release-notes.htmll#knownIssues`)});function p(e){if(void 0===e||!a(s,{priority:e})&&0!==e){const t=c(s,(e,t)=>`OT.${t.toUpperCase()} = ${e.priority}`).join(", ");d.error("level must be one of: OT.NONE = 0, "+t),d.warn("Using OT.WARN instead"),e=s.warn.priority}r.setLogLevel(e),e>=s.debug.priority&&l();return d.info("OpenTok JS SDK now uses the debug library. More info at https://www.npmjs.com/package/debug#browser-support"),d.info("Changed log level to: "+e),e}p(u.debug?s.debug.priority:s.warn.priority),e.exports=p},function(e,t,n){var r=n(96);e.exports=function(e,t){var n;if("function"!=typeof t)throw new TypeError("Expected a function");return e=r(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}},function(e,t,n){var r=n(232),o=n(35),i=n(577),s=n(10),a=n(122);e.exports=function(e,t,n){var c=s(e)?r:i;return n&&a(e,t,n)&&(t=void 0),c(e,o(t,3))}},function(e,t,n){var r=n(266);e.exports=function(e,t){var n;return r(e,(function(e,r,o){return!(n=t(e,r,o))})),!!n}},function(e,t,n){var r=n(25);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&!1!==o(a[s],s,a););return n}}},function(e,t,n){var r=n(33),o=n(35),i=n(580),s=n(10);e.exports=function(e,t){return(s(e)?r:i)(e,o(t,3))}},function(e,t,n){var r=n(266),o=n(25);e.exports=function(e,t){var n=-1,i=o(e)?Array(e.length):[];return r(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}},function(e,t,n){"use strict";e.exports=function(e){return"http:"!==e.substr(0,5)&&"https:"!==e.substr(0,6)&&"data:image/png;base64,"!==e.substr(0,22)?"data:image/png;base64,"+e:e}},function(e,t,n){"use strict";const r=n(56),o=n(1)("Style");e.exports=function(e,t){const n=this,i={},s={buttonDisplayMode:["auto","mini","mini-auto","off","on"],nameDisplayMode:["auto","off","on"],audioLevelDisplayMode:["auto","off","on"],showSettingsButton:[!0,!1],showSpeakerButton:null,showMicButton:[!0,!1],backgroundImageURI:null,showControlBar:[!0,!1],showArchiveStatus:[!0,!1],archiveStatusDisplayMode:["auto","off","on"],videoDisabledDisplayMode:["auto","off","on"],audioBlockedDisplayMode:["auto","off","on"]};n.getAll=function(){return r(i)},n.get=function(e){return e?i[e]:n.getAll()},n.setAll=function(e,t){return Object.keys(e).forEach(r=>{n.set(r,e[r],t)}),n},n.set=function(e,r,a){let c;o.debug("setStyle: "+e.toString());const u=function(e){switch(e){case"true":return!0;case"false":return!1;default:return e}}(r);return function(e,t){const n=s[e];return void 0!==n&&(null===n||-1!==n.indexOf(t))}(e,u)?(c=i[e],u!==c&&(i[e]=u,a||t(e,r,c)),n):(o.warn(`Style.set::Invalid style property passed ${e} : ${u}`),n)},e&&n.setAll(e,!0)}},function(e,t,n){"use strict";const r=n(56);e.exports=function(e){const t=r(e);if(t.backgroundImageURI){const e=t.backgroundImageURI.split(":")[0];t.backgroundImageURI=-1!==["http","https","data"].indexOf(e)?e:"other"}return t}},function(e,t,n){"use strict";const r=n(2),o=n(269);e.exports=()=>Boolean("Node"!==r.name&&!r.isIosWebView&&(!!o()||(void 0!==typeof window?window:global).navigator.mediaDevices&&(void 0!==typeof window?window:global).navigator.mediaDevices.getUserMedia||(void 0!==typeof window?window:global).navigator.webkitGetUserMedia||(void 0!==typeof window?window:global).navigator.mozGetUserMedia))},function(e,t,n){"use strict";const r=n(2);e.exports=()=>"Node"!==r.name&&(!("function"!=typeof(void 0!==typeof window?window:global).webkitRTCPeerConnection||!(void 0!==typeof window?window:global).webkitRTCPeerConnection.prototype.addStream)||("function"==typeof(void 0!==typeof window?window:global).RTCPeerConnection||"function"==typeof(void 0!==typeof window?window:global).mozRTCPeerConnection&&r.version>20))},function(e,t,n){"use strict";e.exports=void 0!==(void 0!==typeof window?window:global).WebSocket},function(e,t){e.exports='<div id="tb_alert"><div id="section-normal-install" class="OT_alert"><div class="OT_alert-exclamation">!</div><button class="OT_alert-close-button" role="OT_close">×</button><div class="OT_alert-header" data-text="Incompatible Browser">Incompatible Browser</div><div class="OT_alert-body">The video component of this application requires <a target="_blank" href="https://www.google.com/chrome/">Google Chrome</a>, <a target="_blank" href="http://www.mozilla.org/firefox">Firefox</a>, <a target="_blank" href="https://www.microsoft.com/en-us/edge">Edge</a>, or <a target="_blank" href="https://www.apple.com/safari/">Safari</a>.</div></div><div id="section-upgrade-install" class="OT_alert"><div class="OT_alert-exclamation">!</div><button class="OT_alert-close-button" role="OT_close">×</button><div class="OT_alert-header" data-text="Incompatible Browser">Incompatible Browser</div><div class="OT_alert-body">The video component of this application requires a newer version of <a target="_blank" href="https://www.google.com/chrome/">Google Chrome</a>, <a target="_blank" href="http://www.mozilla.org/firefox">Firefox</a>, <a target="_blank" href="https://www.microsoft.com/en-us/edge">Edge</a>, or <a target="_blank" href="https://www.apple.com/safari/">Safari</a>.</div><div class="continue-text"><a href="#" role="OT_close">Continue at my own risk.</a></div></div><div id="section-supported-mobile-browser" class="OT_alert"><div class="OT_alert-exclamation">!</div><button class="OT_alert-close-button" role="OT_close">×</button><div class="OT_alert-header" data-text="Incompatible Browser">Incompatible Browser</div><div class="OT_alert-body">The video component of this application requires a newer version of <a target="_blank" href="https://www.google.com.au/chrome/browser/mobile/">Google Chrome</a>.</div><div class="continue-text"><a href="#" role="OT_close">Continue at my own risk.</a></div></div><div id="section-mobile-browser" class="OT_alert"><div class="OT_alert-exclamation">!</div><button class="OT_alert-close-button" role="OT_close">×</button><div class="OT_alert-header" data-text="Incompatible Browser">Incompatible Browser</div><div class="OT_alert-body">The video component of this application is not supported on your mobile device\'s browser at this time.</div></div></div>'},function(e,t,n){"use strict";var r=n(3)(n(60));const o=n(42);e.exports=function(e){function t(t,n){var r;let o=(void 0===n?{}:n).destroyOnClose,i=void 0===o||o;(r=e.call(this)||this).modalDiv=document.createElement("div"),r.modalDiv.classList.add("OT_ModalDialog"),r.modalDiv.innerHTML=t;const s=r.modalDiv.querySelectorAll("[role=OT_close]");return[].forEach.call(s,e=>e.addEventListener("click",e=>{e.preventDefault(),r.close()})),r.close(),document.body.appendChild(r.modalDiv),i&&r.on("closed",()=>r.destroy()),r}(0,r.default)(t,e);var n=t.prototype;return n.open=function(){this.modalDiv.style.display="block",this.emit("opened")},n.close=function(){this.modalDiv.style.display="none",this.emit("closed")},n.destroy=function(){this.modalDiv.innerHTML="",this.modalDiv.parentNode.removeChild(this.modalDiv),this.emit("destroyed")},n.el=function(e){return this.modalDiv.querySelector(e)},t}(o)},function(e,t,n){"use strict";const r=n(27);e.exports=function(e){void 0===e&&(e={});const t=e.env||n(2),o=e.analytics||new r;o.logEvent({action:"UserAgentParsing",variation:"Attempt",payload:{userAgent:t.userAgent}}),o.logEvent({action:"UserAgentParsing",variation:t.error?"Failure":"Success",payload:{userAgent:t.userAgent}})}},function(e,t,n){var r=n(591),o=n(270),i=n(592),s=n(593);function a(t){var n="function"==typeof Map?new Map:void 0;return e.exports=a=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return s(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},a(t)}e.exports=a},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}},function(e,t,n){var r=n(270);function o(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function i(t,n,s){return o()?e.exports=i=Reflect.construct:e.exports=i=function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i},i.apply(null,arguments)}e.exports=i},function(e,t,n){"use strict";(function(t){e.exports=(e,n)=>(n=n||(()=>{}),e.then(e=>new t(e=>{e(n())}).then(()=>e),e=>new t(e=>{e(n())}).then(()=>{throw e})))}).call(this,n(0))},function(e,t,n){var r=n(58),o=n(596),i=n(597),s=n(47);e.exports=function(e,t){return t=r(t,e),null==(e=i(e,t))||delete e[s(o(t))]}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){var r=n(98),o=n(261);e.exports=function(e,t){return t.length<2?e:r(e,o(t,0,-1))}},function(e,t,n){var r=n(135);e.exports=function(e){return r(e)?void 0:e}},function(e,t,n){var r=n(35),o=n(25),i=n(30);e.exports=function(e){return function(t,n,s){var a=Object(t);if(!o(t)){var c=r(n,3);t=i(t),n=function(e){return c(a[e],e,a)}}var u=e(t,n,s);return u>-1?a[c?t[u]:u]:void 0}}},function(e,t,n){var r=n(92),o=n(93),i=n(128),s=n(94),a=n(601),c=n(97);e.exports=function(e,t,n){var u=-1,d=o,l=e.length,p=!0,f=[],h=f;if(n)p=!1,d=i;else if(l>=200){var m=t?null:a(e);if(m)return c(m);p=!1,d=s,h=new r}else h=t?[]:f;e:for(;++u<l;){var b=e[u],g=t?t(b):b;if(b=n||0!==b?b:0,p&&g==g){for(var v=h.length;v--;)if(h[v]===g)continue e;t&&h.push(g),f.push(b)}else d(h,g,n)||(h!==f&&h.push(g),f.push(b))}return f}},function(e,t,n){var r=n(186),o=n(224),i=n(97),s=r&&1/i(new r([,-0]))[1]==1/0?function(e){return new r(e)}:o;e.exports=s},function(e,t,n){"use strict";(function(t){var r=n(3),o=r(n(12)),i=r(n(13));const s=n(1)("hasValidPeerConnection");function a(e){return new t(t=>{e.addEventListener("signalingstatechange",()=>t(!0)),e.createOffer({offerToReceiveAudio:1}).then(t=>e.setLocalDescription(t)).then(()=>setTimeout(()=>{t(!1)},1e3))})}function c(){return(c=(0,i.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,n=new t({iceServers:[]}),e.next=8;break;case 4:return e.prev=4,e.t0=e.catch(0),s.error("Error occurred creating PeerConnection",e.t0),e.abrupt("return",!1);case 8:return e.prev=8,e.next=11,a(n);case 11:e.next=18;break;case 13:e.prev=13,e.t1=e.catch(8),s.error("Error occurred checking the validity of the PeerConnection",e.t1);try{n.close()}catch(e){}return e.abrupt("return",!1);case 18:e.prev=18,n.close(),e.next=26;break;case 22:return e.prev=22,e.t2=e.catch(18),s.error("Error occurred closing PeerConnection",e.t2),e.abrupt("return",!1);case 26:return e.abrupt("return",!0);case 27:case"end":return e.stop()}}),e,null,[[0,4],[8,13],[18,22]])})))).apply(this,arguments)}e.exports=function(e){return c.apply(this,arguments)}}).call(this,n(0))},function(e,t,n){var r=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(604),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t,n){(function(t){!function(n){"use strict";var r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag",u="object"==typeof e,d=n.regeneratorRuntime;if(d)u&&(e.exports=d);else{(d=n.regeneratorRuntime=u?e.exports:{}).wrap=b;var l={},p={};p[s]=function(){return this};var f=Object.getPrototypeOf,h=f&&f(f(_([])));h&&h!==r&&o.call(h,s)&&(p=h);var m=S.prototype=v.prototype=Object.create(p);y.prototype=m.constructor=S,S.constructor=y,S[c]=y.displayName="GeneratorFunction",d.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},d.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(m),e},d.awrap=function(e){return{__await:e}},E(T.prototype),T.prototype[a]=function(){return this},d.AsyncIterator=T,d.async=function(e,t,n,r){var o=new T(b(e,t,n,r));return d.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},E(m),m[c]="Generator",m[s]=function(){return this},m.toString=function(){return"[object Generator]"},d.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},d.values=_,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(R),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return s.type="throw",s.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=e,s.arg=t,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:_(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}}}function b(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,i=Object.create(o.prototype),s=new I(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return x()}for(n.method=o,n.arg=i;;){var s=n.delegate;if(s){var a=C(s,n);if(a){if(a===l)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=g(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,s),i}function g(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function v(){}function y(){}function S(){}function E(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function T(e){var n;this._invoke=function(r,i){function s(){return new t((function(n,s){!function n(r,i,s,a){var c=g(e[r],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&o.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,a)}),(function(e){n("throw",e,s,a)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,a)}))}a(c.arg)}(r,i,n,s)}))}return n=n?n.then(s,s):s()}}function C(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,C(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=g(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function _(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:x}}function x(){return{value:void 0,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const r=n(37),o=n(2),i=n(606),s=n(73),a=n(1)("createPeerConnection");e.exports=function(e){let n=e.window,c=e.config,u=e.constraints;a.debug("called");const d=r(c);d.iceServers=i(o,d.iceServers),s()&&(d.sdpSemantics="plan-b");const l=new n.RTCPeerConnection(d,u);return t.resolve(l)}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(7),o=n(271),i={Edge(e){let t=!1;return e.map(e=>{if(!e)return;const n=e.urls||e.url&&[e.url];if(!n)return;const i=n.filter(e=>0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!t?(t=!0,!0):0===e.indexOf("stun:"));return 0!==i.length?r(o(e,["url","urls"]),{urls:i}):void 0}).filter(e=>void 0!==e)},Safari:e=>e.map(e=>{if(void 0!==e.urls&&void 0===e.url)return e;const t=e.urls||e.url&&[e.url];return r(o(e,["url","urls"]),{urls:t})})};e.exports=function(e,t){let n=e.name;e.isEdge&&(n=e.isLegacyEdge?"Edge":"ChromiumEdge");const r=i[n];return r?r(t):t}},function(e,t,n){"use strict";const r=n(51),o=n(2),i={baseline:"42001f",constBaseline:"42e01f"},s=e=>{let t=e.sdp,n=e.from,r=e.to;return t.replace(new RegExp("^(a=fmtp:\\d+ .*profile-level-id=)"+n,"gmi"),"$1"+r)};e.exports={local:{offer:function(e,t){let n=void 0===e?{}:e,a=n.numSimulcastStreams,c=n.audioBitrate,u=n.priorityVideoCodec,d=void 0===u?"":u,l=n.codecFlags,p=void 0===l?{}:l,f=n.enableStereo,h=void 0!==f&&f,m=n.enableDtx,b=void 0!==m&&m,g=n.replaceBaselineProfile,v=void 0!==g&&g,y=r.filterExcessSSRCs(t);a>1&&(y=r.enableSimulcast(y,a)),c>0&&(y=r.setAudioBitrate(y,c)),y=r.modifyReceiveStereo(y,!1),y=r.modifySendStereo(y,Boolean(h)),y=r.modifyDtx(y,Boolean(b)),o.isLegacyEdge||Object.keys(p).filter(e=>!1===p[e]).forEach(e=>{y=r.removeVideoCodec(y,e)}),d&&!o.isLegacyEdge?y=r.reprioritizeVideoCodec(y,d,"top"):"h264"!==d&&(y=r.reprioritizeVideoCodec(y,"h264","bottom"));let S=y;return v&&(S=s({sdp:S,from:i.baseline,to:i.constBaseline})),{local:y,remote:S}},answer:function(e,t){let n=void 0===e?{}:e,o=n.audioBitrate,a=n.codecFlags,c=n.enableStereo,u=void 0!==c&&c,d=n.enableDtx,l=void 0!==d&&d,p=n.replaceBaselineProfile,f=void 0!==p&&p,h=t;o>0&&(h=r.setAudioBitrate(h,o)),h=r.modifyReceiveStereo(h,Boolean(u)),h=r.modifySendStereo(h,!1),h=r.modifyDtx(h,Boolean(l)),a&&Object.keys(a).filter(e=>!1===a[e]).forEach(e=>{h=r.removeVideoCodec(h,e)});let m=h;return f&&(m=s({sdp:m,from:i.baseline,to:i.constBaseline})),{local:h,remote:m}}},remote:{offer:(e,t)=>{let n=e.replaceBaselineProfile,r=void 0!==n&&n,o=t;if(-1===o.indexOf("a=rtcp-fb")){const e="a=rtcp-fb:* ccm fir\r\na=rtcp-fb:* nack ";o=o.replace(/^m=video(.*)$/gim,"m=video$1\r\n"+e)}return r&&(o=s({sdp:o,from:i.constBaseline,to:i.baseline})),{local:o}},answer:function(e,t){let n=void 0===e?{}:e,o=n.audioBitrate,a=n.replaceBaselineProfile,c=void 0!==a&&a,u=t;return o>0&&(u=r.setAudioBitrate(u,o)),c&&(u=s({sdp:u,from:i.constBaseline,to:i.baseline})),{local:u}}}}},function(e,t,n){var r=n(39),o=n(54),i=n(41),s=n(25),a=n(275),c=n(609),u=n(233),d=n(97),l=n(263),p=n(276),f=r?r.iterator:void 0;e.exports=function(e){if(!e)return[];if(s(e))return a(e)?l(e):o(e);if(f&&e[f])return c(e[f]());var t=i(e);return("[object Map]"==t?u:"[object Set]"==t?d:p)(e)}},function(e,t){e.exports=function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}},function(e,t,n){var r=n(33);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},function(e,t,n){"use strict";e.exports=(e,t)=>{let n=[],r=null;if("function"==typeof e.getReceivers){const t=e.getReceivers().find(e=>"audio"===e.track.kind);t&&(n=t.getSynchronizationSources())}else r=new Error("peerConnection does not support getReceivers function");t&&t(r,n)}},function(e,t,n){"use strict";(function(t){const r=n(613),o=function(e){this.pending=[],this._processBinding=this.maybeProcessPending.bind(this),e&&this.setPeerConnection(e)};o.prototype.setPeerConnection=function(e){if(this.pc)throw new Error("Peer connection already set");this.pc=e,this._forwardIceCandidate=r(this.pc,"addIceCandidate"),this.pc.addEventListener("signalingstatechange",this._processBinding),this.maybeProcessPending()},o.prototype.canAddCandidates=function(){return!!(this.pc&&"closed"!==this.pc.iceConnectionState&&this.pc.remoteDescription&&this.pc.remoteDescription.type&&this.pc.localDescription&&this.pc.localDescription.type)},o.prototype.addIceCandidate=function(e){if(this.canAddCandidates())return this._forwardIceCandidate(e);const n=this.pending;return new t((t,r)=>{n.push({iceCandidate:e,resolve:t,reject:r})})},o.prototype.maybeProcessPending=function(){this.canAddCandidates()&&this.process()},o.prototype.process=function(){for(;this.pending.length;){const e=this.pending.shift();this._forwardIceCandidate(e.iceCandidate).then(e.resolve).catch(e.reject)}},o.prototype.destroy=function(){this.pc&&this.pc.removeEventListener("signalingstatechange",this._processBinding),this._processBinding=null,this.pc=null},e.exports=o}).call(this,n(0))},function(e,t,n){"use strict";(function(t){e.exports=function(e,n){const r=e[n];return function(n){return new t((t,o)=>{const i=r.apply(e,[n,t,o]);i&&"function"==typeof i.then&&t(i)})}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(156),o=n(2),i=n(1)("offerProcessor"),s=n(51),a=n(615);e.exports=function(e,t,n,c,u,d,l,p,f,h,m,b){const g=(e,t)=>n=>{i.error(e),i.error(n),h&&h(e,n,t)},v=t=>{const n=s.hasSendStereo(d.sdp),o=s.hasSendDtx(d.sdp),i=s.getAudioBitrate(d.sdp),a=r(u,"local","answer",{enableStereo:n,enableDtx:o,audioBitrate:i,replaceBaselineProfile:b,codecFlags:l},t.sdp),p=new c({type:t.type,sdp:a.local}),h={type:t.type,sdp:a.remote};return e.setLocalDescription(p).then(()=>f(h)).catch(g("Error while setting LocalDescription","SetLocalDescription"))},y=new c({type:d.type,sdp:r(u,"remote","offer",{replaceBaselineProfile:b},d.sdp).local}),S=g("Error while setting RemoteDescription","SetRemoteDescription");return a(y,p,o,t,n).then(()=>(m(!0),y)).catch(e=>{if(m(!1),!s.hasMediaType(y.sdp,"audio"))throw new Error("Unsupported video without audio for fallback");i.debug("Couldn't set remote description",y,e,", trying without video");const t=new c({type:d.type,sdp:s.disableMediaType(y.sdp,"video")});return i.debug("offer without video",t.sdp),t}).then(t=>e.setRemoteDescription(t)).then(()=>e.createAnswer().then(v).catch(g("Error while setting createAnswer","CreateAnswer"))).catch(S)}},function(e,t,n){"use strict";(function(t){const r=n(73);e.exports=(e,n,o,i,s)=>{if(!i)return t.resolve(!0);const a={iceServers:[]};r()&&(a.sdpSemantics="plan-b");const c=new i(a),u=()=>{try{c.close()}catch(e){}};return c.setRemoteDescription(new s(e)).then(()=>{u()}).catch(e=>{throw u(),e})}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(62),o=n(617);e.exports=function(e){let t=[];const n={};let i={sentMessages:0,recvMessages:0};const s=function(e){const n=new o(e);return t.push(n),n.on("close",()=>{!function(e){t.filter(t=>e!==t)}(n)}),n};return n.add=function(t,n){return s(e.createDataChannel(t,n))},n.addMany=function(e){for(const t in e)e.hasOwnProperty(t)&&n.add(t,e[t])},n.get=function(e,n){return r(t,t=>t.equals(e,n))},n.getOrAdd=function(e,t){let r=n.get(e,t);return r||(r=n.add(e,t)),r},n.getQosData=function(){const e={sentMessages:0,recvMessages:0};return t.forEach(t=>{e.sentMessages+=t.getQosData().sentMessages,e.recvMessages+=t.getQosData().recvMessages}),e},n.sampleQos=function(){const e=n.getQosData(),t={sentMessages:e.sentMessages-i.sentMessages,recvMessages:e.recvMessages-i.recvMessages};return i=e,t},n.destroy=function(){t.forEach(e=>{e.close()}),t=[]},e.addEventListener("datachannel",e=>{s(e.channel)}),n}},function(e,t,n){"use strict";const r=n(6),o=n(1)("DataChannel"),i=function(e){this.data=e.data,this.source=e.source,this.lastEventId=e.lastEventId,this.origin=e.origin,this.timeStamp=e.timeStamp,this.type=e.type,this.ports=e.ports,this.path=e.path};e.exports=function(e){const t={},n=[],s={sentMessages:0,recvMessages:0},a=function(e){return n.push(e),t},c=function(n){return e.send(n),s.sentMessages++,t};return r(t,!0),t.label=e.label,t.id=e.id,t.reliable=e.reliable,t.negotiated=e.negotiated,t.ordered=e.ordered,t.protocol=e.protocol,t._channel=e,t.close=function(){e.close()},t.equals=function(e,n){if(t.label!==e)return!1;for(const e in n)if(n.hasOwnProperty(e)&&t[e]!==n[e])return!1;return!0},t.getQosData=function(){return s},t.send=a,e.addEventListener("open",(function(){t.send=c,function(){let e;for(;e=n.shift();)t.send(e)}()}),!1),e.addEventListener("close",(function(e){t.send=a,t.trigger("close",e)}),!1),e.addEventListener("error",(function(e){o.error(e)}),!1),e.addEventListener("message",(function(e){const n=new i(e);s.recvMessages++,t.trigger("message",n)}),!1),t}},function(e,t,n){"use strict";const r=n(7),o=n(156),i=n(1)("subscribeProcessor");e.exports=function(e){let t=e.peerConnection,n=e.NativeRTCSessionDescription,s=e.sdpTransforms,a=e.numSimulcastStreams,c=e.offerOverrides,u=e.offerConstraints,d=e.replaceBaselineProfile;const l=(e,t)=>n=>{i.error(e,n);const r=new Error(e);throw r.reason=n,r.prefix=t,r};return i.debug("subscribeProcessor: creating offer"),t.createOffer(u).then(e=>{i.debug("subscribeProcessor: offer created",e);const u=o(s,"local","offer",r({numSimulcastStreams:a,replaceBaselineProfile:d},c),e.sdp),p=new n({type:e.type,sdp:u.local}),f=new n({type:e.type,sdp:u.remote});return i.debug("subscribeProcessor: setting local description"),t.setLocalDescription(p).then(()=>f,l("Error while setting LocalDescription","SetLocalDescription"))},l("Error while creating Offer","CreateOffer")).then(e=>({sdp:e.sdp,type:e.type}))}},function(e,t,n){"use strict";var r=n(3),o=r(n(12)),i=r(n(13));const s=n(51),a=s.mediaDirections,c=a.RECVONLY,u=a.INACTIVE,d=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.createOffer();case 4:return r=e.sent,e.next=7,t.setLocalDescription(r);case 7:i=t.remoteDescription.sdp,a=s.changeMediaDirection(i,n),t.setRemoteDescription({type:t.remoteDescription.type,sdp:a});case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();e.exports={changeMediaDirectionToInactive:e=>d(e,u),changeMediaDirectionToRecvOnly:e=>d(e,c)}},function(e,t,n){"use strict";function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.__esModule=!0,t.parseStatsOldAPI=g,t.parseStatsNewAPI=v,t.default=function(e,t,n,r,o){if(l)return v(e,t,n,r,o);return g(e,t,n,r,o)};const i=n(2),s=n(5),a=n(1)("QoS"),c=n(51),u=n(279),d=n(621),l=n(102)(),p=n(158),f=["audioCodec","audioSentBytes","audioSentPackets","audioSentPacketsLost","audioRtt","videoCodec","videoHeight","videoHeightInput","videoSentBytes","videoFrameRateSent","videoSentPackets","videoRtt","videoSentPacketsLost","videoWidthInput","videoWidth"],h=["audioCodec","audioRecvBytes","audioRecvPackets","audioRecvPacketsLost","videoCodec","videoHeight","videoRecvBytes","videoRecvPackets","videoRecvPacketsLost","videoFrameRateReceived","videoWidth"],m=(e,t)=>a.debug(`Raw stats for peer conn ${e.id}:`,t),b=e=>{const t=e.portNumber||e.port;return`${e.ipAddress||e.address||e.ip}:${t}`};function g(e,t,n,r,o){const i=e=>(Number(e.stat("googFrameRateSent"))>0?(n.videoSentBytes=Number(e.stat("bytesSent")),n.videoSentPackets=Number(e.stat("packetsSent")),n.videoSentPacketsLost=Number(e.stat("packetsLost")),n.videoRtt=Number(e.stat("googRtt"))/1e3,n.videoFrameRate=Number(e.stat("googFrameRateInput")),n.videoWidth=Number(e.stat("googFrameWidthSent")),n.videoHeight=Number(e.stat("googFrameHeightSent")),n.videoFrameRateSent=Number(e.stat("googFrameRateSent")),n.videoWidthInput=Number(e.stat("googFrameWidthInput")),n.videoHeightInput=Number(e.stat("googFrameHeightInput")),n.videoCodec=e.stat("googCodecName")):Number(e.stat("googFrameRateReceived"))>0&&(n.videoRecvBytes=Number(e.stat("bytesReceived")),n.videoRecvPackets=Number(e.stat("packetsReceived")),n.videoRecvPacketsLost=Number(e.stat("packetsLost")),n.videoFrameRate=Number(e.stat("googFrameRateOutput")),n.videoFrameRateReceived=Number(e.stat("googFrameRateReceived")),n.videoFrameRateDecoded=Number(e.stat("googFrameRateDecoded")),n.videoWidth=Number(e.stat("googFrameWidthReceived")),n.videoHeight=Number(e.stat("googFrameHeightReceived")),n.videoCodec=e.stat("googCodecName")),null),s=e=>{Number(e.stat("audioInputLevel"))>0?(n.audioSentPackets=Number(e.stat("packetsSent")),n.audioSentPacketsLost=Number(e.stat("packetsLost")),n.audioSentBytes=Number(e.stat("bytesSent")),n.audioCodec=e.stat("googCodecName"),n.audioRtt=Number(e.stat("googRtt"))/1e3):Number(e.stat("audioOutputLevel"))>0&&(n.audioRecvPackets=Number(e.stat("packetsReceived")),n.audioRecvPacketsLost=Number(e.stat("packetsLost")),n.audioRecvBytes=Number(e.stat("bytesReceived")),n.audioCodec=e.stat("googCodecName"))};e.getStats(t=>{if(t.result){const r=t.result();m(e,r);const o=(e,t)=>r.filter(n=>n.id===t.stat(e))[0],a=e=>o("localCandidateId",e),c=e=>o("remoteCandidateId",e);for(let e=0;e<r.length;e++){const t=r[e];t.stat&&("true"===t.stat("googActiveConnection")&&(t.stat("googChannelId").indexOf("audio")>-1?(n.audioLocalAddress=t.stat("googLocalAddress"),n.audioRemoteAddress=t.stat("googRemoteAddress"),n.audioLocalCandidateType=t.stat("googLocalCandidateType"),n.audioRemoteCandidateType=t.stat("googRemoteCandidateType"),n.audioTransportType=t.stat("googTransportType"),n.audioLocalRelayProtocol=u(a(t).stat("priority")),n.audioRemoteRelayProtocol=u(c(t).stat("priority"))):t.stat("googChannelId").indexOf("video")>-1&&(n.videoLocalAddress=t.stat("googLocalAddress"),n.videoRemoteAddress=t.stat("googRemoteAddress"),n.videoLocalCandidateType=t.stat("googLocalCandidateType"),n.videoRemoteCandidateType=t.stat("googRemoteCandidateType"),n.videoTransportType=t.stat("googTransportType"),n.videoLocalRelayProtocol=u(a(t).stat("priority")),n.videoRemoteRelayProtocol=u(c(t).stat("priority")))),s(t),i(t))}"videoCodec"in n&&!n.videoLocalAddress&&["LocalAddress","RemoteAddress","LocalCandidateType","RemoteCandidateType","TransportType","LocalRelayProtocol","RemoteRelayProtocol"].forEach(e=>{n["video"+e]=n["audio"+e]})}o(null,n)})}function v(e,t,n,o,a){const u=e=>{const t={packetsSent:"videoSentPackets",packetsLost:"videoSentPacketsLost",bytesSent:"videoSentBytes",framesPerSecond:"videoFrameRate",framesSent:"videoFrameRateSent",framesReceived:"videoFramesReceived",frameWidth:"videoWidth",frameHeight:"videoHeight"},r=["videoSentPackets","videoSentBytes"];for(const o in t)if(o in e){const i=t[o];r.includes(i)&&Number.isSafeInteger(n[i])?n[i]+=e[o]:n[i]=e[o]}},l=(r,a)=>{if("outboundrtp"===a?u(r):"inboundrtp"===a&&(n.videoRecvPackets=r.packetsReceived,n.videoRecvPacketsLost=r.packetsLost,n.videoRecvBytes=r.bytesReceived),(i.isFirefox&&["outboundrtp","inboundrtp"].includes(a)||!o&&"inboundrtp"===a)&&(n.videoFrameRate=(()=>{if(!("videoSentBytes"in n?n.videoSentBytes>0:n.videoRecvBytes>0))return 0;let e=0;if(i.isFirefox&&i.version<96)e=Number(r.framerateMean);else{const o="outboundrtp"===a?"framesEncoded":"framesDecoded";n[o]=r[o],e=p({currentStatFrames:r[o],currentTimestamp:r.timestamp,prevStatFrames:t[o],prevTimestamp:t.timeStamp||Date.now()})}return e})()),void 0===n.videoCodec&&-1!==["Safari"].indexOf(s.env.name)&&void 0!==r.codecId){const t=("answer"===e.remoteDescription.type?e.remoteDescription:e.localDescription).sdp,o=r.codecId.lastIndexOf("_"),i=c.getCodecsAndCodecMap(t,"video");-1!==o&&void 0!==i&&(n.videoCodec=i.codecMap[r.codecId.substring(o+1)])}};e.getStats(null).then(t=>{let i,p,g,v,y,S,E,T;const C=[],w=r=>{const o=r.type.toLowerCase().replace(/[^a-z]/g,"");const a=r.id.toLowerCase();if(/(in|out)boundrtp$/.test(o)){const t=/rtp/.test(a),i=t&&/audio/.test(a),u=t&&/video/.test(a),d=i||"audio"===r.kind,p=u||"video"===r.kind;if(d?((t,r)=>{if("outboundrtp"===r?(n.audioSentPackets=t.packetsSent,n.audioSentPacketsLost=t.packetsLost,n.audioSentBytes=t.bytesSent):"inboundrtp"===r&&(n.audioRecvPackets=t.packetsReceived,n.audioRecvPacketsLost=t.packetsLost,n.audioRecvBytes=t.bytesReceived),void 0===n.audioCodec&&-1!==["Safari"].indexOf(s.env.name)&&void 0!==t.codecId){const r=("answer"===e.remoteDescription.type?e.remoteDescription:e.localDescription).sdp,o=t.codecId.lastIndexOf("_"),i=c.getCodecsAndCodecMap(r,"audio");-1!==o&&void 0!==i&&(n.audioCodec=i.codecMap[t.codecId.substring(o+1)])}})(r,o):p&&l(r,o),r.hasOwnProperty("roundTripTime")){const e=r.mediaType||r.kind;"video"===e?C.push(r.roundTripTime):"audio"===e&&(n.audioRtt=r.roundTripTime)}if("remoteinboundrtp"===o&&r.hasOwnProperty("packetsLost")){const e=r.kind+"SentPacketsLost";n[e]||(n[e]=0),n[e]+=r.packetsLost}}else if("transport"===o){const e=r.selectedCandidatePairId;e&&(v=d(e,t))}else"localcandidate"===o?(i=r.candidateType,g=b(r),S=r.protocol||r.transport):"remotecandidate"===o?(p=r.candidateType,y=b(r)):"track"===o&&0!==a.indexOf("video")?(E=r.frameWidth,T=r.frameHeight,u(r)):"mediasource"===o&&(r.hasOwnProperty("framesPerSecond")&&(n.videoFrameRate=r.framesPerSecond),r.hasOwnProperty("width")&&(n.videoWidthInput=r.width),r.hasOwnProperty("height")&&(n.videoHeightInput=r.height))};if("function"==typeof t[Symbol.iterator]){m(e,Array.from(t));for(var R,I=r(t);!(R=I()).done;){const e=R.value;w(Array.isArray(e)?e[1]:e)}}else{m(e,t);for(const e in t)t.hasOwnProperty(e)&&w(t[e])}if(e.currentRemoteDescription&&(n.useDtx=c.hasSendDtx(e.currentRemoteDescription.sdp)),o&&(n.videoRtt=(()=>{if(0===C.length)return null;const e=C.filter(e=>e>0),t=e.reduce((e,t)=>e+t,0);return e.length?t/e.length:0})()),(n.audioRecvBytes||n.audioSentBytes)&&(n.audioLocalCandidateType=i,n.audioLocalAddress=g,n.audioRemoteCandidateType=p,n.audioRemoteAddress=y,n.audioTransportType=S,n.audioLocalRelayProtocol=v,void 0===n.audioCodec)){const t=("answer"===e.remoteDescription.type?e.remoteDescription:e.localDescription).sdp,r=c.getCodecs(t,"audio");n.audioCodec=r[0]}if((n.videoRecvBytes||n.videoSentBytes)&&(n.videoLocalCandidateType=i,n.videoLocalAddress=g,n.videoRemoteCandidateType=p,n.videoRemoteAddress=y,n.videoTransportType=S,n.videoLocalRelayProtocol=v,void 0===n.videoCodec)){const t=("answer"===e.remoteDescription.type?e.remoteDescription:e.localDescription).sdp,r=c.getCodecs(t,"video");n.videoCodec=r[0]}!function(e,t){(t?f:h).forEach(t=>{e.hasOwnProperty(t)||(e[t]=null)})}(n,o),n.videoWidth=n.videoWidth||E,n.videoHeight=n.videoHeight||T,a(null,n)}).catch((function(e){a(e)}))}},function(e,t,n){"use strict";const r=n(279);e.exports=(e,t)=>{let n="";if(!e||!t)return n;const o=t.get(e);if(o){const e=o.localCandidateId;if(e){const o=t.get(e);if(o){const e=o.relayProtocol,t=o.priority;if(e){n="TURN/"+e.toUpperCase()}else n=r(t)}}}return n}},function(e,t,n){"use strict";var r=n(3);t.__esModule=!0,t.default=void 0;var o=r(n(18));let i=function(){function e(){(0,o.default)(this,"value",null),(0,o.default)(this,"changeCount",0)}return e.prototype.onValue=function(e){e&&e!==this.value&&(this.value&&(this.changeCount+=1),this.value=e)},e}();t.default=i},function(e,t,n){var r=n(9),o=n(624),i=n(229),s=Math.max,a=Math.min;e.exports=function(e,t,n){var c,u,d,l,p,f,h=0,m=!1,b=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=c,r=u;return c=u=void 0,h=t,l=e.apply(r,n)}function y(e){return h=e,p=setTimeout(E,t),m?v(e):l}function S(e){var n=e-f;return void 0===f||n>=t||n<0||b&&e-h>=d}function E(){var e=o();if(S(e))return T(e);p=setTimeout(E,function(e){var n=t-(e-f);return b?a(n,d-(e-h)):n}(e))}function T(e){return p=void 0,g&&c?v(e):(c=u=void 0,l)}function C(){var e=o(),n=S(e);if(c=arguments,u=this,f=e,n){if(void 0===p)return y(f);if(b)return clearTimeout(p),p=setTimeout(E,t),v(f)}return void 0===p&&(p=setTimeout(E,t)),l}return t=i(t)||0,r(n)&&(m=!!n.leading,d=(b="maxWait"in n)?s(i(n.maxWait)||0,t):d,g="trailing"in n?!!n.trailing:g),C.cancel=function(){void 0!==p&&clearTimeout(p),h=0,c=f=u=p=void 0},C.flush=function(){return void 0===p?l:T(o())},C}},function(e,t,n){var r=n(14);e.exports=function(){return r.Date.now()}},function(e,t,n){"use strict";const r=n(50);t.check=function(e){void 0===e&&(e={});const t=e.env||n(2);return"Chrome"===t.name&&t.userAgent.toLowerCase().indexOf("android")>-1&&t.version<65},t.once=r(()=>t.check())},function(e,t,n){"use strict";const r=n(36),o=n(5);e.exports=function(e){let t,n,i,s,a;const c=this;let u=e.archiving;const d=e.archivingStarted||"Archiving on",l=e.archivingEnded||"Archiving off";let p=!0;const f=function(e){s.nodeValue=e,t.setAttribute("title",e)},h=function(){a&&(clearTimeout(a),a=null),u?o.addClass(n,"OT_active"):o.removeClass(n,"OT_active"),o.removeClass(c.domElement,"OT_archiving-"+(u?"off":"on")),o.addClass(c.domElement,"OT_archiving-"+(u?"on":"off")),e.show&&u?(f(d),o.addClass(i,"OT_mode-on"),o.removeClass(i,"OT_mode-auto"),c.setDisplayMode("on"),a=setTimeout(()=>{o.addClass(i,"OT_mode-auto"),o.removeClass(i,"OT_mode-on")},5e3)):e.show&&!p?(o.addClass(i,"OT_mode-on"),o.removeClass(i,"OT_mode-auto"),c.setDisplayMode("on"),f(l),a=setTimeout(()=>{c.setDisplayMode("off")},5e3)):c.setDisplayMode("off")};r(this,{mode:u&&e.show?"on":"off",nodeName:"h1",htmlAttributes:{className:"OT_archiving OT_edge-bar-item OT_edge-bottom"},onCreate(){t=o.createElement("div",{className:"OT_archiving-light-box"},""),n=o.createElement("div",{className:"OT_archiving-light"},""),t.appendChild(n),i=o.createElement("div",{className:"OT_archiving-status OT_mode-on OT_edge-bar-item OT_edge-bottom"},""),s=document.createTextNode(""),i.appendChild(s),c.domElement.appendChild(t),c.domElement.appendChild(i),h()}}),this.setShowArchiveStatus=function(t){e.show=t,c.domElement&&h.call(c)},this.setArchiving=function(e){u=e,p=!1,c.domElement&&h.call(c)}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.global||(void 0!==typeof window?window:global);return()=>t.navigator&&t.navigator.mediaDevices}},function(e,t,n){"use strict";(function(t){const r=n(7),o=n(9),i=n(106),s=n(629),a=n(27),c=n(22),u=n(6);e.exports=function(e){void 0===e&&(e={});const d=e.env||n(2),l=e.Errors||n(4),p=e.otError||n(11)(),f=e.logging||n(1)("getUserMedia"),h=e.screenSharing||n(162)(),m=e.getDisplayMediaExtensionHelper||n(287),b=e.customGetUserMedia,g=e.global||(void 0!==typeof window?window:global),v=e.analytics||new a,y=g.navigator,S=g.location,E=()=>{return b||(y.mediaDevices?(e=y.mediaDevices).getUserMedia.bind(e):void 0);var e},T=function(){const e=E();return e?e(...arguments):t.reject(new Error("Cannot find getUserMedia"))},C=()=>{return b||(y.mediaDevices&&y.getDisplayMedia?y.getDisplayMedia.bind(y):y.mediaDevices&&y.mediaDevices.getDisplayMedia?(e=y.mediaDevices).getDisplayMedia.bind(e):void 0);var e},w=function(){const e=C();return e?e(...arguments):t.reject(new Error("Cannot find getDisplayMedia"))},R=(()=>{const e={name:l.USER_MEDIA_ACCESS_DENIED,message:"End-user denied permission to hardware devices"},t={name:l.NOT_SUPPORTED,message:"A constraint specified is not supported by the browser."},n={name:l.CONSTRAINTS_NOT_SATISFIED,message:"It's not possible to satisfy one or more constraints passed into the getUserMedia function"},o={name:l.NO_DEVICES_FOUND,message:"No voice or video input devices are available on this machine."},i={name:l.HARDWARE_UNAVAILABLE,message:"The selected voice or video devices are unavailable. Verify that the chosen devices are not in use by another application."},a={name:l.UNABLE_TO_CAPTURE_SCREEN,message:"Unable to capture screen. Unknown error occurred"},c={AbortError:{name:l.UNABLE_TO_CAPTURE_MEDIA,message:"Unable to capture media. Unknown error occurred"},NotAllowedError:e,NotFoundError:o,NotReadableError:i,OverconstrainedError:n,SecurityError:r({},e,{message:"End-user denied permission to hardware devices or user media support may be disabled on this page"}),TypeError:n,PermissionDeniedError:e,PermissionDismissedError:e,NotSupportedError:t,ConstraintNotSatisfiedError:n,MandatoryUnsatisfiedError:n,OverConstrainedError:n,DevicesNotFoundError:o,NoDevicesFoundError:o,HardwareUnavailableError:i,SourceUnavailableError:i,TrackStartError:i,ScreenCaptureError:a,TabCaptureError:a};return s({objectToTrack:c,keys:["PermissionDeniedError","PermissionDismissedError","NotSupportedError","ConstraintNotSatisfiedError","MandatoryUnsatisfiedError","OverConstrainedError","DevicesNotFoundError","NoDevicesFoundError","HardwareUnavailableError","SourceUnavailableError","TrackStartError","ScreenCaptureError","TabCaptureError"],onUsage(e){v.logEvent({action:"DeprecatedPropertyUsage:getUserMedia:errorMap",variation:"Event",payload:{key:e}})}}),c})(),I=(e,t)=>{let n=e;"AbortError"===n&&"string"==typeof t&&t.match(/(screen|tab).?capture/i)&&(n="ScreenCaptureError");const r=R[n];let o;return o=r?p(r.name,new Error(`${r.message} (getUserMedia error: ${e})`)):new Error("Unknown error while getting user media: "+e),o.originalMessage=t,o.originalName=e,o};return function(e,n){if(void 0===n&&(n=!1),f.debug("getUserMedia wrapper called with",e),function(e){if(!e||!o(e))return!0;for(const t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}(e))return f.error("Couldn't get UserMedia: All constraints were false"),u(t.reject(p(l.NO_VALID_CONSTRAINTS,new Error("Video and Audio was disabled, you need to enable at least one"))));const r=n&&m.isSupportedInThisBrowser?w:T,s=u(r(e).catch(e=>{const n=(e=>{if(o(e)&&e.name){let t=e.name,n=e.message;if("Cannot find getUserMedia"!==n&&"Cannot find getDisplayMedia"!==n||(t="Chrome"===d.name&&d.version>73&&"https:"!==g.location.protocol?"NotAllowedError":"NotSupportedError"),"Safari"===d.name&&"Error"===t){const n=Object.prototype.toString.call(e).match(/^\[object (\w+Error)\]$/);n&&(t=n[1])}const r=I(t,n);return r.constraintName=e.constraint||e.constraintName,r instanceof c||v.logEvent({action:"UnexpectedError:getUserMedia:parseErrorEvent",variation:"Event",payload:{name:r.name,message:r.message,originalMessage:r.originalMessage}}),r}if("string"==typeof e){const t=I(e);return v.logEvent({action:"CheckUnreachable:getUserMedia:parseErrorEvent",variation:"Event",payload:{info:"error is string",error:e}}),t}return v.logEvent({action:"CheckUnreachable:getUserMedia:parseErrorEvent",variation:"Event",payload:{info:"error was not string or object with name property",error:e}}),new Error("Unknown error type while getting media")})(e);if(n.name===l.UNABLE_TO_CAPTURE_SCREEN)return new t((e,t)=>{h.checkCapability(e=>{if("chrome"===e.extensionRequired){if(e.extensionRegistered&&!e.extensionInstalled){const e=p(l.SCREEN_SHARING_EXTENSION_NOT_INSTALLED,n);e.message="Screen sharing extension not installed see https://tokbox.com/developer/guides/screen-sharing/js/#chrome-extension",t(e)}else if(!e.extensionRegistered){const e=p(l.SCREEN_SHARING_EXTENSION_NOT_REGISTERED,n);e.message="Screen sharing extension not registered see https://tokbox.com/developer/guides/screen-sharing/js/#chrome-extension",t(e)}}else t(n)})});throw n}).then(e=>(f.debug("got stream:",{stream:e,tracks:e.getTracks(),trackLabels:e.getTracks().map(e=>e.label)}),e))),a=-1!==S.protocol.indexOf("https")?500:100;let b=!0;const y=()=>{b=!1};return s.then(y,y),i(a).then(()=>{if(!b)return;const e=()=>s.emit("accessDialogClosed");s.emit("accessDialogOpened"),s.then(e,e)}),s}}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=function(e){let t=void 0===e?{}:e,n=t.objectToTrack,r=t.keys,o=t.onUsage;if(!Array.isArray(r)&&void 0!==r)throw new Error("keys must be an array, or undefined");if("function"!=typeof o)throw new Error("onUsage must be a function");if(null==n)throw new Error("Expected objectToTrack to be a trackable object");Object.keys(n).forEach(e=>{if(void 0!==r&&-1===r.indexOf(e))return;let t=n[e];Object.defineProperty(n,e,{get:()=>(o(e),t),set(n){t=n,o(e,t)},enumerable:!0})})}},function(e,t,n){"use strict";const r=n(2),o=n(631).isCallbackBasedAPI;let i=n(265),s=null;const a=(e,t)=>{s.getSources(e,t)},c=(e,t)=>{s.getSources(e).then(e=>{t(void 0,e)},t)},u=(e,t)=>{(o?a:c)({types:[e]},(n,r)=>{if(n)return void t(n);const o=r[0];if(!o)return void t(new Error("Could not find Electron source for screensharing"));const i={audio:!1,video:{mandatory:{chromeMediaSource:e,chromeMediaSourceId:o.id}}};t(void 0,i)})};e.exports=function(e){void 0===e&&(e={});try{const t=()=>{let e=void 0!==typeof window?window:global;for(;"function"!=typeof e.require&&e.parent&&e.parent!==e;)e=e.parent;return e},n=()=>{const e=t();return(e.require?e.require("electron"):e.electron).desktopCapturer};s=e.desktopCapturer||(r.isElectron?n():null),i=e.isElectronScreenSharingSource||i}catch(e){}return{isSupportedInThisBrowser:null!==s,autoRegisters:!0,extensionRequired:!1,getConstraintsShowsPermissionUI:!1,sources:{screen:!0,application:!0,window:!0,browser:!0},register:()=>({isInstalled:e=>e(!0),getConstraints(e,t,n){i(e)?n(void 0,{audio:!0,video:!1}):u(e,n)}})}}},function(e,t,n){"use strict";const r=n(2).version<78,o=!r;e.exports={isCallbackBasedAPI:r,isPromiseBasedAPI:o}},function(e,t,n){"use strict";const r=n(2),o=n(160).default;e.exports={isSupportedInThisBrowser:!!r.isFirefox&&!o,autoRegisters:!0,extensionRequired:!1,extensionInstalled:!1,getConstraintsShowsPermissionUI:!1,sources:{screen:!0,application:!1,window:!0,browser:!1},register:()=>({isInstalled(e){e("object"==typeof OTScreenSharing)},getConstraints(e,t,n){t.video={mediaSource:e},t.browserWindow&&(t.video.browserWindow=t.browserWindow,delete t.browserWindow),void 0!==t.scrollWithPage&&(t.video.scrollWithPage=t.scrollWithPage,delete t.scrollWithPage),n(void 0,t)}})}},function(e,t,n){"use strict";var r=n(3),o=r(n(12)),i=r(n(13)),s=r(n(20));const a=n(634).normaliseOptions,c=n(288).isMediaStreamTrack,u=n(148),d=n(7),l=n(140),p=n(289).default,f=n(4),h=n(48),m=n(11),b=n(290).isValidVideoContentHint,g=n(6),v=n(149),y=n(2),S=n(264);e.exports=function(e){void 0===e&&(e={}),["deviceHelpers","getUserMediaHelper"].forEach(t=>{u(e[t],t+" dependency must be injected into processPubOptions")});const t=e.generateConstraintInfo||n(255),r=e.global||(void 0!==typeof window?window:global),E=e.logging||n(1)("processPubOptions"),T=e.navigator||r.navigator,C=e.screenSharing||n(162)(),w=e.env||y,R=n(635)({navigator:T||{}}),I=e,_=I.deviceHelpers,x=I.getUserMediaHelper;return(e,n,u)=>{const y=a(e,n,E),T=v(y.videoSource),I=c(y.audioSource),O=c(y.videoSource),N=!I&&null!==y.audioSource,k=!O&&null!==y.videoSource,Z=N||k,A=e=>"boolean"==typeof e,L=!T||I||S,V=l(y,{mirror:!T&&!O,publishAudio:!0,publishVideo:!0,showControls:!0,fitMode:T?"contain":"cover",audioFallbackEnabled:L,insertDefaultUI:!0,enableRenegotiation:!1,enableStereo:!1,enableDtx:!1,disableAudioProcessing:!1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0});if(void 0===V.videoContentHint||b(V.videoContentHint)||(E.warn(n+': Invalid content hint. Valid content hints are "text", "detail", "motion", or ""'),V.videoContentHint=""),V.name&&(V.name=String(V.name)),A(V.enableDtx)||(V.enableDtx=!1),A(V.enableStereo)||(V.enableStereo=!1),V.constraints)E.warn(n+": You have passed your own constraints not using ours");else{const e=t((0,s.default)({isScreenSharing:T,isCustomAudioTrack:I,isCustomVideoTrack:O},h(V,["audioSource","publishAudio","videoSource","publishVideo","resolution","maxResolution","frameRate","facingMode","enableRenegotiation","enableStereo","disableAudioProcessing","echoCancellation","noiseSuppression","autoGainControl"]),{env:w,usingOptionalMandatoryStyle:R(T)}));d(V,e)}const P={isScreenSharing:T,isCustomAudioTrack:I,isCustomVideoTrack:O,shouldAllowAudio:L,properties:V};return g(P),P.getUserMedia=(0,i.default)(o.default.mark((function e(){var t,s,a,c,d,l,h,b,g;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return P.emit("accessDialogOpened",...t)},s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return P.emit("accessDialogClosed",...t)},Z){e.next=7;break}return a=new r.MediaStream,I&&a.addTrack(y.audioSource),O&&a.addTrack(y.videoSource),e.abrupt("return",a);case 7:if(!T){e.next=15;break}return e.next=10,C.getConstraints({onAccessDialogOpened:t,onAccessDialogClosed:s,videoSource:y.videoSource,constraints:V.constraints});case 10:if(V.constraints=e.sent,!u()){e.next=13;break}throw m(f.CANCEL,new Error("getUserMedia request was aborted"));case 13:e.next=25;break;case 15:return e.next=17,_.shouldAskForDevices();case 17:if(c=e.sent,!u()){e.next=20;break}throw m(f.CANCEL,new Error("getUserMedia request was aborted"));case 20:E.debug(n+": shouldAskForDevices:",c),c.video||(E.warn(n+": Setting video constraint to false, there are no video sources"),V.constraints.video=!1),c.audio||(E.warn(n+": Setting audio constraint to false, there are no audio sources"),V.constraints.audio=!1),P.videoDevices=c.videoDevices,P.audioDevices=c.audioDevices;case 25:if(d=V.constraints,E.debug(n+": onConstraintsFound",d),!u()){e.next=29;break}throw m(f.CANCEL,new Error("getUserMedia request was aborted"));case 29:return l="Failed to acquire functional stream, this might be caused by the following iOS bug: https://bugs.webkit.org/show_bug.cgi?id=188088",h="Failed to acquire functional stream, this might be caused by the following iOS bug: https://bugs.webkit.org/show_bug.cgi?id=204106",b=e=>"NotReadableError"===e.originalName&&"Failed starting capture of a video track"===e.originalMessage,g=function(){var e=(0,i.default)(o.default.mark((function e(){var r,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=x(d,T)).on("accessDialogOpened",t),r.on("accessDialogClosed",s),e.prev=3,e.next=6,r;case 6:if(i=e.sent,!(w.isiOS&&V.publishVideo&&i.getVideoTracks().length&&"ended"===i.getVideoTracks()[0].readyState)){e.next=11;break}throw i.getTracks().forEach(e=>e.stop()),new Error(l);case 11:return e.abrupt("return",i);case 14:if(e.prev=14,e.t0=e.catch(3),!w.isiOS){e.next=34;break}if(!(b(e.t0)&&w.iOSVersion>=13&&w.iOSVersion<14)){e.next=32;break}return e.prev=18,a=x({audio:!0,video:!1},!1),e.next=22,a;case 22:e.sent.getTracks().forEach(e=>e.stop()),e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),E.debug(n+": error disposing audio track",e.t1);case 29:throw new Error(h);case 32:if(e.t0.name!==f.HARDWARE_UNAVAILABLE){e.next=34;break}throw new Error(l);case 34:throw e.t0;case 35:return e.prev=35,setTimeout(()=>{r.off("accessDialogOpened",t),r.off("accessDialogClosed",s)}),e.finish(35);case 38:case"end":return e.stop()}}),e,null,[[3,14,35,38],[18,26]])})));return function(){return e.apply(this,arguments)}}(),e.next=35,p(g,(e,t)=>!(![l,h].includes(e.message)||1!==t||u())&&1e3)();case 35:if(a=e.sent,!u()){e.next=39;break}throw a.getTracks().forEach(e=>{e.stop()}),m(f.CANCEL,new Error("getUserMedia request was aborted"));case 39:return I&&a.addTrack(y.audioSource),O&&a.addTrack(y.videoSource),e.abrupt("return",a);case 42:case"end":return e.stop()}}),e)}))),P}}},function(e,t,n){"use strict";const r=n(288).isMediaStreamTrack,o=n(37),i=n(2);t.normaliseOptions=(e,t,n)=>{const s=e&&"object"==typeof e?o(e):{};if(!1===s.audioSource&&(s.audioSource=null),!1===s.videoSource&&(s.videoSource=null),void 0===s.minVideoBitrate||"number"==typeof s.minVideoBitrate&&s.minVideoBitrate>0||(n.warn(t+": Invalid minVideoBitrate in publisher properties. minVideoBitrate must be a positive number"),delete s.minVideoBitrate),void 0===s.audioBitrate||s.audioBitrate>=6e3&&s.audioBitrate<=51e4||(n.warn(t+": Invalid audioBitrate in publisher properties. audioBitrate must be a number between 6000 and 510000 bits per second"),delete s.audioBitrate),"Firefox"===i.name&&i.version<49){const e="Firefox 48 and below";r(s.audioSource)&&(s.audioSource=null,n.warn(`${t}: Cannot use custom tracks with ${e}. Setting audioSource to null`)),r(s.videoSource)&&(s.videoSource=null,n.warn(`${t}: Cannot use custom tracks with ${e}. Setting videoSource to null`))}return s}},function(e,t,n){"use strict";const r=n(2),o=r.name,i=r.version,s=n(258);e.exports=function(e){let t=(void 0===e?{}:e).navigator,n=void 0===t?window.navigator:t;return function(e){return e&&!s||!(n.mediaDevices&&n.mediaDevices.getUserMedia)||"Chrome"===o&&i<61}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={}),["processPubOptions"].forEach(t=>{if(!e[t])throw new Error(t+" dependency must be injected into OT.getUserMedia")});const t=e.logging||n(1)("getUserMedia"),r=e.processPubOptions;return function(e){void 0===e&&(e={});return r(e,"OT.getUserMedia",()=>!1).getUserMedia().catch(e=>{throw t.error("OT.getUserMedia failed to getUserMedia: "+e),e})}}},function(e,t,n){"use strict";e.exports=function(e,t){const n=(t,n)=>()=>{throw new Error(`Cannot ${t} ${n}, ${e} is destroyed`)};Object.keys(t).forEach(e=>{"function"==typeof t[e]?t[e]=n("call",e):Object.defineProperty(t,e,{get:n("get",e),set:n("set",e)})})}},function(e,t,n){"use strict";e.exports=e=>{if("srcObject"in e)return;const t=window&&window.URL;"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(e,"srcObject",{get(){return this._srcObject},set(e){const n=this;if(this._srcObject=e,this.src&&t.revokeObjectURL(this.src),e)return this.src=t.createObjectURL(e),e.addEventListener("addtrack",()=>{n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)}),e.addEventListener("removetrack",()=>{n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)}),this._srcObject;this.src=""}})}},function(e,t,n){"use strict";e.exports=e=>{return!(!(t=e)||"function"!=typeof t.getBoundingClientRect)&&(e=>{const t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth,o=t.top<=n&&t.top+t.height>=0,i=t.left<=r&&t.left+t.width>=0;return o&&i})(e)&&(e=>{const t=e=>!(!e.style||"hidden"!==e.style.visibility)||!!e.parentNode&&t(e.parentNode);return null!==e.offsetParent&&!t(e)})(e);var t}},function(e,t,n){"use strict";const r=n(104),o=n(5),i={0:"rotate(0deg)",270:"rotate(90deg)",90:"rotate(-90deg)",180:"rotate(180deg)"};e.exports=function(e,t,n){let s=n;r(e,{isRotated:{get(){return this.orientation()&&(270===this.orientation().videoOrientation||90===this.orientation().videoOrientation)}},orientation:{get:()=>s,set(n){s=n;const r=i[n.videoOrientation]||i.ROTATED_NORMAL;switch(o.env.name){case"Chrome":case"Safari":t().style.webkitTransform=r;break;default:t().style.transform=r}e.trigger("orientationChanged",s)}},audioChannelType:{get(){return"mozAudioChannelType"in this.domElement?this.domElement.mozAudioChannelType:"unknown"},set(e){"mozAudioChannelType"in this.domElement&&(this.domElement.mozAudioChannelType=e)}}})}},function(e,t,n){"use strict";e.exports=function(){return function(e,t,n){const r=[];function o(o){setTimeout(()=>{if(r.length)if(function(e){return e.getTracks().every(e=>"ended"===e.readyState)}(e))s(),"function"==typeof t&&t();else{const e=o.target;i(e),"function"==typeof n&&n(e)}},100)}function i(e){e.removeEventListener&&e.removeEventListener("ended",o),e.onended===o&&(e.onended=null);const t=r.indexOf(e);t>=0&&r.splice(t,1)}function s(){r.slice().forEach(i)}function a(){e.getTracks().forEach(e=>{r.push(e),e.onended=o,e.addEventListener&&e.addEventListener("ended",o)})}return a(),{stop:s,refresh:()=>{s(),a()}}}}},function(e,t,n){var r=n(64),o=n(99),i=n(35);e.exports=function(e,t){var n={};return t=i(t,3),o(e,(function(e,o,i){r(n,o,t(e,o,i))})),n}},function(e,t,n){"use strict";e.exports=function(e,t){const n=setTimeout(()=>{e((e,n)=>{if(!e)for(let e=0;e<n.length;e+=1){const r=n[e];-1===r.id.indexOf("_send")||"ssrc"!==r.type||"audio"!==r.kind&&"audio"!==r.mediaType||0!==parseInt(r.bytesSent,10)||t()}})},3e3);return function(){clearTimeout(n)}}},function(e,t,n){"use strict";e.exports=function(e,t,n){void 0===n&&(n=!1);let r=null,o=0,i=null,s=n;const a=e=>"inbound-rtp"===e.type&&"audio"===(e.kind||e.mediaType),c=e=>e.id===i&&"track"===e.type&&"audio"===(e.kind||e.mediaType),u=setInterval(()=>{e((e,n)=>{if(e)return;const d=n.find(a)||{};i=d.trackId;const l=n.find(c);if(l){const e=l.audioLevel,n=l.totalSamplesReceived;if(void 0===e)return;((e,t)=>e===r&&t===o)(e,n)?(clearInterval(u),t("audioLevelStuck")):((e,t)=>!s&&0===e&&0===r&&t>o)(e,n)&&(clearInterval(u),t("audioLevelStuckAt0")),r=e,o=n}})},500);return n||setTimeout(()=>{s=!0},3e3),{stop:()=>{clearInterval(u)}}}},function(e,t,n){"use strict";(function(t){const r=new(n(27));e.exports=function(e){void 0===e&&(e={});const o=e.analytics||r,i=e.errors||n(4),s=e.ExceptionCodes||n(8),a=e.otError||n(11)(),c=e.sessionObjects||n(21),u=e.uuid||n(19);return function(e){void 0===e&&(e=()=>{});const n=u();function r(t){t?e(a(i.REPORT_ISSUE_FAILED,new Error("Error calling OT.reportIssue(). Check the client's network connection."),s.REPORT_ISSUE_ERROR)):e(null,n)}0===c.sessions.length()?o.logEvent({action:"ReportIssue",variation:"Event",payload:{reportIssueId:n}},null,r):t.all(c.sessions.map(e=>e.reportIssue({id:n}))).then(()=>r(),e=>r(e))}}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=e=>{let t=e.window,n=!1;try{const e=Object.defineProperty({},"passive",{get(){n=!0}});t.addEventListener("testPassive",null,e),t.removeEventListener("testPassive",null,e)}catch(e){}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(298),s=(r=i)&&r.__esModule?r:{default:r};var a=function(){},c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.internalIsCanceled=!1,this.listeners=[]}return o(e,[{key:"isCanceled",value:function(){return this.internalIsCanceled}},{key:"cancel",value:function(){this.internalIsCanceled||(this.internalIsCanceled=!0,this.listeners.forEach((function(e){return e()})),this.listeners=null)}},{key:"throwIfCanceled",value:function(){if(this.internalIsCanceled)throw new s.default("Operation has been canceled.")}},{key:"onCancel",value:function(e){var t=this;return this.internalIsCanceled?a:(this.listeners.push(e),function(){if(t.listeners){var n=t.listeners.indexOf(e);-1!==n&&t.listeners.splice(n,1)}})}},{key:"fork",value:function(){if(this.internalIsCanceled)return e.CANCELED;var t=new e;return this.onCancel((function(){return t.cancel()})),t}}]),e}();t.default=c,c.CANCELED=new c,c.CANCELED.internalIsCanceled=!0},function(e,t,n){"use strict";(function(t){const r=n(63),o=n(299).default,i=n(154);n(107)();e.exports=function(e,n){const s=r(e),a=new t(t=>{const n=()=>{(e.videoWidth()>2||e.videoHeight()>2)&&t(!0)};s.on("videoDimensionsChanged",n),n()});return o(i(a,n,()=>!1),()=>s.removeAll())}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const r=n(63),o=n(299).default,i=n(154);n(107)();e.exports=function(e,n){void 0===n&&(n=5e3);const s=r(e),a=new t(e=>{s.on("timeupdate",e),s.on("loadedmetadata",e)});return o(i(a,n,()=>!1),()=>s.removeAll())}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(1)("WidgetView:fixMini");e.exports=function(e){const t=e.clientWidth,n=e.clientHeight;e.classList.remove("OT_micro"),e.classList.remove("OT_mini"),(t<64||n<64)&&(e.classList.add("OT_micro"),r.debug("OT_micro class added",{clientWidth:t,clientHeight:n,microWidth:64,microHeight:64})),(t<128||n<128)&&(e.classList.add("OT_mini"),r.debug("OT_mini class added",{clientWidth:t,clientHeight:n,miniWidth:128,miniHeight:128}))}},function(e,t,n){"use strict";const r=n(19);e.exports=function(e,t){let n,o;if(e&&e.nodeName?(n=e,n.getAttribute("id")&&0!==n.getAttribute("id").length||n.setAttribute("id","OT_"+r()),o=n.getAttribute("id")):e&&(n=document.getElementById(e),n&&(o=e)),o||(o="OT_"+r().replace(/-/g,"_")),!n)return n=document.createElement("div"),n.id=o,n.setAttribute("id",o),n.style.backgroundColor="#000000",document.body.appendChild(n),n;const i=document.createElement("div");switch(i.id="OT_"+r(),t){case"append":return n.appendChild(i),i;case"before":return n.parentNode.insertBefore(i,n),i;case"after":return n.parentNode.insertBefore(i,n.nextSibling),i;case"replace":default:for(;n.firstChild;)n.removeChild(n.firstChild);return n}}},function(e,t,n){"use strict";e.exports=function(e,t){return void 0===t&&(t="px"),String(parseFloat(e,10))===String(e).trim()?`${String(e).trim()}${t}`:e}},function(e,t,n){"use strict";(function(t){const r=n(74);e.exports=function(e,n){let o=void 0===n?{}:n,i=o.frequency,s=void 0===i?60:i,a=o.timeout,c=void 0===a?2e3:a;return new t((t,n)=>{let o;const i=new r(()=>{(function(){try{return e()}catch(e){return!1}})()&&(clearTimeout(o),i.stop(),t())},s);o=setTimeout(()=>{i.stop(),n(new Error("TIMEOUT"))},c),i.start()})}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(11)(),o=n(4),i=n(8);e.exports=e=>"404"===String(e.code)?r(o.STREAM_NOT_FOUND,new Error("stream not found"),i.UNABLE_TO_SUBSCRIBE):"409"===String(e.code)&&"streamLimitExceeded"===e.message?r(o.STREAM_LIMIT_EXCEEDED,new Error("The limit for concurrent streams in the session has been reached"),i.STREAM_LIMIT_EXCEEDED):r(o.UNABLE_TO_SUBSCRIBE,new Error(`subscriberCreate failed with unexpected code ${e.code}: ${e.message}`),i.UNEXPECTED_SERVER_RESPONSE)},function(e,t,n){"use strict";const r=n(26),o=n(49),i=n(103),s=n(23)();e.exports=e=>{let t=e.subscriber,n=e.audioLevelSampler,a=0,c=0;const u=new i(()=>{const e=t.listenerCount(r.AUDIO_LEVEL_UPDATED);o()-c>1e4&&0===e?u.stop():(a=n.sample(),e>0&&t.dispatchEvent(new s.AudioLevelUpdatedEvent(a)))});return Object.defineProperty(t,"loudness",{get:()=>(u.start(),c=o(),a),set(){throw new TypeError("Cannot set readonly property loudness")},configurable:!0}),t.listenerCount(r.AUDIO_LEVEL_UPDATED)&&u.start(),t.on("audioLevelUpdated:added",()=>{u.start()}),t.once(r.SUBSCRIBER_DESTROYED,()=>{u.stop()}),{destroy(){n.destroy(),u.stop()}}}},function(e,t,n){"use strict";const r=n(254),o=n(145),i=n(657),s=n(301),a=n(302),c=n(159)(),u=n(658),d=n(1)("Subscriber");e.exports=function(e,t){void 0===t&&(t={});const n=t.hasGetSynchronizationSupport;if(e){if(i({hasGetSynchronizationSupport:n}))return new r(e.getSynchronizationSources);if(s())return new r(e.getStats);if(a()){let e;try{e=t.audioContext||c()}catch(e){d.warn("Failed to get AudioContext()",e)}if(u(e))return new o(e)}}}},function(e,t,n){"use strict";const r=n(2),o=()=>window.RTCRtpReceiver&&"getSynchronizationSources"in window.RTCRtpReceiver.prototype;e.exports=function(e){void 0===e&&(e={});return(e.hasGetSynchronizationSupport||o)()&&!r.isFirefox}},function(e,t,n){"use strict";e.exports=e=>(void 0!==typeof window?window:global).AudioContext&&e instanceof(void 0!==typeof window?window:global).AudioContext||(void 0!==typeof window?window:global).webkitAudioContext&&e instanceof(void 0!==typeof window?window:global).webkitAudioContext},function(e,t,n){"use strict";const r=n(36),o=n(5);e.exports=function(e){let t=!1,n=!1;const i=function(e){const r=["auto","on"].indexOf(this.getDisplayMode())>-1;o.removeClass(e,"OT_video-disabled OT_video-disabled-warning OT_active"),r&&(t?o.addClass(e,"OT_video-disabled"):n&&o.addClass(e,"OT_video-disabled-warning"),o.addClass(e,"OT_active"))}.bind(this);this.disableVideo=function(e){t=e,!0===e&&(n=!1),i(this.domElement)},this.setWarning=function(e){n=e,i(this.domElement)},r(this,{mode:e.mode||"auto",nodeName:"div",htmlAttributes:{className:"OT_video-disabled-indicator"}});const s=this.setDisplayMode.bind(this);this.setDisplayMode=function(e){s(e),i(this.domElement)}}},function(e,t,n){"use strict";const r=n(36),o=n(5);e.exports=function(e){let t=!1;const n=e=>{const n=["auto","on"].indexOf(this.getDisplayMode())>-1;o.removeClass(e,["OT_audio-blocked","OT_active"].join(" ")),n&&(t&&o.addClass(e,"OT_audio-blocked"),o.addClass(e,"OT_active"))};this.setAudioBlocked=e=>{t=e,n(this.domElement)},r(this,{mode:e.mode||"auto",nodeName:"div",htmlAttributes:{className:"OT_audio-blocked-indicator"}});const i=this.setDisplayMode.bind(this);this.setDisplayMode=e=>{i(e),n(this.domElement)}}},function(e,t,n){"use strict";const r=n(36),o=n(5);e.exports=function(e){let t=!1;const n=e=>{const n=["auto","on"].indexOf(this.getDisplayMode())>-1;o.removeClass(e,["OT_active"].join(" ")),n&&t&&o.addClass(e,"OT_active")};this.setVideoUnsupported=e=>{t=e,n(this.domElement)},r(this,{mode:e.mode||"auto",nodeName:"div",htmlAttributes:{className:"OT_video-unsupported"},htmlContent:'<div class="OT_video-unsupported-bar"></div><div class="OT_video-unsupported-img"></div><span class="OT_video-unsupported-text">Video format not supported</span>'});const i=this.setDisplayMode.bind(this);this.setDisplayMode=e=>{i(e),n(this.domElement)}}},function(e,t,n){"use strict";const r=n(48),o=n(7),i=n(62),s=n(75),a=n(158);e.exports=function(e,t){let n;void 0===t&&(t=5e3);let c=!1;const u={},d=()=>{c||e((e,a)=>{if(!c){if(!e){const e=function(e){return void 0===e&&(e=[]),i(e,e=>s.isVideoInboundRtpStat(e))}(a);e?o(u,r(e,["timestamp","framesDecoded"])):u.timestamp||o(u,{timestamp:Date.now(),framesDecoded:0})}n=setTimeout(d,t)}})};return d(),{getFrameRateFromStat:e=>a({currentStatFrames:e.framesDecoded,currentTimestamp:e.timestamp,prevStatFrames:u.framesDecoded,prevTimestamp:u.timestamp}),destroy(){c=!0,n&&(clearTimeout(n),n=null)}}}},function(e,t,n){"use strict";e.exports=e=>{let t=e.connectivityState,n=e.onWarning,r=e.onTimeout,o=e.warningMs,i=e.timeoutMs;const s=[],a=()=>{s.forEach(e=>clearTimeout(e))};t.observe({onEnterConnecting(){s.push(setTimeout(n,o),setTimeout(r,i))},onEnterConnected:a,onEnterDisconnected:a})}},function(e,t,n){"use strict";const r=n(305);e.exports=e=>{let t=e.onInvalidTransition;return new r({init:"disconnected",transitions:[{name:"beginConnect",from:"disconnected",to:"connecting"},{name:"connect",from:"connecting",to:"connected"},{name:"fail",from:["connecting","connected"],to:"disconnected"},{name:"cancel",from:["connecting","connected"],to:"disconnected"},{name:"disconnect",from:["connecting","connected"],to:"disconnected"}],methods:{onInvalidTransition:t}})}},function(e,t,n){"use strict";const r=n(74);e.exports=e=>{let t=e.connectivityState,n=e.logAttempt;const o=new r(n,.2,6);t.observe({onEnterConnecting(){o.start()},onEnterDisconnected(){o.stop()},onEnterConnected(){o.stop()}})}},function(e,t,n){var r=n(667),o=n(260),i=r((function(e,t,n){return e+(n?" ":"")+o(t)}));e.exports=i},function(e,t,n){var r=n(668),o=n(669),i=n(672),s=RegExp("['’]","g");e.exports=function(e){return function(t){return r(i(o(t).replace(s,"")),e,"")}}},function(e,t){e.exports=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}},function(e,t,n){var r=n(670),o=n(59),i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=o(e))&&e.replace(i,r).replace(s,"")}},function(e,t,n){var r=n(671)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t,n){var r=n(673),o=n(674),i=n(59),s=n(675);e.exports=function(e,t,n){return e=i(e),void 0===(t=n?void 0:t)?o(e)?s(e):r(e):e.match(t)||[]}},function(e,t){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(n)||[]}},function(e,t){var n=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return n.test(e)}},function(e,t){var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",r="["+n+"]",o="\\d+",i="[\\u2700-\\u27bf]",s="[a-z\\xdf-\\xf6\\xf8-\\xff]",a="[^\\ud800-\\udfff"+n+o+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",c="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",d="[A-Z\\xc0-\\xd6\\xd8-\\xde]",l="(?:"+s+"|"+a+")",p="(?:"+d+"|"+a+")",f="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",h="[\\ufe0e\\ufe0f]?"+f+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",c,u].join("|")+")[\\ufe0e\\ufe0f]?"+f+")*"),m="(?:"+[i,c,u].join("|")+")"+h,b=RegExp([d+"?"+s+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[r,d,"$"].join("|")+")",p+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[r,d+l,"$"].join("|")+")",d+"?"+l+"+(?:['’](?:d|ll|m|re|s|t|ve))?",d+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",o,m].join("|"),"g");e.exports=function(e){return e.match(b)||[]}},function(e,t,n){"use strict";e.exports=(e,t)=>{const n=e.getSenders().find(e=>"video"===e.track.kind),r=n.getParameters();r.encodings.forEach(e=>{e.active=t}),n.setParameters(r)}},function(e,t,n){"use strict";const r=n(48);e.exports=e=>r(e,["audioDeviceId","audioFallbackEnabled","audioSource","channels","classNames","constraints","disableAudioProcessing","echoCancellation","noiseSuppression","autoGainControl","enableRenegotiation","enableStereo","facingMode","fitMode","frameRate","height","insertDefaultUI","insertMode","audioBitrate","maxResolution","minVideoBitrate","mirror","name","publishAudio","publishVideo","resolution","showControls","style","videoContentHint","videoDeviceId","videoDimensions","videoFilter","videoSource","width"])},function(e,t,n){"use strict";const r=n(26),o=n(49),i=n(103),s=n(23)();e.exports=e=>{let t=e.publisher,n=e.widgetView,a=0,c=0;const u=new i(()=>{const e=t.listenerCount(r.AUDIO_LEVEL_UPDATED);if(o()-c>1e4&&0===e)return void u.stop();const i=n&&n.video();if(i){const n=i.getAudioInputLevel();a=n,e>0&&t.dispatchEvent(new s.AudioLevelUpdatedEvent(n))}});Object.defineProperty(t,"loudness",{get:()=>(u.start(),c=o(),a),set(){throw new TypeError("Cannot set readonly property loudness")}}),t.listenerCount(r.AUDIO_LEVEL_UPDATED)&&u.start(),t.on("audioLevelUpdated:added",()=>{u.start()}),t.once(r.PUBLISHER_DESTROYED,()=>{u.stop()})}},function(e,t,n){"use strict";var r=n(3),o=r(n(12)),i=r(n(13));e.exports=function(e){let t=!1;return function(){var n=(0,i.default)(o.default.mark((function n(){var r,i,s,a=arguments;return o.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!t){n.next=2;break}throw new Error("The previous call to this function has not yet completed.");case 2:for(t=!0,n.prev=3,r=a.length,i=new Array(r),s=0;s<r;s++)i[s]=a[s];return n.next=7,e.call(this,...i);case 7:return n.abrupt("return",n.sent);case 8:return n.prev=8,t=!1,n.finish(8);case 11:case"end":return n.stop()}}),n,this,[[3,,8,11]])})));return function(){return n.apply(this,arguments)}}()}},function(e,t,n){"use strict";const r=n(11)(),o=n(4);e.exports=function(e){const t=document.createElement("canvas");if(!t.captureStream)throw r(o.NOT_SUPPORTED,new Error("Your browser does not support HTMLCanvasElement.captureStream()"));t.width=e.width,t.height=e.height,t.getContext("2d").fillRect(0,0,1,1);const n=t.captureStream().getVideoTracks()[0];return n.isCreatedCanvas=!0,n.enabled=!1,n}},function(e,t,n){"use strict";e.exports=(e,t)=>{if(!e)return null;const n=e.getVideoTracks()[0];return n?((e,t)=>(e=>e.getSettings&&e.getSettings().deviceId)(e)||(e=>{let t;return e.getConstraints&&e.getConstraints().deviceId&&(t=e.getConstraints().deviceId.exact),t})(e)||((e,t)=>{let n;if(t&&t.length){const r=t.find(t=>t.label===e.label);r&&(n=r.deviceId)}return n})(e,t))(n,t):null}},function(e,t,n){"use strict";const r=n(4),o=n(8),i=n(11)();e.exports=e=>[403,404,409].includes(parseInt(e.code,10))?i(r.STREAM_CREATE_FAILED,new Error("Failed to create stream in server model: "+e.message),o.UNABLE_TO_PUBLISH):i(r.UNEXPECTED_SERVER_RESPONSE,new Error("Unexpected server response: "+e.message),o.UNEXPECTED_SERVER_RESPONSE)},function(e,t,n){"use strict";var r=n(3),o=r(n(12)),i=r(n(13));const s=n(2),a=n(684),c=n(686),u=n(1)("MediaProcessor");function d(e){var t=this;void 0===e&&(e={});const n=e,r=n.ML,s=void 0===r?a:r,d=n.MediaTransform,l=void 0===d?c:d;let p,f,h;this.isValidVideoFilter=e=>{const t=e.type;return l.isSupported(t)&&l.isValidConfig(e)},this.setVideoFilter=function(){var e=(0,i.default)(o.default.mark((function e(n){var r,i,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.type,i=l.getConfigurator(r)){e.next=5;break}return u.warn(`Ignoring: filter "${r}" isn't supported`),e.abrupt("return");case 5:if(a=i.getConfig(n)){e.next=9;break}return u.warn("Ignoring: couldn't configure filter "+r),e.abrupt("return");case 9:if(!!!t.getVideoFilter()){e.next=20;break}return e.prev=11,e.next=14,t.destroy();case 14:e.next=20;break;case 16:return e.prev=16,e.t0=e.catch(11),u.warn("Ignoring, couldn't remove previous filter: "+e.t0),e.abrupt("return");case 20:return e.next=22,s.createConnector(a);case 22:p=e.sent,f=n;case 24:case"end":return e.stop()}}),e,null,[[11,16]])})));return function(t){return e.apply(this,arguments)}}(),this.getVideoFilter=()=>f,this.getOriginalVideoTrack=()=>h,this.setMediaStream=function(){var e=(0,i.default)(o.default.mark((function e(t){var n,r,i;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.getVideoTracks(),r=n[0]){e.next=4;break}return u.warn("Ignoring. No video track found"),e.abrupt("return",null);case 4:return i=null,e.prev=5,e.next=8,p.setTrack(r);case 8:i=e.sent,h=r,e.next=15;break;case 12:e.prev=12,e.t0=e.catch(5),u.error("Error setting media stream: "+e.t0);case 15:return e.abrupt("return",i);case 16:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(t){return e.apply(this,arguments)}}(),this.setVideoTrack=function(){var e=(0,i.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null,e.prev=1,e.next=4,p.setTrack(t);case 4:n=e.sent,h=t,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),u.err("Error setting video track: "+e.t0);case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),this._setConnector=e=>{p=e},this.destroy=(0,i.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.destroy();case 2:p=null,f=null,h=null;case 5:case"end":return e.stop()}}),e)})))}d.isSupported=function(e){void 0===e&&(e={});const t=e,n=t.env,r=void 0===n?s:n,o=t.ML,i=void 0===o?a:o;return r.isChrome&&i.isSupported()},e.exports=d},function(e,t,n){"use strict";const r={isSupported:()=>"undefined"!=typeof MediaStreamTrackProcessor&&"undefined"!=typeof MediaStreamTrackGenerator,setMetadata:n(685).setMetadata,createConnector:n(308).createVonageMediaProcessorConnector};e.exports=r},function(e,t,n){"use strict";n.r(t),function(e,r){function o(){return new e((e,t)=>{"undefined"==typeof MediaStreamTrackProcessor||"undefined"==typeof MediaStreamTrackGenerator?t("Your browser does not support the MediaStreamTrack API for Insertable Streams of Media."):e()})}n.d(t,"MediaProcessor",(function(){return Et})),n.d(t,"MediaProcessorConnector",(function(){return Ct})),n.d(t,"isSupported",(function(){return o})),n.d(t,"setMetadata",(function(){return je}));class i{}i.updates={transformer_new:"New transformer",transformer_null:"Null transformer"},i.errors={transformer_none:"No transformers provided",transformer_start:"Cannot start transformer",transformer_transform:"Cannot transform frame",transformer_flush:"Cannot flush transformer"};var s={exports:{}},a=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},c=a,u=Object.prototype.toString;function d(e){return Array.isArray(e)}function l(e){return void 0===e}function p(e){return"[object ArrayBuffer]"===u.call(e)}function f(e){return null!==e&&"object"==typeof e}function h(e){if("[object Object]"!==u.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function m(e){return"[object Function]"===u.call(e)}function b(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),d(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var g={isArray:d,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===u.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:f,isPlainObject:h,isUndefined:l,isDate:function(e){return"[object Date]"===u.call(e)},isFile:function(e){return"[object File]"===u.call(e)},isBlob:function(e){return"[object Blob]"===u.call(e)},isFunction:m,isStream:function(e){return f(e)&&m(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===u.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:b,merge:function e(){var t={};function n(n,r){h(t[r])&&h(n)?t[r]=e(t[r],n):h(n)?t[r]=e({},n):d(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)b(arguments[r],n);return t},extend:function(e,t,n){return b(t,(function(t,r){e[r]=n&&"function"==typeof t?c(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},v=g;function y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var S=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(v.isURLSearchParams(t))r=t.toString();else{var o=[];v.forEach(t,(function(e,t){null!=e&&(v.isArray(e)?t+="[]":e=[e],v.forEach(e,(function(e){v.isDate(e)?e=e.toISOString():v.isObject(e)&&(e=JSON.stringify(e)),o.push(y(t)+"="+y(e))})))})),r=o.join("&")}if(r){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},E=g;function T(){this.handlers=[]}T.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},T.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},T.prototype.forEach=function(e){E.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var C=T,w=g,R=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},I=R,_=function(e,t,n,r,o){var i=new Error(e);return I(i,t,n,r,o)},x=_,O=g,N=O.isStandardBrowserEnv()?{write:function(e,t,n,r,o,i){var s=[];s.push(e+"="+encodeURIComponent(t)),O.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),O.isString(r)&&s.push("path="+r),O.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},k=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},Z=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},A=g,L=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],V=g,P=V.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=V.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function W(e){this.message=e}W.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},W.prototype.__CANCEL__=!0;var G=W,M=g,D=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(x("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},X=N,j=S,U=function(e,t){return e&&!k(t)?Z(e,t):t},F=function(e){var t,n,r,o={};return e?(A.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=A.trim(e.substr(0,r)).toLowerCase(),n=A.trim(e.substr(r+1)),t){if(o[t]&&L.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o},Y=P,B=_,H=re,J=G,K=function(t){return new e((function(e,n){var r,o=t.data,i=t.headers,s=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(r),t.signal&&t.signal.removeEventListener("abort",r)}M.isFormData(o)&&delete i["Content-Type"];var c=new XMLHttpRequest;if(t.auth){var u=t.auth.username||"",d=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.Authorization="Basic "+btoa(u+":"+d)}var l=U(t.baseURL,t.url);function p(){if(c){var r="getAllResponseHeaders"in c?F(c.getAllResponseHeaders()):null,o={data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:t,request:c};D((function(t){e(t),a()}),(function(e){n(e),a()}),o),c=null}}if(c.open(t.method.toUpperCase(),j(l,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=p:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(p)},c.onabort=function(){c&&(n(B("Request aborted",t,"ECONNABORTED",c)),c=null)},c.onerror=function(){n(B("Network Error",t,null,c)),c=null},c.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||H.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(B(e,t,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",c)),c=null},M.isStandardBrowserEnv()){var f=(t.withCredentials||Y(l))&&t.xsrfCookieName?X.read(t.xsrfCookieName):void 0;f&&(i[t.xsrfHeaderName]=f)}"setRequestHeader"in c&&M.forEach(i,(function(e,t){void 0===o&&"content-type"===t.toLowerCase()?delete i[t]:c.setRequestHeader(t,e)})),M.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&"json"!==s&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(r=function(e){c&&(n(!e||e&&e.type?new J("canceled"):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(r),t.signal&&(t.signal.aborted?r():t.signal.addEventListener("abort",r))),o||(o=null),c.send(o)}))},z=g,Q=function(e,t){w.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},q=R,$={"Content-Type":"application/x-www-form-urlencoded"};function ee(e,t){!z.isUndefined(e)&&z.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var te,ne={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(te=K),te),transformRequest:[function(e,t){return Q(t,"Accept"),Q(t,"Content-Type"),z.isFormData(e)||z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e)?e:z.isArrayBufferView(e)?e.buffer:z.isURLSearchParams(e)?(ee(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):z.isObject(e)||t&&"application/json"===t["Content-Type"]?(ee(t,"application/json"),function(e,t,n){if(z.isString(e))try{return(t||JSON.parse)(e),z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||ne.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||r&&z.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw q(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};z.forEach(["delete","get","head"],(function(e){ne.headers[e]={}})),z.forEach(["post","put","patch"],(function(e){ne.headers[e]=z.merge($)}));var re=ne,oe=g,ie=re,se=function(e){return!(!e||!e.__CANCEL__)},ae=g,ce=function(e,t,n){var r=this||ie;return oe.forEach(n,(function(n){e=n.call(r,e,t)})),e},ue=se,de=re,le=G;function pe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new le("canceled")}var fe=g,he=function(e,t){t=t||{};var n={};function r(e,t){return fe.isPlainObject(e)&&fe.isPlainObject(t)?fe.merge(e,t):fe.isPlainObject(t)?fe.merge({},t):fe.isArray(t)?t.slice():t}function o(n){return fe.isUndefined(t[n])?fe.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function i(e){if(!fe.isUndefined(t[e]))return r(void 0,t[e])}function s(n){return fe.isUndefined(t[n])?fe.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function a(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a};return fe.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||o,r=t(e);fe.isUndefined(r)&&t!==a||(n[e]=r)})),n},me="0.25.0",be=me,ge={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){ge[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var ve={};ge.transitional=function(e,t,n){function r(e,t){return"[Axios v"+be+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,i){if(!1===e)throw new Error(r(o," has been removed"+(t?" in "+t:"")));return t&&!ve[o]&&(ve[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};var ye=g,Se=S,Ee=C,Te=function(t){return pe(t),t.headers=t.headers||{},t.data=ce.call(t,t.data,t.headers,t.transformRequest),t.headers=ae.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),ae.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||de.adapter)(t).then((function(e){return pe(t),e.data=ce.call(t,e.data,e.headers,t.transformResponse),e}),(function(n){return ue(n)||(pe(t),n&&n.response&&(n.response.data=ce.call(t,n.response.data,n.response.headers,t.transformResponse))),e.reject(n)}))},Ce=he,we={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],s=t[i];if(s){var a=e[i],c=void 0===a||s(a,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:ge},Re=we.validators;function Ie(e){this.defaults=e,this.interceptors={request:new Ee,response:new Ee}}Ie.prototype.request=function(t,n){if("string"==typeof t?(n=n||{}).url=t:n=t||{},!n.url)throw new Error("Provided config url is not valid");(n=Ce(this.defaults,n)).method?n.method=n.method.toLowerCase():this.defaults.method?n.method=this.defaults.method.toLowerCase():n.method="get";var r=n.transitional;void 0!==r&&we.assertOptions(r,{silentJSONParsing:Re.transitional(Re.boolean),forcedJSONParsing:Re.transitional(Re.boolean),clarifyTimeoutError:Re.transitional(Re.boolean)},!1);var o=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(i=i&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));var s,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!i){var c=[Te,void 0];for(Array.prototype.unshift.apply(c,o),c=c.concat(a),s=e.resolve(n);c.length;)s=s.then(c.shift(),c.shift());return s}for(var u=n;o.length;){var d=o.shift(),l=o.shift();try{u=d(u)}catch(e){l(e);break}}try{s=Te(u)}catch(t){return e.reject(t)}for(;a.length;)s=s.then(a.shift(),a.shift());return s},Ie.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=Ce(this.defaults,e),Se(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},ye.forEach(["delete","get","head","options"],(function(e){Ie.prototype[e]=function(t,n){return this.request(Ce(n||{},{method:e,url:t,data:(n||{}).data}))}})),ye.forEach(["post","put","patch"],(function(e){Ie.prototype[e]=function(t,n,r){return this.request(Ce(r||{},{method:e,url:t,data:n}))}}));var _e=Ie,xe=G;function Oe(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new e((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(t){var n,o=new e((function(e){r.subscribe(e),n=e})).then(t);return o.cancel=function(){r.unsubscribe(n)},o},t((function(e){r.reason||(r.reason=new xe(e),n(r.reason))}))}Oe.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Oe.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},Oe.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},Oe.source=function(){var e;return{token:new Oe((function(t){e=t})),cancel:e}};var Ne=Oe,ke=g,Ze=g,Ae=a,Le=_e,Ve=he;var Pe=function e(t){var n=new Le(t),r=Ae(Le.prototype.request,n);return Ze.extend(r,Le.prototype,n),Ze.extend(r,n),r.create=function(n){return e(Ve(t,n))},r}(re);Pe.Axios=Le,Pe.Cancel=G,Pe.CancelToken=Ne,Pe.isCancel=se,Pe.VERSION=me,Pe.all=function(t){return e.all(t)},Pe.spread=function(e){return function(t){return e.apply(null,t)}},Pe.isAxiosError=function(e){return ke.isObject(e)&&!0===e.isAxiosError},s.exports=Pe,s.exports.default=Pe;var We=s.exports;class Ge{isEmpty(){return!this.isPresent()}static of(e){if(null!=e)return new Me(e);throw new TypeError("The passed value was null or undefined.")}static ofNonNull(e){return Ge.of(e)}static ofNullable(e){return null!=e?new Me(e):new De}static empty(){return new De}static from(e){switch(e.kind){case"present":return Ge.of(e.value);case"empty":return Ge.empty();default:throw new TypeError("The passed value was not an Option type.")}}}class Me extends Ge{constructor(e){super(),this.payload=e}isPresent(){return!0}get(){return this.payload}ifPresent(e){e(this.payload)}ifPresentOrElse(e,t){e(this.payload)}filter(e){return e(this.payload)?this:Ge.empty()}map(e){const t=e(this.payload);return Ge.ofNullable(t)}flatMap(e){return e(this.payload)}or(e){return this}orElse(e){return this.payload}orElseGet(e){return this.payload}orElseThrow(e){return this.payload}orNull(){return this.payload}orUndefined(){return this.payload}toOption(){return{kind:"present",value:this.payload}}matches(e){return e.present(this.payload)}toJSON(e){return this.payload}}class De extends Ge{isPresent(){return!1}constructor(){super()}get(){throw new TypeError("The optional is not present.")}ifPresent(e){}ifPresentOrElse(e,t){t()}filter(e){return this}map(e){return Ge.empty()}flatMap(e){return Ge.empty()}or(e){return e()}orElse(e){return e}orElseGet(e){return this.orElse(e())}orElseThrow(e){throw e()}orNull(){return null}orUndefined(){}toOption(){return{kind:"empty"}}matches(e){return e.empty()}toJSON(e){return null}}let Xe;function je(e){Xe=e}class Ue{constructor(){const e=Xe;this._report={action:Ge.empty(),applicationId:Ge.ofNullable(void 0!==e?e.appId:null),timestamp:Date.now(),fps:Ge.empty(),framesTransformed:Ge.empty(),guid:Ge.empty(),highestFrameTransformCpu:Ge.empty(),message:Ge.empty(),source:Ge.ofNullable(void 0!==e?e.sourceType:null),transformedFps:Ge.empty(),transformerType:Ge.empty(),variation:Ge.empty(),videoHeight:Ge.empty(),videoWidth:Ge.empty(),version:"1.1.1",error:Ge.empty()}}action(e){return this._report.action=Ge.ofNullable(e),this}framesTransformed(e){return this._report.framesTransformed=Ge.ofNullable(e),this}fps(e){return this._report.fps=Ge.ofNullable(e),this}guid(e){return this._report.guid=Ge.ofNullable(e),this}message(e){return this._report.message=Ge.ofNullable(e),this}transformedFps(e){return this._report.transformedFps=Ge.ofNullable(e),this}transformerType(e){return this._report.transformerType=Ge.ofNullable(e),this}variation(e){return this._report.variation=Ge.ofNullable(e),this}videoHeight(e){return this._report.videoHeight=Ge.ofNullable(e),this}videoWidth(e){return this._report.videoWidth=Ge.ofNullable(e),this}error(e){return this._report.error=Ge.ofNullable(e),this}build(){return this._report}}class Fe{static report(t){return new e((e,n)=>{if(null===t.applicationId||null===t.source)return void e("success");We.create().post("https://hlg.tokbox.com/prod/logging/vcp_webrtc",(e=>JSON.stringify(e,(e,t)=>{if(null!==t)return t}))(t),{timeout:1e4,timeoutErrorMessage:"Request timeout",headers:{"Content-Type":"application/json"}}).then(t=>{console.log(t),e("success")}).catch(e=>{console.log(e),n(e)})})}}var Ye,Be=new Uint8Array(16);function He(){if(!Ye&&!(Ye="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ye(Be)}var Je=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ke(e){return"string"==typeof e&&Je.test(e)}for(var ze=[],Qe=0;Qe<256;++Qe)ze.push((Qe+256).toString(16).substr(1));function qe(e,t,n){var r=(e=e||{}).random||(e.rng||He)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(ze[e[t+0]]+ze[e[t+1]]+ze[e[t+2]]+ze[e[t+3]]+"-"+ze[e[t+4]]+ze[e[t+5]]+"-"+ze[e[t+6]]+ze[e[t+7]]+"-"+ze[e[t+8]]+ze[e[t+9]]+"-"+ze[e[t+10]]+ze[e[t+11]]+ze[e[t+12]]+ze[e[t+13]]+ze[e[t+14]]+ze[e[t+15]]).toLowerCase();if(!Ke(n))throw TypeError("Stringified UUID is invalid");return n}(r)}const $e=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=Symbol("anyProducer"),rt=e.resolve(),ot=Symbol("listenerAdded"),it=Symbol("listenerRemoved");let st=!1;function at(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function ct(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function ut(e,t){const n=et.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}function dt(e,t){const n="string"==typeof t||"symbol"==typeof t?t:nt,r=tt.get(e);return r.has(n)||r.set(n,new Set),r.get(n)}function lt(t,n){n=Array.isArray(n)?n:[n];let r=!1,o=()=>{},i=[];const s={enqueue(e){i.push(e),o()},finish(){r=!0,o()}};for(const e of n)dt(t,e).add(s);return{async next(){return i?0===i.length?r?(i=void 0,this.next()):(await new e(e=>{o=e}),this.next()):{done:!1,value:await i.shift()}:{done:!0}},async return(e){i=void 0;for(const e of n)dt(t,e).delete(s);return o(),arguments.length>0?{done:!0,value:await e}:{done:!0}},[Symbol.asyncIterator](){return this}}}function pt(e){if(void 0===e)return mt;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(const t of e)if(!mt.includes(t)){if("string"!=typeof t)throw new TypeError("`methodNames` element must be a string");throw new Error(t+" is not Emittery method")}return e}const ft=e=>e===ot||e===it;class ht{static mixin(e,t){return t=pt(t),n=>{if("function"!=typeof n)throw new TypeError("`target` must be function");for(const e of t)if(void 0!==n.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``);Object.defineProperty(n.prototype,e,{enumerable:!1,get:function(){return Object.defineProperty(this,e,{enumerable:!1,value:new ht}),this[e]}});const r=t=>function(...n){return this[e][t](...n)};for(const e of t)Object.defineProperty(n.prototype,e,{enumerable:!1,value:r(e)});return n}}static get isDebugEnabled(){if("object"!=typeof r)return st;const{env:e}=r||{env:{}};return"emittery"===e.DEBUG||"*"===e.DEBUG||st}static set isDebugEnabled(e){st=e}constructor(e={}){$e.set(this,new Set),et.set(this,new Map),tt.set(this,new Map),this.debug=e.debug||{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{r=JSON.stringify(r),"symbol"==typeof n&&(n=n.toString());const o=new Date,i=`${o.getHours()}:${o.getMinutes()}:${o.getSeconds()}.${o.getMilliseconds()}`;console.log(`[${i}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}logIfDebugEnabled(e,t,n){(ht.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,n)}on(e,t){ct(t),e=Array.isArray(e)?e:[e];for(const n of e)at(n),ut(this,n).add(t),this.logIfDebugEnabled("subscribe",n,void 0),ft(n)||this.emit(ot,{eventName:n,listener:t});return this.off.bind(this,e,t)}off(e,t){ct(t),e=Array.isArray(e)?e:[e];for(const n of e)at(n),ut(this,n).delete(t),this.logIfDebugEnabled("unsubscribe",n,void 0),ft(n)||this.emit(it,{eventName:n,listener:t})}once(t){return new e(e=>{const n=this.on(t,t=>{n(),e(t)})})}events(e){e=Array.isArray(e)?e:[e];for(const t of e)at(t);return lt(this,e)}async emit(t,n){at(t),this.logIfDebugEnabled("emit",t,n),function(t,n,r){const o=tt.get(t);if(o.has(n))for(const e of o.get(n))e.enqueue(r);if(o.has(nt)){const t=e.all([n,r]);for(const e of o.get(nt))e.enqueue(t)}}(this,t,n);const r=ut(this,t),o=$e.get(this),i=[...r],s=ft(t)?[]:[...o];await rt,await e.all([...i.map(async e=>{if(r.has(e))return e(n)}),...s.map(async e=>{if(o.has(e))return e(t,n)})])}async emitSerial(e,t){at(e),this.logIfDebugEnabled("emitSerial",e,t);const n=ut(this,e),r=$e.get(this),o=[...n],i=[...r];await rt;for(const e of o)n.has(e)&&await e(t);for(const n of i)r.has(n)&&await n(e,t)}onAny(e){return ct(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),$e.get(this).add(e),this.emit(ot,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return lt(this)}offAny(e){ct(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(it,{listener:e}),$e.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(const t of e)if(this.logIfDebugEnabled("clear",t,void 0),"string"==typeof t||"symbol"==typeof t){ut(this,t).clear();const e=dt(this,t);for(const t of e)t.finish();e.clear()}else{$e.get(this).clear();for(const e of et.get(this).values())e.clear();for(const e of tt.get(this).values()){for(const t of e)t.finish();e.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let t=0;for(const n of e)if("string"!=typeof n){void 0!==n&&at(n),t+=$e.get(this).size;for(const e of et.get(this).values())t+=e.size;for(const e of tt.get(this).values())t+=e.size}else t+=$e.get(this).size+ut(this,n).size+dt(this,n).size+dt(this).size;return t}bindMethods(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");t=pt(t);for(const n of t){if(void 0!==e[n])throw new Error(`The property \`${n}\` already exists on \`target\``);Object.defineProperty(e,n,{enumerable:!1,value:this[n].bind(this)})}}}const mt=Object.getOwnPropertyNames(ht.prototype).filter(e=>"constructor"!==e);Object.defineProperty(ht,"listenerAdded",{value:ot,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(ht,"listenerRemoved",{value:it,writable:!1,enumerable:!0,configurable:!1});var bt,gt=ht;function vt(e){return function(e){if("object"==typeof(t=e)&&null!==t&&"message"in t&&"string"==typeof t.message)return e;var t;try{return new Error(JSON.stringify(e))}catch{return new Error(String(e))}}(e).message}(bt||(bt={})).FPS_DROP="fps_drop";class yt extends gt{constructor(e,t){super(),this.index_=t,this.uuid_=qe(),this.framesTransformed_=0,this.transformer_=e,this.shouldStop_=!1,this.isFlashed_=!1,this.framesFromSource_=0,this.fps_=0,this.mediaTransformerQosReportStartTimestamp_=0,this.videoHeight_=0,this.videoWidth_=0,this.trackExpectedRate_=-1,this.transformerType_="Custom","getTransformerType"in e&&(this.transformerType_=e.getTransformerType());const n=(new Ue).action("MediaTransformer").guid(this.uuid_).transformerType(this.transformerType_).variation("Create").build();Fe.report(n)}setTrackExpectedRate(e){this.trackExpectedRate_=e}async start(e){if(this.transformer_&&"function"==typeof this.transformer_.start)try{await this.transformer_.start(e)}catch(e){const t=(new Ue).action("MediaTransformer").guid(this.uuid_).message(i.errors.transformer_start).transformerType(this.transformerType_).variation("Error").error(vt(e)).build();Fe.report(t);const n={eventMetaData:{transformerIndex:this.index_},error:e,function:"start"};this.emit("error",n)}}async transform(e,t){var n,r,o,s;if(0===this.mediaTransformerQosReportStartTimestamp_&&(this.mediaTransformerQosReportStartTimestamp_=Date.now()),this.videoHeight_=null!=(n=null==e?void 0:e.displayHeight)?n:0,this.videoWidth_=null!=(r=null==e?void 0:e.displayWidth)?r:0,++this.framesFromSource_,this.transformer_)if(this.shouldStop_)e.close(),this.flush(t),t.terminate();else try{await(null==(s=(o=this.transformer_).transform)?void 0:s.call(o,e,t)),++this.framesTransformed_,500===this.framesTransformed_&&this.mediaTransformerQosReport()}catch(e){const t=(new Ue).action("MediaTransformer").guid(this.uuid_).message(i.errors.transformer_transform).transformerType(this.transformerType_).variation("Error").error(vt(e)).build();Fe.report(t);const n={eventMetaData:{transformerIndex:this.index_},error:e,function:"transform"};this.emit("error",n)}}async flush(e){if(this.transformer_&&"function"==typeof this.transformer_.flush&&!this.isFlashed_){this.isFlashed_=!0;try{await this.transformer_.flush(e)}catch(e){const t=(new Ue).action("MediaTransformer").guid(this.uuid_).message(i.errors.transformer_flush).transformerType(this.transformerType_).variation("Error").error(vt(e)).build();Fe.report(t);const n={eventMetaData:{transformerIndex:this.index_},error:e,function:"flush"};this.emit("error",n)}}this.mediaTransformerQosReport();const t=(new Ue).action("MediaTransformer").guid(this.uuid_).transformerType(this.transformerType_).variation("Delete").build();Fe.report(t)}stop(){console.log("[Pipeline] Stop stream."),this.shouldStop_=!0}mediaTransformerQosReport(){let e=(Date.now()-this.mediaTransformerQosReportStartTimestamp_)/1e3,t=this.framesFromSource_/e,n=this.framesTransformed_/e;if(-1!=this.trackExpectedRate_&&.8*this.trackExpectedRate_>t){const e={eventMetaData:{transformerIndex:this.index_},warningType:bt.FPS_DROP,dropInfo:{requested:this.trackExpectedRate_,current:t}};this.emit("warn",e)}const r=(new Ue).action("MediaTransformer").fps(t).transformedFps(n).framesTransformed(this.framesTransformed_).guid(this.uuid_).transformerType(this.transformerType_).videoHeight(this.videoHeight_).videoWidth(this.videoWidth_).variation("QoS").build();Fe.report(r),this.mediaTransformerQosReportStartTimestamp_=0,this.framesFromSource_=0,this.framesTransformed_=0}}class St extends gt{constructor(e){super(),this.transformers_=[],this.trackExpectedRate_=-1;for(let t=0;t<e.length;t++){let n=new yt(e[t],t);n.on("error",e=>{this.emit("error",e)}),n.on("warn",e=>{this.emit("warn",e)}),this.transformers_.push(n)}}setTrackExpectedRate(e){this.trackExpectedRate_=e;for(let e of this.transformers_)e.setTrackExpectedRate(this.trackExpectedRate_)}async start(e,t){if(this.transformers_&&0!==this.transformers_.length){try{let n=e;for(let t of this.transformers_)e=e.pipeThrough(new TransformStream(t));e.pipeTo(t).then(async()=>{console.log("[Pipeline] Setup."),await t.abort(),await n.cancel()}).catch(async r=>{e.cancel().then(()=>{console.log("[Pipeline] Shutting down streams after abort.")}).catch(e=>{console.error("[Pipeline] Error from stream transform:",e)}),await t.abort(r),await n.cancel(r)})}catch(e){return void this.destroy()}console.log("[Pipeline] Pipeline started.")}else console.log("[Pipeline] No transformers.")}async destroy(){console.log("[Pipeline] Destroying Pipeline.");for(let e of this.transformers_)e.stop()}}class Et extends gt{constructor(){super(),this.uuid_=qe(),this.trackExpectedRate_=-1;const e=(new Ue).action("MediaProcessor").guid(this.uuid_).variation("Create").build();Fe.report(e)}setTrackExpectedRate(e){this.trackExpectedRate_=e,this.pipeline_&&this.pipeline_.setTrackExpectedRate(this.trackExpectedRate_)}transform(e,t){return this.readable_=e,this.writable_=t,this.transformInternal()}transformInternal(){return new e((e,t)=>{if(!this.transformers_||0===this.transformers_.length){const e=(new Ue).action("MediaProcessor").guid(this.uuid_).message(i.errors.transformer_none).variation("Error").build();Fe.report(e),t("[MediaProcessor] Need to set transformers.")}this.pipeline_&&this.pipeline_.destroy(),this.pipeline_=new St(this.transformers_),this.pipeline_.on("warn",e=>{this.emit("warn",e)}),this.pipeline_.on("error",e=>{this.emit("error",e)}),-1!=this.trackExpectedRate_&&this.pipeline_.setTrackExpectedRate(this.trackExpectedRate_),this.pipeline_.start(this.readable_,this.writable_).then(()=>{e()}).catch(e=>{t(e)})})}setTransformers(t){const n=(new Ue).action("MediaProcessor").guid(this.uuid_).message(i.updates.transformer_new).variation("Update").build();return Fe.report(n),this.transformers_=t,this.readable_&&this.writable_?this.transformInternal():e.resolve()}destroy(){return new e(e=>{this.pipeline_&&this.pipeline_.destroy();const t=(new Ue).action("MediaProcessor").guid(this.uuid_).variation("Delete").build();Fe.report(t),e()})}}class Tt{constructor(){this.processor_=null,this.generator_=null}init(t){return new e((e,n)=>{try{this.processor_=new MediaStreamTrackProcessor(t)}catch(e){console.log("[InsertableStreamHelper] MediaStreamTrackProcessor failed: "+e),n(e)}try{"audio"===t.kind?this.generator_=new MediaStreamTrackGenerator({kind:"audio"}):"video"===t.kind?this.generator_=new MediaStreamTrackGenerator({kind:"video"}):n("kind not supported")}catch(e){console.log("[InsertableStreamHelper] MediaStreamTrackGenerator failed: "+e),n(e)}e()})}getReadable(){return this.processor_.readable}getWriteable(){return this.generator_.writable}getProccesorTrack(){return this.generator_}}class Ct{constructor(e){this.insertableStreamHelper_=new Tt,this.mediaProcessor_=e}setTrack(t){return new e((e,n)=>{this.insertableStreamHelper_.init(t).then(()=>{this.mediaProcessor_.transform(this.insertableStreamHelper_.getReadable(),this.insertableStreamHelper_.getWriteable()).then(()=>{e(this.insertableStreamHelper_.getProccesorTrack())}).catch(e=>{n(e)})}).catch(e=>{n(e)})})}destroy(){return new e((e,t)=>{this.mediaProcessor_?this.mediaProcessor_.destroy().then(()=>{e()}).catch(e=>{t(e)}):t("no processor")})}}}.call(this,n(0),n(43))},function(e,t,n){"use strict";const r={backgroundBlur:n(687)},o=e=>!!r[e],i=e=>o(e)?r[e]:null,s={isSupported:o,getConfigurator:i,isValidConfig:e=>{const t=e.type;return!!o(t)&&i(t).isValidConfig(e)}};e.exports=s},function(e,t,n){"use strict";var r=n(3)(n(20));const o=n(308).BlurRadius,i=n(688),s=o.High,a=e=>"low"===e||"high"===e,c={isValidConfig:e=>{if("backgroundBlur"!==(null==e?void 0:e.type))return!1;const t=e.blurStrength;return!t||a(t)},getConfig:function(e){void 0===e&&(e={});const t=(0,r.default)({},i.getConfig(),{transformerType:"BackgroundBlur",radius:s}),n=e.blurStrength;return a(n)&&(t.radius=(e=>"low"===e?o.Low:o.High)(n)),t}};e.exports=c},function(e,t,n){"use strict";const r=n(34)().onlyLocal(),o={getConfig:function(e){void 0===e&&(e={});const t=e.staticConfig,n=(e=>(e.apiUrl.includes("anvil.opentok.com")?"https://static.opentok.com":"https://www.dev.tokbox.com")+"/v1.3.0/ml-transformers")(void 0===t?r:t);return{wasmAssetUriPath:n+"/",tfliteAssetUriPath:n+"/models/"}}};e.exports=o},function(e,t,n){"use strict";e.exports=e=>null===e||!1===e},function(e,t,n){"use strict";e.exports=e=>{var t;!(!e||!(null==(t=e.videoSource)?void 0:t.canvas))&&!!(!e||!("videoContentHint"in e))&&(e.videoContentHint="detail")}},function(e,t,n){"use strict";const r=n(149);e.exports=e=>{var t;e||(e={});const n=!!r(null==(t=e)?void 0:t.videoSource);e.capableSimulcastScreenshare=n&&(e=>!!(null==e?void 0:e.scalableScreenshare))(e)}},function(e,t,n){var r=n(693),o=n(99),i=n(35);e.exports=function(e,t){return r(e,i(t,3),o)}},function(e,t){e.exports=function(e,t,n){var r;return n(e,(function(e,n,o){if(t(e,n,o))return r=n,!1})),r}},function(e,t,n){"use strict";(function(t){const r=n(51),o=n(73);e.exports=e=>{let n,i,s=e.RTCPeerConnection,a=e.env,c=e.stream,u=e.codecFlags;if(a.isLegacyEdge)return!0;const d=()=>{try{n.close()}catch(e){}try{i.close()}catch(e){}n=null,i=null};try{const e={iceServers:[]};o()&&(e.sdpSemantics="plan-b"),n=new s(e),i=new s(e),n.addStream(c)}catch(e){return d(),t.resolve(!1)}return n.createOffer().then(e=>{const t={type:e.type,sdp:e.sdp};return Object.keys(u).forEach(e=>{u[e]||(t.sdp=r.removeVideoCodec(t.sdp,e))}),i.setRemoteDescription(t)}).then(()=>!0).catch(()=>!1).then(e=>(d(),e))}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(4).INVALID_PARAMETER;e.exports=e=>{let t=e.otError;return e=>{if(!e)return;const n=(e,n)=>{if(!e)throw t(r,new Error("iceConfig invalid: "+n))};"includeServers"in e&&n(-1!==["all","custom"].indexOf(e.includeServers),".includeServers must be all or custom"),"transportPolicy"in e&&n(-1!==["all","relay"].indexOf(e.transportPolicy),".transportPolicy must be all or relay"),n(Array.isArray(e.customServers),".customServers must be an array"),e.customServers.forEach(e=>{n(e.urls||!("url"in e),"ice servers need .urls, not .url"),n("string"==typeof e.urls||Array.isArray(e.urls),"ice server .urls must be a string or an array"),n(!e.username||"string"==typeof e.username,"ice server .username must be a string if present"),n(!e.credential||"string"==typeof e.credential,"ice server .credential must be a string if present")})}}},function(e,t,n){"use strict";const r=n(8);e.exports=function(e){switch(e){case r.AUTHENTICATION_ERROR:case r.INVALID_SESSION_ID:case r.TERMS_OF_SERVICE_FAILURE:case r.UNEXPECTED_SERVER_RESPONSE:return e;case r.ANVIL_EMPTY_RESPONSE_BODY:case r.ANVIL_CONNECT_FAILED:return r.CONNECT_FAILED;case r.ANVIL_BADLY_FORMED_RESPONSE:case r.ANVIL_INVALID_HTTP_STATUS:case r.ANVIL_XDOMAIN_OR_PARSING_ERROR:case r.ANVIL_UNKNOWN_HTTP_ERROR:case r.ANVIL_UNEXPECTED_ERROR_CODE:default:return r.UNEXPECTED_SERVER_RESPONSE}}},function(e,t,n){"use strict";const r=n(8),o=n(4);e.exports={NOT_CONNECTED:{code:o.NOT_CONNECTED,message:"Cannot use forceMute functionality. You are not connected to the session.",exceptionCode:r.NOT_CONNECTED},PERMISSION_DENIED:{code:o.PERMISSION_DENIED,message:"This token does not allow forceMute usage. The role must be at least `moderator` to enable this functionality",exceptionCode:r.UNABLE_TO_FORCE_MUTE},INVALID_PARAMETER:{code:o.INVALID_PARAMETER,message:"Invalid Parameter. Check that you have passed valid parameter values into the method call.",exceptionCode:r.INVALID_PARAMETER},NOT_FOUND:{code:o.NOT_FOUND,message:"The stream does not exist."},UNEXPECTED_SERVER_RESPONSE:{code:o.UNEXPECTED_SERVER_RESPONSE,message:"An unexpected error occurred.",exceptionCode:r.UNEXPECTED_SERVER_RESPONSE}}},function(e,t,n){"use strict";(function(e){var r=n(3);t.__esModule=!0,t.default=function(t){void 0===t&&(t={});const r=t.convertRumorError||n(311),l=t.Dispatcher||n(315),p=t.ExceptionCodes||n(8),f=t.hasIceRestartsCapability||n(312),h=t.hasRenegotiationCapability||n(715),m=t.logging||n(1)("RaptorSocket"),b=t.Message||n(316),g=t.OTHelpers||n(5),v=t.RumorSocket||(0,d.default)(),y=t.Signal||n(317),S=t.SignalError||n(720),E=function t(n,d,f,h,E,T,C){var w=this;let R,I,_,x,O,N,k,Z;void 0===C&&(C=[]);const A=E||new l,L=g.statable(this,["disconnected","connecting","connected","error","disconnecting"],"disconnected"),V=function(e){e.action&&e.variation||m.debug("Expected action and variation"),T.logEvent((0,s.default)({sessionId:I,partnerId:R,p2p:N,messagingServer:k,connectionId:n},e))},P=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t[0];L(r?"error":"connected"),O(...t)},W=e=>{let t="clientDisconnected";!this.is("disconnecting")&&Z&&(t="networkDisconnected"),e&&4001===e.code&&(t="networkTimedout"),L("disconnected"),A.onClose(t)},G=e=>{Z=!0,m.error(e)},M=()=>{A.onReconnecting()},D=()=>{V({action:"Reconnect",variation:"Success",retries:this._rumor.reconnectRetriesCount(),messageQueueSize:this._rumor.messageQueueSize(),socketId:this.socketId}),A.onReconnected()},X=()=>{V({action:"Reconnect",variation:"Attempt",retries:this._rumor.reconnectRetriesCount(),messageQueueSize:this._rumor.messageQueueSize(),socketId:this.socketId})},j=e=>{"connectionLimitExceeded"===e.message&&(e.code=p.CONNECTION_LIMIT_EXCEEDED),e.reason="ConnectToSession";const t=r(e);V({action:"Reconnect",variation:"Failure",failureReason:e.reason,failureCode:t.code,failureMessage:t.message,messageQueueSize:this._rumor.messageQueueSize(),socketId:this.socketId})};Object.defineProperty(this,"socketId",{get(){return this._rumor.socketID}}),this.connect=function(r,o,i,s){if(!this.is("disconnected","error"))return void m.warn("Cannot connect the Raptor Socket as it is currently connected. You should disconnect first.");L("connecting"),R=o.partnerId,I=o.sessionId,N=o.p2pEnabled,k=o.messagingServer,_=r,O=s,x={apiKey:R,sessionId:I};const a=`/v2/partner/${R}/session/${I}`;this._rumor=new t.RumorSocket({messagingURL:f,notifyDisconnectAddress:h,connectionId:n,enableReconnection:o.reconnection}),this._rumor.on("close",W),this._rumor.on("error",G),this._rumor.on("reconnecting",M),this._rumor.on("reconnectAttempt",X),this._rumor.on("reconnectFailure",j),this._rumor.on("reconnected",D),this._rumor.on("message",A.dispatch.bind(A));const u=e=>{P({reason:"WebSocketConnection",code:e.code,message:e.message})};this._rumor.once("error",u),this._rumor.once("open",()=>{this._rumor.removeListener("error",u),m.debug(`connected. Subscribing to ${a} on ${f}`),this._rumor.subscribe([a]);const n=C;(t.hasIceRestartsCapability()||t.hasRenegotiationCapability())&&o.renegotiation&&n.push("renegotiation");const r=b.connections.create({apiKey:R,sessionId:I,connectionId:this._rumor.id,connectionEventsSuppressed:i.connectionEventsSuppressed,capabilities:n}),s=new e(e=>{const t=n=>{n.id===this._rumor.id&&(e(n),E.off("connection#created",t))};E.on("connection#created",t)});this.publish(r,{"X-TB-TOKEN-AUTH":_},!0,(e,t)=>{if(e)return"connectionLimitExceeded"===e.message&&(e.code=p.CONNECTION_LIMIT_EXCEEDED),void P({reason:"ConnectToSession",code:e.code,message:e.message,socketId:this.socketId});const n=t&&t.data?JSON.parse(t.data):null;n&&(n.connection&&0!==n.connection.length||(n.connection=[],Array.isArray(n.stream)&&n.stream.forEach(e=>{let t=e.connection;return n.connection.push(t)})));const r=(e,t)=>{e?P({reason:"GetSessionState",code:e.code,message:e.message,socketId:this.socketId}):P(void 0,t)};s.then(e=>{n.connection.some(t=>t.id===e.id)||n.connection.unshift(e);const t=(0,c.default)();A.registerCallback(t,r),A.emit("session#read",n,t)})})})},this.disconnect=function(){this.is("disconnected")||(L("disconnecting"),this._rumor.disconnect())},this.publish=function(e,t,n,r){r=r||function(){};const o=(0,a.default)(r),i=(0,c.default)();if(m.debug(`Publish (ID:${i}) ${e}`),this._rumor.readyState!==v.OPEN||this._rumor.reconnecting&&!n){const e=new Error("Not connected.");return e.code=500,o(e),void m.error("cannot publish until the socket is connected.")}return A.registerCallback(i,o),this._rumor.publish([h],e,(0,s.default)({},t,{"Content-Type":"application/x-raptor+v2","TRANSACTION-ID":i,"X-TB-FROM-ADDRESS":this._rumor.id}),n,(function(e){e&&o(...arguments)})),i},this.send=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=()=>{}),w.publish((0,u.default)(e),t,n,r)},this.streamCreate=function(e,t,n,r,o,i,s,a){const c={apiKey:R,sessionId:I,streamId:t,name:e,audioFallbackEnabled:n,channels:r,minBitrate:o,maxBitrate:i,sourceStreamId:s},u=b.streams.create(c);this.publish(u,{},!0,(e,n)=>{a(e,t,n)})},this.streamDestroy=function(e,t){this.publish(b.streams.destroy(R,I,e,t),{},!0)},this.streamChannelUpdate=function(e,t,n){this.publish(b.streamChannels.update(R,I,e,t,n),{},!0)},this.subscriberCreate=function(e,t,n,r,o){const i={apiKey:R,sessionId:I,streamId:e,subscriberId:t,connectionId:this._rumor.id,channelsToSubscribeTo:n,sourceStreamId:r};this.publish(b.subscribers.create(i),{},!0,o)},this.subscriberDestroy=function(e,t){this.publish(b.subscribers.destroy(R,I,e,t),{},!0)},this.subscriberUpdate=function(e,t,n){this.publish(b.subscribers.update(R,I,e,t,n),{},!0)},this.subscriberChannelUpdate=function(e,t,n,r){this.publish(b.subscriberChannels.update(R,I,e,t,n,r),{},!0)},this.forceDisconnect=function(e,t){this.publish(b.connections.destroy({apiKey:R,sessionId:I,connectionId:e}),{},!0,t)},this.forceUnpublish=function(e,t){this.publish(b.streams.destroy(R,I,e),{},!0,t)},this.forceMuteStream=function(e,t){const n={streamId:e,active:!0};this.publish(b.forceMute.update((0,o.default)({},x,n)),{},!0,t)},this.forceMuteAll=function(e,t,n){const r={excludedStreamIds:e,active:t};this.publish(b.forceMute.update((0,o.default)({},x,r)),{},!0,n)},this.signal=function(e,t,n){const r=new y(I,this._rumor.id,e||{});r.valid?this.publish(r.toRaptorMessage(),{},r.retryAfterReconnect,e=>{let o,s,a;const c=[400,403,404,413,500];if(e){const t=parseInt(e.code,10);c.includes(t)?(s=t,a=e.message):(s=p.UNEXPECTED_SERVER_RESPONSE,a="Unexpected server response. Try this operation again later."),o=new S(s,a)}else{const e=r.data?typeof r.data:null;n("signal","send",{type:e})}t&&(0,i.default)(t)&&t(o,r.toHash())}):t&&(0,i.default)(t)&&t(new S(r.error.code,r.error.reason),r.toHash())},this.id=function(){return this._rumor&&this._rumor.id}};return E.hasIceRestartsCapability=f,E.hasRenegotiationCapability=h,E.RumorSocket=v,E};var o=r(n(20)),i=r(n(15)),s=r(n(7)),a=r(n(50)),c=r(n(19)),u=r(n(313)),d=r(n(699))}).call(this,n(0))},function(e,t,n){"use strict";var r=n(3);t.__esModule=!0,t.default=function(e){let t=(void 0===e?{}:e).WebSocket,n=void 0===t?u.default:t;const r=(0,i.default)(),d=(0,a.default)({EventEmitter:o.default,WebSocket:n,logging:s.default,allocateId:r});return(0,c.default)({EventEmitter:o.default,ReconnectableSocket:d,logging:s.default,allocateId:r})};var o=r(n(42)),i=r(n(700)),s=r(n(1)),a=r(n(701)),c=r(n(706)),u=r(n(711))},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(){let e=0;return()=>(e+=1,e)}},function(e,t,n){"use strict";var r=n(3);t.__esModule=!0,t.default=void 0;var o=r(n(12)),i=r(n(13)),s=r(n(157)),a=r(n(46)),c=r(n(60)),u=r(n(18)),d=r(n(314)),l=n(76),p=r(n(702)),f=r(n(63)),h=r(n(703)),m=r(n(705));const b=e=>function(){e(...arguments)},g=e=>1e3===e||e>=3e3&&e<=4999,v=l.codes.CLOSE_TIMEOUT;t.default=e=>{var t,n;let r=e.EventEmitter,l=e.WebSocket,y=e.logging,S=e.allocateId,E=e.BUFFER_DRAIN_INTERVAL,T=void 0===E?100:E,C=e.BUFFER_DRAIN_MAX_RETRIES,w=void 0===C?10:C;return n=t=function(e){function t(n){var r;const a="string"==typeof n?{url:n}:n,c=a.url,l=a.connectTimeout,f=void 0===l?15e3:l,m=a.pingThreshold,g=void 0===m?3e3:m,v=a.pingWarningDelay,E=void 0===v?100:v,T=a.disconnectThreshold,C=void 0===T?5900:T,w=a.reconnectMaxDuration,R=void 0===w?6e4:w;if(!c)throw new Error("Must provide url");r=e.call(this)||this,(0,u.default)((0,s.default)(r),"_url",void 0),(0,u.default)((0,s.default)(r),"_id",S()),(0,u.default)((0,s.default)(r),"_logger",y("ReconnectableSocket:"+r._id)),(0,u.default)((0,s.default)(r),"_webSocket",void 0),(0,u.default)((0,s.default)(r),"_connectTimer",void 0),(0,u.default)((0,s.default)(r),"_pingTimer",void 0),(0,u.default)((0,s.default)(r),"_pingWarningTimer",void 0),(0,u.default)((0,s.default)(r),"_disconnectTimer",void 0),(0,u.default)((0,s.default)(r),"_queuedMessages",[]),(0,u.default)((0,s.default)(r),"_draining",!1),r.readyStateMachine=(0,h.default)({reconnectMaxDuration:R,CLOSED:t.CLOSED,CLOSING:t.CLOSING}),r._url=c,(0,d.default)({logger:r._logger,obj:(0,s.default)(r),eventNames:["error","open","message","needsPing","reconnecting","reconnectAttempt","reconnectFailure","reconnected","close"]}),r.readyStateMachine.observe("onEnterOpen",e=>{let t=e.from;r._resetPingTimers(),r._resetDisconnectTimer(),r._connectTimer.clear(),"reconnecting"===t?(r._queuedMessages.forEach(e=>r.send(e,!0)),r._queuedMessages=[],r.emit("reconnected")):r.emit("open")}),r.readyStateMachine.observe("onEnterClosed",(e,t)=>{r.emit("close",t)}),r.readyStateMachine.observe("onEnterClosing",b(function(){var e=(0,i.default)(o.default.mark((function e(t,n){var i,s,a;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.from,s=n.code,a=n.reason,r._clearTimers(),e.next=5,r._clearSocket({drain:"open"===i,code:s,reason:a});case 5:"reconnecting"===i&&r.emit("reconnectFailure",{code:s,reason:a}),setTimeout(()=>{r.readyStateMachine.closed({code:s,reason:a})});case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}())),r.readyStateMachine.observe("onEnterReconnecting",()=>{r.emit("reconnecting")}),r.readyStateMachine.observe("onDisconnect",b(function(){var e=(0,i.default)(o.default.mark((function e(t,n){var i,s,a,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.from,s=t.to,a=n.code,c=n.reason,"reconnecting"!==s){e.next=10;break}if(!r._draining){e.next=5;break}return e.abrupt("return");case 5:return r._clearTimers(),r.emit("reconnectAttempt"),e.next=9,r._clearSocket({drain:"open"===i,code:a,reason:c});case 9:r._createSocket();case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));const I=(e,t)=>new p.default({name:e,duration:t,logger:r._logger});return r._connectTimer=I("connect",f),r._pingTimer=I("ping",g),r._pingWarningTimer=I("pingWarning",E),r._disconnectTimer=I("disconnect",C),r._createSocket(),r}(0,c.default)(t,e),(0,a.default)(t,[{key:"url",get:function(){return"function"==typeof this._url?this._url():this._url}},{key:"reconnecting",get:function(){return"reconnecting"===this.readyStateMachine.state}},{key:"binaryType",get:function(){return this._webSocket.binaryType}},{key:"bufferedAmount",get:function(){return this._webSocket.bufferedAmount}},{key:"protocol",get:function(){return this._webSocket.protocol}},{key:"extensions",get:function(){return this._webSocket.extensions}},{key:"readyState",get:function(){return{reconnecting:t.OPEN,open:t.OPEN,closing:t.CLOSING,closed:t.CLOSED,connecting:t.CONNECTING}[this.readyStateMachine.state]}}]);var n=t.prototype;return n._createSocket=function(){const e=new l(this.url);e.binaryType="arraybuffer";const n=(0,f.default)(e);n.on("open",()=>{this.readyStateMachine.open()}),n.on("close",e=>{let t=e.code,n=e.reason;this.readyStateMachine.disconnect({code:t,reason:n})}),n.on("error",e=>{this.emit("error",e)}),n.on("message",e=>{this.readyState!==t.CLOSING&&this._resetDisconnectTimer(),this.emit("message",e)}),this._webSocket=e,this._webSocketEvents=n,this._connectTimer.reset(()=>{const e={code:v,reason:"Timeout while opening connection"},t=new Error(e.reason);t.code=v,this.emit("error",t),this.readyStateMachine.disconnect(e)})},n._clearSocket=function(){var e=(0,i.default)(o.default.mark((function e(n){var r,i,s,a,c;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(r=void 0===n?{}:n).drain,s=void 0!==i&&i,a=r.code,c=r.reason,this._draining=!0,this._webSocketEvents&&this._webSocketEvents.removeAll(),this._webSocket.readyState===t.CLOSED){e.next=8;break}if(!s){e.next=7;break}return e.next=7,(0,m.default)(this._webSocket,{BUFFER_DRAIN_INTERVAL:T,BUFFER_DRAIN_MAX_RETRIES:w});case 7:try{!g(a)||void 0===a&&void 0===c?this._webSocket.close():this._webSocket.close(a,c)}catch(e){y.error("Could not close websocket",e)}case 8:this._draining=!1;case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.send=function(e,n){void 0===n&&(n=!0),this.readyState===t.OPEN&&this._resetPingTimers();const r=()=>{try{return this._webSocket.send(e),"sent"}catch(e){if(this._webSocket.readyState===l.OPEN)return this._logger.debug("webSocket.send threw exception even though it was open:",e),"dropped";throw e}};if("reconnecting"===this.readyStateMachine.state){if(this._webSocket.readyState===l.OPEN)try{r()}catch(e){}return n?(this._queuedMessages.push(e),"queued"):(this._logger.debug("Dropping message during reconnection since retryAfterReconnect is false:",e),"dropped")}return r()},n.close=function(e,n){if(this.readyState===t.CLOSING)throw new Error("Can not call close on a closing ReconnectableSocket");if(this.readyState===t.CLOSED)throw new Error("Can not call close on an already closed ReconnectableSocket");this.readyStateMachine.close({code:e,reason:n})},n._resetPingTimers=function(){this._pingWarningTimer.clear(),this._pingTimer.reset(()=>{this._pingWarningTimer.reset(()=>{this._logger.warn("Did not send message after needsPing event. Other side may disconnect.")}),this.emit("needsPing")})},n._resetDisconnectTimer=function(){this._disconnectTimer.reset(()=>this.readyStateMachine.disconnect({code:v,reason:"No activity"}))},n._clearTimers=function(){[this._disconnectTimer,this._connectTimer,this._pingTimer,this._pingWarningTimer].forEach(e=>e.clear())},t}(r),(0,u.default)(t,"CONNECTING",l.CONNECTING),(0,u.default)(t,"OPEN",l.OPEN),(0,u.default)(t,"CLOSING",l.CLOSING),(0,u.default)(t,"CLOSED",l.CLOSED),n}},function(e,t,n){"use strict";var r=n(3);t.__esModule=!0,t.default=void 0;var o=r(n(18));let i=function(){function e(e){let t=e.name,n=e.logger,r=e.duration;(0,o.default)(this,"name",void 0),(0,o.default)(this,"logger",void 0),(0,o.default)(this,"duration",void 0),(0,o.default)(this,"currId",void 0),this.name=t,this.logger=n,this.duration=r}var t=e.prototype;return t.reset=function(e){this.clear();const t=setTimeout(()=>{void 0!==this.currId&&(this.logger.spam(`${this.name} timer with id ${this.currId} expired, entering callback`),this.currId=void 0,e())},this.duration);this.currId=t,this.logger.spam(`Started ${this.name} timer with id ${this.currId}, expires in `+this.duration+"ms")},t.clear=function(){void 0!==this.currId&&(clearTimeout(this.currId),this.logger.spam(`Cleared ${this.name} timer with id ${this.currId}`),this.currId=void 0)},t.isRunning=function(){return void 0!==this.currId},e}();t.default=i},function(e,t,n){"use strict";var r=n(3);t.__esModule=!0,t.default=void 0;var o=r(n(305)),i=r(n(704)),s=n(76);const a=(0,r(n(1)).default)("ReconnectableSocketStateMachine"),c=s.codes.CLOSE_UNSUPPORTED,u=s.codes.CLOSE_UNEXPECTED_CONDITION;t.default=e=>{let t,n=e.reconnectMaxDuration,r=e.CLOSED,s=e.CLOSING;return new o.default({init:"connecting",methods:{onInvalidTransition(e,t,n){a.error("Invalid state transition",{transition:e,from:t,to:n})}},transitions:[{name:"open",from:["connecting","reconnecting"],to:"open"},{name:"close",from:["connecting","reconnecting","open"],to:"closing"},{name:"closed",from:"closing",to:"closed"},{name:"disconnect",from:["reconnecting","open","connecting"],to:function(e){let o=e.code;return"open"!==this.state&&t||(t=(0,i.default)(n)),n>0&&!t()&&-1===[c,u].indexOf(o)&&-1===[r,s].indexOf(this.readyState)?"reconnecting":"closing"}}]})}},function(e,t,n){"use strict";e.exports=e=>{let t=!1;return setTimeout(()=>{t=!0},e),()=>t}},function(e,t,n){"use strict";var r=n(3);t.__esModule=!0,t.default=void 0;var o=r(n(12)),i=r(n(13)),s=r(n(106)),a=function(){var e=(0,i.default)(o.default.mark((function e(t,n){var r,i,a,c,u,d;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=(r=void 0===n?{}:n).BUFFER_DRAIN_INTERVAL,a=void 0===i?100:i,c=r.BUFFER_DRAIN_MAX_RETRIES,u=void 0===c?10:c,d=0;case 2:if(!(d<u)){e.next=10;break}if(0!==t.bufferedAmount){e.next=5;break}return e.abrupt("break",10);case 5:return e.next=7,(0,s.default)(a);case 7:d+=1,e.next=2;break;case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.default=a},function(e,t,n){"use strict";var r=n(108),o=n(3);t.__esModule=!0,t.default=void 0;var i=o(n(157)),s=o(n(46)),a=o(n(60)),c=o(n(18)),u=o(n(19)),d=o(n(314)),l=o(n(707)),p=r(n(172)),f=o(n(710)),h=n(76);t.default=e=>{var t,n;let r=e.EventEmitter,o=e.ReconnectableSocket,m=e.logging,b=e.allocateId;return n=t=function(e){function t(t){var n;let r=t.messagingURL,s=t.notifyDisconnectAddress,a=t.connectionId,p=t.enableReconnection,g=t.pingThreshold,v=void 0===g?2e3:g,y=t.disconnectThreshold,S=void 0===y?(p?3:25)*v-100:y,E=t.reconnectMaxDuration,T=void 0===E?p?6e4:0:E;n=e.call(this)||this,(0,c.default)((0,i.default)(n),"url",void 0),(0,c.default)((0,i.default)(n),"id",void 0),(0,c.default)((0,i.default)(n),"_opened",!1),(0,c.default)((0,i.default)(n),"_socket",void 0),(0,c.default)((0,i.default)(n),"_reconnectAttempts",0),(0,c.default)((0,i.default)(n),"_socketID",(0,u.default)()),(0,c.default)((0,i.default)(n),"_receivedTransactionIDs",[]),(0,c.default)((0,i.default)(n),"_notifyDisconnectAddress",void 0),(0,c.default)((0,i.default)(n),"_enableReconnection",void 0),(0,c.default)((0,i.default)(n),"_pendingMessages",[]),(0,c.default)((0,i.default)(n),"_logger",m("RumorSocket:"+b())),(0,d.default)({logger:n._logger,obj:(0,i.default)(n),eventNames:["open","message","error","reconnecting","reconnectAttempt","reconnectFailure","reconnected","close"]}),n.url=r,n.id=a,n._notifyDisconnectAddress=s,n._enableReconnection=p,n.on("error",e=>{n._logger.error(e.message)});try{n._socket=new o({url:()=>n._enableReconnection?[n.url,n.url.indexOf("?")>=0?"&":"?","socketId="+n._socketID,n._socket&&n._socket.reconnecting?"&reconnect=true":"","&attempt="+(0,u.default)()].join(""):n.url,pingThreshold:v,disconnectThreshold:S,reconnectMaxDuration:T})}catch(e){n._logger.error(e),n.emit("error",new f.default(h.codes.CLOSE_CONNECT_EXCEPTION))}const C=()=>{n._opened=!0,n._socket.send(l.default.Connect(n.id,s).serialize()),n.emit("open",n.id)};return n._socket.once("open",C),n._socket.on("message",e=>n._receiveMessage(e)),n._socket.once("close",e=>{n._logger.debug(`ReconnectableSocket closed (code: ${e.code})`),n._clearPendingMessages();-1===[h.codes.CLOSE_NORMAL,h.codes.CLOSE_GOING_AWAY,h.codes.CLOSE_TIMEOUT].indexOf(e.code)&&n.emit("error",new f.default(e.code,e.reason||e.message)),n.emit("close",e)}),n._socket.on("error",e=>{let t=e.code;return n.emit("error",new f.default(t))}),n._socket.on("needsPing",()=>{n._socket.send(l.default.Ping().serialize())}),n._socket.on("reconnecting",()=>{n._opened&&(n._clearPendingMessagesWhichShouldntRetry(),n.emit("reconnecting"),n._reconnectAttempts=0)}),n._socket.on("reconnectAttempt",()=>{n._opened&&(n._reconnectAttempts+=1,n._socket.send(l.default.Disconnect("1").serialize(),!1),n.emit("reconnectAttempt"))}),n._socket.on("reconnected",()=>{n._opened?(n._pendingMessages.forEach(e=>{n._socket.send(e.rumorMessage.serialize())}),n.emit("reconnected")):C()}),n._socket.on("reconnectFailure",()=>{n._opened&&(n._logger.debug("Reconnecting failed as connectivity was not restored within "+T+"ms"),n.emit("reconnectFailure",new f.default))}),n}(0,a.default)(t,e),(0,s.default)(t,[{key:"readyState",get:function(){return this._socket?this._socket.readyState:o.CONNECTING}},{key:"reconnecting",get:function(){return this._opened&&this._socket&&this._socket.reconnecting}}]);var n=t.prototype;return n._clearPendingMessagesWhichShouldntRetry=function(){const e=this._pendingMessages.filter(e=>!e.retryAfterReconnect);this._pendingMessages=this._pendingMessages.filter(e=>e.retryAfterReconnect),e.forEach(e=>{const t=new Error("Not connected.");t.code=500,e.completion(t)})},n._clearPendingMessages=function(){this._pendingMessages.forEach(e=>{const t=new Error("Not connected.");t.code=500,e.completion(t)}),this._pendingMessages=[]},n._sendAck=function(e){this._socket.send(l.default.Status([e.fromAddress],{"TRANSACTION-ID":e.headers["TRANSACTION-ID"],"X-TB-FROM-ADDRESS":this.id}).serialize())},n._receiveMessage=function(e){const t=l.default.deserialize(e.data);if(t.type!==p.PONG){if(this._logger.debug("Received:",t),t.transactionId&&(this._pendingMessages=this._pendingMessages.filter(e=>(e.rumorMessage.transactionId===t.transactionId&&(this._logger.debug("Marking",t.transactionId," as received"),e.completion(void 0,t)),e.rumorMessage.transactionId!==t.transactionId))),t.transactionId&&t.type!==p.STATUS){if(this._sendAck(t),this._receivedTransactionIDs.indexOf(t.transactionId)>=0)return;this._receivedTransactionIDs.push(t.transactionId)}this.emit("message",t)}},n.publish=function(e,t,n,r,o){void 0===o&&(o=()=>{});const i=l.default.Publish(e,t,n);if("dropped"===this._socket.send(i.serialize(),!1)&&!r){const e=new Error("Not connected.");return e.code=500,void o(e)}this._pendingMessages.push({rumorMessage:i,retryAfterReconnect:r,completion:o})},n.subscribe=function(e){this._socket.send(l.default.Subscribe(e).serialize())},n.unsubscribe=function(e){this._socket.send(l.default.Unsubscribe(e).serialize())},n.disconnect=function(){if(this.readyState===t.OPEN&&this._socket.send(l.default.Disconnect().serialize()),this._socket.readyState!==o.CLOSED&&this._socket.readyState!==o.CLOSING){const e=h.codes.CLOSE_NORMAL;this._socket.close(e,h.messages[e])}},n.status=function(e,t){this._socket.send(l.default.Status(e,{"TRANSACTION-ID":t,"X-TB-FROM-ADDRESS":this.id}).serialize())},n.reconnectRetriesCount=function(){return this._reconnectAttempts},n.messageQueueSize=function(){return this._pendingMessages.length},(0,s.default)(t,[{key:"socketID",get:function(){return this._socketID}}]),t}(r),(0,c.default)(t,"CONNECTING",o.CONNECTING),(0,c.default)(t,"OPEN",o.OPEN),(0,c.default)(t,"CLOSING",o.CLOSING),(0,c.default)(t,"CLOSED",o.CLOSED),n}},function(e,t,n){"use strict";var r=n(108),o=n(3);t.__esModule=!0,t.default=void 0;var i=o(n(18)),s=o(n(19)),a=n(708),c=r(n(172));let u=function(){function e(e,t,n,r){(0,i.default)(this,"type",void 0),(0,i.default)(this,"toAddress",void 0),(0,i.default)(this,"headers",void 0),(0,i.default)(this,"data",void 0),this.type=e,this.toAddress=t,this.headers=n,this.data=r,this.fromAddress=this.headers["X-TB-FROM-ADDRESS"],this.transactionId=this.headers["TRANSACTION-ID"],this.status=this.headers.STATUS,this.isError=this.status&&"2"!==this.status[0]}return e.prototype.serialize=function(){let e,t,n,r,o=8,i=7;const s=[],c=[],u=[];for(i++,n=0;n<this.toAddress.length;n++)s.push(new a.TextEncoder("utf-8").encode(this.toAddress[n])),i+=2,i+=s[n].length;i++,n=0;for(const e in this.headers)this.headers.hasOwnProperty(e)&&(c.push(new a.TextEncoder("utf-8").encode(e)),u.push(new a.TextEncoder("utf-8").encode(this.headers[e])),i+=4,i+=c[n].length,i+=u[n].length,n++);t=new a.TextEncoder("utf-8").encode(this.data),i+=t.length;const d=new ArrayBuffer(i),l=new Uint8Array(d,0,i);for(i-=4,l[0]=(4278190080&i)>>>24,l[1]=(16711680&i)>>>16,l[2]=(65280&i)>>>8,l[3]=(255&i)>>>0,l[4]=0,l[5]=0,l[6]=this.type,l[7]=this.toAddress.length,n=0;n<s.length;n++)for(e=s[n],l[o++]=e.length>>8&255,l[o++]=e.length>>0&255,r=0;r<e.length;r++)l[o++]=e[r];for(l[o++]=c.length,n=0;n<c.length;n++){for(e=c[n],l[o++]=e.length>>8&255,l[o++]=e.length>>0&255,r=0;r<e.length;r++)l[o++]=e[r];for(e=u[n],l[o++]=e.length>>8&255,l[o++]=e.length>>0&255,r=0;r<e.length;r++)l[o++]=e[r]}for(n=0;n<t.length;n++)l[o++]=t[n];return d},e.deserialize=function(t){let n,r,o,i,s,c,u,d;(void 0!==typeof window?window:global).Buffer&&(void 0!==typeof window?window:global).Buffer.isBuffer(t)&&(t=(e=>{const t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0;t<e.length;++t)n[t]=e[t];return t})(t));let l=8;const p=new Uint8Array(t);n=p[6];const f=[];for(d=0;d<p[7];d++)u=p[l++]<<8,u+=p[l++],r=new Uint8Array(t,l,u),f[d]=new a.TextDecoder("utf-8").decode(r),l+=u;for(o=p[l++],i={},d=0;d<o;d++)u=p[l++]<<8,u+=p[l++],r=new Uint8Array(t,l,u),s=new a.TextDecoder("utf-8").decode(r),l+=u,u=p[l++]<<8,u+=p[l++],r=new Uint8Array(t,l,u),c=new a.TextDecoder("utf-8").decode(r),i[s]=c,l+=u;const h=new Uint8Array(t,l);return new e(n,f,i,new a.TextDecoder("utf-8").decode(h))},e.Connect=function(t,n){const r={uniqueId:t,"TRANSACTION-ID":(0,s.default)(),notifyDisconnectAddress:n};return new e(c.CONNECT,[],r,"")},e.Disconnect=function(t){return new e(c.DISCONNECT,[],{reconnect:t},"")},e.Subscribe=function(t){return new e(c.SUBSCRIBE,t,{},"")},e.Unsubscribe=function(t){return new e(c.UNSUBSCRIBE,t,{},"")},e.Publish=function(t,n,r){return new e(c.MESSAGE,t,r||{},n||"")},e.Status=function(t,n){return new e(c.STATUS,t,n||{},"")},e.Ping=function(){return new e(c.PING,[],{},"")},e}();t.default=u},function(e,t,n){"use strict";var r=n(108);t.__esModule=!0,t.TextDecoder=t.TextEncoder=void 0;var o=r(n(709));const i=(void 0!==typeof window?window:global).TextEncoder||o.TextEncoder;t.TextEncoder=i;const s=(void 0!==typeof window?window:global).TextDecoder||o.TextDecoder;t.TextDecoder=s},function(e,t,n){"use strict";function r(e,t,n){return t<=e&&e<=n}function o(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}n.r(t),n.d(t,"TextEncoder",(function(){return c})),n.d(t,"TextDecoder",(function(){return a}));function i(e){this.tokens=[].slice.call(e)}i.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};function s(e,t){if(e)throw TypeError("Decoder error");return t||65533}function a(e,t){if(!(this instanceof a))return new a(e,t);if("utf-8"!==(e=void 0!==e?String(e).toLowerCase():"utf-8"))throw new Error("Encoding not supported. Only utf-8 is supported");t=o(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(t.fatal),this._ignoreBOM=Boolean(t.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function c(e,t){if(!(this instanceof c))return new c(e,t);if("utf-8"!==(e=void 0!==e?String(e).toLowerCase():"utf-8"))throw new Error("Encoding not supported. Only utf-8 is supported");t=o(t),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(t.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function u(e){var t=e.fatal,n=0,o=0,i=0,a=128,c=191;this.handler=function(e,u){if(-1===u&&0!==i)return i=0,s(t);if(-1===u)return-1;if(0===i){if(r(u,0,127))return u;if(r(u,194,223))i=1,n=u-192;else if(r(u,224,239))224===u&&(a=160),237===u&&(c=159),i=2,n=u-224;else{if(!r(u,240,244))return s(t);240===u&&(a=144),244===u&&(c=143),i=3,n=u-240}return n<<=6*i,null}if(!r(u,a,c))return n=i=o=0,a=128,c=191,e.prepend(u),s(t);if(a=128,c=191,n+=u-128<<6*(i-(o+=1)),o!==i)return null;var d=n;return n=i=o=0,d}}function d(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(r(t,0,127))return t;var n,o;r(t,128,2047)?(n=1,o=192):r(t,2048,65535)?(n=2,o=224):r(t,65536,1114111)&&(n=3,o=240);for(var i=[(t>>6*n)+o];n>0;){var s=t>>6*(n-1);i.push(128|63&s),n-=1}return i}}a.prototype={decode:function(e,t){var n;n="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=o(t),this._streaming||(this._decoder=new u({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var r,s=new i(n),a=[];!s.endOfStream()&&-1!==(r=this._decoder.handler(s,s.read()));)null!==r&&(Array.isArray(r)?a.push.apply(a,r):a.push(r));if(!this._streaming){do{if(-1===(r=this._decoder.handler(s,s.read())))break;null!==r&&(Array.isArray(r)?a.push.apply(a,r):a.push(r))}while(!s.endOfStream());this._decoder=null}return a.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.shift()):this._BOMseen=!0)),function(e){for(var t="",n=0;n<e.length;++n){var r=e[n];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode(55296+(r>>10),56320+(1023&r)))}return t}(a)}},c.prototype={encode:function(e,t){e=e?String(e):"",t=o(t),this._streaming||(this._encoder=new d(this._options)),this._streaming=Boolean(t.stream);for(var n,r=[],s=new i(function(e){for(var t=String(e),n=t.length,r=0,o=[];r<n;){var i=t.charCodeAt(r);if(i<55296||i>57343)o.push(i);else if(56320<=i&&i<=57343)o.push(65533);else if(55296<=i&&i<=56319)if(r===n-1)o.push(65533);else{var s=e.charCodeAt(r+1);if(56320<=s&&s<=57343){var a=1023&i,c=1023&s;o.push(65536+(a<<10)+c),r+=1}else o.push(65533)}r+=1}return o}(e));!s.endOfStream()&&-1!==(n=this._encoder.handler(s,s.read()));)Array.isArray(n)?r.push.apply(r,n):r.push(n);if(!this._streaming){for(;-1!==(n=this._encoder.handler(s,s.read()));)Array.isArray(n)?r.push.apply(r,n):r.push(n);this._encoder=null}return new Uint8Array(r)}}},function(e,t,n){"use strict";var r=n(108),o=n(3);t.__esModule=!0,t.default=void 0;var i=o(n(18)),s=r(n(76));t.default=function(e,t){void 0===e&&(e=s.codes.CLOSE_FALLBACK_CODE),void 0===t&&(t=s.messages[e]||"No message available from code."),(0,i.default)(this,"code",void 0),(0,i.default)(this,"message",void 0),this.code=e,this.message=t}},function(e,t,n){"use strict";var r=n(3);t.__esModule=!0,t.default=void 0;var o=r(n(712)),i=(void 0!==typeof window?window:global).WebSocket?(void 0!==typeof window?window:global).WebSocket:o.default;t.default=i},function(e,t,n){"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},function(e,t,n){"use strict";const r=n(714);e.exports=function(e){const t=r(e.data);return t.transactionId=e.transactionId,t.fromAddress=e.headers["X-TB-FROM-ADDRESS"],t}},function(e,t,n){"use strict";e.exports=function(e){if(0===e.length)return{};const t=JSON.parse(e),n=t.uri.substr(1).split("/");n.shift(),""===n[n.length-1]&&n.pop(),t.params={};for(let e=0,r=n.length;e<r-1;e+=2)t.params[n[e]]=n[e+1];return n.length%2==0?"channel"===n[n.length-2]&&n.length>6?t.resource=`${n[n.length-4]}_${n[n.length-2]}`:t.resource=n[n.length-2]:"channel"===n[n.length-1]&&n.length>5?t.resource=`${n[n.length-3]}_${n[n.length-1]}`:t.resource=n[n.length-1],t.signature=`${t.resource}#${t.method}`,t}},function(e,t,n){"use strict";const r=n(2).name,o=n(61).once;e.exports=()=>o()&&["Chrome","Firefox","Safari"].indexOf(r)>-1},function(e,t,n){"use strict";const r=n(2),o=n(61).once;e.exports=()=>o()&&("Chrome"===r.name||"Firefox"===r.name||"Node"===r.name||"Safari"===r.name||"Edge"===r.name)},function(e,t,n){"use strict";const r=n(61).once;e.exports=()=>r()},function(e,t,n){"use strict";e.exports="DTLS_SRTP"},function(e,t,n){"use strict";e.exports=function(e){let t=e.supportsWebRTC;return{supportsWebRTC:"true"===t||!0===t}}},function(e,t,n){"use strict";e.exports=function(e,t){this.code=e,this.message=t,this.reason=t}},function(e,t,n){"use strict";e.exports=function(e){const t=[];this.enqueue=function(){t.push(Array.prototype.slice.call(arguments))},this.triggerAll=function(){let n;for(;n=t.shift();)e.trigger(...n)}}},function(e,t,n){"use strict";var r=n(3)(n(20));const o=n(207),i=n(240),s=n(57),a=n(7),c=n(141),u=n(8),d=n(723),l=n(724),p=n(289).default,f={EMPTY_RESPONSE:"Response body was empty, probably due to connectivity loss",BADLY_FORMED:"Unknown error: JSON response was badly formed",NO_ERROR:"No error message",UNEXPECTED_SERVER_RESPONSE:e=>`Unexpected server response (${e}). Try this operation again later.`},h=[0,600,1200];e.exports=function(e){let t=void 0===e?{}:e,n=t.axios,m=void 0===n?o:n,b=t.retryDelays,g=void 0===b?h:b;return p((function(e){let t=e.anvilUrl,n=e.sessionId,o=e.token,p=e.clientVersion,h=e.connectionId;const b=i.parse(t,!0),g=i.format({protocol:b.protocol,auth:b.auth,host:b.host,pathname:i.resolve((b.pathname||"").replace(/\/?$/,"/"),"session/"+n),query:(0,r.default)({},b.query,{extended:!0})});return m.get(g,{validateStatus:e=>e>=200&&e<300,headers:{"X-OPENTOK-AUTH":o,"X-TB-VERSION":1,"X-TB-CLIENT-VERSION":p,"X-TB-CONNECTIONID":h,Accept:"application/json"}}).catch(e=>{if(e.response){const t=new Error(f.UNEXPECTED_SERVER_RESPONSE(`${e.response.statusCode}${e.response.status?" "+e.response.status:""}`));throw t.code=u.ANVIL_INVALID_HTTP_STATUS,t.name=d(t.code),t}if(e.request){const e=new Error(f.CONNECT_FAILED);throw e.code=u.ANVIL_CONNECT_FAILED,e.name=d(e.code),e}{const t=u.ANVIL_UNKNOWN_HTTP_ERROR,n=d(e.code);throw a(e,{code:t,name:n}),e}}).then(e=>{let t=e.data;if("string"==typeof t){if(t.length>0)try{JSON.parse(t)}catch(e){throw e.message=f.UNEXPECTED_SERVER_RESPONSE(e.toString()),e.code=u.ANVIL_XDOMAIN_OR_PARSING_ERROR,e.name=d(e.code),e}const e=new Error(0===t.length?f.EMPTY_RESPONSE:f.BADLY_FORMED);throw e.code=0===t.length?u.ANVIL_EMPTY_RESPONSE_BODY:u.ANVIL_BADLY_FORMED_RESPONSE,e.name=d(e.code),e}if(null===t||0===t.length){const e=new Error(f.EMPTY_RESPONSE);throw e.code=u.ANVIL_EMPTY_RESPONSE_BODY,e.name=d(e.code),e}const n=t.filter(e=>null!=e.error)[0];if(n){const e=l(s(n,"error.code","500"));"Invalid token format"===s(n,"error.errorMessage.message")&&(n.error.errorMessage.message+=" Token: "+o);const t=new Error(s(n,"error.errorMessage.message",void 0===e?"Unknown error: "+n.error.code:f.NO_ERROR));throw t.code=e||u.ANVIL_UNEXPECTED_ERROR_CODE,t.name=d(t.code),t}return new c(t[0])})}),(e,t)=>e.code&&e.code>=3e3&&e.code<=3007&&g[t])}},function(e,t,n){"use strict";const r=n(8),o=n(4),i={[r.ANVIL_BADLY_FORMED_RESPONSE]:o.BADLY_FORMED_RESPONSE,[r.ANVIL_INVALID_HTTP_STATUS]:o.INVALID_HTTP_STATUS,[r.ANVIL_XDOMAIN_OR_PARSING_ERROR]:o.XDOMAIN_OR_PARSING_ERROR,[r.ANVIL_UNKNOWN_HTTP_ERROR]:o.UNKNOWN_HTTP_ERROR,[r.ANVIL_UNEXPECTED_ERROR_CODE]:o.UNEXPECTED_ERROR_CODE,[r.ANVIL_EMPTY_RESPONSE_BODY]:o.EMPTY_RESPONSE_BODY,[r.ANVIL_CONNECT_FAILED]:o.CONNECT_FAILED,[r.AUTHENTICATION_ERROR]:o.AUTHENTICATION_ERROR,[r.INVALID_SESSION_ID]:o.INVALID_SESSION_ID,[r.TERMS_OF_SERVICE_FAILURE]:o.TERMS_OF_SERVICE_FAILURE,[r.UNEXPECTED_SERVER_RESPONSE]:o.UNEXPECTED_SERVER_RESPONSE};e.exports=function(e){return i[e]}},function(e,t,n){"use strict";const r=n(8),o={400:r.INVALID_SESSION_ID,403:r.AUTHENTICATION_ERROR,404:r.INVALID_SESSION_ID,409:r.TERMS_OF_SERVICE_FAILURE,500:r.UNEXPECTED_SERVER_RESPONSE};e.exports=function(e){return o[e]}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.Session||n(310)(),r=e.sessionObjects||n(21);return function(e,n,o){null==n&&(n=e,e=null),Array.isArray(n)&&1===n.length&&(n=n[0]);let i=r.sessions.get(n);return i||(i=new t(e,n,o),r.sessions.add(i)),i}}},function(e,t,n){"use strict";var r=n(3),o=r(n(12)),i=r(n(13));const s=n(727),a=n(273),c=n(2),u=n(4),d=n(8),l=n(11)(),p=n(51),f=n(73),h=n(142)(void 0!==typeof window?window:global);function m(e){return a(s(e,["AV1X","AV1","VP9","rtx","red","ulpfec","H265","X-H264UC","x-ulpfecuc"]))}const b=function(){var e=(0,i.default)(o.default.mark((function e(){var t,n,r,i,s,a,b;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof window){e.next=2;break}return e.abrupt("return",{videoEncoders:[],videoDecoders:[]});case 2:if(t=h.RTCPeerConnection,!window.RTCRtpSender||!("getCapabilities"in window.RTCRtpSender)){e.next=7;break}return n=m(n=window.RTCRtpSender.getCapabilities("video").codecs.map(e=>e.mimeType||e.name).map(e=>e.replace("video/",""))),e.abrupt("return",{videoEncoders:n,videoDecoders:n});case 7:if("Chrome"!==c.name||"captureStream"in window.HTMLCanvasElement.prototype){e.next=9;break}return e.abrupt("return",{videoEncoders:["VP8"],videoDecoders:["VP8"]});case 9:if(!c.isLegacyEdge){e.next=11;break}return e.abrupt("return",{videoEncoders:["H264","VP8"],videoDecoders:["H264","VP8"]});case 11:return(r=window.document.createElement("canvas")).getContext("2d"),i=r.captureStream(),e.prev=14,a={iceServers:[]},f()&&(a.sdpSemantics="plan-b"),(s=new t(a)).addTrack?s.addTrack(i.getVideoTracks()[0],i):s.addStream&&s.addStream(i),e.next=21,s.createOffer();case 21:return b=e.sent,n=m(n=p.getCodecs(b.sdp,"video")||[]),e.abrupt("return",{videoEncoders:n,videoDecoders:n});case 27:throw e.prev=27,e.t0=e.catch(14),l(u.UNABLE_TO_ACCESS_MEDIA_ENGINE,new Error("OT.getSupportedCodecs was not able to get the list of supported codecs"),d.UNABLE_TO_ACCESS_MEDIA_ENGINE);case 30:return e.prev=30,s.close(),e.finish(30);case 33:case"end":return e.stop()}}),e,null,[[14,27,30,33]])})));return function(){return e.apply(this,arguments)}}();e.exports=b},function(e,t,n){var r=n(728),o=n(238),i=n(87),s=n(129),a=i((function(e,t){return s(e)?r(e,o(t,1,s,!0)):[]}));e.exports=a},function(e,t,n){var r=n(92),o=n(93),i=n(128),s=n(33),a=n(68),c=n(94);e.exports=function(e,t,n,u){var d=-1,l=o,p=!0,f=e.length,h=[],m=t.length;if(!f)return h;n&&(t=s(t,a(n))),u?(l=i,p=!1):t.length>=200&&(l=c,p=!1,t=new r(t));e:for(;++d<f;){var b=e[d],g=null==n?b:n(b);if(b=u||0!==b?b:0,p&&g==g){for(var v=m;v--;)if(t[v]===g)continue e;h.push(b)}else l(t,g,u)||h.push(b)}return h}},function(e,t,n){"use strict";const r=n(24)().getInputMediaDevices;e.exports=function(e){r().then(t=>e(void 0,t),e)}},function(e,t,n){"use strict";var r=n(3),o=r(n(12)),i=r(n(13));e.exports=function(e){void 0===e&&(e={});const t=e.deviceHelpers||n(24)(),r=t.hasAudioOutputApiSupport,s=t.hasDevice,a=e.getAudioOutputDevices||n(321),c=e.updateSubscribersSinkId||n(323),u=n(11)(),d=n(4);return function(){var e=(0,i.default)(o.default.mark((function e(t){var n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r()){e.next=2;break}throw u(d.UNSUPPORTED_BROWSER,new Error("setAudioOutputDevice is not supported in your browser."));case 2:return e.next=4,a();case 4:if(n=e.sent,s(n,t)){e.next=8;break}throw u(d.INVALID_AUDIO_OUTPUT_SOURCE,new Error("The requested device is not valid."));case 8:return e.prev=8,e.next=11,c(t);case 11:e.next=16;break;case 13:throw e.prev=13,e.t0=e.catch(8),u(d.REQUESTED_DEVICE_PERMISSION_DENIED,new Error("No permission to use the requested device."));case 16:case"end":return e.stop()}}),e,null,[[8,13]])})));return function(t){return e.apply(this,arguments)}}()}},function(e,t,n){"use strict";var r=n(3),o=r(n(12)),i=r(n(13));const s=n(732)(),a=n(24)(),c=a.hasAudioOutputApiSupport,u=a.getNativeMediaDevices;e.exports=()=>{if(c()){const e=u();let t=!1;e.addEventListener("devicechange",(0,i.default)(o.default.mark((function e(){return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=2;break}return e.abrupt("return");case 2:return t=!0,e.next=5,s();case 5:t=!1;case 6:case"end":return e.stop()}}),e)}))))}}},function(e,t,n){"use strict";var r=n(3),o=r(n(12)),i=r(n(13));e.exports=function(e){void 0===e&&(e={});const t=e.deviceHelpers||n(24)(),r=t.getAudioOutputMediaDevices,s=t.getDefaultAudioOutputDeviceId,a=t.hasDevice,c=e.currentAudioOutputDevice||n(105),u=c.getCurrentAudioOutputDeviceId,d=c.setCurrentAudioOutputDeviceId,l=e.updateSubscribersSinkId||n(323),p=e.logging||n(1)("currentAudioOutputDevice");return function(){var e=(0,i.default)(o.default.mark((function e(){var t,n;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r();case 2:if(0!==(t=e.sent).length){e.next=6;break}return d(""),e.abrupt("return");case 6:if(!a(t,u())){e.next=9;break}return e.abrupt("return");case 9:return n=s(t),d(n),e.prev=11,e.next=14,l(n);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(11),p.debug("Failed to set the default audio output device.",e.t0);case 19:case"end":return e.stop()}}),e,null,[[11,16]])})));return function(){return e.apply(this,arguments)}}()}}])}));
|
|
28
|
+
*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function s(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,c=s(e),u=1;u<arguments.length;u++){for(var d in n=Object(arguments[u]))i.call(n,d)&&(c[d]=n[d]);if(r){a=r(n);for(var l=0;l<a.length;l++)o.call(n,a[l])&&(c[a[l]]=n[a[l]])}}return c}},function(e,t,n){(function(e,r){var i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},o=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(c(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,s=String(e).replace(o,(function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),a=r[n];n<i;a=r[++n])g(a)||!S(a)?s+=" "+a:s+=" "+c(a);return s},t.deprecate=function(n,r){if(void 0!==e&&!0===e.noDeprecation)return n;if(void 0===e)return function(){return t.deprecate(n,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(r);e.traceDeprecation?console.trace(r):console.error(r),i=!0}return n.apply(this,arguments)}};var s,a={};function c(e,n){var r={seen:[],stylize:d};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&t._extend(r,n),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),l(r,e,r.depth)}function u(e,t){var n=c.styles[t];return n?"["+c.colors[n][0]+"m"+e+"["+c.colors[n][1]+"m":e}function d(e,t){return e}function l(e,n,r){if(e.customInspect&&n&&T(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return v(i)||(i=l(e,i,r)),i}var o=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(v(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(b(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(e,n);if(o)return o;var s=Object.keys(n),a=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(n)),w(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(n);if(0===s.length){if(T(n)){var c=n.name?": "+n.name:"";return e.stylize("[Function"+c+"]","special")}if(E(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(_(n))return e.stylize(Date.prototype.toString.call(n),"date");if(w(n))return p(n)}var u,d="",S=!1,C=["{","}"];(h(n)&&(S=!0,C=["[","]"]),T(n))&&(d=" [Function"+(n.name?": "+n.name:"")+"]");return E(n)&&(d=" "+RegExp.prototype.toString.call(n)),_(n)&&(d=" "+Date.prototype.toUTCString.call(n)),w(n)&&(d=" "+p(n)),0!==s.length||S&&0!=n.length?r<0?E(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=S?function(e,t,n,r,i){for(var o=[],s=0,a=t.length;s<a;++s)O(t,String(s))?o.push(f(e,t,n,r,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(f(e,t,n,r,i,!0))})),o}(e,n,r,a,s):s.map((function(t){return f(e,n,r,a,t,S)})),e.seen.pop(),function(e,t,n){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(u,d,C)):C[0]+d+C[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,i,o){var s,a,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),O(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(c.value)<0?(a=g(n)?l(e,c.value,null):l(e,c.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),y(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function h(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function b(e){return"number"==typeof e}function v(e){return"string"==typeof e}function y(e){return void 0===e}function E(e){return S(e)&&"[object RegExp]"===C(e)}function S(e){return"object"==typeof e&&null!==e}function _(e){return S(e)&&"[object Date]"===C(e)}function w(e){return S(e)&&("[object Error]"===C(e)||e instanceof Error)}function T(e){return"function"==typeof e}function C(e){return Object.prototype.toString.call(e)}function I(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(y(s)&&(s=e.env.NODE_DEBUG||""),n=n.toUpperCase(),!a[n])if(new RegExp("\\b"+n+"\\b","i").test(s)){var r=e.pid;a[n]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",n,r,e)}}else a[n]=function(){};return a[n]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=m,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=E,t.isObject=S,t.isDate=_,t.isError=w,t.isFunction=T,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(576);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(){var e=new Date,t=[I(e.getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":");return[e.getDate(),R[e.getMonth()],t].join(" ")}function O(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",x(),t.format.apply(t,arguments))},t.inherits=n(577),t._extend=function(e,t){if(!t||!S(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function N(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(k&&e[k]){var t;if("function"!=typeof(t=e[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,k,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,i=new r((function(e,r){t=e,n=r})),o=[],s=0;s<arguments.length;s++)o.push(arguments[s]);o.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,o)}catch(e){n(e)}return i}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),k&&Object.defineProperty(t,k,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=k,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var i=n.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};t.apply(this,n).then((function(t){e.nextTick(s,null,t)}),(function(t){e.nextTick(N,t,s)}))}return Object.setPrototypeOf(n,Object.getPrototypeOf(t)),Object.defineProperties(n,i(t)),n}}).call(this,n(43),n(0))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){var r=n(579),i=n(264),o=n(265),s=n(60);e.exports=function(e){return function(t){t=s(t);var n=i(t)?o(t):void 0,a=n?n[0]:t.charAt(0),c=n?r(n,1).join(""):t.slice(1);return a[e]()+c}}},function(e,t,n){var r=n(263);e.exports=function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:r(e,t,n)}},function(e,t){e.exports=function(e){return e.split("")}},function(e,t){var n="[\\ud800-\\udfff]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^\\ud800-\\udfff]",s="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",c="(?:"+r+"|"+i+")"+"?",u="[\\ufe0e\\ufe0f]?"+c+("(?:\\u200d(?:"+[o,s,a].join("|")+")[\\ufe0e\\ufe0f]?"+c+")*"),d="(?:"+[o+r+"?",r,s,a,n].join("|")+")",l=RegExp(i+"(?="+i+")|"+d+u,"g");e.exports=function(e){return e.match(l)||[]}},function(e,t,n){"use strict";e.exports=["screen","window","tab","browser","application"]},function(e,t,n){"use strict";const r=n(1),i=n(34)(),o=n(50),s=n(120),a=n(585),c=n(588),u=i.onlyLocal(),d=r("setLogLevel"),l=o(()=>{d.info("%c\n ██████╗ ██████╗ ███████╗███╗ ██╗████████╗ ██████╗ ██╗ ██╗\n██╔═══██╗██╔══██╗██╔════╝████╗ ██║╚══██╔══╝██╔═══██╗██║ ██╔╝\n██║ ██║██████╔╝█████╗ ██╔██╗ ██║ ██║ ██║ ██║█████╔╝\n██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║ ██║ ██║██╔═██╗\n╚██████╔╝██║ ███████╗██║ ╚████║ ██║ ╚██████╔╝██║ ██╗\n ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝",'font-family: "Fire Code", Courier, "Courier New", Consolas, "DejaVu Sans Mono"'),d.info("OpenTok JS SDK "+u.version),d.info(`Release notes: ${u.websiteUrl}/opentok/webrtc/docs/js/release-notes.html`),d.info(`Known issues: ${u.websiteUrl}/opentok/webrtc/docs/js/release-notes.htmll#knownIssues`)});function p(e){if(void 0===e||!a(s,{priority:e})&&0!==e){const t=c(s,(e,t)=>`OT.${t.toUpperCase()} = ${e.priority}`).join(", ");d.error("level must be one of: OT.NONE = 0, "+t),d.warn("Using OT.WARN instead"),e=s.warn.priority}r.setLogLevel(e),e>=s.debug.priority&&l();return d.info("OpenTok JS SDK now uses the debug library. More info at https://www.npmjs.com/package/debug#browser-support"),d.info("Changed log level to: "+e),e}p(u.debug?s.debug.priority:s.warn.priority),e.exports=p},function(e,t,n){var r=n(96);e.exports=function(e,t){var n;if("function"!=typeof t)throw new TypeError("Expected a function");return e=r(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}},function(e,t,n){var r=n(235),i=n(35),o=n(586),s=n(12),a=n(123);e.exports=function(e,t,n){var c=s(e)?r:o;return n&&a(e,t,n)&&(t=void 0),c(e,i(t,3))}},function(e,t,n){var r=n(268);e.exports=function(e,t){var n;return r(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}},function(e,t,n){var r=n(25);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,s=t?o:-1,a=Object(n);(t?s--:++s<o)&&!1!==i(a[s],s,a););return n}}},function(e,t,n){var r=n(33),i=n(35),o=n(589),s=n(12);e.exports=function(e,t){return(s(e)?r:o)(e,i(t,3))}},function(e,t,n){var r=n(268),i=n(25);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},function(e,t,n){"use strict";e.exports=function(e){return"http:"!==e.substr(0,5)&&"https:"!==e.substr(0,6)&&"data:image/png;base64,"!==e.substr(0,22)?"data:image/png;base64,"+e:e}},function(e,t,n){"use strict";const r=n(57),i=n(1)("Style");e.exports=function(e,t){const n=this,o={},s={buttonDisplayMode:["auto","mini","mini-auto","off","on"],nameDisplayMode:["auto","off","on"],audioLevelDisplayMode:["auto","off","on"],showSettingsButton:[!0,!1],showSpeakerButton:null,showMicButton:[!0,!1],backgroundImageURI:null,showControlBar:[!0,!1],showArchiveStatus:[!0,!1],archiveStatusDisplayMode:["auto","off","on"],videoDisabledDisplayMode:["auto","off","on"],audioBlockedDisplayMode:["auto","off","on"]};n.getAll=function(){return r(o)},n.get=function(e){return e?o[e]:n.getAll()},n.setAll=function(e,t){return Object.keys(e).forEach(r=>{n.set(r,e[r],t)}),n},n.set=function(e,r,a){let c;i.debug("setStyle: "+e.toString());const u=function(e){switch(e){case"true":return!0;case"false":return!1;default:return e}}(r);return function(e,t){const n=s[e];return void 0!==n&&(null===n||-1!==n.indexOf(t))}(e,u)?(c=o[e],u!==c&&(o[e]=u,a||t(e,r,c)),n):(i.warn(`Style.set::Invalid style property passed ${e} : ${u}`),n)},e&&n.setAll(e,!0)}},function(e,t,n){"use strict";const r=n(57);e.exports=function(e){const t=r(e);if(t.backgroundImageURI){const e=t.backgroundImageURI.split(":")[0];t.backgroundImageURI=-1!==["http","https","data"].indexOf(e)?e:"other"}return t}},function(e,t,n){"use strict";const r=n(3),i=n(271);e.exports=()=>Boolean("Node"!==r.name&&!r.isIosWebView&&(!!i()||(void 0!==typeof window?window:global).navigator.mediaDevices&&(void 0!==typeof window?window:global).navigator.mediaDevices.getUserMedia||(void 0!==typeof window?window:global).navigator.webkitGetUserMedia||(void 0!==typeof window?window:global).navigator.mozGetUserMedia))},function(e,t,n){"use strict";const r=n(3);e.exports=()=>"Node"!==r.name&&(!("function"!=typeof(void 0!==typeof window?window:global).webkitRTCPeerConnection||!(void 0!==typeof window?window:global).webkitRTCPeerConnection.prototype.addStream)||("function"==typeof(void 0!==typeof window?window:global).RTCPeerConnection||"function"==typeof(void 0!==typeof window?window:global).mozRTCPeerConnection&&r.version>20))},function(e,t,n){"use strict";e.exports=void 0!==(void 0!==typeof window?window:global).WebSocket},function(e,t){e.exports='<div id="tb_alert"><div id="section-normal-install" class="OT_alert"><div class="OT_alert-exclamation">!</div><button class="OT_alert-close-button" role="OT_close">×</button><div class="OT_alert-header" data-text="Incompatible Browser">Incompatible Browser</div><div class="OT_alert-body">The video component of this application requires <a target="_blank" href="https://www.google.com/chrome/">Google Chrome</a>, <a target="_blank" href="http://www.mozilla.org/firefox">Firefox</a>, <a target="_blank" href="https://www.microsoft.com/en-us/edge">Edge</a>, or <a target="_blank" href="https://www.apple.com/safari/">Safari</a>.</div></div><div id="section-upgrade-install" class="OT_alert"><div class="OT_alert-exclamation">!</div><button class="OT_alert-close-button" role="OT_close">×</button><div class="OT_alert-header" data-text="Incompatible Browser">Incompatible Browser</div><div class="OT_alert-body">The video component of this application requires a newer version of <a target="_blank" href="https://www.google.com/chrome/">Google Chrome</a>, <a target="_blank" href="http://www.mozilla.org/firefox">Firefox</a>, <a target="_blank" href="https://www.microsoft.com/en-us/edge">Edge</a>, or <a target="_blank" href="https://www.apple.com/safari/">Safari</a>.</div><div class="continue-text"><a href="#" role="OT_close">Continue at my own risk.</a></div></div><div id="section-supported-mobile-browser" class="OT_alert"><div class="OT_alert-exclamation">!</div><button class="OT_alert-close-button" role="OT_close">×</button><div class="OT_alert-header" data-text="Incompatible Browser">Incompatible Browser</div><div class="OT_alert-body">The video component of this application requires a newer version of <a target="_blank" href="https://www.google.com.au/chrome/browser/mobile/">Google Chrome</a>.</div><div class="continue-text"><a href="#" role="OT_close">Continue at my own risk.</a></div></div><div id="section-mobile-browser" class="OT_alert"><div class="OT_alert-exclamation">!</div><button class="OT_alert-close-button" role="OT_close">×</button><div class="OT_alert-header" data-text="Incompatible Browser">Incompatible Browser</div><div class="OT_alert-body">The video component of this application is not supported on your mobile device\'s browser at this time.</div></div></div>'},function(e,t,n){"use strict";var r=n(2)(n(61));const i=n(42);e.exports=function(e){function t(t,n){var r;let i=(void 0===n?{}:n).destroyOnClose,o=void 0===i||i;(r=e.call(this)||this).modalDiv=document.createElement("div"),r.modalDiv.classList.add("OT_ModalDialog"),r.modalDiv.innerHTML=t;const s=r.modalDiv.querySelectorAll("[role=OT_close]");return[].forEach.call(s,e=>e.addEventListener("click",e=>{e.preventDefault(),r.close()})),r.close(),document.body.appendChild(r.modalDiv),o&&r.on("closed",()=>r.destroy()),r}(0,r.default)(t,e);var n=t.prototype;return n.open=function(){this.modalDiv.style.display="block",this.emit("opened")},n.close=function(){this.modalDiv.style.display="none",this.emit("closed")},n.destroy=function(){this.modalDiv.innerHTML="",this.modalDiv.parentNode.removeChild(this.modalDiv),this.emit("destroyed")},n.el=function(e){return this.modalDiv.querySelector(e)},t}(i)},function(e,t,n){"use strict";const r=n(26);e.exports=function(e){void 0===e&&(e={});const t=e.env||n(3),i=e.analytics||new r;i.logEvent({action:"UserAgentParsing",variation:"Attempt",payload:{userAgent:t.userAgent}}),i.logEvent({action:"UserAgentParsing",variation:t.error?"Failure":"Success",payload:{userAgent:t.userAgent}})}},function(e,t,n){var r=n(600),i=n(272),o=n(601),s=n(602);function a(t){var n="function"==typeof Map?new Map:void 0;return e.exports=a=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return s(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},a(t)}e.exports=a},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}},function(e,t,n){var r=n(272);function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function o(t,n,s){return i()?e.exports=o=Reflect.construct:e.exports=o=function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o},o.apply(null,arguments)}e.exports=o},function(e,t,n){"use strict";(function(t){e.exports=(e,n)=>(n=n||(()=>{}),e.then(e=>new t(e=>{e(n())}).then(()=>e),e=>new t(e=>{e(n())}).then(()=>{throw e})))}).call(this,n(0))},function(e,t,n){var r=n(59),i=n(605),o=n(606),s=n(47);e.exports=function(e,t){return t=r(t,e),null==(e=o(e,t))||delete e[s(i(t))]}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){var r=n(98),i=n(263);e.exports=function(e,t){return t.length<2?e:r(e,i(t,0,-1))}},function(e,t,n){var r=n(136);e.exports=function(e){return r(e)?void 0:e}},function(e,t,n){var r=n(35),i=n(25),o=n(30);e.exports=function(e){return function(t,n,s){var a=Object(t);if(!i(t)){var c=r(n,3);t=o(t),n=function(e){return c(a[e],e,a)}}var u=e(t,n,s);return u>-1?a[c?t[u]:u]:void 0}}},function(e,t,n){var r=n(92),i=n(93),o=n(129),s=n(94),a=n(610),c=n(97);e.exports=function(e,t,n){var u=-1,d=i,l=e.length,p=!0,f=[],h=f;if(n)p=!1,d=o;else if(l>=200){var m=t?null:a(e);if(m)return c(m);p=!1,d=s,h=new r}else h=t?[]:f;e:for(;++u<l;){var g=e[u],b=t?t(g):g;if(g=n||0!==g?g:0,p&&b==b){for(var v=h.length;v--;)if(h[v]===b)continue e;t&&h.push(b),f.push(g)}else d(h,b,n)||(h!==f&&h.push(b),f.push(g))}return f}},function(e,t,n){var r=n(189),i=n(227),o=n(97),s=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=s},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8));let s={SFrame:{}};n(3).isNode||(s=n(612));const a=s.SFrame,c={},u=e=>{var t;return null==(t=c[e])?void 0:t.sender},d=e=>{var t;return null==(t=c[e])?void 0:t.receiver},l=e=>a.createClient(e,{skipVp8PayloadHeader:!0}),p={createSender:(h=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===t&&(t=0),!u(t)){e.next=3;break}return e.abrupt("return",u(t));case 3:return c[t]||(c[t]={}),e.next=6,l(t);case 6:return c[t].sender=e.sent,e.abrupt("return",u(t));case 8:case"end":return e.stop()}}),e)}))),function(e){return h.apply(this,arguments)}),createReceiver:(f=(0,o.default)(i.default.mark((function e(t){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!d(t)){e.next=2;break}return e.abrupt("return",d(t));case 2:return c[t]||(c[t]={}),e.next=5,l(t);case 5:return c[t].receiver=e.sent,e.abrupt("return",d(t));case 7:case"end":return e.stop()}}),e)}))),function(e){return f.apply(this,arguments)}),getSender:u,getReceiver:d,deleteReceiver:e=>{d(e)&&(c[e].receiver.deleteReceiver(e),delete c[e].receiver)},deleteSender:e=>{var t;return null==(t=c[e])||delete t.sender}};var f,h;e.exports=p},function(e,t,n){(function(t){var n;n=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./index.js")}({"./Client.js":
|
|
29
|
+
/*!*******************!*\
|
|
30
|
+
!*** ./Client.js ***!
|
|
31
|
+
\*******************/
|
|
32
|
+
/*! exports provided: SFrame */function(e,n,r){"use strict";r.r(n),r.d(n,"SFrame",(function(){return o}));var i=r(/*! ./Worker.js */"./Worker.js");const o={createClient:async function(e,t){const n=new a;return await n.init(e,t),n}};async function s(e){return e instanceof CryptoKey&&"private"==e.type?await crypto.subtle.exportKey("pkcs8",e):e instanceof CryptoKey?await crypto.subtle.exportKey("raw",e):e instanceof Uint8Array?e.buffer.slice(0):e.slice(0)}class a extends EventTarget{constructor(){super(),this.worker=new i.default,this.transId=1,this.transactions=new Map,this.worker.addEventListener("message",async e=>{const t=e.data;if(t.transId){const e=this.transactions.get(t.transId);this.transactions.delete(t.transId),t.error?e.reject(new Error(t.error)):e.resolve(t.result)}else if(t.event){const e=new Event(t.event.name);e.id=t.event.data.id,e.senderId=t.event.data.senderId,this.dispatchEvent(e)}}),this.postMessage=(e,n,r)=>new t((t,i)=>{const o=this.transId++;this.worker.postMessage({transId:o,cmd:e,args:n},r),this.transactions.set(o,{resolve:t,reject:i})})}async init(e,t){return this.postMessage("init",{senderId:e,config:t})}async setSenderEncryptionKey(e){const t=await s(e);return this.postMessage("setSenderEncryptionKey",[t],[t])}async ratchetSenderEncryptionKey(){return this.postMessage("ratchetSenderEncryptionKey")}async setSenderSigningKey(e){const t=await s(e);return this.postMessage("setSenderSigningKey",[t])}async addReceiver(e){return this.postMessage("addReceiver",[e])}async setReceiverEncryptionKey(e,t){const n=await s(t);return this.postMessage("setReceiverEncryptionKey",[e,n],[n])}async setReceiverVerifyKey(e,t){const n=await s(t);return this.postMessage("setReceiverVerifyKey",[e,n],[n])}deleteReceiver(e){return this.postMessage("deleteReceiver",[e])}async encrypt(e,t){const n=t.track.kind,{readable:r,writable:i}=t.createEncodedStreams?t.createEncodedStreams():t.createEncodedVideoStreams?t.createEncodedVideoStreams():t.createEncodedAudioStreams();return this.postMessage("encrypt",{id:e,kind:n,readableStream:r,writableStream:i},[r,i])}async decrypt(e,t){const n=t.track.kind,{readable:r,writable:i}=t.createEncodedStreams?t.createEncodedStreams():t.createEncodedVideoStreams?t.createEncodedVideoStreams():t.createEncodedAudioStreams();return this.postMessage("decrypt",{id:e,kind:n,readableStream:r,writableStream:i},[r,i])}close(){this.worker.terminate();for(let e of this.transactions.values())e.reject(new Error("Client closed"));this.transactions.clear()}}},"./Worker.js":
|
|
33
|
+
/*!*******************!*\
|
|
34
|
+
!*** ./Worker.js ***!
|
|
35
|
+
\*******************/
|
|
36
|
+
/*! exports provided: default */function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return o}));var r=n(/*! !./node_modules/worker-loader/dist/runtime/inline.js */"./node_modules/worker-loader/dist/runtime/inline.js"),i=n.n(r);function o(){return i()('/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== \'undefined\' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: \'Module\' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, \'__esModule\', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === \'object\' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, \'default\', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != \'string\') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module[\'default\']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, \'a\', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = "";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = "./Worker.js");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ "./Worker.js":\n/*!*******************!*\\\n !*** ./Worker.js ***!\n \\*******************/\n/*! no exports provided */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _lib_Context_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/Context.js */ "./lib/Context.js");\n/* harmony import */ var _lib_VP8PayloadHeader_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/VP8PayloadHeader.js */ "./lib/VP8PayloadHeader.js");\n/* harmony import */ var _lib_Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/Utils.js */ "./lib/Utils.js");\n\n\n\n\nclass TaskQueue\n{\n\tconstructor()\n\t{\n\t\tthis.tasks = [];\n\t\tthis.running = false;\n\t}\n\t\n\tenqueue(promise,callback,error)\n\t{\n\t\t//enqueue task\n\t\tthis.tasks.push({promise,callback,error});\n\t\t//Try run \n\t\tthis.run();\n\t}\n\t\n\tasync run()\n\t{\n\t\t//If already running \n\t\tif (this.running)\n\t\t\t//Nothing\n\t\t\treturn;\n\t\t//Running\n\t\tthis.running = true;\n\t\t//Run all pending tasks\n\t\twhile(this.tasks.length)\n\t\t{\n\t\t\ttry {\n\t\t\t\t//Wait for first promise to finish\n\t\t\t\tconst result = await this.tasks[0].promise;\n\t\t\t\t//Run callback\n\t\t\t\tthis.tasks[0].callback(result); \n\t\t\t} catch(e) {\n\t\t\t\t//Run error callback\n\t\t\t\tthis.tasks[0].error(e); \n\t\t\t}\n\t\t\t//Remove task from queue\n\t\t\tthis.tasks.shift();\n\t\t}\n\t\t//Ended\n\t\tthis.running = false;\n\t}\n}\nlet context; \n\nonmessage = async (event) => {\n\t//Get data\n\tconst {transId,cmd,args} = event.data;\n\t\n\ttry {\n\t\tlet result = true;\n\t\t\n\t\t//Depending on the cmd\n\t\tswitch(event.data.cmd)\n\t\t{\n\t\t\tcase "init":\n\t\t\t{\n\t\t\t\t//Get info\n\t\t\t\tconst {senderId, config} = args;\n\t\t\t\t//Crate context\n\t\t\t\tcontext = new _lib_Context_js__WEBPACK_IMPORTED_MODULE_0__["Context"](senderId, config);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase "encrypt":\n\t\t\t{\n\t\t\t\t//The recrypt queue\n\t\t\t\tconst tasks = new TaskQueue();\n\t\t\t\t//Get event data\n\t\t\t\tconst{id, kind, readableStream, writableStream} = args;\n\t\t\t\t//Create transform stream foo encrypting\n\t\t\t\tconst transformStream = new TransformStream({\n\t\t\t\t\ttransform: async (chunk, controller)=>{\n\t\t\t\t\t\t//Nothing in clear\n\t\t\t\t\t\tlet skip = 0;\n\t\t\t\t\t\t//Check if it is video and we are skipping vp8 payload header\n\t\t\t\t\t\tif (kind=="video" && context.isSkippingVp8PayloadHeader())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Get VP8 header\n\t\t\t\t\t\t\tconst vp8 = _lib_VP8PayloadHeader_js__WEBPACK_IMPORTED_MODULE_1__["VP8PayloadHeader"].parse(chunk.data);\n\t\t\t\t\t\t\t//Skip it\n\t\t\t\t\t\t\tskip = vp8.byteLength;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Enqueue task\n\t\t\t\t\t\ttasks.enqueue (\n\t\t\t\t\t\t\tcontext.encrypt(kind, id, chunk.data, skip),\n\t\t\t\t\t\t\t(encrypted) => {\n\t\t\t\t\t\t\t\t//Set back encrypted payload\n\t\t\t\t\t\t\t\tchunk.data = encrypted.buffer;\n\t\t\t\t\t\t\t\t//write back\n\t\t\t\t\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t(error)=>{\n\t\t\t\t\t\t\t\t//TODO: handle errors\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t//Encrypt\n\t\t\t\treadableStream\n\t\t\t\t\t.pipeThrough(transformStream)\n\t\t\t\t\t.pipeTo(writableStream);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase "decrypt":\n\t\t\t{\n\t\t\t\t//The recrypt queue\n\t\t\t\tconst tasks = new TaskQueue();\n\t\t\t\t//Last reveiced senderId\n\t\t\t\tlet senderId = -1;\n\t\t\t\t//Get event data\n\t\t\t\tconst{id, kind, readableStream, writableStream} = args;\n\t\t\t\t//Create transform stream for encrypting\n\t\t\t\tconst transformStream = new TransformStream({\n\t\t\t\t\ttransform: async (chunk, controller)=>{\n\t\t\t\t\t\t//Nothing in clear\n\t\t\t\t\t\tlet skip = 0;\n\t\t\t\t\t\t//Check if it is video and we are skipping vp8 payload header\n\t\t\t\t\t\tif (kind=="video" && context.isSkippingVp8PayloadHeader())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Get VP8 header\n\t\t\t\t\t\t\tconst vp8 = _lib_VP8PayloadHeader_js__WEBPACK_IMPORTED_MODULE_1__["VP8PayloadHeader"].parse(chunk.data);\n\t\t\t\t\t\t\t//Skip it\n\t\t\t\t\t\t\tskip = vp8.byteLength;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Enqueue task\n\t\t\t\t\t\ttasks.enqueue (\n\t\t\t\t\t\t\tcontext.decrypt(kind, id, chunk.data, skip),\n\t\t\t\t\t\t\t(decrypted) => {\n\t\t\t\t\t\t\t\t//Set back decrypted payload\n\t\t\t\t\t\t\t\tchunk.data = decrypted.buffer;\n\t\t\t\t\t\t\t\t//write back\n\t\t\t\t\t\t\t\tcontroller.enqueue(chunk);\n\t\t\t\t\t\t\t\t//If it is a sender\n\t\t\t\t\t\t\t\tif (decrypted.senderId!=senderId)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//Store it\n\t\t\t\t\t\t\t\t\tsenderId = decrypted.senderId;\n\t\t\t\t\t\t\t\t\t//Launch event\n\t\t\t\t\t\t\t\t\tpostMessage ({event: {\n\t\t\t\t\t\t\t\t\t\tname\t: "authenticated",\n\t\t\t\t\t\t\t\t\t\tdata\t: {\n\t\t\t\t\t\t\t\t\t\t\tid\t : id,\n\t\t\t\t\t\t\t\t\t\t\tsenderId : senderId\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t(error)=>{\n\t\t\t\t\t\t\t\t//TODO: handle errors\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t//Decrypt\n\t\t\t\treadableStream\n\t\t\t\t\t.pipeThrough(transformStream)\n\t\t\t\t\t.pipeTo(writableStream);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\t//Excute "cmd" method on context\n\t\t\t\tresult = await context[cmd](...args || []);\n\t\t}\n\t\t//Send result back\n\t\tpostMessage ({transId,result});\n\t} catch (error) {\n\t\tconsole.error(error);\n\t\t//Send error back\n\t\tpostMessage({transId,error});\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/AesCm128HmacSha256EncryptionKey.js":\n/*!************************************************!*\\\n !*** ./lib/AesCm128HmacSha256EncryptionKey.js ***!\n \\************************************************/\n/*! exports provided: AesCm128HmacSha256EncryptionKey */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AesCm128HmacSha256EncryptionKey", function() { return AesCm128HmacSha256EncryptionKey; });\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils.js */ "./lib/Utils.js");\n/* harmony import */ var _Salts_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Salts.js */ "./lib/Salts.js");\n/* harmony import */ var _IV_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./IV.js */ "./lib/IV.js");\n\n\n\n\nclass AesCm128HmacSha256EncryptionKey \n{\n\tasync setKey(key)\n\t{\n\t\tif (key instanceof CryptoKey)\n\t\t{\n\t\t\t//Check private key algorithm\n\t\t\tif (key.algorithm.name!="HKDF")\n\t\t\t\t//Error\n\t\t\t\tthrow new Error("Invalid key");\n\t\t} else {\n\t\t\t//Import key\n\t\t\tkey = await crypto.subtle.importKey(\n\t\t\t\t"raw",\n\t\t\t\tkey,\n\t\t\t\t"HKDF",\n\t\t\t\tfalse,\n\t\t\t\t["deriveBits", "deriveKey"]\n\t\t\t);\n\t\t}\n\t\t\n\t\t//Get salt key\n\t\tthis.saltKey = new Uint8Array(await crypto.subtle.deriveBits(\n\t\t\t{\n\t\t\t\tname : "HKDF",\n\t\t\t\thash : "SHA-256",\n\t\t\t\tsalt : _Salts_js__WEBPACK_IMPORTED_MODULE_1__["Salts"].SaltKey,\n\t\t\t\tinfo : new ArrayBuffer()\n\t\t\t},\n\t\t\tkey,\n\t\t\t128\n\t\t));\n\t\n\t\t//Get encryption key\n\t\tthis.encryptionKey = await crypto.subtle.deriveKey(\n\t\t\t{\n\t\t\t\tname : "HKDF",\n\t\t\t\thash : "SHA-256",\n\t\t\t\tsalt : _Salts_js__WEBPACK_IMPORTED_MODULE_1__["Salts"].EncryptionKey,\n\t\t\t\tinfo : new ArrayBuffer()\n\t\t\t},\n\t\t\tkey,\n\t\t\t{\n\t\t\t\tname : "AES-CTR",\n\t\t\t\tlength : 128\n\t\t\t},\n\t\t\tfalse,\n\t\t\t["encrypt","decrypt"]\n\t\t);\n\t\n\t\t//Get authentication key\n\t\tthis.authKey = await crypto.subtle.deriveKey(\n\t\t\t{\n\t\t\t\tname : "HKDF",\n\t\t\t\thash : "SHA-256",\n\t\t\t\tsalt : _Salts_js__WEBPACK_IMPORTED_MODULE_1__["Salts"].AuthenticationKey,\n\t\t\t\tinfo : new ArrayBuffer()\n\t\t\t},\n\t\t\tkey,\n\t\t\t{\n\t\t\t\tname : "HMAC",\n\t\t\t\thash : "SHA-256",\n\t\t\t\tlength : 256\n\t\t\t},\n\t\t\tfalse,\n\t\t\t["sign","verify"]\n\t\t);\n\t\n\t\t//Derive Ratchet key\n\t\tthis.ratchetKey = await crypto.subtle.deriveBits(\n\t\t\t{\n\t\t\t\tname : "HKDF",\n\t\t\t\thash : "SHA-256",\n\t\t\t\tsalt : _Salts_js__WEBPACK_IMPORTED_MODULE_1__["Salts"].RatchetKey,\n\t\t\t\tinfo : new ArrayBuffer()\n\t\t\t},\n\t\t\tkey,\n\t\t\t256\n\t\t);\n\t}\n\t\n\tasync encrypt(type,header,payload,extraBytes,skip)\n\t{\n\t\t//Encure int\n\t\tskip = skip ? skip : 0;\n\t\t\n\t\t//Create IV\n\t\tconst iv = _IV_js__WEBPACK_IMPORTED_MODULE_2__["IV"].generate(header.keyId, header.counter, this.saltKey);\n\t\t\n\t\t//Encrypt\n\t\tconst encrypted = await crypto.subtle.encrypt(\n\t\t\t{\n\t\t\t\tname\t: "AES-CTR",\n\t\t\t\tcounter : iv,\n\t\t\t\tlength : 128\n\t\t\t},\n\t\t\tthis.encryptionKey,\n\t\t\tpayload\n\t\t);\n\t\n\t\t//Get auth tag length from media type\n\t\tconst authTagLength = AesCm128HmacSha256EncryptionKey.getAuthTagLen(type);\n\t\t\n\t\t//Create encrypted frame\n\t\tconst encryptedFrame = new Uint8Array(header.byteLength + payload.byteLength + authTagLength + extraBytes + skip);\n\t\t\n\t\t//Set header and encrypted payolad\n\t\tencryptedFrame.set(header, skip);\n\t\tencryptedFrame.set(new Uint8Array(encrypted), skip + header.length);\n\t\t\n\t\t//Authenticate\n\t\tconst signature = new Uint8Array(await crypto.subtle.sign(\n\t\t\t"HMAC",\n\t\t\tthis.authKey, \n\t\t\tencryptedFrame.subarray(skip, skip + header.byteLength + encrypted.byteLength)\n\t\t));\n\t\n\t\t//Truncate\n\t\tconst authTag = signature.subarray(0, authTagLength);\n\t\n\t\t//Append authentication tag\n\t\tencryptedFrame.set(authTag, skip + encrypted.byteLength + header.byteLength );\n\t\t\n\t\t//Done\n\t\treturn [encryptedFrame,authTag];\n\t\t\n\t}\n\t\n\tasync decrypt(type, header, encryptedFrame, extrabytes, skip)\n\t{\n\t\t//Encure int\n\t\tskip = skip ? skip : 0;\n\t\t\n\t\t//Create IV\n\t\tconst iv = _IV_js__WEBPACK_IMPORTED_MODULE_2__["IV"].generate(header.keyId, header.counter, this.saltKey);\n\t\t\n\t\t//Get auth tag length from media type\n\t\tconst authTagLength = AesCm128HmacSha256EncryptionKey.getAuthTagLen(type);\n\t\t\n\t\t//Get encrypted frame length (without extra bytes from signature)\n\t\tconst frameLength = encryptedFrame.byteLength - extrabytes - skip;\n\t\t\n\t\t//Get authentication tag\n\t\tconst authTag = encryptedFrame.subarray(skip + frameLength - authTagLength, skip + frameLength);\n\t\t\n\t\t//Get encrypted payload\n\t\tconst encrypted = encryptedFrame.subarray(skip + header.byteLength, skip + frameLength - authTagLength);\n\t\t\n\t\t//Calculate signature\n\t\tconst signature = new Uint8Array(await crypto.subtle.sign(\n\t\t\t"HMAC",\n\t\t\tthis.authKey, \n\t\t\tencryptedFrame.subarray(skip, skip + header.byteLength + encrypted.byteLength)\n\t\t));\n\t\n\t\t//Authenticate authTag\n\t\tlet authenticated = true;\n\t\t//Avoid timimg attacks by iterating over all bytes\n\t\tfor (let i=0;i<authTagLength;++i)\n\t\t\t//check signature\n\t\t\tauthenticated &= authTag[i]===signature[i];\n\t\t\n\t\t//If not all where equal\n\t\tif (!authenticated)\n\t\t\t//Authentication error\n\t\t\tthrow new Error("Authentication error");\n\t\t\n\t\t//Decrypt\n\t\tconst payload = new Uint8Array (await crypto.subtle.decrypt(\n\t\t\t{\n\t\t\t\tname\t: "AES-CTR",\n\t\t\t\tcounter : iv,\n\t\t\t\tlength : 128\n\t\t\t},\n\t\t\tthis.encryptionKey,\n\t\t\tencrypted\n\t\t));\n\t\t\n\t\t//Done\n\t\treturn [payload, authTag];\n\t}\n\t\n\tasync ratchet()\n\t{\n\t\t//Create new key\n\t\tconst key = new AesCm128HmacSha256EncryptionKey();\n\t\t\n\t\t//Set ratchet key\n\t\tawait key.setKey(this.ratchetKey);\n\t\t\n\t\t//Done\n\t\treturn key;\n\t}\n\t\n\tstatic getAuthTagLen(type)\n\t{\n\t\treturn type.toLowerCase()==="video" ? 10 : 4;\n\t};\n\t\n\tstatic async create(raw) \n\t{\n\t\t//Create new key\n\t\tconst key = new AesCm128HmacSha256EncryptionKey();\n\t\t//Set raw key\n\t\tawait key.setKey(raw);\n\t\t//Done\n\t\treturn key;\n\t}\n};\n\n\n\n/***/ }),\n\n/***/ "./lib/Context.js":\n/*!************************!*\\\n !*** ./lib/Context.js ***!\n \\************************/\n/*! exports provided: Context */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Context", function() { return Context; });\n/* harmony import */ var _Header_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Header.js */ "./lib/Header.js");\n/* harmony import */ var _Sender_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sender.js */ "./lib/Sender.js");\n/* harmony import */ var _Receiver_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Receiver.js */ "./lib/Receiver.js");\n\n\n\n\nclass Context\n{\n\t\n\tconstructor(senderId, config)\n\t{\n\t\t//Store config\n\t\tthis.config = Object.assign({}, config);\n\t\t//Only one sender per context\n\t\tthis.sender = new _Sender_js__WEBPACK_IMPORTED_MODULE_1__["Sender"](senderId);\n\t\t\n\t\t//The map of known remote senders\n\t\tthis.receivers = new Map();\n\t}\n\t\n\tisSkippingVp8PayloadHeader()\n\t{\n\t\treturn !!this.config.skipVp8PayloadHeader;\n\t}\n\t\t\n\tasync setSenderEncryptionKey(key)\n\t{\n\t\t//Set it\n\t\treturn this.sender.setEncryptionKey(key);\n\t}\n\t\n\tasync ratchetSenderEncryptionKey()\n\t{\n\t\t//Set it\n\t\treturn this.sender.ratchetEncryptionKey();\n\t}\n\t\n\tasync setSenderSigningKey(key)\n\t{\n\t\t//Set it\n\t\treturn this.sender.setSigningKey(key);\n\t}\n\t\n\taddReceiver(receiverkKeyId)\n\t{\n\t\t//Check we don\'t have a receiver already for that id\n\t\tif(this.receivers.has(receiverkKeyId))\n\t\t\t//Error\n\t\t\tthrow new Error("There was already a receiver for keyId "+receiverkKeyId);\n\t\t//Add new\n\t\tthis.receivers.set(receiverkKeyId, new _Receiver_js__WEBPACK_IMPORTED_MODULE_2__["Receiver"](receiverkKeyId));\n\t}\n\t\n\tasync setReceiverEncryptionKey(receiverkKeyId, key)\n\t{\n\t\t//Get receiver for the sender\n\t\tconst receiver = this.receivers.get(receiverkKeyId);\n\t\t\n\t\t//IF not found\n\t\tif (!receiver)\n\t\t\t//Error\n\t\t\tthrow new Error("No receiver found for keyId "+receiverkKeyId);\n\t\t\n\t\t//Rachet\n\t\treturn receiver.setEncryptionKey(key);\n\t}\n\t\n\tasync setReceiverVerifyKey(receiverkKeyId,key)\n\t{\n\t\t//Get receiver for the sender\n\t\tconst receiver = this.receivers.get(receiverkKeyId);\n\t\t\n\t\t//IF not found\n\t\tif (!receiver)\n\t\t\t//Error\n\t\t\tthrow new Error("No receiver found for keyId "+receiverkKeyId);\n\t\t\n\t\t//Rachet\n\t\treturn receiver.setVerifyKey(key);\n\t}\n\t\n\tdeleteReceiver(receiverkKeyId)\n\t{\n\t\t//Delete receiver\n\t\treturn this.receivers.delete(receiverkKeyId);\n\t}\n\t\n\tasync encrypt(type, ssrcId, frame, skip)\n\t{\n\t\t//Encrypt it\n\t\treturn this.sender.encrypt(type, ssrcId, frame, skip);\n\t}\n\t\n\tasync decrypt(type, ssrcId, encryptedFrame, skip)\n\t{\n\t\t//convert if needed\n\t\tif (!(encryptedFrame instanceof Uint8Array))\n\t\t\tencryptedFrame = new Uint8Array (encryptedFrame);\n\t\t\n\t\t//Parse encrypted payload\n\t\tconst header = _Header_js__WEBPACK_IMPORTED_MODULE_0__["Header"].parse(encryptedFrame.subarray(skip));\n\t\t\n\t\t//Get receiver for the sender\n\t\tconst receiver = this.receivers.get(header.keyId);\n\t\t\n\t\t//IF not found\n\t\tif (!receiver)\n\t\t\t//Error\n\t\t\tthrow new Error("No receiver found for keyId " + header.keyId);\n\t\t\n\t\t//Decrypt it\n\t\treturn receiver.decrypt(type, ssrcId, header, encryptedFrame, skip);\n\t}\n\t\n};\n\n\n/***/ }),\n\n/***/ "./lib/EcdsaSignKey.js":\n/*!*****************************!*\\\n !*** ./lib/EcdsaSignKey.js ***!\n \\*****************************/\n/*! exports provided: EcdsaSignKey */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EcdsaSignKey", function() { return EcdsaSignKey; });\n//TODO: Update to Ed25519 when available\n// https://chromestatus.com/features/4913922408710144\n// https://chromium.googlesource.com/chromium/src/+log/master/components/webcrypto/algorithms/ed25519.cc\n\nclass EcdsaSignKey\n{\n\t\n\tasync setKey(privKey)\n\t{\n\t\t//If it is a crypto key already\n\t\tif (privKey instanceof CryptoKey)\n\t\t{\n\t\t\t//Check private key algorithm\n\t\t\tif (privKey.algorithm.name!="ECDSA" || !privKey.usages.includes("sign"))\n\t\t\t\t//Error\n\t\t\t\tthrow new Error("Invalid key");\n\t\t\t//Set it\n\t\t\tthis.privKey = privKey;\n\t\t} else {\n\t\t\t//Import it\n\t\t\tthis.privKey = await crypto.subtle.importKey(\n\t\t\t\t"pkcs8",\n\t\t\t\tprivKey,\n\t\t\t\t{\n\t\t\t\t\tname\t\t: "ECDSA",\n\t\t\t\t\tnamedCurve\t: "P-521"\n\t\t\t\t},\n\t\t\t\tfalse,\n\t\t\t\t["sign"]\n\t\t\t);\n\t\t}\n\t}\n\t\n\tasync sign(authTags)\n\t{\n\t\t//Verify\n\t\treturn new Uint8Array(await crypto.subtle.sign(\n\t\t\t{\n\t\t\t name: "ECDSA",\n\t\t\t hash: "SHA-512"\n\t\t\t},\n\t\t\tthis.privKey,\n\t\t\tauthTags\n\t\t));\n\t}\n\t\n\tstatic getSignatureLen()\n\t{\n\t\treturn 64;\n\t}\n\t\n\tstatic async create(privKey)\n\t{\n\t\t//Craete key\n\t\tconst key = new EcdsaSignKey();\n\t\t//Set key\n\t\tawait key.setKey(privKey);\n\t\t//Done\n\t\treturn key;\n\t\t\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/EcdsaVerifyKey.js":\n/*!*******************************!*\\\n !*** ./lib/EcdsaVerifyKey.js ***!\n \\*******************************/\n/*! exports provided: EcdsaVerifyKey */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EcdsaVerifyKey", function() { return EcdsaVerifyKey; });\n\nclass EcdsaVerifyKey\n{\n\tasync setKey(pubKey)\n\t{\n\t\t//If it is a crypto key already\n\t\tif (pubKey instanceof CryptoKey)\n\t\t{\n\t\t\t//Check \n\t\t\tif (pubKey.algorithm.name!="ECDSA" || !pubKey.usages.includes("verify"))\n\t\t\t\t//Error\n\t\t\t\tthrow new Error("Invalid key");\n\t\t\t//Set it\n\t\t\tthis.pubKey = pubKey;\n\t\t} else {\n\t\t\t//Import it\n\t\t\tthis.pubKey = await crypto.subtle.importKey(\n\t\t\t\t"raw",\n\t\t\t\tpubKey,\n\t\t\t\t{\n\t\t\t\t\tname\t\t: "ECDSA",\n\t\t\t\t\tnamedCurve\t: "P-521"\n\t\t\t\t},\n\t\t\t\tfalse,\n\t\t\t\t["verify"]\n\t\t\t);\n\t\t}\n\t}\n\t\n\tasync verify(signed,signature)\n\t{\n\t\t//Verify\n\t\treturn await window.crypto.subtle.verify(\n\t\t\t{\n\t\t\t\tname: "ECDSA",\n\t\t\t\thash: "SHA-512"\n\t\t\t},\n\t\t\tthis.pubKey,\n\t\t\tsignature,\n\t\t\tsigned\n\t\t);\n\t}\n\t\n\tstatic getSignatureLen()\n\t{\n\t\treturn 64;\n\t}\n\t\n\tstatic async create(pubKey)\n\t{\n\t\t//Craete key\n\t\tconst key = new EcdsaVerifyKey();\n\t\t//Set key\n\t\tawait key.setKey(pubKey);\n\t\t//Done\n\t\treturn key;\n\t\t\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/Header.js":\n/*!***********************!*\\\n !*** ./lib/Header.js ***!\n \\***********************/\n/*! exports provided: Header */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Header", function() { return Header; });\n/*\n\t0 1 2 3 4 5 6 7\n\t+-+-+-+-+-+-+-+-+\n\t|S|LEN |X| K |\n\t+-+-+-+-+-+-+-+-+\n\tSFrame header metadata\n\n\tSignature flag (S): 1 bit This field indicates the payload contains a signature of set. Counter Length (LEN): 3 bits This field indicates the length of the CTR fields in bytes. Extended Key Id Flag (X): 1 bit\n\tIndicates if the key field contains the key id or the key length. Key or Key Length: 3 bits This field contains the key id (KID) if the X flag is set to 0, or the key length (KLEN) if set to 1.\n\n\tIf X flag is 0 then the KID is in the range of 0-7 and the frame counter (CTR) is found in the next LEN bytes:\n\n\t 0 1 2 3 4 5 6 7\n\t+-+-+-+-+-+-+-+-+---------------------------------+\n\t|S|LEN |0| KID | CTR... (length=LEN) |\n\t+-+-+-+-+-+-+-+-+---------------------------------+\n\tKey id (KID): 3 bits The key id (0-7). Frame counter (CTR): (Variable length) Frame counter value up to 8 bytes long.\n\n\tif X flag is 1 then KLEN is the length of the key (KID), that is found after the SFrame header metadata byte. After the key id (KID), the frame counter (CTR) will be found in the next LEN bytes:\n\n\t 0 1 2 3 4 5 6 7\n\t+-+-+-+-+-+-+-+-+---------------------------+---------------------------+\n\t|S|LEN |1|KLEN | KID... (length=KLEN) | CTR... (length=LEN) |\n\t+-+-+-+-+-+-+-+-+---------------------------+---------------------------+\n*/\nconst Header = {\n\t\n\tparse : function(buffer) \n\t{\n\t\t//Create uint view\n\t\tconst view = new Uint8Array(buffer);\n\t\t\n\t\t//Get metadata\n\t\tconst metadata = view[0];\n\t\t\n\t\t//Get values\n\t\tconst s\t\t= !!(metadata & 0x80);\n\t\tconst len\t= (metadata >> 4) & 0x07;\n\t\tconst x\t\t= !!(metadata & 0x08);\n\t\tconst k\t\t= metadata & 0x07;\n\t\t\n\t\t//Get key id\n\t\tlet keyId = 0;\n\t\t//Check if it is the extented key format\n\t\tif (x)\n\t\t{\n\t\t\t//Read length\n\t\t\tfor (let i=0;i<k;i++)\n\t\t\t\tkeyId = (keyId * 256) + view[i+1];\n\t\t} else {\n\t\t\t//Short version\n\t\t\tkeyId = k;\n\t\t}\n\t\t\n\t\t//Get ctr\n\t\tconst ini = x ? k + 1 : 1;\n\t\tlet counter = 0;\n\t\t//Read length\n\t\tfor (let i=0;i<len;i++)\n\t\t\tcounter = (counter * 256) + view[ini+i];\n\t\t\n\t\t//Get header buffer view\n\t\tconst header = view.subarray(0, x ? k + len + 1 : len + 1);\n\t\t\n\t\t//Add parsed atributes\n\t\theader.signature = s;\n\t\theader.keyId\t = keyId;\n\t\theader.counter\t = counter;\n\t\t\n\t\t//Done\n\t\treturn header; \n\t},\n\tgenerate: function(signature,keyId,counter)\n\t{\n\t\t//Check keyId\n\t\tHeader.checkKeyId(keyId);\n\t\t\n\t\t//Calcultate variavle length\n\t\tconst varlen = (x) => x ? parseInt(Math.log(x) / Math.log(256))+1 : 1;\n\t\t\n\t\t//Get key extension and length\n\t\tconst x = keyId > 7;\n\t\tconst k = x ? varlen(keyId) : keyId;\n\t\t\n\t\t//Get counter length\n\t\tconst len = varlen(counter);\n\t\t\n\t\t//Ensure counter is not huge\n\t\tif (len>7)\n\t\t\t//Error\n\t\t\tthrow new Error("Counter is too big");\n\t\t\n\t\t//Generate header\n\t\tconst header = new Uint8Array( x ? 1 + k + len : 1 + len);\n\t\t\n\t\t//Set metadata header\n\t\theader[0] = !!signature;\n\t\theader[0] = header[0] << 3 | ( len & 0x07);\n\t\theader[0] = header[0] << 1 | x;\n\t\theader[0] = header[0] << 3 | ( k & 0x07);\n\t\t\n\t\t//Add parsed atributes\n\t\theader.signature = !!signature;\n\t\theader.keyId\t = keyId;\n\t\theader.counter\t = counter;\n\t\t\n\t\t//If extended key\n\t\tif (x)\n\t\t\t//Add key id\n\t\t\tfor (let i=0; i<k; ++i)\n\t\t\t\theader[i+1] = (keyId >> (k-1-i)*8) & 0xff;\n\t\t//The coutner init\n\t\tconst ini = x ? k + 1 : 1;\n\t\t//Add counter\n\t\tfor (let i=0; i<len; ++i)\n\t\t\theader[ini+i] = (counter >> (len-1-i)*8) & 0xff;\n\t\t\t\n\t\t\n\t\t//Done\n\t\treturn header;\n\t}\n};\n\nHeader.MaxKeyId = 0xFFFFFFFFFF;\n\nHeader.checkKeyId = function(keyId)\n{\n\t//Check it is possitive\n\tif (keyId<0)\n\t\t//Error\n\t\tthrow new Error("keyId must be possitive");\n\t//Check it is possitive\n\tif (keyId>Header.MaxKeyId)\n\t\t//Error\n\t\tthrow new Error("keyId must be 5 bytes long at most");\n};\n\n\n/***/ }),\n\n/***/ "./lib/IV.js":\n/*!*******************!*\\\n !*** ./lib/IV.js ***!\n \\*******************/\n/*! exports provided: IV */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IV", function() { return IV; });\nconst IV = \n{\n\tgenerate : function(keyId,counter,salt)\n\t{\n\t\t//128 bits\n\t\tconst iv = new Uint8Array (16);\n\t\t//Get view\n\t\tconst view = new DataView(iv.buffer);\n\t\t//Set keyId\n\t\tview.setBigUint64(0, BigInt(counter));\n\t\t//Set coutner\n\t\tview.setBigUint64(8, BigInt(keyId));\n\t\t//Xor with salt key\n\t\tfor (let i=0; i<iv.byteLength; ++i)\n\t\t\t//xor\n\t\t\tview.setUint8(i,iv[i]^salt[i]); \n\t\t//return buffer\n\t\treturn iv;\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/Receiver.js":\n/*!*************************!*\\\n !*** ./lib/Receiver.js ***!\n \\*************************/\n/*! exports provided: Receiver */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Receiver", function() { return Receiver; });\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils.js */ "./lib/Utils.js");\n/* harmony import */ var _Header_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Header.js */ "./lib/Header.js");\n/* harmony import */ var _EcdsaVerifyKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EcdsaVerifyKey.js */ "./lib/EcdsaVerifyKey.js");\n/* harmony import */ var _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AesCm128HmacSha256EncryptionKey.js */ "./lib/AesCm128HmacSha256EncryptionKey.js");\n\n\n\n\n\nconst MaxRachetAttemtps = 5;\nconst ReplayWindow = 128;\nconst KeyTimeout = 1000;\n\nclass Receiver\n{\n\tconstructor(senderId)\n\t{\n\t\t//Check keyId\n\t\t_Header_js__WEBPACK_IMPORTED_MODULE_1__["Header"].checkKeyId(senderId);\n\t\t\n\t\t//Store sender id\n\t\tthis.senderId = senderId;\n\t\t//Last received counter\n\t\tthis.maxReceivedCounter = -1;\n\t\t//Number or ratchets of current key\n\t\tthis.numKeyRatchets = 0;\n\t\t//Create keyring\n\t\tthis.keyring = [];\n\t\t//Pending verified tags\n\t\tthis.pending = new Map();\n\t\t\n\t\t//Scheduled keys\n\t\tthis.scheduledKeys = new WeakSet ();\n\t\t\n\t\t//Function to clear up keys up to given one\n\t\tthis.schedulePreviousKeysTimeout = (key) =>{\n\t\t\t//If this is the only key\n\t\t\tif (this.keyring.length==1 && this.keyring[0]===key)\n\t\t\t\t//Do nothing\n\t\t\t\treturn;\n\t\t\t//If has been already scheduled\n\t\t\tif (this.scheduledKeys.has(key))\n\t\t\t\t//Not do it twice\n\t\t\t\treturn;\n\t\t\t//Add it\n\t\t\tthis.scheduledKeys.add(key);\n\t\t\t//Schedule key timeout of previous keys\n\t\t\tsetTimeout(()=>{\n\t\t\t\t//Find key index\n\t\t\t\tconst i = this.keyring.findIndex(k=>k===key);\n\t\t\t\t//Remove previous keys\n\t\t\t\tthis.keyring = this.keyring.splice(i);\n\t\t\t}, KeyTimeout);\n\t\t};\n\t}\n\t\n\tasync decrypt(type, ssrcId, header, encryptedFrame, skip)\n\t{\n\t\tlet authTag, payload, extrabytes = 0, signature, signed;\n\t\tconst prevAuthTags = [];\n\t\t\n\t\t//convert if needed\n\t\tif (!(encryptedFrame instanceof Uint8Array))\n\t\t\tencryptedFrame = new Uint8Array (encryptedFrame);\n\t\t\n\t\t//Replay attack protection\n\t\tif (header.counter<this.maxReceivedCounter && this.maxReceivedCounter-header.counter>ReplayWindow)\n\t\t\t//Error\n\t\t\tthrow new Error("Replay check failed, frame counter too old");\n\t\t\n\t\t//Check if frame contains signature\n\t\tif (header.signature)\n\t\t{\n\t\t\t//Start from the end\n\t\t\tlet end = encryptedFrame.byteLength;\n\t\t\t\n\t\t\t//Get lengths\n\t\t\tconst singatureLength = ECDSAVerifyKey.getSignatureLen();\n\t\t\tconst authTagLength = _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_3__["AesCm128HmacSha256EncryptionKey"].getAuthTagLen(type);\n\t\t\t\n\t\t\t//Get signature\n\t\t\tsignature = encryptedFrame.subarray(end - singatureLength, end);\n\t\t\t//Move backward\n\t\t\tend -= singatureLength;\n\t\t\t\n\t\t\t//Get number of tags\n\t\t\tconst num = encryptedFrame[end--];\n\t\t\t\n\t\t\t//Read all tags\n\t\t\tfor (let i=0; i<num; ++i)\n\t\t\t{\n\t\t\t\t//Get previous tag\n\t\t\t\tconst prevTag = encryptedFrame.subarray(end - authTagLength, end);\n\t\t\t\t//Move backward\n\t\t\t\tend -= authTagLength;\n\t\t\t\t//Add tag to previous tags in hex\n\t\t\t\tprevAuthTags.push(_Utils_js__WEBPACK_IMPORTED_MODULE_0__["Utils"].toHex(prevTag))\n\t\t\t}\n\t\t\t//Get the extra bytes\n\t\t\textrabytes = encryptedFrame.byteLength - end;\n\t\t\t\n\t\t\t//Move backward to start oth current frame auth tag\n\t\t\tend -= authTagLength;\n\t\t\t\n\t\t\t//Get singed part\n\t\t\tsigned = encryptedFrame.subarray(end, encryptedFrame.byteLength - singatureLength)\n\t\t}\n\t\t\n\t\t//For each key in key ring\n\t\tfor (let i=0;i<this.keyring.length;++i)\n\t\t{\n\t\t\t//Get key from ring\n\t\t\tconst key = this.keyring[i];\n\t\t\ttry {\n\t\t\t\t//Try to decrypt payload\n\t\t\t\t[payload, authTag] = await key.decrypt(type, header, encryptedFrame, extrabytes, skip);\n\t\t\t\t//Done\n\t\t\t\tbreak;\n\t\t\t} catch(e) {\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If not found yet\n\t\tif (!payload)\n\t\t{\n\t\t\t//Get last key\n\t\t\tlet key = this.keyring[this.keyring.length-1];\n\t\t\t\n\t\t\t//Try ractchet last key\n\t\t\tfor (let i=this.numKeyRatchets; i<MaxRachetAttemtps; ++i)\n\t\t\t{\n\t\t\t\t//Rachet key\n\t\t\t\tkey = await key.ratchet();\n\t\t\t\t\n\t\t\t\t//Append to the keyring\n\t\t\t\tthis.keyring.push(key);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t//Try to decrypt payload\n\t\t\t\t\t[payload, authTag] = await key.decrypt(type, header, encryptedFrame, extrabytes, skip);\n\t\t\t\t\t//Activate\n\t\t\t\t\tthis.schedulePreviousKeysTimeout(key);\n\t\t\t\t\t//Done\n\t\t\t\t\tbreak;\n\t\t\t\t} catch(e) {\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Last check\n\t\tif (!payload)\n\t\t\t//Decryption failed\n\t\t\tthrow new Error("Decryption failed");\n\t\t\n\t\t//If we are sending part of the frame in clear\n\t\tif (skip)\n\t\t\t//Copy skiped payload\n\t\t\tpayload.set(encryptedFrame.subarray(0,skip),0);\n\t\t\n\t\t//Check if have received anything from this ssrc before\n\t\tif (!this.pending.has(ssrcId))\n\t\t\t//Add it\n\t\t\tthis.pending.set(ssrcId,new Set());\n\t\t\n\t\t//Get pending list\n\t\tconst pending = this.pending.get(ssrcId);\n\t\t\n\t\t//Check if it constains signatures\n\t\tif (header.signed)\n\t\t{\n\t\t\t//try to verify list\n\t\t\tif (!await this.verifyKey.verify(signed,signature))\n\t\t\t\t//Error\n\t\t\t\tthrow new Error("Could not verify signature");\n\t\t\t//For each signed tag\n\t\t\tfor (const tag in prevAuthTags)\n\t\t\t\t//Delete from pending to be verified tags\n\t\t\t\tpending.delete(tag);\n\t\t} else {\n\t\t\t//Push this tag to \n\t\t\tpending.add(_Utils_js__WEBPACK_IMPORTED_MODULE_0__["Utils"].toHex(authTag));\n\t\t}\n\t\t\n\t\t//Set authenticated sender id and frame Id\n\t\tpayload.senderId = header.keyId;\n\t\tpayload.frameId = header.counter;\n\t\t\n\t\t//Store last received counter\n\t\tthis.maxReceivedCounter = Math.max(header.counter, this.maxReceivedCounter);\n\t\t\n\t\t//Return decrypted payload\n\t\treturn payload;\n\t}\n\t\n\tasync setVerifyKey(key)\n\t{\n\t\t//Create new singing key\n\t\tthis.verifyKey = _EcdsaVerifyKey_js__WEBPACK_IMPORTED_MODULE_2__["EcdsaVerifyKey"].create(key);\n\t}\n\t\n\tasync setEncryptionKey(raw)\n\t{\n\t\t//Create new encryption key\n\t\tconst key = await _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_3__["AesCm128HmacSha256EncryptionKey"].create(raw);\n\t\t//Append to the keyring\n\t\tthis.keyring.push(key);\n\t\t//Restart ratchet count number\n\t\tthis.numKeyRatchets = 0;\n\t\t//Activate\n\t\tthis.schedulePreviousKeysTimeout(key);\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/Salts.js":\n/*!**********************!*\\\n !*** ./lib/Salts.js ***!\n \\**********************/\n/*! exports provided: Salts */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Salts", function() { return Salts; });\nconst textEncoder = new TextEncoder()\n\nconst Salts = {\n\t"SaltKey"\t\t: textEncoder.encode("SFrameSaltKey"),\n\t"EncryptionKey"\t\t: textEncoder.encode("SFrameEncryptionKey"),\n\t"AuthenticationKey"\t: textEncoder.encode("SFrameAuthenticationKey"),\n\t"RatchetKey"\t\t: textEncoder.encode("SFrameRatchetKey")\n};\n\n\n/***/ }),\n\n/***/ "./lib/Sender.js":\n/*!***********************!*\\\n !*** ./lib/Sender.js ***!\n \\***********************/\n/*! exports provided: Sender */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sender", function() { return Sender; });\n/* harmony import */ var _Header_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Header.js */ "./lib/Header.js");\n/* harmony import */ var _EcdsaSignKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EcdsaSignKey.js */ "./lib/EcdsaSignKey.js");\n/* harmony import */ var _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AesCm128HmacSha256EncryptionKey.js */ "./lib/AesCm128HmacSha256EncryptionKey.js");\n\n\n\n\n\nconst SigningFrameInterval = 10;\n\nclass Sender\n{\n\tconstructor(senderId)\n\t{\n\t\t//Check keyId\n\t\t_Header_js__WEBPACK_IMPORTED_MODULE_0__["Header"].checkKeyId(senderId);\n\t\t\n\t\t//The global frame counter\n\t\tthis.counter = 0;\n\t\t\n\t\t//Store senderId/keyId\n\t\tthis.senderId = senderId;\n\t\t\n\t\t//Pending frames for signing\n\t\tthis.pending = new Map();\n\t}\n\t\n\tasync encrypt(type, ssrcId, payload, skip)\n\t{\n\t\t//Check we have a valid key\n\t\tif (!this.key)\n\t\t\tthrow Error("Encryption key not set");\n\t\t\n\t\t//convert if needed\n\t\tif (!(payload instanceof Uint8Array))\n\t\t\tpayload = new Uint8Array (payload);\n\t\t\n\t\t//Encure int\n\t\tskip = skip ? skip : 0;\n\t\t\n\t\t//Get counter for frame\n\t\tconst counter = this.counter++;\n\t\t\n\t\t//If we don\'t have the ssrc\n\t\t// TODO FIX https://github.com/medooze/sframe/issues/15 and uncomment line below\n\t\t// if (!this.pending.has(ssrcId))\n\t\t//Create new pending frames array\n\t\t\tthis.pending.set(ssrcId,[]);\n\t\t\n\t\t//Get pending frames for signature\n\t\tconst pending = this.pending.get(ssrcId);\t\t\n\t\t\n\t\t//Do we need to sign the frames?\n\t\tconst signing = this.signingKey && pending.length > SigningFrameInterval;\n\t\t\n\t\t//Get auth tag len for type\n\t\tconst authTagLen = _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_2__["AesCm128HmacSha256EncryptionKey"].getAuthTagLen(type);\n\t\t\n\t\t//Calculae extra bytes\n\t\tconst extraBytes = signing ? pending.length * _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_2__["AesCm128HmacSha256EncryptionKey"].getAuthTagLen(type) + 1 + _EcdsaSignKey_js__WEBPACK_IMPORTED_MODULE_1__["EcdsaSignKey"].getSignatureLen() : 0;\n\t\t\n\t\t//Generate header\n\t\tconst header = _Header_js__WEBPACK_IMPORTED_MODULE_0__["Header"].generate(signing,this.senderId,counter);\n\t\t\n\t\t//Encrypt frame\n\t\tconst [encryptedFrame,authTag] = await this.key.encrypt(type, header, payload, extraBytes, skip);\n\t\t\n\t\t//If we are sending part of the frame in clear\n\t\tif (skip)\n\t\t\t//Copy skiped payload\n\t\t\tencryptedFrame.set(payload.subarray(0,skip),0);\n\t\t\n\t\t//If we need to sign the frame\n\t\tif (signing)\n\t\t{\n\t\t\t//Append after auth tag\n\t\t\tlet ini = skip + encryptedFrame.byteLength - extraBytes;\n\t\t\t\n\t\t\t//Get tag list view\n\t\t\tconst authTags = encryptedFrame.subarray(ini - authTagLen, (pending.length + 1) * authTagLen);\n\t\t\t\n\t\t\t//Add all previous tags \n\t\t\tfor (const previousTag of pending)\n\t\t\t{\n\t\t\t\t//Append to frame\n\t\t\t\tencryptedFrame.set(previousTag, ini);\n\t\t\t\t//Move\n\t\t\t\tini += authTagLen;\n\t\t\t}\n\t\t\t\n\t\t\t//Add number of bytes\n\t\t\tencryptedFrame[ini++] = pending.length;\n\t\t\t\n\t\t\t//Create signature with all auth tags (including this frame\'s one)\n\t\t\tconst signature = await this.signingKey.sign(authTags);\n\t\t\t\n\t\t\t//Add signature\n\t\t\tencryptedFrame.set(signature, ini);\n\t\t\t\n\t\t\t//Empty pending list \n\t\t\tthis.pending.set(ssrcId,[]);\n\t\t\t\n\t\t//If we can sign\n\t\t} else if (this.signingKey) {\n\t\t\t//Append a copy of current tag at the begining\n\t\t\tpending.unshift(authTag.slice());\n\t\t}\n\t\t\n\t\t//Set authenticated sender id and frame Id\n\t\tencryptedFrame.senderId = header.keyId;\n\t\tencryptedFrame.frameId = header.counter;\n\t\t\n\t\t//Done\n\t\treturn encryptedFrame;\n\t}\n\t\n\tasync setSigningKey(key)\n\t{\n\t\t//Create new singing key\n\t\tthis.signingKey = await _EcdsaSignKey_js__WEBPACK_IMPORTED_MODULE_1__["EcdsaSignKey"].create(key);\n\t}\n\t\n\tasync setEncryptionKey(key)\n\t{\n\t\t//Create new encryption key\n\t\tthis.key = await _AesCm128HmacSha256EncryptionKey_js__WEBPACK_IMPORTED_MODULE_2__["AesCm128HmacSha256EncryptionKey"].create(key);\n\t}\n\t\n\tasync ratchetEncryptionKey()\n\t{\n\t\t//Check we have a valid key\n\t\tif (!this.key)\n\t\t\tthrow Error("Encryption key not set");\n\t\t\n\t\t//Rachet the key and store it\n\t\tthis.key = await this.key.ratchet();\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/Utils.js":\n/*!**********************!*\\\n !*** ./lib/Utils.js ***!\n \\**********************/\n/*! exports provided: Utils */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Utils", function() { return Utils; });\nconst Utils = \n{\n\ttoHex : function(buffer)\n\t{\n\t\treturn Array.prototype.map.call(buffer instanceof Uint8Array ? buffer : new Uint8Array (buffer), x =>x.toString(16).padStart(2,"0")).join("");\n\t},\n\tfromHex: function(str)\n\t{\n\t\tconst bytes = [];\n\t\tfor (let i=0;i<str.length/2;++i)\n\t\t\tbytes.push(parseInt(str.substring(i*2, (i+1)*2), 16));\n\n\t\treturn new Uint8Array(bytes);\n\t},\n\tequals : function(a,b)\n\t{\n\t\tif (a.byteLength != b.byteLength) return false;\n\t\tfor (let i = 0 ; i != a.byteLength ; i++)\n\t\t\tif (a[i] != b[i]) return false;\n\t\treturn true;\n\t}\n};\n\n\n/***/ }),\n\n/***/ "./lib/VP8PayloadHeader.js":\n/*!*********************************!*\\\n !*** ./lib/VP8PayloadHeader.js ***!\n \\*********************************/\n/*! exports provided: VP8PayloadHeader */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n"use strict";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VP8PayloadHeader", function() { return VP8PayloadHeader; });\n\nconst VP8PayloadHeader = {\n\t\n\tparse : function(buffer) \n\t{\n\t\t//Check size\n\t\tif (buffer.byteLength<3)\n\t\t\t//Invalid\n\t\t\treturn null;\n\t\t\n\t\t//Create uint view\n\t\tconst view = new Uint8Array(buffer);\n\t\t\n\t\t//Read comon 3 bytes\n\t\t// 0 1 2 3 4 5 6 7\n // +-+-+-+-+-+-+-+-+\n // |Size0|H| VER |P|\n // +-+-+-+-+-+-+-+-+\n // | Size1 |\n // +-+-+-+-+-+-+-+-+\n // | Size2 |\n // +-+-+-+-+-+-+-+-+\n\t\tconst firstPartitionSize\t= view[0] >> 5;\n\t\tconst showFrame\t\t\t= view[0] >> 4 & 0x01;\n\t\tconst version\t\t\t= view[0] >> 1 & 0x07;\n\t\tconst isKeyFrame\t\t= (view[0] & 0x01) == 0;\n\n\t\t//check if more\n\t\tif (isKeyFrame)\n\t\t{\n\t\t\t//Check size\n\t\t\tif (buffer.byteLength<10)\n\t\t\t\t//Invalid\n\t\t\t\treturn null;\n\t\t\t//Get size in le\n\t\t\tconst hor = view[7]<<8 | view[6];\n\t\t\tconst ver = view[9]<<8 | view[8];\n\t\t\t//Get dimensions and scale\n\t\t\tconst width\t\t= hor & 0x3fff;\n\t\t\tconst horizontalScale = hor >> 14;\n\t\t\tconst height\t\t= ver & 0x3fff;\n\t\t\tconst verticalScale\t= ver >> 14;\n\t\t\t//Key frame\n\t\t\treturn view.subarray (0,10);\n\t\t}\n\t\t\n\t\t//No key frame\n\t\treturn view.subarray (0,3);\n\t}\n};\n\n\t\t\n\n\n/***/ })\n\n/******/ });\n',"Worker",void 0,void 0)}},"./index.js":
|
|
37
|
+
/*!******************!*\
|
|
38
|
+
!*** ./index.js ***!
|
|
39
|
+
\******************/
|
|
40
|
+
/*! exports provided: SFrame, Utils */function(e,t,n){"use strict";n.r(t);var r=n(/*! ../sframe/lib/Utils */"./lib/Utils.js");n.d(t,"Utils",(function(){return r.Utils}));var i=n(/*! ./Client */"./Client.js");n.d(t,"SFrame",(function(){return i.SFrame}))},"./lib/Utils.js":
|
|
41
|
+
/*!**********************!*\
|
|
42
|
+
!*** ./lib/Utils.js ***!
|
|
43
|
+
\**********************/
|
|
44
|
+
/*! exports provided: Utils */function(e,t,n){"use strict";n.r(t),n.d(t,"Utils",(function(){return r}));const r={toHex:function(e){return Array.prototype.map.call(e instanceof Uint8Array?e:new Uint8Array(e),e=>e.toString(16).padStart(2,"0")).join("")},fromHex:function(e){const t=[];for(let n=0;n<e.length/2;++n)t.push(parseInt(e.substring(2*n,2*(n+1)),16));return new Uint8Array(t)},equals:function(e,t){if(e.byteLength!=t.byteLength)return!1;for(let n=0;n!=e.byteLength;n++)if(e[n]!=t[n])return!1;return!0}}},"./node_modules/worker-loader/dist/runtime/inline.js":
|
|
45
|
+
/*!***********************************************************!*\
|
|
46
|
+
!*** ./node_modules/worker-loader/dist/runtime/inline.js ***!
|
|
47
|
+
\***********************************************************/
|
|
48
|
+
/*! no static exports found */function(e,t,n){"use strict";e.exports=function(e,t,n,r){var i=self||window;try{try{var o;try{o=new i.Blob([e])}catch(t){(o=new(i.BlobBuilder||i.WebKitBlobBuilder||i.MozBlobBuilder||i.MSBlobBuilder)).append(e),o=o.getBlob()}var s=i.URL||i.webkitURL,a=s.createObjectURL(o),c=new i[t](a,n);return s.revokeObjectURL(a),c}catch(r){return new i[t]("data:application/javascript,".concat(encodeURIComponent(e)),n)}}catch(e){if(!r)throw Error("Inline worker is not supported");return new i[t](r,n)}}}})},e.exports=n()}).call(this,n(0))},function(e,t,n){"use strict";e.exports=e=>(e=>parseInt(e,10))((e=>e.substring(0,9))((e=>e&&e.replace(/\D+/g,"")||"0")(e)))},function(e,t,n){"use strict";const r=n(615),i=n(142);e.exports=e=>{const t=i.get();return r(e,t)}},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8));const s=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,o,s;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return!1,r=!0,o=new TextEncoder,e.next=5,window.crypto.subtle.importKey("raw",o.encode(n),{name:"PBKDF2"},!1,["deriveBits","deriveKey"]);case 5:return s=e.sent,e.abrupt("return",window.crypto.subtle.deriveKey({name:"PBKDF2",salt:o.encode(t),iterations:1e5,hash:"SHA-256"},s,{name:"AES-CTR",length:256},r,["encrypt","decrypt"]));case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();e.exports=s},function(e,t,n){"use strict";(function(t){var r=n(2),i=r(n(7)),o=r(n(8));const s=n(1)("hasValidPeerConnection");function a(e){return new t(t=>{e.addEventListener("signalingstatechange",()=>t(!0)),e.createOffer({offerToReceiveAudio:1}).then(t=>e.setLocalDescription(t)).then(()=>setTimeout(()=>{t(!1)},1e3))})}function c(){return(c=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,n=new t({iceServers:[]}),e.next=8;break;case 4:return e.prev=4,e.t0=e.catch(0),s.error("Error occurred creating PeerConnection",e.t0),e.abrupt("return",!1);case 8:return e.prev=8,e.next=11,a(n);case 11:e.next=18;break;case 13:e.prev=13,e.t1=e.catch(8),s.error("Error occurred checking the validity of the PeerConnection",e.t1);try{n.close()}catch(e){}return e.abrupt("return",!1);case 18:e.prev=18,n.close(),e.next=26;break;case 22:return e.prev=22,e.t2=e.catch(18),s.error("Error occurred closing PeerConnection",e.t2),e.abrupt("return",!1);case 26:return e.abrupt("return",!0);case 27:case"end":return e.stop()}}),e,null,[[0,4],[8,13],[18,22]])})))).apply(this,arguments)}e.exports=function(e){return c.apply(this,arguments)}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const r=n(37),i=n(3),o=n(618),s=n(73),a=n(1)("createPeerConnection");e.exports=function(e){let n=e.window,c=e.config,u=e.constraints;a.debug("called");const d=r(c);d.iceServers=o(i,d.iceServers),s()&&(d.sdpSemantics="plan-b");const l=new n.RTCPeerConnection(d,u);return t.resolve(l)}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(9),i=n(273),o={Edge(e){let t=!1;return e.map(e=>{if(!e)return;const n=e.urls||e.url&&[e.url];if(!n)return;const o=n.filter(e=>0===e.indexOf("turn:")&&-1!==e.indexOf("transport=udp")&&-1===e.indexOf("turn:[")&&!t?(t=!0,!0):0===e.indexOf("stun:"));return 0!==o.length?r(i(e,["url","urls"]),{urls:o}):void 0}).filter(e=>void 0!==e)},Safari:e=>e.map(e=>{if(void 0!==e.urls&&void 0===e.url)return e;const t=e.urls||e.url&&[e.url];return r(i(e,["url","urls"]),{urls:t})})};e.exports=function(e,t){let n=e.name;e.isEdge&&(n=e.isLegacyEdge?"Edge":"ChromiumEdge");const r=o[n];return r?r(t):t}},function(e,t,n){"use strict";const r=n(52),i=n(3),o={baseline:"42001f",constBaseline:"42e01f"},s=e=>{let t=e.sdp,n=e.from,r=e.to;return t.replace(new RegExp("^(a=fmtp:\\d+ .*profile-level-id=)"+n,"gmi"),"$1"+r)};e.exports={local:{offer:function(e,t){let n=void 0===e?{}:e,a=n.numSimulcastStreams,c=n.audioBitrate,u=n.priorityVideoCodec,d=void 0===u?"":u,l=n.codecFlags,p=void 0===l?{}:l,f=n.enableStereo,h=void 0!==f&&f,m=n.enableDtx,g=void 0!==m&&m,b=n.replaceBaselineProfile,v=void 0!==b&&b,y=r.filterExcessSSRCs(t);a>1&&(y=r.enableSimulcast(y,a)),c>0&&(y=r.setAudioBitrate(y,c)),y=r.modifyReceiveStereo(y,!1),y=r.modifySendStereo(y,Boolean(h)),y=r.modifyDtx(y,Boolean(g)),i.isLegacyEdge||Object.keys(p).filter(e=>!1===p[e]).forEach(e=>{y=r.removeVideoCodec(y,e)}),d&&!i.isLegacyEdge?y=r.reprioritizeVideoCodec(y,d,"top"):"h264"!==d&&(y=r.reprioritizeVideoCodec(y,"h264","bottom"));let E=y;return v&&(E=s({sdp:E,from:o.baseline,to:o.constBaseline})),{local:y,remote:E}},answer:function(e,t){let n=void 0===e?{}:e,i=n.audioBitrate,a=n.codecFlags,c=n.enableStereo,u=void 0!==c&&c,d=n.enableDtx,l=void 0!==d&&d,p=n.replaceBaselineProfile,f=void 0!==p&&p,h=t;i>0&&(h=r.setAudioBitrate(h,i)),h=r.modifyReceiveStereo(h,Boolean(u)),h=r.modifySendStereo(h,!1),h=r.modifyDtx(h,Boolean(l)),a&&Object.keys(a).filter(e=>!1===a[e]).forEach(e=>{h=r.removeVideoCodec(h,e)});let m=h;return f&&(m=s({sdp:m,from:o.baseline,to:o.constBaseline})),{local:h,remote:m}}},remote:{offer:(e,t)=>{let n=e.replaceBaselineProfile,r=void 0!==n&&n,i=t;if(-1===i.indexOf("a=rtcp-fb")){const e="a=rtcp-fb:* ccm fir\r\na=rtcp-fb:* nack ";i=i.replace(/^m=video(.*)$/gim,"m=video$1\r\n"+e)}return r&&(i=s({sdp:i,from:o.constBaseline,to:o.baseline})),{local:i}},answer:function(e,t){let n=void 0===e?{}:e,i=n.audioBitrate,a=n.replaceBaselineProfile,c=void 0!==a&&a,u=t;return i>0&&(u=r.setAudioBitrate(u,i)),c&&(u=s({sdp:u,from:o.constBaseline,to:o.baseline})),{local:u}}}}},function(e,t,n){var r=n(39),i=n(55),o=n(41),s=n(25),a=n(277),c=n(621),u=n(236),d=n(97),l=n(265),p=n(278),f=r?r.iterator:void 0;e.exports=function(e){if(!e)return[];if(s(e))return a(e)?l(e):i(e);if(f&&e[f])return c(e[f]());var t=o(e);return("[object Map]"==t?u:"[object Set]"==t?d:p)(e)}},function(e,t){e.exports=function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}},function(e,t,n){var r=n(33);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},function(e,t,n){"use strict";e.exports=(e,t)=>{let n=[],r=null;if("function"==typeof e.getReceivers){const t=e.getReceivers().find(e=>"audio"===e.track.kind);t&&(n=t.getSynchronizationSources())}else r=new Error("peerConnection does not support getReceivers function");t&&t(r,n)}},function(e,t,n){"use strict";(function(t){const r=n(625),i=function(e){this.pending=[],this._processBinding=this.maybeProcessPending.bind(this),e&&this.setPeerConnection(e)};i.prototype.setPeerConnection=function(e){if(this.pc)throw new Error("Peer connection already set");this.pc=e,this._forwardIceCandidate=r(this.pc,"addIceCandidate"),this.pc.addEventListener("signalingstatechange",this._processBinding),this.maybeProcessPending()},i.prototype.canAddCandidates=function(){return!!(this.pc&&"closed"!==this.pc.iceConnectionState&&this.pc.remoteDescription&&this.pc.remoteDescription.type&&this.pc.localDescription&&this.pc.localDescription.type)},i.prototype.addIceCandidate=function(e){if(this.canAddCandidates())return this._forwardIceCandidate(e);const n=this.pending;return new t((t,r)=>{n.push({iceCandidate:e,resolve:t,reject:r})})},i.prototype.maybeProcessPending=function(){this.canAddCandidates()&&this.process()},i.prototype.process=function(){for(;this.pending.length;){const e=this.pending.shift();this._forwardIceCandidate(e.iceCandidate).then(e.resolve).catch(e.reject)}},i.prototype.destroy=function(){this.pc&&this.pc.removeEventListener("signalingstatechange",this._processBinding),this._processBinding=null,this.pc=null},e.exports=i}).call(this,n(0))},function(e,t,n){"use strict";(function(t){e.exports=function(e,n){const r=e[n];return function(n){return new t((t,i)=>{const o=r.apply(e,[n,t,i]);o&&"function"==typeof o.then&&t(o)})}}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(159),i=n(3),o=n(1)("offerProcessor"),s=n(52),a=n(627);e.exports=function(e,t,n,c,u,d,l,p,f,h,m,g){const b=(e,t)=>n=>{o.error(e),o.error(n),h&&h(e,n,t)},v=t=>{const n=s.hasSendStereo(d.sdp),i=s.hasSendDtx(d.sdp),o=s.getAudioBitrate(d.sdp),a=r(u,"local","answer",{enableStereo:n,enableDtx:i,audioBitrate:o,replaceBaselineProfile:g,codecFlags:l},t.sdp),p=new c({type:t.type,sdp:a.local}),h={type:t.type,sdp:a.remote};return e.setLocalDescription(p).then(()=>f(h)).catch(b("Error while setting LocalDescription","SetLocalDescription"))},y=new c({type:d.type,sdp:r(u,"remote","offer",{replaceBaselineProfile:g},d.sdp).local}),E=b("Error while setting RemoteDescription","SetRemoteDescription");return a(y,p,i,t,n).then(()=>(m(!0),y)).catch(e=>{if(m(!1),!s.hasMediaType(y.sdp,"audio"))throw new Error("Unsupported video without audio for fallback");o.debug("Couldn't set remote description",y,e,", trying without video");const t=new c({type:d.type,sdp:s.disableMediaType(y.sdp,"video")});return o.debug("offer without video",t.sdp),t}).then(t=>e.setRemoteDescription(t)).then(()=>e.createAnswer().then(v).catch(b("Error while setting createAnswer","CreateAnswer"))).catch(E)}},function(e,t,n){"use strict";(function(t){const r=n(73);e.exports=(e,n,i,o,s)=>{if(!o)return t.resolve(!0);const a={iceServers:[]};r()&&(a.sdpSemantics="plan-b");const c=new o(a),u=()=>{try{c.close()}catch(e){}};return c.setRemoteDescription(new s(e)).then(()=>{u()}).catch(e=>{throw u(),e})}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(62),i=n(629);e.exports=function(e){let t=[];const n={};let o={sentMessages:0,recvMessages:0};const s=function(e){const n=new i(e);return t.push(n),n.on("close",()=>{!function(e){t.filter(t=>e!==t)}(n)}),n};return n.add=function(t,n){return s(e.createDataChannel(t,n))},n.addMany=function(e){for(const t in e)e.hasOwnProperty(t)&&n.add(t,e[t])},n.get=function(e,n){return r(t,t=>t.equals(e,n))},n.getOrAdd=function(e,t){let r=n.get(e,t);return r||(r=n.add(e,t)),r},n.getQosData=function(){const e={sentMessages:0,recvMessages:0};return t.forEach(t=>{e.sentMessages+=t.getQosData().sentMessages,e.recvMessages+=t.getQosData().recvMessages}),e},n.sampleQos=function(){const e=n.getQosData(),t={sentMessages:e.sentMessages-o.sentMessages,recvMessages:e.recvMessages-o.recvMessages};return o=e,t},n.destroy=function(){t.forEach(e=>{e.close()}),t=[]},e.addEventListener("datachannel",e=>{s(e.channel)}),n}},function(e,t,n){"use strict";const r=n(6),i=n(1)("DataChannel"),o=function(e){this.data=e.data,this.source=e.source,this.lastEventId=e.lastEventId,this.origin=e.origin,this.timeStamp=e.timeStamp,this.type=e.type,this.ports=e.ports,this.path=e.path};e.exports=function(e){const t={},n=[],s={sentMessages:0,recvMessages:0},a=function(e){return n.push(e),t},c=function(n){return e.send(n),s.sentMessages++,t};return r(t,!0),t.label=e.label,t.id=e.id,t.reliable=e.reliable,t.negotiated=e.negotiated,t.ordered=e.ordered,t.protocol=e.protocol,t._channel=e,t.close=function(){e.close()},t.equals=function(e,n){if(t.label!==e)return!1;for(const e in n)if(n.hasOwnProperty(e)&&t[e]!==n[e])return!1;return!0},t.getQosData=function(){return s},t.send=a,e.addEventListener("open",(function(){t.send=c,function(){let e;for(;e=n.shift();)t.send(e)}()}),!1),e.addEventListener("close",(function(e){t.send=a,t.trigger("close",e)}),!1),e.addEventListener("error",(function(e){i.error(e)}),!1),e.addEventListener("message",(function(e){const n=new o(e);s.recvMessages++,t.trigger("message",n)}),!1),t}},function(e,t,n){"use strict";const r=n(9),i=n(159),o=n(1)("subscribeProcessor");e.exports=function(e){let t=e.peerConnection,n=e.NativeRTCSessionDescription,s=e.sdpTransforms,a=e.numSimulcastStreams,c=e.offerOverrides,u=e.offerConstraints,d=e.replaceBaselineProfile;const l=(e,t)=>n=>{o.error(e,n);const r=new Error(e);throw r.reason=n,r.prefix=t,r};return o.debug("subscribeProcessor: creating offer"),t.createOffer(u).then(e=>{o.debug("subscribeProcessor: offer created",e);const u=i(s,"local","offer",r({numSimulcastStreams:a,replaceBaselineProfile:d},c),e.sdp),p=new n({type:e.type,sdp:u.local}),f=new n({type:e.type,sdp:u.remote});return o.debug("subscribeProcessor: setting local description"),t.setLocalDescription(p).then(()=>f,l("Error while setting LocalDescription","SetLocalDescription"))},l("Error while creating Offer","CreateOffer")).then(e=>({sdp:e.sdp,type:e.type}))}},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8));const s=n(52),a=s.mediaDirections,c=a.RECVONLY,u=a.INACTIVE,d=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.createOffer();case 4:return r=e.sent,e.next=7,t.setLocalDescription(r);case 7:o=t.remoteDescription.sdp,a=s.changeMediaDirection(o,n),t.setRemoteDescription({type:t.remoteDescription.type,sdp:a});case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();e.exports={changeMediaDirectionToInactive:e=>d(e,u),changeMediaDirectionToRecvOnly:e=>d(e,c)}},function(e,t,n){"use strict";function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.__esModule=!0,t.parseStatsOldAPI=b,t.parseStatsNewAPI=v,t.default=function(e,t,n,r,i){if(l)return v(e,t,n,r,i);return b(e,t,n,r,i)};const o=n(3),s=n(5),a=n(1)("QoS"),c=n(52),u=n(281),d=n(633),l=n(103)(),p=n(161),f=["audioCodec","audioSentBytes","audioSentPackets","audioSentPacketsLost","audioRtt","videoCodec","videoHeight","videoHeightInput","videoSentBytes","videoFrameRateSent","videoSentPackets","videoRtt","videoSentPacketsLost","videoWidthInput","videoWidth"],h=["audioCodec","audioRecvBytes","audioRecvPackets","audioRecvPacketsLost","videoCodec","videoHeight","videoRecvBytes","videoRecvPackets","videoRecvPacketsLost","videoFrameRateReceived","videoWidth"],m=(e,t)=>a.debug(`Raw stats for peer conn ${e.id}:`,t),g=e=>{const t=e.portNumber||e.port;return`${e.ipAddress||e.address||e.ip}:${t}`};function b(e,t,n,r,i){const o=e=>(Number(e.stat("googFrameRateSent"))>0?(n.videoSentBytes=Number(e.stat("bytesSent")),n.videoSentPackets=Number(e.stat("packetsSent")),n.videoSentPacketsLost=Number(e.stat("packetsLost")),n.videoRtt=Number(e.stat("googRtt"))/1e3,n.videoFrameRate=Number(e.stat("googFrameRateInput")),n.videoWidth=Number(e.stat("googFrameWidthSent")),n.videoHeight=Number(e.stat("googFrameHeightSent")),n.videoFrameRateSent=Number(e.stat("googFrameRateSent")),n.videoWidthInput=Number(e.stat("googFrameWidthInput")),n.videoHeightInput=Number(e.stat("googFrameHeightInput")),n.videoCodec=e.stat("googCodecName")):Number(e.stat("googFrameRateReceived"))>0&&(n.videoRecvBytes=Number(e.stat("bytesReceived")),n.videoRecvPackets=Number(e.stat("packetsReceived")),n.videoRecvPacketsLost=Number(e.stat("packetsLost")),n.videoFrameRate=Number(e.stat("googFrameRateOutput")),n.videoFrameRateReceived=Number(e.stat("googFrameRateReceived")),n.videoFrameRateDecoded=Number(e.stat("googFrameRateDecoded")),n.videoWidth=Number(e.stat("googFrameWidthReceived")),n.videoHeight=Number(e.stat("googFrameHeightReceived")),n.videoCodec=e.stat("googCodecName")),null),s=e=>{Number(e.stat("audioInputLevel"))>0?(n.audioSentPackets=Number(e.stat("packetsSent")),n.audioSentPacketsLost=Number(e.stat("packetsLost")),n.audioSentBytes=Number(e.stat("bytesSent")),n.audioCodec=e.stat("googCodecName"),n.audioRtt=Number(e.stat("googRtt"))/1e3):Number(e.stat("audioOutputLevel"))>0&&(n.audioRecvPackets=Number(e.stat("packetsReceived")),n.audioRecvPacketsLost=Number(e.stat("packetsLost")),n.audioRecvBytes=Number(e.stat("bytesReceived")),n.audioCodec=e.stat("googCodecName"))};e.getStats(t=>{if(t.result){const r=t.result();m(e,r);const i=(e,t)=>r.filter(n=>n.id===t.stat(e))[0],a=e=>i("localCandidateId",e),c=e=>i("remoteCandidateId",e);for(let e=0;e<r.length;e++){const t=r[e];t.stat&&("true"===t.stat("googActiveConnection")&&(t.stat("googChannelId").indexOf("audio")>-1?(n.audioLocalAddress=t.stat("googLocalAddress"),n.audioRemoteAddress=t.stat("googRemoteAddress"),n.audioLocalCandidateType=t.stat("googLocalCandidateType"),n.audioRemoteCandidateType=t.stat("googRemoteCandidateType"),n.audioTransportType=t.stat("googTransportType"),n.audioLocalRelayProtocol=u(a(t).stat("priority")),n.audioRemoteRelayProtocol=u(c(t).stat("priority"))):t.stat("googChannelId").indexOf("video")>-1&&(n.videoLocalAddress=t.stat("googLocalAddress"),n.videoRemoteAddress=t.stat("googRemoteAddress"),n.videoLocalCandidateType=t.stat("googLocalCandidateType"),n.videoRemoteCandidateType=t.stat("googRemoteCandidateType"),n.videoTransportType=t.stat("googTransportType"),n.videoLocalRelayProtocol=u(a(t).stat("priority")),n.videoRemoteRelayProtocol=u(c(t).stat("priority")))),s(t),o(t))}"videoCodec"in n&&!n.videoLocalAddress&&["LocalAddress","RemoteAddress","LocalCandidateType","RemoteCandidateType","TransportType","LocalRelayProtocol","RemoteRelayProtocol"].forEach(e=>{n["video"+e]=n["audio"+e]})}i(null,n)})}function v(e,t,n,i,a){const u=e=>{const t={packetsSent:"videoSentPackets",packetsLost:"videoSentPacketsLost",bytesSent:"videoSentBytes",framesPerSecond:"videoFrameRate",framesSent:"videoFrameRateSent",framesReceived:"videoFramesReceived",frameWidth:"videoWidth",frameHeight:"videoHeight"},r=["videoSentPackets","videoSentBytes"];for(const i in t)if(i in e){const o=t[i];r.includes(o)&&Number.isSafeInteger(n[o])?n[o]+=e[i]:n[o]=e[i]}},l=(r,a)=>{if("outboundrtp"===a?u(r):"inboundrtp"===a&&(n.videoRecvPackets=r.packetsReceived,n.videoRecvPacketsLost=r.packetsLost,n.videoRecvBytes=r.bytesReceived),(o.isFirefox&&["outboundrtp","inboundrtp"].includes(a)||!i&&"inboundrtp"===a)&&(n.videoFrameRate=(()=>{if(!("videoSentBytes"in n?n.videoSentBytes>0:n.videoRecvBytes>0))return 0;let e=0;if(o.isFirefox&&o.version<96)e=Number(r.framerateMean);else{const i="outboundrtp"===a?"framesEncoded":"framesDecoded";n[i]=r[i],e=p({currentStatFrames:r[i],currentTimestamp:r.timestamp,prevStatFrames:t[i],prevTimestamp:t.timeStamp||Date.now()})}return e})()),void 0===n.videoCodec&&-1!==["Safari"].indexOf(s.env.name)&&void 0!==r.codecId){const t=("answer"===e.remoteDescription.type?e.remoteDescription:e.localDescription).sdp,i=r.codecId.lastIndexOf("_"),o=c.getCodecsAndCodecMap(t,"video");-1!==i&&void 0!==o&&(n.videoCodec=o.codecMap[r.codecId.substring(i+1)])}};e.getStats(null).then(t=>{let o,p,b,v,y,E,S,_;const w=[],T=r=>{const i=r.type.toLowerCase().replace(/[^a-z]/g,"");const a=r.id.toLowerCase();if(/(in|out)boundrtp$/.test(i)){const t=/rtp/.test(a),o=t&&/audio/.test(a),u=t&&/video/.test(a),d=o||"audio"===r.kind,p=u||"video"===r.kind;if(d?((t,r)=>{if("outboundrtp"===r?(n.audioSentPackets=t.packetsSent,n.audioSentPacketsLost=t.packetsLost,n.audioSentBytes=t.bytesSent):"inboundrtp"===r&&(n.audioRecvPackets=t.packetsReceived,n.audioRecvPacketsLost=t.packetsLost,n.audioRecvBytes=t.bytesReceived),void 0===n.audioCodec&&-1!==["Safari"].indexOf(s.env.name)&&void 0!==t.codecId){const r=("answer"===e.remoteDescription.type?e.remoteDescription:e.localDescription).sdp,i=t.codecId.lastIndexOf("_"),o=c.getCodecsAndCodecMap(r,"audio");-1!==i&&void 0!==o&&(n.audioCodec=o.codecMap[t.codecId.substring(i+1)])}})(r,i):p&&l(r,i),r.hasOwnProperty("roundTripTime")){const e=r.mediaType||r.kind;"video"===e?w.push(r.roundTripTime):"audio"===e&&(n.audioRtt=r.roundTripTime)}if("remoteinboundrtp"===i&&r.hasOwnProperty("packetsLost")){const e=r.kind+"SentPacketsLost";n[e]||(n[e]=0),n[e]+=r.packetsLost}}else if("transport"===i){const e=r.selectedCandidatePairId;e&&(v=d(e,t))}else"localcandidate"===i?(o=r.candidateType,b=g(r),E=r.protocol||r.transport):"remotecandidate"===i?(p=r.candidateType,y=g(r)):"track"===i&&0!==a.indexOf("video")?(S=r.frameWidth,_=r.frameHeight,u(r)):"mediasource"===i&&(r.hasOwnProperty("framesPerSecond")&&(n.videoFrameRate=r.framesPerSecond),r.hasOwnProperty("width")&&(n.videoWidthInput=r.width),r.hasOwnProperty("height")&&(n.videoHeightInput=r.height))};if("function"==typeof t[Symbol.iterator]){m(e,Array.from(t));for(var C,I=r(t);!(C=I()).done;){const e=C.value;T(Array.isArray(e)?e[1]:e)}}else{m(e,t);for(const e in t)t.hasOwnProperty(e)&&T(t[e])}if(e.currentRemoteDescription&&(n.useDtx=c.hasSendDtx(e.currentRemoteDescription.sdp)),i&&(n.videoRtt=(()=>{if(0===w.length)return null;const e=w.filter(e=>e>0),t=e.reduce((e,t)=>e+t,0);return e.length?t/e.length:0})()),(n.audioRecvBytes||n.audioSentBytes)&&(n.audioLocalCandidateType=o,n.audioLocalAddress=b,n.audioRemoteCandidateType=p,n.audioRemoteAddress=y,n.audioTransportType=E,n.audioLocalRelayProtocol=v,void 0===n.audioCodec)){const t=("answer"===e.remoteDescription.type?e.remoteDescription:e.localDescription).sdp,r=c.getCodecs(t,"audio");n.audioCodec=r[0]}if((n.videoRecvBytes||n.videoSentBytes)&&(n.videoLocalCandidateType=o,n.videoLocalAddress=b,n.videoRemoteCandidateType=p,n.videoRemoteAddress=y,n.videoTransportType=E,n.videoLocalRelayProtocol=v,void 0===n.videoCodec)){const t=("answer"===e.remoteDescription.type?e.remoteDescription:e.localDescription).sdp,r=c.getCodecs(t,"video");n.videoCodec=r[0]}!function(e,t){(t?f:h).forEach(t=>{e.hasOwnProperty(t)||(e[t]=null)})}(n,i),n.videoWidth=n.videoWidth||S,n.videoHeight=n.videoHeight||_,a(null,n)}).catch((function(e){a(e)}))}},function(e,t,n){"use strict";const r=n(281);e.exports=(e,t)=>{let n="";if(!e||!t)return n;const i=t.get(e);if(i){const e=i.localCandidateId;if(e){const i=t.get(e);if(i){const e=i.relayProtocol,t=i.priority;if(e){n="TURN/"+e.toUpperCase()}else n=r(t)}}}return n}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(18));let o=function(){function e(){(0,i.default)(this,"value",null),(0,i.default)(this,"changeCount",0)}return e.prototype.onValue=function(e){e&&e!==this.value&&(this.value&&(this.changeCount+=1),this.value=e)},e}();t.default=o},function(e,t,n){var r=n(11),i=n(636),o=n(232),s=Math.max,a=Math.min;e.exports=function(e,t,n){var c,u,d,l,p,f,h=0,m=!1,g=!1,b=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=c,r=u;return c=u=void 0,h=t,l=e.apply(r,n)}function y(e){return h=e,p=setTimeout(S,t),m?v(e):l}function E(e){var n=e-f;return void 0===f||n>=t||n<0||g&&e-h>=d}function S(){var e=i();if(E(e))return _(e);p=setTimeout(S,function(e){var n=t-(e-f);return g?a(n,d-(e-h)):n}(e))}function _(e){return p=void 0,b&&c?v(e):(c=u=void 0,l)}function w(){var e=i(),n=E(e);if(c=arguments,u=this,f=e,n){if(void 0===p)return y(f);if(g)return clearTimeout(p),p=setTimeout(S,t),v(f)}return void 0===p&&(p=setTimeout(S,t)),l}return t=o(t)||0,r(n)&&(m=!!n.leading,d=(g="maxWait"in n)?s(o(n.maxWait)||0,t):d,b="trailing"in n?!!n.trailing:b),w.cancel=function(){void 0!==p&&clearTimeout(p),h=0,c=f=u=p=void 0},w.flush=function(){return void 0===p?l:_(i())},w}},function(e,t,n){var r=n(14);e.exports=function(){return r.Date.now()}},function(e,t,n){"use strict";const r=n(50);t.check=function(e){void 0===e&&(e={});const t=e.env||n(3);return"Chrome"===t.name&&t.userAgent.toLowerCase().indexOf("android")>-1&&t.version<65},t.once=r(()=>t.check())},function(e,t,n){"use strict";const r=n(36),i=n(5);e.exports=function(e){let t,n,o,s,a;const c=this;let u=e.archiving;const d=e.archivingStarted||"Archiving on",l=e.archivingEnded||"Archiving off";let p=!0;const f=function(e){s.nodeValue=e,t.setAttribute("title",e)},h=function(){a&&(clearTimeout(a),a=null),u?i.addClass(n,"OT_active"):i.removeClass(n,"OT_active"),i.removeClass(c.domElement,"OT_archiving-"+(u?"off":"on")),i.addClass(c.domElement,"OT_archiving-"+(u?"on":"off")),e.show&&u?(f(d),i.addClass(o,"OT_mode-on"),i.removeClass(o,"OT_mode-auto"),c.setDisplayMode("on"),a=setTimeout(()=>{i.addClass(o,"OT_mode-auto"),i.removeClass(o,"OT_mode-on")},5e3)):e.show&&!p?(i.addClass(o,"OT_mode-on"),i.removeClass(o,"OT_mode-auto"),c.setDisplayMode("on"),f(l),a=setTimeout(()=>{c.setDisplayMode("off")},5e3)):c.setDisplayMode("off")};r(this,{mode:u&&e.show?"on":"off",nodeName:"h1",htmlAttributes:{className:"OT_archiving OT_edge-bar-item OT_edge-bottom"},onCreate(){t=i.createElement("div",{className:"OT_archiving-light-box"},""),n=i.createElement("div",{className:"OT_archiving-light"},""),t.appendChild(n),o=i.createElement("div",{className:"OT_archiving-status OT_mode-on OT_edge-bar-item OT_edge-bottom"},""),s=document.createTextNode(""),o.appendChild(s),c.domElement.appendChild(t),c.domElement.appendChild(o),h()}}),this.setShowArchiveStatus=function(t){e.show=t,c.domElement&&h.call(c)},this.setArchiving=function(e){u=e,p=!1,c.domElement&&h.call(c)}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.global||(void 0!==typeof window?window:global);return()=>t.navigator&&t.navigator.mediaDevices}},function(e,t,n){"use strict";(function(t){const r=n(9),i=n(11),o=n(107),s=n(641),a=n(26),c=n(22),u=n(6);e.exports=function(e){void 0===e&&(e={});const d=e.env||n(3),l=e.Errors||n(4),p=e.otError||n(13)(),f=e.logging||n(1)("getUserMedia"),h=e.screenSharing||n(165)(),m=e.getDisplayMediaExtensionHelper||n(289),g=e.customGetUserMedia,b=e.global||(void 0!==typeof window?window:global),v=e.analytics||new a,y=b.navigator,E=b.location,S=()=>{return g||(y.mediaDevices?(e=y.mediaDevices).getUserMedia.bind(e):void 0);var e},_=function(){const e=S();return e?e(...arguments):t.reject(new Error("Cannot find getUserMedia"))},w=()=>{return g||(y.mediaDevices&&y.getDisplayMedia?y.getDisplayMedia.bind(y):y.mediaDevices&&y.mediaDevices.getDisplayMedia?(e=y.mediaDevices).getDisplayMedia.bind(e):void 0);var e},T=function(){const e=w();return e?e(...arguments):t.reject(new Error("Cannot find getDisplayMedia"))},C=(()=>{const e={name:l.USER_MEDIA_ACCESS_DENIED,message:"End-user denied permission to hardware devices"},t={name:l.NOT_SUPPORTED,message:"A constraint specified is not supported by the browser."},n={name:l.CONSTRAINTS_NOT_SATISFIED,message:"It's not possible to satisfy one or more constraints passed into the getUserMedia function"},i={name:l.NO_DEVICES_FOUND,message:"No voice or video input devices are available on this machine."},o={name:l.HARDWARE_UNAVAILABLE,message:"The selected voice or video devices are unavailable. Verify that the chosen devices are not in use by another application."},a={name:l.UNABLE_TO_CAPTURE_SCREEN,message:"Unable to capture screen. Unknown error occurred"},c={AbortError:{name:l.UNABLE_TO_CAPTURE_MEDIA,message:"Unable to capture media. Unknown error occurred"},NotAllowedError:e,NotFoundError:i,NotReadableError:o,OverconstrainedError:n,SecurityError:r({},e,{message:"End-user denied permission to hardware devices or user media support may be disabled on this page"}),TypeError:n,PermissionDeniedError:e,PermissionDismissedError:e,NotSupportedError:t,ConstraintNotSatisfiedError:n,MandatoryUnsatisfiedError:n,OverConstrainedError:n,DevicesNotFoundError:i,NoDevicesFoundError:i,HardwareUnavailableError:o,SourceUnavailableError:o,TrackStartError:o,ScreenCaptureError:a,TabCaptureError:a};return s({objectToTrack:c,keys:["PermissionDeniedError","PermissionDismissedError","NotSupportedError","ConstraintNotSatisfiedError","MandatoryUnsatisfiedError","OverConstrainedError","DevicesNotFoundError","NoDevicesFoundError","HardwareUnavailableError","SourceUnavailableError","TrackStartError","ScreenCaptureError","TabCaptureError"],onUsage(e){v.logEvent({action:"DeprecatedPropertyUsage:getUserMedia:errorMap",variation:"Event",payload:{key:e}})}}),c})(),I=(e,t)=>{let n=e;"AbortError"===n&&"string"==typeof t&&t.match(/(screen|tab).?capture/i)&&(n="ScreenCaptureError");const r=C[n];let i;return i=r?p(r.name,new Error(`${r.message} (getUserMedia error: ${e})`)):new Error("Unknown error while getting user media: "+e),i.originalMessage=t,i.originalName=e,i};return function(e,n){if(void 0===n&&(n=!1),f.debug("getUserMedia wrapper called with",e),function(e){if(!e||!i(e))return!0;for(const t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}(e))return f.error("Couldn't get UserMedia: All constraints were false"),u(t.reject(p(l.NO_VALID_CONSTRAINTS,new Error("Video and Audio was disabled, you need to enable at least one"))));const r=n&&m.isSupportedInThisBrowser?T:_,s=u(r(e).catch(e=>{const n=(e=>{if(i(e)&&e.name){let t=e.name,n=e.message;if("Cannot find getUserMedia"!==n&&"Cannot find getDisplayMedia"!==n||(t="Chrome"===d.name&&d.version>73&&"https:"!==b.location.protocol?"NotAllowedError":"NotSupportedError"),"Safari"===d.name&&"Error"===t){const n=Object.prototype.toString.call(e).match(/^\[object (\w+Error)\]$/);n&&(t=n[1])}const r=I(t,n);return r.constraintName=e.constraint||e.constraintName,r instanceof c||v.logEvent({action:"UnexpectedError:getUserMedia:parseErrorEvent",variation:"Event",payload:{name:r.name,message:r.message,originalMessage:r.originalMessage}}),r}if("string"==typeof e){const t=I(e);return v.logEvent({action:"CheckUnreachable:getUserMedia:parseErrorEvent",variation:"Event",payload:{info:"error is string",error:e}}),t}return v.logEvent({action:"CheckUnreachable:getUserMedia:parseErrorEvent",variation:"Event",payload:{info:"error was not string or object with name property",error:e}}),new Error("Unknown error type while getting media")})(e);if(n.name===l.UNABLE_TO_CAPTURE_SCREEN)return new t((e,t)=>{h.checkCapability(e=>{if("chrome"===e.extensionRequired){if(e.extensionRegistered&&!e.extensionInstalled){const e=p(l.SCREEN_SHARING_EXTENSION_NOT_INSTALLED,n);e.message="Screen sharing extension not installed see https://tokbox.com/developer/guides/screen-sharing/js/#chrome-extension",t(e)}else if(!e.extensionRegistered){const e=p(l.SCREEN_SHARING_EXTENSION_NOT_REGISTERED,n);e.message="Screen sharing extension not registered see https://tokbox.com/developer/guides/screen-sharing/js/#chrome-extension",t(e)}}else t(n)})});throw n}).then(e=>(f.debug("got stream:",{stream:e,tracks:e.getTracks(),trackLabels:e.getTracks().map(e=>e.label)}),e))),a=-1!==E.protocol.indexOf("https")?500:100;let g=!0;const y=()=>{g=!1};return s.then(y,y),o(a).then(()=>{if(!g)return;const e=()=>s.emit("accessDialogClosed");s.emit("accessDialogOpened"),s.then(e,e)}),s}}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=function(e){let t=void 0===e?{}:e,n=t.objectToTrack,r=t.keys,i=t.onUsage;if(!Array.isArray(r)&&void 0!==r)throw new Error("keys must be an array, or undefined");if("function"!=typeof i)throw new Error("onUsage must be a function");if(null==n)throw new Error("Expected objectToTrack to be a trackable object");Object.keys(n).forEach(e=>{if(void 0!==r&&-1===r.indexOf(e))return;let t=n[e];Object.defineProperty(n,e,{get:()=>(i(e),t),set(n){t=n,i(e,t)},enumerable:!0})})}},function(e,t,n){"use strict";const r=n(3),i=n(643).isCallbackBasedAPI;let o=n(267),s=null;const a=(e,t)=>{s.getSources(e,t)},c=(e,t)=>{s.getSources(e).then(e=>{t(void 0,e)},t)},u=(e,t)=>{(i?a:c)({types:[e]},(n,r)=>{if(n)return void t(n);const i=r[0];if(!i)return void t(new Error("Could not find Electron source for screensharing"));const o={audio:!1,video:{mandatory:{chromeMediaSource:e,chromeMediaSourceId:i.id}}};t(void 0,o)})};e.exports=function(e){void 0===e&&(e={});try{const t=()=>{let e=void 0!==typeof window?window:global;for(;"function"!=typeof e.require&&e.parent&&e.parent!==e;)e=e.parent;return e},n=()=>{const e=t();return(e.require?e.require("electron"):e.electron).desktopCapturer};s=e.desktopCapturer||(r.isElectron?n():null),o=e.isElectronScreenSharingSource||o}catch(e){}return{isSupportedInThisBrowser:null!==s,autoRegisters:!0,extensionRequired:!1,getConstraintsShowsPermissionUI:!1,sources:{screen:!0,application:!0,window:!0,browser:!0},register:()=>({isInstalled:e=>e(!0),getConstraints(e,t,n){o(e)?n(void 0,{audio:!0,video:!1}):u(e,n)}})}}},function(e,t,n){"use strict";const r=n(3).version<78,i=!r;e.exports={isCallbackBasedAPI:r,isPromiseBasedAPI:i}},function(e,t,n){"use strict";const r=n(3),i=n(163).default;e.exports={isSupportedInThisBrowser:!!r.isFirefox&&!i,autoRegisters:!0,extensionRequired:!1,extensionInstalled:!1,getConstraintsShowsPermissionUI:!1,sources:{screen:!0,application:!1,window:!0,browser:!1},register:()=>({isInstalled(e){e("object"==typeof OTScreenSharing)},getConstraints(e,t,n){t.video={mediaSource:e},t.browserWindow&&(t.video.browserWindow=t.browserWindow,delete t.browserWindow),void 0!==t.scrollWithPage&&(t.video.scrollWithPage=t.scrollWithPage,delete t.scrollWithPage),n(void 0,t)}})}},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8)),s=r(n(20));const a=n(646).normaliseOptions,c=n(290).isMediaStreamTrack,u=n(149),d=n(9),l=n(141),p=n(291).default,f=n(4),h=n(48),m=n(13),g=n(292).isValidVideoContentHint,b=n(6),v=n(150),y=n(3),E=n(266);e.exports=function(e){void 0===e&&(e={}),["deviceHelpers","getUserMediaHelper"].forEach(t=>{u(e[t],t+" dependency must be injected into processPubOptions")});const t=e.generateConstraintInfo||n(257),r=e.global||(void 0!==typeof window?window:global),S=e.logging||n(1)("processPubOptions"),_=e.navigator||r.navigator,w=e.screenSharing||n(165)(),T=e.env||y,C=n(647)({navigator:_||{}}),I=e,R=I.deviceHelpers,x=I.getUserMediaHelper;return(e,n,u)=>{const y=a(e,n,S),_=v(y.videoSource),I=c(y.audioSource),O=c(y.videoSource),k=!I&&null!==y.audioSource,N=!O&&null!==y.videoSource,Z=k||N,A=e=>"boolean"==typeof e,L=!_||I||E,V=l(y,{mirror:!_&&!O,publishAudio:!0,publishVideo:!0,showControls:!0,fitMode:_?"contain":"cover",audioFallbackEnabled:L,insertDefaultUI:!0,enableRenegotiation:!1,enableStereo:!1,enableDtx:!1,disableAudioProcessing:!1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0});if(void 0===V.videoContentHint||g(V.videoContentHint)||(S.warn(n+': Invalid content hint. Valid content hints are "text", "detail", "motion", or ""'),V.videoContentHint=""),V.name&&(V.name=String(V.name)),A(V.enableDtx)||(V.enableDtx=!1),A(V.enableStereo)||(V.enableStereo=!1),V.constraints)S.warn(n+": You have passed your own constraints not using ours");else{const e=t((0,s.default)({isScreenSharing:_,isCustomAudioTrack:I,isCustomVideoTrack:O},h(V,["audioSource","publishAudio","videoSource","publishVideo","resolution","maxResolution","frameRate","facingMode","enableRenegotiation","enableStereo","disableAudioProcessing","echoCancellation","noiseSuppression","autoGainControl"]),{env:T,usingOptionalMandatoryStyle:C(_)}));d(V,e)}const P={isScreenSharing:_,isCustomAudioTrack:I,isCustomVideoTrack:O,shouldAllowAudio:L,properties:V};return b(P),P.getUserMedia=(0,o.default)(i.default.mark((function e(){var t,s,a,c,d,l,h,g,b;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return P.emit("accessDialogOpened",...t)},s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return P.emit("accessDialogClosed",...t)},Z){e.next=7;break}return a=new r.MediaStream,I&&a.addTrack(y.audioSource),O&&a.addTrack(y.videoSource),e.abrupt("return",a);case 7:if(!_){e.next=15;break}return e.next=10,w.getConstraints({onAccessDialogOpened:t,onAccessDialogClosed:s,videoSource:y.videoSource,constraints:V.constraints});case 10:if(V.constraints=e.sent,!u()){e.next=13;break}throw m(f.CANCEL,new Error("getUserMedia request was aborted"));case 13:e.next=25;break;case 15:return e.next=17,R.shouldAskForDevices();case 17:if(c=e.sent,!u()){e.next=20;break}throw m(f.CANCEL,new Error("getUserMedia request was aborted"));case 20:S.debug(n+": shouldAskForDevices:",c),c.video||(S.warn(n+": Setting video constraint to false, there are no video sources"),V.constraints.video=!1),c.audio||(S.warn(n+": Setting audio constraint to false, there are no audio sources"),V.constraints.audio=!1),P.videoDevices=c.videoDevices,P.audioDevices=c.audioDevices;case 25:if(d=V.constraints,S.debug(n+": onConstraintsFound",d),!u()){e.next=29;break}throw m(f.CANCEL,new Error("getUserMedia request was aborted"));case 29:return l="Failed to acquire functional stream, this might be caused by the following iOS bug: https://bugs.webkit.org/show_bug.cgi?id=188088",h="Failed to acquire functional stream, this might be caused by the following iOS bug: https://bugs.webkit.org/show_bug.cgi?id=204106",g=e=>"NotReadableError"===e.originalName&&"Failed starting capture of a video track"===e.originalMessage,b=function(){var e=(0,o.default)(i.default.mark((function e(){var r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=x(d,_)).on("accessDialogOpened",t),r.on("accessDialogClosed",s),e.prev=3,e.next=6,r;case 6:if(o=e.sent,!(T.isiOS&&V.publishVideo&&o.getVideoTracks().length&&"ended"===o.getVideoTracks()[0].readyState)){e.next=11;break}throw o.getTracks().forEach(e=>e.stop()),new Error(l);case 11:return e.abrupt("return",o);case 14:if(e.prev=14,e.t0=e.catch(3),!T.isiOS){e.next=34;break}if(!(g(e.t0)&&T.iOSVersion>=13&&T.iOSVersion<13.4)){e.next=32;break}return e.prev=18,a=x({audio:!0,video:!1},!1),e.next=22,a;case 22:e.sent.getTracks().forEach(e=>e.stop()),e.next=29;break;case 26:e.prev=26,e.t1=e.catch(18),S.debug(n+": error disposing audio track",e.t1);case 29:throw new Error(h);case 32:if(e.t0.name!==f.HARDWARE_UNAVAILABLE){e.next=34;break}throw new Error(l);case 34:throw e.t0;case 35:return e.prev=35,setTimeout(()=>{r.off("accessDialogOpened",t),r.off("accessDialogClosed",s)}),e.finish(35);case 38:case"end":return e.stop()}}),e,null,[[3,14,35,38],[18,26]])})));return function(){return e.apply(this,arguments)}}(),e.next=35,p(b,(e,t)=>!(![l,h].includes(e.message)||1!==t||u())&&1e3)();case 35:if(a=e.sent,!u()){e.next=39;break}throw a.getTracks().forEach(e=>{e.stop()}),m(f.CANCEL,new Error("getUserMedia request was aborted"));case 39:return I&&a.addTrack(y.audioSource),O&&a.addTrack(y.videoSource),e.abrupt("return",a);case 42:case"end":return e.stop()}}),e)}))),P}}},function(e,t,n){"use strict";const r=n(290).isMediaStreamTrack,i=n(37),o=n(3);t.normaliseOptions=(e,t,n)=>{const s=e&&"object"==typeof e?i(e):{};if(!1===s.audioSource&&(s.audioSource=null),!1===s.videoSource&&(s.videoSource=null),void 0===s.minVideoBitrate||"number"==typeof s.minVideoBitrate&&s.minVideoBitrate>0||(n.warn(t+": Invalid minVideoBitrate in publisher properties. minVideoBitrate must be a positive number"),delete s.minVideoBitrate),void 0===s.audioBitrate||s.audioBitrate>=6e3&&s.audioBitrate<=51e4||(n.warn(t+": Invalid audioBitrate in publisher properties. audioBitrate must be a number between 6000 and 510000 bits per second"),delete s.audioBitrate),"Firefox"===o.name&&o.version<49){const e="Firefox 48 and below";r(s.audioSource)&&(s.audioSource=null,n.warn(`${t}: Cannot use custom tracks with ${e}. Setting audioSource to null`)),r(s.videoSource)&&(s.videoSource=null,n.warn(`${t}: Cannot use custom tracks with ${e}. Setting videoSource to null`))}return s}},function(e,t,n){"use strict";const r=n(3),i=r.name,o=r.version,s=n(260);e.exports=function(e){let t=(void 0===e?{}:e).navigator,n=void 0===t?window.navigator:t;return function(e){return e&&!s||!(n.mediaDevices&&n.mediaDevices.getUserMedia)||"Chrome"===i&&o<61}}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={}),["processPubOptions"].forEach(t=>{if(!e[t])throw new Error(t+" dependency must be injected into OT.getUserMedia")});const t=e.logging||n(1)("getUserMedia"),r=e.processPubOptions;return function(e){void 0===e&&(e={});return r(e,"OT.getUserMedia",()=>!1).getUserMedia().catch(e=>{throw t.error("OT.getUserMedia failed to getUserMedia: "+e),e})}}},function(e,t,n){"use strict";e.exports=function(e,t){const n=(t,n)=>()=>{throw new Error(`Cannot ${t} ${n}, ${e} is destroyed`)};Object.keys(t).forEach(e=>{"function"==typeof t[e]?t[e]=n("call",e):Object.defineProperty(t,e,{get:n("get",e),set:n("set",e)})})}},function(e,t,n){"use strict";e.exports=e=>{if("srcObject"in e)return;const t=window&&window.URL;"srcObject"in window.HTMLMediaElement.prototype||Object.defineProperty(e,"srcObject",{get(){return this._srcObject},set(e){const n=this;if(this._srcObject=e,this.src&&t.revokeObjectURL(this.src),e)return this.src=t.createObjectURL(e),e.addEventListener("addtrack",()=>{n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)}),e.addEventListener("removetrack",()=>{n.src&&t.revokeObjectURL(n.src),n.src=t.createObjectURL(e)}),this._srcObject;this.src=""}})}},function(e,t,n){"use strict";e.exports=e=>{return!(!(t=e)||"function"!=typeof t.getBoundingClientRect)&&(e=>{const t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth,i=t.top<=n&&t.top+t.height>=0,o=t.left<=r&&t.left+t.width>=0;return i&&o})(e)&&(e=>{const t=e=>!(!e.style||"hidden"!==e.style.visibility)||!!e.parentNode&&t(e.parentNode);return null!==e.offsetParent&&!t(e)})(e);var t}},function(e,t,n){"use strict";const r=n(105),i=n(5),o={0:"rotate(0deg)",270:"rotate(90deg)",90:"rotate(-90deg)",180:"rotate(180deg)"};e.exports=function(e,t,n){let s=n;r(e,{isRotated:{get(){return this.orientation()&&(270===this.orientation().videoOrientation||90===this.orientation().videoOrientation)}},orientation:{get:()=>s,set(n){s=n;const r=o[n.videoOrientation]||o.ROTATED_NORMAL;switch(i.env.name){case"Chrome":case"Safari":t().style.webkitTransform=r;break;default:t().style.transform=r}e.trigger("orientationChanged",s)}},audioChannelType:{get(){return"mozAudioChannelType"in this.domElement?this.domElement.mozAudioChannelType:"unknown"},set(e){"mozAudioChannelType"in this.domElement&&(this.domElement.mozAudioChannelType=e)}}})}},function(e,t,n){"use strict";e.exports=function(){return function(e,t,n){const r=[];function i(i){setTimeout(()=>{if(r.length)if(function(e){return e.getTracks().every(e=>"ended"===e.readyState)}(e))s(),"function"==typeof t&&t();else{const e=i.target;o(e),"function"==typeof n&&n(e)}},100)}function o(e){e.onended===i&&(e.onended=null);const t=r.indexOf(e);t>=0&&r.splice(t,1)}function s(){r.slice().forEach(o)}function a(){e.getTracks().forEach(e=>{r.push(e),e.onended=i})}return a(),{stop:s,refresh:()=>{s(),a()}}}}},function(e,t,n){"use strict";e.exports=e=>{if((e=e||n(3)).isiPad)return!0;return e.isiPhone?e.iOSVersion>=15:!!e.isSafari&&e.version>=15}},function(e,t,n){var r=n(64),i=n(99),o=n(35);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},function(e,t,n){"use strict";e.exports=function(e,t){const n=setTimeout(()=>{e((e,n)=>{if(!e)for(let e=0;e<n.length;e+=1){const r=n[e];-1===r.id.indexOf("_send")||"ssrc"!==r.type||"audio"!==r.kind&&"audio"!==r.mediaType||0!==parseInt(r.bytesSent,10)||t()}})},3e3);return function(){clearTimeout(n)}}},function(e,t,n){"use strict";e.exports=function(e,t,n){void 0===n&&(n=!1);let r=null,i=0,o=null,s=n;const a=e=>"inbound-rtp"===e.type&&"audio"===(e.kind||e.mediaType),c=e=>e.id===o&&"track"===e.type&&"audio"===(e.kind||e.mediaType),u=setInterval(()=>{e((e,n)=>{if(e)return;const d=n.find(a)||{};o=d.trackId;const l=n.find(c);if(l){const e=l.audioLevel,n=l.totalSamplesReceived;if(void 0===e)return;((e,t)=>e===r&&t===i)(e,n)?(clearInterval(u),t("audioLevelStuck")):((e,t)=>!s&&0===e&&0===r&&t>i)(e,n)&&(clearInterval(u),t("audioLevelStuckAt0")),r=e,i=n}})},500);return n||setTimeout(()=>{s=!0},3e3),{stop:()=>{clearInterval(u)}}}},function(e,t,n){"use strict";(function(t){const r=new(n(26));e.exports=function(e){void 0===e&&(e={});const i=e.analytics||r,o=e.errors||n(4),s=e.ExceptionCodes||n(10),a=e.otError||n(13)(),c=e.sessionObjects||n(21),u=e.uuid||n(19);return function(e){void 0===e&&(e=()=>{});const n=u();function r(t){t?e(a(o.REPORT_ISSUE_FAILED,new Error("Error calling OT.reportIssue(). Check the client's network connection."),s.REPORT_ISSUE_ERROR)):e(null,n)}0===c.sessions.length()?i.logEvent({action:"ReportIssue",variation:"Event",payload:{reportIssueId:n}},null,r):t.all(c.sessions.map(e=>e.reportIssue({id:n}))).then(()=>r(),e=>r(e))}}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=e=>{let t=e.window,n=!1;try{const e=Object.defineProperty({},"passive",{get(){n=!0}});t.addEventListener("testPassive",null,e),t.removeEventListener("testPassive",null,e)}catch(e){}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(302),s=(r=o)&&r.__esModule?r:{default:r};var a=function(){},c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.internalIsCanceled=!1,this.listeners=[]}return i(e,[{key:"isCanceled",value:function(){return this.internalIsCanceled}},{key:"cancel",value:function(){this.internalIsCanceled||(this.internalIsCanceled=!0,this.listeners.forEach((function(e){return e()})),this.listeners=null)}},{key:"throwIfCanceled",value:function(){if(this.internalIsCanceled)throw new s.default("Operation has been canceled.")}},{key:"onCancel",value:function(e){var t=this;return this.internalIsCanceled?a:(this.listeners.push(e),function(){if(t.listeners){var n=t.listeners.indexOf(e);-1!==n&&t.listeners.splice(n,1)}})}},{key:"fork",value:function(){if(this.internalIsCanceled)return e.CANCELED;var t=new e;return this.onCancel((function(){return t.cancel()})),t}}]),e}();t.default=c,c.CANCELED=new c,c.CANCELED.internalIsCanceled=!0},function(e,t,n){"use strict";(function(t){const r=n(63),i=n(303).default,o=n(155);n(108)();e.exports=function(e,n){const s=r(e),a=new t(t=>{const n=()=>{(e.videoWidth()>2||e.videoHeight()>2)&&t(!0)};s.on("videoDimensionsChanged",n),n()});return i(o(a,n,()=>!1),()=>s.removeAll())}}).call(this,n(0))},function(e,t,n){"use strict";(function(t){const r=n(63),i=n(303).default,o=n(155);n(108)();e.exports=function(e,n){void 0===n&&(n=5e3);const s=r(e),a=new t(e=>{s.on("timeupdate",e),s.on("loadedmetadata",e)});return i(o(a,n,()=>!1),()=>s.removeAll())}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(1)("WidgetView:fixMini");e.exports=function(e){const t=e.clientWidth,n=e.clientHeight;e.classList.remove("OT_micro"),e.classList.remove("OT_mini"),(t<64||n<64)&&(e.classList.add("OT_micro"),r.debug("OT_micro class added",{clientWidth:t,clientHeight:n,microWidth:64,microHeight:64})),(t<128||n<128)&&(e.classList.add("OT_mini"),r.debug("OT_mini class added",{clientWidth:t,clientHeight:n,miniWidth:128,miniHeight:128}))}},function(e,t,n){"use strict";const r=n(19);e.exports=function(e,t){let n,i;if(e&&e.nodeName?(n=e,n.getAttribute("id")&&0!==n.getAttribute("id").length||n.setAttribute("id","OT_"+r()),i=n.getAttribute("id")):e&&(n=document.getElementById(e),n&&(i=e)),i||(i="OT_"+r().replace(/-/g,"_")),!n)return n=document.createElement("div"),n.id=i,n.setAttribute("id",i),n.style.backgroundColor="#000000",document.body.appendChild(n),n;const o=document.createElement("div");switch(o.id="OT_"+r(),t){case"append":return n.appendChild(o),o;case"before":return n.parentNode.insertBefore(o,n),o;case"after":return n.parentNode.insertBefore(o,n.nextSibling),o;case"replace":default:for(;n.firstChild;)n.removeChild(n.firstChild);return n}}},function(e,t,n){"use strict";e.exports=function(e,t){return void 0===t&&(t="px"),String(parseFloat(e,10))===String(e).trim()?`${String(e).trim()}${t}`:e}},function(e,t,n){"use strict";(function(t){const r=n(74);e.exports=function(e,n){let i=void 0===n?{}:n,o=i.frequency,s=void 0===o?60:o,a=i.timeout,c=void 0===a?2e3:a;return new t((t,n)=>{let i;const o=new r(()=>{(function(){try{return e()}catch(e){return!1}})()&&(clearTimeout(i),o.stop(),t())},s);i=setTimeout(()=>{o.stop(),n(new Error("TIMEOUT"))},c),o.start()})}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(13)(),i=n(4),o=n(10);e.exports=e=>"404"===String(e.code)?r(i.STREAM_NOT_FOUND,new Error("stream not found"),o.UNABLE_TO_SUBSCRIBE):"409"===String(e.code)&&"streamLimitExceeded"===e.message?r(i.STREAM_LIMIT_EXCEEDED,new Error("The limit for concurrent streams in the session has been reached"),o.STREAM_LIMIT_EXCEEDED):r(i.UNABLE_TO_SUBSCRIBE,new Error(`subscriberCreate failed with unexpected code ${e.code}: ${e.message}`),o.UNEXPECTED_SERVER_RESPONSE)},function(e,t,n){"use strict";const r=n(27),i=n(49),o=n(104),s=n(23)();e.exports=e=>{let t=e.subscriber,n=e.audioLevelSampler,a=0,c=0;const u=new o(()=>{const e=t.listenerCount(r.AUDIO_LEVEL_UPDATED);i()-c>1e4&&0===e?u.stop():(a=n.sample(),e>0&&t.dispatchEvent(new s.AudioLevelUpdatedEvent(a)))});return Object.defineProperty(t,"loudness",{get:()=>(u.start(),c=i(),a),set(){throw new TypeError("Cannot set readonly property loudness")},configurable:!0}),t.listenerCount(r.AUDIO_LEVEL_UPDATED)&&u.start(),t.on("audioLevelUpdated:added",()=>{u.start()}),t.once(r.SUBSCRIBER_DESTROYED,()=>{u.stop()}),{destroy(){n.destroy(),u.stop()}}}},function(e,t,n){"use strict";const r=n(256),i=n(146),o=n(670),s=n(305),a=n(306),c=n(162)(),u=n(671),d=n(1)("Subscriber");e.exports=function(e,t){void 0===t&&(t={});const n=t.hasGetSynchronizationSupport;if(e){if(o({hasGetSynchronizationSupport:n}))return new r(e.getSynchronizationSources);if(s())return new r(e.getStats);if(a()){let e;try{e=t.audioContext||c()}catch(e){d.warn("Failed to get AudioContext()",e)}if(u(e))return new i(e)}}}},function(e,t,n){"use strict";const r=n(3),i=()=>window.RTCRtpReceiver&&"getSynchronizationSources"in window.RTCRtpReceiver.prototype;e.exports=function(e){void 0===e&&(e={});return(e.hasGetSynchronizationSupport||i)()&&!r.isFirefox}},function(e,t,n){"use strict";e.exports=e=>(void 0!==typeof window?window:global).AudioContext&&e instanceof(void 0!==typeof window?window:global).AudioContext||(void 0!==typeof window?window:global).webkitAudioContext&&e instanceof(void 0!==typeof window?window:global).webkitAudioContext},function(e,t,n){"use strict";const r=n(36),i=n(5);e.exports=function(e){let t=!1,n=!1;const o=function(e){const r=["auto","on"].indexOf(this.getDisplayMode())>-1;i.removeClass(e,"OT_video-disabled OT_video-disabled-warning OT_active"),r&&(t?i.addClass(e,"OT_video-disabled"):n&&i.addClass(e,"OT_video-disabled-warning"),i.addClass(e,"OT_active"))}.bind(this);this.disableVideo=function(e){t=e,!0===e&&(n=!1),o(this.domElement)},this.setWarning=function(e){n=e,o(this.domElement)},r(this,{mode:e.mode||"auto",nodeName:"div",htmlAttributes:{className:"OT_video-disabled-indicator"}});const s=this.setDisplayMode.bind(this);this.setDisplayMode=function(e){s(e),o(this.domElement)}}},function(e,t,n){"use strict";const r=n(36),i=n(5);e.exports=function(e){let t=!1;const n=e=>{const n=["auto","on"].indexOf(this.getDisplayMode())>-1;i.removeClass(e,["OT_audio-blocked","OT_active"].join(" ")),n&&(t&&i.addClass(e,"OT_audio-blocked"),i.addClass(e,"OT_active"))};this.setAudioBlocked=e=>{t=e,n(this.domElement)},r(this,{mode:e.mode||"auto",nodeName:"div",htmlAttributes:{className:"OT_audio-blocked-indicator"}});const o=this.setDisplayMode.bind(this);this.setDisplayMode=e=>{o(e),n(this.domElement)}}},function(e,t,n){"use strict";const r=n(36),i=n(5);e.exports=function(e){let t=!1;const n=e=>{const n=["auto","on"].indexOf(this.getDisplayMode())>-1;i.removeClass(e,["OT_active"].join(" ")),n&&t&&i.addClass(e,"OT_active")};this.setVideoUnsupported=e=>{t=e,n(this.domElement)},r(this,{mode:e.mode||"auto",nodeName:"div",htmlAttributes:{className:"OT_video-unsupported"},htmlContent:'<div class="OT_video-unsupported-bar"></div><div class="OT_video-unsupported-img"></div><span class="OT_video-unsupported-text">Video format not supported</span>'});const o=this.setDisplayMode.bind(this);this.setDisplayMode=e=>{o(e),n(this.domElement)}}},function(e,t,n){"use strict";const r=n(48),i=n(9),o=n(62),s=n(75),a=n(161);e.exports=function(e,t){let n;void 0===t&&(t=5e3);let c=!1;const u={},d=()=>{c||e((e,a)=>{if(!c){if(!e){const e=function(e){return void 0===e&&(e=[]),o(e,e=>s.isVideoInboundRtpStat(e))}(a);e?i(u,r(e,["timestamp","framesDecoded"])):u.timestamp||i(u,{timestamp:Date.now(),framesDecoded:0})}n=setTimeout(d,t)}})};return d(),{getFrameRateFromStat:e=>a({currentStatFrames:e.framesDecoded,currentTimestamp:e.timestamp,prevStatFrames:u.framesDecoded,prevTimestamp:u.timestamp}),destroy(){c=!0,n&&(clearTimeout(n),n=null)}}}},function(e,t,n){"use strict";e.exports=e=>{let t=e.connectivityState,n=e.onWarning,r=e.onTimeout,i=e.warningMs,o=e.timeoutMs;const s=[],a=()=>{s.forEach(e=>clearTimeout(e))};t.observe({onEnterConnecting(){s.push(setTimeout(n,i),setTimeout(r,o))},onEnterConnected:a,onEnterDisconnected:a})}},function(e,t,n){"use strict";const r=n(309);e.exports=e=>{let t=e.onInvalidTransition;return new r({init:"disconnected",transitions:[{name:"beginConnect",from:"disconnected",to:"connecting"},{name:"connect",from:"connecting",to:"connected"},{name:"fail",from:["connecting","connected"],to:"disconnected"},{name:"cancel",from:["connecting","connected"],to:"disconnected"},{name:"disconnect",from:["connecting","connected"],to:"disconnected"}],methods:{onInvalidTransition:t}})}},function(e,t,n){"use strict";const r=n(74);e.exports=e=>{let t=e.connectivityState,n=e.logAttempt;const i=new r(n,.2,6);t.observe({onEnterConnecting(){i.start()},onEnterDisconnected(){i.stop()},onEnterConnected(){i.stop()}})}},function(e,t,n){var r=n(680),i=n(262),o=r((function(e,t,n){return e+(n?" ":"")+i(t)}));e.exports=o},function(e,t,n){var r=n(681),i=n(682),o=n(685),s=RegExp("['’]","g");e.exports=function(e){return function(t){return r(o(i(t).replace(s,"")),e,"")}}},function(e,t){e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},function(e,t,n){var r=n(683),i=n(60),o=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,s=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=i(e))&&e.replace(o,r).replace(s,"")}},function(e,t,n){var r=n(684)({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"});e.exports=r},function(e,t){e.exports=function(e){return function(t){return null==e?void 0:e[t]}}},function(e,t,n){var r=n(686),i=n(687),o=n(60),s=n(688);e.exports=function(e,t,n){return e=o(e),void 0===(t=n?void 0:t)?i(e)?s(e):r(e):e.match(t)||[]}},function(e,t){var n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(n)||[]}},function(e,t){var n=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return n.test(e)}},function(e,t){var n="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",r="["+n+"]",i="\\d+",o="[\\u2700-\\u27bf]",s="[a-z\\xdf-\\xf6\\xf8-\\xff]",a="[^\\ud800-\\udfff"+n+i+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",c="(?:\\ud83c[\\udde6-\\uddff]){2}",u="[\\ud800-\\udbff][\\udc00-\\udfff]",d="[A-Z\\xc0-\\xd6\\xd8-\\xde]",l="(?:"+s+"|"+a+")",p="(?:"+d+"|"+a+")",f="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",h="[\\ufe0e\\ufe0f]?"+f+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",c,u].join("|")+")[\\ufe0e\\ufe0f]?"+f+")*"),m="(?:"+[o,c,u].join("|")+")"+h,g=RegExp([d+"?"+s+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[r,d,"$"].join("|")+")",p+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[r,d+l,"$"].join("|")+")",d+"?"+l+"+(?:['’](?:d|ll|m|re|s|t|ve))?",d+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",i,m].join("|"),"g");e.exports=function(e){return e.match(g)||[]}},function(e,t,n){"use strict";e.exports=(e,t)=>{const n=e.getSenders().find(e=>"video"===e.track.kind),r=n.getParameters();r.encodings.forEach(e=>{e.active=t}),n.setParameters(r)}},function(e,t,n){"use strict";const r=n(48);e.exports=e=>r(e,["audioDeviceId","audioFallbackEnabled","audioSource","channels","classNames","constraints","disableAudioProcessing","echoCancellation","noiseSuppression","autoGainControl","enableRenegotiation","enableStereo","facingMode","fitMode","frameRate","height","insertDefaultUI","insertMode","audioBitrate","maxResolution","minVideoBitrate","mirror","name","publishAudio","publishVideo","resolution","showControls","style","videoContentHint","videoDeviceId","videoDimensions","videoFilter","videoSource","width"])},function(e,t,n){"use strict";const r=n(27),i=n(49),o=n(104),s=n(23)();e.exports=e=>{let t=e.publisher,n=e.widgetView,a=0,c=0;const u=new o(()=>{const e=t.listenerCount(r.AUDIO_LEVEL_UPDATED);if(i()-c>1e4&&0===e)return void u.stop();const o=n&&n.video();if(o){const n=o.getAudioInputLevel();a=n,e>0&&t.dispatchEvent(new s.AudioLevelUpdatedEvent(n))}});Object.defineProperty(t,"loudness",{get:()=>(u.start(),c=i(),a),set(){throw new TypeError("Cannot set readonly property loudness")}}),t.listenerCount(r.AUDIO_LEVEL_UPDATED)&&u.start(),t.on("audioLevelUpdated:added",()=>{u.start()}),t.once(r.PUBLISHER_DESTROYED,()=>{u.stop()})}},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8));e.exports=function(e){let t=!1;return function(){var n=(0,o.default)(i.default.mark((function n(){var r,o,s,a=arguments;return i.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!t){n.next=2;break}throw new Error("The previous call to this function has not yet completed.");case 2:for(t=!0,n.prev=3,r=a.length,o=new Array(r),s=0;s<r;s++)o[s]=a[s];return n.next=7,e.call(this,...o);case 7:return n.abrupt("return",n.sent);case 8:return n.prev=8,t=!1,n.finish(8);case 11:case"end":return n.stop()}}),n,this,[[3,,8,11]])})));return function(){return n.apply(this,arguments)}}()}},function(e,t,n){"use strict";const r=n(13)(),i=n(4);e.exports=function(e){const t=document.createElement("canvas");if(!t.captureStream)throw r(i.NOT_SUPPORTED,new Error("Your browser does not support HTMLCanvasElement.captureStream()"));t.width=e.width,t.height=e.height,t.getContext("2d").fillRect(0,0,1,1);const n=t.captureStream().getVideoTracks()[0];return n.isCreatedCanvas=!0,n.enabled=!1,n}},function(e,t,n){"use strict";e.exports=(e,t)=>{if(!e)return null;const n=e.getVideoTracks()[0];return n?((e,t)=>(e=>e.getSettings&&e.getSettings().deviceId)(e)||(e=>{let t;return e.getConstraints&&e.getConstraints().deviceId&&(t=e.getConstraints().deviceId.exact),t})(e)||((e,t)=>{let n;if(t&&t.length){const r=t.find(t=>t.label===e.label);r&&(n=r.deviceId)}return n})(e,t))(n,t):null}},function(e,t,n){"use strict";const r=n(4),i=n(10),o=n(13)();e.exports=e=>[403,404,409].includes(parseInt(e.code,10))?o(r.STREAM_CREATE_FAILED,new Error("Failed to create stream in server model: "+e.message),i.UNABLE_TO_PUBLISH):o(r.UNEXPECTED_SERVER_RESPONSE,new Error("Unexpected server response: "+e.message),i.UNEXPECTED_SERVER_RESPONSE)},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8));const s=n(3),a=n(697),c=n(699),u=n(1)("MediaProcessor");function d(e){var t=this;void 0===e&&(e={});const n=e,r=n.ML,s=void 0===r?a:r,d=n.MediaTransform,l=void 0===d?c:d;let p,f,h;this.isValidVideoFilter=e=>{const t=e.type;return l.isSupported(t)&&l.isValidConfig(e)},this.setVideoFilter=function(){var e=(0,o.default)(i.default.mark((function e(n){var r,o,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.type,o=l.getConfigurator(r)){e.next=5;break}return u.warn(`Ignoring: filter "${r}" isn't supported`),e.abrupt("return");case 5:if(a=o.getConfig(n)){e.next=9;break}return u.warn("Ignoring: couldn't configure filter "+r),e.abrupt("return");case 9:if(!!!t.getVideoFilter()){e.next=20;break}return e.prev=11,e.next=14,t.destroy();case 14:e.next=20;break;case 16:return e.prev=16,e.t0=e.catch(11),u.warn("Ignoring, couldn't remove previous filter: "+e.t0),e.abrupt("return");case 20:return e.next=22,s.createConnector(a);case 22:p=e.sent,f=n;case 24:case"end":return e.stop()}}),e,null,[[11,16]])})));return function(t){return e.apply(this,arguments)}}(),this.getVideoFilter=()=>f,this.getOriginalVideoTrack=()=>h,this.setMediaStream=function(){var e=(0,o.default)(i.default.mark((function e(t){var n,r,o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.getVideoTracks(),r=n[0]){e.next=4;break}return u.warn("Ignoring. No video track found"),e.abrupt("return",null);case 4:return o=null,e.prev=5,e.next=8,p.setTrack(r);case 8:o=e.sent,h=r,e.next=15;break;case 12:e.prev=12,e.t0=e.catch(5),u.error("Error setting media stream: "+e.t0);case 15:return e.abrupt("return",o);case 16:case"end":return e.stop()}}),e,null,[[5,12]])})));return function(t){return e.apply(this,arguments)}}(),this.setVideoTrack=function(){var e=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null,e.prev=1,e.next=4,p.setTrack(t);case 4:n=e.sent,h=t,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),u.err("Error setting video track: "+e.t0);case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),this._setConnector=e=>{p=e},this.destroy=(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.destroy();case 2:p=null,f=null,h=null;case 5:case"end":return e.stop()}}),e)})))}d.isSupported=function(e){void 0===e&&(e={});const t=e,n=t.env,r=void 0===n?s:n,i=t.ML,o=void 0===i?a:i;return r.isChrome&&o.isSupported()},e.exports=d},function(e,t,n){"use strict";const r={isSupported:()=>"undefined"!=typeof MediaStreamTrackProcessor&&"undefined"!=typeof MediaStreamTrackGenerator,setMetadata:n(698).setMetadata,createConnector:n(312).createVonageMediaProcessorConnector};e.exports=r},function(e,t,n){"use strict";n.r(t),function(e,r){function i(){return new e((e,t)=>{"undefined"==typeof MediaStreamTrackProcessor||"undefined"==typeof MediaStreamTrackGenerator?t("Your browser does not support the MediaStreamTrack API for Insertable Streams of Media."):e()})}n.d(t,"MediaProcessor",(function(){return St})),n.d(t,"MediaProcessorConnector",(function(){return wt})),n.d(t,"isSupported",(function(){return i})),n.d(t,"setMetadata",(function(){return je}));class o{}o.updates={transformer_new:"New transformer",transformer_null:"Null transformer"},o.errors={transformer_none:"No transformers provided",transformer_start:"Cannot start transformer",transformer_transform:"Cannot transform frame",transformer_flush:"Cannot flush transformer"};var s={exports:{}},a=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},c=a,u=Object.prototype.toString;function d(e){return Array.isArray(e)}function l(e){return void 0===e}function p(e){return"[object ArrayBuffer]"===u.call(e)}function f(e){return null!==e&&"object"==typeof e}function h(e){if("[object Object]"!==u.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function m(e){return"[object Function]"===u.call(e)}function g(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),d(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var b={isArray:d,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===u.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:f,isPlainObject:h,isUndefined:l,isDate:function(e){return"[object Date]"===u.call(e)},isFile:function(e){return"[object File]"===u.call(e)},isBlob:function(e){return"[object Blob]"===u.call(e)},isFunction:m,isStream:function(e){return f(e)&&m(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===u.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:g,merge:function e(){var t={};function n(n,r){h(t[r])&&h(n)?t[r]=e(t[r],n):h(n)?t[r]=e({},n):d(n)?t[r]=n.slice():t[r]=n}for(var r=0,i=arguments.length;r<i;r++)g(arguments[r],n);return t},extend:function(e,t,n){return g(t,(function(t,r){e[r]=n&&"function"==typeof t?c(t,n):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},v=b;function y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var E=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(v.isURLSearchParams(t))r=t.toString();else{var i=[];v.forEach(t,(function(e,t){null!=e&&(v.isArray(e)?t+="[]":e=[e],v.forEach(e,(function(e){v.isDate(e)?e=e.toISOString():v.isObject(e)&&(e=JSON.stringify(e)),i.push(y(t)+"="+y(e))})))})),r=i.join("&")}if(r){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},S=b;function _(){this.handlers=[]}_.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},_.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},_.prototype.forEach=function(e){S.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var w=_,T=b,C=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},I=C,R=function(e,t,n,r,i){var o=new Error(e);return I(o,t,n,r,i)},x=R,O=b,k=O.isStandardBrowserEnv()?{write:function(e,t,n,r,i,o){var s=[];s.push(e+"="+encodeURIComponent(t)),O.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),O.isString(r)&&s.push("path="+r),O.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},N=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},Z=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},A=b,L=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],V=b,P=V.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=V.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function M(e){this.message=e}M.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},M.prototype.__CANCEL__=!0;var D=M,W=b,G=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(x("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},X=k,j=E,U=function(e,t){return e&&!N(t)?Z(e,t):t},F=function(e){var t,n,r,i={};return e?(A.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=A.trim(e.substr(0,r)).toLowerCase(),n=A.trim(e.substr(r+1)),t){if(i[t]&&L.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i},Y=P,B=R,K=re,H=D,J=function(t){return new e((function(e,n){var r,i=t.data,o=t.headers,s=t.responseType;function a(){t.cancelToken&&t.cancelToken.unsubscribe(r),t.signal&&t.signal.removeEventListener("abort",r)}W.isFormData(i)&&delete o["Content-Type"];var c=new XMLHttpRequest;if(t.auth){var u=t.auth.username||"",d=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(u+":"+d)}var l=U(t.baseURL,t.url);function p(){if(c){var r="getAllResponseHeaders"in c?F(c.getAllResponseHeaders()):null,i={data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:t,request:c};G((function(t){e(t),a()}),(function(e){n(e),a()}),i),c=null}}if(c.open(t.method.toUpperCase(),j(l,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=p:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(p)},c.onabort=function(){c&&(n(B("Request aborted",t,"ECONNABORTED",c)),c=null)},c.onerror=function(){n(B("Network Error",t,null,c)),c=null},c.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||K.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(B(e,t,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",c)),c=null},W.isStandardBrowserEnv()){var f=(t.withCredentials||Y(l))&&t.xsrfCookieName?X.read(t.xsrfCookieName):void 0;f&&(o[t.xsrfHeaderName]=f)}"setRequestHeader"in c&&W.forEach(o,(function(e,t){void 0===i&&"content-type"===t.toLowerCase()?delete o[t]:c.setRequestHeader(t,e)})),W.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&"json"!==s&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(r=function(e){c&&(n(!e||e&&e.type?new H("canceled"):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(r),t.signal&&(t.signal.aborted?r():t.signal.addEventListener("abort",r))),i||(i=null),c.send(i)}))},z=b,Q=function(e,t){T.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},q=C,$={"Content-Type":"application/x-www-form-urlencoded"};function ee(e,t){!z.isUndefined(e)&&z.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var te,ne={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(te=J),te),transformRequest:[function(e,t){return Q(t,"Accept"),Q(t,"Content-Type"),z.isFormData(e)||z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e)?e:z.isArrayBufferView(e)?e.buffer:z.isURLSearchParams(e)?(ee(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):z.isObject(e)||t&&"application/json"===t["Content-Type"]?(ee(t,"application/json"),function(e,t,n){if(z.isString(e))try{return(t||JSON.parse)(e),z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||ne.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,i=!n&&"json"===this.responseType;if(i||r&&z.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw q(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};z.forEach(["delete","get","head"],(function(e){ne.headers[e]={}})),z.forEach(["post","put","patch"],(function(e){ne.headers[e]=z.merge($)}));var re=ne,ie=b,oe=re,se=function(e){return!(!e||!e.__CANCEL__)},ae=b,ce=function(e,t,n){var r=this||oe;return ie.forEach(n,(function(n){e=n.call(r,e,t)})),e},ue=se,de=re,le=D;function pe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new le("canceled")}var fe=b,he=function(e,t){t=t||{};var n={};function r(e,t){return fe.isPlainObject(e)&&fe.isPlainObject(t)?fe.merge(e,t):fe.isPlainObject(t)?fe.merge({},t):fe.isArray(t)?t.slice():t}function i(n){return fe.isUndefined(t[n])?fe.isUndefined(e[n])?void 0:r(void 0,e[n]):r(e[n],t[n])}function o(e){if(!fe.isUndefined(t[e]))return r(void 0,t[e])}function s(n){return fe.isUndefined(t[n])?fe.isUndefined(e[n])?void 0:r(void 0,e[n]):r(void 0,t[n])}function a(n){return n in t?r(e[n],t[n]):n in e?r(void 0,e[n]):void 0}var c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a};return fe.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||i,r=t(e);fe.isUndefined(r)&&t!==a||(n[e]=r)})),n},me="0.25.0",ge=me,be={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){be[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var ve={};be.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ge+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,i,o){if(!1===e)throw new Error(r(i," has been removed"+(t?" in "+t:"")));return t&&!ve[i]&&(ve[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}};var ye=b,Ee=E,Se=w,_e=function(t){return pe(t),t.headers=t.headers||{},t.data=ce.call(t,t.data,t.headers,t.transformRequest),t.headers=ae.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),ae.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||de.adapter)(t).then((function(e){return pe(t),e.data=ce.call(t,e.data,e.headers,t.transformResponse),e}),(function(n){return ue(n)||(pe(t),n&&n.response&&(n.response.data=ce.call(t,n.response.data,n.response.headers,t.transformResponse))),e.reject(n)}))},we=he,Te={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),i=r.length;i-- >0;){var o=r[i],s=t[o];if(s){var a=e[o],c=void 0===a||s(a,o,e);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+o)}},validators:be},Ce=Te.validators;function Ie(e){this.defaults=e,this.interceptors={request:new Se,response:new Se}}Ie.prototype.request=function(t,n){if("string"==typeof t?(n=n||{}).url=t:n=t||{},!n.url)throw new Error("Provided config url is not valid");(n=we(this.defaults,n)).method?n.method=n.method.toLowerCase():this.defaults.method?n.method=this.defaults.method.toLowerCase():n.method="get";var r=n.transitional;void 0!==r&&Te.assertOptions(r,{silentJSONParsing:Ce.transitional(Ce.boolean),forcedJSONParsing:Ce.transitional(Ce.boolean),clarifyTimeoutError:Ce.transitional(Ce.boolean)},!1);var i=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(o=o&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));var s,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!o){var c=[_e,void 0];for(Array.prototype.unshift.apply(c,i),c=c.concat(a),s=e.resolve(n);c.length;)s=s.then(c.shift(),c.shift());return s}for(var u=n;i.length;){var d=i.shift(),l=i.shift();try{u=d(u)}catch(e){l(e);break}}try{s=_e(u)}catch(t){return e.reject(t)}for(;a.length;)s=s.then(a.shift(),a.shift());return s},Ie.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=we(this.defaults,e),Ee(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},ye.forEach(["delete","get","head","options"],(function(e){Ie.prototype[e]=function(t,n){return this.request(we(n||{},{method:e,url:t,data:(n||{}).data}))}})),ye.forEach(["post","put","patch"],(function(e){Ie.prototype[e]=function(t,n,r){return this.request(we(r||{},{method:e,url:t,data:n}))}}));var Re=Ie,xe=D;function Oe(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new e((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(t){var n,i=new e((function(e){r.subscribe(e),n=e})).then(t);return i.cancel=function(){r.unsubscribe(n)},i},t((function(e){r.reason||(r.reason=new xe(e),n(r.reason))}))}Oe.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Oe.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},Oe.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},Oe.source=function(){var e;return{token:new Oe((function(t){e=t})),cancel:e}};var ke=Oe,Ne=b,Ze=b,Ae=a,Le=Re,Ve=he;var Pe=function e(t){var n=new Le(t),r=Ae(Le.prototype.request,n);return Ze.extend(r,Le.prototype,n),Ze.extend(r,n),r.create=function(n){return e(Ve(t,n))},r}(re);Pe.Axios=Le,Pe.Cancel=D,Pe.CancelToken=ke,Pe.isCancel=se,Pe.VERSION=me,Pe.all=function(t){return e.all(t)},Pe.spread=function(e){return function(t){return e.apply(null,t)}},Pe.isAxiosError=function(e){return Ne.isObject(e)&&!0===e.isAxiosError},s.exports=Pe,s.exports.default=Pe;var Me=s.exports;class De{isEmpty(){return!this.isPresent()}static of(e){if(null!=e)return new We(e);throw new TypeError("The passed value was null or undefined.")}static ofNonNull(e){return De.of(e)}static ofNullable(e){return null!=e?new We(e):new Ge}static empty(){return new Ge}static from(e){switch(e.kind){case"present":return De.of(e.value);case"empty":return De.empty();default:throw new TypeError("The passed value was not an Option type.")}}}class We extends De{constructor(e){super(),this.payload=e}isPresent(){return!0}get(){return this.payload}ifPresent(e){e(this.payload)}ifPresentOrElse(e,t){e(this.payload)}filter(e){return e(this.payload)?this:De.empty()}map(e){const t=e(this.payload);return De.ofNullable(t)}flatMap(e){return e(this.payload)}or(e){return this}orElse(e){return this.payload}orElseGet(e){return this.payload}orElseThrow(e){return this.payload}orNull(){return this.payload}orUndefined(){return this.payload}toOption(){return{kind:"present",value:this.payload}}matches(e){return e.present(this.payload)}toJSON(e){return this.payload}}class Ge extends De{isPresent(){return!1}constructor(){super()}get(){throw new TypeError("The optional is not present.")}ifPresent(e){}ifPresentOrElse(e,t){t()}filter(e){return this}map(e){return De.empty()}flatMap(e){return De.empty()}or(e){return e()}orElse(e){return e}orElseGet(e){return this.orElse(e())}orElseThrow(e){throw e()}orNull(){return null}orUndefined(){}toOption(){return{kind:"empty"}}matches(e){return e.empty()}toJSON(e){return null}}let Xe;function je(e){Xe=e}class Ue{constructor(){const e=Xe;this._report={action:De.empty(),applicationId:De.ofNullable(void 0!==e?e.appId:null),timestamp:Date.now(),fps:De.empty(),framesTransformed:De.empty(),guid:De.empty(),highestFrameTransformCpu:De.empty(),message:De.empty(),source:De.ofNullable(void 0!==e?e.sourceType:null),transformedFps:De.empty(),transformerType:De.empty(),variation:De.empty(),videoHeight:De.empty(),videoWidth:De.empty(),version:"1.1.1",error:De.empty()}}action(e){return this._report.action=De.ofNullable(e),this}framesTransformed(e){return this._report.framesTransformed=De.ofNullable(e),this}fps(e){return this._report.fps=De.ofNullable(e),this}guid(e){return this._report.guid=De.ofNullable(e),this}message(e){return this._report.message=De.ofNullable(e),this}transformedFps(e){return this._report.transformedFps=De.ofNullable(e),this}transformerType(e){return this._report.transformerType=De.ofNullable(e),this}variation(e){return this._report.variation=De.ofNullable(e),this}videoHeight(e){return this._report.videoHeight=De.ofNullable(e),this}videoWidth(e){return this._report.videoWidth=De.ofNullable(e),this}error(e){return this._report.error=De.ofNullable(e),this}build(){return this._report}}class Fe{static report(t){return new e((e,n)=>{if(null===t.applicationId||null===t.source)return void e("success");Me.create().post("https://hlg.tokbox.com/prod/logging/vcp_webrtc",(e=>JSON.stringify(e,(e,t)=>{if(null!==t)return t}))(t),{timeout:1e4,timeoutErrorMessage:"Request timeout",headers:{"Content-Type":"application/json"}}).then(t=>{console.log(t),e("success")}).catch(e=>{console.log(e),n(e)})})}}var Ye,Be=new Uint8Array(16);function Ke(){if(!Ye&&!(Ye="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ye(Be)}var He=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Je(e){return"string"==typeof e&&He.test(e)}for(var ze=[],Qe=0;Qe<256;++Qe)ze.push((Qe+256).toString(16).substr(1));function qe(e,t,n){var r=(e=e||{}).random||(e.rng||Ke)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(ze[e[t+0]]+ze[e[t+1]]+ze[e[t+2]]+ze[e[t+3]]+"-"+ze[e[t+4]]+ze[e[t+5]]+"-"+ze[e[t+6]]+ze[e[t+7]]+"-"+ze[e[t+8]]+ze[e[t+9]]+"-"+ze[e[t+10]]+ze[e[t+11]]+ze[e[t+12]]+ze[e[t+13]]+ze[e[t+14]]+ze[e[t+15]]).toLowerCase();if(!Je(n))throw TypeError("Stringified UUID is invalid");return n}(r)}const $e=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=Symbol("anyProducer"),rt=e.resolve(),it=Symbol("listenerAdded"),ot=Symbol("listenerRemoved");let st=!1;function at(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new TypeError("eventName must be a string or a symbol")}function ct(e){if("function"!=typeof e)throw new TypeError("listener must be a function")}function ut(e,t){const n=et.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}function dt(e,t){const n="string"==typeof t||"symbol"==typeof t?t:nt,r=tt.get(e);return r.has(n)||r.set(n,new Set),r.get(n)}function lt(t,n){n=Array.isArray(n)?n:[n];let r=!1,i=()=>{},o=[];const s={enqueue(e){o.push(e),i()},finish(){r=!0,i()}};for(const e of n)dt(t,e).add(s);return{async next(){return o?0===o.length?r?(o=void 0,this.next()):(await new e(e=>{i=e}),this.next()):{done:!1,value:await o.shift()}:{done:!0}},async return(e){o=void 0;for(const e of n)dt(t,e).delete(s);return i(),arguments.length>0?{done:!0,value:await e}:{done:!0}},[Symbol.asyncIterator](){return this}}}function pt(e){if(void 0===e)return mt;if(!Array.isArray(e))throw new TypeError("`methodNames` must be an array of strings");for(const t of e)if(!mt.includes(t)){if("string"!=typeof t)throw new TypeError("`methodNames` element must be a string");throw new Error(t+" is not Emittery method")}return e}const ft=e=>e===it||e===ot;class ht{static mixin(e,t){return t=pt(t),n=>{if("function"!=typeof n)throw new TypeError("`target` must be function");for(const e of t)if(void 0!==n.prototype[e])throw new Error(`The property \`${e}\` already exists on \`target\``);Object.defineProperty(n.prototype,e,{enumerable:!1,get:function(){return Object.defineProperty(this,e,{enumerable:!1,value:new ht}),this[e]}});const r=t=>function(...n){return this[e][t](...n)};for(const e of t)Object.defineProperty(n.prototype,e,{enumerable:!1,value:r(e)});return n}}static get isDebugEnabled(){if("object"!=typeof r)return st;const{env:e}=r||{env:{}};return"emittery"===e.DEBUG||"*"===e.DEBUG||st}static set isDebugEnabled(e){st=e}constructor(e={}){$e.set(this,new Set),et.set(this,new Map),tt.set(this,new Map),this.debug=e.debug||{},void 0===this.debug.enabled&&(this.debug.enabled=!1),this.debug.logger||(this.debug.logger=(e,t,n,r)=>{r=JSON.stringify(r),"symbol"==typeof n&&(n=n.toString());const i=new Date,o=`${i.getHours()}:${i.getMinutes()}:${i.getSeconds()}.${i.getMilliseconds()}`;console.log(`[${o}][emittery:${e}][${t}] Event Name: ${n}\n\tdata: ${r}`)})}logIfDebugEnabled(e,t,n){(ht.isDebugEnabled||this.debug.enabled)&&this.debug.logger(e,this.debug.name,t,n)}on(e,t){ct(t),e=Array.isArray(e)?e:[e];for(const n of e)at(n),ut(this,n).add(t),this.logIfDebugEnabled("subscribe",n,void 0),ft(n)||this.emit(it,{eventName:n,listener:t});return this.off.bind(this,e,t)}off(e,t){ct(t),e=Array.isArray(e)?e:[e];for(const n of e)at(n),ut(this,n).delete(t),this.logIfDebugEnabled("unsubscribe",n,void 0),ft(n)||this.emit(ot,{eventName:n,listener:t})}once(t){return new e(e=>{const n=this.on(t,t=>{n(),e(t)})})}events(e){e=Array.isArray(e)?e:[e];for(const t of e)at(t);return lt(this,e)}async emit(t,n){at(t),this.logIfDebugEnabled("emit",t,n),function(t,n,r){const i=tt.get(t);if(i.has(n))for(const e of i.get(n))e.enqueue(r);if(i.has(nt)){const t=e.all([n,r]);for(const e of i.get(nt))e.enqueue(t)}}(this,t,n);const r=ut(this,t),i=$e.get(this),o=[...r],s=ft(t)?[]:[...i];await rt,await e.all([...o.map(async e=>{if(r.has(e))return e(n)}),...s.map(async e=>{if(i.has(e))return e(t,n)})])}async emitSerial(e,t){at(e),this.logIfDebugEnabled("emitSerial",e,t);const n=ut(this,e),r=$e.get(this),i=[...n],o=[...r];await rt;for(const e of i)n.has(e)&&await e(t);for(const n of o)r.has(n)&&await n(e,t)}onAny(e){return ct(e),this.logIfDebugEnabled("subscribeAny",void 0,void 0),$e.get(this).add(e),this.emit(it,{listener:e}),this.offAny.bind(this,e)}anyEvent(){return lt(this)}offAny(e){ct(e),this.logIfDebugEnabled("unsubscribeAny",void 0,void 0),this.emit(ot,{listener:e}),$e.get(this).delete(e)}clearListeners(e){e=Array.isArray(e)?e:[e];for(const t of e)if(this.logIfDebugEnabled("clear",t,void 0),"string"==typeof t||"symbol"==typeof t){ut(this,t).clear();const e=dt(this,t);for(const t of e)t.finish();e.clear()}else{$e.get(this).clear();for(const e of et.get(this).values())e.clear();for(const e of tt.get(this).values()){for(const t of e)t.finish();e.clear()}}}listenerCount(e){e=Array.isArray(e)?e:[e];let t=0;for(const n of e)if("string"!=typeof n){void 0!==n&&at(n),t+=$e.get(this).size;for(const e of et.get(this).values())t+=e.size;for(const e of tt.get(this).values())t+=e.size}else t+=$e.get(this).size+ut(this,n).size+dt(this,n).size+dt(this).size;return t}bindMethods(e,t){if("object"!=typeof e||null===e)throw new TypeError("`target` must be an object");t=pt(t);for(const n of t){if(void 0!==e[n])throw new Error(`The property \`${n}\` already exists on \`target\``);Object.defineProperty(e,n,{enumerable:!1,value:this[n].bind(this)})}}}const mt=Object.getOwnPropertyNames(ht.prototype).filter(e=>"constructor"!==e);Object.defineProperty(ht,"listenerAdded",{value:it,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(ht,"listenerRemoved",{value:ot,writable:!1,enumerable:!0,configurable:!1});var gt,bt=ht;function vt(e){return function(e){if("object"==typeof(t=e)&&null!==t&&"message"in t&&"string"==typeof t.message)return e;var t;try{return new Error(JSON.stringify(e))}catch{return new Error(String(e))}}(e).message}(gt||(gt={})).FPS_DROP="fps_drop";class yt extends bt{constructor(e,t){super(),this.index_=t,this.uuid_=qe(),this.framesTransformed_=0,this.transformer_=e,this.shouldStop_=!1,this.isFlashed_=!1,this.framesFromSource_=0,this.fps_=0,this.mediaTransformerQosReportStartTimestamp_=0,this.videoHeight_=0,this.videoWidth_=0,this.trackExpectedRate_=-1,this.transformerType_="Custom","getTransformerType"in e&&(this.transformerType_=e.getTransformerType());const n=(new Ue).action("MediaTransformer").guid(this.uuid_).transformerType(this.transformerType_).variation("Create").build();Fe.report(n)}setTrackExpectedRate(e){this.trackExpectedRate_=e}async start(e){if(this.transformer_&&"function"==typeof this.transformer_.start)try{await this.transformer_.start(e)}catch(e){const t=(new Ue).action("MediaTransformer").guid(this.uuid_).message(o.errors.transformer_start).transformerType(this.transformerType_).variation("Error").error(vt(e)).build();Fe.report(t);const n={eventMetaData:{transformerIndex:this.index_},error:e,function:"start"};this.emit("error",n)}}async transform(e,t){var n,r,i,s;if(0===this.mediaTransformerQosReportStartTimestamp_&&(this.mediaTransformerQosReportStartTimestamp_=Date.now()),this.videoHeight_=null!=(n=null==e?void 0:e.displayHeight)?n:0,this.videoWidth_=null!=(r=null==e?void 0:e.displayWidth)?r:0,++this.framesFromSource_,this.transformer_)if(this.shouldStop_)e.close(),this.flush(t),t.terminate();else try{await(null==(s=(i=this.transformer_).transform)?void 0:s.call(i,e,t)),++this.framesTransformed_,500===this.framesTransformed_&&this.mediaTransformerQosReport()}catch(e){const t=(new Ue).action("MediaTransformer").guid(this.uuid_).message(o.errors.transformer_transform).transformerType(this.transformerType_).variation("Error").error(vt(e)).build();Fe.report(t);const n={eventMetaData:{transformerIndex:this.index_},error:e,function:"transform"};this.emit("error",n)}}async flush(e){if(this.transformer_&&"function"==typeof this.transformer_.flush&&!this.isFlashed_){this.isFlashed_=!0;try{await this.transformer_.flush(e)}catch(e){const t=(new Ue).action("MediaTransformer").guid(this.uuid_).message(o.errors.transformer_flush).transformerType(this.transformerType_).variation("Error").error(vt(e)).build();Fe.report(t);const n={eventMetaData:{transformerIndex:this.index_},error:e,function:"flush"};this.emit("error",n)}}this.mediaTransformerQosReport();const t=(new Ue).action("MediaTransformer").guid(this.uuid_).transformerType(this.transformerType_).variation("Delete").build();Fe.report(t)}stop(){console.log("[Pipeline] Stop stream."),this.shouldStop_=!0}mediaTransformerQosReport(){let e=(Date.now()-this.mediaTransformerQosReportStartTimestamp_)/1e3,t=this.framesFromSource_/e,n=this.framesTransformed_/e;if(-1!=this.trackExpectedRate_&&.8*this.trackExpectedRate_>t){const e={eventMetaData:{transformerIndex:this.index_},warningType:gt.FPS_DROP,dropInfo:{requested:this.trackExpectedRate_,current:t}};this.emit("warn",e)}const r=(new Ue).action("MediaTransformer").fps(t).transformedFps(n).framesTransformed(this.framesTransformed_).guid(this.uuid_).transformerType(this.transformerType_).videoHeight(this.videoHeight_).videoWidth(this.videoWidth_).variation("QoS").build();Fe.report(r),this.mediaTransformerQosReportStartTimestamp_=0,this.framesFromSource_=0,this.framesTransformed_=0}}class Et extends bt{constructor(e){super(),this.transformers_=[],this.trackExpectedRate_=-1;for(let t=0;t<e.length;t++){let n=new yt(e[t],t);n.on("error",e=>{this.emit("error",e)}),n.on("warn",e=>{this.emit("warn",e)}),this.transformers_.push(n)}}setTrackExpectedRate(e){this.trackExpectedRate_=e;for(let e of this.transformers_)e.setTrackExpectedRate(this.trackExpectedRate_)}async start(e,t){if(this.transformers_&&0!==this.transformers_.length){try{let n=e;for(let t of this.transformers_)e=e.pipeThrough(new TransformStream(t));e.pipeTo(t).then(async()=>{console.log("[Pipeline] Setup."),await t.abort(),await n.cancel()}).catch(async r=>{e.cancel().then(()=>{console.log("[Pipeline] Shutting down streams after abort.")}).catch(e=>{console.error("[Pipeline] Error from stream transform:",e)}),await t.abort(r),await n.cancel(r)})}catch(e){return void this.destroy()}console.log("[Pipeline] Pipeline started.")}else console.log("[Pipeline] No transformers.")}async destroy(){console.log("[Pipeline] Destroying Pipeline.");for(let e of this.transformers_)e.stop()}}class St extends bt{constructor(){super(),this.uuid_=qe(),this.trackExpectedRate_=-1;const e=(new Ue).action("MediaProcessor").guid(this.uuid_).variation("Create").build();Fe.report(e)}setTrackExpectedRate(e){this.trackExpectedRate_=e,this.pipeline_&&this.pipeline_.setTrackExpectedRate(this.trackExpectedRate_)}transform(e,t){return this.readable_=e,this.writable_=t,this.transformInternal()}transformInternal(){return new e((e,t)=>{if(!this.transformers_||0===this.transformers_.length){const e=(new Ue).action("MediaProcessor").guid(this.uuid_).message(o.errors.transformer_none).variation("Error").build();Fe.report(e),t("[MediaProcessor] Need to set transformers.")}this.pipeline_&&this.pipeline_.destroy(),this.pipeline_=new Et(this.transformers_),this.pipeline_.on("warn",e=>{this.emit("warn",e)}),this.pipeline_.on("error",e=>{this.emit("error",e)}),-1!=this.trackExpectedRate_&&this.pipeline_.setTrackExpectedRate(this.trackExpectedRate_),this.pipeline_.start(this.readable_,this.writable_).then(()=>{e()}).catch(e=>{t(e)})})}setTransformers(t){const n=(new Ue).action("MediaProcessor").guid(this.uuid_).message(o.updates.transformer_new).variation("Update").build();return Fe.report(n),this.transformers_=t,this.readable_&&this.writable_?this.transformInternal():e.resolve()}destroy(){return new e(e=>{this.pipeline_&&this.pipeline_.destroy();const t=(new Ue).action("MediaProcessor").guid(this.uuid_).variation("Delete").build();Fe.report(t),e()})}}class _t{constructor(){this.processor_=null,this.generator_=null}init(t){return new e((e,n)=>{try{this.processor_=new MediaStreamTrackProcessor(t)}catch(e){console.log("[InsertableStreamHelper] MediaStreamTrackProcessor failed: "+e),n(e)}try{"audio"===t.kind?this.generator_=new MediaStreamTrackGenerator({kind:"audio"}):"video"===t.kind?this.generator_=new MediaStreamTrackGenerator({kind:"video"}):n("kind not supported")}catch(e){console.log("[InsertableStreamHelper] MediaStreamTrackGenerator failed: "+e),n(e)}e()})}getReadable(){return this.processor_.readable}getWriteable(){return this.generator_.writable}getProccesorTrack(){return this.generator_}}class wt{constructor(e){this.insertableStreamHelper_=new _t,this.mediaProcessor_=e}setTrack(t){return new e((e,n)=>{this.insertableStreamHelper_.init(t).then(()=>{this.mediaProcessor_.transform(this.insertableStreamHelper_.getReadable(),this.insertableStreamHelper_.getWriteable()).then(()=>{e(this.insertableStreamHelper_.getProccesorTrack())}).catch(e=>{n(e)})}).catch(e=>{n(e)})})}destroy(){return new e((e,t)=>{this.mediaProcessor_?this.mediaProcessor_.destroy().then(()=>{e()}).catch(e=>{t(e)}):t("no processor")})}}}.call(this,n(0),n(43))},function(e,t,n){"use strict";const r={backgroundBlur:n(700)},i=e=>!!r[e],o=e=>i(e)?r[e]:null,s={isSupported:i,getConfigurator:o,isValidConfig:e=>{const t=e.type;return!!i(t)&&o(t).isValidConfig(e)}};e.exports=s},function(e,t,n){"use strict";var r=n(2)(n(20));const i=n(312).BlurRadius,o=n(701),s=i.High,a=e=>"low"===e||"high"===e,c={isValidConfig:e=>{if("backgroundBlur"!==(null==e?void 0:e.type))return!1;const t=e.blurStrength;return!t||a(t)},getConfig:function(e){void 0===e&&(e={});const t=(0,r.default)({},o.getConfig(),{transformerType:"BackgroundBlur",radius:s}),n=e.blurStrength;return a(n)&&(t.radius=(e=>"low"===e?i.Low:i.High)(n)),t}};e.exports=c},function(e,t,n){"use strict";const r=n(34)().onlyLocal(),i={getConfig:function(e){void 0===e&&(e={});const t=e.staticConfig,n=(e=>(e.apiUrl.includes("anvil.opentok.com")?"https://static.opentok.com":"https://www.dev.tokbox.com")+"/v1.3.0/ml-transformers")(void 0===t?r:t);return{wasmAssetUriPath:n+"/",tfliteAssetUriPath:n+"/models/"}}};e.exports=i},function(e,t,n){"use strict";e.exports=e=>null===e||!1===e},function(e,t,n){"use strict";e.exports=e=>{var t;!(!e||!(null==(t=e.videoSource)?void 0:t.canvas))&&!!(!e||!("videoContentHint"in e))&&(e.videoContentHint="detail")}},function(e,t,n){"use strict";const r=n(150);e.exports=e=>{var t;e||(e={});const n=!!r(null==(t=e)?void 0:t.videoSource);e.capableSimulcastScreenshare=n&&(e=>!!(null==e?void 0:e.scalableScreenshare))(e)}},function(e,t,n){var r=n(706),i=n(99),o=n(35);e.exports=function(e,t){return r(e,o(t,3),i)}},function(e,t){e.exports=function(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}},function(e,t,n){"use strict";(function(t){const r=n(52),i=n(73);e.exports=e=>{let n,o,s=e.RTCPeerConnection,a=e.env,c=e.stream,u=e.codecFlags;if(a.isLegacyEdge)return!0;const d=()=>{try{n.close()}catch(e){}try{o.close()}catch(e){}n=null,o=null};try{const e={iceServers:[]};i()&&(e.sdpSemantics="plan-b"),n=new s(e),o=new s(e),n.addStream(c)}catch(e){return d(),t.resolve(!1)}return n.createOffer().then(e=>{const t={type:e.type,sdp:e.sdp};return Object.keys(u).forEach(e=>{u[e]||(t.sdp=r.removeVideoCodec(t.sdp,e))}),o.setRemoteDescription(t)}).then(()=>!0).catch(()=>!1).then(e=>(d(),e))}}).call(this,n(0))},function(e,t,n){"use strict";const r=n(4).INVALID_PARAMETER;e.exports=e=>{let t=e.otError;return e=>{if(!e)return;const n=(e,n)=>{if(!e)throw t(r,new Error("iceConfig invalid: "+n))};"includeServers"in e&&n(-1!==["all","custom"].indexOf(e.includeServers),".includeServers must be all or custom"),"transportPolicy"in e&&n(-1!==["all","relay"].indexOf(e.transportPolicy),".transportPolicy must be all or relay"),n(Array.isArray(e.customServers),".customServers must be an array"),e.customServers.forEach(e=>{n(e.urls||!("url"in e),"ice servers need .urls, not .url"),n("string"==typeof e.urls||Array.isArray(e.urls),"ice server .urls must be a string or an array"),n(!e.username||"string"==typeof e.username,"ice server .username must be a string if present"),n(!e.credential||"string"==typeof e.credential,"ice server .credential must be a string if present")})}}},function(e,t,n){"use strict";const r=n(10);e.exports=function(e){switch(e){case r.AUTHENTICATION_ERROR:case r.INVALID_SESSION_ID:case r.TERMS_OF_SERVICE_FAILURE:case r.UNEXPECTED_SERVER_RESPONSE:return e;case r.ANVIL_EMPTY_RESPONSE_BODY:case r.ANVIL_CONNECT_FAILED:return r.CONNECT_FAILED;case r.ANVIL_BADLY_FORMED_RESPONSE:case r.ANVIL_INVALID_HTTP_STATUS:case r.ANVIL_XDOMAIN_OR_PARSING_ERROR:case r.ANVIL_UNKNOWN_HTTP_ERROR:case r.ANVIL_UNEXPECTED_ERROR_CODE:default:return r.UNEXPECTED_SERVER_RESPONSE}}},function(e,t,n){"use strict";const r=n(10),i=n(4);e.exports={NOT_CONNECTED:{code:i.NOT_CONNECTED,message:"Cannot use forceMute functionality. You are not connected to the session.",exceptionCode:r.NOT_CONNECTED},PERMISSION_DENIED:{code:i.PERMISSION_DENIED,message:"This token does not allow forceMute usage. The role must be at least `moderator` to enable this functionality",exceptionCode:r.UNABLE_TO_FORCE_MUTE},INVALID_PARAMETER:{code:i.INVALID_PARAMETER,message:"Invalid Parameter. Check that you have passed valid parameter values into the method call.",exceptionCode:r.INVALID_PARAMETER},NOT_FOUND:{code:i.NOT_FOUND,message:"The stream does not exist."},UNEXPECTED_SERVER_RESPONSE:{code:i.UNEXPECTED_SERVER_RESPONSE,message:"An unexpected error occurred.",exceptionCode:r.UNEXPECTED_SERVER_RESPONSE}}},function(e,t,n){"use strict";(function(e){var r=n(2);t.__esModule=!0,t.default=function(t){void 0===t&&(t={});const r=t.convertRumorError||n(315),l=t.Dispatcher||n(319),p=t.ExceptionCodes||n(10),f=t.hasIceRestartsCapability||n(316),h=t.hasRenegotiationCapability||n(728),m=t.hasE2eeCapability||n(158),g=t.logging||n(1)("RaptorSocket"),b=t.Message||n(320),v=t.OTHelpers||n(5),y=t.RumorSocket||(0,d.default)(),E=t.Signal||n(321),S=t.SignalError||n(733),_=function t(n,d,f,h,m,_,w){var T=this;let C,I,R,x,O,k,N,Z;void 0===w&&(w=[]);const A=m||new l,L=v.statable(this,["disconnected","connecting","connected","error","disconnecting"],"disconnected"),V=function(e){e.action&&e.variation||g.debug("Expected action and variation"),_.logEvent((0,s.default)({sessionId:I,partnerId:C,p2p:k,messagingServer:N,connectionId:n},e))},P=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t[0];L(r?"error":"connected"),O(...t)},M=e=>{let t="clientDisconnected";!this.is("disconnecting")&&Z&&(t="networkDisconnected"),e&&4001===e.code&&(t="networkTimedout"),L("disconnected"),A.onClose(t)},D=e=>{Z=!0,g.error(e)},W=()=>{A.onReconnecting()},G=()=>{V({action:"Reconnect",variation:"Success",retries:this._rumor.reconnectRetriesCount(),messageQueueSize:this._rumor.messageQueueSize(),socketId:this.socketId}),A.onReconnected()},X=()=>{V({action:"Reconnect",variation:"Attempt",retries:this._rumor.reconnectRetriesCount(),messageQueueSize:this._rumor.messageQueueSize(),socketId:this.socketId})},j=e=>{"connectionLimitExceeded"===e.message&&(e.code=p.CONNECTION_LIMIT_EXCEEDED),e.reason="ConnectToSession";const t=r(e);V({action:"Reconnect",variation:"Failure",failureReason:e.reason,failureCode:t.code,failureMessage:t.message,messageQueueSize:this._rumor.messageQueueSize(),socketId:this.socketId})};Object.defineProperty(this,"socketId",{get(){return this._rumor.socketID}}),this.connect=function(r,i,o,s){if(!this.is("disconnected","error"))return void g.warn("Cannot connect the Raptor Socket as it is currently connected. You should disconnect first.");L("connecting"),C=i.partnerId,I=i.sessionId,k=i.p2pEnabled,N=i.messagingServer,R=r,O=s,x={apiKey:C,sessionId:I};const a=`/v2/partner/${C}/session/${I}`;this._rumor=new t.RumorSocket({messagingURL:f,notifyDisconnectAddress:h,connectionId:n,enableReconnection:i.reconnection}),this._rumor.on("close",M),this._rumor.on("error",D),this._rumor.on("reconnecting",W),this._rumor.on("reconnectAttempt",X),this._rumor.on("reconnectFailure",j),this._rumor.on("reconnected",G),this._rumor.on("message",A.dispatch.bind(A));const u=e=>{P({reason:"WebSocketConnection",code:e.code,message:e.message})};this._rumor.once("error",u),this._rumor.once("open",()=>{this._rumor.removeListener("error",u),g.debug(`connected. Subscribing to ${a} on ${f}`),this._rumor.subscribe([a]);const n=w;(t.hasIceRestartsCapability()||t.hasRenegotiationCapability())&&i.renegotiation&&n.push("renegotiation");t.hasE2eeCapability()&&i.e2ee&&n.push("e2ee");const r=b.connections.create({apiKey:C,sessionId:I,connectionId:this._rumor.id,connectionEventsSuppressed:o.connectionEventsSuppressed,capabilities:n}),s=new e(e=>{const t=n=>{n.id===this._rumor.id&&(e(n),m.off("connection#created",t))};m.on("connection#created",t)});this.publish(r,{"X-TB-TOKEN-AUTH":R},!0,(e,t)=>{if(e)return"connectionLimitExceeded"===e.message&&(e.code=p.CONNECTION_LIMIT_EXCEEDED),void P({reason:"ConnectToSession",code:e.code,message:e.message,socketId:this.socketId});const n=t&&t.data?JSON.parse(t.data):null;n&&(n.connection&&0!==n.connection.length||(n.connection=[],Array.isArray(n.stream)&&n.stream.forEach(e=>{let t=e.connection;return n.connection.push(t)})));const r=(e,t)=>{e?P({reason:"GetSessionState",code:e.code,message:e.message,socketId:this.socketId}):P(void 0,t)};s.then(e=>{n.connection.some(t=>t.id===e.id)||n.connection.unshift(e);const t=(0,c.default)();A.registerCallback(t,r),A.emit("session#read",n,t)})})})},this.disconnect=function(){this.is("disconnected")||(L("disconnecting"),this._rumor.disconnect())},this.publish=function(e,t,n,r){r=r||function(){};const i=(0,a.default)(r),o=(0,c.default)();if(g.debug(`Publish (ID:${o}) ${e}`),this._rumor.readyState!==y.OPEN||this._rumor.reconnecting&&!n){const e=new Error("Not connected.");return e.code=500,i(e),void g.error("cannot publish until the socket is connected.")}return A.registerCallback(o,i),this._rumor.publish([h],e,(0,s.default)({},t,{"Content-Type":"application/x-raptor+v2","TRANSACTION-ID":o,"X-TB-FROM-ADDRESS":this._rumor.id}),n,(function(e){e&&i(...arguments)})),o},this.send=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=()=>{}),T.publish((0,u.default)(e),t,n,r)},this.streamCreate=function(e,t,n,r,i,o,s,a){const c={apiKey:C,sessionId:I,streamId:t,name:e,audioFallbackEnabled:n,channels:r,minBitrate:i,maxBitrate:o,sourceStreamId:s},u=b.streams.create(c);this.publish(u,{},!0,(e,n)=>{a(e,t,n)})},this.streamDestroy=function(e,t){this.publish(b.streams.destroy(C,I,e,t),{},!0)},this.streamChannelUpdate=function(e,t,n){this.publish(b.streamChannels.update(C,I,e,t,n),{},!0)},this.subscriberCreate=function(e,t,n,r,i,o){const s={apiKey:C,sessionId:I,streamId:e,subscriberId:t,connectionId:this._rumor.id,channelsToSubscribeTo:n,sourceStreamId:r,e2ee:i};this.publish(b.subscribers.create(s),{},!0,o)},this.subscriberDestroy=function(e,t){this.publish(b.subscribers.destroy(C,I,e,t),{},!0)},this.subscriberUpdate=function(e,t,n){this.publish(b.subscribers.update(C,I,e,t,n),{},!0)},this.subscriberChannelUpdate=function(e,t,n,r){this.publish(b.subscriberChannels.update(C,I,e,t,n,r),{},!0)},this.forceDisconnect=function(e,t){this.publish(b.connections.destroy({apiKey:C,sessionId:I,connectionId:e}),{},!0,t)},this.forceUnpublish=function(e,t){this.publish(b.streams.destroy(C,I,e),{},!0,t)},this.forceMuteStream=function(e,t){const n={streamId:e,active:!0};this.publish(b.forceMute.update((0,i.default)({},x,n)),{},!0,t)},this.forceMuteAll=function(e,t,n){const r={excludedStreamIds:e,active:t};this.publish(b.forceMute.update((0,i.default)({},x,r)),{},!0,n)},this.signal=function(e,t,n){const r=new E(I,this._rumor.id,e||{});r.valid?this.publish(r.toRaptorMessage(),{},r.retryAfterReconnect,e=>{let i,s,a;const c=[400,403,404,413,500];if(e){const t=parseInt(e.code,10);c.includes(t)?(s=t,a=e.message):(s=p.UNEXPECTED_SERVER_RESPONSE,a="Unexpected server response. Try this operation again later."),i=new S(s,a)}else{const e=r.data?typeof r.data:null;n("signal","send",{type:e})}t&&(0,o.default)(t)&&t(i,r.toHash())}):t&&(0,o.default)(t)&&t(new S(r.error.code,r.error.reason),r.toHash())},this.id=function(){return this._rumor&&this._rumor.id}};return _.hasIceRestartsCapability=f,_.hasRenegotiationCapability=h,_.hasE2eeCapability=m,_.RumorSocket=y,_};var i=r(n(20)),o=r(n(15)),s=r(n(9)),a=r(n(50)),c=r(n(19)),u=r(n(317)),d=r(n(712))}).call(this,n(0))},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=function(e){let t=(void 0===e?{}:e).WebSocket,n=void 0===t?u.default:t;const r=(0,o.default)(),d=(0,a.default)({EventEmitter:i.default,WebSocket:n,logging:s.default,allocateId:r});return(0,c.default)({EventEmitter:i.default,ReconnectableSocket:d,logging:s.default,allocateId:r})};var i=r(n(42)),o=r(n(713)),s=r(n(1)),a=r(n(714)),c=r(n(719)),u=r(n(724))},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(){let e=0;return()=>(e+=1,e)}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(7)),o=r(n(8)),s=r(n(160)),a=r(n(46)),c=r(n(61)),u=r(n(18)),d=r(n(318)),l=n(76),p=r(n(715)),f=r(n(63)),h=r(n(716)),m=r(n(718));const g=e=>function(){e(...arguments)},b=e=>1e3===e||e>=3e3&&e<=4999,v=l.codes.CLOSE_TIMEOUT;t.default=e=>{var t,n;let r=e.EventEmitter,l=e.WebSocket,y=e.logging,E=e.allocateId,S=e.BUFFER_DRAIN_INTERVAL,_=void 0===S?100:S,w=e.BUFFER_DRAIN_MAX_RETRIES,T=void 0===w?10:w;return n=t=function(e){function t(n){var r;const a="string"==typeof n?{url:n}:n,c=a.url,l=a.connectTimeout,f=void 0===l?15e3:l,m=a.pingThreshold,b=void 0===m?3e3:m,v=a.pingWarningDelay,S=void 0===v?100:v,_=a.disconnectThreshold,w=void 0===_?5900:_,T=a.reconnectMaxDuration,C=void 0===T?6e4:T;if(!c)throw new Error("Must provide url");r=e.call(this)||this,(0,u.default)((0,s.default)(r),"_url",void 0),(0,u.default)((0,s.default)(r),"_id",E()),(0,u.default)((0,s.default)(r),"_logger",y("ReconnectableSocket:"+r._id)),(0,u.default)((0,s.default)(r),"_webSocket",void 0),(0,u.default)((0,s.default)(r),"_connectTimer",void 0),(0,u.default)((0,s.default)(r),"_pingTimer",void 0),(0,u.default)((0,s.default)(r),"_pingWarningTimer",void 0),(0,u.default)((0,s.default)(r),"_disconnectTimer",void 0),(0,u.default)((0,s.default)(r),"_queuedMessages",[]),(0,u.default)((0,s.default)(r),"_draining",!1),r.readyStateMachine=(0,h.default)({reconnectMaxDuration:C,CLOSED:t.CLOSED,CLOSING:t.CLOSING}),r._url=c,(0,d.default)({logger:r._logger,obj:(0,s.default)(r),eventNames:["error","open","message","needsPing","reconnecting","reconnectAttempt","reconnectFailure","reconnected","close"]}),r.readyStateMachine.observe("onEnterOpen",e=>{let t=e.from;r._resetPingTimers(),r._resetDisconnectTimer(),r._connectTimer.clear(),"reconnecting"===t?(r._queuedMessages.forEach(e=>r.send(e,!0)),r._queuedMessages=[],r.emit("reconnected")):r.emit("open")}),r.readyStateMachine.observe("onEnterClosed",(e,t)=>{r.emit("close",t)}),r.readyStateMachine.observe("onEnterClosing",g(function(){var e=(0,o.default)(i.default.mark((function e(t,n){var o,s,a;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.from,s=n.code,a=n.reason,r._clearTimers(),e.next=5,r._clearSocket({drain:"open"===o,code:s,reason:a});case 5:"reconnecting"===o&&r.emit("reconnectFailure",{code:s,reason:a}),setTimeout(()=>{r.readyStateMachine.closed({code:s,reason:a})});case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}())),r.readyStateMachine.observe("onEnterReconnecting",()=>{r.emit("reconnecting")}),r.readyStateMachine.observe("onDisconnect",g(function(){var e=(0,o.default)(i.default.mark((function e(t,n){var o,s,a,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.from,s=t.to,a=n.code,c=n.reason,"reconnecting"!==s){e.next=10;break}if(!r._draining){e.next=5;break}return e.abrupt("return");case 5:return r._clearTimers(),r.emit("reconnectAttempt"),e.next=9,r._clearSocket({drain:"open"===o,code:a,reason:c});case 9:r._createSocket();case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()));const I=(e,t)=>new p.default({name:e,duration:t,logger:r._logger});return r._connectTimer=I("connect",f),r._pingTimer=I("ping",b),r._pingWarningTimer=I("pingWarning",S),r._disconnectTimer=I("disconnect",w),r._createSocket(),r}(0,c.default)(t,e),(0,a.default)(t,[{key:"url",get:function(){return"function"==typeof this._url?this._url():this._url}},{key:"reconnecting",get:function(){return"reconnecting"===this.readyStateMachine.state}},{key:"binaryType",get:function(){return this._webSocket.binaryType}},{key:"bufferedAmount",get:function(){return this._webSocket.bufferedAmount}},{key:"protocol",get:function(){return this._webSocket.protocol}},{key:"extensions",get:function(){return this._webSocket.extensions}},{key:"readyState",get:function(){return{reconnecting:t.OPEN,open:t.OPEN,closing:t.CLOSING,closed:t.CLOSED,connecting:t.CONNECTING}[this.readyStateMachine.state]}}]);var n=t.prototype;return n._createSocket=function(){const e=new l(this.url);e.binaryType="arraybuffer";const n=(0,f.default)(e);n.on("open",()=>{this.readyStateMachine.open()}),n.on("close",e=>{let t=e.code,n=e.reason;this.readyStateMachine.disconnect({code:t,reason:n})}),n.on("error",e=>{this.emit("error",e)}),n.on("message",e=>{this.readyState!==t.CLOSING&&this._resetDisconnectTimer(),this.emit("message",e)}),this._webSocket=e,this._webSocketEvents=n,this._connectTimer.reset(()=>{const e={code:v,reason:"Timeout while opening connection"},t=new Error(e.reason);t.code=v,this.emit("error",t),this.readyStateMachine.disconnect(e)})},n._clearSocket=function(){var e=(0,o.default)(i.default.mark((function e(n){var r,o,s,a,c;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(r=void 0===n?{}:n).drain,s=void 0!==o&&o,a=r.code,c=r.reason,this._draining=!0,this._webSocketEvents&&this._webSocketEvents.removeAll(),this._webSocket.readyState===t.CLOSED){e.next=8;break}if(!s){e.next=7;break}return e.next=7,(0,m.default)(this._webSocket,{BUFFER_DRAIN_INTERVAL:_,BUFFER_DRAIN_MAX_RETRIES:T});case 7:try{!b(a)||void 0===a&&void 0===c?this._webSocket.close():this._webSocket.close(a,c)}catch(e){y.error("Could not close websocket",e)}case 8:this._draining=!1;case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),n.send=function(e,n){void 0===n&&(n=!0),this.readyState===t.OPEN&&this._resetPingTimers();const r=()=>{try{return this._webSocket.send(e),"sent"}catch(e){if(this._webSocket.readyState===l.OPEN)return this._logger.debug("webSocket.send threw exception even though it was open:",e),"dropped";throw e}};if("reconnecting"===this.readyStateMachine.state){if(this._webSocket.readyState===l.OPEN)try{r()}catch(e){}return n?(this._queuedMessages.push(e),"queued"):(this._logger.debug("Dropping message during reconnection since retryAfterReconnect is false:",e),"dropped")}return r()},n.close=function(e,n){if(this.readyState===t.CLOSING)throw new Error("Can not call close on a closing ReconnectableSocket");if(this.readyState===t.CLOSED)throw new Error("Can not call close on an already closed ReconnectableSocket");this.readyStateMachine.close({code:e,reason:n})},n._resetPingTimers=function(){this._pingWarningTimer.clear(),this._pingTimer.reset(()=>{this._pingWarningTimer.reset(()=>{this._logger.warn("Did not send message after needsPing event. Other side may disconnect.")}),this.emit("needsPing")})},n._resetDisconnectTimer=function(){this._disconnectTimer.reset(()=>this.readyStateMachine.disconnect({code:v,reason:"No activity"}))},n._clearTimers=function(){[this._disconnectTimer,this._connectTimer,this._pingTimer,this._pingWarningTimer].forEach(e=>e.clear())},t}(r),(0,u.default)(t,"CONNECTING",l.CONNECTING),(0,u.default)(t,"OPEN",l.OPEN),(0,u.default)(t,"CLOSING",l.CLOSING),(0,u.default)(t,"CLOSED",l.CLOSED),n}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(18));let o=function(){function e(e){let t=e.name,n=e.logger,r=e.duration;(0,i.default)(this,"name",void 0),(0,i.default)(this,"logger",void 0),(0,i.default)(this,"duration",void 0),(0,i.default)(this,"currId",void 0),this.name=t,this.logger=n,this.duration=r}var t=e.prototype;return t.reset=function(e){this.clear();const t=setTimeout(()=>{void 0!==this.currId&&(this.logger.spam(`${this.name} timer with id ${this.currId} expired, entering callback`),this.currId=void 0,e())},this.duration);this.currId=t,this.logger.spam(`Started ${this.name} timer with id ${this.currId}, expires in `+this.duration+"ms")},t.clear=function(){void 0!==this.currId&&(clearTimeout(this.currId),this.logger.spam(`Cleared ${this.name} timer with id ${this.currId}`),this.currId=void 0)},t.isRunning=function(){return void 0!==this.currId},e}();t.default=o},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(309)),o=r(n(717)),s=n(76);const a=(0,r(n(1)).default)("ReconnectableSocketStateMachine"),c=s.codes.CLOSE_UNSUPPORTED,u=s.codes.CLOSE_UNEXPECTED_CONDITION;t.default=e=>{let t,n=e.reconnectMaxDuration,r=e.CLOSED,s=e.CLOSING;return new i.default({init:"connecting",methods:{onInvalidTransition(e,t,n){a.error("Invalid state transition",{transition:e,from:t,to:n})}},transitions:[{name:"open",from:["connecting","reconnecting"],to:"open"},{name:"close",from:["connecting","reconnecting","open"],to:"closing"},{name:"closed",from:"closing",to:"closed"},{name:"disconnect",from:["reconnecting","open","connecting"],to:function(e){let i=e.code;return"open"!==this.state&&t||(t=(0,o.default)(n)),n>0&&!t()&&-1===[c,u].indexOf(i)&&-1===[r,s].indexOf(this.readyState)?"reconnecting":"closing"}}]})}},function(e,t,n){"use strict";e.exports=e=>{let t=!1;return setTimeout(()=>{t=!0},e),()=>t}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(7)),o=r(n(8)),s=r(n(107)),a=function(){var e=(0,o.default)(i.default.mark((function e(t,n){var r,o,a,c,u,d;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=(r=void 0===n?{}:n).BUFFER_DRAIN_INTERVAL,a=void 0===o?100:o,c=r.BUFFER_DRAIN_MAX_RETRIES,u=void 0===c?10:c,d=0;case 2:if(!(d<u)){e.next=10;break}if(0!==t.bufferedAmount){e.next=5;break}return e.abrupt("break",10);case 5:return e.next=7,(0,s.default)(a);case 7:d+=1,e.next=2;break;case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();t.default=a},function(e,t,n){"use strict";var r=n(109),i=n(2);t.__esModule=!0,t.default=void 0;var o=i(n(160)),s=i(n(46)),a=i(n(61)),c=i(n(18)),u=i(n(19)),d=i(n(318)),l=i(n(720)),p=r(n(175)),f=i(n(723)),h=n(76);t.default=e=>{var t,n;let r=e.EventEmitter,i=e.ReconnectableSocket,m=e.logging,g=e.allocateId;return n=t=function(e){function t(t){var n;let r=t.messagingURL,s=t.notifyDisconnectAddress,a=t.connectionId,p=t.enableReconnection,b=t.pingThreshold,v=void 0===b?2e3:b,y=t.disconnectThreshold,E=void 0===y?(p?3:25)*v-100:y,S=t.reconnectMaxDuration,_=void 0===S?p?6e4:0:S;n=e.call(this)||this,(0,c.default)((0,o.default)(n),"url",void 0),(0,c.default)((0,o.default)(n),"id",void 0),(0,c.default)((0,o.default)(n),"_opened",!1),(0,c.default)((0,o.default)(n),"_socket",void 0),(0,c.default)((0,o.default)(n),"_reconnectAttempts",0),(0,c.default)((0,o.default)(n),"_socketID",(0,u.default)()),(0,c.default)((0,o.default)(n),"_receivedTransactionIDs",[]),(0,c.default)((0,o.default)(n),"_notifyDisconnectAddress",void 0),(0,c.default)((0,o.default)(n),"_enableReconnection",void 0),(0,c.default)((0,o.default)(n),"_pendingMessages",[]),(0,c.default)((0,o.default)(n),"_logger",m("RumorSocket:"+g())),(0,d.default)({logger:n._logger,obj:(0,o.default)(n),eventNames:["open","message","error","reconnecting","reconnectAttempt","reconnectFailure","reconnected","close"]}),n.url=r,n.id=a,n._notifyDisconnectAddress=s,n._enableReconnection=p,n.on("error",e=>{n._logger.error(e.message)});try{n._socket=new i({url:()=>n._enableReconnection?[n.url,n.url.indexOf("?")>=0?"&":"?","socketId="+n._socketID,n._socket&&n._socket.reconnecting?"&reconnect=true":"","&attempt="+(0,u.default)()].join(""):n.url,pingThreshold:v,disconnectThreshold:E,reconnectMaxDuration:_})}catch(e){n._logger.error(e),n.emit("error",new f.default(h.codes.CLOSE_CONNECT_EXCEPTION))}const w=()=>{n._opened=!0,n._socket.send(l.default.Connect(n.id,s).serialize()),n.emit("open",n.id)};return n._socket.once("open",w),n._socket.on("message",e=>n._receiveMessage(e)),n._socket.once("close",e=>{n._logger.debug(`ReconnectableSocket closed (code: ${e.code})`),n._clearPendingMessages();-1===[h.codes.CLOSE_NORMAL,h.codes.CLOSE_GOING_AWAY,h.codes.CLOSE_TIMEOUT].indexOf(e.code)&&n.emit("error",new f.default(e.code,e.reason||e.message)),n.emit("close",e)}),n._socket.on("error",e=>{let t=e.code;return n.emit("error",new f.default(t))}),n._socket.on("needsPing",()=>{n._socket.send(l.default.Ping().serialize())}),n._socket.on("reconnecting",()=>{n._opened&&(n._clearPendingMessagesWhichShouldntRetry(),n.emit("reconnecting"),n._reconnectAttempts=0)}),n._socket.on("reconnectAttempt",()=>{n._opened&&(n._reconnectAttempts+=1,n._socket.send(l.default.Disconnect("1").serialize(),!1),n.emit("reconnectAttempt"))}),n._socket.on("reconnected",()=>{n._opened?(n._pendingMessages.forEach(e=>{n._socket.send(e.rumorMessage.serialize())}),n.emit("reconnected")):w()}),n._socket.on("reconnectFailure",()=>{n._opened&&(n._logger.debug("Reconnecting failed as connectivity was not restored within "+_+"ms"),n.emit("reconnectFailure",new f.default))}),n}(0,a.default)(t,e),(0,s.default)(t,[{key:"readyState",get:function(){return this._socket?this._socket.readyState:i.CONNECTING}},{key:"reconnecting",get:function(){return this._opened&&this._socket&&this._socket.reconnecting}}]);var n=t.prototype;return n._clearPendingMessagesWhichShouldntRetry=function(){const e=this._pendingMessages.filter(e=>!e.retryAfterReconnect);this._pendingMessages=this._pendingMessages.filter(e=>e.retryAfterReconnect),e.forEach(e=>{const t=new Error("Not connected.");t.code=500,e.completion(t)})},n._clearPendingMessages=function(){this._pendingMessages.forEach(e=>{const t=new Error("Not connected.");t.code=500,e.completion(t)}),this._pendingMessages=[]},n._sendAck=function(e){this._socket.send(l.default.Status([e.fromAddress],{"TRANSACTION-ID":e.headers["TRANSACTION-ID"],"X-TB-FROM-ADDRESS":this.id}).serialize())},n._receiveMessage=function(e){const t=l.default.deserialize(e.data);if(t.type!==p.PONG){if(this._logger.debug("Received:",t),t.transactionId&&(this._pendingMessages=this._pendingMessages.filter(e=>(e.rumorMessage.transactionId===t.transactionId&&(this._logger.debug("Marking",t.transactionId," as received"),e.completion(void 0,t)),e.rumorMessage.transactionId!==t.transactionId))),t.transactionId&&t.type!==p.STATUS){if(this._sendAck(t),this._receivedTransactionIDs.indexOf(t.transactionId)>=0)return;this._receivedTransactionIDs.push(t.transactionId)}this.emit("message",t)}},n.publish=function(e,t,n,r,i){void 0===i&&(i=()=>{});const o=l.default.Publish(e,t,n);if("dropped"===this._socket.send(o.serialize(),!1)&&!r){const e=new Error("Not connected.");return e.code=500,void i(e)}this._pendingMessages.push({rumorMessage:o,retryAfterReconnect:r,completion:i})},n.subscribe=function(e){this._socket.send(l.default.Subscribe(e).serialize())},n.unsubscribe=function(e){this._socket.send(l.default.Unsubscribe(e).serialize())},n.disconnect=function(){if(this.readyState===t.OPEN&&this._socket.send(l.default.Disconnect().serialize()),this._socket.readyState!==i.CLOSED&&this._socket.readyState!==i.CLOSING){const e=h.codes.CLOSE_NORMAL;this._socket.close(e,h.messages[e])}},n.status=function(e,t){this._socket.send(l.default.Status(e,{"TRANSACTION-ID":t,"X-TB-FROM-ADDRESS":this.id}).serialize())},n.reconnectRetriesCount=function(){return this._reconnectAttempts},n.messageQueueSize=function(){return this._pendingMessages.length},(0,s.default)(t,[{key:"socketID",get:function(){return this._socketID}}]),t}(r),(0,c.default)(t,"CONNECTING",i.CONNECTING),(0,c.default)(t,"OPEN",i.OPEN),(0,c.default)(t,"CLOSING",i.CLOSING),(0,c.default)(t,"CLOSED",i.CLOSED),n}},function(e,t,n){"use strict";var r=n(109),i=n(2);t.__esModule=!0,t.default=void 0;var o=i(n(18)),s=i(n(19)),a=n(721),c=r(n(175));let u=function(){function e(e,t,n,r){(0,o.default)(this,"type",void 0),(0,o.default)(this,"toAddress",void 0),(0,o.default)(this,"headers",void 0),(0,o.default)(this,"data",void 0),this.type=e,this.toAddress=t,this.headers=n,this.data=r,this.fromAddress=this.headers["X-TB-FROM-ADDRESS"],this.transactionId=this.headers["TRANSACTION-ID"],this.status=this.headers.STATUS,this.isError=this.status&&"2"!==this.status[0]}return e.prototype.serialize=function(){let e,t,n,r,i=8,o=7;const s=[],c=[],u=[];for(o++,n=0;n<this.toAddress.length;n++)s.push(new a.TextEncoder("utf-8").encode(this.toAddress[n])),o+=2,o+=s[n].length;o++,n=0;for(const e in this.headers)this.headers.hasOwnProperty(e)&&(c.push(new a.TextEncoder("utf-8").encode(e)),u.push(new a.TextEncoder("utf-8").encode(this.headers[e])),o+=4,o+=c[n].length,o+=u[n].length,n++);t=new a.TextEncoder("utf-8").encode(this.data),o+=t.length;const d=new ArrayBuffer(o),l=new Uint8Array(d,0,o);for(o-=4,l[0]=(4278190080&o)>>>24,l[1]=(16711680&o)>>>16,l[2]=(65280&o)>>>8,l[3]=(255&o)>>>0,l[4]=0,l[5]=0,l[6]=this.type,l[7]=this.toAddress.length,n=0;n<s.length;n++)for(e=s[n],l[i++]=e.length>>8&255,l[i++]=e.length>>0&255,r=0;r<e.length;r++)l[i++]=e[r];for(l[i++]=c.length,n=0;n<c.length;n++){for(e=c[n],l[i++]=e.length>>8&255,l[i++]=e.length>>0&255,r=0;r<e.length;r++)l[i++]=e[r];for(e=u[n],l[i++]=e.length>>8&255,l[i++]=e.length>>0&255,r=0;r<e.length;r++)l[i++]=e[r]}for(n=0;n<t.length;n++)l[i++]=t[n];return d},e.deserialize=function(t){let n,r,i,o,s,c,u,d;(void 0!==typeof window?window:global).Buffer&&(void 0!==typeof window?window:global).Buffer.isBuffer(t)&&(t=(e=>{const t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0;t<e.length;++t)n[t]=e[t];return t})(t));let l=8;const p=new Uint8Array(t);n=p[6];const f=[];for(d=0;d<p[7];d++)u=p[l++]<<8,u+=p[l++],r=new Uint8Array(t,l,u),f[d]=new a.TextDecoder("utf-8").decode(r),l+=u;for(i=p[l++],o={},d=0;d<i;d++)u=p[l++]<<8,u+=p[l++],r=new Uint8Array(t,l,u),s=new a.TextDecoder("utf-8").decode(r),l+=u,u=p[l++]<<8,u+=p[l++],r=new Uint8Array(t,l,u),c=new a.TextDecoder("utf-8").decode(r),o[s]=c,l+=u;const h=new Uint8Array(t,l);return new e(n,f,o,new a.TextDecoder("utf-8").decode(h))},e.Connect=function(t,n){const r={uniqueId:t,"TRANSACTION-ID":(0,s.default)(),notifyDisconnectAddress:n};return new e(c.CONNECT,[],r,"")},e.Disconnect=function(t){return new e(c.DISCONNECT,[],{reconnect:t},"")},e.Subscribe=function(t){return new e(c.SUBSCRIBE,t,{},"")},e.Unsubscribe=function(t){return new e(c.UNSUBSCRIBE,t,{},"")},e.Publish=function(t,n,r){return new e(c.MESSAGE,t,r||{},n||"")},e.Status=function(t,n){return new e(c.STATUS,t,n||{},"")},e.Ping=function(){return new e(c.PING,[],{},"")},e}();t.default=u},function(e,t,n){"use strict";var r=n(109);t.__esModule=!0,t.TextDecoder=t.TextEncoder=void 0;var i=r(n(722));const o=(void 0!==typeof window?window:global).TextEncoder||i.TextEncoder;t.TextEncoder=o;const s=(void 0!==typeof window?window:global).TextDecoder||i.TextDecoder;t.TextDecoder=s},function(e,t,n){"use strict";function r(e,t,n){return t<=e&&e<=n}function i(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}n.r(t),n.d(t,"TextEncoder",(function(){return c})),n.d(t,"TextDecoder",(function(){return a}));function o(e){this.tokens=[].slice.call(e)}o.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};function s(e,t){if(e)throw TypeError("Decoder error");return t||65533}function a(e,t){if(!(this instanceof a))return new a(e,t);if("utf-8"!==(e=void 0!==e?String(e).toLowerCase():"utf-8"))throw new Error("Encoding not supported. Only utf-8 is supported");t=i(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(t.fatal),this._ignoreBOM=Boolean(t.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function c(e,t){if(!(this instanceof c))return new c(e,t);if("utf-8"!==(e=void 0!==e?String(e).toLowerCase():"utf-8"))throw new Error("Encoding not supported. Only utf-8 is supported");t=i(t),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(t.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function u(e){var t=e.fatal,n=0,i=0,o=0,a=128,c=191;this.handler=function(e,u){if(-1===u&&0!==o)return o=0,s(t);if(-1===u)return-1;if(0===o){if(r(u,0,127))return u;if(r(u,194,223))o=1,n=u-192;else if(r(u,224,239))224===u&&(a=160),237===u&&(c=159),o=2,n=u-224;else{if(!r(u,240,244))return s(t);240===u&&(a=144),244===u&&(c=143),o=3,n=u-240}return n<<=6*o,null}if(!r(u,a,c))return n=o=i=0,a=128,c=191,e.prepend(u),s(t);if(a=128,c=191,n+=u-128<<6*(o-(i+=1)),i!==o)return null;var d=n;return n=o=i=0,d}}function d(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(r(t,0,127))return t;var n,i;r(t,128,2047)?(n=1,i=192):r(t,2048,65535)?(n=2,i=224):r(t,65536,1114111)&&(n=3,i=240);for(var o=[(t>>6*n)+i];n>0;){var s=t>>6*(n-1);o.push(128|63&s),n-=1}return o}}a.prototype={decode:function(e,t){var n;n="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=i(t),this._streaming||(this._decoder=new u({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var r,s=new o(n),a=[];!s.endOfStream()&&-1!==(r=this._decoder.handler(s,s.read()));)null!==r&&(Array.isArray(r)?a.push.apply(a,r):a.push(r));if(!this._streaming){do{if(-1===(r=this._decoder.handler(s,s.read())))break;null!==r&&(Array.isArray(r)?a.push.apply(a,r):a.push(r))}while(!s.endOfStream());this._decoder=null}return a.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.shift()):this._BOMseen=!0)),function(e){for(var t="",n=0;n<e.length;++n){var r=e[n];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode(55296+(r>>10),56320+(1023&r)))}return t}(a)}},c.prototype={encode:function(e,t){e=e?String(e):"",t=i(t),this._streaming||(this._encoder=new d(this._options)),this._streaming=Boolean(t.stream);for(var n,r=[],s=new o(function(e){for(var t=String(e),n=t.length,r=0,i=[];r<n;){var o=t.charCodeAt(r);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(r===n-1)i.push(65533);else{var s=e.charCodeAt(r+1);if(56320<=s&&s<=57343){var a=1023&o,c=1023&s;i.push(65536+(a<<10)+c),r+=1}else i.push(65533)}r+=1}return i}(e));!s.endOfStream()&&-1!==(n=this._encoder.handler(s,s.read()));)Array.isArray(n)?r.push.apply(r,n):r.push(n);if(!this._streaming){for(;-1!==(n=this._encoder.handler(s,s.read()));)Array.isArray(n)?r.push.apply(r,n):r.push(n);this._encoder=null}return new Uint8Array(r)}}},function(e,t,n){"use strict";var r=n(109),i=n(2);t.__esModule=!0,t.default=void 0;var o=i(n(18)),s=r(n(76));t.default=function(e,t){void 0===e&&(e=s.codes.CLOSE_FALLBACK_CODE),void 0===t&&(t=s.messages[e]||"No message available from code."),(0,o.default)(this,"code",void 0),(0,o.default)(this,"message",void 0),this.code=e,this.message=t}},function(e,t,n){"use strict";var r=n(2);t.__esModule=!0,t.default=void 0;var i=r(n(725)),o=(void 0!==typeof window?window:global).WebSocket?(void 0!==typeof window?window:global).WebSocket:i.default;t.default=o},function(e,t,n){"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},function(e,t,n){"use strict";const r=n(727);e.exports=function(e){const t=r(e.data);return t.transactionId=e.transactionId,t.fromAddress=e.headers["X-TB-FROM-ADDRESS"],t}},function(e,t,n){"use strict";e.exports=function(e){if(0===e.length)return{};const t=JSON.parse(e),n=t.uri.substr(1).split("/");n.shift(),""===n[n.length-1]&&n.pop(),t.params={};for(let e=0,r=n.length;e<r-1;e+=2)t.params[n[e]]=n[e+1];return n.length%2==0?"channel"===n[n.length-2]&&n.length>6?t.resource=`${n[n.length-4]}_${n[n.length-2]}`:t.resource=n[n.length-2]:"channel"===n[n.length-1]&&n.length>5?t.resource=`${n[n.length-3]}_${n[n.length-1]}`:t.resource=n[n.length-1],t.signature=`${t.resource}#${t.method}`,t}},function(e,t,n){"use strict";const r=n(3).name,i=n(51).once;e.exports=()=>i()&&["Chrome","Firefox","Safari"].indexOf(r)>-1},function(e,t,n){"use strict";const r=n(3),i=n(51).once;e.exports=()=>i()&&("Chrome"===r.name||"Firefox"===r.name||"Node"===r.name||"Safari"===r.name||"Edge"===r.name)},function(e,t,n){"use strict";const r=n(51).once;e.exports=()=>r()},function(e,t,n){"use strict";e.exports="DTLS_SRTP"},function(e,t,n){"use strict";e.exports=function(e){let t=e.supportsWebRTC;return{supportsWebRTC:"true"===t||!0===t}}},function(e,t,n){"use strict";e.exports=function(e,t){this.code=e,this.message=t,this.reason=t}},function(e,t,n){"use strict";e.exports=function(e){const t=[];this.enqueue=function(){t.push(Array.prototype.slice.call(arguments))},this.triggerAll=function(){let n;for(;n=t.shift();)e.trigger(...n)}}},function(e,t,n){"use strict";var r=n(2)(n(20));const i=n(210),o=n(243),s=n(58),a=n(9),c=n(100),u=n(10),d=n(736),l=n(737),p=n(291).default,f={EMPTY_RESPONSE:"Response body was empty, probably due to connectivity loss",BADLY_FORMED:"Unknown error: JSON response was badly formed",NO_ERROR:"No error message",UNEXPECTED_SERVER_RESPONSE:e=>`Unexpected server response (${e}). Try this operation again later.`},h=[0,600,1200];e.exports=function(e){let t=void 0===e?{}:e,n=t.axios,m=void 0===n?i:n,g=t.retryDelays,b=void 0===g?h:g;return p((function(e){let t=e.anvilUrl,n=e.sessionId,i=e.token,p=e.clientVersion,h=e.connectionId;const g=o.parse(t,!0),b=o.format({protocol:g.protocol,auth:g.auth,host:g.host,pathname:o.resolve((g.pathname||"").replace(/\/?$/,"/"),"session/"+n),query:(0,r.default)({},g.query,{extended:!0})});return m.get(b,{validateStatus:e=>e>=200&&e<300,headers:{"X-OPENTOK-AUTH":i,"X-TB-VERSION":1,"X-TB-CLIENT-VERSION":p,"X-TB-CONNECTIONID":h,Accept:"application/json"}}).catch(e=>{if(e.response){const t=new Error(f.UNEXPECTED_SERVER_RESPONSE(`${e.response.statusCode}${e.response.status?" "+e.response.status:""}`));throw t.code=u.ANVIL_INVALID_HTTP_STATUS,t.name=d(t.code),t}if(e.request){const e=new Error(f.CONNECT_FAILED);throw e.code=u.ANVIL_CONNECT_FAILED,e.name=d(e.code),e}{const t=u.ANVIL_UNKNOWN_HTTP_ERROR,n=d(e.code);throw a(e,{code:t,name:n}),e}}).then(e=>{let t=e.data;if("string"==typeof t){if(t.length>0)try{JSON.parse(t)}catch(e){throw e.message=f.UNEXPECTED_SERVER_RESPONSE(e.toString()),e.code=u.ANVIL_XDOMAIN_OR_PARSING_ERROR,e.name=d(e.code),e}const e=new Error(0===t.length?f.EMPTY_RESPONSE:f.BADLY_FORMED);throw e.code=0===t.length?u.ANVIL_EMPTY_RESPONSE_BODY:u.ANVIL_BADLY_FORMED_RESPONSE,e.name=d(e.code),e}if(null===t||0===t.length){const e=new Error(f.EMPTY_RESPONSE);throw e.code=u.ANVIL_EMPTY_RESPONSE_BODY,e.name=d(e.code),e}const n=t.filter(e=>null!=e.error)[0];if(n){const e=l(s(n,"error.code","500"));"Invalid token format"===s(n,"error.errorMessage.message")&&(n.error.errorMessage.message+=" Token: "+i);const t=new Error(s(n,"error.errorMessage.message",void 0===e?"Unknown error: "+n.error.code:f.NO_ERROR));throw t.code=e||u.ANVIL_UNEXPECTED_ERROR_CODE,t.name=d(t.code),t}return new c(t[0])})}),(e,t)=>e.code&&e.code>=3e3&&e.code<=3007&&b[t])}},function(e,t,n){"use strict";const r=n(10),i=n(4),o={[r.ANVIL_BADLY_FORMED_RESPONSE]:i.BADLY_FORMED_RESPONSE,[r.ANVIL_INVALID_HTTP_STATUS]:i.INVALID_HTTP_STATUS,[r.ANVIL_XDOMAIN_OR_PARSING_ERROR]:i.XDOMAIN_OR_PARSING_ERROR,[r.ANVIL_UNKNOWN_HTTP_ERROR]:i.UNKNOWN_HTTP_ERROR,[r.ANVIL_UNEXPECTED_ERROR_CODE]:i.UNEXPECTED_ERROR_CODE,[r.ANVIL_EMPTY_RESPONSE_BODY]:i.EMPTY_RESPONSE_BODY,[r.ANVIL_CONNECT_FAILED]:i.CONNECT_FAILED,[r.AUTHENTICATION_ERROR]:i.AUTHENTICATION_ERROR,[r.INVALID_SESSION_ID]:i.INVALID_SESSION_ID,[r.TERMS_OF_SERVICE_FAILURE]:i.TERMS_OF_SERVICE_FAILURE,[r.UNEXPECTED_SERVER_RESPONSE]:i.UNEXPECTED_SERVER_RESPONSE};e.exports=function(e){return o[e]}},function(e,t,n){"use strict";const r=n(10),i={400:r.INVALID_SESSION_ID,403:r.AUTHENTICATION_ERROR,404:r.INVALID_SESSION_ID,409:r.TERMS_OF_SERVICE_FAILURE,500:r.UNEXPECTED_SERVER_RESPONSE};e.exports=function(e){return i[e]}},function(e,t,n){"use strict";e.exports=function(e){void 0===e&&(e={});const t=e.Session||n(314)(),r=e.sessionObjects||n(21);return function(e,n,i){null==n&&(n=e,e=null),Array.isArray(n)&&1===n.length&&(n=n[0]);let o=r.sessions.get(n);return o||(o=new t(e,n,i),r.sessions.add(o)),o}}},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8));const s=n(740),a=n(275),c=n(3),u=n(4),d=n(10),l=n(13)(),p=n(52),f=n(73),h=n(143)(void 0!==typeof window?window:global);function m(e){return a(s(e,["AV1X","AV1","VP9","rtx","red","ulpfec","H265","X-H264UC","x-ulpfecuc"]))}const g=function(){var e=(0,o.default)(i.default.mark((function e(){var t,n,r,o,s,a,g;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof window){e.next=2;break}return e.abrupt("return",{videoEncoders:[],videoDecoders:[]});case 2:if(t=h.RTCPeerConnection,!window.RTCRtpSender||!("getCapabilities"in window.RTCRtpSender)){e.next=7;break}return n=m(n=window.RTCRtpSender.getCapabilities("video").codecs.map(e=>e.mimeType||e.name).map(e=>e.replace("video/",""))),e.abrupt("return",{videoEncoders:n,videoDecoders:n});case 7:if("Chrome"!==c.name||"captureStream"in window.HTMLCanvasElement.prototype){e.next=9;break}return e.abrupt("return",{videoEncoders:["VP8"],videoDecoders:["VP8"]});case 9:if(!c.isLegacyEdge){e.next=11;break}return e.abrupt("return",{videoEncoders:["H264","VP8"],videoDecoders:["H264","VP8"]});case 11:return(r=window.document.createElement("canvas")).getContext("2d"),o=r.captureStream(),e.prev=14,a={iceServers:[]},f()&&(a.sdpSemantics="plan-b"),(s=new t(a)).addTrack?s.addTrack(o.getVideoTracks()[0],o):s.addStream&&s.addStream(o),e.next=21,s.createOffer();case 21:return g=e.sent,n=m(n=p.getCodecs(g.sdp,"video")||[]),e.abrupt("return",{videoEncoders:n,videoDecoders:n});case 27:throw e.prev=27,e.t0=e.catch(14),l(u.UNABLE_TO_ACCESS_MEDIA_ENGINE,new Error("OT.getSupportedCodecs was not able to get the list of supported codecs"),d.UNABLE_TO_ACCESS_MEDIA_ENGINE);case 30:return e.prev=30,s.close(),e.finish(30);case 33:case"end":return e.stop()}}),e,null,[[14,27,30,33]])})));return function(){return e.apply(this,arguments)}}();e.exports=g},function(e,t,n){var r=n(741),i=n(241),o=n(87),s=n(130),a=o((function(e,t){return s(e)?r(e,i(t,1,s,!0)):[]}));e.exports=a},function(e,t,n){var r=n(92),i=n(93),o=n(129),s=n(33),a=n(68),c=n(94);e.exports=function(e,t,n,u){var d=-1,l=i,p=!0,f=e.length,h=[],m=t.length;if(!f)return h;n&&(t=s(t,a(n))),u?(l=o,p=!1):t.length>=200&&(l=c,p=!1,t=new r(t));e:for(;++d<f;){var g=e[d],b=null==n?g:n(g);if(g=u||0!==g?g:0,p&&b==b){for(var v=m;v--;)if(t[v]===b)continue e;h.push(g)}else l(t,b,u)||h.push(g)}return h}},function(e,t,n){"use strict";const r=n(24)().getInputMediaDevices;e.exports=function(e){r().then(t=>e(void 0,t),e)}},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8));e.exports=function(e){void 0===e&&(e={});const t=e.deviceHelpers||n(24)(),r=t.hasAudioOutputApiSupport,s=t.hasDevice,a=e.getAudioOutputDevices||n(325),c=e.updateSubscribersSinkId||n(327),u=n(13)(),d=n(4);return function(){var e=(0,o.default)(i.default.mark((function e(t){var n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r()){e.next=2;break}throw u(d.UNSUPPORTED_BROWSER,new Error("setAudioOutputDevice is not supported in your browser."));case 2:return e.next=4,a();case 4:if(n=e.sent,s(n,t)){e.next=8;break}throw u(d.INVALID_AUDIO_OUTPUT_SOURCE,new Error("The requested device is not valid."));case 8:return e.prev=8,e.next=11,c(t);case 11:e.next=16;break;case 13:throw e.prev=13,e.t0=e.catch(8),u(d.REQUESTED_DEVICE_PERMISSION_DENIED,new Error("No permission to use the requested device."));case 16:case"end":return e.stop()}}),e,null,[[8,13]])})));return function(t){return e.apply(this,arguments)}}()}},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8));const s=n(745)(),a=n(24)(),c=a.hasAudioOutputApiSupport,u=a.getNativeMediaDevices;e.exports=()=>{if(c()){const e=u();let t=!1;e.addEventListener("devicechange",(0,o.default)(i.default.mark((function e(){return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=2;break}return e.abrupt("return");case 2:return t=!0,e.next=5,s();case 5:t=!1;case 6:case"end":return e.stop()}}),e)}))))}}},function(e,t,n){"use strict";var r=n(2),i=r(n(7)),o=r(n(8));e.exports=function(e){void 0===e&&(e={});const t=e.deviceHelpers||n(24)(),r=t.getAudioOutputMediaDevices,s=t.getDefaultAudioOutputDeviceId,a=t.hasDevice,c=e.currentAudioOutputDevice||n(106),u=c.getCurrentAudioOutputDeviceId,d=c.setCurrentAudioOutputDeviceId,l=e.updateSubscribersSinkId||n(327),p=e.logging||n(1)("currentAudioOutputDevice");return function(){var e=(0,o.default)(i.default.mark((function e(){var t,n;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r();case 2:if(0!==(t=e.sent).length){e.next=6;break}return d(""),e.abrupt("return");case 6:if(!a(t,u())){e.next=9;break}return e.abrupt("return");case 9:return n=s(t),d(n),e.prev=11,e.next=14,l(n);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(11),p.debug("Failed to set the default audio output device.",e.t0);case 19:case"end":return e.stop()}}),e,null,[[11,16]])})));return function(){return e.apply(this,arguments)}}()}}])}));
|
|
29
49
|
//# sourceMappingURL=opentok.min.js.map
|